@applitools/nlp-web-runner 5.17.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_inline/_chunks/rolldown-runtime-D7D4PA-g.js +1 -1
- package/dist/_inline/_externals/nlp-runner.externals.json +3 -1
- package/dist/_inline/assets/index-DDs3RDNV.html +10 -0
- package/dist/_inline/assets/mock-FmX1aJGy.html +36 -0
- package/dist/_inline/assets/{session-replay-CIK-O8Jw.js → session-replay-BbzxeL6s.js} +3 -3
- package/dist/_inline/nlp-runner/web/index.d.ts +1020 -557
- package/dist/_inline/nlp-runner/web/index.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as j}from'../../_chunks/rolldown-runtime-D7D4PA-g.js';import{debuglog,inspect,styleText}from'node:util';import{basename}from'node:path';import{once,setMaxListeners}from'node:events';import{colornames}from'color-name-list/short';import T from'parse-color';import{differenceHyab,nearest,parse,rgb}from'culori';import{readFileSync}from'node:fs';import{execFileSync}from'node:child_process';import{Agent,Headers,Request,Socks5ProxyAgent,WebSocket,buildConnector,fetch as z}from'undici';import{Buffer as N}from'node:buffer';import{Readable}from'node:stream';import{buffer}from'node:stream/consumers';import{setImmediate,setTimeout as o}from'node:timers/promises';import{nextTick}from'node:process';import{harFromMessages}from'chrome-har';import{XMLBuilder,XMLParser,XMLValidator}from'fast-xml-parser';import{readFile}from'node:fs/promises';const contextProxyHandler={'has'(B,Q){return B['data']['has'](Q)||Reflect['has'](B,Q);},'get'(B,Q){if(B['data']['has'](Q))return B['own'](),B['accessedKeys']['add'](Q),B['data']['get'](Q);else return Reflect['get'](B,Q);},'set'(B,Q,a){return B['own'](),B['mutatedKeys']['add'](Q),B['data']['set'](Q,a),!![];},'deleteProperty'(B,Q){return B['own'](),B['mutatedKeys']['add'](Q),B['data']['delete'](Q);},'ownKeys'(B){return Array['from'](B['data']['keys']());}};var Context=class Context{['data']=new Map();['accessedKeys']=new Set();['mutatedKeys']=new Set();['sharedData']=![];get['accessed'](){return this['accessedKeys']['size']>0x0;}get['mutated'](){return this['mutatedKeys']['size']>0x0;}get['self'](){return this;}constructor(){return new Proxy(this,contextProxyHandler);}['share'](){const B=this['self'];return B['sharedData']=!![],{'data':B['data'],'accessedKeys':B['accessedKeys'],'mutatedKeys':B['mutatedKeys']};}static['materialize'](B){const Q=Object['create'](Context['prototype']);return Q['data']=B['data'],Q['accessedKeys']=B['accessedKeys'],Q['mutatedKeys']=B['mutatedKeys'],Q['sharedData']=!![],new Proxy(Q,contextProxyHandler);}['has'](B){return this['data']['has'](B);}['own'](){if(!this['sharedData'])return;this['data']=new Map(this['data']),this['accessedKeys']=new Set(this['accessedKeys']),this['mutatedKeys']=new Set(this['mutatedKeys']),this['sharedData']=![];}['refresh'](){const B=this['self'];B['own'](),B['data']['forEach']((Q,a)=>{if(!B['accessedKeys']['has'](a)&&!B['mutatedKeys']['has'](a))B['data']['delete'](a);}),B['accessedKeys']['clear'](),B['mutatedKeys']['clear']();}['clone'](){const B=this['self'],Q=Object['create'](Context['prototype']);return Q['data']=B['data'],Q['accessedKeys']=B['accessedKeys'],Q['mutatedKeys']=B['mutatedKeys'],Q['sharedData']=!![],B['sharedData']=!![],new Proxy(Q,contextProxyHandler);}};const collectionsProxyHandler={'has'(B,Q){return B['collections']['has'](Q)||Reflect['has'](B,Q);},'get'(B,Q){if(!B['collections']['has'](Q)&&Reflect['has'](B,Q))return Reflect['get'](B,Q);B['own']();let a=B['collections']['get'](Q);return a===void 0x0&&(a=new Collection(),B['collections']['set'](Q,a)),a;},'set'(B,Q,a){return B['own'](),B['collections']['set'](Q,a),!![];},'deleteProperty'(B,Q){return B['own'](),B['collections']['delete'](Q);}};var Collections=class Collections{['collections']=new Map();['sharedData']=![];get['self'](){return this;}constructor(){return new Proxy(this,collectionsProxyHandler);}['share'](){const B=this['self'];return B['sharedData']=!![],B['collections'];}static['materialize'](B){const Q=Object['create'](Collections['prototype']);return Q['collections']=B,Q['sharedData']=!![],new Proxy(Q,collectionsProxyHandler);}['own'](){if(!this['sharedData'])return;const B=new Map();this['collections']['forEach']((Q,a)=>{if(Q['length']>0x0)B['set'](a,Q['clone']());}),this['collections']=B,this['sharedData']=![];}['keys'](){return this['collections']['keys']();}['equals'](B){if(this['collections']===B['collections'])return!![];for(const [Q,a]of this['collections']){if(a['length']===0x0)continue;const c=B['collections']['get'](Q);if(!c||!a['equals'](c))return![];}for(const [X,f]of B['collections'])if(f['length']>0x0&&!this['collections']['has'](X))return![];return!![];}['clone'](){const B=this['self'],Q=Object['create'](Collections['prototype']);return Q['collections']=B['collections'],Q['sharedData']=!![],B['sharedData']=!![],new Proxy(Q,collectionsProxyHandler);}},Collection=class Collection{['data']=[];['length']=0x0;['own'](){this['data']=this['data']['slice'](0x0,this['length']);}['at'](B,Q){if(B<0x0)B=this['length']+B;if(arguments['length']===0x1)return this['data'][B];if(B<this['data']['length'])this['own']();return this['data'][B]=Q;}['has'](B){for(let Q=0x0;Q<this['length'];++Q)if(this['data'][Q]===B)return!![];return![];}['find'](B){for(let Q=0x0;Q<this['length'];++Q)if(B(this['data'][Q]))return this['data'][Q];}['findLast'](B){for(let Q=this['length']-0x1;Q>=0x0;--Q)if(B(this['data'][Q]))return this['data'][Q];}['delete'](B){if(B>=this['length'])return;this['own'](),this['data']['splice'](B,0x1),--this['length'];}['push'](...B){if(this['data']['length']>this['length'])this['own']();for(const Q of B)this['data'][this['length']++]=Q;return this['length'];}['pop'](){if(this['length']>0x0)return this['data'][--this['length']];}['slice'](B,Q){return this['data']['slice'](0x0,this['length'])['slice'](B,Q);}['equals'](B){if(this['length']!==B['length'])return![];if(this['data']===B['data'])return!![];for(let Q=0x0;Q<this['length'];++Q)if(this['data'][Q]!==B['data'][Q])return![];return!![];}['clone']({deep:B}={}){const Q=Object['create'](Collection['prototype']);return Q['data']=B?this['data']['slice'](0x0,this['length']):this['data'],Q['length']=this['length'],Q;}};function RegExpToken(B){return B=new RegExp(B['source'],B['flags']['includes']('y')?B['flags']:B['flags']+'y'),Q=>{B['lastIndex']=Q['pos'];const a=Q['shared']['endPos']?Q['text']['substring'](0x0,Q['shared']['endPos']):Q['text'],c=B['exec'](a);if(c){const X=Q['move'](c[0x0]['length']),f=X['tokens']['boundary']?.(X)??X['clone']();if(f!==X){for(let J=0x1;J<c['length'];++J)f['collections']['results']['push'](c[J]);return f['logMatched'](B),f;}}return Q['logMismatched'](B),Q;};}function StringToken(B){return Q=>{if((Q['shared']['endPos']?Q['text']['substring'](0x0,Q['shared']['endPos']):Q['text'])['startsWith'](B,Q['pos'])){const a=Q['move'](B['length']),c=a['tokens']['boundary']?.(a)??a['clone']();if(c!==a)return c['logMatched'](B),c;}return Q['logMismatched'](B),Q;};}function Use(B){if(typeof B==='function')return B;if(B instanceof RegExp)return RegExpToken(B);if(typeof B==='string')return StringToken(B);throw new Error('Invalid\x20rule');}const Never=B=>B,Nothing$1=B=>{if(B instanceof Cursor){const Q=B;return Q['logMatched']('<nothing>'),Q['clone']();}else{const a=B;return Node(Nothing$1,()=>a);}};function Silent(B){const Q=Use(B);return Pre(a=>a['logs']['enabled']?void(a['logs']['enabled']=![]):Q(a),Post(Q,a=>void(a['logs']['enabled']=!![])));}function LogGroup(B,Q){let a,c=![];if(typeof B==='string')a=B;else a=B['name'],c=B['collapsed']??![];const X=c?Silent(Use(Q)):Use(Q);return Pre(f=>{if(!f['logs']['enabled'])return X(f);if(!c)f['logGroup'](a);},Post(X,(f,J)=>{f[!c?'logGroupEnd':'logCollapsedGroup'](f!==J?styleText(['reset','green'],a):styleText(['reset','red'],a));}));}function Pre(B,Q){const a=Use(Q);return c=>B(c)??a(c);}function Post(B,Q){const a=Use(B),c=typeof Q==='function'?(X,f)=>Q(X,f)??X:(X,f)=>Q[X!==f?'match':'unmatch']?.(X,f)??X;return X=>{const f=X,J=X['clone']();J['rest']['post']((h,V)=>{if(h===V)return V;const k=c(h,f);return k===f?V:k;});const Y=a(J);return Y['rest']['pop'](),c(Y!==J?Y:X,X);};}const Anything$1=Customizable(({threshold:threshold=0xa}={})=>{return B=>{let Q=B['clone']();while(!![]){const a=Rest(Q);if(a!==Q&&(a['pos']>=Q['text']['length']||a['pos']-Q['pos']>=threshold))break;Q=Q['move'](0x1);if(Q['pos']===Q['text']['length'])break;}return Q['collections']['results']['push'](Q['text']['substring'](B['pos'],Q['pos'])),Q;};}),Rest=B=>{if(B['shared']['matchingRest'])return B['logSkip']('skipped\x20rest'),B;const Q=B['clone'](),a=Pre(c=>{c['shared']['matchingRest']=!![],c['logs']['restDepth']??=c['logs']['depth'];},Post(LogGroup('Rest',B['rest']['probe']),c=>{c['logs']['restDepth']=Q['logs']['restDepth'],c['shared']['matchingRest']=![];}))(Q);return a!==Q?a:B;};function Recursive(B){return Q({'depth':0x0});function Q({depth:a}){return B(Lazy(()=>Q({'depth':++a})),{'depth':a});}}function Dynamic(B){return Q=>{return Use(B(Q))(Q);};}function Lazy(B){let Q;return Dynamic(()=>Q??=Use(B()));}function Customizable(B){const Q=new Map();function a(c){let X=Q['get'](c);if(!X)Q['set'](c,X=Use(B(c)));return X;}return c=>{if(c instanceof Cursor)return a()(c);else return Customizable(X=>a(c||X?{...c,...X}:void 0x0));};}function Boundary(B,Q){const a=B&&Silent(Boundary(null,Use(B)));return Pre(c=>{c['tokens']={...c['tokens'],'boundary':a,'boundaryStack':[...c['tokens']['boundaryStack'],c['tokens']['boundary']]};},Post(Q,c=>{c['tokens']={...c['tokens'],'boundary':c['tokens']['boundaryStack']['at'](-0x1)??null,'boundaryStack':c['tokens']['boundaryStack']['slice'](0x0,-0x1)};}));}function NoBoundary(B){return Post(Boundary(null,B),{'match':(Q,a)=>{if(!Q['tokens']['boundary'])return Q;const c=Q['tokens']['boundary'](Q);if(c===Q)return a;return c;}});}function Ignore(B,Q){const a=B&&Use(B);return Pre(c=>{c['tokens']={...c['tokens'],'ignore':a,'ignoreStack':[...c['tokens']['ignoreStack'],c['tokens']['ignore']]};},Post(Q,c=>{c['tokens']={...c['tokens'],'ignore':c['tokens']['ignoreStack']['at'](-0x1)??null,'ignoreStack':c['tokens']['ignoreStack']['slice'](0x0,-0x1)};}));}function Raw(B){return Ignore(null,Boundary(null,B));}function Not(B){return Post(B,{'match':(Q,a)=>a,'unmatch':(Q,a)=>a['clone']()});}function NonEmpty(B){return Post(B,{'match':(Q,a)=>Q['pos']===a['pos']&&Q['collections']['equals'](a['collections'])?a:Q});}function Optional(B){return Post(B,{'unmatch':(Q,a)=>a['clone']()});}function Weak(B,{cost:cost=0x1}={}){const Q=Use(B);return LogGroup('Weak',a=>{const c=a;a['shared']['weakDepth']+=cost;const X=Q(c);a['shared']['weakDepth']-=cost;if(X===c)return a;if(a['shared']['matchingRest'])return a['clone']();return a['fork'](X,cost);});}function Any(...B){const Q=B['map'](Use),a=Q['map']((c,X)=>Q['slice'](X+0x1));return c=>{const X={'upTo':-0x1};for(let f=0x0;f<Q['length'];++f){const J=Q[f],Y=c['clone'](),h=a[f];if(h['length']>0x0)Y['rest']['any'](c,h,f+0x1,X);const V=J(Y);if(h['length']>0x0)V['rest']['pop']();X['upTo']=f;if(V!==Y)return V;}return c;};}function Longest(...B){const Q=B['map']((a,c)=>LogGroup('Longest\x20candidate\x20#'+(c+0x1),Use(a)));return LogGroup('Longest',a=>{return Q['reduce']((c,X)=>{const f=a['clone'](),J=X(f);if(J!==f&&J['pos']>c['pos'])return J;return c;},a);});}function All(...B){const Q=B['map'](Use);if(Q['length']===0x1)return Q[0x0];return a=>{let c=a['clone']();c['rest']['all'](Q);for(let X=0x0;X<Q['length'];++X){const f=Q[X];c['rest']['pop']();const J=c['tokens']['ignore']?.(c)??c,Y=f(J);if(Y===J)return a;if(Y['pos']!==J['pos']||!Y['collections']['equals'](J['collections']))c=Y;}return c;};}function Plus$1(B){const Q=Use(B);return a=>{let c=a;while(!![]){const X=c===a?c['clone']():c['tokens']['ignore']?.(c)??c['clone']();X['rest']['plus'](Q);const f=Q(X);f['rest']['pop']();if(f===X)return c;if(f['pos']===X['pos']&&f['collections']['equals'](X['collections']))return c;c=f;}};}function Star(B){return Optional(Plus$1(B));}function PreCondition(B,Q){return Pre(a=>{const c=!B(a)?a:void 0x0;if(c)a['logMismatched']('<precondition>');return c;},Q);}function PostCondition(B,Q){return Post(B,{'match':(a,c)=>{const X=!Q(a['collections']['results']['slice'](c['collections']['results']['length']),a,c)?c:void 0x0;if(X)a['logMismatched']('<postcondition>');return X;}});}function As$1(B,Q){const a=Use(B);return Pre(c=>{const X=a(c);if(X===c)return c;c['limit'](X['pos']);},Post(Q,c=>c['limit'](void 0x0)));}function Effect(B,Q){return Post(B,{'match':(a,c)=>void Q(a['collections']['results']['slice'](c['collections']['results']['length']),a,c)});}function Node(B,Q){return Effect(B,(a,c,X)=>{const f=Q(a,c,X);c['collections']['results']['length']=X['collections']['results']['length'],c['collections']['results']['push'](f);});}function Text$2(B){return Node(B,(Q,a,c)=>a['text']['substring'](c['pos'],a['pos']));}function Void(B){return Effect(B,(Q,a,c)=>{a['collections']['results']['length']=c['collections']['results']['length'];});}function Important(B){return Effect(B,(Q,a)=>a['collections']['important']['push'](!![]));}const log$1=debuglog('nlp:parse');var Cursor=class Cursor{['text'];['pos']=0x0;['__context']=new Context();['__contextParts']=null;['__collections']=new Collections();['__collectionsMap']=null;['rest']=new RestStorage();get['context'](){return this['__context']??=Context['materialize'](this['__contextParts']);}get['collections'](){return this['__collections']??=Collections['materialize'](this['__collectionsMap']);}['tokens']={'ignore':null,'boundary':null,'ignoreStack':[],'boundaryStack':[]};['logs']={'enabled':log$1['enabled'],'depth':0x0,'restDepth':void 0x0};['shared']={'forkId':void 0x0,'forks':[],'endPos':void 0x0,'farthestPos':0x0,'matchingRest':![],'weakDepth':0x0,'options':{}};get['options'](){return this['shared']['options'];}get['farthestPos'](){return this['shared']['farthestPos'];}constructor(B,Q){this['text']=B,this['shared']['options']=Q??{};}['clone'](){const B=Object['create'](Cursor['prototype']);return B['text']=this['text'],B['pos']=this['pos'],B['__context']=null,B['__contextParts']=this['__context']?this['__context']['share']():this['__contextParts'],B['__collections']=null,B['__collectionsMap']=this['__collections']?this['__collections']['share']():this['__collectionsMap'],B['tokens']=this['tokens'],B['rest']=this['rest']['clone'](),B['logs']=this['logs'],B['shared']=this['shared'],B;}['fork'](B,Q=0x1){const a=this['clone'](),c=this['shared']['weakDepth']+Q,X=B['clone']();return X['shared']={...X['shared'],'forkId':''+(a['shared']['forkId']?a['shared']['forkId']+'.':'')+(a['shared']['forks']['length']+0x1),'forks':[],'weakDepth':c},X['logs']={...X['logs']},X['rest']=new RestStorage(),a['shared']['forks']['push']({'$':X,'token':this['rest']['token'],'weight':c}),a['logSkip']('forked\x20#'+X['shared']['forkId']+'\x20(weight\x20'+c+')\x20'+X['getProgressString']()),a;}['limit'](B){if(B===void 0x0||B<0x0)this['shared']['endPos']=void 0x0;else this['shared']['endPos']=Math['min'](B,this['shared']['endPos']??this['text']['length']);}['move'](B){const Q=this['clone']();Q['pos']+=B;if(Q['pos']>Q['shared']['farthestPos'])Q['shared']['farthestPos']=Q['pos'];return Q;}['getDepthStyle'](B){const Q=['cyan','magenta','yellow','blue','cyanBright','magentaBright','yellowBright','blueBright'],a=B??this['logs']['depth'],c=Q[Math['max'](0x0,a-0x1)%Q['length']];return this['logs']['restDepth']!==void 0x0&&a>this['logs']['restDepth']?['dim',c]:[c];}['getProgressString'](B=this['pos']){return styleText('reset','['+styleText(['dim','underline'],this['text']['substring'](0x0,B))+this['text']['substring'](B)+']');}['log'](B){let Q='';if(this['logs']['restDepth']!==void 0x0){for(let c=0x0;c<this['logs']['restDepth'];c++)Q+=styleText(this['getDepthStyle'](c+0x1),'│\x20');const a=this['logs']['depth']-this['logs']['restDepth'];for(let X=0x0;X<a;X++)Q+=styleText(this['getDepthStyle'](this['logs']['restDepth']+X+0x1),'┊\x20');}else{for(let f=0x0;f<this['logs']['depth'];f++)Q+=styleText(this['getDepthStyle'](f+0x1),'│\x20');}log$1(''+(this['shared']['forkId']?'*':'')+Q+B);}['logFork'](B){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'╞═\x20▼\x20'+B)),this['logs']['depth']+=0x1);}['logForkEnd'](B){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'╞═\x20△\x20'+B)+'\x20'+this['getProgressString']()));}['logGroup'](B){this['logs']['enabled']&&(this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'▼\x20'+B)),this['logs']['depth']+=0x1);}['logGroupEnd'](B){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'△\x20'+B)+'\x20'+this['getProgressString']()));}['logCollapsedGroup'](B){if(this['logs']['enabled'])this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'▶\x20'+B)+'\x20'+this['getProgressString']());}['logMatched'](B){if(this['logs']['enabled'])this['log'](styleText('green','✓')+'\x20'+styleText('green',B['toString']())+'\x20\x20'+this['getProgressString']());}['logMismatched'](B){if(this['logs']['enabled'])this['log'](styleText('red','✗')+'\x20'+styleText('red',B['toString']())+'\x20'+this['getProgressString']());}['logSkip'](B){if(this['logs']['enabled'])this['log'](styleText('yellow','↷\x20'+B));}['logComplete'](){if(this['logs']['enabled']){if(this['pos']<this['text']['length'])log$1(styleText('red','parsing\x20finished\x20✗\x20'+this['getProgressString'](this['shared']['farthestPos'])));else log$1(styleText('green','parsing\x20finished\x20✓\x20'+this['getProgressString'](this['shared']['farthestPos'])));}}};let emptyContinuation;var RestStorage=class RestStorage{['head']=null;get['token'](){return this['compose']({'probing':![]});}get['probe'](){return this['compose']({'probing':!![]});}['compose']({probing:B}){const Q=this['head'];if(!Q)return emptyContinuation??=All(...[]);const a=B?Q['probe']:Q['token'];if(a)return a;let c=[];for(let f=Q;f;f=f['next']){const J=f['item'];if(typeof J==='function')c['push'](J);else{if(!B||J['kind']!=='post')c=[J['wrap'](c)];}}const X=All(...c);if(B)Q['probe']=X;else Q['token']=X;return X;}['clone'](){const B=new RestStorage();return B['head']=this['head'],B;}['all'](B){for(let Q=B['length']-0x1;Q>=0x0;--Q)this['head']={'item':B[Q],'next':this['head']};}['post'](B){this['unshift']({'kind':'post','wrap':Q=>{return Post(Q['length']>0x0?All(...Q):Important(Nothing$1),B);}});}['any'](B,Q,a,c){const X=B;this['unshift']({'kind':'any','wrap':f=>{return Any(All(...f),...Q['map']((J,Y)=>h=>{if(a+Y<=c['upTo'])return h;const V=X['clone']();V['shared']=h['shared'],V['logs']=h['logs'],V['rest']=h['rest']['clone']();const k=J(V);return k!==V?k:h;}));}});}['plus'](B){this['unshift']({'kind':'plus','wrap':Q=>{return All(...Q,Star(B));}});}['pop'](){this['head']=this['head']?.['next']??null;}['unshift'](B){this['head']={'item':B,'next':this['head']};}};function State(B,Q){const a=Symbol('state\x20id');return Q?c(Q({'Mutate':f,'state':Y,'mutate':J})):{'Provide':X,'Apply':c,'Mutate':f,'state':Y,'mutate':J};function c(h){return X(Node(Void(h),(V,k)=>Y(k)));}function X(h){return Pre(V=>void V['collections'][a]['push']({'init':B,'mutators':[]}),Post(h,V=>void V['collections'][a]['pop']()));}function f(h,V){return Effect(h,(k,t)=>J(t,K=>V(K,k)));}function J(h,V){h['collections'][a]=h['collections'][a]['clone']({'deep':!![]});const k=h['collections'][a]['at'](-0x1);if(!k)throw new Error('Cannot\x20mutate\x20state\x20that\x20wasn\x27t\x20provided');h['collections'][a]['at'](-0x1,{'init':k['init'],'mutators':[...k['mutators'],V]});}function Y(h){const V=h['collections'][a]['at'](-0x1);if(!V)throw new Error('Cannot\x20return\x20state\x20that\x20wasn\x27t\x20provided');const k=structuredClone(V['init']);return V['mutators']['forEach'](t=>t(k)),k;}}const MAX_FORK_QUEUE=0x3a98;function takeNextFork(B){let Q=0x0;for(let a=0x1;a<B['length'];++a){const c=B[a],X=B[Q];if(c['weight']<X['weight'])Q=a;}return B['splice'](Q,0x1)[0x0];}function makeParse(B){return(Q,a)=>{if(typeof Q!=='string')throw new Error('Parsing\x20function\x20expects\x20a\x20string\x20input');let c=null;const X=PostCondition(B,(Y,h)=>{if(h['pos']===h['text']['length'])return!![];if(!c||h['pos']>c['pos'])c=h;return![];}),f=new Cursor(Q,a);let J=X(f);if(J===f){const Y=f['shared']['forks']['splice'](0x0,f['shared']['forks']['length']);while(Y['length']>0x0){if(Y['length']>MAX_FORK_QUEUE)break;const {$:h,token:V}=takeNextFork(Y);f['logFork']('Fork\x20#'+h['shared']['forkId']);const k=V(h);k['logForkEnd']('Fork\x20#'+h['shared']['forkId']);if(k!==h){J=k;break;}Y['push'](...k['shared']['forks']);}}if(J===f||J['pos']<Q['length']){const t=J['farthestPos'];if(J===f&&c)J=c;J['collections']['errors']['push']({'type':'ParseError','pos':t,'text':Q['slice'](t)});}return J['logComplete'](),Object['fromEntries'](Array['from'](J['collections']['keys']())['map'](K=>[K,J['collections'][K]['slice']()]));};}function test(B,Q,a){if(typeof Q!=='string')return![];const c=new Cursor(Q,a),X=Use(B)(c);return c!==X&&X['pos']>=Q['length'];}function startsWith$2(B,Q,a){if(typeof Q!=='string')return![];const c=new Cursor(Q,a),X=Use(B)(c);return c!==X&&X['pos']>0x0;}function search(B,Q,a){if(typeof Q!=='string')return null;const c=new Cursor(Q,a),X=Use(B);for(let f=0x0;f<Q['length'];++f){const J=c['move'](f),Y=X(J);if(Y!==J&&Y['pos']>J['pos'])return{'text':Q['substring'](f,Y['pos']),'pos':f};}return null;}const Article=B=>All(Optional(/the|an|a/i),B),Possessive=(B,{strict:Q}={})=>Any(NoBoundary(All(B,/'s?/)),Q?Never:B),Plural$1=B=>NoBoundary(All(B,/e?s/i)),InstructionTerminator=/[.;\s]*$/,ActionSeparator=/(?:(?:(?:,\s*)?(?:(?:and\s+)?(?:then|after)|and))|,)/i,ActionModifierSeparator=/[:,-]/,BlockSeparator=/[,;]/,AndListSeparator=/(?:,\s*)?and|,/i,OrListSeparator=/(?:,\s*)?(?:or|and)|,/i,The=/the(?:\s+the)?/i,IndefiniteArticle=/an|a/i,For=/for/i,To=/to/i,From=/from/i,Of=/of/i,By=/by/i,With=/with/i,Without=/without/i,As=/as/i,LocationPreposition=/into|within|inside|in|on|at/i,FunctionalPreposition=/as|under/i,RelationalPreposition=/from|of|in|at|as|below|under/i,EquivalencePreposition=/as|to/i,TemporalPreposition=/before|after|for/i,AssignmentPreposition=/with|as|to|in/i,StoragePreposition=/to|in|as|under/i,AssociationPreposition=/with|of/i,ConditionPreposition=/in|on|under/i,MembershipPreposition=/in|of|from/i,Only=/only/i,Last$1=/last/i,If$1=/if/i,And=/and/i,That=/that/i,When=/when/i,Then$1=/then/i,NumberSign=/#|№/,At=/at/i,Between=/between/i,Index$1=/index/i,Repeat$1=/repeat/i,Iterate=/iterate|loop/i,Over=/over|through|across/i,Until=/until/i,While=/while|as\s+long\s+as/i,Start=/Start/i,Bottom=/bottom/i,It=/it/i,Its=/its/i,Them=/them/i,This=/this/i,Demonstrative=/that|this|the\s+same|the\s+current/i,These=/these/i,Keyboard$1=/keyboard/i,KeyboardKey$1=All(Optional(Keyboard$1),/key|button/i),KeyboardKeys=All(Optional(Keyboard$1),/(?:key|button)s?/i),Character=/char(?:acter)?|symbol|letter/i,Characters=/(?:char(?:acter)?|symbol|letter)s?/i,Variables=/(?:var(?:iable)?|param(?:eter)?)s?/i,Parameters$1=/(?:arg(?:ument)?|var(?:iable)?|param(?:eter)?)s?/i,Value$5=/value|data|datum|content/i,Custom=/custom/i,Http=/https?|hyper\s*text\s+transfer\s+protocol/i,Pixels=/px|pixels?/i,Following=/following/i,Nothing=/nothing/i,Anything=/anything/i,Name$2=/name/i,Times$4=/times?/i,Iterations=/attempts?|iterations?|items?|loops?|times?/i,PlusSymbolic=/\+/,Plus=Any(PlusSymbolic,/plus/i),MinusSymbolic=/-/,Minus=Any(MinusSymbolic,/minus/i),MultiplySymbolic=/\*|×|·/,Multiply=Any(MultiplySymbolic,/times|multiplied\s+by/i),DivisionSymbolic=/(?<=\s)\/(?=\s)|÷/,Division=Any(DivisionSymbolic,/divided\s+by/i),Sum=/sum/i,Difference=/difference/i,Product=/product/i,Quotient=/quotient/i,Evaluation=/eval(?:uation)?|exec(?:ution)?|step/i,Request$1=/request|req/,Result=/result/,Length=/length|size/i,Width=/width/,Height=/height/,Assertions=/(?:assert(?:ion)?|verification|validation|check(?:point)?)s?/i,CustomFlowTest=/test|custom[-\s]?flow(?:\s+test)?/i,TestStep=/(?:test[-\s])?step/i,TestSteps=/(?:test[-\s])?steps?/i,Website=/(?:web[-\s]?)?(?:site|page|document)/i,Websites=/(?:web[-\s]?)?(?:site|page|document)s?/i,Url$4=/url|(?:hyper)?link|domain|address/i,Title$1=/title/i,Endpoint$1=/endpoint|api|url|address/i,BasicAuth$1=/(?:basic\s+)?auth(?:orization)?/i,User=/user/i,HttpCookie=/(?:request\s+)?cookie/i,HttpHeader$1=/(?:request\s+)?header/i,HttpBody=/(?:request\s+)?body/i,HttpResponse=/(?:https?\s+)?(?:request\s+)?response/i,HttpStatusCode=/(?:request\s+)?status(?:\s+code)?/i,HttpStatusCodes=/(?:request\s+)?status(?:es|(?:\s+codes?))?/i,CSSPseudoClass=/styl(?:e|ing)|pseudo[-\s]?class/i,JavaScript=/js|java-?script/i,CodeSnippet=/(?:code\s+)?(?:snippet|expression|statement|line)|code/i,CollectionItems=/items?|elements?|entr(?:y|eis)/i,CollectionPairs=/pairs?|mappings?/i,CollectionKeys=/keys?/i,CollectionValues=/values?/i,Secret$1=/(?:(?:(?:(?:access|auth(?:entication)?)\s+)?(?:token|password|pwd|pass|security|pin)(?:\s*(?:key|code))?|secret(?:\s*(?:pin|key|code))?)|(?:access|auth(?:entication)?)\s+(?:key|code)|credit\s*card)/i,OTP$1=/(?:otp|one\s*-?\s*time\s*-?\s*password)(?:\s+(?:(?:pin\s*-?\s*)?code|password|key|digits|pin|(?:pass\s*-?\s*)?phrase|secret|passcode))?/i,File=/file|attachment/i,SelectboxOption=/(radio\s+)?(button|option|item|entry|value|text|element)/i,Popup=/(?:pop(?:-|\s*)(?:up|over)|dialog)(?:\s+(?:item))?/i,Tooltip=/(?:tool|info|help|context)\s*tip|help\s*tip|(?:info|hint|help|text)\s+bubble/i,Page=/page/i,WebPage=/(?:web[-\s]?)?(?:page|document)|window/i,PdfPage$1=/(?:document|pdf)\s+page/i,App$1=/app(?:lication)?/i,Viewport$1=/screen|viewport/i,Selector$1=/selector|locator/i,String$1=/text/i,Color$2=/colou?r/i,Date$1=/date/i,Time=/time/i,DateTime=/date(?:-|\s+and\s+|\s+)?time/i,Number$1=/amount|sum|total|number/i,Price$1=/price|cost|fee/i,Code=/id|code/i,Having=/with|holding|containing|including/i,Percentage$1=/percent(?:age)?/i,Text$1=/label|text|string/i,Link=/link/i,Heading=/heading/i,Hamburger=/(?:ham)?burger(?:\s+menu)?/i,Item=/item|option|entry/i,Menu=/nav(?:igation)?[-\s]?bar|nav(?:igation)?(?:\s+menu)?|menu/i,MenuItem=NoBoundary(All(Menu,Item)),List$1=/list/i,ListItem=NoBoundary(All(List$1,Item)),Header$5=/header/i,Footer=/footer/i,Card=/card|panel/i,Paragraph=/paragraph/i,Textbox=/box|text[-\s]?(?:box|area|field|input)|edit[-\s]?(?:box|area)|bar/i,Searchbox=/search[-\s]?(?:box|bar)/i,Checkbox=/check[-\s]?box/i,CheckboxGroup=/check[-\s]?box\s*group/i,Radio=/radio/i,RadioGroup=/radio\s*group/i,ColorPicker=/colou?r(?:-|\s*)(?:picker|chooser|box|field|input)/i,DatePicker=/date(?:-|\s*)(?:picker|chooser|box|field|input)/i,TimePicker=/time(?:-|\s*)(?:picker|chooser|box|field|input)/i,DateTimePicker=/date(?:-|\s+and\s+|\s+)?time(?:-|\s*)(?:picker|chooser|box|field|input)/i,FilePicker=/file(?:-|\s*)(?:picker|chooser|box|field|input)/i,Inputbox=/form(?:-|\s*)(?:field|input)|input(?:[-\s]?(?:field|box|area))?|field/i,Selectbox=/select(?:-|\s+)?box/i,Valuebox=/value(?:-|\s+)?box/i,Combobox=/(?:drop[-\s]?down(?:\s+(?:menu|list))?|drop[-\s]?box|combo[-\s]?box)(?:\s+arrow)?/i,Listbox=/(?:list[-\s]?box)(?:\s+arrow)?/i,Option$1=/option/i,Form$1=/form/i,Image=/image|svg|picture|drawing|graphics?/i,Logo=/logo/i,Icon=/icon|svg|glyph/i,Button=/button|(?:tool\s*bar|tool|bar)(?:\s+item)?/i,Tab$1=/tab/i,TabList=/tab(?:s|[-\s]?(?:list|bar|strip))/i,TabPanel=/tab[-\s]?(?:panel|pane|content)/i,Slider=/slider/i,Ad=/advert(?:isement)?|ads?/i,Element$3=/element/i,Browser$1=/(?:(?:web|internet)[-\s])?browser/i,BrowserTab=All(Possessive(Browser$1),/tab/i),BrowserTabList=All(Possessive(Browser$1),TabList),BrowserToolbar=All(Possessive(Browser$1),Optional(/tool[-\s]?bar/i)),BrowserDialogType=/alert|prompt|confirm/i,BrowserDialog=Any(All(/native/i,Optional(Possessive(Browser$1)),Any(BrowserDialogType,Popup)),All(Possessive(Browser$1),Any(BrowserDialogType,Popup)),BrowserDialogType),Accept=/ok|accept|agree|allow|confirm|submit/i,Dismiss=/cancel|decline|reject|close|discard|dismiss/i,Table=/table/i,Cell=/cell/i,Row=/row/i,Column=/column/i,Stub=/stub/i,Be=/be|is|are/i,Wait$2=/wait/i,Waiting=/waiting|pausing/i,Skip=/skip|ignore/i,Skipping=/skipping|ignoring/i,Run=/run|do|execute|perform/i,Running=/running|doing|executing|performing/i,Expect=/expect|accept|allow|permit/i,Expecting=/expecting|accepting|allowing|permitting/i,Using=/using/i,Holding=/holding|pressing|hitting/i,Activate=/activate|define|add/i,Cancel=/cancel|undefine|clear|reset/i,Dont=/do\s+not|don't/i,Optionally=/optionally|if\s+possible/i,Random=/random(?:ly)?/i,Relative=/relative/i,Current=/current/i,Active=/active/i,Each=/each|every|all|any/i,Every=/every|each/i,Named=/named|called|titled|(?:(?:with|of|that\s+has|showing)\s+(?:the\s+)?(?:name|title|text)?)/i,Maximum=/maximum|max|no\s+more\s+than|at\s+most|a\s+(?:max|maximum)\s+of|up\s+to/i,Inside=/within|inside(?:\s+of)?|on(?:top(?:\s+of)?)?|in|at|of/i,Near=/(?:nearest|near)(?:\s+to)?|(?:closest|close|next|adjacent)\s+to/i,Background=/background/i,Foreground=/foreground/i,Back=/back/i,Forward=/forward/i,Previous=/prev(?:ious)?/i,Next=/next/i,Before=/before/i,After=/after/i,Prior=/before|prior(?:\s+to)?/i,Implicit=/implicit/i,Subsequent=/subsequent|remaining|next/i,Generated=/generated/i,New=/new/i,Zero=Use(/(zero)/i);Use(/(one)/i);const CardinalNumeralDigit=Use(/(one|two|three|four|five|six|seven|eight|nine)/i),CardinalNumeralTeen=Use(/(ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen)/i),CardinalNumeralTen=Use(/(twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety)/i),OrdinalNumeralDigit=Use(/(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth)/i),OrdinalNumeralTeen=Use(/(tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth)/i),OrdinalNumeralTen=Use(/(twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)/i),DenominatorNumeralDigit=Use(/(firsts?|half|halves|thirds?|fourths?|quoters?|fifths?|sixths?|sevenths?|eighths?|ninths?)/i),DenominatorNumeralTeen=Use(/(tenths?|elevenths?|twelfths?|thirteenths?|fourteenths?|fifteenths?|sixteenths?|seventeenths?|eighteenths?|nineteenths?)/i),DenominatorNumeralTen=Use(/(twentieths?|thirtieths?|fortieths?|fiftieths?|sixtieths?|seventieths?|eightieths?|ninetieths?)/i),MultiplicativeNumeral=Use(/(single|double|triple|quadruple|quintuple|sextuple|septuple|octuple|nonuple|decuple)/i),FractionNumeral=Use(/(half|quoter)/i),IterativeNumeral=Use(/(once|twice|thrice)/i),SkipSpaces=B=>All(Optional(/\s+/),Ignore(/\s+/,B)),TokenBoundary=B=>Boundary(/(?<!\w)|\b(?![-]|'\w)/,B),Sanitize$1=B=>TokenBoundary(SkipSpaces(B)),Continuous=(B,Q)=>Any(PreCondition(a=>a['context']['self']['data']['has']('continuous'),Q),B),Plural=(B,Q)=>Any(PreCondition(a=>a['context']['self']['data']['get']('plural')===!![],Q),B),Mark=(B,{type:Q,subtype:a,regexp:c,mutate:X})=>Effect(B,(f,J,Y)=>{const h=J['text']['slice'](Y['pos'],J['pos']);if(h){let V;if(c){const k=h['match'](c);if(k)V={'pos':Y['pos']+k['index'],'text':k[0x0],'type':Q};}else V={'pos':Y['pos'],'text':h,'type':Q};if(V){if(a)V['subtype']=a;X?.(V,f,J,Y),J['collections']['markers']['push'](V);}}}),Fix=(B,Q)=>Effect(Mark(B,{'type':'fixable'}),(a,c,X)=>{const f=c['text']['slice'](X['pos'],c['pos']);if(f)c['collections']['fixes']['push']({'pos':X['pos'],'text':f,'fix':Q(f,a)});}),Disambiguate=(B,Q)=>Effect(Mark(B,{'type':'ambiguous'}),(a,c,X)=>{const f=c['text']['slice'](X['pos'],c['pos']);if(f)c['collections']['disambiguations']['push']({'pos':X['pos'],'text':f,'replacements':Q(f,a)});}),Wrap=(B,Q)=>{const {left:a,right:c}=typeof B==='object'&&!(B instanceof RegExp)?B:{'left':B,'right':B};return All(a,Q,c);},DoubleQuoted$1=B=>Mark(Wrap('\x22',B),{'type':'string','subtype':'double\x20quoted'}),SingleQuoted$1=B=>Mark(Wrap('\x27',B),{'type':'string','subtype':'single\x20quoted'}),Quoted$1=B=>Any(DoubleQuoted$1(B),SingleQuoted$1(B)),Stringish=B=>Any(Quoted$1(B),Mark(B,{'type':'string','subtype':'unquoted'})),Index=B=>Node(B,([Q])=>typeof Q==='number'?Q-0x1:Q),List=(B,Q)=>All(B,Star(All(Q,B))),WeakList=(B,Q)=>All(B,Star(Weak(All(Q,B)))),Mask=()=>{const {Provide:B,state:Q,mutate:a}=State({'enabled':![],'markers':[]});function c(f,J=!![]){const Y=J?'secret':'empty';a(f,h=>h['enabled']=J),Q(f)['markers']['forEach'](h=>h['type']=Y);}const X=f=>Mark(f,{'type':'empty','mutate':(J,Y,h)=>{if(Q(h)['enabled'])J['type']='secret';a(h,V=>V['markers']['push'](J));}});return{'Masker':B,'Maskable':X,'mask':c};},HorizontalAbsolutePosition=Any(Node(/(?:very\s+)?left(?:\s*(?:-\s*)?most)?|start|beginning/i,()=>'left'),Node(/(?:very\s+)?right(?:\s*(?:-\s*)?most)?|end/i,()=>'right')),VerticalAbsolutePosition=Any(Node(/(?:very\s+)?top(?:\s*(?:-\s*)?most)?/i,()=>'top'),Node(/(?:very\s+)?bottom(?:\s*(?:-\s*)?most)?/i,()=>'bottom')),CenterAbsolutePosition=Node(/middle|center/i,()=>'center'),OrthogonalAbsolutePosition=Any(Node(/left/i,()=>'left'),Node(/right/i,()=>'right'),Node(/top/i,()=>'top'),Node(/bottom/i,()=>'bottom')),AbsolutePosition$1=Any(Node(All(Optional(The),HorizontalAbsolutePosition,Optional(All(And,VerticalAbsolutePosition))),([B,Q])=>''+(Q??'')+B),Node(All(Optional(The),VerticalAbsolutePosition,Optional(All(And,HorizontalAbsolutePosition))),([B,Q])=>''+B+(Q??'')),All(Optional(The),CenterAbsolutePosition)),HorizontalRelativePosition=Any(Node(/left/i,()=>'leftof'),Node(/right/i,()=>'rightof')),VerticalRelativePosition=Any(Node(/above|over/i,()=>'above'),Node(/below|under/i,()=>'below')),BeforeRelativePosition=Any(Node(Before,()=>'belowleftof')),AfterRelativePosition=Any(Node(After,()=>'aboverightof')),RelativePosition=Any(Node(All(Optional(All(To,Optional(The))),HorizontalRelativePosition,Optional(All(And,Optional(All(To,Optional(The))),VerticalRelativePosition))),([B,Q])=>''+(Q??'')+B),Node(All(Optional(All(To,Optional(The))),VerticalRelativePosition,Optional(All(And,Optional(All(To,Optional(The))),HorizontalRelativePosition))),([B,Q])=>''+B+(Q??'')),BeforeRelativePosition,AfterRelativePosition),SequentialRelativePosition=B=>Any(Node(Any(All(Next,B),All(B,/that\s+(?:follows|comes\s+after)\s+(?:the\s+)?current/i)),([Q])=>({'position':'next','object':Q})),Node(Any(All(Previous,B),All(B,/that\s+comes\s+before\s+(?:the\s+)?current/i)),([Q])=>({'position':'previous','object':Q}))),BackspaceKey$1=Node(/backspace/i,()=>'Backspace'),DeleteKey$1=Node(/del(?:ete)?/i,()=>'Delete'),ArrowKey$1=Any(Node(/up(?:\s+arrow)?|arrow\s+up/i,()=>'ArrowUp'),Node(/down(?:\s+arrow)?|arrow\s+down/i,()=>'ArrowDown'),Node(/left(?:\s+arrow)?|arrow\s+left/i,()=>'ArrowLeft'),Node(/right(?:\s+arrow)?|arrow\s+right/i,()=>'ArrowRight')),ControlKey$1=Any(Node(/escape|esc/i,()=>'Escape'),Node(/f1/i,()=>'F1'),Node(/f2/i,()=>'F2'),Node(/f3/i,()=>'F3'),Node(/f4/i,()=>'F4'),Node(/f5/i,()=>'F5'),Node(/f6/i,()=>'F6'),Node(/f7/i,()=>'F7'),Node(/f8/i,()=>'F8'),Node(/f9/i,()=>'F9'),Node(/f10/i,()=>'F10'),Node(/f11/i,()=>'F11'),Node(/f12/i,()=>'F12'),Node(/caps(?:\s*lock)?/i,()=>'CapsLock'),Node(/tab/i,()=>'Tab'),Node(/enter|return/i,()=>'Enter'),Node(/(?:left\s+)?shift/i,()=>'ShiftLeft'),Node(/right\s+shift/i,()=>'ShiftRight'),Node(/(?:left\s+)?(?:control|ctrl)/i,()=>'ControlLeft'),Node(/right\s+(?:control|ctrl)/i,()=>'ControlRight'),Node(/(?:left\s+)?(?:meta|windows|command|cmd)/i,()=>'MetaLeft'),Node(/right\s+(?:meta|windows|command|cmd)/i,()=>'MetaRight'),Node(/(?:left\s+)?(?:alt|alternate|option)/i,()=>'AltLeft'),Node(/right\s+(?:alt|alternate|option)/i,()=>'AltRight'),Node(/(?:alt|alternate)\s*gr(?:aph)/i,()=>'AltGraph'),Node(/space/i,()=>'Space'),Node(/home/i,()=>'Home'),Node(/end/i,()=>'End'),Node(/page\s*up|pgup/i,()=>'PageUp'),Node(/page\s*down|pgdn/i,()=>'PageDown'),Node(/ins(?:ert)?/i,()=>'Insert'),BackspaceKey$1,DeleteKey$1),KeyboardKey=Any(ControlKey$1,ArrowKey$1,Any(Node(/\\|backslash/i,()=>'Backslash'),Node(/`(?!\S)|back\s*quote|back\s*tick/,()=>'Backquote'),Node(/1|one/i,()=>'Digit1'),Node(/2|two/i,()=>'Digit2'),Node(/3|thee/i,()=>'Digit3'),Node(/4|four/i,()=>'Digit4'),Node(/5|five/i,()=>'Digit5'),Node(/6|six/i,()=>'Digit6'),Node(/7|seven/i,()=>'Digit7'),Node(/8|eight/i,()=>'Digit8'),Node(/9|nine/i,()=>'Digit9'),Node(/0|zero/i,()=>'Digit0'),Node(/-(?!\S)|minus/i,()=>'Minus'),Node(/=(?!\S)|equal/i,()=>'Equal'),Node(/Q/i,()=>'KeyQ'),Node(/W/i,()=>'KeyW'),Node(/E/i,()=>'KeyE'),Node(/R/i,()=>'KeyR'),Node(/T/i,()=>'KeyT'),Node(/Y/i,()=>'KeyY'),Node(/U/i,()=>'KeyU'),Node(/I/i,()=>'KeyI'),Node(/O/i,()=>'KeyO'),Node(/P/i,()=>'KeyP'),Node(/\[(?!\S)|(?:left|open(?:ing)?)\s+bracket/i,()=>'BracketLeft'),Node(/\](?!\S)|(?:right|clos(?:e|ing))\s+bracket/i,()=>'BracketRight'),Node(/A/i,()=>'KeyA'),Node(/S/i,()=>'KeyS'),Node(/D/i,()=>'KeyD'),Node(/F/i,()=>'KeyF'),Node(/G/i,()=>'KeyG'),Node(/H/i,()=>'KeyH'),Node(/J/i,()=>'KeyJ'),Node(/K/i,()=>'KeyK'),Node(/L/i,()=>'KeyL'),Node(/;(?!\S)|semi(?:colon)?/i,()=>'Semicolon'),Node(/"(?!\S)|(?:double\s+)?quote/i,()=>'Quote'),Node(/Z/i,()=>'KeyZ'),Node(/X/i,()=>'KeyX'),Node(/C/i,()=>'KeyC'),Node(/V/i,()=>'KeyV'),Node(/B/i,()=>'KeyB'),Node(/N/i,()=>'KeyN'),Node(/M/i,()=>'KeyM'),Node(/,(?!\S)|comma/i,()=>'Comma'),Node(/\.(?!\S)|period|dot/i,()=>'Period'),Node(/\/(?!\S)|slash/i,()=>'Slash'))),InnerRelationalOffset=Any(Node(/half(?:\s*way)?/i,()=>0.5),Node(/entire|whole|full|all(?:\s+(?:the\s+)?way)?/i,()=>0x1)),Comment=Mark(Node(RegExpToken(/(?:\/\/|#)(.*)$/),([B])=>({'type':'comment','text':B['trim']()})),{'type':'comment'}),TrailingCommentText=RegExpToken(/(?:\/\/|#(?=\s|$))(.*)$/),TrailingComment=All(Void(/[\s.;]*/),Mark(Void(TrailingCommentText),{'type':'comment'})),CARDINAL_NUMERALS={'one':0x1,'two':0x2,'three':0x3,'four':0x4,'five':0x5,'six':0x6,'seven':0x7,'eight':0x8,'nine':0x9,'ten':0xa,'eleven':0xb,'twelve':0xd,'fourteen':0xe,'fifteen':0xf,'sixteen':0x10,'seventeen':0x11,'eighteen':0x12,'nineteen':0x13,'twenty':0x14,'thirty':0x1e,'forty':0x28,'fifty':0x32,'sixty':0x3c,'seventy':0x46,'eighty':0x50,'ninety':0x5a};function cardinalNumeralToNumber(B){return CARDINAL_NUMERALS[B]??NaN;}const ORDINAL_NUMERALS={...CARDINAL_NUMERALS,'first':0x1,'second':0x2,'third':0x3,'fourth':0x4,'fifth':0x5,'sixth':0x6,'seventh':0x7,'eighth':0x8,'ninth':0x9,'tenth':0xa,'eleventh':0xb,'twelfth':0xc,'thirteenth':0xd,'fourteenth':0xe,'fifteenth':0xf,'sixteenth':0x10,'seventeenth':0x11,'eighteenth':0x12,'nineteenth':0x13,'twentieth':0x14,'thirtieth':0x1e,'fortieth':0x28,'fiftieth':0x32,'sixtieth':0x3c,'seventieth':0x46,'eightieth':0x50,'ninetieth':0x5a};function ordinalNumeralToNumber(B){return ORDINAL_NUMERALS[B]??NaN;}const DENOMINATOR_NUMERALS={...ORDINAL_NUMERALS,'firsts':0x1,'half':0x2,'halves':0x2,'thirds':0x3,'fourths':0x4,'quoter':0x4,'quoters':0x4,'fifths':0x5,'sixths':0x6,'sevenths':0x7,'eighths':0x8,'ninths':0x9,'tenths':0xa,'elevenths':0xb,'twelfths':0xc,'thirteenths':0xd,'fourteenths':0xe,'fifteenths':0xf,'sixteenths':0x10,'seventeenths':0x11,'eighteenths':0x12,'nineteenths':0x13,'twentieths':0x14,'thirtieths':0x1e,'fortieths':0x28,'fiftieths':0x32,'sixtieths':0x3c,'seventieths':0x46,'eightieths':0x50,'ninetieths':0x5a};function denominatorNumeralToNumber(B){return DENOMINATOR_NUMERALS[B]??NaN;}const ITERATIVE_NUMERALS={'once':0x1,'twice':0x2,'thrice':0x3};function iterativeNumeralToInteger(B){return ITERATIVE_NUMERALS[B]??NaN;}const MULTIPLICATIVE_NUMERALS={'single':0x1,'double':0x2,'triple':0x3,'quadruple':0x4,'quintuple':0x5,'sextuple':0x6,'septuple':0x7,'octuple':0x8,'nonuple':0x9,'decuple':0xa};function multiplicativeNumeralToInteger(B){return MULTIPLICATIVE_NUMERALS[B]??NaN;}const FRACTIONAL_NUMERALS={'quoter':0.25,'half':0.5};function fractionalNumeralToNumber(B){return FRACTIONAL_NUMERALS[B]??NaN;}function replace(B,Q,a,c){return B['substring'](0x0,Q)+c+B['substring'](Q+a);}function normalizeString(B,Q=/[]/){return B['replaceAll'](new RegExp(String['raw']`\\([{\\nt]|${Q['source']})`,'g'),(a,c)=>{if(c==='n')return'\x0a';else{if(c==='t')return'\x09';}return c;});}const GERUND_PARTICLES=new Set(['on','off','over','up','down','out']);function gerundize(B){const Q=B['split'](/\s+/);let a=Q['length']-0x1;if(Q['length']>0x1&&GERUND_PARTICLES['has'](Q[a]['toLowerCase']()))a-=0x1;const c=Q[a]['toLowerCase']();if(/ee$/['test'](c))Q[a]=c+'ing';else{if(/e$/['test'](c))Q[a]=c['slice'](0x0,-0x1)+'ing';else{if(/[^aeiou][aeiou][^aeiouswxy]$/['test'](c))Q[a]=''+c+c['at'](-0x1)+'ing';else Q[a]=c+'ing';}}return Q['join']('\x20');}const DEFAULT_LOCALE='en-US',SAMPLE_NUMBER=1234567.5,numberFormats=new Map();function numberFormatParts(B){try{return new Intl['NumberFormat'](B)['formatToParts'](SAMPLE_NUMBER);}catch{return new Intl['NumberFormat'](DEFAULT_LOCALE)['formatToParts'](SAMPLE_NUMBER);}}function numberFormat(B){const Q=(B??'en-US')['replaceAll']('_','-');let a=numberFormats['get'](Q);if(!a){const c=numberFormatParts(Q);a={'group':c['find'](X=>X['type']==='group')?.['value']??'','decimal':c['find'](X=>X['type']==='decimal')?.['value']??'.'},numberFormats['set'](Q,a);}return a;}const NUMBER_FORMAT_LOCALES=['en-US','de-DE'];function groupSeparatorPattern({group:B}){if(/\s/['test'](B))return String['raw']`\s`;if(B==='\x27'||B==='’')return'[\x27’]';return RegExp['escape'](B);}function normalizeNumericString(B,Q){const a=numberFormat(Q);return(a['group']?B['replaceAll'](new RegExp(groupSeparatorPattern(a),'g'),''):B)['replace'](a['decimal'],'.');}function mergeElementDescriptors(B,Q){const a={...B,...Q};if(B['type']&&Q['type']){a['type']=[...new Set([B['type']??[],Q['type']??[]]['flat']())];if(a['type']['length']===0x1)a['type']=a['type'][0x0];}if(B['anchor']&&Q['anchor'])a['anchor']=[B['anchor']??[],Q['anchor']??[]]['flat']();if(B['hints']?.['type']&&Q['hints']?.['type']){a['hints']['type']=[...new Set([B['hints']['type']??[],Q['hints']['type']??[]]['flat']())];if(a['hints']['type']['length']===0x1)a['hints']['type']=a['hints']['type'][0x0];}return a;}function attachAnchor(B,Q){const a=Array['isArray'](Q)?Q:[Q];if(B['anchor'])B['anchor']=[B['anchor'],...a]['flat']();else{if(a['length']===0x1)B['anchor']=a[0x0];else B['anchor']=a;}}function attachAnchorAtDeepest(B,Q){if((Array['isArray'](Q)?Q:[Q])['some'](({element:a})=>a===B))return;if(B['anchor']){for(const a of Array['isArray'](B['anchor'])?B['anchor']:[B['anchor']])if(a['element']&&!('isViewportDescriptor'in a['element'])&&!('isDialogDescriptor'in a['element']))attachAnchorAtDeepest(a['element'],Q);}else B['anchor']=Q;}function convertToStructure(B){if(Array['isArray'](B))return{'isStructure':!![],'type':'array','items':B['map'](Q=>convertToStructure(Q))};else{if(B&&typeof B==='object')return{'isStructure':!![],'type':'record','items':Object['entries'](B)['map'](([Q,a])=>({'key':Q,'value':convertToStructure(a)}))};}return B;}const RESERVED_NAMES=new Set(['page','response','js-result','it']);function isReservedName(B){return RESERVED_NAMES['has'](B);}function isSecretName(B){const Q=new RegExp('(?:'+[/(?:access|o?auth(?:entication|orization)?)[\s_-]*(?:key|code)/,/(credential|token)(?:s)?/,/(?:api|app(?:lication)?|client|shared)[\s_-]*secret/,/(?:secret|api|private|encryption|verification|certificate)(?:[\s_-]*(?:pin|code|key))+/,/(?:pin|secret|otp)[\s_-]*(?:code)?/,/(?:secure|security|authenticator|2fa|mfa|(?:two|2)[\s_-]factor)[\s_-]*(?:code)?/,/pass[\s_-]*(?:code|word|phrase)/,/(credit|payment)[\s_-]*card/,/(?:cc|cvv|cvc)[\s_-]*(?:number|code|digits?)/]['map'](h=>h['source'])['join']('|')+')','i')['exec'](B);if(!Q)return![];const a=Q['index'],c=a+Q[0x0]['length'],X=B[a-0x1]||'',f=B[c]||'';if(!/[A-Za-z0-9]/['test'](X)&&!/[A-Za-z0-9]/['test'](f))return!![];const J=/[a-z0-9]/['test'](X)&&/[A-Z]/['test'](Q[0x0][0x0]),Y=/[A-Z]/['test'](Q[0x0]['slice'](-0x1))&&/[a-z0-9]/['test'](f);return J||Y;}function isElementType(B){return test(Any(ElementType$1,NoopElementType),B);}function isPatternName(B){return test(NamedPattern,B);}function isNamedColor(B){if(typeof B!=='string')return![];return test(NamedColor,B['trim']());}function isNumberOperation(B){return typeof B==='object'&&B!==null&&'operator'in B&&(B['operator']==='add'||B['operator']==='sub'||B['operator']==='mul'||B['operator']==='div');}function variableNameToElementType(B){const Q=B['toLowerCase']()['replace'](/[\s_-]+/g,'');if(/(link|url|address|uri|location)/['test'](Q))return'link';if(/(btn|button|cta)/['test'](Q))return'button';if(/(combo(?:box)|dropdown|select)/['test'](Q))return'combobox';if(/(listbox)/['test'](Q))return'listbox';if(/(radio)/['test'](Q))return'radio';if(/(form)/['test'](Q))return'form';if(/(check)/['test'](Q))return'checkbox';if(/(popup|dialog|modal|alert)/['test'](Q))return'popup';if(/(logo|brand)/['test'](Q))return'logo';if(/(img|image|picture|photo)/['test'](Q))return'image';if(/(heading|title|subtitle)/['test'](Q))return'heading';if(/(item)/['test'](Q))return'menuitem';if(/(menu|nav)/['test'](Q))return'menu';if(/(burger)/['test'](Q))return'hamburger';if(/(datetime)/['test'](Q))return'datetimepicker';if(/(calendar|date)/['test'](Q))return'datepicker';if(/(time)/['test'](Q))return'timepicker';if(/(color)/['test'](Q))return'colorpicker';if(/(header|topbar)/['test'](Q))return'header';if(/(footer|bottombar)/['test'](Q))return'footer';if(/(icon|glyph|symbol)/['test'](Q))return'icon';if(/(range|slider)/['test'](Q))return'slider';if(/(textbox|input|field)/['test'](Q))return'textbox';if(/(text|label|paragraph|content)/['test'](Q))return'text';return null;}function singularize(B){if(/[^aeiou]ies$/i['test'](B))return B['slice'](0x0,-0x3)+'y';if(/(?:ss|sh|ch|x|z)es$/i['test'](B))return B['slice'](0x0,-0x2);if(/[^su]s$/i['test'](B))return B['slice'](0x0,-0x1);return null;}function multiplyByTimeUnit(B,Q){if(Q==null)return B;return{'operator':'mul','operands':[{'isOperand':!![],'value':B},{'isOperand':!![],'value':Q}]};}const Identifier$1=Use(/([^,.:\/'"{}[\]()/\s]+)/),SingularizedIdentifier=Node(Identifier$1,([B])=>singularize(B)??B),MultiWordIdentifier=Use(/([^,.:\/'"{}[\]()/]+)\b/),Reference$1=(B,{context:Q}={})=>Lazy(()=>Sanitize$1(Recursive(()=>{const a=Any(Node(All('.',MultiWordIdentifier),([X])=>({'get':X})),Node(Wrap({'left':'[','right':']'},Any(IntegerNumberLiteral,QuotedInterpolatedStringLiteral,UnquotedInterpolatedStringLiteral({'escape':/[\]]/}))),([X])=>({'get':X}))),c=Node(RegExpLiteral,([X])=>({'match':X}));return Mark(Any(Node(Wrap({'left':'{%','right':'%}'},UnquotedJSExpressionLiteral({'char':/(?!%})./})),([X])=>{return{'isJSExpressionRef':!![],'expression':X,'type':B};}),Node(Wrap({'left':'{','right':'}'},All(MultiWordIdentifier,Star(Any(a,c)))),([X,...f],J)=>{let Y;if(X==='it'&&J['context']['has']('reference'))Y={...J['context']['reference'],'modifiers':[...J['context']['reference']?.['modifiers']??[],...f],'type':B};else{Y={'isRef':!![],'name':X,'modifiers':f,'type':B};if(J['collections']['bindings']['find'](h=>h['names']['includes'](X['toLowerCase']())))Y['binding']=!![];}return J['collections']['references']['push'](Y),Y;})),{'type':'reference','subtype':Q});}))),VerboseReference=Any(Lazy(()=>{return Mark(Node(All(Optional(The),Optional(Last$1),HttpResponse,Optional(Any(Node(HttpBody,()=>[{'get':'body'}]),Node(All(HttpCookie,InterpolatedStringLiteral$1),([B])=>[{'get':'cookies'},{'get':B}]),Node(All(HttpHeader$1,InterpolatedStringLiteral$1),([B])=>[{'get':'headers'},{'get':B}])))),([B],Q)=>{const a={'isRef':!![],'name':'response','modifiers':B,'type':'string'};return Q['collections']['references']['push'](a),a;}),{'type':'reference'});}),Mark(Node(All(Optional(The),Optional(Last$1),JavaScript,Optional(Evaluation),Result),(B,Q)=>{const a={'isRef':!![],'name':'js-result','type':'string'};return Q['collections']['references']['push'](a),a;}),{'type':'reference'}),Lazy(()=>{const B=Any(Node(Url$4,()=>({'type':'string','modifiers':[{'get':'url'}]})),Node(Title$1,()=>({'type':'string','modifiers':[{'get':'title'}]})),Node(HttpStatusCode,()=>({'type':'number','modifiers':[{'get':'status'}]})),Node(Width,()=>({'type':'number','modifiers':[{'get':'width'}]})),Node(Height,()=>({'type':'number','modifiers':[{'get':'height'}]})),Node(All(HttpCookie,InterpolatedStringLiteral$1),([Q])=>({'type':'string','modifiers':[{'get':'cookies'},{'get':Q}]})),Node(All(HttpHeader$1,InterpolatedStringLiteral$1),([Q])=>({'type':'string','modifiers':[{'get':'headers'},{'get':Q}]})));return Mark(Node(Any(All(Optional(The),B,Of,Any(The,This),Optional(Current),WebPage),All(Possessive(WebPage),B)),([{type:Q,modifiers:a}],c)=>{const X={'isRef':!![],'name':'page','modifiers':a,'type':Q};return c['collections']['references']['push'](X),X;}),{'type':'reference'});}));function GroupedDigits(B){return'[1-9](?:'+groupSeparatorPattern(B)+'(?=\x5cd{3})|\x5cd)*';}function NumberLiteral(B,Q){const a=new Map();return Mark(Dynamic(c=>{const X=numberFormat(c['options']['locale']);let f=a['get'](X);return!f&&(f=Node(Use(new RegExp('('+B(X)+')')),([J],Y)=>Q(normalizeNumericString(J,Y['options']['locale']))),a['set'](X,f)),f;}),{'type':'number'});}const NaturalNumberLiteral=NumberLiteral(GroupedDigits,Number['parseInt']),NonnegativeDecimalNumberLiteral=NumberLiteral(B=>'(?:0|'+GroupedDigits(B)+')?'+RegExp['escape'](B['decimal'])+'\x5cd+',Number['parseFloat']),DecimalNumberLiteral=NumberLiteral(B=>'[-+]?(?:0|'+GroupedDigits(B)+')'+RegExp['escape'](B['decimal'])+'\x5cd+',Number['parseFloat']),NonnegativeIntegerNumberLiteral=NumberLiteral(B=>'0|'+GroupedDigits(B),Number['parseInt']),IntegerNumberLiteral=NumberLiteral(B=>'[-+]?(?:0|'+GroupedDigits(B)+')',Number['parseInt']),NumericLiteral=Any(DecimalNumberLiteral,IntegerNumberLiteral),NonnegativeRationalNumberLiteral=Node(Mark(All(NonnegativeIntegerNumberLiteral,All('/',NaturalNumberLiteral)),{'type':'number'}),([B,Q])=>B/Q),RationalNumberLiteral=Node(Mark(All(IntegerNumberLiteral,All('/',NaturalNumberLiteral)),{'type':'number'}),([B,Q])=>B/Q),CardinalNumberLiteral=Node(Mark(Any(NoBoundary(All(CardinalNumeralTen,Optional(All(Optional(/and|-/i),CardinalNumeralDigit)))),CardinalNumeralTeen,CardinalNumeralDigit),{'type':'number'}),B=>B['reduce']((Q,a)=>Q+cardinalNumeralToNumber(a),0x0)),OrdinalNumberLiteral$1=Mark(Any(Node(Use(/(\d*(?:(?:[0|4-9]|1\d)th|1st|2nd|3rd))/i),([B])=>Number['parseInt'](B)),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(/and|-/i),OrdinalNumeralDigit)),OrdinalNumeralTen,OrdinalNumeralTeen,OrdinalNumeralDigit),B=>B['reduce']((Q,a)=>Q+ordinalNumeralToNumber(a),0x0))),{'type':'number'}),FractionalNumberLiteral=Mark(Any(Node(All(Any(Node(Zero,()=>0x0),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(All(Optional(/and|-/i),CardinalNumeralTeen)))),CardinalNumeralTeen,CardinalNumeralDigit),B=>B['reduce']((Q,a)=>Q+cardinalNumeralToNumber(a),0x0))),Optional('-'),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(/and|-/i),DenominatorNumeralDigit)),DenominatorNumeralTen,DenominatorNumeralTeen,DenominatorNumeralDigit),B=>B['reduce']((Q,a)=>Q+denominatorNumeralToNumber(a),0x0))),([B,Q])=>B/Q),Node(FractionNumeral,([B])=>fractionalNumeralToNumber(B))),{'type':'number'}),QuantitativeNumberLiteral=Any(NonnegativeDecimalNumberLiteral,NonnegativeRationalNumberLiteral,NaturalNumberLiteral,FractionalNumberLiteral,CardinalNumberLiteral),PercentageNumberLiteral=Node(NoBoundary(All(Any(NonnegativeDecimalNumberLiteral,NonnegativeIntegerNumberLiteral),'%')),([B])=>B/0x64),IterativeNumberLiteral=Node(IterativeNumeral,([B])=>iterativeNumeralToInteger(B)),MultiplicativeNumberLiteral=Node(MultiplicativeNumeral,([B])=>multiplicativeNumeralToInteger(B)),IntegerNumberExpression=Any(Reference$1('number'),IntegerNumberLiteral,CardinalNumberLiteral),CardinalNumberExpression=Any(Reference$1('number'),NaturalNumberLiteral,CardinalNumberLiteral),IterativeNumberExpression=Any(Reference$1('number'),IterativeNumberLiteral),OrdinalNumberExpression$1=Any(Reference$1('number'),OrdinalNumberLiteral$1),NullLiteral=Node(/null|nil/i,()=>null),TimeUnitLiteral=Any(Node(/milliseconds?|millis|msecs?|ms/i,()=>0x1),Node(/seconds?|secs?|s/i,()=>0x3e8),Node(/minutes?|mins?|m/i,()=>0xea60)),TimeIntervalLiteral=Node(NoBoundary(All(Any(QuantitativeNumberLiteral,Nothing$1(0x1)),Optional(IndefiniteArticle),TimeUnitLiteral)),([B,Q])=>B*Q),RegExpLiteral=Node(Use(/\/([^/]+)\/([gimsuy]*)/),([B,Q])=>{return{'isPattern':!![],'pattern':B,'flags':Q};}),NamedPattern=Node(Any(Node(Number$1,()=>'number'),Node(Price$1,()=>'price'),Node(Percentage$1,()=>'percentage'),Node(Date$1,()=>'date'),Node(Time,()=>'time'),Node(Code,()=>'code')),([B])=>{return{'isPattern':!![],'name':B};}),QuotedStringLiteral=Customizable((B={})=>{const Q=B['char']??/./,a=Node(Use(new RegExp(String['raw']`"((?:(?:\\["\\nt])|(?:(?!["])${Q['source']}))*)"`)),([X])=>normalizeString(X,/["]/)),c=Node(Use(new RegExp(String['raw']`'((?:(?:\\['\\nt])|(?:(?!['])${Q['source']}))*)'`)),([X])=>normalizeString(X,/[']/));return Node(Any(Mark(a,{'type':'string','subtype':'double\x20quoted'}),Mark(c,{'type':'string','subtype':'single\x20quoted'})),([X])=>normalizeString(X,/['"]/));}),QuotedInterpolatedStringLiteral=Customizable((B={})=>{const Q=B['char']??/./,a=Node(Use(new RegExp(String['raw']`({?(?:(?:\\["{\\nt])|(?:(?!["{])${Q['source']}))+|{)`)),([f])=>normalizeString(f,/["]/)),c=Node(Use(new RegExp(String['raw']`({?(?:(?:\\['{\\nt])|(?:(?!['{])${Q['source']}))+|{)`)),([f])=>normalizeString(f,/[']/)),X=Use(/(\s+)/);return Raw(Node(Any(Mark(Wrap('\x22',Star(Any(X,Reference$1('string',{'context':'double\x20quoted\x20string\x20chunk'}),a))),{'type':'string','subtype':'double\x20quoted'}),Mark(Wrap('\x27',Star(Any(X,Reference$1('string',{'context':'single\x20quoted\x20string\x20chunk'}),c))),{'type':'string','subtype':'single\x20quoted'})),f=>{f=f['reduce']((J,Y)=>{if(typeof Y==='string'){if(typeof J['at'](-0x1)==='string')J[J['length']-0x1]+=Y;else J['push'](Y);}else J['push'](Y);return J;},[]);if(f['length']===0x0)return'';else{if(f['length']===0x1&&typeof f[0x0]==='string')return f[0x0];else return{'isInterpolatedString':!![],'chunks':f};}}));});function excludeParens(B){return new RegExp(B['source']+'|[()]');}const UnquotedStringLiteral$1=Customizable((B={})=>{const Q=B['char']??/[^,\s]/,a=B['escape']??/[]/,c=B['allowParens']?a:excludeParens(a),X=B['weak'],f=Use(new RegExp('((?:(?![\x27\x22]|'+c['source']+')'+Q['source']+')+)'));return Mark(X?NonEmpty(Weak(f)):f,{'type':'string','subtype':'unquoted'});}),UnquotedInterpolatedStringLiteral=Customizable((B={})=>{const Q=B['char']??/[^,\s]/,a=B['escape']??/[]/,c=B['allowParens']?a:excludeParens(a),X=B['weak'],f=Use(new RegExp(String['raw']`({?(?:(?:\\(?:[{\\nt]|${c['source']}))|(?:(?![{]|${c['source']})${Q['source']}))+|{)`)),J=Node(Plus$1(Any(All(Not(/["'\s]/),Reference$1('string',{'context':'unquoted\x20string\x20chunk'})),f)),Y=>{Y=Y['map'](h=>typeof h==='string'?normalizeString(h,c):h);if(Y['length']===0x1)return Y[0x0];else return{'isInterpolatedString':!![],'chunks':Y};});return Raw(Mark(X?NonEmpty(Weak(J)):J,{'type':'string','subtype':'unquoted'}));}),StandaloneInterpolatedStringLiteral=Customizable((B={})=>{const Q=B['char']??/./,a=Use(new RegExp(String['raw']`({?(?:(?:\\[{\\nt])|(?:(?![{])${Q['source']}))+|{)`));return Raw(Node(Mark(Star(Any(Use(/(\s+)/),Reference$1('string',{'context':'standalone\x20string\x20chunk'}),a)),{'type':'string','subtype':'standalone'}),c=>{c=c['reduce']((X,f)=>{if(typeof f==='string'){f=normalizeString(f);if(typeof X['at'](-0x1)==='string')X[X['length']-0x1]+=f;else X['push'](f);}else X['push'](f);return X;},[]);if(c['length']===0x0)return'';else{if(c['length']===0x1)return c[0x0];else return{'isInterpolatedString':!![],'chunks':c};}}));}),StringLiteral$1=Customizable((B={})=>{return Any(QuotedStringLiteral(B),UnquotedStringLiteral$1(B));}),InterpolatedStringLiteral$1=Customizable((B={})=>{return Any(QuotedInterpolatedStringLiteral(B),UnquotedInterpolatedStringLiteral(B));}),QuotedStringExpression=Customizable((B={})=>{return Any(Reference$1('string'),VerboseReference,QuotedInterpolatedStringLiteral(B));}),UnquotedStringExpression=Customizable((B={})=>{return Any(VerboseReference,UnquotedInterpolatedStringLiteral(B));}),StringExpression$1=Customizable((B={})=>{return LogGroup({'name':'StringExpression','collapsed':![]},Any(VerboseReference,InterpolatedStringLiteral$1(B)));}),StandaloneStringExpression=StandaloneInterpolatedStringLiteral,QuotedJSExpressionLiteral=Lazy(()=>{return Raw(Mark(Node(Any(Wrap('\x22',Star(Any(Reference$1('any'),Use(/(\{?(?:\\["{\\]|[^"{])+)/)))),Wrap('\x27',Star(Any(Reference$1('any'),Use(/(\{?(?:\\['{\\]|[^'{])+)/))))),B=>{return B=B['map'](Q=>typeof Q==='string'?Q['replace'](/\\(["'{\\])/g,'$1'):Q),{'isJSExpression':!![],'chunks':B};}),{'type':'js\x20code'}));}),UnquotedJSExpressionLiteral=Customizable((B={})=>{const Q=B['char'];return Raw(Mark(Node(Q?Star(Any(Reference$1('any'),Use(new RegExp(String['raw']`(\{?(?:\\[{\\]|(?![{])${Q['source']})+)`)))):As$1(Anything$1,Star(Any(Reference$1('any'),Use(/(\{?(?:\\[{\\]|[^{])+)/)))),a=>{return a=a['map'](c=>typeof c==='string'?c['replace'](/\\(["'{\\])/g,'$1'):c),{'isJSExpression':!![],'chunks':a};}),{'type':'js\x20code'}));}),JSExpressionLiteral$1=Customizable((B={})=>{return Any(QuotedJSExpressionLiteral,UnquotedJSExpressionLiteral(B));}),StructureLiteral$1=Lazy(()=>Recursive(B=>{const Q=Any(Reference$1('string'),Use(/([^:'",\s]+)/),InterpolatedStringLiteral$1),a=Any(Reference$1('any'),B,PrimitiveLiteral({'escape':/[\]]/})),c=Any(Reference$1('any'),B,PrimitiveLiteral({'escape':/[\}]/}));return Any(Node(Mark(Wrap({'left':'[','right':']'},Optional(List(a,','))),{'type':'array'}),X=>({'isStructure':!![],'type':'array','items':X})),Node(Mark(Wrap({'left':'{','right':'}'},Optional(List(Node(All(Mark(Q,{'type':'record\x20key'}),':',c),([X,f])=>({'key':X,'value':f})),','))),{'type':'record'}),X=>({'isStructure':!![],'type':'record','items':X})));})),BooleanLiteral=Any(Node(/true/i,()=>!![]),Node(/false/i,()=>![]));Any(Reference$1('boolean'),BooleanLiteral);const PrimitiveLiteral=Customizable((B={})=>{return Any(NullLiteral,BooleanLiteral,RationalNumberLiteral,DecimalNumberLiteral,IntegerNumberLiteral,InterpolatedStringLiteral$1(B));}),Url$3=Mark(StringExpression$1,{'type':'secret','regexp':/(?<=^[^:]+:\/\/.+(?:(?=(?<!\\){)|:)).+(?=@.+)/}),ExplicitUrl=Mark(Stringish(Use(/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/)),{'type':'secret','regexp':/(?<=^[^:]+:\/\/.+(?:(?=(?<!\\){)|:)).+(?=@.+)/}),Viewport=Node(All(Optional(The),Viewport$1),()=>({'isViewportDescriptor':!![]})),Dialog=Node(All(Optional(The),BrowserDialog),(B,Q)=>{const a={'isDialogDescriptor':!![]};return Q['context']['element']=a,a;}),{Apply:Apply$30,Mutate:Mutate$30}=State({'isDialogElementDescriptor':!![]}),ButtonTitle$1=Any(Mutate$30(Stringish(Accept),B=>B['title']='ok'),Mutate$30(Stringish(Dismiss),B=>B['title']='cancel')),TextboxTitle$1=Mutate$30(Stringish(/prompt|answer/i),B=>B['title']='prompt'),DialogButton=Effect(Apply$30(All(Optional(The),Any(All(Optional(Possessive(BrowserDialog)),ButtonTitle$1),All(ButtonTitle$1,Optional(Possessive(BrowserDialog)))),Optional(Button))),([B],Q)=>Q['context']['element']=B),ExplicitDialogButton=Effect(Apply$30(All(Optional(The),Any(All(Possessive(BrowserDialog),ButtonTitle$1),All(ButtonTitle$1,Possessive(BrowserDialog))),Optional(Button))),([B],Q)=>Q['context']['element']=B),DialogTextbox=Effect(Apply$30(All(Optional(The),Optional(Possessive(BrowserDialog)),TextboxTitle$1,Optional(Textbox))),([B],Q)=>Q['context']['element']=B),ExplicitDialogTextbox=Effect(Apply$30(All(Optional(The),Possessive(BrowserDialog),TextboxTitle$1,Optional(Textbox))),([B],Q)=>Q['context']['element']=B),RelativeAnchor=({Element:B})=>Any(Node(All(Near,B),([Q])=>({'position':'near','element':Q})),Node(All(RelativePosition,Optional(Of),B),([Q,a])=>({'position':Q,'element':a}))),AbsoluteAnchor=({Element:B})=>{const Q=Any(Viewport,Dialog,B),a=Node(PostCondition(List(B({'anchor':![]}),Inside),c=>c['length']>=0x2&&c['every'](X=>X['type']&&X['type']===c[0x0]['type'])),c=>{return c['reduceRight']((X,f)=>(attachAnchor(f,{'position':'inside','element':X}),f));});return Longest(Node(All(Optional(LocationPreposition),AbsolutePosition$1,Optional(All(Any(LocationPreposition,Of),Q))),([c,X])=>X?{'position':c,'element':X}:{'position':c}),Node(All(Inside,WeakList(Any(a,Q),AndListSeparator)),c=>{const X=c['map'](f=>({'position':'inside','element':f}));return X['length']>0x1?X:X[0x0];}));},Anchor$3=B=>{return LogGroup('Anchor',Mark(Any(RelativeAnchor(B),AbsoluteAnchor(B)),{'type':'anchor'}));},NamedColor=Any(Node(/red/i,()=>'red'),Node(/blue/i,()=>'blue'),Node(/green/i,()=>'green'),Node(/yellow/i,()=>'yellow'),Node(/orange/i,()=>'orange'),Node(/purple/i,()=>'purple'),Node(/pink/i,()=>'pink'),Node(/brown/i,()=>'brown'),Node(/black/i,()=>'black'),Node(/white/i,()=>'white'),Node(/gr[ae]y/i,()=>'gray'),Node(/cyan/i,()=>'cyan'),Node(/magenta/i,()=>'magenta'),Node(/lime/i,()=>'lime'),Node(/navy/i,()=>'navy'),Node(/teal/i,()=>'teal'),Node(/maroon/i,()=>'maroon'),Node(/olive/i,()=>'olive'),Node(/aqua/i,()=>'aqua'),Node(/silver/i,()=>'silver'),Node(/gold/i,()=>'gold'),Node(/indigo/i,()=>'indigo'),Node(/violet/i,()=>'violet'),Node(/crimson/i,()=>'crimson'),Node(/coral/i,()=>'coral'),Node(/salmon/i,()=>'salmon'),Node(/turquoise/i,()=>'turquoise'),Node(/lavender/i,()=>'lavender'),Node(/khaki/i,()=>'khaki'),Node(/tan/i,()=>'tan'),Node(/beige/i,()=>'beige'),Node(/ivory/i,()=>'ivory'),Node(/plum/i,()=>'plum'),Node(/azure/i,()=>'azure'),Node(/mint/i,()=>'mint'),Node(/peach/i,()=>'peach')),EncodedColor=Any(Use(/(rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\))/i),Use(/(rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d*\.?\d+\s*\))/i),Use(/(cmyk\(\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\))/i),Use(/(hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\))/i),Use(/(#[0-9A-F]{3}(?:[0-9A-F]{3})?)/i)),Color$1=Any(EncodedColor,NamedColor),{Apply:Apply$29,Mutate:Mutate$29,state:state$3}=State({}),Type$3=Void(Mutate$29(Use(/(css|xpath)/i),(B,[Q])=>B['type']=Q['toLowerCase']())),Value$4=Mutate$29(Node(StringExpression$1({'allowParens':!![]}),([B],Q)=>({'type':state$3(Q)['type']??(typeof B==='string'&&['/','(','../','./','*/']['some'](a=>B['startsWith'](a))?'xpath':'css'),'selector':B})),(B,[{type:Q,selector:a}])=>{B['type']=Q,B['selector']=a;}),ElementSelector=Apply$29(All(Any(All(Type$3,Optional(All(Optional(Any('-',With,By)),Selector$1))),All(Nothing$1(void 0x0),Selector$1)),Mark(Value$4,{'type':'selector','mutate':(B,[Q])=>B['subtype']=Q['type']}))),NoopElementType=Element$3,AppElementType=Node(Any(WebPage,App$1),()=>'app'),groups={'control':['checkboxgroup','checkbox','radiogroup','radio','textbox','combobox','listbox','option','datepicker','timepicker','datetimepicker','colorpicker','filepicker','slider','inputbox','selectbox','valuebox','button','tab','color'],'structural':['ad','header','footer','popup','tooltip','form','menu','menuitem','hamburger','list','listitem','heading','table','table-cell','table-row','table-head-row','table-column','table-stub-column','table-head-cell','card','pdfpage','tablist','tabpanel'],'content':['text','link','label','logo','image','icon','video','paragraph']},definitions=[['tooltip',Tooltip],['button',Button],['radiogroup',RadioGroup],['radio',Radio],['textbox',Textbox],['checkboxgroup',CheckboxGroup],['checkbox',Checkbox],['combobox',Combobox],['listbox',Listbox],['option',Option$1],['colorpicker',ColorPicker],['datepicker',DatePicker],['timepicker',TimePicker],['datetimepicker',DateTimePicker],['filepicker',FilePicker],['slider',Slider],['inputbox',Inputbox],['selectbox',Selectbox],['valuebox',Valuebox],['pdfpage',PdfPage$1],['ad',Ad],['table-head-cell',All(Optional(Table),Header$5,Cell)],['table-cell',All(Optional(Table),Cell)],['table-head-row',All(Optional(Table),Header$5,Row)],['table-row',All(Optional(Table),Row)],['table-stub-column',All(Optional(Table),Stub,Column)],['table-column',All(Optional(Table),Column)],['table',Table],['tabpanel',TabPanel],['tablist',TabList],['tab',Tab$1],['header',Header$5],['footer',Footer],['popup',Popup],['form',Form$1],['menuitem',MenuItem],['menu',Menu],['listitem',ListItem],['list',List$1],['hamburger',Hamburger],['heading',Heading],['card',Card],['text',Text$1],['link',Link],['logo',Logo],['image',Image],['icon',Icon],['paragraph',Paragraph]],pluralDefinitions=definitions['map'](([B,Q])=>[B,Plural$1(Q)]),ElementType$1=Customizable((B={})=>{function Q(a){if(!B?.['allowed'])return a['map'](([X,f])=>Node(f,()=>X));const c=new Set(B['allowed']['flatMap'](X=>groups[X]??X));return a['flatMap'](([X,f])=>c['has'](X)?[Node(f,()=>X)]:[]);}return Plural(Any(...Q(definitions)),Any(...Q(pluralDefinitions)));}),{Apply:Apply$28,Mutate:Mutate$28}=State({}),Type$2=Customizable(B=>{const Q=B?.['allowed']?.['filter'](c=>c!=='noop'),a=!Q||Q['length']<B['allowed']['length'];return Any(Mutate$28(ElementType$1({'allowed':Q}),(c,[X])=>c['type']=X),!Q||Q['includes']('textbox')?Mutate$28(Any(All(Stringish(Use(/(search)/i)),Plural(/bar|box/i,Plural$1(/bar|box/i))),Plural(Searchbox,Plural$1(Searchbox))),(c,[X='search'])=>{c['type']='textbox',c['title']=X;}):Never,a?Plural(NoopElementType,Plural$1(Element$3)):Never);}),App=Mutate$28(AppElementType,(B,[Q])=>B['type']=Q),IndexedPdfPage=Mutate$28(All(Optional(The),Any(All(Index(OrdinalNumberExpression$1),Any(PdfPage$1,Page)),All(Any(PdfPage$1,Page),Optional(Any(NumberSign,Number$1)),Index(CardinalNumberExpression)))),(B,[Q])=>(B['type']='pdfpage',B['nth']=Q)),ExplicitColor=Mutate$28(Any(All(Color$2,Any(EncodedColor,StringExpression$1)),All(Any(EncodedColor,StringExpression$1),Color$2)),(B,[Q])=>B['color']=Q),KnownColor=Mutate$28(Color$1,(B,[Q])=>B['color']=Q),Colorable=B=>Any(All(B,Any(With,Of),Optional(The),ExplicitColor),All(Optional(KnownColor),B)),Selector=Mutate$28(All(Optional(All(Any(With,By),Optional(The))),ElementSelector),(B,[Q])=>B['selector']=Q),ElementReference$1=Mutate$28(Reference$1('any'),(B,[Q])=>{B['reference']=Q;}),Title=Customizable(({weak:B}={})=>Mutate$28(Any(All(Optional(All(Having,Optional(The))),NamedPattern),All(Named,Mark(StringExpression$1,{'type':'text'})),Mark(StringExpression$1({'weak':B}),{'type':'text'})),(Q,[a])=>{Q['title']=a;if(typeof a==='string'&&isSecretName(a))Q['secret']=!![];})),Nth=Mutate$28(Index(OrdinalNumberExpression$1),(B,[Q])=>B['nth']=Q),Last=Mutate$28(Any(Last$1,Bottom),B=>B['orderDirection']='backward'),ExplicitIndex=Mutate$28(All(Any(With,At),Optional(The),Index$1,Optional(NumberSign),IntegerNumberExpression),(B,[Q])=>B['nth']=Q),SearchOrder=Any(Mutate$28(/from\s+(?:the\s+)?(?:beginning|top)/i,B=>B['orderDirection']='forward'),Mutate$28(/from\s+(?:the\s+)?(?:end|bottom)/i,B=>B['orderDirection']='backward')),ElementAnchor=B=>Mutate$28(Anchor$3({'Element':B}),(Q,[a])=>attachAnchor(Q,a)),AbsolutePositionAnchor=Mutate$28(OrthogonalAbsolutePosition,(B,[Q])=>attachAnchor(B,{'position':Q})),TypeAnchor=Mutate$28(All(Optional(The),Any(All(Nothing$1(void 0x0),Possessive(AppElementType,{'strict':!![]})),All(Node(Optional(OrthogonalAbsolutePosition),([B])=>B&&{'position':B}),Possessive(ElementType$1({'allowed':['structural']})))),Not(Any(Near,Inside,RelativePosition))),(B,[Q,a])=>attachAnchor(B,{'position':'inside','element':Q?{'type':a,'anchor':Q}:{'type':a}})),Element$2=Recursive((B,{depth:Q})=>{return Customizable(a=>{const c=PreCondition(O=>a?.['reference']!==![]&&O['collections']['bindings']['length']===0x0,ImplicitElement),X=a?.['explicit']&&Q===0x0,f=a?.['anchor']!==![],J=!!a?.['types']&&!a['types']['includes']('noop'),Y=Type$2({'allowed':a?.['types']}),h=f?List(ElementAnchor(B(a)),AndListSeparator):Never,V=X?All(The,ElementReference$1):All(Optional(The),ElementReference$1),k=All(Optional(The),Any(All(Y,Selector),All(Selector,Optional(Y)))),t=Void(Any(All(Optional(The),Any(Last,ElementReference$1),Colorable(Y),Optional(h)),All(Optional(The),Optional(Any(AbsolutePositionAnchor,Nth)),Optional(The),Any(All(Colorable(Y),Optional(ExplicitIndex),Any(All(SearchOrder,Optional(Selector)),f?All(Optional(Selector),h):Never,All(Title({'weak':!![]}),Optional(Selector),Optional(h)),Optional(Selector))),All(Colorable(All(Title,Any(All(TypeAnchor,Y),Y))),Optional(ExplicitIndex),Optional(Selector),Optional(h)))))),K=PostCondition(All(Optional(The),Optional(Any(Nth,Last)),Any(All(Title,NonEmpty(All(Optional(ExplicitIndex),Optional(Selector),Optional(h)))),Title({'weak':!![]}))),(O,S,C)=>!X||!test(StringExpression$1,S['text']['substring'](C['pos'],S['pos'])));return Any(c,Effect(LogGroup('ElementDescriptor',Mark(Apply$28(Any(IndexedPdfPage,k,Longest(V,f?All(TypeAnchor,t):Never,Any(t,Article(App),J?Never:K),f&&!J?All(TypeAnchor,K):Never))),{'type':'element\x20descriptor'})),([O],S)=>{if(O['type']!=='app')S['context']['element']=O;const C=O['title']&&typeof O['title']==='object'&&'isRef'in O['title']?O['title']:O['reference']&&'isRef'in O['reference']?O['reference']:void 0x0;if(C){const G=variableNameToElementType(C['name']);G&&(O['hints']=O['hints']??{},O['hints']['type']=[G]);}if(O['nth']!==void 0x0&&!O['title']){if(O['type']==='table-row')O['type']='table-leaf-row';if(O['type']==='table-column')O['type']='table-leaf-column';}if(Array['isArray'](O['anchor'])){function E(e){if(!e)return![];return(Array['isArray'](e)?e:[e])['some'](H=>['table-column','table-row','table-leaf-column','table-leaf-row','table-stub-column','table-head-row']['includes'](H));}const W=O['anchor']['filter'](e=>e['position']==='inside'&&e['element']&&!('isViewportDescriptor'in e['element'])&&!('isDialogDescriptor'in e['element'])&&!('isElementReference'in e['element'])&&E(e['element']['type']));if(W['length']>0x0){const e=W[W['length']-0x1];function H(I){if(I['type']==='table')return{'position':'inside','element':I};if(I['anchor']&&!Array['isArray'](I['anchor'])&&I['anchor']['position']==='inside'&&I['anchor']['element']&&!('isViewportDescriptor'in I['anchor']['element'])&&!('isDialogDescriptor'in I['anchor']['element']))return H(I['anchor']['element']);}const q=H(e['element']);if(q){const I=O['anchor']['indexOf'](e);O['anchor']=O['anchor']['map']((n,R)=>{if(R===I||!W['includes'](n))return n;if(H(n['element']))return n;const F=structuredClone(n);return attachAnchorAtDeepest(F['element'],q),F;});}}}}));});}),ExplicitElement=Lazy(()=>Element$2({'explicit':!![]})),StringElement=Apply$28(Title),PageElement=Apply$28(All(Optional(The),App)),ImplicitElement=Customizable(({contextual:contextual=![]}={})=>{function B(a,c){const X=a['context']['has']('element')?a['context']['element']:void 0x0;return{'isElementReference':!![],...c?{'type':c}:{},...X?.['secret']?{'secret':!![]}:{}};}const Q=Mark(Any(Node(It,(a,c)=>B(c)),Node(All(Demonstrative,Any(ElementType$1(),Node(Element$3,()=>void 0x0))),([a],c)=>B(c,a))),{'type':'element\x20reference'});return contextual?PreCondition(a=>a['context']['has']('element'),Q):Q;}),extractTypes={'number':'amount','price':'price','percentage':'percentage'},ElementValueExtractor=Customizable(({Element:Element=Element$2}={})=>{const B=Any(Node(All(Optional(Any(Node(Mark(Background,{'type':'color-type','subtype':'background'}),()=>'background-color'),Node(Mark(Any(Foreground,Text$1),{'type':'color-type','subtype':'foreground'}),()=>'foreground-color'))),Color$2),([Q])=>Q??'color'),Node(Value$5,()=>'any'),Node(String$1,()=>'string'));return Mark(Node(Any(Node(All(Optional(The),B,Any(All(Any(Of,From,LocationPreposition),Element),Node(Anchor$3({'Element':Element}),([Q])=>({'anchor':Q})))),([Q,a])=>({'operator':'extract','operands':[{'isOperand':!![],'value':a},Q]})),Node(All(ExplicitElement,B),([Q,a])=>({'operator':'extract','operands':[{'isOperand':!![],'value':Q},a]})),Node(PostCondition(All(ExplicitElement,NamedPattern),([Q,a])=>!('isElementReference'in Q)&&Q['title']!=null&&!(typeof Q['title']==='object'&&'isPattern'in Q['title'])&&'name'in a&&a['name']in extractTypes),([Q,a])=>({'operator':'extract','operands':[{'isOperand':!![],'value':Q},extractTypes[a['name']]]})),Node(PostCondition(Element,([Q])=>!!(Q['type']==='text'&&!(Q['nth']||Q['title'])&&Q['anchor']&&(!Array['isArray'](Q['anchor'])||Q['anchor']['length']===0x1))),([Q])=>{return{'operator':'extract','operands':[{'isOperand':!![],'value':(Array['isArray'](Q['anchor'])?Q['anchor'][0x0]:Q['anchor'])['element']},'string']};})),([Q],a)=>{return a['collections']['extractors']['push'](Q),Q;}),{'type':'extractor'});}),Op=(B,Q)=>Node(B,()=>Q),SymbolicAddSubOperator=Mark(Any(Op(PlusSymbolic,'add'),Op(MinusSymbolic,'sub')),{'type':'operator'}),SymbolicMulDivOperator=Mark(Any(Op(MultiplySymbolic,'mul'),Op(DivisionSymbolic,'div')),{'type':'operator'}),AddSubOperator=Mark(Any(Op(Plus,'add'),Op(Minus,'sub')),{'type':'operator'}),MulDivOperator=Mark(Any(Op(Multiply,'mul'),Op(Division,'div')),{'type':'operator'}),VerboseOperationWord=Mark(Any(Op(Sum,'add'),Op(Difference,'sub'),Op(Product,'mul'),Op(Quotient,'div')),{'type':'operator'}),numberOperatorSymbols={'add':'+','sub':'-','mul':'*','div':'/'};function toOperand(B,Q){const a={'isOperand':!![],'value':B['value']};return Q['collections']['operands']['push'](a),a;}function reduceChainToOperation([B,...Q],a){return Q['reduce']((c,{operator:X,expression:f})=>{return{'value':{'operator':X,'operands':[toOperand(c,a),toOperand(f,a)]}};},B);}function reducePercentAwareChainToOperation([B,...Q],a){return Q['reduce']((c,{operator:X,expression:f})=>{const J=f['isPercent']?{'value':{'operator':'mul','operands':[toOperand(f,a),toOperand(c,a)]}}:f;return{'value':{'operator':X,'operands':[toOperand(c,a),toOperand(J,a)]}};},B);}const ArithmeticOperation=Customizable(({symbolic:symbolic=![]}={})=>{const B=symbolic?SymbolicAddSubOperator:AddSubOperator,Q=symbolic?SymbolicMulDivOperator:MulDivOperator;return Node(PostCondition(Recursive(a=>{const c=Node(All(Optional(The),VerboseOperationWord,Of,PostCondition(List(a,AndListSeparator),J=>J['length']>=0x2)),([J,Y,...h],V)=>h['reduce']((k,t)=>({'value':{'operator':J,'operands':[toOperand(k,V),toOperand(t,V)]}}),Y)),X=Any(Wrap({'left':'(','right':')'},a),PreCondition(()=>!symbolic,c),Node(All(PercentageNumberLiteral,Of,Lazy(()=>X)),([J,Y],h)=>({'value':{'operator':'mul','operands':[toOperand({'value':J},h),toOperand(Y,h)]}})),Node(PercentageNumberLiteral,([J])=>({'value':J,'isPercent':!![]})),Node(Lazy(()=>ElementValueExtractor),([J])=>({'value':J})),Node(Reference$1('number'),([J])=>({'value':J})),Node(Any(RationalNumberLiteral,NumericLiteral),([J])=>({'value':J}))),f=Node(All(X,Star(Node(All(Q,X),([J,Y])=>({'operator':J,'expression':Y})))),reduceChainToOperation);return Node(All(f,Star(Node(All(B,f),([J,Y])=>({'operator':J,'expression':Y})))),reducePercentAwareChainToOperation);}),([a])=>isNumberOperation(a['value'])||!symbolic&&a['isPercent']===!![]),([a])=>a['value']);}),QuantitativeNumberExpression=Any(ArithmeticOperation({'symbolic':!![]}),Reference$1('number'),QuantitativeNumberLiteral),TimeIntervalExpression=Any(Node(NoBoundary(All(ArithmeticOperation({'symbolic':!![]}),Optional(All(Optional(IndefiniteArticle),TimeUnitLiteral)))),([B,Q])=>multiplyByTimeUnit(B,Q)),Node(NoBoundary(All(Reference$1('number'),Optional(TimeUnitLiteral))),([B,Q])=>multiplyByTimeUnit(B,Q)),TimeIntervalLiteral),AnyExpression$1=Any(ArithmeticOperation,Reference$1('any'),VerboseReference,StructureLiteral$1,PrimitiveLiteral),AnyVerboseExpression=Customizable((B={})=>{return Any(ArithmeticOperation,Reference$1('any'),VerboseReference,StructureLiteral$1,CardinalNumberLiteral,FractionalNumberLiteral,PrimitiveLiteral(B));}),IsWrapperOperator=B=>{return Node(All(Any(Node(/not|isn't|is\s+not|aren't|are\s+not|do(?:es)?n't|do(?:es)?\s+not|(?:can't|can\s+not)(\s+be)?|ha(?:ve|s)(?:n't|\s+not)\s+been/i,()=>![]),Node(/is|are|does|be|(?:to|can)(?:\s+be)?|(?:have|has)\s+been/i,()=>!![]),Nothing$1(!![])),B),([Q,a])=>{return Q?a:(...c)=>not(a(...c));});},IgnoreCase=Node(/case[\s-]?insensitive|(?:ignor(?:e|ing))\s+(?:cas(?:e|ing))/i,()=>ignoreCase),MatchCase=Node(/case[\s-]?sensitive|(?:match(?:ing)?|respect(?:ing)?)\s+(?:cas(?:e|ing))/i,()=>matchCase),ParensOperator=B=>{return Node(Wrap({'left':'(','right':')'},B),([Q])=>parens(Q));},BooleanOperator=Any(Node(/(?:,\s+)?(?:and|but)|,/i,()=>and),Node(/(?:,\s+)?or/i,()=>or)),IsOperator=Any(Node(/not|is(?:n't|\s+not)|are(?:n't|\s+not)|do(?:es)?(n't|\s+not)/,()=>(B,Q)=>not(eq$1(B,Q))),Node(/be|is|are|do(?:es)?/,()=>eq$1)),ComparisonOperator=Any(Node(/==?=?|equals?(?:\s+to)?|the\s+same\s+as|eq/i,()=>eq$1),Node(/!==?|different\s+(?:from|than)/i,()=>(B,Q)=>not(eq$1(B,Q))),Node(/>=|(?:greater|bigger|larger|more)\s+or\s+equals?\s(?:to|than)|gte/i,()=>gte$1),Node(/>|(?:greater|bigger|larger|more)\s+than|gt/i,()=>gt$1),Node(/<=|(?:lower|smaller|less)\s+or\s+equals?\s(?:to|than)|lte/i,()=>lte$1),Node(/<|(?:lower|smaller|less)\s+than|lt/i,()=>lt$1)),ValidateOperator=Node(Any(Node(Use(/(lower|upper|camel|pascal|snake|kebab)[\s-]?case/i),([B])=>B['toLowerCase']()+'case'),Node(/capitalized/i,()=>'capitalized'),Node(/(?:numeric|a\s+number)/i,()=>'numeric'),Node(/alpha-?numeric/i,()=>'alphanumeric')),([B])=>{return Q=>validate$1(Q,B);}),MatchOperator=Node(All(Optional(/match(?:es)?(?:(?:\s+the)?\s+(?:regexp?|rex|pattern|regular(?:-|\s+)expression))?/i),RegExpLiteral),([B])=>{return Q=>match$1(Q,B);}),SizeValidationOperator=Any(Node(/empty/i,()=>{return B=>eq$1({'isOperand':!![],'value':size(B)},{'isOperand':!![],'value':0x0});}),Node(/nonempty/i,()=>{return B=>gt$1({'isOperand':!![],'value':size(B)},{'isOperand':!![],'value':0x0});}),Node(All(/includes?|contains?|have|has/i,CardinalNumberExpression,Any(CollectionItems,CollectionPairs,CollectionValues,CollectionKeys)),([B])=>{return Q=>gte$1({'isOperand':!![],'value':size(Q)},{'isOperand':!![],'value':B});})),IncludesOnlyOperator=Node(All(/includes?|contains?|have|has/i,Only,Optional(Any(Node(All(Optional(The),CollectionValues),()=>values),Node(All(Optional(The),Any(All(CollectionKeys,Optional(/named|names?/i)),All(Any(CollectionItems,CollectionPairs),/named|names?/i))),()=>keys),Node(All(Optional(The),CollectionItems),()=>entries)))),([B])=>{return(Q,a)=>includesOnly$1(B?{'isOperand':!![],'value':B(Q)}:Q,a);}),IncludesOperator=Node(All(/includes?|contains?|have|has/i,Optional(Any(Node(All(Optional(The),CollectionValues),()=>values),Node(All(Optional(The),Any(All(CollectionKeys,Optional(/named|names?/i)),All(Any(CollectionItems,CollectionPairs),/named|names?/i))),()=>keys),Node(All(Optional(The),CollectionItems),()=>entries)))),([B])=>{return(Q,a)=>includes$1(B?{'isOperand':!![],'value':B(Q)}:Q,a);}),StartsWithOperator=Node(/starts?\s+with/i,()=>startsWith$1),EndsWithOperator=Node(/ends?\s+with/i,()=>endsWith$1),VisibleOperator=Node(All(/visible|shown|shows?(?:\s+up)?|appears?|apparent|displayed/i,Optional(Anchor$3({'Element':Element$2}))),([B])=>{if(B)return Q=>{const a=Q['value'];return visible$1({'isOperand':!![],'value':{...a,'anchor':a['anchor']?[a['anchor'],B]['flat']():B}});};else return visible$1;}),InvisibleOperator=Node(All(/invisible|hidden|disappear/i,Optional(Anchor$3({'Element':Element$2}))),()=>B=>not(visible$1(B))),ClickableOperator=Node(/clickable|clicked/i,()=>clickable$1),EnabledOperator=Node(/enabled/i,()=>enabled$1),DisabledOperator=Node(/disabled/i,()=>B=>not(enabled$1(B))),CheckedOperator=Node(/checked|ticked/i,()=>B=>checked$1(B,!![])),UncheckedOperator=Node(/unchecked|unselected|unticked/i,()=>B=>checked$1(B,![])),PopulatedOperator=Node(/populated|entered|set|filled(?:\s+in)?|(?:have|has)(?:\s+an?)?\s+value|holds?\s+input/i,()=>B=>populated$1(B)),NotPopulatedOperator=Node(Any(/unfilled/i,/unset/i,/blank/i),()=>B=>not(populated$1(B))),HoveredOperator=Node(Any(/hovered/i,All(/has\s+hover/i,CSSPseudoClass,/applied|active/i),All(Optional(ConditionPreposition),/hover(?:\s+state)?/i)),()=>hovered$1),HoveredReversedOperator=All(/hover/i,CSSPseudoClass,IsWrapperOperator(Node(/applied|active/i,()=>hovered$1)),LocationPreposition),SelectedOperator=Node(All(/selected/i,StoragePreposition),()=>eq$1),BetweenOperator=Node(All(/between/i,CardinalNumberExpression,And,CardinalNumberExpression),([B,Q])=>{return a=>and(gte$1(a,{'isOperand':!![],'value':B}),lte$1(a,{'isOperand':!![],'value':Q}));}),IterationOperator=Any(Node(/(?:every|each|all)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'every'})),Node(/(?:some|any)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'some'})),Node(/(?:none|no)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'none'})),Node(All(/at\s+least/i,CardinalNumberExpression,Optional(Of),Optional(The)),([B])=>({'type':'some','min':B}))),UnaryOperator=IsWrapperOperator(Any(BetweenOperator,MatchOperator,ValidateOperator,SizeValidationOperator)),BinaryOperator=Any(IsWrapperOperator(Any(ComparisonOperator,IncludesOnlyOperator,IncludesOperator,StartsWithOperator,EndsWithOperator)),IsOperator),ElementUnaryOperator=IsWrapperOperator(Any(VisibleOperator,InvisibleOperator,CheckedOperator,UncheckedOperator,ClickableOperator,EnabledOperator,DisabledOperator,HoveredOperator,PopulatedOperator,NotPopulatedOperator)),ElementReversedUnaryOperator=Any(HoveredReversedOperator),ElementBinaryOperator=IsWrapperOperator(Any(SelectedOperator)),OperationExpression=Any(PreCondition(B=>B['context']['has']('element'),Node(All(Its,Optional(Any(Value$5,String$1)),Length),(B,Q)=>size({'isOperand':!![],'value':Q['context']['element']}))),Node(All(Optional(The),Length,Of,Any(ElementValueExtractor,Reference$1('any'),VerboseReference,StructureLiteral$1,Element$2)),([B])=>size({'isOperand':!![],'value':B})),Node(All(Element$2({'explicit':!![]}),Optional(Any(Value$5,String$1)),Length),([B])=>size({'isOperand':!![],'value':B}))),ConditionOperation=Recursive(B=>{const {Masker:Q,Maskable:a,mask:c}=Mask(),X=Effect(Use(Secret$1),(R,F)=>c(F)),f=R=>{return LogGroup('Operand',Node(Mark(a(R),{'type':'operand'}),([F],w)=>{const i={'isOperand':!![],'value':F};return w['collections']['operands']['push'](i),i;}));},J=f(AnyVerboseExpression({'weak':!![]})),Y=f(PreCondition(R=>R['context']['has']('clipboard'),Mark(Node(Any(It,Them),(R,F)=>F['context']['clipboard']),{'type':'reference'}))),h=f(VerboseReference),V=f(Effect(ElementValueExtractor,([R],F)=>R['operands'][0x0]['value']['secret']&&c(F))),k=f(Effect(Element$2({'explicit':!![],'reference':![]}),([R],F)=>!('isElementReference'in R)&&R['secret']&&c(F))),t=f(OperationExpression),K=f(ArithmeticOperation),O=f(Any(VerboseReference,Reference$1('any'),StructureLiteral$1)),S=f(PreCondition(R=>R['collections']['bindings']['length']>0x0,Node(Optional(Any(It,Them)),(R,F)=>({...F['collections']['bindings']['at'](-0x1)['reference']})))),C=Any(t,K,All(Optional(X),V),h,k,Y,All(Optional(X),J),S),G=f(Any(Effect(Element$2,([R],F)=>!('isElementReference'in R)&&R['secret']&&c(F)),Dialog,PreCondition(R=>R['collections']['bindings']['length']>0x0,Node(Optional(Any(It,Them)),(R,F)=>({'reference':{...F['collections']['bindings']['at'](-0x1)['reference']}}))))),E=Node(All(C,Optional(Any(IgnoreCase,MatchCase))),([R,F])=>{return{'operand':R,'wrapper':F};}),W=Any(Node(UnaryOperator,([R])=>({'operator':R})),Node(All(BinaryOperator,C,Optional(Any(IgnoreCase,MatchCase))),([R,F,w])=>{return{'operator':i=>w?.(R(i,F))??R(i,F)};})),e=Node(B,([R])=>{return{'operation':R};}),H=Node(All(Any(All(G,ElementUnaryOperator),All(C,UnaryOperator)),Any(IgnoreCase,MatchCase,Nothing$1(R=>R)),Star(Node(All(BooleanOperator,Any(e,W)),([R,F])=>{return{'connector':R,'addition':F};}))),([R,F,w,...i])=>{return i['reduce']((U,{connector:d,addition:L})=>{return d(U,'operator'in L?L['operator'](R):L['operation']);},w(F(R)));}),q=Node(All(All(ElementReversedUnaryOperator,G),Star(Node(All(BooleanOperator,e),([R,F])=>{return{'connector':R,'addition':F};}))),([R,F,...w])=>{return w['reduce']((i,{connector:U,addition:d})=>{return U(i,d['operation']);},R(F));}),I=Node(All(Any(All(G,ElementBinaryOperator),All(C,BinaryOperator)),C,Any(IgnoreCase,MatchCase,Nothing$1(R=>R)),Star(Any(Node(All(BooleanOperator,Any(e,W)),([R,F])=>{return{'connector':R,'addition':F};}),NonEmpty(Weak(Node(All(BooleanOperator,E),([R,F])=>{return{'connector':R,'addition':F};})))))),([R,F,w,i,...U])=>{return U['reduce']((d,{connector:L,addition:s})=>{if('operand'in s){if(d['operator']==='includes\x20only')return d['operands']['push'](s['operand']),d;else return L(d,F(R,s['operand']));}else{if('operator'in s)return L(d,s['operator'](R));else return L(d,s['operation']);}},i(F(R,w)));}),n=Any(Node(All(Optional(For),IterationOperator,Effect(All(Mark(Identifier$1,{'type':'binding\x20name'}),MembershipPreposition,O),([R],F)=>{F['collections']['bindings']['push']({'reference':{'isRef':!![],'name':R,'binding':!![]},'names':[...bindingsOf$1(R),'it','index','key']['map'](w=>w['toLowerCase']())});}),Optional(BlockSeparator),Optional(Any(That,Then$1)),B),([R,F,w,i],U)=>{U['collections']['bindings']['pop']();const d={'isOperand':!![],'value':map(w,i,bindingsOf$1(F))},L=R['type']==='every'?every(d):some(d,R['min']);return R['type']==='none'?not(L):L;}),q,H,I);return Node(Mark(Q(All(Any(ParensOperator(n),n),Star(Node(All(BooleanOperator,Any(ParensOperator(n),n)),([R,F])=>{return w=>R(w,F);})))),{'type':'operation'}),([R,...F])=>{return F['reduce']((w,i)=>i(w),R);});}),Condition$2=Node(ConditionOperation,([B])=>({'isCondition':!![],'operation':B})),NegativeCondition$1=Node(ConditionOperation,([B])=>({'isCondition':!![],'operation':not(B)}));function parens(B){return{'operator':'parens','operands':[B]};}function ignoreCase(B){return{'operator':'ignore\x20case','operands':[B]};}function matchCase(B){return{'operator':'match\x20case','operands':[B]};}function not(B){return{'operator':'not','operands':[B]};}function and(B,Q){return{'operator':'and','operands':[B,Q]};}function or(B,Q){return{'operator':'or','operands':[B,Q]};}function eq$1(B,Q){return{'operator':'eq','operands':[B,Q]};}function gte$1(B,Q){return{'operator':'gte','operands':[B,Q]};}function gt$1(B,Q){return{'operator':'gt','operands':[B,Q]};}function lte$1(B,Q){return{'operator':'lte','operands':[B,Q]};}function lt$1(B,Q){return{'operator':'lt','operands':[B,Q]};}function validate$1(B,Q){return{'operator':'validate','operands':[B,Q]};}function size(B){return{'operator':'size','operands':[B]};}function map(B,Q,a){return{'operator':'map','operands':[B,Q],...a?.['length']?{'bindings':a}:{}};}function every(B){return{'operator':'every','operands':[B]};}function some(B,Q){return{'operator':'some','operands':[B],...Q!=null?{'min':Q}:{}};}function bindingsOf$1(B){const Q=singularize(B);return Q?[B,Q]:[B];}function keys(B){return{'operator':'keys','operands':[B]};}function values(B){return{'operator':'values','operands':[B]};}function entries(B){return{'operator':'entries','operands':[B]};}function match$1(B,Q){return{'operator':'match','operands':[B,Q]};}function includesOnly$1(B,Q,...a){return{'operator':'includes\x20only','operands':[B,Q,...a]};}function includes$1(B,Q){return{'operator':'includes','operands':[B,Q]};}function startsWith$1(B,Q){return{'operator':'starts\x20with','operands':[B,Q]};}function endsWith$1(B,Q){return{'operator':'ends\x20with','operands':[B,Q]};}function visible$1(B){return{'operator':'visible','operands':[B]};}function clickable$1(B){return{'operator':'clickable','operands':[B]};}function enabled$1(B){return{'operator':'enabled','operands':[B]};}function hovered$1(B){return{'operator':'hovered','operands':[B]};}function checked$1(B,Q){return{'operator':'checked','operands':[B,Q]};}function populated$1(B){return{'operator':'populated','operands':[B]};}const {Apply:Apply$27,Mutate:Mutate$27}=State({'isChromeElementDescriptor':!![]}),ButtonTitle=Mutate$27(Any(Mutate$27(Stringish(/(?:click\s+to\s+)?(?:go\s+)?(?:back|(?:to\s+)?(?:the\s+)?prev(?:ious)?(?:\s+page)?)|<-|</i),B=>B['title']='back'),Mutate$27(Stringish(/(?:click\s+to\s+)?(?:go\s+)?(?:fwd|forward|(?:to\s+)?(?:the\s+)?next(?:\s+page)?)|->|>/i),B=>B['title']='forward'),Mutate$27(Stringish(/(?:reload|refresh)(?:\s+(?:(?:(?:(?:this|the)\s+)?page)|this))?/i),B=>B['title']='refresh')),B=>B['type']='button'),TextboxTitle=Mutate$27(Stringish(/search|address|url/i),B=>(B['type']='textbox',B['title']='url')),TabTitle=Mutate$27(StringExpression$1,(B,[Q])=>(B['type']='tab',B['title']=Q)),TabOrdinalIndex=Mutate$27(Index(OrdinalNumberExpression$1),(B,[Q])=>(B['type']='tab',B['index']=Q)),TabCardinalIndex=Mutate$27(All(Any(With,At),Optional(The),Index$1,Optional(NumberSign),IntegerNumberExpression),(B,[Q])=>(B['type']='tab',B['index']=Q)),TabPosition=B=>Mutate$27(SequentialRelativePosition(B),(Q,[{position:a}])=>(Q['type']='tab',Q['position']=a)),Tab=Any(TabPosition(Tab$1),All(TabOrdinalIndex,Tab$1),All(Tab$1,TabCardinalIndex),All(Tab$1,Optional(Named),TabTitle),All(TabTitle,Tab$1)),ChromeButton=Apply$27(All(Optional(The),Optional(BrowserToolbar),ButtonTitle,Optional(Button))),ExplicitChromeButton=Apply$27(Any(All(Optional(The),BrowserToolbar,ButtonTitle,Optional(Button)),All(Optional(The),ButtonTitle,Optional(Button),Inside,Optional(The),BrowserToolbar))),ChromeTextbox=Apply$27(All(Optional(The),Optional(BrowserToolbar),TextboxTitle,Optional(Textbox))),ExplicitChromeTextbox=Apply$27(Any(All(Optional(The),BrowserToolbar,TextboxTitle,Optional(Textbox)),All(Optional(The),TextboxTitle,Optional(Textbox),Inside,Optional(The),BrowserToolbar))),ExplicitChromeTabList=Node(All(Optional(The),Any(BrowserTabList,All(BrowserToolbar,TabList))),()=>({'isChromeElementDescriptor':!![],'type':'tablist'})),ChromeTab=Apply$27(All(Optional(The),Tab)),ExplicitChromeTab=Apply$27(All(Optional(The),Any(All(Possessive(BrowserTabList),Tab),All(Tab,Inside,ExplicitChromeTabList),TabPosition(BrowserTab),All(TabOrdinalIndex,BrowserTab),All(BrowserTab,TabCardinalIndex),All(BrowserTab,Optional(Named),TabTitle),All(Possessive(Browser$1),Any(TabPosition(Tab$1),All(TabOrdinalIndex,Tab$1),All(TabTitle,Tab$1))),All(TabTitle,BrowserTab)))),ActiveChromeTab=Apply$27(All(Optional(The),Optional(Any(Current,Active)),Mutate$27(BrowserTab,B=>B['type']='tab'))),{Apply:Apply$26,Mutate:Mutate$26,state:state$2}=State({'secret':![]}),Secret=Mutate$26(Article(Secret$1),B=>B['secret']=!![]),Name$1=Mutate$26(Mark(StringExpression$1({'escape':/[:]/}),{'type':'header\x20name'}),(B,[Q])=>B['name']=Q),StringValue$2=Mutate$26(Mark(StringExpression$1,{'type':'header\x20value'}),(B,[Q])=>B['value']=Q),DoubleQuotedValue=Mutate$26(Mark(UnquotedStringExpression({'char':/./,'escape':/["]/}),{'type':'header\x20value'}),(B,[Q])=>B['value']=Q),SingleQuotedValue=Mutate$26(Mark(UnquotedStringExpression({'char':/./,'escape':/[']/}),{'type':'header\x20value'}),(B,[Q])=>B['value']=Q),Maskable$1=B=>Dynamic(Q=>state$2(Q)['secret']?Mark(B,{'type':'secret'}):B),HttpHeader=Apply$26(All(Optional(The),Optional(Any(All(Secret,Optional(Article(Custom))),All(Article(Custom),Optional(Secret)))),HttpHeader$1,Any(All(Optional(Any(Named,Name$2)),Name$1,And,Optional(AssociationPreposition),Optional(HttpHeader$1),Optional(Secret),Value$5,Maskable$1(StringValue$2)),All(Name$1,':',Maskable$1(StringValue$2)),DoubleQuoted$1(All(Name$1,':',Maskable$1(DoubleQuotedValue))),SingleQuoted$1(All(Name$1,':',Maskable$1(SingleQuotedValue)))))),OTPLiteral=Node(All(Mark(All(Optional(IndefiniteArticle),Optional(Generated),OTP$1),{'type':'otp'}),For,Optional(The),Optional(User),Mark(StringExpression$1,{'type':'user'})),([B])=>({'isOTP':!![],'user':B})),FileHandleLiteral=Node(Mark(StringLiteral$1,{'type':'file'}),([B],Q)=>{const a={'isFileHandle':!![],'filename':B};return Q['collections']['files']['push'](a),a;}),Description$1=As$1(Anything$1,StandaloneStringExpression),RandomValueLiteral=Node(Mark(All(Optional(IndefiniteArticle),Optional(Random),Description$1),{'type':'random\x20value'}),([B],Q)=>{const a={'isRandomValue':!![],'description':B};return Q['collections']['randomValues']['push'](a),a;}),GrabAction=Mark(Continuous(/grab/i,/grabbing/i),{'type':'actionword'}),Clip=B=>Effect(B,([Q],a)=>{if(typeof Q==='object'&&Q&&'isRef'in Q)a['context']['reference']=Q;a['context']['clipboard']=Q;}),Grab=LogGroup('Grab',Void(All(GrabAction,Any(Clip(ElementValueExtractor),Longest(Clip(AnyExpression$1),ExplicitElement))))),{Apply:Apply$25,Mutate:Mutate$25}=State({'type':'set\x20variable','data':{'value':null},'names':[]}),SetVariableAction=Mark(Continuous(/set|assign|define/i,/setting|assigning|defining/i),{'type':'actionword'}),StoreValueAction=Mark(Continuous(/set|assign|remember|memorize|store|save/i,/setting|assigning|remembering|memorizing|storing|saving/i),{'type':'actionword'}),{Masker,Maskable,mask}=Mask(),SetOperator='=',Name=B=>Mutate$25(Effect(Mark(B,{'type':'variable\x20name'}),([Q],a,c)=>{if(isReservedName(Q))a['collections']['errors']['push']({'type':'ReservedVariableNameError','pos':c['pos'],'text':a['text']['slice'](c['pos'],a['pos']),'message':Q+'\x20is\x20a\x20reserved\x20variable\x20which\x20cannot\x20be\x20set'});else{if(isSecretName(Q))mask(a);}}),(Q,[a])=>{const c={'name':a};if(isSecretName(a))c['secret']=!![];Q['names']['push'](c);}),NamesList=B=>Mutate$25(List(B,AndListSeparator),(Q,a)=>{if(a['length']>0x1)Q['destruction']=!![];}),StringishName=Name(Any(Quoted$1(MultiWordIdentifier),Identifier$1,Fix(Wrap({'left':'{','right':'}'},MultiWordIdentifier),(B,[Q])=>'\x22'+Q+'\x22'))),StandaloneName=Name(Any(Identifier$1,Fix(Wrap({'left':'{','right':'}'},Identifier$1),(B,[Q])=>Q))),Value$2=B=>Mutate$25(Mark(Maskable(B),{'type':'variable\x20value'}),(Q,[a])=>Q['data']['value']=a),DataValue=Value$2(AnyExpression$1),ExtractorValue=Value$2(Any(ElementValueExtractor,Node(Element$2({'explicit':!![]}),([B])=>({'operator':'extract','operands':[{'isOperand':!![],'value':B},'string']})))),OTPValue$1=Mutate$25(Value$2(OTPLiteral),B=>B['data']['secret']=!![]),ClipboardValue$1=Value$2(Mark(Any(PreCondition(B=>B['context']['has']('clipboard'),Node(Any(It,Them),(B,Q)=>Q['context']['clipboard'])),PreCondition(B=>B['context']['has']('element'),Node(Any(It,All(Its,Value$5)),(B,Q)=>({'operator':'extract','operands':[{'isOperand':!![],'value':Q['context']['element']},'string']})))),{'type':'reference'})),SomeValue=Any(OTPValue$1,Value$2(OperationExpression),ClipboardValue$1,Longest(DataValue,ExtractorValue)),AnyValue=Any(Mutate$25(Effect(Any(All(Article(Secret$1),SomeValue),All(SomeValue,Article(Secret$1))),(B,Q)=>mask(Q)),(B,Q)=>B['data']['secret']=!![]),SomeValue),SetVariable=LogGroup('SetVariable',Effect(Apply$25(Masker(Any(All(StoreValueAction,AnyValue,As,Article(Value$5),Of,Optional(Article(Variables)),NamesList(StringishName)),All(StoreValueAction,AnyValue,StoragePreposition,Optional(The),Variables,NamesList(StringishName)),All(SetVariableAction,Optional(Article(Variables)),NamesList(StringishName),Any(AssignmentPreposition,SetOperator),Optional(Article(Value$5)),AnyValue),All(StoreValueAction,AnyValue,StoragePreposition,NamesList(StringishName)),All(NamesList(StandaloneName),SetOperator,AnyValue)))),([B],Q)=>{if(B['destruction']&&B['data']['value']&&typeof B['data']['value']==='object'&&'isRef'in B['data']['value']&&B['data']['value']['name']==='random\x20value'&&B['data']['value']['scope']==='internal'){const a=Q['collections']['randomValues']['at'](-0x1);a['properties']=B['names']['map'](({name:c})=>c);}if(B['destruction'])Q['collections']['variables']['push'](...B['names']['map'](({name:c})=>({'name':c})));else Q['collections']['variables']['push'](...B['names']['map'](({name:c})=>({'name':c,'value':B['data']['value']})));})),{Apply:Apply$24,Mutate:Mutate$24}=State({'type':'set\x20variable','data':{},'scope':'internal'}),SetTimeoutAction=Mark(Continuous(/set|assign|define/i,/setting|assigning|defining/i),{'type':'actionword'}),ImplicitlyWaitAction=Mark(Continuous(/(?:implicitly)?\s+wait|wait\s+(?:implicitly)?/i,/(?:implicitly)?\s+waiting|waiting\s+(?:implicitly)?/i),{'type':'actionword'}),TimeoutName=Any(Mutate$24(/(?:(?:browser|url)\s+)?nav(?:igation)?s?/i,B=>B['names']=[{'name':'navigateTimeout'}]),Mutate$24(/elements?(?:\s+(?:finding|locating))?|(?:finding|locating)\s+elements?/i,B=>B['names']=[{'name':'findTimeout'}]),Mutate$24(/(?:(?:taking|capturing)\s+)?(?:screenshots?|screen\s+captures?)/i,B=>B['names']=[{'name':'screenshotTimeout'}]),Mutate$24(/(?:(?:taking|capturing)\s+)?preview\s+(?:screenshots?|screen\s+captures?)/i,B=>B['names']=[{'name':'previewTimeout'}])),TimeoutDefaultName=Mutate$24(Nothing$1,B=>B['names']=[{'name':'timeout'}]),Value$1=Mutate$24(TimeIntervalExpression,(B,[Q])=>B['data']['value']=Q),SetTimeout=LogGroup('SetTimeout',Apply$24(Any(All(SetTimeoutAction,Optional(The),Optional(Implicit),Wait$2,Optional(Time),TemporalPreposition,TimeoutName,Optional(EquivalencePreposition),Value$1),All(SetTimeoutAction,Optional(The),Optional(Implicit),Any(TimeoutName,TimeoutDefaultName),Wait$2,Optional(Time),Optional(EquivalencePreposition),Value$1),All(ImplicitlyWaitAction,Maximum,Value$1,TemporalPreposition,TimeoutName),All(ImplicitlyWaitAction,Any(All(TemporalPreposition,TimeoutName),TimeoutDefaultName),Maximum,Value$1)))),{Apply:Apply$23,Mutate:Mutate$23,state:state$1}=State({'type':'set\x20value'}),SetValueAction=Mark(Continuous(/set/i,/setting/i),{'type':'actionword'}),SelectValueAction=Mutate$23(Mark(Continuous(/select|pick|choose/i,/selecting|picking|choosing/i),{'type':'actionword'}),B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'selectbox'}})),RandomlySelectAction=Mutate$23(Mark(Continuous(/randomly\s+(?:select|pick|choose)/i,/randomly\s+(?:selecting|picking|choosing)/i),{'type':'actionword'}),B=>{B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'selectbox'}}),B['value']={'isRandomValue':!![],'type':'number'};}),AttachAction=Mutate$23(Any(Mark(Continuous(/attach|upload/i,/attaching|uploading/i),{'type':'actionword'}),All(Mark(Continuous(/add|import/i,/adding|importing/i),{'type':'actionword'}),File)),B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'filepicker'}})),StringValue$1=Mutate$23(StringExpression$1,(B,[Q])=>B['value']=Q),StringReferenceValue=Mutate$23(Reference$1('string'),(B,[Q])=>B['value']=Q),FileHandleValue=Mutate$23(FileHandleLiteral,(B,[Q])=>B['value']=Q),OrdinalIndex$1=Mutate$23(Index(OrdinalNumberExpression$1),(B,[Q])=>B['value']=Q),CardinalIndex=Mutate$23(All(Optional(NumberSign),Index(CardinalNumberExpression)),(B,[Q])=>B['value']=Q),RandomIndex=Mutate$23(Random,B=>B['value']={'isRandomValue':!![],'type':'number'}),SelectboxHint=Mutate$23(SelectboxOption,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'selectbox'}})),FileHint=Mutate$23(File,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'filepicker'}})),Hint=Any(Mutate$23(Color$2,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'colorpicker'}})),Mutate$23(DateTime,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'datetimepicker'}})),Mutate$23(Date$1,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'datepicker'}})),Mutate$23(Time,B=>B['element']=mergeElementDescriptors(B['element']??{},{'hints':{'type':'timepicker'}}))),InputElement=Mutate$23(Element$2,(B,[Q])=>B['element']=mergeElementDescriptors(B['element']??{},Q)),StringInput=Mutate$23(StringElement,(B,[Q])=>B['element']=mergeElementDescriptors(B['element']??{},Q)),SetValue=LogGroup('SetValue',Apply$23(Any(All(SetValueAction,InputElement,Value$5,Optional(AssignmentPreposition),StringValue$1),All(Any(SetValueAction,SelectValueAction),Any(All(Article(Any(All(StringReferenceValue,Optional(RelationalPreposition)),OrdinalIndex$1,RandomIndex)),Any(All(SelectboxHint,Optional(RelationalPreposition),InputElement),All(StringInput,SelectboxHint),All(InputElement,Optional(SelectboxHint)))),All(Article(Any(All(Hint,StringValue$1),All(FileHint,Optional(Named),FileHandleValue),All(FileHandleValue,FileHint),All(SelectboxHint,Any(CardinalIndex,StringValue$1)),All(CardinalIndex,SelectboxHint),All(StringValue$1,Any(Hint,SelectboxHint)))),Dynamic(B=>{const Q=All(Optional(Any(StoragePreposition,RelationalPreposition)),InputElement);return state$1(B)['element']?Optional(Q):Q;})),All(StringValue$1,Any(StoragePreposition,RelationalPreposition),InputElement))),All(RandomlySelectAction,Any(All(Optional(All(Optional(IndefiniteArticle),SelectboxHint)),Optional(RelationalPreposition),InputElement),All(Optional(RelationalPreposition),InputElement,Optional(SelectboxHint)))),All(AttachAction,Article(Any(All(FileHint,Optional(Named),FileHandleValue),All(FileHandleValue,Optional(FileHint)))),Optional(All(Optional(Any(StoragePreposition,RelationalPreposition)),InputElement)))))),{Apply:Apply$22,Mutate:Mutate$22}=State({'type':'set\x20variable','data':{},'scope':'internal'}),GenerateAction=Mark(Continuous(/generate/i,/generating/i),{'type':'actionword'}),RandomlyGenerateAction=Mark(Continuous(/randomly\s+generate/i,/randomly\s+generating/i),{'type':'actionword'}),OTP=Mutate$22(OTPLiteral,(B,[Q])=>{B['names']=[{'name':'otp'}],B['data']['value']=Q,B['data']['secret']=!![];}),RandomValue=Mutate$22(RandomValueLiteral,(B,[Q])=>{B['names']=[{'name':'random\x20value'}],B['data']['value']=Q;}),Generate=LogGroup('Generate',Effect(Apply$22(Any(All(GenerateAction,Any(OTP,RandomValue)),All(RandomlyGenerateAction,RandomValue))),([B],Q)=>Q['context']['clipboard']={'isRef':!![],'name':B['names']?.[0x0]?.['name'],'scope':B['scope']})),Assert=LogGroup('Assert',Node(All(Mark(Continuous(/assert|check|validate|verify|make\s+sure/i,/asserting|checking|validating|verifying|making\s+sure/i),{'type':'actionword'}),Optional(That),Condition$2),([B])=>({'type':'assert','condition':B}))),{Apply:Apply$21,Mutate:Mutate$21}=State({'type':'fetch'}),FetchAction$1=Mark(Continuous(/send/i,/sending/i),{'type':'actionword'}),Url$2=Mutate$21(Mark(Url$3,{'type':'fetch\x20url'}),(B,[Q])=>B['url']=Q),Endpoint=All(Optional(Any(From,To)),Optional(The),Optional(Endpoint$1),Url$2),ExplicitEndpoint=All(Any(All(Any(From,To),Optional(The),Optional(Endpoint$1)),All(Optional(Any(From,To)),The,Optional(Endpoint$1)),All(Optional(Any(From,To)),Optional(The),Endpoint$1)),Url$2),Method$2=Mark(Mutate$21(Use(/(get|post|put|patch|head|options|trace|delete|connect)/i),(B,[Q])=>B['method']=Q['toLowerCase']()),{'type':'fetch\x20option','subtype':'method'}),Auth$1=Mutate$21(State({'type':'basic'},({Mutate:B})=>{const Q=B(Mark(StringExpression$1({'escape':/[:]/}),{'type':'username'}),(Y,[h])=>Y['username']=h),a=B(Mark(UnquotedStringExpression({'char':/./,'escape':/[":]/}),{'type':'username'}),(Y,[h])=>Y['username']=h),c=B(Mark(UnquotedStringExpression({'char':/./,'escape':/[':]/}),{'type':'username'}),(Y,[h])=>Y['username']=h),X=B(Mark(Mark(StringExpression$1,{'type':'password'}),{'type':'secret'}),(Y,[h])=>Y['password']=h),f=B(Mark(Mark(UnquotedStringExpression({'char':/./,'escape':/[":]/}),{'type':'password'}),{'type':'secret'}),(Y,[h])=>Y['password']=h),J=B(Mark(Mark(UnquotedStringExpression({'char':/./,'escape':/[':]/}),{'type':'password'}),{'type':'secret'}),(Y,[h])=>Y['password']=h);return Mark(All(Optional(Any(As,With)),Optional(The),Mark(Any(User,BasicAuth$1),{'type':'auth\x20type'}),Any(All(Q,':',X),DoubleQuoted$1(All(a,':',f)),SingleQuoted$1(All(c,':',J)))),{'type':'fetch\x20option','subtype':'auth'});}),(B,[Q])=>B['auth']=Q),Cookie$1=Mutate$21(State({'secret':![]},({Mutate:B,state:Q})=>{const a=B(Article(Secret$1),k=>k['secret']=!![]),c=B(Mark(StringExpression$1({'escape':/[=]/}),{'type':'cookie\x20name'}),(k,[t])=>k['name']=t),X=B(Mark(UnquotedStringExpression({'char':/./,'escape':/["=]/}),{'type':'cookie\x20name'}),(k,[t])=>k['name']=t),f=B(Mark(UnquotedStringExpression({'char':/./,'escape':/['=]/}),{'type':'cookie\x20name'}),(k,[t])=>k['name']=t),J=B(Mark(StringExpression$1,{'type':'cookie\x20value'}),(k,[t])=>k['value']=t),Y=B(Mark(UnquotedStringExpression({'char':/./,'escape':/["]/}),{'type':'cookie\x20value'}),(k,[t])=>k['value']=t),h=B(Mark(UnquotedStringExpression({'char':/./,'escape':/[']/}),{'type':'cookie\x20value'}),(k,[t])=>k['value']=t),V=k=>Dynamic(t=>Q(t)['secret']?Mark(k,{'type':'secret'}):k);return Mark(All(Optional(With),Optional(The),Optional(a),HttpCookie,Any(All(Optional(Any(Named,Name$2)),c,And,Optional(AssociationPreposition),Optional(HttpCookie),Optional(a),Value$5,V(J)),All(c,'=',V(J)),DoubleQuoted$1(All(X,'=',V(Y))),SingleQuoted$1(All(f,'=',V(h))))),{'type':'fetch\x20option','subtype':'cookie'});}),(B,[Q])=>(B['cookies']??=[])['push'](Q)),Headers$3=List(Any(Auth$1,Mutate$21(Mark(All(Optional(With),HttpHeader),{'type':'fetch\x20option','subtype':'header'}),(B,[Q])=>(B['headers']??=[])['push'](Q)),Cookie$1),Optional(AndListSeparator)),BodyType=Mark(Mutate$21(Use(/(json|xml|base64)/i),(B,[Q])=>(B['body']??={'data':null})['type']=Q['toLowerCase']()),{'type':'body\x20type'}),BodyData=Mark(Mutate$21(AnyExpression$1,(B,[Q])=>(B['body']??={'data':null})['data']=Q),{'type':'body\x20data'}),Body$2=Mark(All(Optional(With),Optional(BodyType),Optional(HttpBody),BodyData),{'type':'fetch\x20option','subtype':'body'}),StatusCodes$1=Mark(Mutate$21(Any(/any/i,List(Use(/([1-5]\d\d)/),Optional(OrListSeparator))),(B,Q)=>B['statuses']=Q['length']>0x0?Q['map'](a=>Number['parseInt'](a)):'*'),{'type':'status\x20codes'}),Statuses$1=Mark(All(Optional(AndListSeparator),Any(Expect,Expecting),Any(All(Optional(The),HttpStatusCodes,Optional(':'),StatusCodes$1),All(StatusCodes$1,HttpStatusCodes))),{'type':'fetch\x20option','subtype':'statuses'}),Fetch=LogGroup('Fetch',Effect(Apply$21(All(Any(All(FetchAction$1,Method$2,Optional(Http)),All(FetchAction$1,Optional(IndefiniteArticle),Optional(Http),Optional(Method$2)),All(Optional(Http),Method$2)),Optional(Request$1),Any(All(Any(All(Headers$3,Optional(All(Optional(AndListSeparator),NonEmpty(Weak(Body$2))))),NonEmpty(Weak(Body$2))),Optional(All(Optional(AndListSeparator),Headers$3)),ExplicitEndpoint,Optional(Headers$3)),All(Optional(Headers$3),Endpoint,Optional(Any(All(Headers$3,Optional(All(Optional(AndListSeparator),NonEmpty(Weak(Body$2))))),NonEmpty(Weak(Body$2)))),Optional(All(Optional(AndListSeparator),Headers$3)))),Optional(Statuses$1))),([B],Q)=>{Q['collections']['fetches']['push'](B),Q['collections']['variables']['push']({'name':'response'}),Q['context']['clipboard']={'isRef':!![],'name':'response'};})),Evaluate=LogGroup('Evaluate',Effect(Node(All(Mark(Continuous(/evaluate|execute|run/i,/evaluating|executing|running/i),{'type':'actionword'}),Optional(The),JavaScript,Optional(CodeSnippet),Optional(/[:-]/),JSExpressionLiteral$1),([B])=>({'type':'evaluate','js':B})),(B,Q)=>{Q['collections']['variables']['push']({'name':'js-result'}),Q['context']['clipboard']={'isRef':!![],'name':'js-result'};})),{Apply:Apply$20,Mutate:Mutate$20}=State({'type':'navigate'}),NavigateAction=All(Any(All(Mark(Continuous(/navigate/i,/navigating/i),{'type':'actionword'}),Optional(All(Optional(The),Browser$1))),Mark(Continuous(/goto|browse|visit|open/i,/browsing|visiting|opening/i),{'type':'actionword'})),Optional(To),Optional(The)),GoToPageAction=All(Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Optional(To),Optional(The)),AbsoluteUrl=Mutate$20(Mark(Url$3,{'type':'navigation\x20url'}),(B,[Q])=>B['url']=Q),ExplicitAbsoluteUrl=Mutate$20(Mark(ExplicitUrl,{'type':'navigation\x20url'}),(B,[Q])=>B['url']=Q),RelativeUrl=Mutate$20(Mark(StringExpression$1,{'type':'navigation\x20url'}),(B,[Q])=>(B['url']=Q,B['relative']=!![])),Direction$1=Any(Mutate$20(Any(Back,Previous),B=>B['direction']='back'),Mutate$20(Any(Forward,Next),B=>B['direction']='forward')),VerboseDirection=Any(Mutate$20(All(Back,To,Optional(The),Previous,Website),B=>B['direction']='back'),Mutate$20(All(Forward,To,Optional(The),Next,Website),B=>B['direction']='forward')),CardinalTimes=Mutate$20(CardinalNumberExpression,(B,[Q])=>B['times']=Q),IterativeTimes=Mutate$20(Any(All(CardinalNumberExpression,Times$4),IterativeNumberExpression),(B,[Q])=>B['times']=Q),StatusCodes=Mutate$20(Any(/any/i,List(Use(/([1-5]\d\d)/),Optional(OrListSeparator))),(B,Q)=>B['statuses']=Q['length']>0x0?Q['map'](a=>Number['parseInt'](a)):'*'),Statuses=All(Optional(AndListSeparator),Any(Expect,Expecting),Any(All(Optional(The),HttpStatusCodes,Optional(':'),StatusCodes),All(StatusCodes,HttpStatusCodes))),Header$3=Mutate$20(Mark(All(Optional(With),HttpHeader),{'type':'navigation\x20option','subtype':'header'}),(B,[Q])=>(B['headers']??=[])['push'](Q)),Headers$2=All(Optional(AndListSeparator),List(Header$3,Optional(AndListSeparator))),ExplicitNavigateBody=Any(All(VerboseDirection,Optional(IterativeTimes)),All(CardinalTimes,Websites,Direction$1),All(Direction$1,Any(All(CardinalTimes,Websites),Optional(Website))),All(RelativeUrl,Relative,To,Optional(The),Current,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)),All(Any(Url$4,All(Website,Optional(LocationPreposition))),AbsoluteUrl,Optional(Headers$2),Optional(Statuses))),Navigate=LogGroup('Navigate',Apply$20(Any(All(NavigateAction,Any(ExplicitNavigateBody,All(AbsoluteUrl,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)))),All(GoToPageAction,Any(ExplicitNavigateBody,All(ExplicitAbsoluteUrl,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)),All(AbsoluteUrl,Any(Url$4,Website),Optional(Headers$2),Optional(Statuses)),All(AbsoluteUrl,Optional(Any(Url$4,Website)),Any(Statuses,All(Headers$2,Optional(Statuses))))))))),{Apply:Apply$19,Mutate:Mutate$19}=State({'type':'focus'}),FocusAction=Mark(Continuous(/(?:(?:set\s+)?focus)/i,/setting\s+focus|focussing/i),{'type':'actionword'}),Element$1=Mutate$19(Element$2,(B,[Q])=>B['element']=Q),Focus=LogGroup('Focus',Apply$19(All(FocusAction,Optional(LocationPreposition),Element$1))),CheckAction=Mark(Continuous(/check|tick|select|(?:turn|switch)\s+on/i,/checking|ticking|selecting|(?:turning|switching)\s+on/i),{'type':'actionword'}),UncheckAction=Mark(Continuous(/uncheck|untick|unselect|(?:turn|switch)\s+off/i,/unchecking|unticking|unselecting|(?:turning|switching)\s+off/i),{'type':'actionword'}),Check=LogGroup('Check',Node(All(Any(Node(CheckAction,()=>!![]),Node(UncheckAction,()=>![])),Element$2),([B,Q])=>({'type':'check','value':B,'element':Q}))),Clear=LogGroup('Clear',Node(All(Mark(Continuous(/clear/i,/clearing/i),{'type':'actionword'}),Any(All(Article(String$1),LocationPreposition,Element$2),Longest(Node(String$1,()=>({'state':{'focused':!![]},'fallback':{'type':'textbox'}})),Element$2))),([B])=>({'type':'clear','element':B}))),{Apply:Apply$18,Mutate:Mutate$18}=State({'type':'erase'}),EraseAction=Mark(Continuous(/erase|delete|remove/i,/erasing|deleting|removing/i),{'type':'actionword'}),Size=Mutate$18(CardinalNumberExpression,(B,[Q])=>B['size']=Q),DefaultSize=Mutate$18(Optional(IndefiniteArticle),B=>B['size']=0x1),TargetTextbox=Mutate$18(Element$2,(B,[Q])=>B['element']=Q),Erase=LogGroup('Erase',Apply$18(All(EraseAction,Any(All(Size,Characters),All(DefaultSize,Character)),Optional(All(Optional(LocationPreposition),TargetTextbox))))),{Apply:Apply$17,Mutate:Mutate$17}=State({'type':'hover'}),HoverAction=Mark(Continuous(/hover(?:\s+(?:over|inside|on(?:(?:\s+the)?\s+center\s+of|\s+top(?:\s+of)?)?))?|(?:(?:move|place)?\s+(?:the\s+)?)?(?:cursor|mouse)\s+over/i,/hovering(?:\s+(?:over|inside|on(?:(?:\s+the)?\s+center\s+of|\s+top(?:\s+of)?)?))?|(?:mov|plac)ing\s+(?:the\s+)?(?:cursor|mouse)\s+over/i),{'type':'actionword'}),Anchor$2=Mutate$17(Anchor$3({'Element':Element$2}),(B,[Q])=>{const a=B['element'];return a?a['anchor']=[Q,a['anchor']??[]]['flat']():B['element']={'anchor':Q};}),TargetElement$3=Mutate$17(Element$2,(B,[Q])=>{const a=B['element'];if(!a||'isElementReference'in Q)return B['element']=Q;return Object['assign'](a,Q,Q['anchor']&&a['anchor']?{'anchor':[a['anchor']??[],Q['anchor']??[]]['flat']()}:{});}),FocusedElement$2=Mutate$17(ImplicitElement,(B,[Q])=>B['element']=Q),Hover=LogGroup('Hover',Apply$17(All(HoverAction,Any(All(Optional(LocationPreposition),FocusedElement$2),All(Optional(Weak(Anchor$2)),Optional(LocationPreposition),TargetElement$3))))),{Apply:Apply$16,Mutate:Mutate$16}=State({'type':'type'}),TypeActionKeyword=Continuous(/type|enter|fill|write|insert/i,/typing|entering|filling|writing|inserting/i),TypeAction=Mark(TypeActionKeyword,{'type':'actionword'}),GenerateAndTypeAction=Mark(All(/generate/i,And,TypeActionKeyword),{'type':'actionword'}),Preposition=Any(LocationPreposition,FunctionalPreposition,For),StringValue=Mutate$16(Mark(StringExpression$1,{'type':'value'}),(B,[Q])=>B['value']=Q),OTPValue=Mutate$16(Mark(OTPLiteral,{'type':'value'}),(B,[Q])=>B['value']=Q),ClipboardValue=Mutate$16(Mark(Any(PreCondition(B=>B['context']['has']('element'),Node(All(Its,Value$5),(B,Q)=>({'operator':'extract','operands':[{'isOperand':!![],'value':Q['context']['element']},'string']}))),PreCondition(B=>B['context']['has']('clipboard'),Node(Any(It,Them),(B,Q)=>Q['context']['clipboard']))),{'type':'value'}),(B,[Q])=>B['value']=Q),UnquotedCompoundValue=Weak(Fix(Mutate$16(Mark(All(UnquotedStringLiteral$1,UnquotedStringLiteral$1),{'type':'value'}),(B,[Q,a])=>B['value']=Q+'\x20'+a),B=>'\x22'+B+'\x22')),Value=Any(OTPValue,ClipboardValue,StringValue),MaskedValue=Mutate$16(Mark(Value,{'type':'secret'}),B=>B['secret']=!![]),SecretValue=Any(All(Optional(The),Secret$1,MaskedValue),All(MaskedValue,Secret$1)),TextboxElement=Mutate$16(Any(ImplicitElement,Element$2),(B,[Q])=>B['element']=Q),AnchoredTextboxElement=Mutate$16(Anchor$3({'Element':Element$2}),(B,[Q])=>B['element']={'anchor':Q}),SecretTextboxElement=Longest(PostCondition(TextboxElement,([B])=>!!B['secret']),All(Optional(The),Secret$1,TextboxElement)),DefaultTextboxElement=Mutate$16(PreCondition(B=>B['context']['has']('element'),Node(Nothing$1,(B,Q)=>Q['context']['element'])),(B,[Q])=>B['element']={'state':{'focused':!![]},'fallback':Q}),SecretDefaultTextboxElement=PreCondition(B=>B['context']['has']('element')&&!!B['context']['element']['secret'],DefaultTextboxElement),ChromeTextboxElement=Mutate$16(ChromeTextbox,(B,[Q])=>B['element']=Q),ExplicitChromeTextboxElement=Mutate$16(ExplicitChromeTextbox,(B,[Q])=>B['element']=Q),DialogTextboxElement=Mutate$16(DialogTextbox,(B,[Q])=>B['element']=Q),ExplicitDialogTextboxElement=Mutate$16(ExplicitDialogTextbox,(B,[Q])=>B['element']=Q),InBrowserDialog=Mutate$16(All(LocationPreposition,Optional(The),BrowserDialog,Optional(ActionModifierSeparator)),B=>B['element']={'isDialogElementDescriptor':!![],'title':'prompt'}),ConventionalTextboxElement=Any(All(Preposition,TextboxElement),AnchoredTextboxElement),TypeBody=Any(All(Url$4,Value,Preposition,ChromeTextboxElement),All(Value,Preposition,Any(ExplicitChromeTextboxElement,ExplicitDialogTextboxElement)),All(MaskedValue,Preposition,SecretTextboxElement),All(Any(SecretValue,Value),ConventionalTextboxElement),All(SecretValue,Optional(DefaultTextboxElement)),All(SecretTextboxElement,MaskedValue),All(TextboxElement,SecretValue),All(OTPValue,Optional(DefaultTextboxElement)),Longest(All(MaskedValue,SecretDefaultTextboxElement),All(Value,Optional(DefaultTextboxElement)),UnquotedCompoundValue,All(TextboxElement,Weak(Value)))),Type$1=LogGroup('Type',Apply$16(Any(All(TypeAction,TypeBody),All(InBrowserDialog,TypeAction,Value,Optional(All(Preposition,DialogTextboxElement))),All(GenerateAndTypeAction,OTPValue,Optional(Any(ConventionalTextboxElement,DefaultTextboxElement)))))),PartialType=LogGroup('PartialType',Apply$16(TypeBody)),{Apply:Apply$15,Mutate:Mutate$15}=State({'type':'search'}),SearchAction=Mark(Continuous(/search/i,/searching/i),{'type':'actionword'}),QuotedValue=Mutate$15(Mark(QuotedStringExpression,{'type':'value'}),(B,[Q])=>B['value']=Q),UnquotedValue=Fix(Mutate$15(Mark(Anything$1,{'type':'value'}),(B,[Q])=>B['value']=Q['trim']()),B=>'\x22'+B+'\x22'),Input=Mutate$15(Element$2,(B,[Q])=>B['element']=Q),Search=LogGroup('Search',Dynamic(B=>{const Q=Apply$15(All(SearchAction,Optional(For),Optional(The),Longest(All(Any(QuotedValue,UnquotedValue),Optional(All(Optional(LocationPreposition),PostCondition(Input,([a])=>'isElementReference'in a||!!a['type'])))),UnquotedValue)));if(!B['options']['intent'])return Q;else return Node(Text$2(Q),([a],c)=>{const X={'type':'intent','description':a};return c['collections']['intents']['push'](X),X;});})),{Apply:Apply$14,Mutate:Mutate$14}=State({'type':'click'}),ClickAction=Mark(NoBoundary(All(Optional(All(Any(Mutate$14(Any(Node(/left/i,()=>'left'),Node(/right/i,()=>'right')),(B,[Q])=>B['button']=Q),Mutate$14(MultiplicativeNumberLiteral,(B,[Q])=>B['times']=Q)),Optional('-'))),Continuous(/click|press|hit|tap|open|expand|collapse/i,/clicking|pressing|hitting|tapping|opening|expanding|collapsing/i))),{'type':'actionword'}),Anchor$1=Mutate$14(Anchor$3({'Element':Element$2}),(B,[Q])=>{const a=B['element'];return a?a['anchor']=[Q,a['anchor']??[]]['flat']():B['element']={'anchor':Q};}),TargetElement$2=Mutate$14(Element$2,(B,[Q])=>B['element']=B['element']?mergeElementDescriptors(B['element'],Q):Q),FocusedElement$1=Mutate$14(ImplicitElement,(B,[Q])=>B['element']=Q),ExplicitDialogElement=Mutate$14(ExplicitDialogButton,(B,[Q])=>B['element']=Q),DialogElement=Mutate$14(DialogButton,(B,[Q])=>B['element']=Q),ChromeElement=Mutate$14(Any(ChromeButton,ChromeTab),(B,[Q])=>B['element']=Q),ExplicitChromeTabElement$1=Mutate$14(Any(ExplicitChromeButton,ExplicitChromeTab),(B,[Q])=>B['element']=Q),ControlKey=Mutate$14(Mark(Stringish(ControlKey$1),{'type':'value'}),(B,[Q])=>(B['keys']??=[])['push'](Q)),Key$1=Mutate$14(Mark(Stringish(KeyboardKey),{'type':'value'}),(B,[Q])=>(B['keys']??=[])['push'](Q)),ChordSeparator$1=Any(AndListSeparator,'+',Nothing$1),Chord$1=List(All(Optional(The),Any(All(KeyboardKey$1,Key$1),All(Key$1,Optional(KeyboardKey$1)))),ChordSeparator$1),Click=LogGroup('Click',Apply$14(Any(All(Mutate$14(Mark(Continuous(Text$2(Any(Accept,Dismiss)),Text$2(/(?:ok|accept|agree|allow|confirm|submit|cancel|decline|reject|clos|discard|dismiss)ing/i)),{'type':'actionword'}),(B,[Q])=>B['element']={'type':'button','title':Q}),Optional(Mutate$14(Any(Dialog,Element$2),(B,[Q])=>attachAnchor(B['element'],{'position':'inside','element':Q})))),All(Optional(All(ControlKey,Optional(All(Optional(ChordSeparator$1),Chord$1)),Optional(ChordSeparator$1))),ClickAction,Any(All(Optional(LocationPreposition),Any(FocusedElement$1,ExplicitDialogElement,ExplicitChromeTabElement$1)),All(Optional(Weak(Anchor$1,{'cost':0x2})),Optional(LocationPreposition),TargetElement$2)),Optional(All(While,Holding,Chord$1))),All(LocationPreposition,Optional(The),BrowserToolbar,Optional(ActionModifierSeparator),ClickAction,Optional(LocationPreposition),ChromeElement),All(LocationPreposition,Optional(The),BrowserDialog,Optional(ActionModifierSeparator),ClickAction,Optional(LocationPreposition),DialogElement)))),{Apply:Apply$13,Mutate:Mutate$13}=State({'type':'scroll'}),ScrollAction=Mark(Continuous(/scroll/i,/scrolling/i),{'type':'actionword'}),GoToPositionAction=Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Direction=Mutate$13(Any(Node(/upwards?|up/i,()=>'up'),Node(/downwards?|down/i,()=>'down'),Node(/left/i,()=>'left'),Node(/right/i,()=>'right')),(B,[Q])=>B['direction']=Q),Times$2=Mutate$13(Any(IterativeNumberLiteral,All(CardinalNumberExpression,Times$4)),(B,[Q])=>B['times']=Q),Distance=Mutate$13(NoBoundary(All(QuantitativeNumberExpression,Optional(Pixels))),(B,[Q])=>B['distance']=Q),AbsolutePositionMutator=(B,[Q])=>{delete B['direction'],delete B['fraction'],B['position']=Q;},AbsolutePosition=Mutate$13(All(Optional(To),AbsolutePosition$1),AbsolutePositionMutator),ExplicitAbsolutePosition=Mutate$13(All(To,AbsolutePosition$1),AbsolutePositionMutator),Fraction=Mutate$13(All(Optional(The),Any(InnerRelationalOffset,QuantitativeNumberExpression)),(B,[Q])=>B['fraction']=Q),ContextElement=Mutate$13(Any(Viewport,Element$2),(B,[Q])=>B['element']=Q),PageContextElement=Mutate$13(Any(Viewport,PageElement),(B,[Q])=>B['element']=Q),TargetElement$1=Mutate$13(Element$2,(B,[Q])=>{if(B['position']==='bottom'&&!('isElementReference'in Q))Q['orderDirection']='backward';delete B['direction'],delete B['position'],B['element']=Q;}),TargetExplicitElement=Mutate$13(ExplicitElement,(B,[Q])=>{if(B['position']==='bottom'&&!('isElementReference'in Q))Q['orderDirection']='backward';delete B['direction'],delete B['position'],B['element']=Q;}),Scroll=LogGroup('Scroll',Apply$13(Any(All(Any(ScrollAction,GoToPositionAction),Any(All(Fraction,Any(All(ExplicitAbsolutePosition,Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))),All(Optional(Any(Of,LocationPreposition)),ContextElement,Optional(Any(Direction,AbsolutePosition))),All(Direction,Optional(AbsolutePosition),Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))),All(AbsolutePosition,Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))))),All(Direction,Optional(Any(All(Times$2,Optional(All(Optional(Fraction),Optional(AbsolutePosition),Optional(Any(Of,LocationPreposition)),ContextElement))),All(Optional(By),Distance),All(Optional(Fraction),Optional(AbsolutePosition),Optional(Any(Of,LocationPreposition)),Any(All(To,TargetElement$1),ContextElement)),Fraction))),All(AbsolutePosition,Optional(Any(All(Any(Of,LocationPreposition),ContextElement),PageContextElement,TargetElement$1))),All(ContextElement,Any(All(Direction,Optional(By),Distance),All(Direction,Optional(Times$2),Optional(Fraction)),All(Optional(Times$2),Fraction,Direction))))),All(ScrollAction,To,TargetElement$1),All(GoToPositionAction,To,TargetExplicitElement)))),{Apply:Apply$12,Mutate:Mutate$12}=State({'type':'navigate\x20pdf'}),NavigatePdfAction=Mark(Continuous(/go|navigate|jump|switch|flip/i,/going|navigating|jumping|switching|flipping/i),{'type':'actionword'}),ShowPdfPageAction=Mark(Continuous(/open|view|show/i,/opening|viewing|showing/i),{'type':'actionword'}),PdfPage=Mutate$12(Any(All(Any(OrdinalNumberExpression$1,Node(Last$1,()=>-0x1)),Any(PdfPage$1,Page)),All(Any(PdfPage$1,Page),Optional(Any(NumberSign,Number$1)),CardinalNumberExpression)),(B,[Q])=>B['page']=Q),NavigatePdf=Apply$12(All(Any(All(NavigatePdfAction,To),ShowPdfPageAction),Optional(The),PdfPage)),{Apply:Apply$11,Mutate:Mutate$11}=State({'type':'wait'}),WaitAction=Mark(Continuous(/wait|halt|pause|delay|block/i,/halting|blocking/i),{'type':'actionword'}),TimeInterval=Mutate$11(TimeIntervalExpression,(B,[Q])=>B['timeout']=Q),Condition$1=Any(Mutate$11(Condition$2,(B,[Q])=>B['condition']=Q),Mutate$11(Element$2,(B,[Q])=>B['condition']={'isCondition':!![],'operation':{'operator':'visible','operands':[{'isOperand':!![],'value':Q}]}})),Wait$1=LogGroup('Wait',Apply$11(All(WaitAction,Optional(Any(All(Optional(For),Optional(Maximum),TimeInterval,Optional(All(Any(For,Until),Condition$1))),All(Any(For,Until),Condition$1,Optional(All(Optional(For),Optional(Maximum),TimeInterval)))))))),{Apply:Apply$10,Mutate:Mutate$10}=State({'type':'refresh'}),RefreshAction=Mark(Continuous(/refresh|reload/i,/refreshing|reloading/i),{'type':'actionword'}),Type=Any(Mutate$10(/hard(?:ly)?|(?:ignore|ignoring|skip|skipping)(?:\s+the)?(?:\s+cache)/i,B=>B['value']='hard'),Mutate$10(/soft(?:ly)?/i,B=>B['value']='soft')),Refresh=LogGroup('Refresh',Apply$10(Any(All(RefreshAction,Optional(All(Optional(The),Any(Page,BrowserTab))),Optional(Type)),All(Type,RefreshAction,Optional(All(Optional(The),Any(Page,BrowserTab))))))),{Apply:Apply$9,Mutate:Mutate$9}=State({'type':'hit\x20key'}),HitKeyAction=Mark(Continuous(/hit|press/i,/hitting|pressing/i),{'type':'actionword'}),TypeKeyAction=Mark(Continuous(/type/i,/typing/i),{'type':'actionword'}),InputSource=All(LocationPreposition,Optional(The),Keyboard$1),Times$1=Mutate$9(Any(All(CardinalNumberExpression,Times$4),IterativeNumberExpression),(B,[Q])=>B['times']=Q),Key=Mutate$9(Mark(Stringish(KeyboardKey),{'type':'value'}),(B,[Q])=>(B['keys']??=[])['push'](Q)),ArrowKey=Mutate$9(ArrowKey$1,(B,[Q])=>(B['keys']??=[])['push'](Q)),BackspaceKey=Mutate$9(BackspaceKey$1,(B,[Q])=>(B['keys']??=[])['push'](Q)),DeleteKey=Mutate$9(DeleteKey$1,(B,[Q])=>(B['keys']??=[])['push'](Q)),ChordSeparator=Any(AndListSeparator,'+',Nothing$1),Chord=WeakList(All(Optional(The),Any(All(KeyboardKey$1,Key),All(Key,Optional(KeyboardKey$1)))),ChordSeparator),ExplicitChord=WeakList(All(Optional(The),Any(All(KeyboardKey$1,Key),All(Key,KeyboardKey$1))),ChordSeparator),HitKey=LogGroup('HitKey',Apply$9(Any(All(All(InputSource,Optional(','),Any(HitKeyAction,TypeKeyAction)),Optional(LocationPreposition),Chord,Optional(KeyboardKeys),Optional(Times$1)),All(HitKeyAction,Optional(LocationPreposition),Chord,Optional(Any(KeyboardKeys,InputSource)),Optional(Times$1)),All(TypeKeyAction,Optional(LocationPreposition),Any(All(ExplicitChord,Optional(Any(KeyboardKeys,InputSource))),All(Chord,Any(KeyboardKeys,InputSource))),Optional(Times$1))))),HitArrowKey=LogGroup('HitArrowKey',Apply$9(All(ArrowKey,Optional(Times$1)))),HitBackspaceKey=LogGroup('HitBackspaceKey',Apply$9(All(BackspaceKey,Optional(Times$1)))),HitDeleteKey=LogGroup('HitDeleteKey',Apply$9(All(DeleteKey,Optional(Times$1)))),{Apply:Apply$8,Mutate:Mutate$8}=State({'type':'switch'}),SwitchAction=Mark(Continuous(/switch\s+to|change\s+to/i,/switching\s+to|changing\s+to/i),{'type':'actionword'}),ActivateTabAction=Mark(Continuous(/activate|focus\s+on|select/i,/activating|focusing\s+on|selecting/i),{'type':'actionword'}),ExplicitChromeElement=Mutate$8(ExplicitChromeTab,(B,[Q])=>B['element']=Q),TabElement=Mutate$8(PostCondition(Element$2({'reference':![]}),([B])=>!('isElementReference'in B)&&(!B['type']||(Array['isArray'](B['type'])?B['type']:[B['type']])['includes']('tab'))),(B,[Q])=>B['element']='isElementReference'in Q||Q['type']?Q:{...Q,'hints':{...Q['hints'],'type':'tab'}}),ExplicitTabElement=Mutate$8(PostCondition(Element$2({'reference':![]}),([B])=>!('isElementReference'in B)&&(Array['isArray'](B['type'])?B['type']:[B['type']])['includes']('tab')),(B,[Q])=>B['element']=Q),Switch=LogGroup('Switch',Apply$8(Any(All(SwitchAction,Any(ExplicitChromeElement,TabElement)),All(ActivateTabAction,Any(ExplicitChromeElement,ExplicitTabElement))))),{Apply:Apply$7,Mutate:Mutate$7}=State({'type':'create\x20target'}),CreateTargetAction=Mark(Continuous(/create|open/i,/creating|opening/i),{'type':'actionword'}),Url$1=Mutate$7(Mark(Url$3,{'type':'navigation\x20url'}),(B,[Q])=>B['url']=Q),CreateTarget=LogGroup('CreateTarget',Apply$7(All(CreateTargetAction,Article(All(Optional(New),BrowserTab)),Optional(All(Any(LocationPreposition,AssociationPreposition),Article(Any(Url$4,Website)),Url$1))))),{Apply:Apply$6,Mutate:Mutate$6}=State({'type':'close'}),CloseAction=Mark(Continuous(Dismiss,/cancell?ing|declining|rejecting|closing|discarding|dismissing/i),{'type':'actionword'}),ExplicitChromeTabElement=Mutate$6(Longest(ActiveChromeTab,ExplicitChromeTab),(B,[Q])=>B['element']=Q),TargetElement=Mutate$6(Any(Dialog,Element$2),(B,[Q])=>B['element']=Q),FocusedElement=Mutate$6(ImplicitElement,(B,[Q])=>B['element']=Q),Close=LogGroup('Close',Apply$6(All(CloseAction,Optional(LocationPreposition),Any(FocusedElement,ExplicitChromeTabElement,TargetElement)))),{Apply:Apply$5,Mutate:Mutate$5}=State({'type':'go'}),Go=LogGroup('Go',Apply$5(All(Disambiguate(All(Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Optional(To),Optional(The)),B=>[B+'\x20url',B+'\x20element']),Mutate$5(StringExpression$1,(B,[Q])=>B['target']=Q)))),VisualCheck=LogGroup('VisualCheck',Node(Mark(Continuous(/visual\s+check/i,/visually\s+checking|visual\s+checking/i),{'type':'actionword'}),()=>({'type':'visual\x20check'}))),{Apply:Apply$4,Mutate:Mutate$4}=State({'type':'intent'}),FillAction=Mark(Continuous(/fill/i,/filling/i),{'type':'actionword'}),FillOutAction=Mark(Continuous(/fill\s+out/i,/filling\s+out/i),{'type':'actionword'}),Form=PostCondition(Element$2({'reference':![]}),([B])=>!('isElementReference'in B)&&B['type']==='form'),Description=B=>Mutate$4(Text$2(B),(Q,[a])=>Q['description']=a),Intent=LogGroup('Intent',PreCondition(B=>B['options']['intent'],Effect(Apply$4(Any(Description(All(FillOutAction,Anything$1)),Description(All(FillAction,Form)))),([B],Q)=>Q['collections']['intents']['push'](B)))),{Apply:Apply$3,Mutate:Mutate$3,state}=State({'type':'initialize\x20scope'}),InitializeScopeAction=Mark(Continuous(/run|execute|invoke|call|do|perform/i,/running|executing|invoking|calling|doing|performing/i),{'type':'actionword'}),ScopeName=Mutate$3(Mark(StringLiteral$1,{'type':'scope\x20name'}),(B,[Q])=>B['name']=Q),Scope$1=Mark(All(Optional(All(Optional(Each),Optional(Of),Optional(The),TestSteps,Optional(Any(LocationPreposition,Of)))),Optional(The),Any(All(CustomFlowTest,ScopeName),All(ScopeName,Optional(CustomFlowTest)))),{'type':'scope\x20definition'}),Parameter=Mutate$3(Effect(State({'secret':![]},({Mutate:B,state:Q})=>{const a=B(Article(Secret$1),h=>h['secret']=!![]),c=B(Effect(Mark(Node(StringLiteral$1({'escape':/[:=]/}),([h])=>h['toLowerCase']()),{'type':'parameter\x20name'}),([h],V,k)=>{if(isReservedName(h))V['collections']['errors']['push']({'type':'ReservedParameterNameError','pos':k['pos'],'text':V['text']['slice'](k['pos'],V['pos']),'message':h+'\x20is\x20a\x20reserved\x20variable\x20name\x20and\x20cannot\x20be\x20used\x20as\x20an\x20argument'});}),(h,[V])=>{h['name']=V;if(isSecretName(V))h['secret']=!![];}),X=PostCondition(c,(h,V)=>Q(V)['secret']),f=B(Mark(AnyExpression$1,{'type':'parameter\x20value'}),(h,[V])=>h['value']=V),J=Mark(f,{'type':'secret'}),Y=h=>Dynamic(V=>Q(V)['secret']?Mark(h,{'type':'secret'}):h);return Any(All(J,StoragePreposition,Optional(The),X),All(Optional(a),Y(f),StoragePreposition,Optional(The),c),All(c,Any(All(Any(AssignmentPreposition,Be),Optional(The)),/[:=]/),Optional(a),Y(f)));}),([B],Q,a)=>{if(state(Q)['parameters']?.['some'](({name:c})=>c===B['name']))Q['collections']['errors']['push']({'type':'RedefinedParameterError','pos':a['pos'],'text':Q['text']['slice'](a['pos'],Q['pos']),'message':'The\x20argument\x20'+B['name']+'\x20is\x20already\x20defined'});}),(B,[Q])=>(B['parameters']??=[])['push'](Q)),Parameters=Mark(List(All(Optional(Any(With,When,Using)),Optional(Parameters$1),Parameter),AndListSeparator),{'type':'scope\x20parameters'}),AssertionType=Any(Node(/visual\s+and\s+(?:non[-\s]?visual|textual)|(?:non[-\s]?visual|textual)\s+and\s+visual/i,()=>'all'),Node(/visual/i,()=>'visual'),Node(/non[-\s]?visual|textual/i,()=>'nonvisual')),Options$1=Mark(List(All(Any(All(Any(Run,Running),Optional(All(Each,Optional(All(Of,Optional(The)))))),All(Dont,Skip),All(Without,Skipping)),Any(Mutate$3(All(Optional(AssertionType),Assertions),(B,[Q='all'])=>{const a=B['options']??={};if(!a['assertions']||Q==='all')a['assertions']=Q;else{if(a['assertions']!=='all'&&a['assertions']!==Q)a['assertions']='all';}}),Mutate$3(Article(All(Start,Url$4)),B=>(B['options']??={})['navigation']='all'))),AndListSeparator),{'type':'scope\x20options'}),InitializeScope=Effect(Apply$3(Mark(All(InitializeScopeAction,Scope$1,Optional(All(Optional(AndListSeparator),Parameters)),Optional(All(Optional(AndListSeparator),Options$1))),{'type':'control\x20flow','subtype':'initialize\x20scope'})),([B],Q)=>Q['collections']['scopes']['push']({'name':B['name'],'parameters':(B['parameters']??[])['map'](({name:a})=>a),'options':B['options']})),IfKeyword=Mark(/(?:only\s+)?if(?:\s+and\s+only\s+if)?|(?:given|providing)\s+that/i,{'type':'keyword'}),UnlessKeyword=Mark(/unless/i,{'type':'keyword'}),ElseKeyword=Mark(/else|otherwise/i,{'type':'keyword'}),Block$1=(B,{collapseElseif:collapseElseif=![]}={})=>Mark(B,{'type':'block','mutate':collapseElseif?(Q,[a])=>{if(a?.['length']===0x1&&a[0x0]?.['type']==='if')Q['type']='empty';}:void 0x0}),Then=All(Then$1,Optional(All(Run,Optional(All(Optional(Any(The,These,This)),Following)),Optional(TestStep),Optional(TestSteps))),Optional(ActionModifierSeparator)),Else=B=>{return LogGroup('Else',Node(All(Optional(BlockSeparator),Mark(ElseKeyword,{'type':'control\x20flow','subtype':'else'}),Optional(ActionModifierSeparator),Block$1(Optional(B),{'collapseElseif':!![]})),([Q],a)=>{return a['collections']['conditionals']['length']=0x0,a['collections']['conditionals']['push'](Q?.[0x0]['type']==='if'?'elseif':'else'),Q??[];}));},If=B=>{return LogGroup('If',Node(All(Mark(Any(All(IfKeyword,Condition$2),All(UnlessKeyword,NegativeCondition$1)),{'type':'control\x20flow','subtype':'if'}),Optional(Any(All(Optional(ActionModifierSeparator),Then),ActionModifierSeparator)),Block$1(Optional(B)),Optional(Else(B))),([Q,a,c],X)=>{X['collections']['conditionals']['length']=0x0,X['collections']['conditionals']['push']('if');const f={'type':'if','condition':Q};if(a)f['then']=a;if(c)f['otherwise']=c;return f;}));},{Apply:Apply$2,Mutate:Mutate$2}=State({'type':'loop','instructions':[]}),RunKeyword=Mark(Run,{'type':'keyword'}),RepeatKeyword=Mark(Any(Repeat$1,Iterate),{'type':'keyword'}),ForEachKeyword=Mark(Any(/for[-\s]?(?:each|every|any)/i,All(Iterate,Over,/each|every|any/i),/for(?![-\s]?all)/i),{'type':'keyword'}),ForAllKeyword=Effect(Mark(Any(/for[-\s]?all/i,All(Iterate,Over,Optional(/all/i))),{'type':'keyword'}),(B,Q)=>{Q['context']['plural']=!![];}),UntilKeyword=Mark(Until,{'type':'keyword'}),WhileKeyword=Mark(While,{'type':'keyword'}),KeepKeyword=Effect(Mark(/keep(?:\s+on)?/i,{'type':'keyword'}),(B,Q)=>{Q['context']['continuous']=!![];}),Condition=Mutate$2(Condition$2,(B,[Q])=>B['condition']=Q),NegativeCondition=Mutate$2(NegativeCondition$1,(B,[Q])=>B['condition']=Q),Times=Mutate$2(Any(IterativeNumberLiteral,All(CardinalNumberExpression,Times$4)),(B,[Q])=>B['times']=Q),Delay=Mutate$2(TimeIntervalExpression,(B,[Q])=>B['wait']=Q),Wait=Any(All(Any(Wait$2,Waiting),Optional(For),Delay,Optional(All(Between,Optional(Every),Iterations))),All(Every,Delay)),Binding=B=>Mutate$2(Effect(B,([Q],a)=>a['collections']['variables']['push']({'name':Q},{'name':'it'})),(Q,[a])=>Q['bindings']=[a]),IterableData=Mutate$2(PostCondition(AnyExpression$1,([B])=>typeof B!=='string'||!/^it\b/i['test'](B)),(B,[Q])=>B['iterable']=Q),IterableElement=Mutate$2(Element$2,(B,[Q])=>B['iterable']=Q),Declaration=B=>Effect(B,(Q,a)=>a['collections']['variables']['push']({'name':'index'},{'name':'key'})),Block=B=>Mutate$2(Mark(B,{'type':'block'}),(Q,[a])=>{if(a)Q['instructions']=a;}),Repeat=B=>{return LogGroup('Repeat',Apply$2(Declaration(Any(All(Mark(Any(All(Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Any(Repeat$1,Iterate,Run),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait))),All(Any(RepeatKeyword,RunKeyword),Optional(All(Optional(Any(The,These,This)),Following,Optional(Any(TestStep,TestSteps)))),Any(All(Optional(Maximum),Times,Optional(Any(All(While,Condition),All(Until,NegativeCondition)))),Any(All(While,Condition),All(Until,NegativeCondition))),Optional(All(Optional(BlockSeparator),Wait)))),{'type':'control\x20flow','subtype':'loop'}),Optional(ActionModifierSeparator),Block(Optional(B))),All(KeepKeyword,Block(B),Optional(ActionModifierSeparator),Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait)))))));},ForEach=B=>{return LogGroup('ForEach',Apply$2(Declaration(All(Mark(All(Any(All(ForEachKeyword,Any(All(Binding(Identifier$1),RelationalPreposition,IterableData),IterableElement)),All(ForAllKeyword,Effect(Any(All(Binding(SingularizedIdentifier),RelationalPreposition,IterableData),IterableElement),(Q,a)=>a['context']['plural']=![]))),Optional(All(Optional(BlockSeparator),Wait))),{'type':'control\x20flow','subtype':'loop'}),Optional(ActionModifierSeparator),Block(Optional(B))))));},Loop=B=>Any(Repeat(B),ForEach(B)),LoopPostlude=Node(LogGroup('LoopPostlude',Apply$2(Declaration(All(Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait)))))),([B])=>(Q,a,c)=>{const X=Math['min'](a['context']['self']['data']['get']('group')??0x1,Q['length']);B['instructions']=Q['slice'](-X);if(X>=Q['length'])return B;const f=a['text']['slice'](c['pos'],a['pos']),J=a['collections']['markers']['slice']()['filter'](Y=>Y['type']==='actionword'&&Y['pos']>=c['pos'])['toReversed']()['reduce']((Y,h)=>replace(Y,h['pos']-c['pos'],h['text']['length'],gerundize(h['text'])),f);return a['collections']['disambiguations']['push']({'pos':c['pos'],'text':f,'replacements':['keep\x20'+J]}),[...Q['slice'](0x0,-X),B];});Sanitize$1(ElementType$1);const Currency=Any(Any(/USD/i,/\$/,/U\.?S\.?\s*D(?:ollars?)?/i,/United\s*States\s*D(?:ollars?)?/i),Any(/EUR?O?s?/i,/€/),Any(/GBP/i,/£/,/Pounds?\s*(?:Sterling)?/i,/Great\s*Britain\s*Pounds?/i),Any(/JPY/i,/¥/,/(?:Japanese\s*)?Yen/i),Any(/CHF/i,/Fr\.?/i,/(?:Swiss\s*)?Francs?/i),Any(/CAD/i,/C(?:an)?\$/,/Canad(?:ian|a)\s*D(?:ollars?)?/i),Any(/AUD/i,/A(?:us)?\$/,/Austral(?:ian|ia)\s*D(?:ollars?)?/i),Any(/NZD/i,/NZ\$/,/New\s*Zealand\s*D(?:ollars?)?/i),Any(/CNY/i,/RMB/i,/CN¥/,/元/,/(?:Chinese\s*)?Yuan/i,/Renminbi/i),Any(/HKD/i,/HK\$/,/Hong\s*Kong\s*D(?:ollars?)?/i),Any(/SGD/i,/S\$/,/Singapore\s*D(?:ollars?)?/i),Any(/KRW/i,/₩/,/(?:South\s*)?Korean\s*Won/i),Any(/INR/i,/₹/,/Rs\.?/i,/(?:Indian\s*)?Rupees?/i),Any(/SEK/i,/(?:Swedish\s*)?Kron(?:a|or)/i),Any(/NOK/i,/(?:Norwegian\s*)?Kron(?:e|er)/i),Any(/TRY/i,/₺/,/TL/i,/(?:Turkish\s*)?Liras?/i),Any(/MXN/i,/Mex\$/,/(?:Mexican\s*)?Pesos?/i),Any(/BRL/i,/R\$/,/(?:Brazilian\s*)?Re(?:al|ais)/i),Any(/ZAR/i,/Rand/i,/R/)),SUPPORTED_LOCALES=['en','tr','es','fr','de','it','pt','he'];function getMonthsPattern(B){const Q=new Set(),a=new Intl['DateTimeFormat'](B,{'month':'long'}),c=new Intl['DateTimeFormat'](B,{'month':'short'});for(let f=0x0;f<0xc;f++){const J=new Date(0x7d0,f,0x1);Q['add'](a['format'](J)['toLowerCase']()),Q['add'](c['format'](J)['toLowerCase']());}const X=Array['from'](Q)['join']('|');return Use(new RegExp(X,'i'));}const Month=Any(...SUPPORTED_LOCALES['map'](B=>getMonthsPattern(B))),DateDelim=/[\/\-\.]/,TimeValue=Use(/(?:\d{1,2}:\d{2}(?::\d{2})?(?:\s*[ap]m)?)|(?:\d{1,2}\s*[ap]m)/i),TimeZone=Any(/Z/i,All(/[+-]/,/\d{2}/,Optional(All(/:?/,/\d{2}/)))),Year=/\d{4}/,IsoDate=All(Year,/-/,/\d{2}/,/-/,/\d{2}/,Optional(All(/T|\s+/,TimeValue,Optional(TimeZone)))),NumericDate=All(/\d{1,2}/,DateDelim,/\d{1,2}/,DateDelim,/\d{2,4}/),TextDateMonthFirst=All(Month,Optional(/\./),Optional(/\s+/),OrdinalNumberLiteral$1,Optional(All(/,?\s+/,Year))),TextDateDayFirst=All(OrdinalNumberLiteral$1,Optional(/\s+/),Optional(Of),Optional(/\s+/),Month,Optional(/\.?/),Optional(All(/,?\s+/,Year))),DateValue=Mark(Any(IsoDate,NumericDate,All(Month,Optional(/\./),Optional(/\s+/),Any(OrdinalNumberLiteral$1,NonnegativeIntegerNumberLiteral),Optional(/,/),/\s+/,Year),TextDateMonthFirst,TextDateDayFirst),{'type':'date'}),NumberValue=NumericLiteral,Percentage=Any(All(Optional(/[-+]/),Any(All(/%/,Optional(/\s+/),QuantitativeNumberLiteral),NoBoundary(All(QuantitativeNumberLiteral,Optional(/\s+/),/%/)))),Mark(All(QuantitativeNumberLiteral,Optional(/\s+/),Percentage$1),{'type':'percentage'})),Price=Mark(Any(All(NumericLiteral,Optional(/\s+/),Currency),All(Currency,Optional(/\s+/),NumericLiteral),All(/-/,Optional(/\s+/),Currency,Optional(/\s+/),QuantitativeNumberLiteral)),{'type':'price'}),Identifier=Mark(Any(/\S+/),{'type':'identifier'});function maskText(B,{meta:Q,mask:mask='***'}){let a=B;const c=[],X=[],f=[];for(const V of Q['markers']??[])if(V['type']==='secret'){let k=V['pos'];for(const t of f)if(t['pos']>=V['pos']&&t['pos']+t['length']<=V['pos']+V['text']['length']){if(t['pos']>k){const K={'pos':k,'length':t['pos']-k,'text':mask};if(!X['some'](O=>O['pos']<=K['pos']&&O['pos']+O['length']>=K['pos']+K['length']))X['push'](K);}k=t['pos']+t['length'];}if(V['pos']+V['text']['length']>k){const O={'pos':k,'length':V['pos']+V['text']['length']-k,'text':mask};if(!X['some'](S=>S['pos']<=O['pos']&&S['pos']+S['length']>=O['pos']+O['length']))X['push'](O);}}else{if(V['type']==='reference'||V['type']==='element\x20descriptor')f['push']({'pos':V['pos'],'length':V['text']['length']});}for(let S of Q['markers']??[]){let C=0x0;S=X['reduce']((G,E)=>{if(G['pos']<=E['pos']+C&&G['pos']+G['text']['length']>=E['pos']+C+E['length'])G['text']=replace(G['text'],E['pos']+C-G['pos'],E['length'],E['text']);else{if(G['pos']>=E['pos']+C+E['length'])G['pos']+=E['text']['length']-E['length'];}return C+=E['text']['length']-E['length'],G;},{...S}),c['push'](S);}const J=[];let Y=0x0;for(const G of X){J['push']({'pos':G['pos']+Y,'length':G['text']['length'],'text':a['substring'](G['pos']+Y,G['pos']+Y+G['length'])}),a=replace(a,G['pos']+Y,G['length'],G['text']),Y+=G['text']['length']-G['length'];}const h={'text':a,'meta':{...Q,'markers':c,'masks':J}};if(h['meta']['navigationUrls'])h['meta']['navigationUrls']=h['meta']['markers']['reduce']((E,W)=>{if(W['type']==='navigation\x20url')E['push'](W['text']['replaceAll'](/^['"]|['"]$/g,''));return E;},[]);return h;}const Empty=LogGroup('Empty',Node(/$/,()=>({'type':'empty'}))),PreinstructionKeyword=Mark(/pre(?:-|\s+)?step/i,{'type':'keyword'}),PreinstructionDescription=All(Prior,Optional(Running),Any(Each,The),Optional(Subsequent),Optional(TestSteps)),SetPreinstructions=B=>{return Node(Mark(All(Any(All(Activate,Optional(IndefiniteArticle),PreinstructionKeyword,Optional(ActionModifierSeparator)),All(Optional(Run),Optional(All(Optional(The),Following)),Any(PreinstructionKeyword,PreinstructionDescription),Optional(ActionModifierSeparator))),B),{'type':'control\x20flow','subtype':'set\x20preinstructions'}),([Q])=>({'type':'set\x20preinstructions','instructions':Q}));},SetPreinstructionsPostlude=Node(All(Optional(ActionModifierSeparator),PreinstructionDescription),()=>B=>({'type':'set\x20preinstructions','instructions':B})),DropPreinstructions=Node(Mark(Any(All(Cancel,Optional(The),PreinstructionKeyword),All(Any(All(Run,Nothing),All(Dont,Run,Anything)),PreinstructionDescription)),{'type':'control\x20flow','subtype':'drop\x20preinstructions'}),()=>({'type':'drop\x20preinstructions'})),TryKeyword=Mark(/try|optional/i,{'type':'keyword'}),Try=B=>{return Node(Mark(All(Any(All(TryKeyword,Optional(ActionModifierSeparator)),All(Optionally,Optional(All(Run,Optional(All(Optional(The),Following)),Optional(Any(TestStep,TestSteps)))),Optional(ActionModifierSeparator))),B),{'type':'control\x20flow','subtype':'try'}),([Q])=>({'type':'try','instructions':Q}));},TryPostlude=Node(PreCondition(B=>B['context']['has']('element'),All(Optional(Only),If$1,Optional(It),Optional(/is|does|be|(?:to|can)(?:\s+be)?|(?:have|has)\s+been/i),/visible|shown|shows?(?:\s+up)?|appears?|apparent|displayed/i)),()=>B=>({'type':'try','instructions':B}));function Instructions({allowed:B,disabled:Q}={}){function a(X,f){if(Q?.['includes'](X))return Never;if(B&&!B['includes'](X))return Never;return f;}const c=Node(List(Mark(Effect(Any(a('intent',Intent),a('switch',Switch),a('close',Close),a('create\x20target',CreateTarget),a('hit\x20key',HitKey),a('type',Type$1),a('navigate\x20pdf',NavigatePdf),a('click',Click),Longest(a('navigate',Navigate),a('scroll',Scroll)),a('go',Go),a('search',Search),a('assert',Assert),a('visual\x20check',VisualCheck),a('hover',Hover),a('erase',Erase),a('clear',Clear),a('wait',Wait$1),a('refresh',Refresh),a('hit\x20key',Weak(HitArrowKey)),a('hit\x20key',Weak(HitBackspaceKey)),a('focus',Focus),a('set\x20variable',SetTimeout),a('set\x20variable',SetVariable),a('set\x20value',SetValue),a('check',Check),a('set\x20variable',Generate),Longest(a('hit\x20key',HitDeleteKey),a('fetch',Fetch)),a('evaluate',Evaluate),Grab,a('type',PreCondition(X=>X['context']['action']?.['type']==='type',PartialType))),([X],f)=>f['context']['action']=X),{'type':'action','mutate':(X,[f],J)=>{X['subtype']=f?.['type']??'empty';if(J['context']['accessed'])X['type']='dependent\x20action',J['context']['group']=(J['context']['self']['data']['get']('group')??0x1)+0x1;else J['context']['group']=0x1;if(J['context']['has']('continuous'))J['context']['continuous']=!![];J['context']['refresh']();}}),ActionSeparator),X=>X);return All(Sanitize$1(Recursive((X,{depth:f})=>{return Customizable(({avoid:J}={})=>{return Node(Any(PreCondition(()=>f===0x0,a('empty',Empty)),PreCondition(()=>f===0x0,a('comment',Comment)),PreCondition(()=>J!=='try',a('try',Try(X({'avoid':'try'})))),PreCondition(()=>J!=='preinstruction',a('set\x20preinstructions',SetPreinstructions(X({'avoid':'preinstruction'})))),PreCondition(()=>J!=='preinstruction',a('drop\x20preinstructions',DropPreinstructions)),a('if',If(X({'avoid':'conditional'}))),a('if',Else(X)),a('loop',Loop(X({'avoid':'loop'}))),Node(All(c,Optional(Any(PreCondition(()=>J!=='try',a('try',TryPostlude)),PreCondition(()=>J!=='loop',a('loop',LoopPostlude)),PreCondition(()=>J!=='preinstruction',a('set\x20preinstructions',SetPreinstructionsPostlude))))),([Y,h],V,k)=>h?h(Y,V,k):Y),a('initialize\x20scope',InitializeScope)),([Y])=>Array['isArray'](Y)?Y:[Y]);});})),Optional(TrailingComment),Optional(InstructionTerminator));}const store$1=new WeakMap();function flatten(B){return B['flatMap'](Q=>{if(Q['type']==='if')return[Q,...flatten(Q['then']??[]),...flatten(Q['otherwise']??[])];else{if(Q['type']==='try'||Q['type']==='set\x20preinstructions')return[Q,...flatten(Q['instructions'])];}return[Q];});}function instructionMarkers(B){const Q=B['filter'](a=>{if(a['type']==='comment')return!![];if(a['type']==='action'||a['type']==='dependent\x20action'||a['type']==='control\x20flow')return Boolean(a['subtype'])&&a['subtype']!=='empty';return![];});return Q['filter'](a=>{if(a['type']!=='control\x20flow')return!![];return!Q['some'](c=>c!==a&&contains(a,c));})['toSorted']((a,c)=>a['pos']-c['pos']);}function contains(B,Q){return Q['pos']>=B['pos']&&Q['pos']+Q['text']['length']<=B['pos']+B['text']['length'];}function typeOf$1(B){return B['type']==='comment'?'comment':B['subtype'];}function getInstructionTexts(B){const Q=instructionMarkers(B['meta']['markers']??[]),a=new Map();let c=0x0;for(const X of flatten(B['result'])){const f=Q['slice'](c)['findIndex'](J=>typeOf$1(J)===X['type']);f>=0x0&&(a['set'](X,Q[c+f]['text']['trim']()),c+=f+0x1);}return a;}function registerInstructionTexts(B){getInstructionTexts(B)['forEach']((Q,a)=>store$1['set'](a,Q));}function getInstructionText(B){return store$1['get'](B);}function normalizeCurlString(B,Q=/[]/){return B['replaceAll'](new RegExp(String['raw']`\\([{\\nt]|${Q['source']})`,'g'),(a,c)=>{if(c==='n')return'\x0a';else{if(c==='t')return'\x09';}return c;})['replaceAll'](/\\u([0-9a-fA-F]{4})/g,(a,c)=>String['fromCharCode'](parseInt(c,0x10)))['replaceAll'](/\\x([0-9a-fA-F]{2})/g,(a,c)=>String['fromCharCode'](parseInt(c,0x10)));}const CurlString=Any(Any(Node(Use(/\$'([^']*)'/),([B])=>normalizeCurlString(B)),Use(/"([^"]+)"/),Use(/'([^']+)'/)),Use(/(\S+)/)),Sanitize=B=>TokenBoundary(Ignore(/[\s\\]+/,B)),{Apply:Apply$1,Mutate:Mutate$1}=State({'type':'fetch'}),Curl=/curl/i,CliOption=(B,Q)=>{return All(Any(All(/--/,B['longhand']),B['shorthand']?All(/-/,B['shorthand']):Never,B['optional']?Nothing$1:Never),Q);},Url=Mutate$1(CliOption({'longhand':'url','optional':!![]},CurlString),(B,[Q])=>B['url']=Q),BasicAuth=Mutate$1(CliOption({'longhand':'user','shorthand':'u'},CurlString),(B,[Q])=>{const [a,c]=Q['split'](':',0x2)['map'](X=>X['trim']());B['auth']={'type':'basic','username':a,'password':c};}),Header$2=Mutate$1(CliOption({'longhand':'header','shorthand':'H'},CurlString),(B,[Q])=>{const a=Q['indexOf'](':'),c=a>-0x1?Q['slice'](0x0,a)['trim']():Q['trim'](),X=a>-0x1?Q['slice'](a+0x1)['trim']():'';B['headers']??=[],B['headers']['push']({'name':c,'value':X,'secret':![]});}),Method$1=Mutate$1(Any(CliOption({'longhand':'request','shorthand':'X'},CurlString)),(B,[Q])=>{B['method']=Q['toLowerCase']();}),DataBody=Mutate$1(CliOption({'longhand':Any('data-urlencode','data-ascii','data'),'shorthand':'d'},CurlString),(B,[Q])=>{const [a,c]=Q['split']('=',0x2)['map'](J=>J['trim']());if(!c){B['body']??={'data':null},B['body']['data']=a;return;}B['body']??={'data':null};const X=typeof B['body']['data']==='string'?B['body']['data']['split']('&'):[],f=a+'='+c;B['body']['data']=[...X,f]['join']('&');}),Options=Any(BasicAuth,Header$2,Method$1,Any(Mutate$1(CliOption({'longhand':'data-raw'},CurlString),(B,[Q])=>{B['body']??={'data':Q};}),DataBody,Mutate$1(CliOption({'longhand':'json'},CurlString),(B,[Q])=>{B['body']??={'data':null};try{B['body']['data']=convertToStructure(JSON['parse'](Q));}catch{B['body']['data']=Q;}finally{B['body']['type']='json';}})),Mutate$1(CliOption({'longhand':'cookie','shorthand':'b'},CurlString),(B,[Q])=>{B['cookies']??=[];const a=Q['split'](';')['map'](X=>X['trim']());for(const c of a){const [X,f]=c['split']('=',0x2);B['cookies']['push']({'name':X,'value':f,'secret':![]});}}),Raw(CliOption({'longhand':/[a-zA-Z0-9.-]+/,'shorthand':/[a-zA-Z]/},Optional(CurlString)))),parse$5=makeParse(Apply$1(Sanitize(All(Curl,Star(Options),Url,Star(Options)))));function parseCurl(B){const Q=parse$5(B);if(Q['errors']||!Q['results'])return null;const [a]=Q['results'];return a;}const {Apply,Mutate}=State({'type':'fetch'}),URI=Any(Mutate(Use(/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/),(B,[Q])=>B['url']=Q),Mutate(Use(/(\S+)/),(B,[Q])=>{B['url']=''+(Q['startsWith']('/')?'':'/')+Q;})),Method=Mutate(Use(/(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)/i),(B,[Q])=>B['method']=Q['toLowerCase']()),HttpVersion=Use(/HTTP\/[0-9.]+/i),Headers$1=All(/\n/,List(Mutate(All(Use(/([^:\n]+)/),/:\s*/,Use(/([^\n]*)/)),(B,[Q,a])=>{B['headers']??=[],B['headers']['push']({'name':Q,'value':a,'secret':![]});}),/\n/)),Body$1=Mutate(Use(/(.+)/s),(B,[Q])=>{B['body']={'data':Q};}),parse$4=makeParse(Apply(All(Method,/\s+/,URI,/\s+/,HttpVersion,Optional(Headers$1),Optional(All(/\n\n/,Body$1)))));function parseHttp(B){const Q=parse$4(B);if(Q['errors']||!Q['results'])return null;const a=Q['results'][0x0],c=a['headers']?.['find'](X=>X['name']==='Host')?.['value'];if(c)a['url']='https://'+c+a['url'];return a;}function FetchAction(B){const Q=['send\x20http'];if(B['method'])Q['push'](B['method']);Q['push']('request\x20to\x20'+StringExpression(B['url']));const a=[];if(B['auth'])a['push'](Auth(B['auth']));if(B['headers'])B['headers']['forEach'](({name:c,value:X})=>{a['push'](Header({'name':c,'value':X}));});if(B['cookies'])B['cookies']['forEach'](({name:c,value:X})=>{a['push'](Cookie({'name':c,'value':X}));});if(B['body'])a['push'](Body(B['body']));if(a['length']>0x0)Q['push'](a['join']('\x20and\x20'));if(B['statuses'])Q['push'](Status(B['statuses']));return Q['join']('\x20');}function Cookie(B){const Q=['with'];if(B['secret'])Q['push']('secret');return Q['push']('cookie\x20'+StringExpression(B['name'])+'\x20=\x20'+StringExpression(B['value'])),Q['join']('\x20');}function Header(B){const Q=['with'];if(B['secret'])Q['push']('secret');return Q['push']('header\x20'+StringExpression(B['name'])+':\x20'+StringExpression(B['value'])),Q['join']('\x20');}function Body(B){if(B['type'])return'with\x20'+B['type']+'\x20body\x20'+AnyExpression(B['data']);else return'with\x20body\x20'+AnyExpression(B['data']);}function Status(B){if(B==='*')return'expecting\x20any\x20status\x20code';else return'expecting\x20status\x20code'+(B['length']>0x1?'s':'')+'\x20'+B['join']('\x20or\x20');}function Auth(B,Q={}){return'with\x20basic\x20auth\x20'+StringExpression(B['username'])+':'+StringExpression(B['password']);}function ElementReference(B){return B['type']?'that\x20'+ElementType(B['type']):'it';}function ElementDescriptor(B){if('isElementReference'in B)return ElementReference(B);const Q=['the'];if(B['nth']!=null)Q['push'](OrdinalIndex(B['nth']));if(B['reference'])Q['push'](Reference(B['reference'])),Q['push'](B['type']?ElementType(B['type'],B['vocabulary']):'element');else{if(B['orderDirection']==='backward'){Q['push']('last'),Q['push'](B['type']?ElementType(B['type'],B['vocabulary']):'element');if(typeof B['title']==='string')Q['push']('with\x20text\x20'+StringExpression(B['title']));else{if(B['title']&&'name'in B['title'])Q['push']('with\x20'+B['title']['name']);}}else{if(B['title']&&typeof B['title']==='object'&&'isPattern'in B['title']){Q['push'](B['type']?ElementType(B['type']):'element');if('name'in B['title'])Q['push']('with\x20'+B['title']['name']);}else{if(typeof B['title']==='string'&&isPatternName(B['title']))Q['push'](B['type']?ElementType(B['type']):'element'),Q['push']('with\x20text\x20'+StringExpression(B['title']));else{if(B['title']&&typeof B['title']==='string'&&isNamedColor(B['title']))Q['push'](B['type']?ElementType(B['type'],B['vocabulary']):'element'),Q['push']('with\x20text\x20'+StringExpression(B['title'],{'avoid':'unquoted'}));else{if(typeof B['color']==='string'&&isNamedColor(B['color']))Q['push'](B['color']);const a=B['title']!=null&&typeof B['title']==='object'&&('isRef'in B['title']||'isJSExpressionRef'in B['title']||B['title']['chunks']['length']===0x1&&typeof B['title']['chunks'][0x0]!=='string');if(B['title']&&!a)Q['push'](StringExpression(B['title'],{'avoid':typeof B['title']==='string'&&isElementType(B['title'])?'unquoted':void 0x0}));Q['push'](B['type']?ElementType(B['type'],B['vocabulary']):'element');if(typeof B['color']==='string'&&!isNamedColor(B['color']))Q['push']('with\x20color\x20'+StringExpression(B['color']));if(B['title']&&a)Q['push']('with\x20text\x20'+StringExpression(B['title']));}}}}}if(B['selector']){if(B['selector']['type']==='css')Q['push']('with\x20css\x20selector\x20'+StringExpression(B['selector']['selector'],{'prefer':'single\x20quoted'}));else{if(B['selector']['type']==='xpath')Q['push']('with\x20xpath\x20selector\x20'+StringExpression(B['selector']['selector'],{'prefer':'single\x20quoted'}));}}if(B['anchor'])Q['push'](Anchor(B['anchor']));return Q['join']('\x20');}function ElementType(B,Q){B=Array['isArray'](B)?B[0x0]:B;if(Q&&Q[B])return Q[B];switch(B){case'table-cell':return'cell';case'table-head-cell':return'header\x20cell';case'table-row':return'row';case'table-column':return'column';case'table-leaf-row':return'row';case'table-leaf-column':return'column';case'table-stub-column':return'stub\x20column';case'table-head-row':return'header\x20row';case'textbox':return'field';case'inputbox':return'field';case'combobox':return'dropdown';case'datetimepicker':return'date\x20and\x20time\x20picker';case'datepicker':return'date\x20picker';case'timepicker':return'time\x20picker';case'colorpicker':return'color\x20picker';case'radiogroup':return'radio\x20group';case'checkboxgroup':return'checkbox\x20group';case'listitem':return'list\x20item';case'menuitem':return'menu\x20item';case'pdfpage':return'document\x20page';case'tablist':return'tab\x20list';case'tabpanel':return'tab\x20panel';default:return B;}}function Anchor(B){if(Array['isArray'](B)&&B['length']===0x2&&(typeIs(B[0x0],'table-column')||typeIs(B[0x0],'table-row'))&&(typeIs(B[0x1],'table-column')||typeIs(B[0x1],'table-row'))){const c=extractCommonTableAnchor(B[0x0],B[0x1]),X=c?removeDeepestTableAnchor(B[0x0]):B[0x0],f=c?removeDeepestTableAnchor(B[0x1]):B[0x1];let J=Anchor(X)+'\x20and\x20'+Anchor(f);if(c)J+='\x20'+Anchor(c);return J;}const Q=Array['isArray'](B)?B[0x0]:B,a=[];if(Q['position']==='near')a['push']('near\x20to');else{if(Q['position']==='leftof')a['push']('to\x20the\x20left\x20of');else{if(Q['position']==='rightof')a['push']('to\x20the\x20right\x20of');else{if(Q['position']==='below')a['push']('below\x20of');else{if(Q['position']==='above')a['push']('above\x20of');else{if(Q['position']==='aboveleftof')a['push']('to\x20the\x20left\x20and\x20above\x20of');else{if(Q['position']==='aboverightof')a['push']('to\x20the\x20right\x20and\x20above\x20of');else{if(Q['position']==='belowleftof')a['push']('to\x20the\x20left\x20and\x20below\x20of');else{if(Q['position']==='belowrightof')a['push']('to\x20the\x20right\x20and\x20below\x20of');else{if(Q['position']==='inside'&&typeIs(Q,'table'))a['push']('of');else{if(Q['position']==='inside')a['push']('in');else{if(Q['position']==='left')a['push'](Q['element']?'at\x20the\x20left\x20of':'at\x20the\x20left');else{if(Q['position']==='right')a['push'](Q['element']?'at\x20the\x20right\x20of':'at\x20the\x20right');else{if(Q['position']==='top')a['push'](Q['element']?'at\x20the\x20top\x20of':'at\x20the\x20top');else{if(Q['position']==='bottom')a['push'](Q['element']?'at\x20the\x20bottom\x20of':'at\x20the\x20bottom');else{if(Q['position']==='topleft')a['push'](Q['element']?'at\x20the\x20left\x20and\x20top\x20of':'at\x20the\x20left\x20and\x20top');else{if(Q['position']==='topright')a['push'](Q['element']?'at\x20the\x20right\x20and\x20top\x20of':'at\x20the\x20right\x20and\x20top');else{if(Q['position']==='bottomleft')a['push'](Q['element']?'at\x20the\x20left\x20and\x20bottom\x20of':'at\x20the\x20left\x20and\x20bottom');else{if(Q['position']==='bottomright')a['push'](Q['element']?'at\x20the\x20right\x20and\x20bottom\x20of':'at\x20the\x20right\x20and\x20bottom');}}}}}}}}}}}}}}}}}}if(Q['element']){if('isViewportDescriptor'in Q['element'])a['push']('the\x20viewport');else{if('isDialogDescriptor'in Q['element'])a['push']('the\x20native\x20browser\x20dialog');else a['push'](ElementDescriptor(Q['element']));}}return a['join']('\x20');}function Reference(B){if('isRef'in B)return'{'+ReferenceName(B)+'}';else return'{%'+JSExpressionLiteral(B['expression'])+'%}';}function ReferenceName(B){return(B['modifiers']??[])['reduce']((Q,a)=>{if('get'in a){if(typeof a['get']==='string')return test(Identifier$1,a['get'])?Q+'.'+a['get']:Q+'['+StringLiteral(a['get'])+']';else{if(typeof a['get']==='number')return Q+'['+a['get']+']';else{if('isRef'in a['get']||'isJSExpressionRef'in a['get'])return Q+'['+Reference(a['get'])+']';else{if('isInterpolatedString'in a['get'])return Q+'['+InterpolatedStringLiteral(a['get'])+']';}}}}else{if('match'in a){const c=a['match'];if('pattern'in c)return Q+'/'+c['pattern']+'/';else{if('name'in c)return Q+'/'+c['name']+'/';}return Q+'/'+String(c)+'/';}}return Q;},B['name']);}function Literal(B,Q){if(typeof B==='string')return StringLiteral(B,Q?.['quoting']);else return JSON['stringify'](B);}function AnyExpression(B,Q){if(B&&typeof B==='object'){if('isInterpolatedString'in B)return InterpolatedStringLiteral(B,Q?.['quoting']);else{if('isStructure'in B)return StructureLiteral(B,Q);else{if('isRef'in B||'isJSExpressionRef'in B)return Reference(B);else{if('operator'in B)return NumberOperationLiteral(B);}}}return'';}else return Literal(B,Q);}function NumberOperationLiteral(B){const [Q,a]=B['operands'];return[NumberOperandLiteral(Q,{'operator':B['operator'],'position':'left'}),numberOperatorSymbols[B['operator']],NumberOperandLiteral(a,{'operator':B['operator'],'position':'right'})]['join']('\x20');}function NumberOperandLiteral(B,{operator:Q,position:a}){const c={'add':0x1,'sub':0x1,'mul':0x2,'div':0x2},X=B['value'];if(X&&typeof X==='object'&&'operator'in X){if(X['operator']==='extract')return ExtractOperationLiteral(X);if(isNumberOperation(X)){const f=NumberOperationLiteral(X),J=c[X['operator']],Y=c[Q];return J<Y||a==='right'&&J===Y?'('+f+')':f;}return'';}return AnyExpression(X);}function ExtractOperationLiteral(B){const Q={'color':'color','background-color':'background\x20color','foreground-color':'foreground\x20color','any':'value'},[a,c]=B['operands'];return(Q[c]??'text')+'\x20of\x20'+ElementDescriptor(a['value']);}function JSExpressionLiteral(B){if(B['chunks']['length']===0x1)return typeof B['chunks'][0x0]==='string'?UnquotedStringLiteral(B['chunks'][0x0]):Reference(B['chunks'][0x0]);return B['chunks']['reduce']((Q,a)=>{return Q+(typeof a==='string'?UnquotedStringChunk(a):Reference(a));},'');}function StructureLiteral(B,Q){if(B['type']==='array')return'['+B['items']['map'](a=>AnyExpression(a,Q))['join'](',\x20')+']';else return'{'+B['items']['map'](a=>StringExpression(a['key'],Q?.['quoting'])+':\x20'+AnyExpression(a['value'],Q))['join'](',\x20')+'}';}function StringExpression(B,Q){if(typeof B==='string')return StringLiteral(B,Q);else{if('isInterpolatedString'in B)return InterpolatedStringLiteral(B,Q);else return Reference(B);}}function Quoted(B,Q='double\x20quoted'){if(Q==='double\x20quoted')return DoubleQuoted(B);else{if(Q==='single\x20quoted')return SingleQuoted(B);else{if(Q==='unquoted')return B;else return'';}}}function DoubleQuoted(B){return'\x22'+B+'\x22';}function SingleQuoted(B){return'\x27'+B+'\x27';}function includesParens(B){return/[()]/['test'](B);}function StringLiteral(B,Q){if(Q?.['prefer']&&Q['prefer']!==Q?.['avoid']){if(Q['prefer']==='unquoted'&&!B['includes']('\x20')&&!includesParens(B)&&!/^['"]|^[\d,.]+$/['test'](B))return UnquotedStringChunk(B);else{if(Q['prefer']==='double\x20quoted'&&!B['includes']('\x22'))return DoubleQuoted(DoubleQuotedStringChunk(B));else{if(Q['prefer']==='single\x20quoted'&&!B['includes']('\x27'))return SingleQuoted(SingleQuotedStringChunk(B));}}}if(Q?.['avoid']!=='unquoted'&&!B['includes']('\x20')&&!includesParens(B)&&!/^['"]/['test'](B))return UnquotedStringChunk(B);if(Q?.['avoid']!=='double\x20quoted'&&!B['includes']('\x22'))return DoubleQuoted(DoubleQuotedStringChunk(B));else{if(Q?.['avoid']!=='single\x20quoted'&&!B['includes']('\x27'))return SingleQuoted(SingleQuotedStringChunk(B));else return Q?.['avoid']!=='double\x20quoted'?DoubleQuoted(DoubleQuotedStringChunk(B)):SingleQuoted(SingleQuotedStringChunk(B));}}function UnquotedStringLiteral(B){return UnquotedStringChunk(B);}function InterpolatedStringLiteral(B,Q){if(B['chunks']['length']===0x1)return typeof B['chunks'][0x0]==='string'?StringLiteral(B['chunks'][0x0],Q):Reference(B['chunks'][0x0]);const a=B['chunks']['reduce']((X,f,J)=>{if(typeof f==='string'){if(f['includes']('\x20')||includesParens(f)||J===0x0&&/^['"]/['test'](f))X['delete']('unquoted');else{if(f['includes']('\x22'))X['delete']('double\x20quoted');else{if(f['includes']('\x27'))X['delete']('single\x20quoted');}}}return X;},new Set(['unquoted','double\x20quoted','single\x20quoted']));if(Q?.['avoid'])a['delete'](Q?.['avoid']);const c=[...a][0x0]??(Q?.['avoid']!=='double\x20quoted'?'double\x20quoted':'single\x20quoted');return Quoted(B['chunks']['reduce']((X,f)=>{return X+(typeof f==='string'?StringChunk(f,c):Reference(f));},''),c);}function StringChunk(B,Q='double\x20quoted'){if(Q==='unquoted')return UnquotedStringChunk(B);else{if(Q==='double\x20quoted')return DoubleQuotedStringChunk(B);else{if(Q==='single\x20quoted')return SingleQuotedStringChunk(B);else return'';}}}function UnquotedStringChunk(B){return B['replaceAll'](/[{]|\\(?=[\{])/g,(Q,a)=>{return Q==='{'&&!startsWith$2(Reference$1('any'),B['substring'](a))?Q:'\x5c'+Q;});}function SingleQuotedStringChunk(B){return B['replaceAll'](/['{]|\\(?=[\'{])/g,(Q,a)=>{return Q==='{'&&!startsWith$2(Reference$1('any'),B['substring'](a))?Q:'\x5c'+Q;});}function DoubleQuotedStringChunk(B){return B['replaceAll'](/["{]|\\(?=[\"{])/g,(Q,a)=>{return Q==='{'&&!startsWith$2(Reference$1('any'),B['substring'](a))?Q:'\x5c'+Q;});}function OrdinalIndex(B){return OrdinalNumberExpression(typeof B==='number'?B+0x1:B);}function OrdinalNumberExpression(B){if(typeof B==='number')return OrdinalNumberLiteral(B);else{if('isRef'in B||'isJSExpressionRef'in B)return Reference(B);else return'';}}function OrdinalNumberLiteral(B){if(B===0x1)return'first';else{if(B===0x2)return'second';else{if(B===0x3)return'third';}}const Q=B%0x64;if(Q>=0xb&&Q<=0xd)return B+'th';switch(B%0xa){case 0x1:return B+'st';case 0x2:return B+'nd';case 0x3:return B+'rd';default:return B+'th';}}function typeIs(B,Q){return Boolean(B&&B['element']&&'type'in B['element']===!![]&&B['element']['type']===Q);}function findDeepestTableAnchor(B){if(!B['element']||'isViewportDescriptor'in B['element']||'isDialogDescriptor'in B['element']||'isElementReference'in B['element'])return;if(typeIs(B,'table')){if(B['element']['anchor']&&!Array['isArray'](B['element']['anchor']))return findDeepestTableAnchor(B['element']['anchor'])||B;return B;}if(B['element']['anchor']&&!Array['isArray'](B['element']['anchor']))return findDeepestTableAnchor(B['element']['anchor']);}function extractCommonTableAnchor(B,Q){const a=findDeepestTableAnchor(B),c=findDeepestTableAnchor(Q);if(!a||!c)return;if(a['position']===c['position']&&a['element']&&c['element']){const X=a['element'],f=c['element'];if(!('isElementReference'in X)&&!('isElementReference'in f)&&'type'in X&&'type'in f&&X['type']===f['type']&&X['title']===f['title'])return a;}}function removeDeepestTableAnchor(B){if(!B['element']||'isViewportDescriptor'in B['element']||'isDialogDescriptor'in B['element']||'isElementReference'in B['element']||Array['isArray'](B['element']['anchor']))return B;if(B['element']['anchor']&&!Array['isArray'](B['element']['anchor'])&&typeIs(B['element']['anchor'],'table')){const Q=B['element']['anchor'];if(Q['element']&&!('isViewportDescriptor'in Q['element'])&&!('isDialogDescriptor'in Q['element'])&&!('isElementReference'in Q['element'])&&!Q['element']['anchor']){const {anchor:a,...c}=B['element'];return{...B,'element':c};}}if(B['element']['anchor']&&!Array['isArray'](B['element']['anchor']))return{...B,'element':{...B['element'],'anchor':removeDeepestTableAnchor(B['element']['anchor'])}};return B;}const cache=new Map();function getParse({allowed:B,disabled:Q}){const a=(B?B['toSorted']()['join'](','):'*')+'|'+(Q?Q['toSorted']()['join'](','):'');let c=cache['get'](a);if(!c)cache['set'](a,c=makeParse(Instructions({'allowed':B,'disabled':Q})));return c;}function parseText(B,{split:Q,fix:a,mask:c,replacements:X,intent:intent=!![],locale:locale=DEFAULT_LOCALE,allowed:f,disabled:J}={}){let Y=0x0;for(const t of X??[]){B=replace(B,t['pos']+Y,t['length'],t['text']),Y+=t['text']['length']-t['length'];}const h=getParse({'allowed':f,'disabled':J})(B,{'intent':intent,'locale':locale});if(a&&h['errors']){const K=parseCurl(B);if(K)return parseText(FetchAction(K),{'split':Q,'intent':intent,'fix':a,'mask':c,'locale':locale});const O=parseHttp(B);if(O)return parseText(FetchAction(O),{'split':Q,'intent':intent,'fix':a,'mask':c,'locale':locale});}if(a&&h['fixes']&&!h['errors'])return parseText(h['fixes']['sort']((S,C)=>C['pos']-S['pos'])['reduce']((S,{pos:C,text:G,fix:E})=>replace(S,C,G['length'],E),B),{'split':Q,'mask':c,'intent':intent,'locale':locale});if(Q&&!h['errors']){const S=[];for(let C=h['markers']['length']-0x1;C>=0x0;--C){const G=h['markers'][C];if(G['type']==='action'||G['type']==='dependent\x20action'||G['type']==='control\x20flow'){const E=S[0x0];if(!E||E['pos']>G['pos']){if(E&&E['type']==='dependent\x20action'&&G['type']!=='control\x20flow')S[0x0]={...G,'text':B['substring'](G['pos'],E['pos']+E['text']['length'])};else{if(E&&G['subtype']==='else'&&E['subtype']==='if')S[0x0]={...G,'text':B['substring'](G['pos'],E['pos']+E['text']['length'])};else S['unshift'](G);}}}}if(S['length']>0x1)return nestPieces(S['map'](W=>({'pos':W['pos'],'result':parseText(W['text'],{'intent':intent,'mask':c,'locale':locale})[0x0]})),h['markers']['filter'](W=>W['type']==='block'));}const V=h['results']?.[0x0]??[],k={'text':B,'result':V,'meta':{}};k['meta']['instructions']=V['map'](W=>W['type']);if(h['fixes'])k['meta']['fixes']=h['fixes'];if(h['disambiguations'])k['meta']['disambiguations']=h['disambiguations'];if(h['variables'])k['meta']['variables']=h['variables'];if(h['extractors'])k['meta']['extractors']=h['extractors'];if(h['operands'])k['meta']['operands']=h['operands'];if(h['randomValues'])k['meta']['randomValues']=h['randomValues'];if(h['files'])k['meta']['files']=h['files'];if(h['fetches'])k['meta']['fetches']=h['fetches'];if(h['intents'])k['meta']['intents']=h['intents'];if(h['conditionals'])k['meta']['conditional']=h['conditionals'][0x0];if(h['scopes'])k['meta']['scope']=h['scopes']['at'](-0x1);h['references']&&(k['meta']['references']=h['references'],k['meta']['parameters']=h['references']['reduce']((W,e)=>{if(!e['binding']&&!W['some'](H=>H['name']===e['name'])&&!h['variables']?.['some'](H=>H['name']===e['name']))W['push']({'name':e['name'],'type':e['type']});return W;},[]));if(h['markers']){k['meta']['markers']=h['markers']['filter'](e=>e['type']!=='empty'&&e['type']!=='block');const W=k['meta']['markers']['reduce']((e,H)=>{if(H['type']==='navigation\x20url')e['push'](H['text']['replaceAll'](/^['"]|['"]$/g,''));return e;},[]);if(W['length']>0x0)k['meta']['navigationUrls']=W;}if(h['errors']?.[0x0])k['error']=h['errors'][0x0];if(c){const e=maskText(B,{'meta':k['meta']});k['text']=e['text'],k['meta']=e['meta'];}return registerInstructionTexts(k),[k];}function nestPieces(B,Q){function a(f){return Q['reduce']((J,Y)=>Y['pos']<=f&&f<Y['pos']+Y['text']['length']?J+0x1:J,0x0);}const c=[],X=[];for(const f of B){const J=a(f['pos']);while(X['length']>0x0&&X['at'](-0x1)['depth']>=J)X['pop']();const Y={'result':f['result'],'children':[]};(X['at'](-0x1)?.['node']['children']??c)['push'](Y),X['push']({'node':Y,'depth':J});}return c['map'](function h(V){return V['children']['length']>0x0?{'head':V['result'],'body':V['children']['map'](h)}:V['result'];});}Sanitize$1(StructureLiteral$1);const store=new WeakMap();function unseal(B){return store['get'](B);}function Fragment(B){return All(Sanitize$1(B),Optional(TrailingComment));}function parseElementFragment(B,{locale:Q}={}){const a=makeParse(Fragment(Element$2()))(B['trim'](),{'locale':Q});return{'text':B,'result':a['results']?.[0x0],'error':a['errors']?.[0x0],'meta':{'markers':a['markers']}};}const parse$1=makeParse(Any(Index(OrdinalNumberLiteral$1),NonnegativeIntegerNumberLiteral,CardinalNumberLiteral));function parseIndex(B){if(typeof B==='number')return Number['isInteger'](B)&&B>=0x0?B:null;if(typeof B!=='string')return null;const {results:Q,errors:a}=parse$1(B['trim']()['toLowerCase']());return!a?.['length']&&Number['isInteger'](Q?.[0x0])?Q[0x0]:null;}const PATTERNS$1={'price':Price,'percentage':Percentage,'number':NumberValue,'date':DateValue,'time':TimeValue,'code':Identifier},SEPARATORS=new RegExp('['+[...new Set(NUMBER_FORMAT_LOCALES['flatMap'](B=>[numberFormat(B)['group'],numberFormat(B)['decimal']]))]['map'](B=>RegExp['escape'](B))['join']('')+']');function extractPattern(B,Q,{locale:a}={}){const c=PATTERNS$1[B];if(!c)return null;return conventions(Q,{'locale':a})['reduce']((X,f)=>{const J=search(c,Q,{'locale':f})?.['text'];return J&&(!X||J['length']>X['length'])?J:X;},null);}function extractNumber(B,{locale:Q,preferredLocale:a}={}){const c=conventions(B,{'locale':Q,'preferredLocale':a})['reduce']((X,f)=>{const J=search(NumberValue,B,{'locale':f});return J&&(!X||J['text']['length']>X['text']['length'])?{...J,'locale':f}:X;},null);return c&&{'text':c['text'],'pos':c['pos'],'value':Number['parseFloat'](normalizeNumericString(c['text'],c['locale']))};}function conventions(B,{locale:Q,preferredLocale:a}){if(Q)return[Q];if(!SEPARATORS['test'](B))return[DEFAULT_LOCALE];if(!a)return NUMBER_FORMAT_LOCALES;return NUMBER_FORMAT_LOCALES['toSorted']((c,X)=>Number(sameConvention(X,a))-Number(sameConvention(c,a)));}function sameConvention(B,Q){const a=numberFormat(B),c=numberFormat(Q);return a['group']===c['group']&&a['decimal']===c['decimal'];}function brandedHasInstance(B,Q){return function(a){if(this!==B)return Function['prototype'][Symbol['hasInstance']]['call'](this,a);return typeof a==='object'&&a!==null&&a[Q]===!![];};}function classBrand(B){return Symbol['for']('@applitools/nlp-utils.'+B);}function setBrand(B,Q){Object['defineProperty'](B,Q,{'value':!![]});}const EVENT_TARGET_BRAND=classBrand('EventTarget');var EventTarget$1=class EventTarget$1 extends globalThis['EventTarget']{static [Symbol['hasInstance']]=brandedHasInstance(EventTarget$1,EVENT_TARGET_BRAND);#listeners=new Map();#queue=new Set();#corked=![];#groups=new Map();#addListener(B,Q){if(this.#listeners['has'](B))this.#listeners['get'](B)['add'](Q);else this.#listeners['set'](B,new Set([Q]));this['addEventListener'](B,Q);if(B!=='listenerAdded'&&B!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerAddedEvent({'event':B,'count':this.#listeners['get'](B)['size']}));}#addOnceListener(B,Q){if(this.#listeners['has'](B))this.#listeners['get'](B)['add'](Q);else this.#listeners['set'](B,new Set([Q]));this['addEventListener'](B,a=>{Q(a),this.#listeners['get'](B)?.['delete'](Q);if(B!=='listenerAdded'&&B!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerRemovedEvent({'event':B,'count':this.#listeners['get'](B)['size']}));},{'once':!![]});if(B!=='listenerAdded'&&B!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerAddedEvent({'event':B,'count':this.#listeners['get'](B)['size']}));}#removeListener(B,Q){this.#listeners['get'](B)?.['delete'](Q),this['removeEventListener'](B,Q);}get['corked'](){return this.#corked;}constructor(){super(),setBrand(this,EVENT_TARGET_BRAND);}['dispatch'](B){this['dispatchEvent'](B);}['on'](B,Q,a){this.#addListener(B,Q);const c=()=>this['off'](B,Q);if(a?.['key']){let X=this.#groups['get'](a['key']);if(!X)this.#groups['set'](a['key'],X=[]);X['push'](c);}return c;}['once'](B,Q,a){if(Q){this.#addOnceListener(B,Q);const c=()=>this['off'](B,Q);if(a?.['key']){let X=this.#groups['get'](a['key']);if(!X)this.#groups['set'](a['key'],X=[]);X['push'](c);}return c;}else return new Promise(f=>this.#addOnceListener(B,f));}['off'](B,Q){if(!B)this.#listeners['forEach']((a,c)=>a['forEach'](X=>this.#removeListener(c,X))),this.#listeners['clear']();else{if(!Q){if(this.#listeners['has'](B)){const a=B;this.#listeners['get'](a)?.['forEach'](c=>this.#removeListener(a,c)),this.#listeners['delete'](a);}else{const c=B;this.#groups['get'](c)?.['forEach'](X=>X()),this.#groups['delete'](c);}}else{const X=B;this.#removeListener(X,Q);}}}['cork'](){this.#corked=!![];}['uncork'](){this.#corked=![],this.#queue['forEach'](B=>this['dispatch'](B)),this.#queue['clear']();}['dispatchEvent'](B){if(this.#corked)return this.#queue['add'](B),![];return super['dispatchEvent'](B);}['addEventListener'](B,Q,a){return super['addEventListener'](B,Q,a);}['removeEventListener'](B,Q,a){return super['removeEventListener'](B,Q,a);}},EventTargetListenerAddedEvent=class extends Event{['event'];['count'];constructor({event:B,count:Q}){super('listenerAdded'),this['event']=B,this['count']=Q;}},EventTargetListenerRemovedEvent=class extends Event{['event'];['count'];constructor({event:B,count:Q}){super('listenerRemoved'),this['event']=B,this['count']=Q;}};function on(B,Q,a){return B['addEventListener'](Q,a),()=>B['removeEventListener'](Q,a);}function once$1(B,Q,a){return B['addEventListener'](Q,a,{'once':!![]}),()=>B['removeEventListener'](Q,a);}async function abortable(B,Q){if(Q){if(Q['aborted'])return Promise['reject'](Q['reason']);let a;const c=new Promise((X,f)=>{a=once$1(Q,'abort',()=>{f(Q['reason']);});});return Promise['race']([B['finally'](()=>a()),c]);}else return B;}const EVENT_TARGET_NODE_BRAND=classBrand('EventTargetNode');var EventTargetNode=class EventTargetNode extends EventTarget$1{static [Symbol['hasInstance']]=brandedHasInstance(EventTargetNode,EVENT_TARGET_NODE_BRAND);constructor(){super(),setMaxListeners(0x64,this),setBrand(this,EVENT_TARGET_NODE_BRAND);}};const debugLogger={'log':(B,Q)=>debuglog('nlp:runner')('%s\x20%o',B,Q),'error':(B,Q)=>debuglog('nlp:runner:error')('%s\x20%o',B,Q),'trace':(B,Q)=>debuglog('nlp:runner:trace')('%s\x20%o',B,Q),'debug':(B,Q)=>debuglog('nlp:runner:debug')('%s\x20%o',B,Q)};let activeLogger=debugLogger;function use(B){activeLogger=B??debugLogger;}function log(B,Q){activeLogger['log'](B,Q);}function error(B,Q){activeLogger['error'](B,Q);}function trace(B,Q){activeLogger['trace'](B,Q);}function debug(B,Q){activeLogger['debug'](B,Q);}function serializeError(B){if(B instanceof Error){const Q={'name':B['name'],'message':B['message']};if(B['stack'])Q['stack']=B['stack'];const a=B['code'];if(typeof a==='string')Q['code']=a;if(B['cause']!==void 0x0)Q['cause']=serializeError(B['cause']);return Q;}return{'name':'Error','message':typeof B==='string'?B:inspect(B,{'depth':0x3})};}const LEVEL_WEIGHT={'trace':0x0,'debug':0x1,'info':0x2,'error':0x3};function makeEventLogger({downstream:B}={}){const Q=new Set();function a(X,f,J){c['downstream']?.[levelMethod(X)](f,J);if(LEVEL_WEIGHT[X]<LEVEL_WEIGHT[c['minLevel']]||Q['size']===0x0)return;const Y={'type':f,'level':X,'timestamp':Date['now'](),'data':serializeErrors(J)};for(const h of Q)try{h(Y);}catch{}}const c={'minLevel':'trace','downstream':B,'log':(X,f)=>a('info',X,f),'error':(X,f)=>a('error',X,f),'trace':(X,f)=>a('trace',X,f),'debug':(X,f)=>a('debug',X,f),'onLog'(X){return Q['add'](X),()=>Q['delete'](X);}};return c;}function levelMethod(B){return B==='info'?'log':B;}function serializeErrors(B){let Q;for(const [a,c]of Object['entries'](B))c instanceof Error&&(Q??={...B},Q[a]=serializeError(c));return Q??B;}const COLOR_BRAND=classBrand('Color');var Color=class Color{static [Symbol['hasInstance']]=brandedHasInstance(Color,COLOR_BRAND);['r'];['g'];['b'];['a'];constructor(B,Q,c,X=0x1){this['r']=B,this['g']=Q,this['b']=c,this['a']=X,setBrand(this,COLOR_BRAND);}static['from'](B){return new Color(B['r'],B['g'],B['b'],B['a']);}['toString'](){return colorToString(this);}['equals'](B,Q=0x5){return Math['abs'](this['r']-B['r'])<=Q&&Math['abs'](this['g']-B['g'])<=Q&&Math['abs'](this['b']-B['b'])<=Q&&Math['abs'](this['a']-B['a'])<=Q;}['toRGBAString'](){return'rgba('+this['r']+',\x20'+this['g']+',\x20'+this['b']+',\x20'+this['a']+')';}['diff'](B){return differenceHyab()(this['toCulori'](),B['toCulori']())/0x15e;}['getColorFamily'](){const B=nearest(colorFamilies['flatMap'](Q=>Q['colors']),differenceHyab())(this['toCulori']())[0x0];return colorFamilies['find'](Q=>Q['colors']['includes'](B))?.['name']||'unknown';}['similarTo'](B,Q=0.75){return this['getSimilarity'](B)>=Q;}['getSimilarity'](B){const Q=this['getColorFamily']()===B['getColorFamily']();return Math['min']((0x1-this['diff'](B))*(Q?1.2:0.8),0x1);}['toCulori'](){return{'mode':'rgb','r':this['r']/0xff,'g':this['g']/0xff,'b':this['b']/0xff,'alpha':this['a']};}static['fromCulori'](B){const Q=rgb(B);return new Color(Q['r']*0xff,Q['g']*0xff,Q['b']*0xff,B['alpha']);}};function stringToColor(B){const Q=B?.['trim']();if(!Q)return null;const c=parse(Q['replace'](/\s/g,'')['toLowerCase']());if(c)return Color['fromCulori'](c);const X=getKnownColor(Q);if(X)return new Color(X['r'],X['g'],X['b'],0x1);const {rgba:f}=T(Q);if(f){const [J,Y,h,V]=f;return new Color(clampByte(J),clampByte(Y),clampByte(h),clampAlpha(V));}return null;}function stringToColorOrThrow(B){const Q=stringToColor(B);if(Q===null)throw new Error('Invalid\x20color\x20string:\x20'+B);return Q;}function objectToColor(B){if(B==null)return null;if(!('r'in B)||!('g'in B)||!('b'in B))return null;return new Color(B['r'],B['g'],B['b'],'a'in B?B['a']:0x1);}let knownColors=null;function getKnownColor(B){function Q(a){return a['toLowerCase']()['replaceAll']('\x20','');}if(!knownColors)knownColors=Object['fromEntries'](colornames['map'](({name:a,hex:c})=>{return[Q(a),{'r':parseInt(c['slice'](0x1,0x3),0x10),'g':parseInt(c['slice'](0x3,0x5),0x10),'b':parseInt(c['slice'](0x5,0x7),0x10)}];}));return knownColors[Q(B)];}function clampByte(B){if(Number['isNaN'](B))return NaN;return Math['max'](0x0,Math['min'](0xff,B|0x0));}function clampAlpha(B){if(Number['isNaN'](B))return NaN;return Math['max'](0x0,Math['min'](0x1,B));}function colorToString(B){const Q=colornames['find'](({hex:a})=>a===rgbaToHex(B));if(Q)return Q['name']['toLowerCase']()['replaceAll']('\x20','');return'rgba('+B['r']+',\x20'+B['g']+',\x20'+B['b']+',\x20'+B['a']+')';}function rgbaToHex(B){return'#'+B['r']['toString'](0x10)['padStart'](0x2,'0')+B['g']['toString'](0x10)['padStart'](0x2,'0')+B['b']['toString'](0x10)['padStart'](0x2,'0');}const colorFamilies=[{'name':'red','colors':['#CD5C5C','#F08080','#FA8072','#E9967A','#FFA07A','#DC143C','#FF0000','#B22222','#8B0000']},{'name':'pink','colors':['#FFC0CB','#FFB6C1','#DB7093','#FF69B4','#FF1493','#C71585']},{'name':'orange','colors':['#FFA07A','#FF7F50','#FF6347','#FF4500','#FF8C00','#FFA500']},{'name':'yellow','colors':['#FFFFE0','#FFFACD','#FAFAD2','#FFEFD5','#FFE4B5','#FFDAB9','#EEE8AA','#FFD700','#FFFF00','#F0E68C','#BDB76B']},{'name':'purple','colors':['#E6E6FA','#D8BFD8','#DDA0DD','#EE82EE','#DA70D6','#FF00FF','#BA55D3','#9370DB','#7B68EE','#6A5ACD','#663399','#8A2BE2','#9400D3','#9932CC','#8B008B','#800080','#4B0082','#483D8B']},{'name':'green','colors':['#ADFF2F','#7FFF00','#7CFC00','#9ACD32','#6B8E23','#808000','#556B2F','#00FF00','#32CD32','#98FB98','#90EE90','#228B22','#008000','#006400','#00FA9A','#00FF7F','#3CB371','#2E8B57','#66CDAA','#8FBC8B','#20B2AA','#008B8B','#008080']},{'name':'blue','colors':['#00FFFF','#E0FFFF','#AFEEEE','#7FFFD4','#40E0D0','#48D1CC','#00CED1','#5F9EA0','#B0E0E6','#ADD8E6','#87CEEB','#87CEFA','#00BFFF','#1E90FF','#4682B4','#B0C4DE','#6495ED','#7B68EE','#4169E1','#0000FF','#0000CD','#00008B','#000080','#191970']},{'name':'brown','colors':['#FFF8DC','#FFEBCD','#FFE4C4','#FFDEAD','#F5DEB3','#DEB887','#D2B48C','#BC8F8F','#F4A460','#DAA520','#B8860B','#CD853F','#D2691E','#8B4513','#A0522D','#A52A2A','#800000']},{'name':'white','colors':['#FFFFFF','#FFFAFA','#F0FFF0','#F5FFFA','#F0FFFF','#F0F8FF','#F8F8FF','#F5F5F5','#FFF5EE','#F5F5DC','#FDF5E6','#FFFAF0','#FFFFF0','#FAEBD7','#FAF0E6','#FFF0F5','#FFE4E1']},{'name':'gray','colors':['#DCDCDC','#D3D3D3','#C0C0C0','#A9A9A9','#808080','#696969','#778899','#708090','#2F4F4F']},{'name':'black','colors':['#000000']}],POINT_BRAND=classBrand('Point');var Point=class Point{static [Symbol['hasInstance']]=brandedHasInstance(Point,POINT_BRAND);['x'];['y'];constructor(B,Q){this['x']=B,this['y']=Q,setBrand(this,POINT_BRAND);}['equals'](B,Q=0.1){return Math['abs'](this['x']-B['x'])<Q&&Math['abs'](this['y']-B['y'])<Q;}['distance'](B){return Math['hypot'](this['x']-B['x'],this['y']-B['y']);}};const VECTOR_BRAND=classBrand('Vector');var Vector=class Vector{static [Symbol['hasInstance']]=brandedHasInstance(Vector,VECTOR_BRAND);static ['down']=new Vector(0x0,0x1);static ['left']=new Vector(-0x1,0x0);static ['right']=new Vector(0x1,0x0);static ['up']=new Vector(0x0,-0x1);static ['leftUp']=new Vector(-0x1,-0x1);static ['rightUp']=new Vector(0x1,-0x1);static ['leftDown']=new Vector(-0x1,0x1);static ['rightDown']=new Vector(0x1,0x1);static['fromPoints'](B,Q){return new Vector(Q['x']-B['x'],Q['y']-B['y']);}['x'];['y'];constructor(B,Q){this['x']=B,this['y']=Q,setBrand(this,VECTOR_BRAND);}get['magnitude'](){return Math['hypot'](this['x'],this['y']);}['cross'](B){return this['x']*B['y']-this['y']*B['x'];}['dot'](B){return this['x']*B['x']+this['y']*B['y'];}};const SEGMENT_BRAND=classBrand('Segment');var Segment=class Segment{static [Symbol['hasInstance']]=brandedHasInstance(Segment,SEGMENT_BRAND);['start'];['end'];constructor(B,Q){this['start']=B instanceof Point?B:new Point(B['x'],B['y']),this['end']=Q instanceof Point?Q:new Point(Q['x'],Q['y']),setBrand(this,SEGMENT_BRAND);}['toOrthogonal'](){const B=Math['abs'](this['end']['x']-this['start']['x'])<=Math['abs'](this['end']['y']-this['start']['y'])?new Point(this['end']['x'],this['start']['y']):new Point(this['start']['x'],this['end']['y']);return[new Segment(this['start'],B),new Segment(B,this['end'])];}['contains'](B){const Q=Vector['fromPoints'](this['start'],this['end']),a=Vector['fromPoints'](this['start'],B);if(Q['cross'](a)!==0x0)return![];return Math['min'](this['start']['x'],this['end']['x'])<=B['x']&&B['x']<=Math['max'](this['start']['x'],this['end']['x'])&&Math['min'](this['start']['y'],this['end']['y'])<=B['y']&&B['y']<=Math['max'](this['start']['y'],this['end']['y']);}};const RECTANGLE_BRAND=classBrand('Rectangle');var Rectangle=class Rectangle{static [Symbol['hasInstance']]=brandedHasInstance(Rectangle,RECTANGLE_BRAND);static['min'](...B){return B['reduce']((Q,a)=>a['area']<Q['area']?a:Q);}static['max'](...B){return B['reduce']((Q,a)=>a['area']>Q['area']?a:Q);}static['union'](B){const [Q,...a]=B;return Q['union'](...a);}static['intersection'](B){const [Q,...a]=B;let c=Q;for(const X of a){c=c['intersection'](X);if(!c)return null;}return c;}static['from'](B){return new Rectangle(B['x'],B['y'],B['width'],B['height']);}static['fromQuad'](B){const Q=[B[0x0],B[0x2],B[0x4],B[0x6]],a=[B[0x1],B[0x3],B[0x5],B[0x7]],c=Math['min'](...Q),X=Math['min'](...a);return new Rectangle(c,X,Math['max'](...Q)-c,Math['max'](...a)-X);}['left'];['top'];['right'];['bottom'];get['center'](){return new Point(this['left']+this['width']/0x2,this['top']+this['height']/0x2);}get['leftTop'](){return new Point(this['left'],this['top']);}get['rightTop'](){return new Point(this['right'],this['top']);}get['rightBottom'](){return new Point(this['right'],this['bottom']);}get['leftBottom'](){return new Point(this['left'],this['bottom']);}get['edges'](){return[new Segment(this['leftTop'],this['rightTop']),new Segment(this['rightTop'],this['rightBottom']),new Segment(this['rightBottom'],this['leftBottom']),new Segment(this['leftBottom'],this['leftTop'])];}get['vertices'](){return[this['leftTop'],this['rightTop'],this['rightBottom'],this['leftBottom']];}get['area'](){return this['width']*this['height'];}['x'];['y'];['width'];['height'];constructor(B,Q,a,c){this['x']=B,this['y']=Q,this['width']=a,this['height']=c,this['left']=B,this['top']=Q,this['right']=a===Infinity?Infinity:B+a,this['bottom']=c===Infinity?Infinity:Q+c,setBrand(this,RECTANGLE_BRAND);}['offset'](B){return new Rectangle(this['x']+B['x'],this['y']+B['y'],this['width'],this['height']);}['scale'](B){return new Rectangle(this['x']*B,this['y']*B,this['width']*B,this['height']*B);}['resize']({left:B,right:Q,top:a,bottom:c}){const X=this['left']-(B??0x0),f=Math['max'](X,this['right']+(Q??0x0)),J=this['top']-(a??0x0),Y=Math['max'](J,this['bottom']+(c??0x0));return new Rectangle(X,J,f-X,Y-J);}['union'](...B){let Q=this['left'],a=this['top'],c=this['right'],X=this['bottom'];for(const f of B){Q=Math['min'](Q,f['left']),a=Math['min'](a,f['top']),c=Math['max'](c,f['right']),X=Math['max'](X,f['bottom']);}return new Rectangle(Q,a,c-Q,X-a);}['intersection'](B){if(!this['intersects'](B))return null;const Q=Math['max'](this['left'],B['left']),a=Math['min'](this['right'],B['right']),c=Math['max'](this['top'],B['top']),X=Math['min'](this['bottom'],B['bottom']);return new Rectangle(Q,c,a-Q,X-c);}['equals'](B){return this['x']===B['x']&&this['y']===B['y']&&this['width']===B['width']&&this['height']===B['height'];}['contains'](B){if(B instanceof Rectangle)return Math['round'](this['left'])<=Math['round'](B['left'])&&Math['round'](this['top'])<=Math['round'](B['top'])&&Math['round'](this['right'])>=Math['round'](B['right'])&&Math['round'](this['bottom'])>=Math['round'](B['bottom']);else return B['x']>=this['left']&&B['x']<=this['right']&&B['y']>=this['top']&&B['y']<=this['bottom'];}['intersects'](B){return this['left']<B['right']&&this['right']>B['left']&&this['top']<B['bottom']&&this['bottom']>B['top'];}['distance'](B){const Q=Math['max'](0x0,B['left']-this['right'],this['left']-B['right']),a=Math['max'](0x0,B['top']-this['bottom'],this['top']-B['bottom']);return Math['hypot'](Q,a);}['toJSON'](){return{'x':this['x'],'y':this['y'],'width':this['width'],'height':this['height']};}[Symbol['for']('nodejs.util.inspect.custom')](B,Q){return'('+Q['stylize'](this['left']['toFixed'](0x1),'number')+',\x20'+Q['stylize'](this['top']['toFixed'](0x1),'number')+')\x20'+Q['stylize'](this['width']['toFixed'](0x1),'number')+'\x20x\x20'+Q['stylize'](this['height']['toFixed'](0x1),'number');}};const RTREE_BRAND=classBrand('RTree');var RTree=class RTree{static [Symbol['hasInstance']]=brandedHasInstance(RTree,RTREE_BRAND);#root;#maxItems;#minItems;constructor({maxItems:maxItems=0x9,minItems:B}={}){this.#maxItems=Math['max'](0x4,maxItems),this.#minItems=B??Math['max'](0x2,Math['floor'](this.#maxItems*0.4)),this.#root=new RNode({'leaf':!![],'minItems':this.#minItems}),setBrand(this,RTREE_BRAND);}*['levels'](){let B=[this.#root];while(B['length']>0x0)if(B[0x0]['leaf']){yield B['flatMap'](Q=>Q['children']['map'](a=>a['rect']));return;}else{const Q=[],a=[];for(const c of B){Q['push'](c['rect']),a['push'](...c['children']);}yield Q,B=a;}}['insert'](B){const Q=[];let a=this.#root;while(!a['leaf']){Q['push'](a),a=a['chooseChild'](B['rect']);}return Q['push'](a),a['add'](B),this.#balance(Q),this;}['search'](B){const Q=[],a=[this.#root];while(a['length']>0x0){const c=a['shift']();if(c['rect']['intersects'](B)){if(c['leaf']){for(const X of c['children'])if(X['rect']['intersects'](B))Q['push'](X['data']);}else a['push'](...c['children']);}}return Q;}#balance(B){for(let Q=B['length']-0x1;Q>=0x0;--Q){const a=B[Q];if(a['children']['length']>this.#maxItems){const c=a['split']();if(Q===0x0)this.#root=new RNode({'leaf':![],'minItems':this.#minItems})['add'](a,c);else B[Q-0x1]['add'](c);}}}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){let c='';const X=[{'node':this.#root,'depth':0x0}];while(X['length']>0x0){const {node:f,depth:J}=X['shift']();if(f instanceof RNode)X['unshift'](...f['children']['map'](Y=>({'node':Y,'depth':J+0x1}))),c+='\x20\x20'['repeat'](J)+a(f,Q)+'\x0a';else c+='\x20\x20'['repeat'](J)+('RItem\x20'+a({'rect':f['rect'],'data':f['data']},{...Q,'compact':!![],'breakLength':Infinity})+'\x0a');}return c;}},RNode=class RNode{#rect;#children=[];#leaf;#minItems;get['rect'](){return this.#rect??new Rectangle(0x0,0x0,0x0,0x0);}get['children'](){return this.#children;}get['leaf'](){return this.#leaf;}constructor({leaf:B,minItems:Q}){this.#leaf=B,this.#minItems=Q;}*['descendants'](){const B=[this];while(B['length']>0x0){const Q=B['shift']();yield Q;if(Q['leaf'])yield*Q['children'];else B['push'](...Q['children']);}}['chooseChild'](B){let Q=this.#children[0x0],a=Q['rect']['union'](B)['area']-Q['rect']['area'],c=Q['rect']['area'];for(let X=0x1;X<this.#children['length'];++X){const f=this.#children[X],J=f['rect']['union'](B)['area']-f['rect']['area'];(J<a||J===a&&f['rect']['area']<c)&&(a=J,c=f['rect']['area'],Q=f);}return Q;}['add'](...B){return this.#children['push'](...B),this.#rect=this.#rect?this.#rect['union'](...B['map'](Q=>Q['rect'])):Rectangle['union'](B['map'](Q=>Q['rect'])),this;}['split'](){const B=[...this.#children],[Q,a]=findSeeds(B)['map'](X=>({'rect':B[X]['rect'],'nodes':B['splice'](X,0x1)}));while(B['length']>0x0){if(a['nodes']['length']+B['length']<=this.#minItems){a['nodes']['push'](...B),a['rect']=a['rect']['union'](...B['map'](f=>f['rect']));break;}if(Q['nodes']['length']+B['length']<=this.#minItems){Q['nodes']['push'](...B),Q['rect']=Q['rect']['union'](...B['map'](f=>f['rect']));break;}let X={'difference':-Infinity,'index':0x0,'group':a,'rect':a['rect']};for(let f=0x0;f<B['length'];++f){const J=B[f],Y={'rect':a['rect']['union'](J['rect']),'group':a},h=Y['rect']['area']-a['rect']['area'],V={'rect':Q['rect']['union'](J['rect']),'group':Q},k=V['rect']['area']-Q['rect']['area'],t=Math['abs'](h-k);if(t>X['difference'])X={'difference':t,'index':f,...h<k?Y:V};}X['group']['nodes']['push'](...B['splice'](X['index'],0x1)),X['group']['rect']=X['group']['rect']['union'](X['rect']);}this.#children=a['nodes'],this.#rect=a['rect'];const c=new RNode({'leaf':this.#leaf,'minItems':this.#minItems});return c.#children=Q['nodes'],c.#rect=Q['rect'],c;}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){return'RNode\x20'+a({'rect':this['rect'],'leaf':this['leaf']},{...Q,'compact':!![],'breakLength':Infinity});}};function findSeeds(B){let Q=-0x1,a=[0x0,0x0];for(let c=0x0;c<B['length'];c++){const X=B[c];for(let f=c+0x1;f<B['length'];f++){const J=B[f],Y=X['rect']['union'](J['rect'])['area']-X['rect']['area']-J['rect']['area'];Y>Q&&(Q=Y,a=[f,c]);}}return a;}const RAY_BRAND=classBrand('Ray');(class Ray{static [Symbol['hasInstance']]=brandedHasInstance(Ray,RAY_BRAND);static['fromPoints'](B,Q){return new Ray(B,Vector['fromPoints'](B,Q));}['origin'];['direction'];constructor(B,Q){this['origin']=B,this['direction']=Q,setBrand(this,RAY_BRAND);}['contains'](B){const Q=new Vector(B['x']-this['origin']['x'],B['y']-this['origin']['y']);if(Q['cross'](this['direction'])!==0x0)return![];return Q['dot'](this['direction'])>=0x0;}['intersection'](B){const Q=B['direction']['cross'](this['direction']);if(Math['abs'](Q)<Number['EPSILON'])return null;const a=B['origin']['x']-this['origin']['x'],c=B['origin']['y']-this['origin']['y'],X=(B['direction']['x']*c-B['direction']['y']*a)/Q,f=(this['direction']['x']*c-this['direction']['y']*a)/Q;if(X>=0x0&&f>=0x0)return new Point(this['origin']['x']+X*this['direction']['x'],this['origin']['y']+X*this['direction']['y']);return null;}['distance'](B){const Q=Vector['fromPoints'](this['origin'],B);if(this['direction']['dot'](Q)<0x0)return this['origin']['distance'](B);return Math['abs'](this['direction']['cross'](Q)/this['direction']['magnitude']);}});const PATTERNS={'price':B=>extractPattern('price',B),'percentage':B=>extractPattern('percentage',B),'number':B=>extractPattern('number',B),'date':B=>extractPattern('date',B),'time':B=>extractPattern('time',B),'code':B=>extractPattern('code',B)};function getPatternMatcher(B){return PATTERNS[B];}const DEBUG_BUS_KEY=Symbol['for']('applitools.nlp.debugBus'),debugBus=globalThis[DEBUG_BUS_KEY]??=new EventTarget$1(),WATCHER_BRAND=classBrand('Watcher');function makeWatcher(B){return new Watcher(B);}var Watcher=class Watcher{static [Symbol['hasInstance']]=brandedHasInstance(Watcher,WATCHER_BRAND);#promise;#resolve;#reject;#result;#hint;#signal;#timers=new Map();#listeners=[];get['promise'](){if(!this.#promise){this.#promise=new Promise((...B)=>[this.#resolve,this.#reject]=B);if(this.#result){if(this.#result['status']==='fulfilled')this.#resolve(this.#result['value']);else this.#reject(this.#result['reason']);}}return this.#promise;}get['pending'](){return!this.#result;}get['settled'](){return!!this.#result;}get['hint'](){return this.#hint;}get[Symbol['toStringTag']](){return'Watcher';}constructor(B){this.#hint=B?.['hint'],this.#signal=B?.['signal'];if(this.#signal){if(this.#signal['aborted'])this['reject'](this.#signal['reason']);else this.#listeners['push'](once$1(this.#signal,'abort',()=>void this['reject'](this.#signal['reason'])));}setBrand(this,WATCHER_BRAND);}async['then'](B,Q){return this['promise']['then'](B,Q);}async['catch'](B){return this['promise']['catch'](B);}async['finally'](B){return this['promise']['finally'](B);}['reset'](B){this.#timers['forEach'](Q=>Q['cancel']()),this.#hint=B?.['hint'];if(this.#signal!==B?.['signal'])this.#signal=B?.['signal'];this.#listeners['forEach'](Q=>Q()),this.#listeners=[];this.#result&&(this.#result=void 0x0,this.#promise=void 0x0,this.#resolve=void 0x0,this.#reject=void 0x0);if(this.#signal){if(this.#signal['aborted'])this['reject'](this.#signal['reason']);else this.#listeners['push'](once$1(this.#signal,'abort',()=>void this['reject'](this.#signal['reason'])));}return this;}['resolve'](B,{delay:Q,key:a}={}){if(Q&&Q>0x0){a??='default',this.#timers['get'](a)?.['cancel']();const c=setTimeout(()=>void this['resolve'](B),Q);this.#timers['set'](a,{'cancel':()=>(clearTimeout(c),this.#timers['delete'](a))});}else this.#timers['forEach'](X=>X['cancel']()),this.#result??={'status':'fulfilled','value':B},this.#resolve?.(B);return this;}['reject'](B,{delay:Q,key:a}={}){if(Q&&Q>0x0){a??='default',this.#timers['get'](a)?.['cancel']();const c=setTimeout(()=>void this['reject'](B),Q);this.#timers['set'](a,{'cancel':()=>(clearTimeout(c),this.#timers['delete'](a))});}else this.#timers['forEach'](X=>X['cancel']()),this.#result??={'status':'rejected','reason':B},this.#reject?.(B);return this;}};function sleep(B,{signal:Q}={}){return makeWatcher({'signal':Q})['resolve'](void 0x0,{'delay':B});}function until(B,{timeout:Q,signal:a}){const c=sleep(Q,{'signal':a});return B['finally'](()=>void c['resolve']()),c;}const PROGRESS_EVENT_BRAND=classBrand('ProgressEvent');var ProgressEvent=class ProgressEvent extends Event{static [Symbol['hasInstance']]=brandedHasInstance(ProgressEvent,PROGRESS_EVENT_BRAND);constructor(){super('progress'),setBrand(this,PROGRESS_EVENT_BRAND);}};function rectToSamplingPoints(B){const Q=Math['round'](B['left']+B['width']/0x2),a=Math['round'](B['top']+B['height']/0x2),c=Q+Math['floor'](B['width']/0x4),X=Q-Math['ceil'](B['width']/0x4),f=B['height']/0x2*0.15,J=Math['ceil'](B['top']+f),Y=Math['floor'](B['top']+B['height']-f);return[{'x':X,'y':a},{'x':c,'y':a},{'x':Q,'y':a},{'x':Q,'y':J},{'x':Q,'y':Y}];}function calculateObscurationRatio(B){if(B['length']===0x0)return 0x1;const Q=B['flat']();return Q['filter'](a=>a)['length']/Q['length'];}const MAX_PROJECTED_TEXT=0xa0;function clip(B){return B['length']>MAX_PROJECTED_TEXT?B['slice'](0x0,MAX_PROJECTED_TEXT)+'…':B;}function projectAXNode(B){if(!B)return null;const Q={};try{if(B['type'])Q['type']={...B['type']};if(B['text'])Q['text']=clip(B['text']);const a=B['visibleLabel']||B['geometricLabel']||B['declarativeLabel'];if(a)Q['label']=clip(a);const c=B['borderRect'];if(c)Q['rect']={'x':c['x'],'y':c['y'],'width':c['width'],'height':c['height']};}catch{}return Q;}function projectDescriptor(B){if(!B)return B;const {node:Q,anchor:a,fallback:c,...X}=B,f={...X};if(Q)f['node']=projectAXNode(Q);if(a)f['anchor']=(Array['isArray'](a)?a:[a])['map'](J=>({...J,'element':J['element']&&!('isViewportDescriptor'in J['element'])?projectDescriptor(J['element']):J['element']}));if(c)f['fallback']=projectDescriptor(c);return f;}function projectPrioritizedCandidates(B,Q){return B['map'](a=>{let c=0x1;return{'nodeId':a['node']['debugLog']?.['id'],'node':projectAXNode(a['node']),'quality':a['quality'],'prioritizers':Q['map'](X=>{let f;try{const J=X['value'](a);f=Array['isArray'](J)?J['join'](',\x20'):J;}catch{f=void 0x0;}return{'name':X['name'],'priorityOrder':c++,'order':typeof X['compare']==='function'?'custom':X['compare']['order']??'asc','value':typeof f==='string'?clip(f):f};})};});}const eventLogger=makeEventLogger();use(eventLogger);const RUNNER_TYPES=new Set(['instructionExecutionStarted','instructionExecutionFinished','subinstructionExecutionStarted','subinstructionExecutionFinished']),RECORDER_TYPES=new Set(['recordingStarted','recordingStopped','instructionRecorded','elementSelectionStarted','elementSelectionStopped','elementDescriptorGenerated','elementSelectorGenerated','recorderError']);function isLegacyLogEventType(B){return RUNNER_TYPES['has'](B)||RECORDER_TYPES['has'](B);}function makeLogEventFromStructured(B){return new LogEvent(B['data']!=null&&!(typeof B['data']==='object'&&Object['keys'](B['data'])['length']===0x0)?{'type':B['type'],'data':B['data']}:{'type':B['type']});}var LogEvent=class LogEvent extends CustomEvent{['component'];constructor(B){super('log',{'detail':{...B,'timestamp':B['timestamp']??Date['now']()}}),this['component']=RUNNER_TYPES['has'](B['type'])?'runner':'recorder';}['clone'](){return new LogEvent(this['detail']);}};const bus=new EventTarget$1();eventLogger['onLog'](B=>{if(isLegacyLogEventType(B['type']))bus['dispatch'](makeLogEventFromStructured(B));});function makeScript(B){if(B instanceof Script)return B;else{if(typeof B!=='object')return new Script({'source':B});else return new Script(B);}}function makeBundledScript({name:B,url:Q}){return new Script({'source':readFileSync(Q,{'encoding':'utf8'}),'name':B,'bundled':!![]});}var Script=class{['source'];['name'];['bundled'];constructor({source:B,name:Q,bundled:a}){this['source']=B['toString'](),this['name']=Q,this['bundled']=!!a;}async['compile'](B){if(this['bundled']&&this['name']&&knownBundledSnippets['has'](this['name']))return await B['evaluate'](makeExpression({'name':'registerRuntimeBundled_'+this['name'],'source':bundleSnippet(this['name'])})),makeScript({'name':this['name'],'source':'(...args)\x20=>\x20'+this['name']+'(...args)'});return this;}['toString'](){return this['source'];}['toJSON'](){return this['source'];}[Symbol['toPrimitive']](){return this['source'];}[Symbol['for']('nodejs.util.inspect.custom')](){return this['name']?'NamedScript('+this['name']+')':'Script('+(this['source']['length']>0xc8?this['source']['substring'](0x0,0xc8)+'...':this['source'])+')';}};function makeExpression(B){return B instanceof Expression?B:new Expression(typeof B==='object'?B:{'source':B});}function makeBundledExpression({name:B,url:Q}){return new Expression({'source':readFileSync(Q,{'encoding':'utf8'}),'name':B,'bundled':!![]});}var Expression=class{['source'];['name'];['bundled'];constructor({source:B,name:Q,bundled:a}){this['source']=typeof B==='string'?B:'('+B['toString']()+')()',this['name']=Q,this['bundled']=!!a;}async['compile'](){if(this['bundled']&&this['name']&&knownBundledSnippets['has'](this['name']))return makeExpression({'name':this['name'],'source':bundleSnippet(this['name'])});return this;}['toString'](){return this['source'];}['toJSON'](){return this['source'];}[Symbol['toPrimitive']](){return this['source'];}[Symbol['for']('nodejs.util.inspect.custom')](){return this['name']?'NamedExpression('+this['name']+')':'Expression('+(this['source']['length']>0xc8?this['source']['substring'](0x0,0xc8)+'...':this['source'])+')';}};const knownBundledSnippets=new Map();function provideRolldownConfig(B){for(const Q of B)if(!Array['isArray'](Q['output'])&&Q['output']?.['name'])knownBundledSnippets['set'](Q['output']['name'],Q);}function bundleSnippet(B){return execFileSync(process['execPath'],[new URL('../../assets/bundler-CqGVGUSF.ts',import.meta.url)['pathname'],JSON['stringify'](knownBundledSnippets['get'](B))],{'maxBuffer':0xa*0x400*0x400,'encoding':'utf8'});}const findNodeBySelector=makeBundledScript({'name':'findNodeBySelector','url':new URL('../../assets/find-node-by-selector-FKXS0K9G.js',import.meta.url)}),findNodesBySelector=makeBundledScript({'name':'findNodesBySelector','url':new URL('../../assets/find-nodes-by-selector-Cbl5Yyn7.js',import.meta.url)}),getElementSelector=makeBundledScript({'name':'getElementSelector','url':new URL('../../assets/get-element-selector-DdXbhL__.js',import.meta.url)}),getElementValue=makeBundledScript({'name':'getElementValue','url':new URL('../../assets/get-element-value-Br7RXcCX.js',import.meta.url)}),setElementValue=makeBundledScript({'name':'setElementValue','url':new URL('../../assets/set-element-value-CipEuFvw.js',import.meta.url)}),canTypeIntoElement=makeBundledScript({'name':'canTypeToElement','url':new URL('../../assets/can-type-to-element-Ly-SUrz_.js',import.meta.url)}),isElementAcceptableInvisible=makeBundledScript({'name':'isElementAcceptableInvisible','url':new URL('../../assets/is-element-acceptable-invisible-BWAx59YN.js',import.meta.url)}),checkVisibility=makeBundledScript({'name':'checkVisibility','url':new URL('../../assets/check-visibility-NBT6SZvi.js',import.meta.url)}),isFrameContentVisible=makeBundledScript({'name':'isFrameContentVisible','url':new URL('../../assets/is-frame-content-visible-D-Jj5gM9.js',import.meta.url)}),getObscurationRatio=makeBundledScript({'name':'getObscurationRatio','url':new URL('../../assets/get-obscuration-ratio-zVFVUD5T.js',import.meta.url)}),setElementCaretPosition=makeBundledScript({'name':'setElementCaretPosition','url':new URL('../../assets/set-element-caret-position-2rBkIsy9.js',import.meta.url)}),registerPort=makeBundledScript({'name':'registerPort','url':new URL('../../assets/register-port-BZpidK-7.js',import.meta.url)}),visibilityTracker=makeBundledExpression({'name':'visibilityTracker','url':new URL('../../assets/visibility-tracker-BscfcZdV.js',import.meta.url)}),filepickerMocker=makeBundledExpression({'name':'filepickerMocker','url':new URL('../../assets/filepicker-mocker-BCrF2vqr.js',import.meta.url)});var AbortError=class extends Error{['retriable'];constructor(B,Q){super(B,Q),this['retriable']=Q?.['retriable']??![];}},FlushError=class extends Error{},AutomatorError=class extends Error{constructor(B){super(B),this['name']=this['constructor']['name'];}},NavigationFailedError=class extends AutomatorError{['url'];['reason'];constructor({url:B,reason:Q}){super('Navigation\x20failed\x20due\x20to\x20the\x20page\x20being\x20unavailable'),this['url']=B,this['reason']=Q;}},NavigationTimedOutError=class extends AutomatorError{['url'];['timeout'];constructor({url:B,timeout:Q}){super('Navigation\x20timed\x20out'),this['url']=B,this['timeout']=Q;}},NoHistoryEntryError=class extends AutomatorError{['offset'];constructor({offset:B}){super('Can’t\x20go\x20to\x20the\x20'+(B>0x0?'next':'previous')+'\x20page'),this['offset']=B;}},BodyConsumedError=class extends AutomatorError{['accessor'];constructor({accessor:B}){super('Response\x20body\x20has\x20already\x20been\x20consumed;\x20cannot\x20call\x20\x22'+B+'\x22\x20again'),this['accessor']=B;}},CommandTimedOutError=class extends AutomatorError{['method'];['commandId'];['sessionId'];constructor({method:B,commandId:Q,sessionId:a}){super('Devtools\x20command\x20\x22'+B+'\x22\x20that\x20was\x20sent\x20with\x20id\x20'+Q+'\x20to\x20the\x20session\x20\x22'+a+'\x22\x20is\x20timed\x20out'),this['method']=B,this['commandId']=Q,this['sessionId']=a;}};function makeConnection(B){return new Connection(B);}let index=0x0;var Connection=class{#commands=new Map();#events=new Map();#listeners=[];#signal;#timeout=0x7530;async #handleMessage(B){try{const Q=JSON['parse'](B['data']['toString']('utf8'));if(Q['id']!==void 0x0){const a=this.#commands['get'](Q['id']);if(a){trace('cdpCommandSucceeded',{'method':a['method'],'payload':Q,'sessionId':this['sessionId']});if(Q['error'])error('cdpCommandFailed',{'method':a['method'],'params':a['params'],'response':Q,'sessionId':this['sessionId']}),a['watcher']['reject'](new Error(Q['error']['message']));else a['watcher']['resolve'](Q['result']);}}else{if(this['sessionId']===Q['sessionId'])this.#events['get'](Q['method'])?.['forEach'](async c=>{try{await c?.(Q['params']);}catch(X){error('cdpEventHandlerFailed',{'method':Q['method'],'sessionId':this['sessionId'],'raw':B['data']['toString']('utf8'),'error':X});}});}}catch(c){error('cdpMessageParsingFailed',{'sessionId':this['sessionId'],'raw':B['data']['toString']('utf8'),'error':c});}}['socket'];['sessionId'];constructor(B){this['socket']=B['socket'],setMaxListeners(0x3e8,this['socket']),this['sessionId']=B['sessionId'],this.#signal=B['signal'];if(B['timeout']!=null)this.#timeout=B['timeout'];this.#listeners['push'](on(this['socket'],'message',this.#handleMessage['bind'](this))),this.#listeners['push'](on(this['socket'],'error',({error:Q})=>{error('connectionSocketError',{'sessionId':this['sessionId'],'error':Q});})),this.#listeners['push'](on(this['socket'],'close',({code:Q,reason:a})=>{log('connectionSocketClosed',{'sessionId':this['sessionId'],'code':Q,'reason':a});}));if(this.#signal)this.#listeners['push'](once$1(this.#signal,'abort',()=>this['abort'](this.#signal['reason'])));}get['timeout'](){return this.#timeout;}set['timeout'](B){this.#timeout=B;}['abort'](B){this.#listeners['forEach'](Q=>Q()),this.#commands['forEach'](({method:Q,params:a,watcher:c})=>{error('cdpCommandAborted',{'method':Q,'params':a,'reason':B,'sessionId':this['sessionId']}),c['reject'](B);}),this.#commands['clear'](),this.#events['clear']();}['flush'](B){this.#commands['forEach'](({method:Q,params:a,watcher:c})=>{error('cdpCommandFlushed',{'method':Q,'params':a,'reason':B,'sessionId':this['sessionId']}),c['reject'](B);});}async['execute'](B,Q,{signal:a,timeout:c}={}){const X=makeWatcher();if(a?.['aborted']||this.#signal?.['aborted'])return error('cdpCommandNotSent',{'method':B,'params':Q,'sessionId':this['sessionId'],'reason':a?.['reason']||this.#signal?.['reason']}),X['reject'](a?.['reason']||this.#signal?.['reason']),X;let f;if(a)f=once$1(a,'abort',()=>{if(X['settled'])return;error('cdpCommandAborted',{'method':B,'params':Q,'reason':a['reason'],'sessionId':this['sessionId']}),X['reject'](a['reason']);});const J=++index,Y=c??this.#timeout;if(!process.env.PLAY&&Number['isFinite'](Y)&&Y>0x0)X['reject'](new CommandTimedOutError({'method':B,'commandId':J,'sessionId':this['sessionId']}),{'delay':Y});return this.#commands['set'](J,{'method':B,'params':Q,'watcher':X}),trace('cdpCommandSent',{'method':B,'commandId':J,'params':Q,'sessionId':this['sessionId'],'awaitsResponse':!![]}),this['socket']['send'](JSON['stringify']({'sessionId':this['sessionId'],'id':J,'method':B,'params':Q})),X['finally'](()=>{this.#commands['delete'](J),f?.();});}['send'](B,Q){const a=++index;trace('cdpCommandSent',{'method':B,'params':Q,'sessionId':this['sessionId'],'awaitsResponse':![]}),this['socket']['send'](JSON['stringify']({'sessionId':this['sessionId'],'id':a,'method':B,'params':Q}));}['on'](B,Q){let a=this.#events['get'](B);if(!a)this.#events['set'](B,a=new Set());return a['add'](Q),()=>a['delete'](Q);}['once'](B,Q){if(Q){const a=this['on'](B,(...c)=>{return a(),Q(...c);});return a;}else return new Promise((c,X)=>{const f=this['on'](B,(...J)=>{return f(),c(...J);});});}};function makeFrameManager(){return new FrameManager();}var FrameManager=class{#tree=new Map();['has'](B){return!!this.#tree['get'](B)?.['frame'];}*['getFramesIterator'](B){const Q=this.#tree['get'](B);if(!Q||!Q['frame'])throw new Error('Cannot\x20recreate\x20the\x20frame\x20tree,\x20because\x20root\x20frame\x20with\x20id\x20'+B+'\x20is\x20missing');const a=[B];for(let c=0x0;c<a['length'];++c){const X=a[c],f=this.#tree['get'](X);if(f){if(!f['frame'])throw new Error('Cannot\x20recreate\x20the\x20frame\x20tree,\x20because\x20frame\x20with\x20id\x20'+X+'\x20is\x20missing');yield f['frame'],a['push'](...f['childFrameIds']);}}}['get'](B){return this.#tree['get'](B)?.['frame'];}['add'](B){const Q=this.#tree['get'](B['frameId']);if(!Q||Q['frame']){if(Q?.['frame'])this['delete'](B['frameId']);this.#tree['set'](B['frameId'],{'frame':B,'childFrameIds':new Set()});}else Q['frame']=B;if(B['parentFrameId']){if(!this.#tree['has'](B['parentFrameId']))this.#tree['set'](B['parentFrameId'],{'frame':void 0x0,'childFrameIds':new Set([B['frameId']])});else this.#tree['get'](B['parentFrameId'])['childFrameIds']['add'](B['frameId']);}}['delete'](B){const Q=this.#tree['get'](B);if(Q?.['frame']?.['parentFrameId'])this.#tree['get'](Q['frame']['parentFrameId'])?.['childFrameIds']['delete'](B);this.#tree['delete'](B);const a=[B];for(let c=0x0;c<a['length'];++c){const X=a[c],f=this.#tree['get'](X);f&&(a['push'](...f['childFrameIds']),this.#tree['delete'](X));}}['deleteDescendants'](B){const Q=this.#tree['get'](B);if(Q){const a=[...Q['childFrameIds']];for(let c=0x0;c<a['length'];++c){const X=a[c],f=this.#tree['get'](X);f&&(a['push'](...f['childFrameIds']),this.#tree['delete'](X));}Q['childFrameIds']['clear']();}}};function makeWindow(B){return new Window(B);}var Window=class extends EventTargetNode{#targets=new Set();['windowId'];['browser'];constructor({browser:B,windowId:Q}){super(),this['browser']=B,this['windowId']=Q,this['on']('targetAttached',({target:a})=>{this.#targets['add'](a);}),this['on']('targetDetached',({target:a})=>{this.#targets['delete'](a);if(this.#targets['size']===0x0)this['dispatch'](new WindowDestroyedEvent(this));});}*['targets'](){yield*this.#targets['values']();}*['pages'](){yield*this.#targets['values']()['filter'](B=>B['type']==='page');}async['setBounds'](B){await this['browser']['connection']['execute']('Browser.setWindowBounds',{'windowId':this['windowId'],'bounds':{'left':B['x'],'top':B['y'],'width':B['width'],'height':B['height'],'windowState':'normal'}});}async['setSize'](B){await this['browser']['connection']['execute']('Browser.setWindowBounds',{'windowId':this['windowId'],'bounds':{'left':0x0,'top':0x0,'width':B['width'],'height':B['height'],'windowState':'normal'}});}async['setContentsSize'](B){await this['browser']['connection']['execute']('Browser.setContentsSize',{'windowId':this['windowId'],...B});}},WindowTargetAttachedEvent=class extends Event{['target'];constructor(B){super('targetAttached'),this['target']=B;}},WindowTargetDetachedEvent=class extends Event{['target'];constructor(B){super('targetDetached'),this['target']=B;}},WindowDestroyedEvent=class extends Event{['window'];constructor(B){super('destroyed'),this['window']=B;}};function makeWindowManager(){return new WindowManager();}var WindowManager=class{#windows=new Map();['get'](B){return this.#windows['get'](B);}['getOrCreate']({windowId:B,browser:Q}){const a=this.#windows['get'](B);if(a)return a;const c=makeWindow({'browser':Q,'windowId':B});return this.#windows['set'](B,c),c['once']('destroyed',()=>this.#windows['delete'](B)),Q['dispatch'](new BrowserWindowCreatedEvent(c)),c;}*[Symbol['iterator']](){yield*this.#windows['values']();}};function makePagesHistory(B){return new PagesHistory(B);}var PagesHistory=class{#activatingPage;#stack=[];#index=0x0;constructor({browser:B}){B['on']('activePageChanged',({target:Q})=>{this.#activatingPage!==Q&&(this['push'](Q),this.#activatingPage=void 0x0);}),B['on']('pageClosed',({target:Q})=>this['delete'](Q));}get['nextPage'](){if(this.#index<this.#stack['length']-0x1)return this.#stack[this.#index+0x1];}get['previousPage'](){if(this.#index>0x0)return this.#stack[this.#index-0x1];}['push'](B){if(this.#index<this.#stack['length']-0x1)this.#stack=this.#stack['slice'](0x0,this.#index+0x1);const Q=this.#stack[this.#stack['length']-0x1];if(!(Q&&Q===B))this.#stack['push'](B);this.#index=this.#stack['length']-0x1;}['delete'](B){this.#stack=this.#stack['filter'](Q=>Q['targetId']!==B['targetId']);if(this.#stack['length']<=0x1)this.#index=0x0;else{if(this.#index>=this.#stack['length'])this.#index=this.#stack['length']-0x1;}}async['activatePreviousPage'](){this.#activatingPage=this['previousPage'];if(!this.#activatingPage)return![];return this.#activatingPage['once']('activated',()=>this.#index-=0x1),await this.#activatingPage['activate'](),!![];}async['activateNextPage'](){this.#activatingPage=this['nextPage'];if(!this.#activatingPage)return![];return this.#activatingPage['once']('activated',()=>this.#index+=0x1),await this.#activatingPage['activate'](),!![];}};function localizeRemoteValue({evaluator:B,value:Q}){const a=Q['type'];if(a==='undefined'||a==='boolean'||a==='string')return Q['value'];else{if(a==='number'){if(Q['value']['unserializableValue']){if(Q['value']['unserializableValue']==='Infinity')return Infinity;else{if(Q['value']['unserializableValue']==='-Infinity')return-Infinity;else{if(Q['value']['unserializableValue']==='-0')return-0x0;else{if(Q['value']['unserializableValue']==='NaN')return NaN;}}}}return Q['value'];}else{if(a==='bigint')return BigInt(Q['unserializableValue']['slice'](0x0,-0x1));else{if(a==='symbol')return null;else{if(a==='object'){if(Q['subtype']==='null')return null;return new RemoteObjectHandle({'evaluator':B,'value':Q});}else{if(a==='function')return new RemoteFunctionHandle({'evaluator':B,'value':Q});}}}}}return null;}var RemoteObjectHandle=class{#value;#cache=new Map();#revoked=![];async #resolveSerializedValue(B,{path:path=[]}={}){const Q=B['weakLocalObjectReference'];if(Q!==void 0x0&&this.#cache['has'](Q))return this.#cache['get'](Q);let a;const c=B['type'];if(c==='undefined'||c==='boolean'||c==='string')a=B['value'];else{if(c==='null')a=null;else{if(c==='number'){if(B['value']==='Infinity')a=Infinity;else{if(B['value']==='-Infinity')a=-Infinity;else{if(B['value']==='-0')a=-0x0;else{if(B['value']==='NaN')a=NaN;else a=B['value'];}}}}else{if(c==='bigint')a=BigInt(B['value']);else{if(c==='symbol')a=null;else{if(c==='node')a=makeWebNode({'evaluator':this['evaluator'],'handle':path['length']===0x0?this:void 0x0,'nodeId':B['value']['backendNodeId'],'preview':'<'+(B['value']['localName']??'#node')+'\x20'+(B['value']['attributes']?Object['entries'](B['value']['attributes'])['map'](([X,f])=>X+'=\x22'+f+'\x22')['join']('\x20'):'')+'/>'});else{if(c==='array'){const X=[],f=B['value'];for(const [J,Y]of f['entries']())X['push'](await this.#resolveSerializedValue(Y,{'path':[...path,{'type':'value','index':J}]}));a=X;}else{if(c==='set'){const h=new Set(),V=B['value'];for(const [k,t]of V['entries']())h['add'](await this.#resolveSerializedValue(t,{'path':[...path,{'type':'value','index':k}]}));a=h;}else{if(c==='object'){const K={},O=B['value'];for(const [S,[C,G]]of O['entries']())K[C]=await this.#resolveSerializedValue(G,{'path':[...path,{'type':'value','index':S}]});a=K;}else{if(c==='map'){const E=new Map(),W=B['value'];for(const [e,[H,q]]of W['entries']()){const I=typeof H==='string'?H:await this.#resolveSerializedValue(H,{'path':[...path,{'type':'key','index':e}]}),n=await this.#resolveSerializedValue(q,{'path':[...path,{'type':'value','index':e}]});E['set'](I,n);}a=E;}else{if(c==='function')a=await this['evaluator']['execute']((R,F)=>{for(const w of F){const i=(Array['isArray'](R)||R instanceof Set||R instanceof Map?Array['from'](R['entries']()):Object['entries'](R))[w['index']];if(!i)throw new Error('Can\x27t\x20resolve\x20remote\x20object');R=i[w['type']==='key'?0x0:0x1];}return R;},[this,path]);else throw new Error('Can\x27t\x20resolve\x20serialized\x20remote\x20value\x20of\x20type\x20\x22'+c+'\x22');}}}}}}}}}}if(Q!==void 0x0)this.#cache['set'](Q,a);return a;}['evaluator'];get['objectId'](){return this.#value['objectId'];}get['revoked'](){return this.#revoked;}constructor({evaluator:B,value:Q}){this['evaluator']=B,this.#value=Q;}async['resolve'](){if(this.#value['type']==='object'&&this.#value['subtype']==='node')return makeWebNode({'evaluator':this['evaluator'],'handle':this});else{if(this.#value['deepSerializedValue']){const B=await this.#resolveSerializedValue(this.#value['deepSerializedValue']);return await this['revoke'](),B;}else throw new Error('Can\x27t\x20resolve\x20unserialized\x20remote\x20object');}}async['revoke'](){!this.#revoked&&(this.#revoked=!![],await this['evaluator']['target']['connection']['execute']('Runtime.releaseObject',{'objectId':this['objectId']}));}['asArgument'](){if(this['evaluator']['destroyed'])throw new StaleRemoteObjectHandleError('Remote\x20object\x20with\x20id\x20'+this['objectId']+'\x20is\x20stale');return!this.#revoked?{'objectId':this['objectId']}:{'value':null};}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){let c;if(this.#value['deepSerializedValue']){c=stringifySerializedRemoteValue(this.#value['deepSerializedValue'],{'depth':B-0x1});if(this.#value['deepSerializedValue']['type']==='node'&&Q['maxStringLength'])c=c['substring'](0x0,Q['maxStringLength'])+'...';}else{if(this.#value['preview'])c=stringifyRemoteValuePreview(this.#value['preview']);else c=this.#value['description']??'';}return'RemoteObjectHandle\x20{'+c+'}';}},RemoteFunctionHandle=class extends RemoteObjectHandle{async['resolve'](){const B=(...Q)=>this['call'](...Q);return B['handle']=this,B;}async['call'](...B){return await this['evaluator']['execute']((Q,a)=>Q(...a),[this,B]);}},StaleRemoteObjectHandleError=class extends Error{};function stringifyRemoteValuePreview(B){const Q=B['type'];if(Q==='object'){const c=B['subtype'];if(c==='null'||c==='regexp')return B['description'];else{if(c==='node')return'<'+B['description']+'/>';else{if(c==='array')return'['+B['properties']['map'](X=>a(X))['join'](',\x20')+(B['overflow']?'\x20...,\x20[length]:\x20'+/\d+/['exec'](B['description'])?.[0x0]:'')+']';else{if(c==='set'||c==='weakset')return B['description']+'\x20{'+(B['entries']??[])['map'](X=>stringifyRemoteValuePreview(X['value']))['join'](',\x20')+(B['overflow']?'\x20...':'')+'}';else{if(!c)return'['+B['properties']['map'](X=>X['name']+':\x20'+a(X))['join'](',\x20')+(B['overflow']?'\x20...':'')+']';else{if(c==='map'||c==='weakmap')return B['description']+'\x20{'+(B['entries']??[])['map'](X=>stringifyRemoteValuePreview(X['key'])+'\x20=>\x20'+stringifyRemoteValuePreview(X['value']))['join'](',\x20')+'\x20'+(B['overflow']?'...':'')+'}';else{if(c==='date')return'Date\x20{'+B['description']+'}';else{if(c==='promise'){const X=B['properties']['find'](J=>J['name']==='[[PromiseState]]')?.['value']??'pending',f=B['properties']['find'](J=>J['name']==='[[PromiseResult]]');return'Promise\x20{<'+X+'>'+(X!=='pending'&&f?a(f):'')+'}';}else{if(c==='error')return'Error\x20{'+B['description']+'}';else return'{<unknown>:\x20'+c+'}';}}}}}}}}}else{if(Q==='string')return'\x27'+B['description']?.['replaceAll']('\x27','\x5c\x27')+'\x27';else return B['description'];}function a(J){return J['valuePreview']?stringifyRemoteValuePreview(J['valuePreview']):J['value'];}}function stringifySerializedRemoteValue(B,{depth:Q}){const a=B['type'];if(a==='undefined'||a==='null')return a;else{if(a==='boolean'||a==='number')return B['value'];else{if(a==='bigint')return B['value']+'n';else{if(a==='string')return'\x27'+B['value']['replaceAll']('\x27','\x5c\x27')+'\x27';else{if(a==='symbol')return'';else{if(a==='node'){const c=Object['entries'](B['value']['attributes']??{})['map'](([X,f])=>X+'=\x22'+f+'\x22')['join']('\x20');return'<'+(B['value']['localName']??'#node')+'\x20'+c+'/>';}else{if(a==='regexp')return'';else{if(a==='date')return'';else{if(a==='array'){const X='Array('+B['value']['length']+')';if(Q===0x0)return X;return'['+B['value']['map'](f=>stringifySerializedRemoteValue(f,{'depth':Q-0x1}))['join'](',\x20')+']';}else{if(a==='set'){const f='Set('+B['value']['length']+')';if(Q===0x0)return f;return f+'\x20{'+B['value']['map'](J=>stringifySerializedRemoteValue(J,{'depth':Q-0x1}))['join'](',\x20')+'}';}else{if(a==='object'){const J='Object('+B['value']['length']+')';if(Q===0x0)return J;return'{'+B['value']['map'](([Y,h])=>Y+':\x20'+stringifySerializedRemoteValue(h,{'depth':Q-0x1}))['join'](',\x20')+'}';}else{if(a==='map'){const Y='Map('+B['value']['length']+')';if(Q===0x0)return Y;return Y+'\x20{'+B['value']['map'](([h,V])=>(typeof h==='string'?h:stringifySerializedRemoteValue(h,{'depth':Q-0x1}))+'\x20=>\x20'+stringifySerializedRemoteValue(V,{'depth':Q-0x1}))['join'](',\x20')+'}';}else return'{<unknown>:\x20'+a+'}';}}}}}}}}}}}}function boxToRect(B){return{'x':B['x'],'y':B['y'],'width':B['width'],'height':B['height'],'top':B['height']<0x0?B['y']+B['height']:B['y'],'left':B['width']<0x0?B['x']+B['width']:B['x']};}function hostnameOf(B){if(!B)return void 0x0;try{return new URL(B)['hostname'];}catch{return;}}function matchesDomain(B,Q){return Q['some'](a=>B===a||B['endsWith']('.'+a));}const AD_FRAME_PATTERNS=/(?:doubleclick\.net|googlesyndication\.com|googleadservices\.com|google(?:tag|ad)manager\.com|adnxs\.com|pubmatic\.com|amazon-adsystem\.com|rubiconproject\.com|casalemedia\.com|criteo\.(?:com|net)|sharethrough\.com|yieldmo\.com|gumgum\.com|openx\.net|bidswitch\.net|media\.net|seedtag\.com|3lift\.com|undertone\.com|ads\.yahoo\.com|pub\.network|lijit\.com|adsrvr\.org|2mdn\.net|moatads\.com|serving-sys\.com|taboola\.com|outbrain\.com)/i;function isAdUrl(B){const Q=hostnameOf(B);return Q?AD_FRAME_PATTERNS['test'](Q):![];}const ANALYTICS_DOMAINS=['google-analytics.com','analytics.google.com','omtrdc.net','2o7.net','demdex.net','contentsquare.net','hotjar.com','fullstory.com','mixpanel.com','amplitude.com','segment.io','segment.com','newrelic.com','nr-data.net','scorecardresearch.com','quantserve.com','chartbeat.com','clarity.ms'],ANALYTICS_HOSTNAME_PREFIX=/^s?metrics\./i;function isAnalyticsUrl(B){const Q=hostnameOf(B);if(!Q)return![];return matchesDomain(Q,ANALYTICS_DOMAINS)||ANALYTICS_HOSTNAME_PREFIX['test'](Q);}function isNonBlockingRequest(B,Q){return B==='Ping'||B==='EventSource'||isAdUrl(Q)||isAnalyticsUrl(Q);}function makeWebNode(B){return new WebNode(B);}var WebNode=class{#handle;#nodeId;#contentFrame=void 0x0;#attributes;#description;#preview;async #getDescription(){if(this.#description)return this.#description;const B=await this['frame']['target']['connection']['execute']('DOM.describeNode',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});return this.#description=B['node'];}['evaluator'];get['frame'](){return this['evaluator']['frame'];}constructor({evaluator:B,handle:Q,nodeId:a,preview:c}){this['evaluator']=B,this.#handle=Q,this.#nodeId=a,this.#preview=c;}async['asRemoteObjectHandle'](){if(this.#handle)return this.#handle;const B=await this['frame']['target']['connection']['execute']('DOM.resolveNode',{'executionContextId':this['evaluator']['evaluatorId'],'backendNodeId':this.#nodeId});return this.#handle=localizeRemoteValue({'evaluator':this['evaluator'],'value':B['object']});}async['equal'](B){if(this['frame']!==B['frame'])return![];const Q=await Promise['all']([this['getNodeId'](),B['getNodeId']()]);return Q[0x0]===Q[0x1];}async['normalize'](){return this['execute'](B=>{if(B instanceof Element&&['::before','::after']['includes'](B['tagName']))return B['parentElement'];if(B instanceof SVGElement){let Q=B;while(Q['viewportElement'])Q=Q['viewportElement'];return Q;}return B;});}async['isConnected'](){return this['execute'](B=>B['isConnected'])['catch'](()=>![]);}async['isEnabled'](){return this['execute'](B=>B instanceof Element?B['matches'](':enabled'):![]);}async['isHovered'](){return this['execute'](B=>B instanceof Element?B['matches'](':hover'):B['parentElement']?.['matches'](':hover')??![]);}async['getNodeId'](){if(this.#nodeId)return this.#nodeId;return(await this.#getDescription())['backendNodeId'];}async['getValue']({hint:hint='string',acceptFormValue:B}={}){return await this['execute'](getElementValue,[{'hint':hint,'acceptFormValue':B}]);}async['getText'](){return await this['execute'](B=>B['textContent']);}async['getScreenBox'](){let B=await this['getBox']();try{let Q=this['frame'];while(Q&&!Q['isMain']){if(Q['isOutOfProcess']){const a=await(await Q['getOwnerNode']())['getBox']();B=B['offset'](a);}Q=Q['parent'];}return B;}catch(c){throw new Error('Node\x20screen\x20box\x20calculation\x20is\x20failed',{'cause':c});}}async['getBox'](){try{const {model:B}=await this['frame']['target']['connection']['execute']('DOM.getBoxModel',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});return new Rectangle(B['border'][0x0],B['border'][0x1],B['border'][0x4]-B['border'][0x0],B['border'][0x5]-B['border'][0x1]);}catch(Q){error('nodeBoxCalculationFailed',{'error':Q});throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');}}async['getMetrics'](){return this['execute'](B=>{const Q=B instanceof Element?B:B['parentElement'];return{'scrollX':Q['scrollLeft'],'scrollY':Q['scrollTop'],'scrollWidth':Q['scrollWidth'],'scrollHeight':Q['scrollHeight'],'clientWidth':Q['clientWidth'],'clientHeight':Q['clientHeight']};});}async['getContentBoxes'](){try{const {quads:B}=await this['frame']['target']['connection']['execute']('DOM.getContentQuads',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']}),Q=B['map'](a=>Rectangle['fromQuad'](a))['filter'](a=>a['width']>0x0&&a['height']>0x0);if(Q['length']===0x0)throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');return Q;}catch(a){error('nodeBoxCalculationFailed',{'error':a});throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');}}async['getTagName'](){return(await this.#getDescription())['nodeName']['toLowerCase']();}async['getAttribute'](B){if(!this.#attributes){const Q=await this.#getDescription();this.#attributes=new Map();if(Q['attributes']){for(let a=0x0;a<(Q['attributes']?.['length']??0x0);a+=0x2)this.#attributes['set'](Q['attributes'][a],Q['attributes'][a+0x1]);}}return this.#attributes['get'](B);}async['getContentFrame'](){if(this.#contentFrame===void 0x0){const B=(await this.#getDescription())['frameId'];this.#contentFrame=B?this['frame']['target']['browser']['frameManager']['get'](B):null;if(!this.#contentFrame)throw new Error('Cannot\x20find\x20content\x20frame\x20of\x20the\x20iframe\x20node\x20with\x20with\x20object\x20id\x20\x22'+this.#nodeId+'\x22');}return this.#contentFrame;}async['$'](B){const Q=['/','(','../','./','*/']['some'](a=>B['startsWith'](a))?'xpath':'css';return await this['execute']((a,c,X)=>{if(X==='xpath')return document['evaluate'](c['replaceAll']('/svg','/*[local-name()\x20=\x20\x27svg\x27]'),a,null,XPathResult['FIRST_ORDERED_NODE_TYPE'],null)['singleNodeValue'];else return(a instanceof Element?a:a['parentElement'])['querySelector'](c);},[B,Q]);}async['$$'](B){const Q=['/','(','../','./','*/']['some'](a=>B['startsWith'](a))?'xpath':'css';return await this['execute']((a,c,X)=>{if(X==='xpath'){const f=document['evaluate'](c['replaceAll']('/svg','/*[local-name()\x20=\x20\x27svg\x27]'),a,null,XPathResult['ORDERED_NODE_ITERATOR_TYPE'],null),J=[];let Y;while(Y=f['iterateNext']())J['push'](Y);return J;}else{const h=a instanceof Element?a:a['parentElement'];return Array['from'](h['querySelectorAll'](c));}},[B,Q]);}async['execute'](B,Q,a){return this['evaluator']['execute'](B,[this,...Q??[]],a);}async['focus'](){try{return await this['frame']['target']['connection']['execute']('DOM.focus',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']}),!![];}catch{const B=await this['getTagName']();if(B==='html'||B==='body')return!![];if(await this['execute'](Q=>Q instanceof Element?Q['shadowRoot']?.['delegatesFocus']:![])===![])return!![];return![];}}async['hover']({signal:B}){const Q=(await this['getBox']())['center'],a=this['frame']['target']['mouse']['position'],c=[[Q]],X=await this['frame']['target']['getViewportSize']();c['push']([{'x':Q['x'],'y':X['height']+0x64},Q]);const f=new Segment(a,Q)['toOrthogonal']();c['push'](f['map'](J=>J['end']));for(const J of c){await this['frame']['target']['mouse']['move'](J,{'signal':B});const {isObscured:Y}=await this['isObscured']();if(!Y){const h=await this['getBox']();if(h['center']['distance'](this['frame']['target']['mouse']['position'])>0x1)await this['frame']['target']['mouse']['move'](h['center'],{'signal':B});return;}await this['frame']['target']['mouse']['move'](a,{'signal':B}),await o(0x3e8);}}async['click']({simulate:B,signal:Q,...a}={}){if(B)await this['execute'](c=>c['click']());else{await this['hover']({'signal':Q});const [c]=await this['getContentBoxes'](),X={'x':c['x']+c['width']/0x2,'y':c['y']+c['height']/0x2};await this['frame']['target']['mouse']['click'](X,a);}}async['scrollIntoView']({block:block='nearest',inline:inline='nearest'}={}){await this['execute'](async(B,{block:Q,inline:a})=>{(B instanceof Element?B:B['parentElement'])['scrollIntoView']({'block':Q,'inline':a,'behavior':'instant'}),await new Promise(requestAnimationFrame);},[{'block':block,'inline':inline}],{'await':!![]});}async['tryToUnobscure'](){await this['scrollIntoView']();const {ratio:B}=await this['getObscurationInfo']();if(B!==0x0)await this['scrollIntoView']({'block':'center','inline':'center'});}async['isVisible'](){const {isVisible:B}=await this['execute'](checkVisibility,[{'minSize':0x1,'checkParentsVisibility':!![]}]);return B;}async['getObscurationInfo'](){if(!await this['isVisible']())return{'ratio':0x1,'obscuringElement':null};const {ratio:B,obscuringElement:Q}=await this['execute'](getObscurationRatio);if(B===0x0)return{'ratio':0x0,'obscuringElement':null};const a=await this['getContentBoxes']();if(a['length']===0x0)return{'ratio':0x1,'obscuringElement':null};const {dx:c,dy:X}=await this['frame']['target']['mainFrame']['execute'](()=>({'dx':window['scrollX'],'dy':window['scrollY']})),f=await this['execute'](V=>V instanceof Element?V:V['parentElement']),J=[];let Y=null;for(const V of a){const k=rectToSamplingPoints(boxToRect(V)),t=await Promise['all'](k['map'](async O=>{const S={'x':O['x']+c,'y':O['y']+X},C=await this['frame']['target']['resolveFromLocation'](S);if(!C)return{'isObscured':![],'node':null};if(await f['equal'](C))return{'isObscured':![],'node':null};if(await f['contains'](C))return{'isObscured':![],'node':null};return{'isObscured':!![],'node':C};})),K=t['map'](O=>O['isObscured']);if(!Y){const O=t['find'](S=>S['isObscured']&&S['node']);if(O)Y=O['node'];}J['push'](K);}const h=calculateObscurationRatio(J);return{'ratio':Math['min'](h,B),'obscuringElement':Y??Q};}async['isObscured'](){const {ratio:B,obscuringElement:Q}=await this['getObscurationInfo']();return{'isObscured':B>0.5,'obscuringElement':Q};}async['isAcceptableInvisible'](){return this['execute'](isElementAcceptableInvisible);}async['scrollTo'](B){await this['execute']((Q,{x:a,y:c})=>{if(!(Q instanceof Element))return;let X;if(a==='end')X=Q['scrollWidth'];else{if(a==='center')X=Q['scrollWidth']/0x2;else X=a;}let f;if(c==='end')f=Q['scrollHeight'];else{if(c==='center')f=Q['scrollHeight']/0x2;else f=c;}Q['scrollTo']({'left':X,'top':f,'behavior':'instant'});},[B]);}async['scrollBy'](B){if(await this['execute'](async(a,{x:c,y:X})=>{if(!(a instanceof Element))return!![];const f=a['scrollTop'],J=a['scrollLeft'];return a['scrollBy']({'left':c,'top':X,'behavior':'instant'}),new Promise(Y=>{requestAnimationFrame(()=>{const h=a['scrollTop'],V=a['scrollLeft'];if(h===f&&V===J)Y(![]);else Y(!![]);});});},[B],{'await':!![]}))return;const Q=await this['getBox']();await this['frame']['target']['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseWheel','x':Q['x']+Q['width']-0x1,'y':Q['y']+0x1,'deltaX':B['x']??0x0,'deltaY':B['y']??0x0});}async['setValue'](B){if(await this['execute'](Q=>Q instanceof HTMLInputElement&&Q['type']==='file')){if(typeof B!=='string'&&!Array['isArray'](B))throw new Error('Can\x27t\x20set\x20value\x20of\x20type\x20'+typeof B+'\x20in\x20a\x20filepicker');await this['frame']['target']['connection']['execute']('DOM.setFileInputFiles',{'files':Array['isArray'](B)?B:[B],'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});}else await this['execute'](setElementValue,[B]);}async['canTypeInto'](){return this['execute'](canTypeIntoElement);}async['type'](B){throw new Error('Web\x20elements\x20do\x20not\x20support\x20direct\x20typing.\x20Use\x20keyboard.type()\x20instead.');}async['contains'](B){if(this['frame']!==B['frame'])return![];return this['execute']((Q,a)=>Q['contains'](a),[await this['evaluator']['adopt'](B)]);}async['generateXpath'](){return this['execute'](B=>{let Q='';const a=B['ownerDocument'];if(!a)return Q;let c=B;if(B instanceof Element&&B['id'])Q='//'+B['tagName']+'[@id=\x22'+B['id']+'\x22]';else while(c&&c!==a){const X=c['parentNode'];if(X){const f=c['tagName'];Q='/'+f+'['+(Array['prototype']['filter']['call'](X['childNodes'],J=>J['tagName']===f)['indexOf'](c)+0x1)+']'+Q;}c=X;}return Q;});}async['getDescription'](){return this['generateXpath']();}async['isTextNode'](){return this['execute'](B=>B instanceof Text);}async['getParent'](){return await this['execute'](B=>B['parentElement']);}async['getSelector'](){return this['execute'](getElementSelector);}async['isContentEditable'](){return this['execute'](B=>B instanceof HTMLElement?B['isContentEditable']:![]);}async['setCaretPosition'](B){return this['execute'](setElementCaretPosition,[B]);}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){a['styles']['node']='magentaBright';const c=this.#handle?.[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a)??this.#preview;return c?Q['stylize'](c,'node'):'Node\x20'+a({'nodeId':this.#nodeId},{...Q,'compact':!![],'breakLength':Infinity});}async['isLabelOf'](B){if(this['frame']!==B['frame'])return![];return this['execute']((Q,a)=>{if(!(a instanceof HTMLInputElement)||!a['labels'])return![];return Array['from'](a['labels'])['some'](c=>c['contains'](Q));},[await this['evaluator']['adopt'](B)]);}},StaleNodeError=class extends Error{},PortOutgoingMessageEvent=class extends Event{['name'];['payload'];constructor(B,Q){super('outgoingMessage'),this['name']=B,this['payload']=Q;}},PortIncommingMessageEvent=class extends Event{['name'];['payload'];constructor(B,Q){super('incommingMessage'),this['name']=B,this['payload']=Q;}};function makePort(B){return new Port(B);}var Port=class extends EventTargetNode{#watchers={'initialized':makeWatcher()};async #initialize(){const B='__'+this['name']['replaceAll']('\x20','_')+'_post_message';this['evaluator']['target']['connection']['on']('Runtime.bindingCalled',({executionContextId:Q,name:a,payload:c})=>{if(this['evaluator']['evaluatorId']===Q&&a===B){const X=JSON['parse'](c);this['dispatch'](new PortIncommingMessageEvent(X['name'],X['payload']));}}),await this['evaluator']['target']['connection']['execute']('Runtime.addBinding',{'name':B,'executionContextId':this['evaluator']['evaluatorId']}),await this['evaluator']['execute'](registerPort,[this['name']]),log('portInitialized',{'portName':this['name'],'evaluatorId':this['evaluator']['evaluatorId'],'frameId':this['evaluator']['frame']?.['frameId']});}#closed=![];['evaluator'];['name'];constructor({evaluator:B,name:Q}){super(),this['evaluator']=B,this['name']=Q,this.#initialize()['then'](()=>this.#watchers['initialized']['resolve']())['catch'](a=>this.#watchers['initialized']['reject'](a)),this['evaluator']['on']('destroyed',()=>{if(this.#closed)return;this.#closed=!![],log('portClosed',{'portName':this['name'],'evaluatorId':this['evaluator']['evaluatorId']});}),this['on']('outgoingMessage',async({name:a,payload:c})=>{try{await this['evaluator']['execute']((X,f,J)=>{const Y=globalThis;Y['ports'][X]['dispatchEvent'](new Y['PortIncommingMessageEvent'](f,J));},[this['name'],a,c]);}catch(X){error('portMessageSendFailed',{'portName':this['name'],'messageName':a,'evaluatorId':this['evaluator']['evaluatorId'],'error':X});}});}['send'](B,Q){this['dispatch'](new PortOutgoingMessageEvent(B,Q));}async['wait'](B){await this.#watchers[B];}};function makeEvaluator(B){return new Evaluator(B);}var Evaluator=class extends EventTargetNode{#evaluatorId;#destroyed=![];#controller=new AbortController();['type'];['name'];['target'];['frame'];get['evaluatorId'](){return this.#evaluatorId;}get['destroyed'](){return this.#destroyed;}constructor(B){super(),this.#evaluatorId=B['evaluatorId'];if('target'in B)this['target']=B['target'];else this['target']=B['frame']['target'],this['frame']=B['frame'];this['name']=B['name'],this['type']=B['type'],this['target']['connection']['on']('Runtime.executionContextsCleared',()=>{log('executionContextDestroyed',{'contextId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'cleared'}),log('evaluatorDestroyed',{'evaluatorId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'cleared'}),this.#controller['abort'](new AbortError('Evaluator\x20with\x20id\x20\x22'+this.#evaluatorId+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation',{'retriable':this['frame']&&!this['frame']['destroyed']})),this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),this.#controller=new AbortController();}),this['target']['connection']['on']('Runtime.executionContextDestroyed',({executionContextId:a})=>{this.#evaluatorId===a&&(log('executionContextDestroyed',{'contextId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'destroyed'}),log('evaluatorDestroyed',{'evaluatorId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'destroyed'}),this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),this.#controller=new AbortController());});if(B['logs'])this['target']['connection']['on']('Runtime.consoleAPICalled',({executionContextId:a,type:c,timestamp:X,args:f})=>{if(this.#evaluatorId===a)try{const J=f['map'](Y=>localizeRemoteValue({'evaluator':this,'value':Y}));this['dispatch'](new EvaluatorLogEvent({'type':c,'timestamp':X,'args':J}));}catch{}});const Q=this['type']+'-'+this.#evaluatorId;this['frame']?.['on']('destroyed',()=>this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),{'key':Q}),this['on']('destroyed',()=>{this.#destroyed=!![],this.#controller['abort'](new AbortError('Evaluator\x20with\x20id\x20\x22'+this.#evaluatorId+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation',{'retriable':this['frame']&&!this['frame']['destroyed']})),this['frame']?.['off'](Q);});}async['execute'](B,Q,a){const c=await this['target']['connection']['execute']('Runtime.callFunctionOn',{'executionContextId':this.#evaluatorId,'functionDeclaration':await makeScript(B)['compile'](this),'arguments':await Promise['all']((Q??[])['map'](async f=>{if(f instanceof RemoteObjectHandle)return f['asArgument']();if(f instanceof WebNode)return(await f['asRemoteObjectHandle']())['asArgument']();if(typeof f==='bigint')return{'unserializableValue':f+'n'};if(f===Infinity)return{'unserializableValue':'Infinity'};if(f===-Infinity)return{'unserializableValue':'-Infinity'};if(Object['is'](f,-0x0))return{'unserializableValue':'-0'};if(Number['isNaN'](f))return{'unserializableValue':'NaN'};return{'value':f};})),'awaitPromise':a?.['await'],'serializationOptions':{'serialization':'deep'}},{'signal':this.#controller['signal'],'timeout':a?.['timeout']});if(c['exceptionDetails']){const f=c['exceptionDetails']['exception']?.['description']?.['replace'](/^\w+:\s*/,'')['replace'](/\n.*/s,'');throw new Error(f??'Error\x20during\x20script\x20evaluation');}const X=localizeRemoteValue({'evaluator':this,'value':c['result']});return X instanceof RemoteObjectHandle?await X['resolve']():X;}async['evaluate'](B,Q){const a=await this['target']['connection']['execute']('Runtime.evaluate',{'contextId':this.#evaluatorId,'expression':await makeExpression(B)['compile'](),'awaitPromise':Q?.['await'],'serializationOptions':{'serialization':'deep'}},{'signal':this.#controller['signal'],'timeout':Q?.['timeout']});if(a['exceptionDetails']){const X=a['exceptionDetails']['exception']?.['description']?.['replace'](/^\w+:\s*/,'')['replace'](/\n.*/s,'');throw new Error(X??'Error\x20during\x20script\x20evaluation');}const c=localizeRemoteValue({'evaluator':this,'value':a['result']});return c instanceof RemoteObjectHandle?await c['resolve']():c;}async['resolve']({nodeId:B}){const Q=await this['target']['connection']['execute']('DOM.resolveNode',{'executionContextId':this['evaluatorId'],'backendNodeId':B});return await localizeRemoteValue({'evaluator':this,'value':Q['object']})['resolve']();}async['adopt'](B){if(B['evaluator']===this)return B;if(B['frame']!==this['frame'])throw new Error('Can\x27t\x20adopt\x20a\x20node\x20from\x20a\x20different\x20frame');return this['resolve']({'nodeId':await B['getNodeId']()});}async['port'](B){const Q=makePort({'evaluator':this,'name':B});return await Q['wait']('initialized'),Q;}},EvaluatorLogEvent=class extends Event{['type'];['timestamp'];['args'];constructor({type:B,timestamp:Q,args:a},c){super('log',c),this['type']=B,this['timestamp']=Q,this['args']=a;}},EvaluatorDestroyedEvent=class extends Event{['evaluatorId'];constructor({evaluatorId:B},Q){super('destroyed',Q),this['evaluatorId']=B;}};function makeRemoteStream(B,Q){let a=typeof Q==='string'?Q:void 0x0;const c=typeof Q==='function'?Q:void 0x0;let X=![],f;async function J(){if(a)return a;return f??=c()['then'](h=>a=h),f;}async function Y(){if(X)return;X=!![];if(!a)return;try{await B['execute']('IO.close',{'handle':a});}catch{}}return new Readable({'read'(h){J()['then'](V=>B['execute']('IO.read',{'handle':V,'size':Math['max'](h,0x40*0x400)}))['then'](({data:V,base64Encoded:k,eof:t})=>{if(V['length']>0x0)this['push'](k?N['from'](V,'base64'):N['from'](V,'utf8'));t&&(this['push'](null),Y());},V=>this['destroy'](V instanceof Error?V:new Error(String(V))));},'destroy'(h,V){Y()['finally'](()=>V(h));}});}const BFCACHE_LIMIT=0x6;var StylesheetsManager=class{#current={'sheets':new Map()};#bfcache=new Map();get['current'](){return[...this.#current['sheets']['values']()];}['add'](B){this.#current['sheets']['set'](B['stylesheetId'],B);}['remove'](B){return this.#current['sheets']['delete'](B);}['beginNavigation'](){if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']);this.#current={'sheets':new Map()};}['commitNavigation'](B,Q){if(this.#current['loaderId']===B)return;if(Q==='restoration'){const a=this.#bfcache['get'](B);if(a){if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']);this.#bfcache['delete'](B),this.#current={'loaderId':B,'sheets':a},this.#evictBfcache(B);return;}}if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']),this.#current={'loaderId':B,'sheets':new Map()};else this.#current['loaderId']=B;this.#evictBfcache(B);}#evictBfcache(B){while(this.#bfcache['size']>BFCACHE_LIMIT){let Q=![];for(const a of this.#bfcache['keys']()){if(a===B)continue;this.#bfcache['delete'](a),Q=!![];break;}if(!Q)break;}}},FrameFetchError=class extends Error{['netError'];constructor(B){super(B),this['name']='FrameFetchError',this['netError']=B;}};function makeFrame(B){return new Frame(B);}var Frame=class extends EventTargetNode{#target;#node;#defaultEvaluator;#isolatedEvaluator;#response;#controller=new AbortController();#destroyed=![];#watchers={'determined':makeWatcher({'signal':this.#controller['signal']}),'defaultEvaluatorAttached':makeWatcher({'signal':this.#controller['signal']}),'navigated':makeWatcher({'signal':this.#controller['signal']}),'loaded':makeWatcher({'signal':this.#controller['signal']}),'networkAlmostIdle':makeWatcher({'signal':this.#controller['signal']}),'networkIdle':makeWatcher({'signal':this.#controller['signal']}),'stable':makeWatcher({'signal':this.#controller['signal']})};#isAd=![];#navigatedAt=0x0;#stylesheets=new StylesheetsManager();async #getDefaultEvaluator(){return await this.#watchers['defaultEvaluatorAttached'],this.#defaultEvaluator;}async #getIsolatedEvaluator(){if(this.#isolatedEvaluator)return this.#isolatedEvaluator;const B=await this.#target['connection']['execute']('Page.createIsolatedWorld',{'frameId':this['frameId'],'worldName':'isolated-'+this['frameId']},{'signal':this.#controller['signal']});return this.#isolatedEvaluator=makeEvaluator({'frame':this,'evaluatorId':B['executionContextId'],'type':'isolated','logs':!![]}),log('evaluatorCreated',{'evaluatorId':this.#isolatedEvaluator['evaluatorId'],'frameId':this['frameId']}),this.#isolatedEvaluator['once']('destroyed',()=>this.#isolatedEvaluator=void 0x0),this['dispatch'](new FrameEvaluatorAttached(this.#isolatedEvaluator)),this.#isolatedEvaluator;}async #execute(B,Q,a,c){await this['wait']('determined');let X;if(B==='isolated')X=await this.#getIsolatedEvaluator();else X=await this.#getDefaultEvaluator();try{return await X['execute'](Q,a,c);}catch(f){if(f instanceof AbortError&&f['retriable'])return this.#execute(B,Q,a,c);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#execute(B,Q,a,c);throw f;}}async #evaluate(B,Q,a){await this['wait']('determined');let c;if(B==='isolated')c=await this.#getIsolatedEvaluator();else c=await this.#getDefaultEvaluator();try{return await c['evaluate'](Q,a);}catch(X){if(X instanceof AbortError&&X['retriable'])return this.#evaluate(B,Q,a);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#evaluate(B,Q,a);throw X;}}async #resolve(B,Q){await this['wait']('determined');let a;if(B==='isolated')a=await this.#getIsolatedEvaluator();else a=await this.#getDefaultEvaluator();try{return await a['resolve'](Q);}catch(c){if(c instanceof AbortError&&c['retriable'])return this.#resolve(B,Q);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#resolve(B,Q);throw c;}}['frameId'];['parentFrameId'];get['loaded'](){return this.#watchers['loaded']['settled'];}get['stable'](){return this.#watchers['stable']['settled'];}get['destroyed'](){return this.#destroyed;}get['target'](){return this.#target;}get['response'](){return this.#response;}get['isMain'](){return!this['parentFrameId'];}get['isOutOfProcess'](){return!this['isMain']&&this['frameId']===this.#target['targetId'];}get['isAd'](){return this.#isAd;}get['parent'](){if(!this['parentFrameId'])return null;return this['target']['browser']['frameManager']['get'](this['parentFrameId'])??null;}get['defaultEvaluator'](){return this.#defaultEvaluator;}get['navigatedAt'](){return this.#navigatedAt;}get['stylesheets'](){return this.#stylesheets['current'];}['addStylesheet'](B){this.#stylesheets['add'](B);}['removeStylesheet'](B){return this.#stylesheets['remove'](B);}constructor({target:B,frameId:Q,parentFrameId:a}){super(),this.#target=B,this['frameId']=Q,this['parentFrameId']=a,this.#watchers['determined']['resolve'](),this.#watchers['navigated']['resolve'](),this['on']('evaluatorAttached',({evaluator:c})=>{c['type']==='default'&&(this.#defaultEvaluator=c,this.#watchers['defaultEvaluatorAttached']['resolve'](),c['on']('log',({type:X,args:f})=>{log('frameConsoleMessage',{'frameId':this['frameId'],'consoleType':X,'args':f});}));}),this['on']('request',({request:c})=>{if(this.#watchers['navigated']['settled'])this['dispatch'](new FrameNavigatingEvent({'url':c['url'],'reason':'unknown'}));}),this['on']('response',({response:c})=>this.#response=c),this['on']('navigating',()=>{this.#watchers['navigated']['reset']({'signal':this.#controller['signal']}),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('navigated',({url:c,reason:X,loaderId:f})=>{if(!this['isMain'])this.#isAd=isAdUrl(c);this.#navigatedAt=Date['now'](),this.#watchers['navigated']['resolve']();if(X!=='local')this.#stylesheets['commitNavigation'](f,X);X==='remote'?(this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']})):(this.#watchers['loaded']['resolve'](),this.#watchers['stable']['resolve'](),this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['resolve']());}),this['on']('loading',()=>{if(this['isAd'])return;this.#stylesheets['beginNavigation'](),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('loaded',()=>{this.#watchers['loaded']['resolve'](),this.#watchers['stable']['resolve']();}),this['on']('networkAlmostIdle',()=>{this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('networkIdle',()=>{this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['resolve']();}),this['on']('swapping',()=>{log('frameTargetSwapping',{'frameId':this['frameId']}),this.#watchers['determined']['reset']({'signal':this.#controller['signal']}),this.#defaultEvaluator=void 0x0,this.#isolatedEvaluator=void 0x0;}),this['on']('swapped',({target:c})=>{log('frameTargetSwapped',{'frameId':this['frameId'],'targetId':c['targetId']}),this.#target=c,this.#watchers['determined']['resolve'](),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('destroyed',()=>{this.#destroyed=!![],this.#controller['abort'](new AbortError('Frame\x20with\x20id\x20\x22'+this['frameId']+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation'));});}async['isVisible'](){if(this['isMain'])return!![];const B=await this['getOwnerNode']();if(!B)return![];return await B['execute'](isFrameContentVisible);}async['wait'](B,{signal:Q}={}){return abortable(this.#watchers[B],Q);}async['getOwnerNode'](){if(this.#node!==void 0x0)return this.#node;if(!this['parent'])return this.#node=null;const B=await this['parent']['$$']('iframe,\x20frame');for(const Q of B)if(await Q['getContentFrame']()===this)return this.#node=Q;throw new Error('Cannot\x20find\x20owner\x20node\x20for\x20the\x20frame');}async['$'](B){const Q=[B]['flat']();let a=this;for(const c of Q['keys']()){const X=Q[c],f=await a['execute'](findNodeBySelector,[X]);if(!f)return null;if(c<Q['length']-0x1)a=await f['getContentFrame']();else return f;}return null;}async['$$'](B){const Q=[B]['flat']();let a=[this];for(const c of Q['keys']()){const X=Q[c],f=await a['reduce'](async(J,Y)=>{const h=await Y['execute'](findNodesBySelector,[X]),V=await J;return V['push'](...h),V;},Promise['resolve']([]));if(f['length']===0x0)return[];if(c<Q['length']-0x1)a=await Promise['all'](f['map'](async J=>J['getContentFrame']()));else return f;}return[];}async['fetch'](B,Q={}){const a=this['target']['connection'],c={'disableCache':Q['disableCache']??![],'includeCredentials':Q['includeCredentials']??!![]};let X;try{X=await a['execute']('Network.loadNetworkResource',{'frameId':this['frameId'],'url':B,'options':c});}catch(K){throw new FrameFetchError(K instanceof Error?K['message']:String(K));}const {success:f,httpStatusCode:J,headers:Y,netErrorName:h,stream:V}=X['resource'];if(!f&&J===void 0x0)throw new FrameFetchError(h??'unknown');const k={};for(const [O,S]of Object['entries'](Y??{}))k[O['toLowerCase']()]=typeof S==='string'?S:String(S);let t;if(V)try{t=await buffer(makeRemoteStream(a,V));}catch(C){throw new FrameFetchError(C instanceof Error?C['message']:String(C));}else t=N['alloc'](0x0);return{'request':{'url':B,'method':'GET','headers':{},'body':()=>Promise['resolve'](new Uint8Array())},'status':J??0xc8,'headers':k,get 'body'(){return Readable['from'](t);},'arrayBuffer':()=>Promise['resolve'](new Uint8Array(t)['buffer']),'base64':()=>Promise['resolve'](t['toString']('base64'))};}async['execute'](B,Q,a){return this.#execute('isolated',B,Q,a);}async['defaultExecute'](B,Q,a){return this.#execute('default',B,Q,a);}async['evaluate'](B,Q){return this.#evaluate('isolated',B,Q);}async['defaultEvaluate'](B,Q){return this.#evaluate('default',B,Q);}async['resolve'](B){return this.#resolve('isolated',B);}async['defaultResolve'](B){return this.#resolve('default',B);}},FrameEvaluatorAttached=class extends Event{['evaluator'];constructor(B){super('evaluatorAttached'),this['evaluator']=B;}},FrameLifecycleEvent=class extends Event{constructor(B){super(B);}},FrameNavigatingEvent=class extends Event{['url'];['reason'];constructor({url:B,reason:Q}){super('navigating'),this['url']=B,this['reason']=Q;}},FrameNavigatedEvent=class extends Event{['url'];['reason'];['loaderId'];constructor({url:B,reason:Q,loaderId:a}){super('navigated'),this['url']=B,this['reason']=Q,this['loaderId']=a;}},FrameDocumentRequestEvent=class extends Event{['request'];constructor(B){super('request'),this['request']=B;}},FrameDocumentResponseEvent=class extends Event{['response'];constructor(B){super('response'),this['response']=B;}},FrameSwappingEvent=class extends Event{constructor(){super('swapping');}},FrameSwappedEvent=class extends Event{['target'];constructor(B){super('swapped'),this['target']=B;}},FrameDestroyedEvent=class extends Event{constructor(){super('destroyed');}};function makeLoader(B){return new Loader(B);}var Loader=class extends EventTargetNode{#frame;constructor({frame:B}){super(),this.#frame=B,this.#frame&&(this['on']('request',({resource:Q,request:a})=>{if(Q==='Document')this.#frame['dispatch'](new FrameDocumentRequestEvent(a));}),this['on']('response',({resource:Q,response:a})=>{if(Q==='Document')this.#frame['dispatch'](new FrameDocumentResponseEvent(a));}));}async*['responses'](){const B=makeWatcher();let Q=[];this['on']('response',({response:a})=>{Q['push'](a),B['resolve'](),B['reset']();});while(!![]){await B,yield*Q,Q=[];}}},LoaderRequestEvent=class extends Event{['requestId'];['request'];['resource'];constructor(B,{requestId:Q,resource:a},c){super('request',c),this['requestId']=Q,this['resource']=a,this['request']=B;}},LoaderResponseEvent=class extends Event{['requestId'];['response'];['resource'];constructor(B,{requestId:Q,resource:a},c){super('response',c),this['requestId']=Q,this['resource']=a,this['response']=B;}};function makeBlockingDialog(B){return new BlockingDialog(B);}var BlockingDialog=class extends EventTargetNode{#handled=![];['target'];['type'];['message'];constructor({target:B,type:Q,message:a}){super(),this['target']=B,this['type']=Q,this['message']=a;}get['handled'](){return this.#handled;}async['handle'](B,Q){log('dialogHandling',{'targetId':this['target']['targetId']}),this.#handled=!![],await this['target']['connection']['execute']('Page.handleJavaScriptDialog',{'accept':B,'promptText':Q}),this['dispatch'](new DialogHandledEvent());}};function makeFilepickerDialog(B){return new FilepickerDialog(B);}var FilepickerDialog=class extends EventTargetNode{#handled=![];['frame'];['element'];['multiple'];['accept'];['type']='filepicker';constructor({frame:B,element:Q,multiple:a,accept:c}){super(),this['frame']=B,this['element']=Q,this['multiple']=a,this['accept']=c;}get['handled'](){return this.#handled;}async['handle'](B){try{await this['element']['setValue'](B),this.#handled=!![],this['dispatch'](new DialogHandledEvent());}catch(Q){error('filepickerHandleFailed',{'error':Q});}}},DialogHandledEvent=class extends Event{constructor(){super('handled');}};function makeDebugger(B){return new Debugger(B);}var Debugger=class extends EventTargetNode{#watchers={'holds':new Set(),'paused':makeWatcher()};#initialize(){this['target']['connection']['on']('Debugger.paused',async()=>{log('debuggerPaused',{'targetId':this['target']['targetId'],'reason':this.#watchers['paused']['settled']?'manual':'programmatic'});if(this.#watchers['paused']['settled'])this.#watchers['paused']['reset']({'hint':'manual'});this['dispatch'](new DebuggerPausedEvent({'reason':this.#watchers['paused']['hint']}));}),this['target']['connection']['on']('Debugger.resumed',async()=>{log('debuggerResumed',{'targetId':this['target']['targetId']}),this.#watchers['paused']['resolve'](),this.#watchers['holds']['forEach'](B=>B['resolve']()),this.#watchers['holds']['clear'](),this['dispatch'](new DebuggerResumedEvent());}),this.#watchers['paused']['resolve']();}['target'];get['paused'](){return!this.#watchers['paused']['settled'];}constructor({target:B}){super(),this['target']=B,this['target']['wait']('initialized')['then'](()=>this.#initialize());}['hold'](){if(this.#watchers['paused']['settled'])return()=>void 0x0;const B=makeWatcher();return this.#watchers['holds']['add'](B),()=>{this.#watchers['holds']['delete'](B),B['resolve']();};}async['pause'](){this.#watchers['paused']['reset']({'hint':'programmatic'}),await this['target']['connection']['execute']('Debugger.pause'),this['target']['mainFrame']['defaultEvaluate']('1\x20+\x201')['catch'](()=>null);}async['resume'](){await Promise['allSettled'](this.#watchers['holds']);if(!this.#watchers['paused']['settled'])await this['target']['connection']['execute']('Debugger.resume',{'terminateOnResume':![]});}},DebuggerPausedEvent=class extends Event{['reason'];constructor({reason:B},Q){super('paused',Q),this['reason']=B;}},DebuggerResumedEvent=class extends Event{constructor(B){super('resumed',B);}};const us=buildLayout({'us':{'Escape':{'keyCode':0x1b,'key':'Escape'},'F1':{'keyCode':0x70,'key':'F1'},'F2':{'keyCode':0x71,'key':'F2'},'F3':{'keyCode':0x72,'key':'F3'},'F4':{'keyCode':0x73,'key':'F4'},'F5':{'keyCode':0x74,'key':'F5'},'F6':{'keyCode':0x75,'key':'F6'},'F7':{'keyCode':0x76,'key':'F7'},'F8':{'keyCode':0x77,'key':'F8'},'F9':{'keyCode':0x78,'key':'F9'},'F10':{'keyCode':0x79,'key':'F10'},'F11':{'keyCode':0x7a,'key':'F11'},'F12':{'keyCode':0x7b,'key':'F12'},'Backquote':{'keyCode':0xc0,'shiftKey':'~','key':'`'},'Digit1':{'keyCode':0x31,'shiftKey':'!','key':'1'},'Digit2':{'keyCode':0x32,'shiftKey':'@','key':'2'},'Digit3':{'keyCode':0x33,'shiftKey':'#','key':'3'},'Digit4':{'keyCode':0x34,'shiftKey':'$','key':'4'},'Digit5':{'keyCode':0x35,'shiftKey':'%','key':'5'},'Digit6':{'keyCode':0x36,'shiftKey':'^','key':'6'},'Digit7':{'keyCode':0x37,'shiftKey':'&','key':'7'},'Digit8':{'keyCode':0x38,'shiftKey':'*','key':'8'},'Digit9':{'keyCode':0x39,'shiftKey':'(','key':'9'},'Digit0':{'keyCode':0x30,'shiftKey':')','key':'0'},'Minus':{'keyCode':0xbd,'shiftKey':'_','key':'-'},'Equal':{'keyCode':0xbb,'shiftKey':'+','key':'='},'Backslash':{'keyCode':0xdc,'shiftKey':'|','key':'\x5c'},'Backspace':{'keyCode':0x8,'key':'Backspace'},'Tab':{'keyCode':0x9,'key':'Tab'},'KeyQ':{'keyCode':0x51,'shiftKey':'Q','key':'q'},'KeyW':{'keyCode':0x57,'shiftKey':'W','key':'w'},'KeyE':{'keyCode':0x45,'shiftKey':'E','key':'e'},'KeyR':{'keyCode':0x52,'shiftKey':'R','key':'r'},'KeyT':{'keyCode':0x54,'shiftKey':'T','key':'t'},'KeyY':{'keyCode':0x59,'shiftKey':'Y','key':'y'},'KeyU':{'keyCode':0x55,'shiftKey':'U','key':'u'},'KeyI':{'keyCode':0x49,'shiftKey':'I','key':'i'},'KeyO':{'keyCode':0x4f,'shiftKey':'O','key':'o'},'KeyP':{'keyCode':0x50,'shiftKey':'P','key':'p'},'BracketLeft':{'keyCode':0xdb,'shiftKey':'{','key':'['},'BracketRight':{'keyCode':0xdd,'shiftKey':'}','key':']'},'CapsLock':{'keyCode':0x14,'key':'CapsLock'},'KeyA':{'keyCode':0x41,'shiftKey':'A','key':'a'},'KeyS':{'keyCode':0x53,'shiftKey':'S','key':'s'},'KeyD':{'keyCode':0x44,'shiftKey':'D','key':'d'},'KeyF':{'keyCode':0x46,'shiftKey':'F','key':'f'},'KeyG':{'keyCode':0x47,'shiftKey':'G','key':'g'},'KeyH':{'keyCode':0x48,'shiftKey':'H','key':'h'},'KeyJ':{'keyCode':0x4a,'shiftKey':'J','key':'j'},'KeyK':{'keyCode':0x4b,'shiftKey':'K','key':'k'},'KeyL':{'keyCode':0x4c,'shiftKey':'L','key':'l'},'Semicolon':{'keyCode':0xba,'shiftKey':':','key':';'},'Quote':{'keyCode':0xde,'shiftKey':'\x22','key':'\x27'},'Enter':{'keyCode':0xd,'key':'Enter','text':'\x0d'},'ShiftLeft':{'keyCode':0xa0,'keyCodeWithoutLocation':0x10,'key':'Shift','location':0x1},'KeyZ':{'keyCode':0x5a,'shiftKey':'Z','key':'z'},'KeyX':{'keyCode':0x58,'shiftKey':'X','key':'x'},'KeyC':{'keyCode':0x43,'shiftKey':'C','key':'c'},'KeyV':{'keyCode':0x56,'shiftKey':'V','key':'v'},'KeyB':{'keyCode':0x42,'shiftKey':'B','key':'b'},'KeyN':{'keyCode':0x4e,'shiftKey':'N','key':'n'},'KeyM':{'keyCode':0x4d,'shiftKey':'M','key':'m'},'Comma':{'keyCode':0xbc,'shiftKey':'<','key':','},'Period':{'keyCode':0xbe,'shiftKey':'>','key':'.'},'Slash':{'keyCode':0xbf,'shiftKey':'?','key':'/'},'ShiftRight':{'keyCode':0xa1,'keyCodeWithoutLocation':0x10,'key':'Shift','location':0x2},'ControlLeft':{'keyCode':0xa2,'keyCodeWithoutLocation':0x11,'key':'Control','location':0x1},'MetaLeft':{'keyCode':0x5b,'key':'Meta','location':0x1},'AltLeft':{'keyCode':0xa4,'keyCodeWithoutLocation':0x12,'key':'Alt','location':0x1},'Space':{'keyCode':0x20,'key':'\x20'},'AltRight':{'keyCode':0xa5,'keyCodeWithoutLocation':0x12,'key':'Alt','location':0x2},'AltGraph':{'keyCode':0xe1,'key':'AltGraph'},'MetaRight':{'keyCode':0x5c,'key':'Meta','location':0x2},'ContextMenu':{'keyCode':0x5d,'key':'ContextMenu'},'ControlRight':{'keyCode':0xa3,'keyCodeWithoutLocation':0x11,'key':'Control','location':0x2},'PrintScreen':{'keyCode':0x2c,'key':'PrintScreen'},'ScrollLock':{'keyCode':0x91,'key':'ScrollLock'},'Pause':{'keyCode':0x13,'key':'Pause'},'PageUp':{'keyCode':0x21,'key':'PageUp'},'PageDown':{'keyCode':0x22,'key':'PageDown'},'Insert':{'keyCode':0x2d,'key':'Insert'},'Delete':{'keyCode':0x2e,'key':'Delete'},'Home':{'keyCode':0x24,'key':'Home'},'End':{'keyCode':0x23,'key':'End'},'ArrowLeft':{'keyCode':0x25,'key':'ArrowLeft'},'ArrowUp':{'keyCode':0x26,'key':'ArrowUp'},'ArrowRight':{'keyCode':0x27,'key':'ArrowRight'},'ArrowDown':{'keyCode':0x28,'key':'ArrowDown'},'NumLock':{'keyCode':0x90,'key':'NumLock'},'NumpadDivide':{'keyCode':0x6f,'key':'/','location':0x3},'NumpadMultiply':{'keyCode':0x6a,'key':'*','location':0x3},'NumpadSubtract':{'keyCode':0x6d,'key':'-','location':0x3},'Numpad7':{'keyCode':0x24,'shiftKeyCode':0x67,'key':'Home','shiftKey':'7','location':0x3},'Numpad8':{'keyCode':0x26,'shiftKeyCode':0x68,'key':'ArrowUp','shiftKey':'8','location':0x3},'Numpad9':{'keyCode':0x21,'shiftKeyCode':0x69,'key':'PageUp','shiftKey':'9','location':0x3},'Numpad4':{'keyCode':0x25,'shiftKeyCode':0x64,'key':'ArrowLeft','shiftKey':'4','location':0x3},'Numpad5':{'keyCode':0xc,'shiftKeyCode':0x65,'key':'Clear','shiftKey':'5','location':0x3},'Numpad6':{'keyCode':0x27,'shiftKeyCode':0x66,'key':'ArrowRight','shiftKey':'6','location':0x3},'NumpadAdd':{'keyCode':0x6b,'key':'+','location':0x3},'Numpad1':{'keyCode':0x23,'shiftKeyCode':0x61,'key':'End','shiftKey':'1','location':0x3},'Numpad2':{'keyCode':0x28,'shiftKeyCode':0x62,'key':'ArrowDown','shiftKey':'2','location':0x3},'Numpad3':{'keyCode':0x22,'shiftKeyCode':0x63,'key':'PageDown','shiftKey':'3','location':0x3},'Numpad0':{'keyCode':0x2d,'shiftKeyCode':0x60,'key':'Insert','shiftKey':'0','location':0x3},'NumpadDecimal':{'keyCode':0x2e,'shiftKeyCode':0x6e,'key':'\x00','shiftKey':'.','location':0x3},'NumpadEnter':{'keyCode':0xd,'key':'Enter','text':'\x0d','location':0x3}}}['us']);function buildLayout(B){const Q=new Map();for(const a in B){const c=B[a],X={'name':a,'key':c['key']||'','code':c['keyCodeWithoutLocation']||c['keyCode']||0x0,'text':c['text']??(c['key']['length']===0x1?c['key']:''),'modifier':['Shift','Control','Alt','Meta']['includes'](c['key']),'commands':c['commands']};let f;if(c['shiftKey']){f={...X},f['key']=c['shiftKey'],f['text']=c['shiftKey'];if(c['shiftKeyCode'])f['code']=c['shiftKeyCode'];}Q['set'](a,{...X,'shifted':f});if(X['key']['length']===0x1)Q['set'](X['key'],X);if(f)Q['set'](f['key'],f);}return Q;}function makeMouse(B){return new Mouse(B);}var Mouse=class{#target;#position=new Point(0x0,0x0);constructor({target:B}){this.#target=B;}get['position'](){return this.#position;}async['move'](B,{signal:Q}){const a=Array['isArray'](B)?B:[B];for(const c of a){const {x:X,y:f}=c,J=this.#position,Y=1.7,h=0x5,V=Math['hypot'](X-J['x'],f-J['y'])/Y,k=Math['ceil'](V/h);for(let K=0x0;K<k;K++){Q?.['throwIfAborted']();const O=K/k,S=lerp(J['x'],X,O),C=lerp(J['y'],f,O);await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseMoved','x':S,'y':C},{'signal':Q}),await o(h,void 0x0,{'signal':Q});}await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseMoved','x':X,'y':f},{'signal':Q}),this.#position=new Point(X,f);}}async['click']({x:B,y:Q},{button:button='left',times:times=0x1}={}){await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mousePressed','x':B,'y':Q,'button':button,'clickCount':times}),await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseReleased','x':B,'y':Q,'button':button,'clickCount':times}),this.#position=new Point(B,Q);}};function makeKeyboard(B){return new Keyboard(B);}const SLOW_TYPING_BUDGET_MS=0x7d0,WHITESPACE_CONTROL=/[\n\r\t]/;var Keyboard=class{#target;#pressed={'modifiers':new Set(),'keys':new Set()};constructor({target:B}){this.#target=B;}async['press'](B,{raw:Q,commands:a}={}){await this['down'](B,{'raw':Q,'commands':a}),await o(0xa),await this['up'](B);}async['down'](B,{raw:Q,commands:a}={}){for(const c of Array['isArray'](B)?B:[B]){let X=us['get'](c);if(!X)throw new Error('Unknown\x20key\x20\x22'+c+'\x22');if(this.#pressed['modifiers']['has']('Shift')&&X['shifted'])X=X['shifted'];Q=!X['text']||Q&&X['key']!==X['text'],await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':Q?'rawKeyDown':'keyDown','modifiers':toModifiersMask(this.#pressed['modifiers']),'windowsVirtualKeyCode':X['code'],'nativeVirtualKeyCode':X['code'],'code':X['name'],'key':X['key'],'text':Q?'':X['text'],'unmodifiedText':Q?'':X['text'],'commands':[...a??[],...X['commands']??[]]});if(X['modifier'])this.#pressed['modifiers']['add'](X['key']);else this.#pressed['keys']['add'](X['key']);}}async['up'](B){for(const Q of Array['isArray'](B)?B['toReversed']():[B]){const a=us['get'](Q);if(!a)throw new Error('Unknown\x20key\x20\x22'+Q+'\x22');await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':'keyUp','modifiers':toModifiersMask(this.#pressed['modifiers']),'windowsVirtualKeyCode':a['code'],'nativeVirtualKeyCode':a['code'],'code':a['name'],'key':a['key']});if(a['modifier'])this.#pressed['modifiers']['delete'](a['key']);else this.#pressed['keys']['delete'](a['key']);}}async['type'](B,{signal:Q}={}){const a=[...B];let c=0x0;for(let X=0x0;X<a['length'];X++){const f=a[X],J=Date['now']();if(us['has'](f))await this['press'](f);else{if(WHITESPACE_CONTROL['test'](f))await this.#target['connection']['execute']('Input.insertText',{'text':f});else await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':'char','text':f});}c+=Date['now']()-J,Q?.['throwIfAborted']();if(c>SLOW_TYPING_BUDGET_MS&&X<a['length']-0x1)return this['insert'](a['slice'](X+0x1)['join'](''));await o(0x64);}}async['insert'](B,{keys:Q}={}){if(Q)await this['press'](Q);const a=[...B],c=us['has'](a['at'](-0x1)??'')?a['pop']():void 0x0;if(a['length']>0x0)await this.#target['connection']['execute']('Input.insertText',{'text':a['join']('')});if(c)await this['press'](c);}};function toModifiersMask(B){let Q=0x0;if(B['has']('Alt'))Q|=0x1;if(B['has']('Control'))Q|=0x2;if(B['has']('Meta'))Q|=0x4;if(B['has']('Shift'))Q|=0x8;return Q;}function lerp(B,Q,a){return B*(0x1-a)+Q*a;}function makeInjection(B){return new Injection(B);}var Injection=class extends EventTargetNode{#targets=new Set();#evaluators=new Map();#isolated=!![];#deep=!![];#watchers={'injected':makeWatcher()};async #inject(B){try{log('injectionStarted',{'name':this['name'],'targetId':B['targetId']}),await B['wait']('initialized'),this.#targets['add'](B),B['on']('closed',()=>this.#targets['delete'](B));for(const Q of B['frames']()){if(!this.#isolated&&Q['defaultEvaluator'])await this.#attach(Q['defaultEvaluator']);Q['on']('evaluatorAttached',async({evaluator:a})=>{if(this.#isolated?a['name']===this['name']:a['type']==='default')await this.#attach(a);});}B['on']('frameAttached',({frame:a})=>{a['on']('evaluatorAttached',async({evaluator:c})=>{if(this.#isolated?c['name']===this['name']:c['type']==='default')await this.#attach(c);});}),B['connection']['on']('Runtime.bindingCalled',({executionContextId:a,name:c,payload:X})=>{if(c===this['binding']){const f=this.#evaluators['get'](B['targetId']+':'+a);if(f){const J=JSON['parse'](X);this['dispatch'](new InjectionIncommingMessageEvent(f,J['name'],J['payload']));}}}),await B['connection']['execute']('Runtime.addBinding',{'name':this['binding'],'executionContextName':this.#isolated?this['name']:void 0x0}),await B['connection']['execute']('Page.addScriptToEvaluateOnNewDocument',{'source':await makeExpression(this['expression'])['compile'](),'worldName':this.#isolated?this['name']:void 0x0,'runImmediately':!![]}),this['dispatch'](new InjectionTargetAttachedEvent(B)),this.#deep&&(B['on']('frameTargetCreated',async({target:a})=>this.#inject(a)),await Promise['all'](Array['from'](B['targets'](),async a=>this.#inject(a))));}catch(a){if(a instanceof AbortError)log('injectionTargetAborted',{'name':this['name'],'targetId':B['targetId'],'error':a});else throw a;}}async #attach(B){log('injectionEvaluatorAttached',{'name':this['name'],'evaluatorId':B['evaluatorId'],'evaluatorName':B['name'],'frameId':B['frame']?.['frameId']}),this.#evaluators['set'](B['target']['targetId']+':'+B['evaluatorId'],B),B['on']('destroyed',({evaluatorId:Q})=>this.#evaluators['delete'](B['target']['targetId']+':'+Q)),this['dispatch'](new InjectionEvaluatorAttachedEvent(B));}['name'];['binding'];['expression'];constructor({target:B,expression:Q,name:a,deep:c,isolated:X}){super(),a??=Q instanceof Expression?Q['name']:a;if(!a)throw new Error('Cannot\x20create\x20an\x20injection\x20without\x20a\x20name');this['expression']=Q,this['name']=a,this['binding']='__'+a['replaceAll']('\x20','_')+'_post_message',this.#deep=c??!![],this.#isolated=X??!![],this['cork'](),this.#inject(B)['then'](()=>{this.#watchers['injected']['resolve']();})['catch'](f=>{this.#watchers['injected']['reject'](f);if(f instanceof AbortError)log('injectionAborted',{'targetId':B['targetId'],'error':f});else error('injectionFailed',{'targetId':B['targetId'],'error':f});})['finally'](()=>nextTick(()=>this['uncork']())),this['on']('outgoingMessage',async({name:f,payload:J,filter:Y})=>{try{await this['execute']((h,V,k)=>{const t=globalThis,K=t['ports']?.[h];if(K)setTimeout(()=>K['dispatchEvent'](new t['PortIncommingMessageEvent'](V,k)),0x0);},[this['name'],f,J],{'filter':Y});}catch(h){error('injectionPortSendFailed',{'portName':this['name'],'messageName':f,'error':h});}});}*['targets'](){yield*this.#targets['values']();}async['wait'](B){await this.#watchers[B];}async['execute'](B,Q,a){let c=Array['from'](this.#evaluators['values']());if(a?.['filter'])c=c['filter'](a['filter']);return Promise['all'](c['map'](X=>X['execute'](B,Q,a)));}async['evaluate'](B,Q){let a=Array['from'](this.#evaluators['values']());if(Q?.['filter'])a=a['filter'](Q['filter']);return Promise['all'](a['map'](c=>c['evaluate'](B,Q)));}['send'](B,Q,a){this['dispatch'](new InjectionOutgoingMessageEvent(B,Q,a));}},InjectionTargetAttachedEvent=class extends Event{['target'];constructor(B){super('evaluatorAttached'),this['target']=B;}},InjectionEvaluatorAttachedEvent=class extends Event{['evaluator'];constructor(B){super('evaluatorAttached'),this['evaluator']=B;}},InjectionOutgoingMessageEvent=class extends Event{['name'];['payload'];['filter'];constructor(B,Q,a){super('outgoingMessage'),this['name']=B,this['payload']=Q,this['filter']=a?.['filter'];}},InjectionIncommingMessageEvent=class extends Event{['evaluator'];['name'];['payload'];constructor(B,Q,a){super('incommingMessage'),this['evaluator']=B,this['name']=Q,this['payload']=a;}};function makeRequestsTracker(){return new RequestsTracker();}var RequestsTracker=class{#requestsWatchers=new Map();#allDoneWatcher=makeWatcher();get['pending'](){return this.#allDoneWatcher['settled'];}get[Symbol['toStringTag']](){return'RequestTracker';}constructor(){this.#allDoneWatcher['resolve']();}async['wait'](){await this.#allDoneWatcher;}['track'](B,Q){this.#requestsWatchers['set'](B,Q);if(this.#allDoneWatcher['settled'])this.#allDoneWatcher['reset']();Q['finally'](()=>{if(this.#requestsWatchers['get'](B)===Q)this['untrack'](B);});}['untrack'](B){const Q=this.#requestsWatchers['delete'](B);if(Q&&this.#requestsWatchers['size']===0x0)this.#allDoneWatcher['resolve']();return Q;}['resolveBy'](B){this.#requestsWatchers['get'](B)?.['resolve']();}['debounceBy'](B,Q){this.#requestsWatchers['get'](B)?.['resolve'](void 0x0,{'delay':Q,'key':'debounce'});}};function makeIntercepted(B){if(B['intercepted']['responseStatusCode']===void 0x0&&B['intercepted']['responseErrorReason']===void 0x0)return makeInterceptedRequest(B);return makeInterceptedResponse(B);}var Intercepted=class{['_handled']=![];['target'];['frame'];['requestId'];['stage'];['resource'];constructor({target:B,intercepted:Q}){this['target']=B,this['frame']=B['browser']['frameManager']['get'](Q['frameId']),this['requestId']=Q['requestId'],this['resource']=Q['resourceType'],this['stage']=Q['responseStatusCode']===void 0x0&&Q['responseErrorReason']===void 0x0?'request':'response';}get['handled'](){return this['_handled'];}async['fulfill']({status:B,headers:Q,body:a}){await this['target']['connection']['execute']('Fetch.fulfillRequest',{'requestId':this['requestId'],'responseCode':B,'responseHeaders':Q&&Object['entries'](Q)['map'](([c,X])=>({'name':c,'value':X})),'body':a&&N['from'](a)['toString']('base64')}),this['_handled']=!![];}};function makeInterceptedRequest(B){return new InterceptedRequest(B);}var InterceptedRequest=class extends Intercepted{#networkId;#body;['stage']='request';['url'];['method'];['headers'];constructor({target:B,intercepted:Q}){super({'target':B,'intercepted':Q}),this['url']=Q['request']['url']+(Q['request']['urlFragment']??''),this['method']=Q['request']['method'],this['headers']=Q['request']['headers'],this.#networkId=Q['networkId'];if(!Q['request']['hasPostData'])this.#body=new Uint8Array();else{if(Q['request']['postDataEntries']?.['length'])this.#body=N['concat'](Q['request']['postDataEntries']['map'](a=>N['from'](a['bytes']??'','base64')));}}async['continue']({headers:B,url:Q,method:a,body:c,interceptResponse:X}={}){await this['target']['connection']['execute']('Fetch.continueRequest',{'requestId':this['requestId'],'headers':B&&Object['entries'](B)['map'](([f,J])=>({'name':f,'value':J})),'url':Q,'method':a,'postData':c!==void 0x0?N['from'](c)['toString']('base64'):void 0x0,'interceptResponse':X}),this['_handled']=!![];}async['body'](){if(this.#body)return this.#body;if(this.#networkId){const {postData:B}=await this['target']['connection']['execute']('Network.getRequestPostData',{'requestId':this.#networkId});return new TextEncoder()['encode'](B);}return new Uint8Array();}};function makeInterceptedResponse(B){return new InterceptedResponse(B);}var InterceptedResponse=class extends Intercepted{#consumed=![];['stage']='response';['request'];['status'];['error'];['headers'];['body'];constructor({target:B,intercepted:Q}){if(Q['responseStatusCode']===void 0x0&&Q['responseErrorReason']===void 0x0)throw new Error('InterceptedResponse\x20requires\x20a\x20response-stage\x20Fetch\x20event');super({'target':B,'intercepted':Q}),this['status']=Q['responseStatusCode']??-0x1,this['error']=Q['responseErrorReason'],this['headers']=Object['fromEntries']((Q['responseHeaders']??[])['map'](({name:a,value:c})=>[a,c])),this['request']=makeInterceptedRequest({'target':B,'intercepted':Q}),this['body']=makeRemoteStream(this['target']['connection'],async()=>{this.#assertNotConsumed('body'),this.#consumed=!![];const {stream:a}=await this['target']['connection']['execute']('Fetch.takeResponseBodyAsStream',{'requestId':this['requestId']});return a;});}async['continue'](){await this['target']['connection']['execute']('Fetch.continueResponse',{'requestId':this['requestId']}),this['_handled']=!![];}async['arrayBuffer'](){this.#assertNotConsumed('arrayBuffer'),this.#consumed=!![];const {body:B,base64Encoded:Q}=await this['target']['connection']['execute']('Fetch.getResponseBody',{'requestId':this['requestId']}),a=Q?N['from'](B,'base64'):N['from'](B,'utf8');return new Uint8Array(a)['buffer'];}async['base64'](){this.#assertNotConsumed('base64'),this.#consumed=!![];const {body:B,base64Encoded:Q}=await this['target']['connection']['execute']('Fetch.getResponseBody',{'requestId':this['requestId']});return Q?B:N['from'](B,'utf8')['toString']('base64');}#assertNotConsumed(B){if(this.#consumed)throw new BodyConsumedError({'accessor':B});}};function makeInterceptionPatternMatcher(B){const Q=[];if(B['url'])Q['push'](a=>B['url']['test'](a['request']['url']+(a['request']['urlFragment']??'')));if(B['resource'])Q['push'](a=>B['resource']['includes'](a['resourceType']));if(B['stage'])Q['push'](a=>B['stage']['includes'](a['responseStatusCode']===void 0x0&&a['responseErrorReason']===void 0x0?'request':'response'));return a=>Q['every'](c=>c(a));}function toCDPPattern(B){const Q=B['resource']??[void 0x0],a=B['stage']??['request'],c=[];for(const X of Q)for(const f of a)c['push']({'urlPattern':'*',...X&&{'resourceType':X},'requestStage':f==='response'?'Response':'Request'});return c;}var StylesheetHandle=class{['stylesheetId'];['frame'];['url'];['inline'];['constructed'];['ownerNode'];constructor({stylesheetId:B,frame:Q,url:a,inline:c,constructed:X,ownerNode:f}){this['stylesheetId']=B,this['frame']=Q,this['url']=a,this['inline']=c,this['constructed']=X,this['ownerNode']=f;}async['text'](){const {text:B}=await this['frame']['target']['connection']['execute']('CSS.getStyleSheetText',{'styleSheetId':this['stylesheetId']});return B;}};function makeTarget(B){return new Target(B);}var Target=class extends EventTargetNode{#connection;#browser;#evaluator;#url;#title;#mode='normal';#filepickersHidden=![];#loaders=new Map();#dialog=null;#injections=new Map();#visible=void 0x0;#controller=new AbortController();#watchers={'attached':makeWatcher(),'initialized':makeWatcher(),'navigated':makeWatcher({'hint':'chrome'}),'dialogOpened':makeWatcher(),'windowResolved':makeWatcher()};#window;#requestsTracker=makeRequestsTracker();#requestInterceptors=new Set();#filepickerHandlers=new Set();async #initialize(B){try{this.#connection=makeConnection({'socket':this.#browser['connection']['socket'],'signal':this.#controller['signal'],'sessionId':B}),this.#watchers['attached']['resolve'](),await setImmediate();if(this['mainFrame'])this['dispatch'](new TargetMainFrameReadyEvent(this['mainFrame']));this['kind']==='renderer'&&(this.#handleExistentFrames()['catch'](Q=>{error('framesExtractionFailed',{'targetId':this['targetId'],'error':Q});}),this.#resolveWindow()['catch'](Q=>{error('windowResolutionFailed',{'targetId':this['targetId'],'error':Q}),this.#watchers['windowResolved']['reject'](Q);}),this['connection']['on']('Overlay.inspectNodeRequested',async({backendNodeId:Q})=>{if(this.#mode==='element\x20selection')this['dispatch'](new TargetElementSelectedEvent(await this['resolve']({'nodeId':Q})));}),this['connection']['on']('Page.frameAttached',({frameId:Q,parentFrameId:a})=>{if(this.#browser['frameManager']['has'](Q)){log('frameAttached',{'frameId':Q,'parentFrameId':a,'reattached':!![]});const c=this.#browser['frameManager']['get'](Q);c['dispatch'](new FrameSwappingEvent()),c['dispatch'](new FrameSwappedEvent(this));}else{log('frameAttached',{'frameId':Q,'parentFrameId':a,'reattached':![]});const X=makeFrame({'target':this,'frameId':Q,'parentFrameId':a});this.#browser['frameManager']['add'](X),this['dispatch'](new TargetFrameAttachedEvent(X));}}),this['connection']['on']('Page.frameDetached',({frameId:Q,reason:a})=>{const c=this.#browser['frameManager']['get'](Q);if(a==='remove'){log('frameRemoved',{'frameId':Q});if(!c)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20is\x20removed\x20but\x20the\x20frame\x20wasn\x27t\x20found');c['dispatch'](new FrameDestroyedEvent()),this.#browser['frameManager']['delete'](Q);}else{if(a==='swap'){log('frameSwapped',{'frameId':Q,'ownTargetFound':!![]});if(!c)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20is\x20swapped\x20but\x20the\x20frame\x20wasn\x27t\x20found');const X=this.#browser['targetManager']['get'](Q);if(!X)return log('frameSwapped',{'frameId':Q,'ownTargetFound':![]});c['dispatch'](new FrameSwappedEvent(X));}}}),this['connection']['on']('Page.frameRequestedNavigation',async({frameId:Q,reason:a,url:c})=>{log('frameNavigationRequested',{'frameId':Q,'url':c,'reason':a});const X=this.#browser['frameManager']['get'](Q);if(!X)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20requested\x20navigation\x20but\x20the\x20frame\x20wasn\x27t\x20found');X['dispatch'](new FrameNavigatingEvent({'url':c,'reason':a}));}),this['connection']['on']('Page.frameNavigated',({frame:{id:Q,url:a,loaderId:c},type:X})=>{log('frameNavigated',{'frameId':Q,'url':a,'navigationType':X});const f=this.#browser['frameManager']['get'](Q);if(!f)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20is\x20navigated\x20but\x20the\x20frame\x20wasn\x27t\x20found');this.#browser['frameManager']['deleteDescendants'](Q),f['dispatch'](new FrameNavigatedEvent({'url':a,'reason':X==='Navigation'?'remote':'restoration','loaderId':c}));}),this['connection']['on']('Page.navigatedWithinDocument',({frameId:Q,url:a})=>{log('frameNavigatedWithinDocument',{'frameId':Q,'url':a});const c=this.#browser['frameManager']['get'](Q);if(!c)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20is\x20navigated\x20within\x20document\x20but\x20the\x20frame\x20wasn\x27t\x20found');c['dispatch'](new FrameNavigatedEvent({'url':a,'reason':'local','loaderId':''}));}),this['connection']['on']('Page.frameStartedLoading',({frameId:Q})=>{log('frameLoadingStarted',{'frameId':Q});const a=this.#browser['frameManager']['get'](Q);if(!a)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20started\x20loading\x20but\x20the\x20frame\x20wasn\x27t\x20found');a['dispatch'](new FrameLifecycleEvent('loading'));}),this['connection']['on']('Page.frameStoppedLoading',({frameId:Q})=>{log('frameLoadingStopped',{'frameId':Q});const a=this.#browser['frameManager']['get'](Q);if(!a)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20stopped\x20loading\x20but\x20the\x20frame\x20wasn\x27t\x20found');a['dispatch'](new FrameLifecycleEvent('loaded'));}),this['connection']['on']('Page.lifecycleEvent',({frameId:Q,name:a})=>{log('frameLifecycleEvent',{'frameId':Q,'name':a});const c=this.#browser['frameManager']['get'](Q);if(!c)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20fired\x20a\x20lifecycle\x20event\x20but\x20the\x20frame\x20wasn\x27t\x20found');if(a==='load'&&!this.#watchers['initialized']['settled'])c['dispatch'](new FrameLifecycleEvent('loaded'));else{if(a==='networkAlmostIdle')c['dispatch'](new FrameLifecycleEvent('networkAlmostIdle'));else{if(a==='networkIdle')c['dispatch'](new FrameLifecycleEvent('networkIdle'));}}}),this['connection']['on']('Page.javascriptDialogOpening',({type:Q,message:a})=>{log('dialogOpened',{'dialogType':Q,'message':a}),this.#dialog=makeBlockingDialog({'target':this,'type':Q,'message':a}),this.#watchers['dialogOpened']['resolve'](),this['dispatch'](new TargetDialogEvent('opened',this.#dialog));}),this['connection']['on']('Page.javascriptDialogClosed',({result:Q,userInput:a})=>{log('dialogClosed',{}),this.#watchers['dialogOpened']['reset'](),this['dispatch'](new TargetDialogEvent('closed',this.#dialog,{'result':Q,'value':a})),this.#dialog=null;}),this['connection']['on']('Page.fileChooserOpened',async({frameId:Q,backendNodeId:a,mode:c})=>{log('filepickerOpened',{'frameId':Q});const X=this.#browser['frameManager']['get'](Q);if(!X)throw new Error('Filepicker\x20dialog\x20opened\x20in\x20frame\x20with\x20id\x20\x22'+Q+'\x22\x20but\x20the\x20frame\x20wasn\x27t\x20found');const f=a?await X['resolve']({'nodeId':a}):await X['defaultExecute'](()=>globalThis['__mockFilepicker']),J=c==='selectMultiple',Y=await f?.['execute'](h=>h['accept'])??'';this.#dialog=makeFilepickerDialog({'frame':X,'element':f,'multiple':J,'accept':Y}),this.#dialog['once']('handled',()=>this.#dialog=null);if(this.#filepickerHandlers['size']>0x0)for(const h of this.#filepickerHandlers){await h(this.#dialog);if(this.#dialog['handled'])break;}else this.#watchers['dialogOpened']['resolve'](),this['dispatch'](new TargetFilepickerDialogEvent(this.#dialog));}),this['connection']['on']('Page.windowOpen',async()=>{log('childTargetCreated',{'targetId':this['targetId']}),this['dispatch'](new TargetChildTargetCreatingEvent());}),this['connection']['on']('CSS.styleSheetAdded',({header:Q})=>{if(Q['origin']==='user-agent'||Q['origin']==='inspector')return;const a=this.#browser['frameManager']['get'](Q['frameId']);if(!a)return;a['addStylesheet'](new StylesheetHandle({'stylesheetId':Q['styleSheetId'],'frame':a,'url':Q['sourceURL'],'inline':Q['isInline'],'constructed':Q['isConstructed'],'ownerNode':Q['ownerNode']}));}),this['connection']['on']('CSS.styleSheetRemoved',({styleSheetId:Q})=>{for(const a of this['frames']())if(a['removeStylesheet'](Q))break;})),this['connection']['on']('Target.attachedToTarget',async({sessionId:Q,targetInfo:a})=>{log('targetAttached',{'targetId':a['targetId'],'targetType':a['type'],'parentTargetId':this['targetId'],'sessionId':Q});if(a['type']==='worker'){await makeConnection({'socket':this.#browser['connection']['socket'],'sessionId':Q})['execute']('Runtime.runIfWaitingForDebugger')['catch'](c=>{error('workerResumeFailed',{'targetId':a['targetId'],'error':c});});return;}this.#browser['targetManager']['get'](a['targetId'])?.['dispatch'](new TargetAttachedEvent(Q));}),this['connection']['on']('Runtime.executionContextCreated',({context:Q})=>{if(Q['auxData']?.['frameId']){log('executionContextCreated',{'contextId':Q['id'],'contextName':Q['name'],'frameId':Q['auxData']['frameId']});const a=this['browser']['frameManager']['get'](Q['auxData']['frameId']);if(!a)throw new Error('Execution\x20context\x20with\x20id\x20\x22'+Q['id']+'\x22\x20and\x20name\x20\x22'+Q['name']+'\x22\x20is\x20created\x20for\x20frame\x20with\x20id\x20\x22'+Q['auxData']['frameId']+'\x22\x20but\x20the\x20frame\x20wasn\x27t\x20found');const c=makeEvaluator({'frame':a,'name':Q['name'],'evaluatorId':Q['id'],'type':Q['auxData']['type']});a['dispatch'](new FrameEvaluatorAttached(c));}else log('executionContextCreated',{'contextId':Q['id'],'targetId':this['targetId']}),this.#evaluator=makeEvaluator({'target':this,'name':Q['name'],'evaluatorId':Q['id'],'type':'default'});}),this['connection']['on']('Network.requestWillBeSent',({loaderId:Q,frameId:a,requestId:c,type:X,request:f,hasUserGesture:J})=>{if(X==='Document')log('requestSent',{'frameId':a,'url':f['url'],'kind':'navigation','resourceType':X});else{if(f['url']['startsWith']('blob:'))log('requestSent',{'frameId':a,'url':f['url'],'kind':'blob','resourceType':X});else{if(J){const h=!isNonBlockingRequest(X,f['url']);log('requestSent',{'targetId':this['targetId'],'url':f['url'],'kind':'userInitiated','resourceType':X,'tracked':h});if(h)this.#requestsTracker['track'](c,makeWatcher()['resolve'](void 0x0,{'delay':0x9c40}));}else{if(a){const V=this.#browser['frameManager']['get'](a);if(V&&Date['now']()-V['navigatedAt']<0xbb8){const k=!isNonBlockingRequest(X,f['url']);log('requestSent',{'frameId':a,'url':f['url'],'kind':'frameSubresource','resourceType':X,'tracked':k});if(k)this.#requestsTracker['track'](c,makeWatcher()['resolve'](void 0x0,{'delay':0x2710}));}}}}}let Y=this.#loaders['get'](Q);if(!Y){if(a){const t=this.#browser['frameManager']['get'](a);if(!t)throw new Error('Frame\x20with\x20id\x20\x22'+a+'\x22\x20received\x20a\x20response\x20but\x20the\x20frame\x20wasn\x27t\x20found');Y=makeLoader({'loaderId':Q,'frame':t});}else Y=makeLoader({'loaderId':Q});this.#loaders['set'](Q,Y);}Y['dispatch'](new LoaderRequestEvent(f,{'requestId':c,'resource':X??'Other'}));}),this['connection']['on']('Network.responseReceived',({loaderId:Q,frameId:a,requestId:c,type:X,response:f})=>{let J=this.#loaders['get'](Q);if(!J){if(a){const V=this.#browser['frameManager']['get'](a);if(!V)throw new Error('Frame\x20with\x20id\x20\x22'+a+'\x22\x20received\x20a\x20response\x20but\x20the\x20frame\x20wasn\x27t\x20found');J=makeLoader({'loaderId':Q,'frame':V});}else J=makeLoader({'loaderId':Q});this.#loaders['set'](Q,J);}J['dispatch'](new LoaderResponseEvent(f,{'requestId':c,'resource':X}));const Y=[/^text\/event-stream$/,/^application\/octet-stream$/,/video\/*/],h=f['headers']['content-type']||'';if(Y['some'](k=>k['test'](h)))this.#requestsTracker['resolveBy'](c);else this.#requestsTracker['debounceBy'](c,0xbb8);}),this['connection']['on']('Network.dataReceived',({requestId:Q})=>{this.#requestsTracker['debounceBy'](Q,0xbb8);}),this['connection']['on']('Network.loadingFinished',({requestId:Q})=>{this.#requestsTracker['resolveBy'](Q);}),this['connection']['on']('Network.loadingFailed',({requestId:Q})=>{this.#requestsTracker['resolveBy'](Q);}),this['connection']['on']('Fetch.requestPaused',async Q=>{const a=makeIntercepted({'target':this,'intercepted':Q});for(const {matchers:c,handler:X}of this.#requestInterceptors){if(!c['some'](f=>f(Q)))continue;await X(a);if(a['handled'])return;}await a['continue']();}),await Promise['all']([this['kind']==='renderer'&&this['connection']['execute']('Page.enable',{'enableFileChooserOpenedEvent':!![]}),this['kind']==='renderer'&&this['connection']['execute']('Page.setLifecycleEventsEnabled',{'enabled':!![]}),this['connection']['execute']('Network.enable'),this['connection']['execute']('Runtime.enable'),this['kind']==='renderer'&&this['connection']['execute']('DOM.enable'),this['kind']==='renderer'&&this['connection']['execute']('Overlay.enable'),this['kind']==='renderer'&&this['connection']['execute']('CSS.enable'),this['kind']==='renderer'&&this['connection']['execute']('Target.setAutoAttach',{'autoAttach':!![],'flatten':!![],'filter':[{'type':'page'},{'type':'iframe'},{'type':'worker'}],'waitForDebuggerOnStart':!![]}),this['connection']['execute']('Runtime.runIfWaitingForDebugger')]);}catch(Q){if(Q instanceof AbortError)log('targetInitAborted',{'targetId':this['targetId'],'error':Q});else throw Q;}this.#watchers['initialized']['resolve']();if(!this.#browser['headless']&&this['kind']==='renderer'&&this['type']!=='iframe')this.#trackVisibility()['catch'](a=>{error('visibilityTrackingFailed',{'targetId':this['targetId'],'error':a});});this.#mockProgrammaticFilepickers()['catch'](a=>{error('filepickerMockingFailed',{'targetId':this['targetId'],'error':a});});if(this['kind']==='renderer')this['hideFilepickers'](this.#browser['filepickersHidden']);}async #resolveWindow(){const {windowId:B}=await this.#browser['connection']['execute']('Browser.getWindowForTarget',{'targetId':this['targetId']});this.#window=this.#browser['windowManager']['getOrCreate']({'windowId':B,'browser':this.#browser}),this.#window['dispatch'](new WindowTargetAttachedEvent(this)),this.#watchers['windowResolved']['resolve']();}async #handleExistentFrames(){const {frameTree:B}=await this['connection']['execute']('Page.getFrameTree'),Q=[B];for(let a=0x0;a<Q['length'];++a){const c=Q[a];if(!this.#browser['frameManager']['has'](c['frame']['id'])){const X=makeFrame({'target':this,'frameId':c['frame']['id'],'parentFrameId':c['frame']['parentId']??null});this.#browser['frameManager']['add'](X),this['dispatch'](new TargetFrameAttachedEvent(X));if(X['frameId']===this['targetId'])this['dispatch'](new TargetMainFrameReadyEvent(this['mainFrame']));}if(c['childFrames'])Q['push'](...c['childFrames']);}}async #trackVisibility(){const B=await this['inject'](visibilityTracker,{'name':'visibility_tracker','deep':![]});this.#visible=![],B['on']('incommingMessage',({name:Q,payload:a})=>{if(Q==='visibilityChanged'){log('targetVisibilityChanged',{'targetId':this['targetId'],'visibility':a});const c=a==='visible';this.#visible!==c&&(this.#visible=c,this['dispatch'](new TargetVisibilityChangeEvent(a)));}}),this['on']('childTargetCreating',async()=>B['send']('childTargetCreating',void 0x0));}async #mockProgrammaticFilepickers(){await this['inject'](filepickerMocker,{'name':'filepicker_mocker','isolated':![]});}['targetId'];['type'];['kind'];['createdAt']=Date['now']();['parent'];['debugger']=makeDebugger({'target':this});['mouse']=makeMouse({'target':this});['keyboard']=makeKeyboard({'target':this});get['initialized'](){return this.#watchers['initialized']['settled'];}get['attached'](){return!!this.#connection;}get['navigated'](){return this.#watchers['initialized']['settled']&&this.#watchers['navigated']['settled'];}get['stable'](){return this.#watchers['initialized']['settled']&&this.#watchers['navigated']['settled']&&(this['mainFrame']['stable']||this.#watchers['dialogOpened']['settled']);}get['pendingRequests'](){return this.#requestsTracker['pending'];}get['download'](){const B=this['mainFrame']['response']?.['headers']??{};return!!(Object['entries'](B)['find'](([Q])=>Q['toLowerCase']()==='content-disposition')?.[0x1])?.['startsWith']('attachment');}get['visible'](){return this.#visible;}get['mode'](){return this.#mode;}get['title'](){return this.#title;}get['url'](){return this.#url;}get['connection'](){return this.#connection;}get['browser'](){return this.#browser;}get['window'](){return this.#window;}get['popup'](){return!!this['parent']&&this['window']!==this['parent']['window'];}get['mainFrame'](){return this.#browser['frameManager']['get'](this['targetId']);}get['dialog'](){return this.#dialog;}get['injections'](){return Object['fromEntries'](this.#injections['entries']());}constructor({browser:B,parent:Q,targetId:a,type:c,url:X,title:f}){super(),this.#browser=B,this.#url=X,this.#title=f,this['parent']=Q,this['targetId']=a,this['type']=c,this['kind']=c==='page'||c==='iframe'||c==='other'&&X['startsWith']('devtools:')?'renderer':'worker';if(this['type']==='page'){const J=makeFrame({'target':this,'frameId':this['targetId'],'parentFrameId':null});this.#browser['frameManager']['add'](J);}else{if(this['type']==='iframe'){const Y=this.#browser['frameManager']['get'](this['targetId']);if(Y){const h=Y['target'];Y['dispatch'](new FrameSwappingEvent()),this['on']('detached',()=>Y['dispatch'](new FrameSwappedEvent(h)));}}}if(this.#browser['headless'])this.#visible=!![];this['on']('attached',({sessionId:V})=>{this.#initialize(V);}),this['on']('changed',({url:V,title:k})=>{this.#url=V,this.#title=k;}),this['on']('closed',()=>{this.#controller['abort'](new AbortError('Target\x20with\x20id\x20\x22'+this['targetId']+'\x22\x20and\x20of\x20type\x20\x22'+this['type']+'\x22\x20is\x20closed\x20in\x20the\x20middle\x20of\x20operation'));if(this.#window)this.#window['dispatch'](new WindowTargetDetachedEvent(this));}),this['on']('dialogOpened',()=>{this['connection']['flush'](new FlushError('Target\x20with\x20id\x20\x22'+this['targetId']+'\x22\x20and\x20of\x20type\x20\x22'+this['type']+'\x22\x20is\x20blocked\x20due\x20to\x20dialog\x20opening'));}),this['on']('mainFrameReady',()=>{this['mainFrame']['on']('navigating',({reason:V})=>{this.#watchers['navigated']['reset']({'hint':V==='unknown'?'chrome':V==='programmatic'?'programmatic':'page'});}),this['mainFrame']['on']('navigated',({url:V,reason:k})=>{this.#watchers['navigated']['resolve']();const t=this.#url;this.#url=V;if(k==='local')this['dispatch'](new TargetNavigatedEvent({'from':t,'to':V,'reason':'page'}));else{if(V!=='chrome-error://chromewebdata/')this['dispatch'](new TargetNavigatedEvent({'from':t,'to':V,'reason':this.#watchers['navigated']['hint']}));}}),this['mainFrame']['on']('loading',()=>{}),this['mainFrame']['on']('loaded',()=>{this.#watchers['navigated']['resolve']();});}),this['on']('frameTargetCreated',({target:V})=>{V['on']('filepickerDialogOpened',({dialog:k})=>this['dispatch'](new TargetFilepickerDialogEvent(k)));});}*['frames'](){if(this.#controller['signal']['aborted']||!this.#browser['frameManager']['has'](this['targetId']))return;yield*this.#browser['frameManager']['getFramesIterator'](this['targetId']);}*['targets'](){yield*this['frames']()['filter'](B=>B['frameId']!==this['targetId']&&B['isOutOfProcess'])['map'](B=>B['target']);}async['wait'](B,{signal:Q}={}){if(B==='stable')await abortable(this.#watchers['initialized'],Q),this['kind']==='renderer'&&(await abortable(this.#watchers['navigated'],Q),await abortable(Promise['race']([this['mainFrame']['wait']('stable'),this.#watchers['dialogOpened']]),Q));else{if(B==='pendingRequests')await abortable(this.#requestsTracker['wait'](),Q);else await abortable(this.#watchers[B],Q);}}async['activate'](){if(this['type']!=='page')throw new Error('Only\x20page\x20target\x20could\x20be\x20activated');this['dispatch'](new TargetActivatingEvent()),await this['connection']['execute']('Page.bringToFront');if(this.#browser['headless'])this['dispatch'](new TargetActivatedEvent({'reason':'programmatic'}));}async['emulate']({viewport:B,scale:scale=0x1,mobile:mobile=![],timeout:Q}){return this['connection']['execute']('Emulation.setDeviceMetricsOverride',{...B,'deviceScaleFactor':scale,'mobile':mobile},{'timeout':Q});}async['getViewportSize'](){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20get\x20a\x20viewport\x20size\x20of\x20a\x20non-renderer\x20target');const {offsetX:B,offsetY:Q}=await this['mainFrame']['execute'](()=>{return{'offsetX':innerWidth-Math['round'](visualViewport['width']),'offsetY':innerHeight-Math['round'](visualViewport['height'])};}),{cssVisualViewport:a}=await this['connection']['execute']('Page.getLayoutMetrics'),{clientWidth:c,clientHeight:X,scale:scale=0x1,zoom:zoom=0x1}=a;return{'width':Math['round']((c+B)*zoom*scale),'height':Math['round']((X+Q)*zoom*scale)};}async['captureScreenshot'](B){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20capture\x20screenshot\x20of\x20a\x20non-renderer\x20target');return await this['connection']['execute']('Emulation.setVisibleSize',await this['getViewportSize']()),(await this['connection']['execute']('Page.captureScreenshot',B??{'format':'png'}))['data'];}async['execute'](B,Q,a){await this['wait']('stable');if(this['kind']==='renderer')throw new Error('Can\x27t\x20execute\x20script\x20in\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return this.#evaluator['execute'](B,Q,a);}async['evaluate'](B,Q){if(this['kind']==='renderer')throw new Error('Can\x27t\x20evaluate\x20expression\x20in\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return await this['wait']('stable'),this.#evaluator['evaluate'](B,Q);}async['resolve'](B){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20resolve\x20node\x20with\x20a\x20non-renderer\x20target');for(const Q of this['frames']()){const a=await Q['resolve'](B);if(a)return a;}throw new Error('Cannot\x20resolve\x20node\x20by\x20backend\x20id\x20\x22'+B['nodeId']+'\x22\x20in\x20target\x20with\x20id\x20\x22'+this['targetId']+'\x22');}async['resolveFromLocation'](B,{ignorePointerEventsNone:ignorePointerEventsNone=!![]}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20resolve\x20node\x20with\x20a\x20non-renderer\x20target');try{const {frameId:Q,...a}=await this['connection']['execute']('DOM.getNodeForLocation',{'x':Math['round'](B['x']),'y':Math['round'](B['y']),'ignorePointerEventsNone':ignorePointerEventsNone,'includeUserAgentShadowDOM':![]}),c=this['browser']['frameManager']['get'](Q);if(!c)throw new Error('Frame\x20with\x20id\x20\x22'+Q+'\x22\x20resolved\x20a\x20node\x20but\x20the\x20frame\x20wasn\x27t\x20found');return await c['resolve']({'nodeId':a['backendNodeId']});}catch(X){return error('nodeResolutionFailed',{'error':X}),null;}}async['port'](B){if(this['kind']==='renderer')throw new Error('Can\x27t\x20create\x20a\x20port\x20to\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return this.#evaluator['port'](B);}async['filepicker'](B){const Q=[];try{this.#filepickerHandlers['size']===0x0&&(await this['wait']('initialized'),await this['hideFilepickers'](!![])),this.#filepickerHandlers['add'](B),this.#controller['signal']['throwIfAborted'](),Q['push'](this['on']('frameTargetCreated',async({target:a})=>Q['push'](await a['filepicker'](B)))),Q['push'](...await Promise['all'](Array['from'](this['targets'](),a=>a['filepicker'](B))));}catch(a){if(a instanceof AbortError)log('filepickerSetupAborted',{'targetId':this['targetId'],'error':a});else throw a;}return()=>{this.#filepickerHandlers['delete'](B),Q['forEach'](c=>c());if(this.#filepickerHandlers['size']===0x0)this['hideFilepickers'](![]);};}async['intercept'](B,Q){const a=Q??B,c=Q?Array['isArray'](B)?B:[B]:[{'stage':['request']}],X={'matchers':c['map'](J=>makeInterceptionPatternMatcher(J)),'patterns':c['flatMap'](J=>toCDPPattern(J)),'handler':a},f=[];try{this.#requestInterceptors['add'](X),await this['wait']('attached'),this['connection']['send']('Fetch.enable',{'patterns':Array['from'](this.#requestInterceptors)['flatMap'](({patterns:J})=>J)}),this.#controller['signal']['throwIfAborted'](),await this['wait']('initialized'),f['push'](this['on']('frameTargetCreated',async({target:J})=>f['push'](await J['intercept'](c,a)))),f['push'](...await Promise['all'](Array['from'](this['targets'](),J=>J['intercept'](c,a))));}catch(J){if(J instanceof AbortError)log('interceptorSetupAborted',{'targetId':this['targetId'],'error':J});else throw J;}return()=>{this.#requestInterceptors['delete'](X),f['forEach'](Y=>Y());if(this.#requestInterceptors['size']===0x0)this['connection']['send']('Fetch.disable');else this['connection']['send']('Fetch.enable',{'patterns':Array['from'](this.#requestInterceptors)['flatMap'](({patterns:Y})=>Y)});};}async['navigateThroughHistory'](B){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');const {currentIndex:Q,entries:a}=await this['connection']['execute']('Page.getNavigationHistory'),c=a[Q+B];if(!c)throw new NoHistoryEntryError({'offset':B});this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':c['url'],'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'}),await this['connection']['execute']('Page.navigateToHistoryEntry',{'entryId':c['id']});}async['navigate'](B,{timeout:Q,headers:a}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');if(!this.#watchers['navigated']['settled'])await Promise['allSettled']([this.#watchers['navigated']]);let c;if(a){const f=URL['parse'](B)?.['host'];c=await this['intercept']([{'stage':['request']}],async J=>{if(J['stage']!=='request')return;if(URL['parse'](J['url'])?.['host']!==f)return;await J['continue']({'headers':{...J['headers'],...a}});});}this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':B,'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'});if(Q)this.#watchers['navigated']['reject'](new NavigationTimedOutError({'url':B,'timeout':Q}),{'delay':Q});const X=new AbortController();this.#watchers['navigated']['catch'](J=>X['abort'](J));try{const {errorText:J}=await this['connection']['execute']('Page.navigate',{'url':B},{'signal':X['signal'],'timeout':Q?Q+0x1388:void 0x0});if(J){if(J==='net::ERR_INVALID_AUTH_CREDENTIALS')this.#watchers['navigated']['resolve']();else{if(J==='net::ERR_ABORTED'&&[0xcc,0xcd]['includes'](this['mainFrame']['response']['status']))this.#watchers['navigated']['resolve']();else this.#watchers['navigated']['reject'](new NavigationFailedError({'url':B,'reason':J}));}}await this.#watchers['navigated'];}catch(Y){c?.();throw Y;}if(c)this['mainFrame']['once']('navigating',c);return{'url':B,'status':this['mainFrame']['response']['status'],'headers':this['mainFrame']['response']['headers']};}async['reload']({hard:B}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');if(B)await this.#browser['clearCookies']();this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':this['url'],'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'}),await this['connection']['execute']('Page.reload',{'ignoreCache':B}),await this.#watchers['navigated'],await Promise['race']([this['wait']('dialogOpened'),this['mainFrame']['wait']('networkAlmostIdle')]);}async['cancelNavigation'](){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');await this['connection']['execute']('Page.stopLoading')['catch'](()=>null);}async['devtools'](B){const {targetId:Q}=await this.#browser['connection']['execute']('Target.openDevTools',{'targetId':this['targetId']});await this.#browser['wait']('attachedTargets');const a=this.#browser['targetManager']['get'](Q);if(B?.['panel']){await a['wait']('stable');const c=AbortSignal['timeout'](0x1388);let X;while(!c['aborted']){X=await a['mainFrame']['$']('.tabbed-pane>>>[aria-label=\x22'+B['panel']+'\x22\x20i]');if(X){await X['click']();break;}}}return a;}async['highlight'](B,Q){if(B){const a={'x':Math['round'](B['x']),'y':Math['round'](B['y']),'width':Math['round'](B['width']),'height':Math['round'](B['height']),'color':Q?.['color']??{'r':0x6f,'g':0xa8,'b':0xdc,'a':0.66},'outlineColor':Q?.['outlineColor']};if(Q?.['blink']){const c=0x5;for(let X=0x0;X<c;X++){await this['connection']['execute']('Overlay.highlightRect',a),await sleep(0xfa),await this['connection']['execute']('Overlay.hideHighlight'),await sleep(0x96);}}else await this['connection']['execute']('Overlay.highlightRect',a);}else await this['connection']['execute']('Overlay.hideHighlight');}async['bypassCSP'](B=!![]){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20bypass\x20csp\x20of\x20a\x20non-renderer\x20target');await this['connection']['execute']('Page.setBypassCSP',{'enabled':B});}async['getCookies'](){const {cookies:B}=await this['connection']['execute']('Network.getCookies');return B['reduce']((Q,{name:a,value:c})=>Q['set'](a,c),new Map());}async['setCookies'](B){await this['connection']['execute']('Network.setCookies',{'cookies':B});}async['inject'](B,{name:Q,deep:a,isolated:c}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20peform\x20an\x20injection\x20in\x20a\x20non-renderer\x20target');const X=makeInjection({'target':this,'expression':B,'name':Q,'deep':a,'isolated':c});return await X['wait']('injected'),this.#injections['set'](X['name'],X),X;}async['changeMode'](B,Q){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20change\x20mode\x20of\x20a\x20non-renderer\x20target');await this['wait']('initialized');if(B==='element\x20selection'){const a=Q?.['color']?{'contentColor':Q['color'],'paddingColor':Q['color'],'borderColor':Q['color'],'shapeColor':Q['color']}:{};await this['connection']['execute']('Overlay.setInspectMode',{'mode':'searchForNode','highlightConfig':a}),this['on']('frameTargetCreated',({target:c})=>{c['on']('elementSelected',({element:X})=>this['dispatch'](new TargetElementSelectedEvent(X)),{'key':'modeChanger'}),c['changeMode'](B,Q);},{'key':'modeChanger'}),await Promise['all'](Array['from'](this['targets'](),c=>{return c['on']('elementSelected',({element:X})=>this['dispatch'](new TargetElementSelectedEvent(X)),{'key':'modeChanger'}),c['changeMode'](B,Q);}));}else await this['connection']['execute']('Overlay.setInspectMode',{'mode':'none','highlightConfig':{}}),this['off']('modeChanger'),await Promise['all'](Array['from'](this['targets'](),c=>{return c['off']('modeChanger'),c['changeMode'](B);}));this.#mode=B;}async['hideFilepickers'](B=!![]){try{this.#filepickersHidden!==B&&(await this['connection']['execute']('Page.setInterceptFileChooserDialog',{'enabled':B}),this.#filepickersHidden=B);}catch(Q){error('filepickerHideFailed',{'error':Q});}}async['close'](){this['dispatch'](new TargetClosedEvent()),this['connection']['send']('Target.closeTarget',{'targetId':this['targetId']});}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){return'Target\x20'+a({'targetId':this['targetId'],'type':this['type'],'url':this['url'],'title':this['title']},Q);}},TargetAttachedEvent=class extends Event{['sessionId'];constructor(B){super('attached'),this['sessionId']=B;}},TargetDetachedEvent=class extends Event{constructor(){super('detached');}},TargetActivatingEvent=class extends Event{constructor(){super('activating');}},TargetActivatedEvent=class extends Event{['reason'];constructor({reason:B}){super('activated'),this['reason']=B;}},TargetChangedEvent=class extends Event{['url'];['title'];constructor(B){super('changed'),this['url']=B['url'],this['title']=B['title'];}},TargetNavigatedEvent=class extends Event{['from'];['to'];['reason'];constructor({from:B,to:Q,reason:a}){super('navigated'),this['from']=B,this['to']=Q,this['reason']=a;}},TargetClosedEvent=class extends Event{constructor(){super('closed');}},TargetVisibilityChangeEvent=class extends Event{['visibility'];constructor(B){super('visibilityChanged'),this['visibility']=B;}},TargetMainFrameReadyEvent=class extends Event{['frame'];constructor(B){super('mainFrameReady'),this['frame']=B;}},TargetFrameAttachedEvent=class extends Event{['frame'];constructor(B){super('frameAttached'),this['frame']=B;}},TargetFrameTargetCreatedEvent=class extends Event{['target'];constructor(B){super('frameTargetCreated'),this['target']=B;}},TargetDialogEvent=class extends Event{['state'];['dialog'];['result'];['value'];constructor(B,Q,a={}){super('dialog'+(B[0x0]['toUpperCase']()+B['substring'](0x1))),this['state']=B,this['dialog']=Q,this['result']=a['result'],this['value']=a['value'];}},TargetFilepickerDialogEvent=class extends Event{['dialog'];constructor(B){super('filepickerDialogOpened'),this['dialog']=B;}},TargetChildTargetCreatingEvent=class extends Event{constructor(){super('childTargetCreating');}},TargetElementSelectedEvent=class extends Event{['element'];constructor(B){super('elementSelected'),this['element']=B;}};const browsers=new WeakMap();async function makeBrowser(B){if(B['driver']&&browsers['has'](B['driver']))return browsers['get'](B['driver']);if(B['socket']){const Q=new Browser({'socket':B['socket'],'driver':B['driver']});if(B['driver'])browsers['set'](B['driver'],Q);return Q;}else{if(B['wsDebuggerUrl']){const a=new Agent()['compose'](X=>{return(f,J)=>{return f['headers']=f['headers']&&Object['fromEntries'](Object['entries'](f['headers'])['filter'](([Y])=>Y['toLowerCase']()!=='sec-websocket-extensions')),X(f,J);};}),c=new WebSocket(B['wsDebuggerUrl'],{'dispatcher':a});return await once(c,'open'),makeBrowser({'socket':c,'driver':B['driver']});}else{if(B['debuggerAddress']){const X='http://'+B['debuggerAddress']['replace']('localhost','127.0.0.1'),f=await fetch(X+'/json/version')['catch'](()=>null);if(f?.['status']!==0xc8)throw new Error('Failed\x20to\x20extract\x20websocket\x20debugger\x20url');return makeBrowser({'wsDebuggerUrl':(await f['json']())['webSocketDebuggerUrl']['replace']('localhost','127.0.0.1'),'driver':B['driver']});}else{if(B['driver']){const J=await B['driver']['getCapabilities'](),Y=J['get']('se:cdp')?.['replace'](/172.\d+.0.2/,'localhost');if(Y)return makeBrowser({'wsDebuggerUrl':Y,'driver':B['driver']});return makeBrowser({'debuggerAddress':J['get']('goog:chromeOptions')?.['debuggerAddress']??J['get']('ms:edgeOptions')?.['debuggerAddress']??J['get']('moz:debuggerAddress')??'localhost:9245','driver':B['driver']});}else throw new Error('Cannot\x20create\x20browser\x20-\x20no\x20connection\x20options\x20provided');}}}}var Browser=class extends EventTargetNode{#targets=new Map();#pages=[];#extensions=[];#activePage;#headless;#product;#filepickersHidden=![];#closed=![];#history=makePagesHistory({'browser':this});#watchers={'initialized':makeWatcher(),'attachedTargets':makeWatcher(),'activePage':makeWatcher(),'history':makeWatcher()};async #initialize(){on(this['connection']['socket'],'close',({code:c,reason:X})=>{if(this.#closed)return;log('browserSocketClosed',{'code':c,'reason':X}),this['dispatch'](new BrowserDisconnectedEvent({'code':c,'reason':X}));});const {product:B,userAgent:Q}=await this['connection']['execute']('Browser.getVersion');this.#product=B,this.#headless=Q['includes']('HeadlessChrome');const a=this.#headless?await this['driver']?.['getWindowHandle']():void 0x0;this['connection']['on']('Target.targetCreated',async({targetInfo:c})=>{log('targetCreated',{'targetId':c['targetId'],'targetType':c['type'],'openerTargetId':c['openerId'],'openerFrameId':c['openerFrameId']});if(!(c['type']==='page'||c['type']==='iframe'&&this['frameManager']['has'](c['targetId'])||c['type']==='service_worker'&&c['url']['startsWith']('chrome-extension://')||c['url']['startsWith']('devtools://')))return;const X=makeTarget({'browser':this,'parent':c['openerId']?this.#targets['get'](c['openerId']):void 0x0,'targetId':c['targetId'],'type':c['type'],'url':c['url'],'title':c['title']});this.#targets['set'](X['targetId'],X),this.#watchers['attachedTargets']['reset'](),this['dispatch'](new BrowserTargetCreatedEvent(X));if(c['type']==='other'&&c['url']['startsWith']('devtools://'))await this['connection']['execute']('Target.attachToTarget',{'targetId':c['targetId'],'flatten':!![]});X['on']('attached',()=>{if(Array['from'](this.#targets['values']())['every'](f=>f['attached'])&&!this.#watchers['attachedTargets']['settled'])this.#watchers['attachedTargets']['resolve']();});if(X['type']==='page'&&!X['url']['startsWith']('devtools://'))this['dispatch'](new BrowserPageCreatedEvent(X)),this.#pages['push'](X),X['on']('attached',()=>{if(this.#activePage){log('activePageChanging',{'reason':this.#activePage===X['parent']?'childOfActive':'newPage'});if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'automatic'});if(this['headless'])X['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else this.#activePage=void 0x0;}else this.#headless&&X['targetId']===a&&(log('activePageChanging',{'reason':'webdriver'}),X['dispatch'](new TargetActivatedEvent({'reason':'programmatic'})));}),X['on']('activating',()=>{if(this['activePage']!==X&&this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'programmatic'});}),X['on']('activated',({reason:f})=>{this.#activePage=X,log('activePageChanged',{'targetId':X['targetId']}),this.#watchers['activePage']['resolve'](),this['dispatch'](new BrowserActivePageChangedEvent(X,{'reason':f}));}),X['on']('navigated',({from:f,to:J,reason:Y})=>{log('pageNavigated',{'targetId':X['targetId']}),this['dispatch'](new BrowserPageNavigatedEvent(X,{'from':f,'to':J,'reason':Y}));}),X['on']('closed',()=>{log('pageClosed',{'targetId':X['targetId']});const f=!X['download']&&(X['initialized']&&!this.#activePage||this.#activePage===X);this['dispatch'](new BrowserPageClosedEvent(X,{'wasActive':f})),this.#targets['delete'](X['targetId']),this.#pages['splice'](this.#pages['indexOf'](X),0x1);if(this.#activePage===X||!this['activePage']&&X['visible']===void 0x0){log('activePageClosed',{'targetId':X['targetId']}),this.#watchers['activePage']['reset']({'hint':'automatic'});if(this['headless']&&X['parent'])log('activePageChanging',{'reason':'parentOfClosed'}),X['parent']['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else{const J=this.#pages['findLast'](Y=>Y['visible']);J?(log('activePageChanging',{'reason':'otherVisible'}),J['dispatch'](new TargetActivatedEvent({'reason':'automatic'}))):(log('activePageVacated',{'reason':'noVisiblePage'}),this.#activePage=void 0x0);}}else{if(!this.#activePage)this.#watchers['activePage']['reset']({'hint':'automatic'});}}),X['on']('visibilityChanged',({visibility:f})=>{if(f==='visible'){if(!this.#activePage)log('activePageChanging',{'reason':'becameVisible'}),X['dispatch'](new TargetActivatedEvent({'reason':this.#watchers['activePage']['hint']}));else{if(this.#activePage!==X){if(X['popup'])log('activePageChanging',{'reason':'popupStole'}),X['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else{log('activePageContested',{});if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'manual'});}}}}else{if(this.#activePage===X&&f==='hidden'&&X['navigated']){log('activePageVacated',{'reason':'activePageHidden'});const J=this.#pages['findLast'](Y=>Y['visible']);if(J)log('activePageChanging',{'reason':'otherVisible'}),J['dispatch'](new TargetActivatedEvent({'reason':this.#watchers['activePage']['hint']}));else{if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'manual'});this.#activePage=void 0x0;}}}}),X['on']('childTargetCreating',()=>{this.#watchers['attachedTargets']['reset']();});else{if(X['type']==='iframe')this['frameManager']['get'](X['mainFrame']['parentFrameId'])?.['target']['dispatch'](new TargetFrameTargetCreatedEvent(X));else{if(X['type']==='service_worker')this.#extensions['push'](X);}}}),this['connection']['on']('Target.targetDestroyed',({targetId:c})=>{const X=this.#targets['get'](c);X&&(log('targetDestroyed',{'targetId':X['targetId'],'targetType':X['type']}),this.#targets['delete'](c),X['dispatch'](new TargetClosedEvent()));}),this['connection']['on']('Target.targetCrashed',({targetId:c,status:X,errorCode:f})=>{log('targetCrashed',{'targetId':c,'status':X,'errorCode':f});const J=this.#targets['get'](c)??null;this['dispatch'](new BrowserTargetCrashedEvent(J,{'targetId':c,'status':X,'errorCode':f}));}),this['connection']['on']('Target.targetInfoChanged',({targetInfo:c})=>{this.#targets['get'](c['targetId'])?.['dispatch'](new TargetChangedEvent(c));}),this['connection']['on']('Target.attachedToTarget',async({sessionId:c,targetInfo:X})=>{log('targetAttached',{'targetId':X['targetId'],'targetType':X['type'],'sessionId':c}),this.#targets['get'](X['targetId'])?.['dispatch'](new TargetAttachedEvent(c));}),this['connection']['on']('Target.detachedFromTarget',async({sessionId:c,targetId:X})=>{log('targetDetached',{'targetId':X,'sessionId':c}),this.#targets['get'](X)?.['dispatch'](new TargetDetachedEvent());}),await this['connection']['execute']('Target.setDiscoverTargets',{'discover':!![]}),await this['connection']['execute']('Target.setAutoAttach',{'autoAttach':!![],'flatten':!![],'filter':[{'type':'page'},{'type':'iframe'},{'type':'service_worker'}],'waitForDebuggerOnStart':!![]});}['type']='web';['targetManager']=this.#targets;['frameManager']=makeFrameManager();['windowManager']=makeWindowManager();['extensions']=this.#extensions;['driver'];['connection'];['frameStabilityTimeout']=0x9c40;get['headless'](){return this.#headless;}get['product'](){return this.#product;}get['blocked'](){return!!this.#activePage?.['dialog']&&this.#activePage['dialog']['type']!=='filepicker';}get['activePage'](){return this.#activePage;}get['filepickersHidden'](){return this.#filepickersHidden;}get['__previousPage'](){return this.#history['previousPage'];}get['__nextPage'](){return this.#history['nextPage'];}constructor({driver:B,socket:Q}){super(),this['driver']=B,this['connection']=makeConnection({'socket':Q}),this.#initialize()['then'](()=>this.#watchers['initialized']['resolve']())['catch'](a=>this.#watchers['initialized']['reject'](a));}*['targets'](){yield*this.#targets['values']();}*['pages'](){yield*this.#pages;}async['stabilize'](B,{signal:Q,timeout:a}={}){await this['wait']('stable',{'signal':Q});const c=this['activePage'];if(!c)return this['stabilize'](B,{'signal':Q,'timeout':a});if(B==='basic')await this.#stabilizeBasic(c,{'signal':Q});else{if(B==='strict')await this.#stabilizeStrict(c,{'signal':Q});else{if(B==='paranoid')await until(this.#stabilizeParanoid(c,{'signal':Q}),{'timeout':a??0xea60,'signal':Q});}}if(this.#activePage!==c||!this.#watchers['activePage']['settled'])return this['stabilize'](B,{'signal':Q,'timeout':a});}async #stabilizeBasic(B,{signal:Q}){await B['wait']('initialized',{'signal':Q}),!B['navigated']&&(this['dispatch'](new BrowserStabilizingNavigationEvent({'done':![]})),await B['wait']('navigated',{'signal':Q}),this['dispatch'](new BrowserStabilizingNavigationEvent({'done':!![]}))),!B['stable']&&(this['dispatch'](new BrowserStabilizingLoadEvent({'done':![]})),await B['wait']('stable',{'signal':Q}),this['dispatch'](new BrowserStabilizingLoadEvent({'done':!![]})));}async #stabilizeStrict(B,{signal:Q}){await this.#stabilizeBasic(B,{'signal':Q}),!B['pendingRequests']&&(this['dispatch'](new BrowserStabilizingOutgoingRequestsEvent({'done':![]})),await B['wait']('pendingRequests',{'signal':Q}),this['dispatch'](new BrowserStabilizingOutgoingRequestsEvent({'done':!![]})));}async #stabilizeParanoid(B,{signal:Q}){await this.#stabilizeStrict(B,{'signal':Q});for(const a of B['frames']())try{if(await a['isVisible']())await a['wait']('loaded',{'signal':Q});}catch(c){if(Q?.['aborted']&&Q['reason']===c)throw c;}}async['wait'](B,{signal:Q}={}){if(B==='stable')await abortable(this.#watchers['initialized'],Q),await abortable(this.#watchers['attachedTargets'],Q),await abortable(this.#watchers['activePage'],Q);else await abortable(this.#watchers[B],Q);}async['page']({url:B,automationTimeout:Q}){await this.#watchers['activePage'],this.#watchers['attachedTargets']['reset']();const {targetId:a}=await this['connection']['execute']('Target.createTarget',{'url':'about:blank'});await this.#watchers['attachedTargets'];const c=this.#targets['get'](a);if(Q!=null)c['connection']['timeout']=Q;return await Promise['all']([c['activate'](),B?c['wait']('stable')['then'](()=>c['navigate'](B)['then'](()=>c['wait']('stable'))):null]),c;}async['activatePreviousPage'](){return await this.#watchers['activePage'],this.#history['activatePreviousPage']();}async['activateNextPage'](){return await this.#watchers['activePage'],this.#history['activateNextPage']();}async['intercept'](B,Q){const a=Q??B,c=Q?B:void 0x0,X=[];X['push'](this['on']('pageCreated',async({target:J})=>X['push'](await f(J)))),X['push'](...await Promise['all'](Array['from'](this['pages'](),f)));return()=>X['forEach'](J=>J());function f(J){return c!==void 0x0?J['intercept'](c,a):J['intercept'](a);}}async['filepicker'](B){const Q=[];return this['on']('pageCreated',async({target:a})=>Q['push'](await a['filepicker'](B))),Q['push'](...await Promise['all'](Array['from'](this['pages'](),a=>a['filepicker'](B)))),()=>Q['forEach'](a=>a());}async['getCookies'](){const {cookies:B}=await this['connection']['execute']('Storage.getCookies');return B;}async['setCookies'](B){await this['connection']['execute']('Storage.setCookies',{'cookies':B});}async['clearCookies'](){await this['connection']['execute']('Storage.clearCookies');}async['clearOriginStorage'](B){await this['connection']['execute']('Storage.clearDataForOrigin',{'origin':B,'storageTypes':'all'});}async['setWindowSize'](B){await this.#watchers['activePage'],await this['activePage']['wait']('windowResolved'),await this.#activePage['window']['setSize'](B);}async['setViewportSize'](B){await this.#watchers['activePage'],await this['activePage']['wait']('windowResolved');const Q=this.#activePage['window'];if(this.#headless){await Q['setSize'](B);const a=await this['activePage']['getViewportSize']();if(a['width']!==B['width']||a['height']!==B['height'])await Q['setSize']({'width':B['width']+B['width']-a['width'],'height':B['height']+B['height']-a['height']});}else await Q['setContentsSize'](B);}async['captureScreenshot'](){return await this['wait']('stable'),this['activePage']['captureScreenshot']();}async['hideFilepickers'](B=!![]){await Promise['all'](Array['from'](this['targets'](),Q=>Q['hideFilepickers'](B))),this.#filepickersHidden=B;}async['close'](){log('browserClosing',{}),this.#closed=!![],this.#targets['forEach'](B=>B['dispatch'](new TargetClosedEvent()));if(this['driver'])await this['driver']?.['quit']();else await this['connection']['execute']('Browser.close');}},BrowserTargetCreatedEvent=class extends Event{['target'];constructor(B,Q){super('targetCreated',Q),this['target']=B;}},BrowserPageCreatedEvent=class extends Event{['target'];constructor(B,Q){super('pageCreated',Q),this['target']=B;}},BrowserPageNavigatedEvent=class extends Event{['target'];['from'];['to'];['reason'];constructor(B,{from:Q,to:a,reason:c},X){super('pageNavigated',X),this['target']=B,this['from']=Q,this['to']=a,this['reason']=c;}},BrowserPageClosedEvent=class extends Event{['target'];['wasActive'];constructor(B,{wasActive:wasActive=![]}={},Q){super('pageClosed',Q),this['target']=B,this['wasActive']=wasActive;}},BrowserActivePageChangedEvent=class extends Event{['target'];['reason'];constructor(B,{reason:Q},a){super('activePageChanged',a),this['target']=B,this['reason']=Q;}},BrowserDisconnectedEvent=class extends Event{['code'];['reason'];constructor({code:B,reason:Q},a){super('disconnected',a),this['code']=B,this['reason']=Q;}},BrowserTargetCrashedEvent=class extends Event{['target'];['targetId'];['status'];['errorCode'];constructor(B,{targetId:Q,status:a,errorCode:c},X){super('targetCrashed',X),this['target']=B,this['targetId']=Q,this['status']=a,this['errorCode']=c;}},BrowserWindowCreatedEvent=class extends Event{['window'];constructor(B){super('windowCreated'),this['window']=B;}},BrowserStabilizingNavigationEvent=class extends Event{['done'];constructor({done:B}){super('stabilizingNavigation'),this['done']=B;}},BrowserStabilizingLoadEvent=class extends Event{['done'];constructor({done:B}){super('stabilizingLoad'),this['done']=B;}},BrowserStabilizingOutgoingRequestsEvent=class extends Event{['done'];constructor({done:B}){super('stabilizingOutgoingRequests'),this['done']=B;}},HarRecorder=class extends EventTargetNode{#target;#includeBodies;#unsubscribes=[];#disposed=![];#events=[];#bodies=new Map();#seenRequestIds=new Set();#cachedRequestIds=new Set();#stats={'requestCount':0x0,'bytesIn':0x0,'bytesOut':0x0};constructor({target:B,includeBodies:includeBodies=![]}){super(),this.#target=B,this.#includeBodies=includeBodies,this.#subscribe(),this.#seedActivePage();}get['stats'](){return this.#stats;}get['target'](){return this.#target;}get['includeBodies'](){return this.#includeBodies;}['setIncludeBodies'](B){this.#includeBodies=B;}['toHar'](){const B=this.#events['map'](({method:a,params:c})=>({'method':a,'params':c}));let Q;try{Q=harFromMessages(B,{'includeTextFromResponseBody':![]});}catch{Q=emptyHar();}for(const a of Q['log']['entries']){const c=a['_requestId'];if(!c)continue;const X=this.#bodies['get'](c);if(!X||!a['response']?.['content'])continue;a['response']['content']['text']=X['body'];if(X['base64Encoded'])a['response']['content']['encoding']='base64';}return{'har':Q,'eventCount':B['length'],'requestCount':this.#stats['requestCount']};}['dispose'](){if(this.#disposed)return;this.#disposed=!![];for(const B of this.#unsubscribes)try{B();}catch{}this.#unsubscribes=[];}#subscribe(){const B=this.#target['connection'];if(!B)return;for(const Q of CDP_NETWORK_METHODS)this.#unsubscribes['push'](B['on'](Q,a=>{this.#capture(Q,a);if(Q==='Network.requestWillBeSent')this.#onRequestWillBeSent(a);else{if(Q==='Network.requestServedFromCache')this.#onRequestServedFromCache(a);else{if(Q==='Network.dataReceived')this.#onDataReceived(a);else{if(Q==='Network.loadingFinished')this.#onLoadingFinished(a);}}}}));for(const a of CDP_PAGE_METHODS)this.#unsubscribes['push'](B['on'](a,c=>this.#capture(a,c)));}#seedActivePage(){if(this.#disposed)return;this.#capture('Page.frameStartedLoading',{'frameId':this.#target['targetId']});}#capture(B,Q){if(this.#disposed)return;this.#events['push']({'method':B,'params':Q,'timestamp':Date['now']()});}#onRequestWillBeSent(B){if(!/^https?:/i['test'](B['request']?.['url']??''))return;this.#seenRequestIds['add'](B['requestId']),this.#stats['requestCount']+=0x1;const Q=B['request']?.['postData']?.['length']??0x0;if(Q>0x0)this.#stats['bytesOut']+=Q;this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onRequestServedFromCache(B){if(!this.#seenRequestIds['has'](B['requestId']))return;if(this.#cachedRequestIds['has'](B['requestId']))return;this.#cachedRequestIds['add'](B['requestId']),this.#stats['requestCount']-=0x1,this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onDataReceived(B){if(!this.#seenRequestIds['has'](B['requestId']))return;if(this.#cachedRequestIds['has'](B['requestId']))return;if(typeof B['encodedDataLength']==='number')this.#stats['bytesIn']+=B['encodedDataLength'];this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onLoadingFinished(B){if(!this.#includeBodies)return;if(!this.#seenRequestIds['has'](B['requestId']))return;if(this.#cachedRequestIds['has'](B['requestId']))return;this.#fetchBody(B['requestId']);}async #fetchBody(B){if(this.#disposed)return;const Q=this.#target['connection'];if(!Q)return;try{const a=await Q['execute']('Network.getResponseBody',{'requestId':B});if(this.#disposed)return;this.#bodies['set'](B,{'body':a['body'],'base64Encoded':a['base64Encoded']});}catch{}}};const CDP_NETWORK_METHODS=['Network.requestWillBeSent','Network.requestWillBeSentExtraInfo','Network.responseReceived','Network.responseReceivedExtraInfo','Network.dataReceived','Network.loadingFinished','Network.loadingFailed','Network.requestServedFromCache'],CDP_PAGE_METHODS=['Page.frameStartedLoading','Page.frameRequestedNavigation','Page.navigatedWithinDocument','Page.frameAttached','Page.loadEventFired','Page.domContentEventFired'];function emptyHar(){return{'log':{'version':'1.2','creator':{'name':'automator','version':''},'pages':[],'entries':[]}};}var HarRecorderStatsChangedEvent=class extends Event{['stats'];constructor(B){super('statsChanged'),this['stats']=B;}};const ErrorCode={'NOT_IMPLEMENTED':'NOT_IMPLEMENTED','HANDLER_ABORTED':'HANDLER_ABORTED','UNKNOWN_ACTION':'UNKNOWN_ACTION','UNRESOLVED_REF':'UNRESOLVED_REF','FAILED_ASSERTION':'FAILED_ASSERTION','MALFORMED_COOKIE':'MALFORMED_COOKIE','MALFORMED_HEADER':'MALFORMED_HEADER','EVALUATION_FAILED':'EVALUATION_FAILED','SWITCH_TO_CURRENT_TAB':'SWITCH_TO_CURRENT_TAB','CLOSE_LAST_TAB':'CLOSE_LAST_TAB','NO_TAB_HISTORY':'NO_TAB_HISTORY','NO_TAB':'NO_TAB','NO_NEXT_TAB':'NO_NEXT_TAB','NO_HISTORY_ENTRY':'NO_HISTORY_ENTRY','UNEXPECTED_REQUEST_STATUS':'UNEXPECTED_REQUEST_STATUS','UNEXPECTED_NAVIGATION_STATUS':'UNEXPECTED_NAVIGATION_STATUS','ELEMENT_NOT_INTERACTIVE':'ELEMENT_NOT_INTERACTIVE','ELEMENT_NOT_TEXTBOX':'ELEMENT_NOT_TEXTBOX','ELEMENT_NOT_CLEARABLE':'ELEMENT_NOT_CLEARABLE','UNHANDLED_DIALOG':'UNHANDLED_DIALOG','NO_ELEMENT':'NO_ELEMENT','ILLEGAL_ELEMENT_DESCRIPTOR':'ILLEGAL_ELEMENT_DESCRIPTOR','NO_OPTION':'NO_OPTION','NO_DIALOG':'NO_DIALOG','CONDITION_TIMED_OUT':'CONDITION_TIMED_OUT','NAVIGATION_FAILED':'NAVIGATION_FAILED','NAVIGATION_TIMED_OUT':'NAVIGATION_TIMED_OUT','FETCH_FAILED':'FETCH_FAILED','UNRESPONSIVE_TAB':'UNRESPONSIVE_TAB','INTERNAL':'INTERNAL','MESSAGE_PARSING':'MESSAGE_PARSING','INVALID_DATA':'INVALID_DATA','OBSCURED_ELEMENT':'OBSCURED_ELEMENT','FORBIDDEN_ACTION':'FORBIDDEN_ACTION','EXCEEDED_ALLOWED_TIMEOUT':'EXCEEDED_ALLOWED_TIMEOUT','LOOP_LIMIT_EXCEEDED':'LOOP_LIMIT_EXCEEDED','ASSIGNMENT_TO_BINDING':'ASSIGNMENT_TO_BINDING','NOT_PDF_VIEWER':'NOT_PDF_VIEWER','PDF_PAGE_OUT_OF_RANGE':'PDF_PAGE_OUT_OF_RANGE'};var RunnerError=class extends Error{['code'];['meta'];constructor(B,{code:code=ErrorCode['INTERNAL'],error:Q,...a}={}){super(),this['name']=this['constructor']['name'],this['message']=B,this['code']=code,this['meta']=a,Q instanceof Error&&(this['message']=B+':\x20'+Q['message'],this['stack']=Q['stack']);}};function translateAutomatorError(B,Q={}){if(B instanceof NavigationFailedError)return{'code':ErrorCode['NAVIGATION_FAILED'],'meta':{'url':B['url'],'reason':B['reason']}};if(B instanceof NavigationTimedOutError)return{'code':ErrorCode['NAVIGATION_TIMED_OUT'],'meta':{'url':B['url'],'timeout':B['timeout']}};if(B instanceof NoHistoryEntryError)return{'code':ErrorCode['NO_HISTORY_ENTRY'],'meta':{'offset':B['offset']}};if(B instanceof CommandTimedOutError){const {method:a,commandId:c,sessionId:X}=B;return{'code':ErrorCode['UNRESPONSIVE_TAB'],'meta':{'method':a,'commandId':c,'sessionId':X,'retriable':Q['retriable']}};}return{'code':ErrorCode['INTERNAL'],'meta':{'original':B}};}async function evaluateJSExpression(B,{context:Q,stack:a,automator:c,signal:X}){if(!(c instanceof Browser))throw new Error('Can\x27t\x20evaluate\x20js\x20expression\x20with\x20a\x20non-web\x20automator');const f=await evaluateExpression(B,{'context':Q,'stack':a,'automator':c,'signal':X});return await c['wait']('stable'),await c['activePage']['wait']('stable'),await c['activePage']['mainFrame']['defaultEvaluate'](f,{'await':!![]});}function isBase64String(B){return/^[A-Za-z0-9+/]*={0,2}$/['test'](B);}function isUrlString(B){return/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/['test'](B);}function isXmlString(B){try{return XMLValidator['validate'](B,{'allowBooleanAttributes':!![]})===!![];}catch{return![];}}function parseXmlString(B){const Q=XMLValidator['validate'](B,{'allowBooleanAttributes':!![]});if(Q!==!![])throw new RunnerError('Failed\x20to\x20parse\x20malformed\x20XML,\x20with\x20an\x20error\x20\x22'+Q['err']['msg']+'\x22');return new XMLParser()['parse'](B);}function stringifyXml(B){return new XMLBuilder()['build'](B);}function stringifyJson(B){return JSON['stringify'](B);}function isJsonString(B){try{return JSON['parse'](B),!![];}catch{return![];}}function parseJsonString(B){try{return JSON['parse'](B);}catch(Q){throw new RunnerError('Failed\x20to\x20parse\x20malformed\x20JSON,\x20with\x20an\x20error\x20\x22'+Q['message']+'\x22');}}function stringifyJSLiteral(B){if(typeof B==='bigint')return B+'n';else{if(B===Infinity)return'Infinity';else{if(B===-Infinity)return'-Infinity';else{if(Object['is'](B,-0x0))return'-0';else{if(Number['isNaN'](B))return'NaN';else return JSON['stringify'](B);}}}}}function isAlphaNumeric(B){return/^[\p{L}\p{N}]+$/u['test'](B);}function isNumeric(B){return/^\p{N}+$/u['test'](B);}function isCapitalized(B){return/^\p{Lu}/u['test'](B);}function isLowerCase(B){return!/\p{Lu}/u['test'](B);}function isUpperCase(B){return!/\p{Ll}/u['test'](B);}function isCamelCase(B){return/^\p{Ll}[\p{L}\p{N}]*$/u['test'](B);}function isPascalCase(B){return/^\p{Lu}[\p{L}\p{N}]*$/u['test'](B);}function isSnakeCase(B){return/^[\p{Ll}\p{N}_]+$/u['test'](B);}function isKebabCase(B){return/^[\p{Ll}\p{N}-]+$/u['test'](B);}function isReference(B){return!!(B?.['isRef']&&B['name']);}function isJSExpressionReference(B){return!!(B?.['isJSExpressionRef']&&B['expression']);}function isInterpolatedString(B){return!!(B?.['isInterpolatedString']&&B['chunks']);}function isJSExpression(B){return!!(B?.['isJSExpression']&&B['chunks']);}function isStructure(B){return!!(B?.['isStructure']&&B['type']);}function isPattern(B){return!!(B?.['isPattern']&&(B['pattern']||B['name']));}function isExtractor(B){return B?.['operator']==='extract'&&Array['isArray'](B['operands']);}function isOTP(B){return!!B?.['isOTP'];}function isRandomValue(B){return!!B?.['isRandomValue'];}function isFileHandle(B){return!!B?.['isFileHandle'];}function isCondition(B){return!!B?.['isCondition'];}function isOperation(B){return!!(B?.['operator']&&B['operands']);}function isExpressionOperation(B){return!!(B?.['operator']&&B['operands']);}function isMapOperation(B){return isOperation(B)&&B['operator']==='map';}const expressionOperators=new Set(['size','keys','values','entries','add','sub','mul','div','extract','map','every','some']);function isConditionOperation(B){return isOperation(B)&&!expressionOperators['has'](B['operator']);}function isElementDescriptor(B){if(B&&typeof B==='object')return Object['keys'](B)['every'](Q=>['hints','type','title','color','anchor','nth','reference','selector','orderDirection','superlative','secret']['includes'](Q));return![];}function isElementReference(B){return!!B&&typeof B==='object'&&'isElementReference'in B;}function isSelectorElementDescriptor(B){return!!(B&&typeof B==='object'&&typeof B['selector']==='object'&&B['selector']['type']&&B['selector']['selector']);}function isViewportDescriptor(B){return!!B?.['isViewportDescriptor'];}function isDialogDescriptor(B){return!!B?.['isDialogDescriptor'];}function isDialogElementDescriptor(B){return!!B?.['isDialogElementDescriptor'];}function isChromeTabDescriptor(B){return!!B?.['isChromeElementDescriptor']&&B?.['type']==='tab';}function toChromeTabDescriptor(B){if(!Object['keys'](B)['every'](Q=>['type','title','nth','hints']['includes'](Q)))return null;if(!(Array['isArray'](B['type'])?B['type']:[B['type']])['includes']('tab')){if(B['type']!=null)return null;if(B['hints']==null||Object['keys'](B['hints'])['length']!==0x1||B['hints']['type']!=='tab')return null;}else{if(B['hints']!=null)return null;}if(B['title']==null&&B['nth']==null)return null;if(B['title']!=null&&typeof B['title']!=='string')return null;return{'isChromeElementDescriptor':!![],'type':'tab',...B['nth']!=null?{'index':B['nth']}:{},...B['title']!=null?{'title':B['title']}:{}};}const DIALOG_ACCEPT_TITLES=new Set(['ok','accept','agree','allow','confirm','submit','yes']),DIALOG_DISMISS_TITLES=new Set(['cancel','decline','reject','dismiss','discard','close','no']);function toDialogButtonTitle(B){if(typeof B!=='string')return null;if(DIALOG_ACCEPT_TITLES['has'](B['toLowerCase']()))return'ok';if(DIALOG_DISMISS_TITLES['has'](B['toLowerCase']()))return'cancel';return null;}function toDialogElementDescriptor(B){if(B['type']&&B['type']!=='button')return null;if(!Object['keys'](B)['every'](a=>['type','title']['includes'](a)))return null;const Q=toDialogButtonTitle(B['title']);return Q?{'isDialogElementDescriptor':!![],'title':Q}:null;}function isChromeElementDescriptor(B){return!!B?.['isChromeElementDescriptor'];}function toChromeElementDescriptor(B){if(!B['title']||typeof B['title']!=='string')return null;if(!Object['keys'](B)['every'](Q=>['type','title']['includes'](Q)))return null;if(/^(?:(?:reload|refresh)(?:\s+(?:(?:(?:(?:this|the)\s+)?page)|this))?)$/i['test'](B['title'])){if(B['type']&&B['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'refresh'};}else{if(/^(?:(?:(?:click\s+to\s+)?(?:go\s+)?(?:back|(?:to\s+)?(?:the\s+)?prev(?:ious)?(?:\s+page)?))|<-|<)$/i['test'](B['title'])){if(B['type']&&B['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'back'};}else{if(/^(?:(?:(?:click\s+to\s+)?(?:go\s+)?(?:fwd|forward|(?:to\s+)?(?:the\s+)?next(?:\s+page)?))|->|>)$/i['test'](B['title'])){if(B['type']&&B['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'forward'};}}}return null;}function stringify(B){if(B&&B[Symbol['for']('stringify')])return stringify(B[Symbol['for']('stringify')]());else{if(Array['isArray'](B))return B['map'](stringify)['join']('\x20');else{if(typeof B==='object')return stringifyJson(B);else return String(B);}}}function sizeOf(B){const Q=0x5*0x400*0x400;if(typeof B==='string'){if(B['length']>Q)throw new RunnerError('String\x20length\x20exceeds\x20the\x20safety\x20limit\x20of\x20'+Q+'\x20characters',{'code':ErrorCode['INVALID_DATA']});const a=new Intl['Segmenter']('en',{'granularity':'grapheme'});let c=0x0;for(const X of a['segment'](B))c++;return c;}else{if(Array['isArray'](B))return B['length'];else{if(B instanceof Set||B instanceof Map)return B['size'];else{if(B&&typeof B==='object')return Object['keys'](B)['length'];else throw new RunnerError('Cannot\x20get\x20size\x20of\x20the\x20'+typeof B+'\x20value');}}}}function keysOf(B){if(B instanceof Map)return Array['from'](B['keys']());else{if(B&&typeof B==='object'&&!Array['isArray'](B))return Object['keys'](B);else throw new RunnerError('Cannot\x20get\x20keys\x20of\x20the\x20'+(Array['isArray'](B)?'array':typeof B)+'\x20value');}}function valuesOf(B){if(Array['isArray'](B)||B instanceof Set||B instanceof Map)return Array['from'](B['values']());else{if(B&&typeof B==='object')return Object['values'](B);else throw new RunnerError('Cannot\x20get\x20values\x20of\x20the\x20'+typeof B+'\x20value');}}function entriesOf$1(B){if(typeof B==='string')return B;else{if(Array['isArray'](B)||B instanceof Set)return Array['from'](B['values']());else{if(B instanceof Map)return Array['from'](B['keys']());else{if(B&&typeof B==='object')return Object['keys'](B);else throw new RunnerError('Cannot\x20get\x20entries\x20of\x20the\x20'+typeof B+'\x20value');}}}}const patternNames={'amount':'number','price':'price','percentage':'percentage'};function typeOf(B){if(isElementDescriptor(B)||isDialogDescriptor(B))return'string';else{if(isExtractor(B))return B['operands'][0x1]['includes']('color')||B['operands'][0x1]in patternNames?'string':B['operands'][0x1];else{if(isReference(B))return B['type']??'any';else{if(isInterpolatedString(B))return'string';else{if(isStructure(B))return'any';else{if(isOperation(B)){if(['add','sub','mul','div','size']['includes'](B['operator']))return'number';else return'any';}else{if(B===null)return'null';else return typeof B;}}}}}}}function arrayOf(...B){return B['flatMap'](Q=>{if(Array['isArray'](Q))return Q;if(Q!==void 0x0)return[Q];return[];});}function toLowerCase(B){if(typeof B==='string')return B['toLowerCase']();else{if(Array['isArray'](B))return B['map'](Q=>toLowerCase(Q));else return B;}}async function extractValue(B,{context:Q,stack:a,automator:c,timeout:X,signal:f}){const J=a['extractor'](B),Y=B['operands'][0x1];let h=await evaluateExpression(B['operands'][0x0]['value'],{'context':Q,'stack':a,'automator':c,'timeout':X,'signal':f});const V=patternNames[Y];if(V)h={'title':{'isPattern':!![],'name':V},'anchor':{'position':'near','element':h}};const k=await Q['axOps']['findNode']({...h,'hints':{...h['hints'],'type':arrayOf(h['hints']?.['type'],Y==='string'?['text','valuebox']:['valuebox','text'])}},{'stack':a,'timeout':X??0x0,'signal':f??new AbortController()['signal']});if(!k)return null;Q['activeAXNode']=k;const t=J(await k['node']['getValue']({'hint':Y})??null);if(Y['includes']('color'))return objectToColor(t);return t;}async function evaluateOperand(B,{context:Q,stack:a,automator:c,hint:X,signal:f}){const {done:J,value:Y}=await evaluateOperandSequence(B,{'context':Q,'stack':a,'automator':c,'hint':X,'signal':f})['next']();if(J)throw new RunnerError('Operand\x20not\x20evaluatable');return Y;}async function*evaluateOperandSequence(B,{context:Q,stack:a,automator:c,hint:X,signal:f}){const J=a['operand'](B);if(isElementReference(B['value'])){const Y=await extractValue({'operator':'extract','operands':[{'isOperand':!![],'value':B['value']},X??'string']},{'context':Q,'stack':a,'automator':c,'signal':f});if(Y===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});yield J(Y);}else{if(isElementDescriptor(B['value'])){const h=B['value'],V=await extractValue({'operator':'extract','operands':[{'isOperand':!![],'value':{...h,'hints':{...h['hints'],'type':arrayOf('valuebox',h['hints']?.['type'])}}},X??'string']},{'context':Q,'stack':a,'automator':c,'signal':f});if(V===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});yield J(V);}else{if(isDialogDescriptor(B['value'])){const k=c instanceof Browser?(c?.['activePage']['dialog']&&c['activePage']['dialog']['type']!=='filepicker'&&c['activePage']['dialog']['message'])??null:null;if(k===null)throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});yield J(k);}else{const t=await evaluateExpression(B['value'],{'context':Q,'stack':a,'automator':c,'signal':f});yield J(X==='string'&&typeof t?.[Symbol['for']('stringify')]==='function'?stringify(t):t,{'secret':a['isSecret'](B['value'])??![]});}}}}const operations={'validate':validate,'eq':eq,'lt':lt,'gt':gt,'lte':lte,'gte':gte,'match':match,'includes\x20only':includesOnly,'includes':includes,'starts\x20with':startsWith,'ends\x20with':endsWith,'visible':visible,'clickable':clickable,'enabled':enabled,'hovered':hovered,'checked':checked,'populated':populated},transformers={'ignore\x20case':toLowerCase,'match\x20case':B=>B};function isSizeOperand(B){return isExpressionOperation(B['value'])&&B['value']['operator']==='size';}function validateLengthBoundary(B){const Q=typeof B==='number'?B:Number(B);if(Q<0x0)throw new RunnerError('Invalid\x20boundary:\x20length\x20comparison\x20values\x20must\x20be\x20non-negative',{'code':ErrorCode['INVALID_DATA']});if(!Number['isFinite'](Q))throw new RunnerError('Invalid\x20boundary:\x20non-finite\x20values\x20are\x20not\x20allowed\x20for\x20length\x20comparisons',{'code':ErrorCode['INVALID_DATA']});}async function evaluateCondition(B,{context:Q,stack:a,automator:c,signal:X}){const f=new Map();return h(B['operation']);async function*J(V,{hint:k}={}){const t=stringify(V);let K=f['get'](t);if(!K)K={'values':[],'iterator':evaluateOperandSequence(V,{'context':Q,'stack':a,'automator':c,'hint':k,'signal':X})},f['set'](t,K);else yield*K['values'];for await(const O of K['iterator']){K['values']['push'](O),yield O;}}async function*Y(...[V,...k]){if(!V)yield[];else{const t=[];for await(const K of V){for(const O of t)yield[K,...O];for await(const S of Y(...k)){t['push'](S),yield[K,...S];}}}}async function h(V,k={}){const t=a['operation'](V),{operator:K,operands:O}=V;switch(K){case'parens':return t(await h(O[0x0],k));case'ignore\x20case':case'match\x20case':return t(await h(O[0x0],{...k,'mode':K}));case'not':return t(!await h(O[0x0],k));case'and':return t(await h(O[0x0],k)&&await h(O[0x1],k));case'or':return t(await h(O[0x0],k)||await h(O[0x1],k));case'validate':case'match':for await(const S of J(O[0x0])){if(k['mode']&&isPattern(O[0x1])){O[0x1]['flags']??='';if(k['mode']==='ignore\x20case'&&!O[0x1]['flags']['includes']('i'))O[0x1]['flags']+='i';else{if(k['mode']==='match\x20case')O[0x1]['flags']=O[0x1]['flags']['replace']('i','');}}const C=operations[K](stringify(S),await evaluateExpression(O[0x1],{'context':Q,'stack':a,'automator':c,'signal':X}));if(C)return t(C);}return t(![]);case'eq':case'lt':case'gt':case'lte':case'gte':case'includes':case'starts\x20with':case'ends\x20with':{const G=typeOf(O[0x1]['value']),E=typeOf(O[0x0]['value']),W=transformers[k['mode']??'match\x20case'],e=['eq','lt','gt','lte','gte']['includes'](K),H=e?await Q['scope']['global']['page']?.['value'][Symbol['for']('get')]('language')['catch'](()=>void 0x0):void 0x0;for await(const [q,I]of Y(J(O[0x0],{'hint':G}),J(O[0x1],{'hint':E}))){const n=a['nodeFor'](O[0x0],q),R=a['nodeFor'](O[0x1],I);if(n&&R&&await n['node']['equal'](R['node']))continue;e&&(isSizeOperand(O[0x0])||isSizeOperand(O[0x1]))&&(validateLengthBoundary(q),validateLengthBoundary(I));const F=operations[K](W(q),W(I),H);if(F)return t(F);}return t(![]);}case'includes\x20only':{const w=typeOf(O[0x0]),i=transformers[k['mode']??'match\x20case'];for await(const [U,d]of Y(J(O[0x0]),Y(...O['slice'](0x1)['map'](L=>J(L,{'hint':w}))))){const L=operations[K](i(U),i(d));if(L)return t(L);}return t(![]);}case'visible':return t(await operations['visible'](O[0x0]['value'],{'context':Q,'stack':a,'automator':c,'signal':X}));case'clickable':case'enabled':case'hovered':return t(await operations[K](O[0x0]['value'],{'context':Q,'stack':a,'automator':c,'signal':X}));case'checked':return t(await operations['checked'](O[0x0]['value'],O[0x1],{'context':Q,'stack':a,'automator':c,'signal':X}));case'populated':return t(await operations['populated'](O[0x0]['value'],{'context':Q,'stack':a,'automator':c,'signal':X}));case'every':case'some':return t(await evaluateExpression(V,{'context':Q,'stack':a,'automator':c,'signal':X}));}}}function validate(B,Q){if(Q==='alphanumeric')return isAlphaNumeric(B);else{if(Q==='numeric')return isNumeric(B);else{if(Q==='capitalized')return isCapitalized(B);else{if(Q==='lowercase')return isLowerCase(B);else{if(Q==='uppercase')return isUpperCase(B);else{if(Q==='camelcase')return isCamelCase(B);else{if(Q==='pascalcase')return isPascalCase(B);else{if(Q==='snakecase')return isSnakeCase(B);else{if(Q==='kebabcase')return isKebabCase(B);else return![];}}}}}}}}}function compare(B,Q,a){if(B instanceof Color||Q instanceof Color){const J=B instanceof Color?B:stringToColor(B),Y=Q instanceof Color?Q:stringToColor(Q);if(!J||!Y)return 0x1;return J['similarTo'](Y)?0x0:0x1;}const c=stringify(B),X=stringify(Q),f=compareNumerically(c,X,a);if(f!=null)return f;return c===X?0x0:c>X?0x1:-0x1;}function compareNumerically(B,Q,a){const c=extractNumber(B,{'preferredLocale':a}),X=extractNumber(Q,{'preferredLocale':a});if(!c||!X)return null;if(B['slice'](0x0,c['pos'])===Q['slice'](0x0,X['pos'])&&B['slice'](c['pos']+c['text']['length'])===Q['slice'](X['pos']+X['text']['length']))return c['value']-X['value'];const f=c['text']===B['trim']();if(f===(X['text']===Q['trim']()))return null;const J=f?priceOrPercentageValue(Q,X):priceOrPercentageValue(B,c);if(J==null)return null;return f?c['value']-J:J-X['value'];}function priceOrPercentageValue(B,Q){const a=B['trim']();if(extractPattern('price',a)!==a&&extractPattern('percentage',a)!==a)return null;return a['startsWith']('-')&&!Q['text']['startsWith']('-')?-Q['value']:Q['value'];}function eq(B,Q,a){return stringify(B)===stringify(Q)||compare(B,Q,a)===0x0;}function lt(B,Q,a){return compare(B,Q,a)<0x0;}function lte(B,Q,a){return compare(B,Q,a)<=0x0;}function gt(B,Q,a){return compare(B,Q,a)>0x0;}function gte(B,Q,a){return compare(B,Q,a)>=0x0;}function match(B,Q){return Q['test'](stringify(B));}function startsWith(B,Q,a){if(typeof B==='string')return B['startsWith'](stringify(Q));else{if(Array['isArray'](B))return B['at'](0x0)===Q;else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof B+'\x20value');}}function endsWith(B,Q,a){if(typeof B==='string')return B['endsWith'](stringify(Q));else{if(Array['isArray'](B))return B['at'](-0x1)===Q;else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof B+'\x20value');}}function includes(B,Q,a){if(typeof B==='string')return B['includes'](stringify(Q));else{if(Array['isArray'](B))return B['includes'](Q);else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof B+'\x20value');}}function includesOnly(B,Q){if(typeof B==='string')return!B['replace'](new RegExp(Q['map'](a=>stringify(a))['join']('|'),'g'),'')['trim']();else{if(Array['isArray'](B))return B['every'](a=>Q['includes'](a));else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof B+'\x20value');}}async function visible(B,{context:Q,stack:a,automator:c,signal:X}){if(isElementDescriptor(B)||isElementReference(B)){const f=await evaluateExpression(B,{'context':Q,'stack':a,'automator':c,'signal':X}),J=await Q['axOps']['findNode'](f,{'stack':a,'signal':X});if(!J)return![];Q['activeAXNode']=J;const {ratio:Y=0x1}=await J['node']['getObscurationInfo']();return Y<=0.5;}else return c instanceof Browser&&!!c['activePage']?.['dialog'];}async function populated(B,{context:Q,stack:a,automator:c,signal:X}){const f=await evaluateExpression({...B,'type':[B['type']??[],'inputbox']['flat']()},{'context':Q,'stack':a,'automator':c,'signal':X}),J=await Q['axOps']['findNode'](f,{'stack':a,'signal':X});if(!J)return![];return Q['activeAXNode']=J,!!await J['node']['getValue']({'hint':'boolean','acceptFormValue':!![]});}async function clickable(B,{context:Q,stack:a,automator:c,signal:X}){const f=await evaluateExpression(B,{'context':Q,'stack':a,'automator':c,'signal':X}),J=await Q['axOps']['findNode'](f,{'stack':a,'signal':X});if(!J)return![];return Q['activeAXNode']=J,await J['node']['isEnabled']()??![];}async function enabled(B,{context:Q,stack:a,automator:c,signal:X}){const f=await evaluateExpression(B,{'context':Q,'stack':a,'automator':c,'signal':X}),J=await Q['axOps']['findNode'](f,{'stack':a,'signal':X});if(!J)return![];return Q['activeAXNode']=J,!J['state']['disabled']&&!J['state']['inert'];}async function hovered(B,{context:Q,stack:a,automator:c,signal:X}){const f=await evaluateExpression(B,{'context':Q,'stack':a,'automator':c,'signal':X}),J=await Q['axOps']['findNode'](f,{'stack':a,'signal':X});if(!J)return![];return Q['activeAXNode']=J,await J['node']['isHovered']()??![];}async function checked(B,Q,{context:a,stack:c,automator:X,signal:f}){const J=await evaluateExpression({'type':'checkbox',...B},{'context':a,'stack':c,'automator':X,'signal':f}),Y=await a['axOps']['findNode'](J,{'stack':c,'signal':f});if(!Y)return![];return a['activeAXNode']=Y,await Y['node']['getValue']({'hint':'boolean'})===Q;}async function*makeIterator(B,{context:Q,stack:a,automator:c,signal:X}){if(!isMapOperation(B)){for(const V of entriesOf(B))yield{...V,'result':V['item']};return;}const [f,J]=B['operands'],Y=await evaluateOperand(f,{'context':Q,'stack':a,'automator':c,'signal':X}),h=['it',...(B['bindings']??[])['map'](k=>k['toLowerCase']())];for(const {index:k,key:t,item:K}of entriesOf(Y)){const O=Q['scope']['bind']({...Object['fromEntries'](h['map'](S=>[S,{'value':K}])),'index':{'value':k},'key':{'value':t}});try{yield{'index':k,'key':t,'item':K,'result':isConditionOperation(J)?await evaluateCondition({'isCondition':!![],'operation':J},{'context':Q,'stack':a,'automator':c,'signal':X}):await evaluateExpression(J,{'context':Q,'stack':a,'automator':c,'signal':X})};}finally{O();}}}function entriesOf(B){if(typeof B==='string')return[...B]['map']((Q,a)=>({'index':a,'key':a,'item':Q}));if(Array['isArray'](B))return B['map']((Q,a)=>({'index':a,'key':a,'item':Q}));if(B&&typeof B==='object')return Object['entries'](B)['map'](([Q,a],c)=>({'index':c,'key':Q,'item':a}));throw new RunnerError('Cannot\x20iterate\x20over\x20the\x20value\x20'+stringify(B)+'\x20as\x20it\x20is\x20not\x20iterable',{'code':ErrorCode['INVALID_DATA']});}async function evaluateExpression(B,{context:Q,stack:a,automator:c,timeout:X,signal:f}){return J(B);async function J(Y){if(isReference(Y)){const h=Y,V=h['scope']??'public';if(!(h['name']['toLowerCase']()in Q['scope'][V]))throw new RunnerError('Unable\x20to\x20resolve\x20parameter\x20or\x20variable\x20with\x20the\x20name\x20\x22'+h['name']+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':h});const k=a['reference'](h),t=Q['scope'][V][h['name']['toLowerCase']()],K=await(h['modifiers']??[])['reduce'](async(O,S)=>{let C=await O;if('get'in S){const G=await J(S['get']);if(typeof C==='string'){if(isJsonString(C))C=parseJsonString(C);else{if(isXmlString(C))C=parseXmlString(C);}}if(Array['isArray'](C)){if(typeof G==='number'){const E=C['at'](G);if(E===void 0x0)throw new RunnerError('No\x20list\x20value\x20was\x20found\x20at\x20index\x20'+G,{'code':ErrorCode['UNRESOLVED_REF'],'ref':h});return E;}}else{if(C&&typeof C==='object'){const W=await C[Symbol['for']('get')]?.(G)??C[G];if(W===void 0x0)throw new RunnerError('No\x20value\x20is\x20mapped\x20to\x20the\x20key\x20\x22'+G+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':h});return W;}}throw new RunnerError('Can’t\x20convert\x20the\x20value\x20'+stringifyJson(C)+'\x20to\x20a\x20dictionary\x20as\x20it\x20is\x20not\x20a\x20valid\x20json\x20object\x20or\x20an\x20XML\x20fragment',{'code':ErrorCode['UNRESOLVED_REF'],'ref':h});}else{if('match'in S){const e=stringify(C),H=await J(S['match']);let q=null;if(typeof H==='function'){const I=H(e);I&&(q=[I],q['index']=e['indexOf'](I),q['input']=e);}else q=e['match'](H);if(!q)throw new RunnerError('The\x20regex\x20'+(typeof H==='function'?'custom\x20matcher':'/'+H['source']+'/')+'\x20does\x20not\x20match\x20the\x20value\x20\x22'+e+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':h});return q['groups']?{...q['groups']}:q['length']===0x1?q[0x0]:q['slice'](0x1);}else return C;}},Promise['resolve'](t['value']));return k(h['type']==='string'?stringify(K):K,{'secret':t['secret']});}else{if(isJSExpressionReference(Y))return await evaluateJSExpression(Y['expression'],{'context':Q,'stack':a,'automator':c,'signal':f});else{if(isInterpolatedString(Y))return(await Promise['all'](Y['chunks']['map'](async O=>isReference(O)||isJSExpressionReference(O)?J(O):O)))['join']('');else{if(isJSExpression(Y))return(await Promise['all'](Y['chunks']['map'](async O=>isReference(O)||isJSExpressionReference(O)?stringifyJSLiteral(await J(O)):O)))['join']('');else{if(isPattern(Y))return'name'in Y?getPatternMatcher(Y['name']):new RegExp(Y['pattern'],Y['flags']);else{if(isStructure(Y)){if(Y['type']==='array')return Promise['all'](Y['items']['map'](async O=>J(O)));else return Object['fromEntries'](await Promise['all'](Y['items']['map'](async({key:O,value:S})=>[await J(O),await J(S)])));}else{if(isChromeTabDescriptor(Y))return{...Y,...'index'in Y&&Y['index']!=null?{'index':await J(Y['index'])}:{},...'title'in Y&&Y['title']!=null?{'title':await J(Y['title'])}:{}};else{if(isElementReference(Y)){const O=Q['activeAXNode'];if(!O)throw new RunnerError('`it`\x20does\x20not\x20refer\x20to\x20any\x20element\x20yet',{'code':ErrorCode['UNRESOLVED_REF']});return a['descriptor'](Y)({'node':O});}else{if(isElementDescriptor(Y)){if(!Array['isArray'](Y['anchor'])&&isDialogDescriptor(Y['anchor']?.['element'])){if(isPattern(Y['title']))throw new RunnerError('An\x20element\x20with\x20a\x20pattern\x20title\x20cannot\x20target\x20the\x20native\x20browser\x20dialog',{'code':ErrorCode['ILLEGAL_ELEMENT_DESCRIPTOR']});return{'isDialogElementDescriptor':!![],'title':toDialogButtonTitle(await J(Y['title']))??'ok'};}async function S(W){if(isDialogDescriptor(W))throw new RunnerError('The\x20native\x20browser\x20dialog\x20can\x20only\x20be\x20used\x20as\x20the\x20single\x20direct\x20anchor\x20of\x20the\x20target\x20element',{'code':ErrorCode['ILLEGAL_ELEMENT_DESCRIPTOR']});return J(W);}const {reference:C,...G}=Y;let E={};if(C){const W=await J(C),e=parseIndex(W);E=e!==null?{'nth':e}:{'title':stringify(W)};}else{if('nth'in Y){const H=await J(Y['nth']);E={'nth':typeof H==='number'?H:parseIndex(H)??Number(H)};}}return a['descriptor'](Y)({...G,...E,...'title'in Y&&!isPattern(Y['title'])?{'title':await J(Y['title'])}:{},...'color'in Y?{'color':await J(Y['color'])}:{},...'selector'in Y&&Y['selector']?.['selector']?{'selector':{...Y['selector'],'selector':await J(Y['selector']['selector'])}}:{},...'anchor'in Y&&Y['anchor']?{'anchor':Array['isArray'](Y['anchor'])?await Promise['all'](Y['anchor']['map'](async q=>({...q,'element':q['element']&&await S(q['element'])}))):{...Y['anchor'],'element':Y['anchor']['element']&&await S(Y['anchor']['element'])}}:{},...'fallback'in Y?{'fallback':await J(Y['fallback'])}:{}});}else{if(isExtractor(Y)){const q=await extractValue(Y,{'context':Q,'stack':a,'automator':c,'timeout':X,'signal':f});if(q===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});return q;}else{if(isExpressionOperation(Y)){const I=a['operation'](Y);if(Y['operator']==='every'||Y['operator']==='some'){const R=Y['operands'][0x0]['value'],F=Y['operator']==='some'?Number(await J(Y['min']??0x1)):null;if(F!==null&&(!Number['isInteger'](F)||F<0x1))throw new RunnerError('The\x20minimum\x20number\x20of\x20matching\x20items\x20must\x20be\x20a\x20positive\x20integer,\x20but\x20got\x20'+F,{'code':ErrorCode['INVALID_DATA']});let w=0x0,i=![];for await(const U of makeIterator(R,{'context':Q,'stack':a,'automator':c,'signal':f})){if(U['result'])++w;else i=!![];if(F===null?i:w>=F)break;}return I(F===null?!i:w>=F);}else{if(Y['operator']==='map')return I(await Array['fromAsync'](makeIterator(Y,{'context':Q,'stack':a,'automator':c,'signal':f}),d=>d['result']));}const n=await Y['operands']['reduce'](async(d,L)=>{const s=await d;return s['push'](await evaluateOperand(L,{'context':Q,'stack':a,'automator':c,'signal':f})),s;},Promise['resolve']([]));if(Y['operator']==='size')return I(sizeOf(n[0x0]));else{if(Y['operator']==='keys')return I(keysOf(n[0x0]));else{if(Y['operator']==='values')return I(valuesOf(n[0x0]));else{if(Y['operator']==='entries')return I(entriesOf$1(n[0x0]));else{if(isNumberOperation(Y)){const [d,L]=n['map'](s=>{const A=typeof s==='string'&&s['trim']()!==''?Number(s):s;if(typeof A!=='number'||Number['isNaN'](A))throw new RunnerError('Cannot\x20evaluate\x20\x22'+Y['operator']+'\x22\x20operation\x20on\x20a\x20non-numeric\x20value\x20'+JSON['stringify'](s),{'code':ErrorCode['INVALID_DATA']});return A;});if(Y['operator']==='add')return I(d+L);else{if(Y['operator']==='sub')return I(d-L);else{if(Y['operator']==='div')return I(d/L);else return I(d*L);}}}else throw new RunnerError('Unknown\x20operator');}}}}}else{if(isCondition(Y))return evaluateCondition(Y,{'context':Q,'stack':a,'automator':c,'signal':f});else{if(isOTP(Y)){if(!Q['actions']['generateOTP'])throw new RunnerError('generateOTP\x20callback\x20not\x20provided',{'code':ErrorCode['INTERNAL']});const s=a['generator'](Y),A=await J(Y['user']);return s(await Q['actions']['generateOTP'](A));}else{if(isFileHandle(Y)){const Z=await J(Y['filename']);try{return await Q['actions']['resolveFilename']?.(Z)??Z;}catch{return Z;}}else{if(isRandomValue(Y)){const m=a['generator'](Y);if(Y['type']==='number')return m(Math['random']());else{if(!Q['actions']['generateRandomValue'])throw new RunnerError('generateRandomValue\x20callback\x20not\x20provided',{'code':ErrorCode['INTERNAL']});return m(await Q['actions']['generateRandomValue']({...Y,'description':Y['description']?await J(Y['description']):void 0x0}));}}else return Y;}}}}}}}}}}}}}}}}var InstructionExecutionStartedEvent=class extends ProgressEvent{['status'];['done']=![];constructor({preStep:B}={}){super(),this['status']=B?'runningPreStepInstruction':'runningInstruction';}},InstructionExecutionFinishedEvent=class extends ProgressEvent{['status'];['done']=!![];constructor({preStep:B}={}){super(),this['status']=B?'runningPreStepInstruction':'runningInstruction';}},ActionExecutionStartedEvent=class extends ProgressEvent{['status']='runningAction';['done']=![];},ActionExecutionFinishedEvent=class extends ProgressEvent{['status']='runningAction';['done']=!![];},AXNodeSearchStartedEvent=class extends ProgressEvent{['status']='searchingForElement';['done']=![];['descriptor'];constructor({descriptor:B}){super(),this['descriptor']=B;}},AXNodeSearchFinishedEvent=class extends ProgressEvent{['status']='searchingForElement';['done']=!![];['descriptor'];['node'];constructor({descriptor:B,node:Q}){super(),this['descriptor']=B,this['node']=Q;}},NavigationWaitStartedEvent=class extends ProgressEvent{['status']='waitingForNavigation';['done']=![];},NavigationWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForNavigation';['done']=!![];},LoadWaitStartedEvent=class extends ProgressEvent{['status']='waitingForResourcesLoad';['done']=![];},LoadWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForResourcesLoad';['done']=!![];},OutgoingRequestsWaitStartedEvent=class extends ProgressEvent{['status']='waitingForOutgoingRequests';['done']=![];},OutgoingRequestsWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForOutgoingRequests';['done']=!![];},StabilizationWaitStartedEvent=class extends ProgressEvent{['status']='waitingForStabilization';['done']=![];},StabilizationWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForStabilization';['done']=!![];};function makeValuesStack(){return new ValuesStack();}var ValuesStack=class{#id=0x1;#pending=new Set();#items=new Map();#entities=new Map();#relations=new Map();#item(B,Q,a,c){const X=this.#id++;if(a)return this.#add(X,{'type':B,'entity':Q,'value':a,...c});else return this.#pending['add'](X),this.#relations['set'](X,[]),(f,J)=>{return this.#pending['delete'](X),this.#add(X,{'type':B,'entity':Q,'value':f,...J});};}#add(B,Q){this.#items['set'](B,Q),this.#pending['forEach'](c=>this.#relations['get'](c)['push'](B));let a=this.#entities['get'](Q['entity']);if(!a)this.#entities['set'](Q['entity'],a=[]);return a['push'](B),Q['value'];}*#related(B,Q){for(const a of[B,...this.#relations['get'](B)??[]]){const c=this.#items['get'](a);if(c&&(!Q||Q===c['type']))yield c;}}['descriptor'](B,Q){return Q?this.#item('descriptor',B,Q):this.#item('descriptor',B);}['node'](B,Q){return Q?this.#item('node',B,Q):this.#item('node',B);}['reference'](B,Q,a){return Q?this.#item('reference',B,Q,a):this.#item('reference',B);}['extractor'](B,Q,a){return Q?this.#item('extractor',B,Q,a):this.#item('extractor',B);}['generator'](B,Q,a){return Q?this.#item('generator',B,Q,a):this.#item('generator',B);}['operand'](B,Q,a){return Q?this.#item('operand',B,Q,a):this.#item('operand',B);}['operation'](B,Q){return Q?this.#item('operation',B,Q):this.#item('operation',B);}['nodeFor'](B,Q){const a=this.#entities['get'](B)?.['find'](c=>this.#items['get'](c)?.['value']===Q);if(a)return Array['from'](this.#related(a,'node'))[0x0]?.['value'];}['isSecret'](B){if(isReference(B)){const [Q]=this.#entities['get'](B)??[];if(Q)return Array['from'](this.#related(Q,'reference'))[0x0]?.['secret'];}else{if(isInterpolatedString(B))return B['chunks']['some'](a=>this['isSecret'](a));else{if(isStructure(B)){if(B['type']==='array')return B['items']['some'](a=>this['isSecret'](a));else return B['items']['some'](a=>this['isSecret'](a['key'])||this['isSecret'](a['value']));}}}}*['descriptors'](B){if(B){const Q=this.#entities['get'](B)??[];for(const a of Q)for(const {value:c}of this.#related(a,'descriptor'))yield c;}else{for(const {type:X,value:f}of this.#items['values']())if(X==='descriptor')yield f;}}*['nodes'](B){if(B){const Q=this.#entities['get'](B)??[];for(const a of Q)for(const {entity:c,value:X}of this.#related(a,'node'))yield{'node':X,'descriptor':c};}else{for(const {type:f,entity:J,value:Y}of this.#items['values']())if(f==='node')yield{'node':Y,'descriptor':J};}}*['references'](){for(const {type:B,entity:Q,value:a,...c}of this.#items['values']())if(B==='reference')yield{'reference':Q,'value':a,...c};}*['extractors'](){for(const [B,{type:Q,entity:a,value:c,...X}]of this.#items['entries']())if(Q==='extractor')yield{'extractor':a,'value':c,'element':Array['from'](this.#related(B,'node'))[0x0]?.['entity'],...X};}*['operands'](){for(const [B,{type:Q,entity:a,value:c,...X}]of this.#items['entries']())if(Q==='operand')yield{'operand':a,'value':c,'element':Array['from'](this.#related(B,'node'))[0x0]?.['entity'],...X};}};async function tryMakeElementNotObscured(B,{timeout:Q,signal:a}){const c=await getVisibleElementFromNode(B);if(!c)return;let X=!![];const f=setTimeout(()=>X=![],Q);do{await c['tryToUnobscure']();const {isObscured:J,obscuringElement:Y}=await c['isObscured']();if(!J){clearTimeout(f);return;}if(Y&&await Y['isLabelOf'](B['node'])){clearTimeout(f);return;}await sleep(0x3e8,{'signal':a});}while(X);throw new RunnerError('Element\x20is\x20obscured',{'code':ErrorCode['OBSCURED_ELEMENT']});}async function getVisibleElementFromNode(B){let Q;for(const a of B['incorporated'])if(await a['isVisible']()&&await a['execute'](c=>c instanceof Element)){Q=a;break;}if(!Q){if(!B['parent'])return;return getVisibleElementFromNode(B['parent']);}return Q;}async function revealElements(B){const Q=[];for(const {node:a}of B){const c=(await Promise['all'](Q['map'](async X=>X['node']['equal'](a['node'])['catch'](()=>![]))))['indexOf'](!![]);if(c>=0x0)Q['splice'](c,0x1);Q['push'](a);}for(const X of Q)try{await(await getVisibleElementFromNode(X))?.['scrollIntoView']();}catch(f){error('elementRevealFailed',{'error':f});}}const PDF_STATE={'ready':'data-nlp-pdf-ready','error':'data-nlp-pdf-error','currentPage':'data-nlp-pdf-current-page','isolate':'data-nlp-pdf-isolate','isolatedPage':'data-nlp-pdf-isolated-page'},PDF_BYTES_PLACEHOLDER='__NLP_PDF_BYTES__';function isPdfViewerFrame(B){return Object['entries'](B['response']?.['headers']??{})['some'](([Q])=>Q['toLowerCase']()==='x-nlp-pdf-viewer');}async function waitForReady(B,Q=0x4e20){return B['defaultExecute'](async(a,c,X)=>{const f=document['documentElement'];function J(){return f['getAttribute'](a)==='true'||f['getAttribute'](c)!=null;}if(J())return;await new Promise(Y=>{function h(){V['disconnect'](),clearTimeout(k),Y();}const V=new MutationObserver(()=>J()&&h());V['observe'](f,{'attributes':!![],'attributeFilter':[a,c]});const k=setTimeout(h,X);});},[PDF_STATE['ready'],PDF_STATE['error'],Q],{'await':!![]});}var Handler=class extends EventTargetNode{#captures={};#controller=new AbortController();#stack=makeValuesStack();#metrics;['automator'];['context'];['instruction'];['signal'];['shouldCapture'];['loop'];['stepId'];['correlationId'];['stepIndex'];['shouldNotThrowOnUnexpectedNavigationStatus'];['expectedNavigationStatuses'];get['action'](){return this['instruction'];}get['stack'](){return this.#stack;}get['metrics'](){return this.#metrics;}get['findTimeout'](){return this['context']['scope']['internal']['findTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['frameStabilityTimeout'](){return this['context']['scope']['internal']['frameStabilityTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['navigateTimeout'](){return this['context']['scope']['internal']['navigateTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['screenshotTimeout'](){return this['context']['scope']['internal']['screenshotTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}constructor({automator:B,context:Q,instruction:a,signal:c,shouldCapture:X,loop:f,stepId:J,correlationId:Y,stepIndex:h,shouldNotThrowOnUnexpectedNavigationStatus:V,expectedNavigationStatuses:k}){super(),this.#metrics={'platform':B['type']},this['automator']=B,this['context']=Q,this['instruction']=a,this['loop']=f,this['stepId']=J,this['stepIndex']=h,this['correlationId']=Y,this['signal']=c?AbortSignal['any']([this.#controller['signal'],c]):this.#controller['signal'],this['shouldCapture']=X??![],this['shouldNotThrowOnUnexpectedNavigationStatus']=V??![],this['expectedNavigationStatuses']=k??[];}['abort'](B){this.#controller['abort'](B??new RunnerError('The\x20instruction\x20was\x20aborted\x20before\x20it\x20got\x20to\x20finish',{'core':ErrorCode['HANDLER_ABORTED']}));}['throwIfAborted'](){this['signal']['throwIfAborted']();}['throwIfNoElement'](B){if(!B)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});}['throwIfBlocked'](){if(this['automator']instanceof Browser&&this['automator']['activePage']['dialog']&&this['automator']['activePage']['dialog']['type']!=='filepicker')throw new RunnerError('Cannot\x20proceed\x20until\x20native\x20blocking\x20dialog\x20is\x20handled',{'code':ErrorCode['UNHANDLED_DIALOG']});}['throwIfExceededAllowedTimeout'](B){const Q=this['context']['scope']['internal']['maxWaitTimeout']?.['value']??0x1d4c0;if(B>Q)throw new RunnerError('Timeout\x20of\x20'+B+'ms\x20exceeds\x20maximum\x20allowed\x20timeout\x20of\x20'+Q+'ms',{'code':ErrorCode['EXCEEDED_ALLOWED_TIMEOUT'],'timeout':B});}async['throwIfCannotTypeToElement'](B){if(!B||!await B['canTypeInto']())throw new RunnerError('Element\x20is\x20not\x20a\x20textbox',{'code':ErrorCode['ELEMENT_NOT_TEXTBOX']});}async #isBrowserResponsive(){if(!(this['automator']instanceof Browser))return void 0x0;try{return await this['automator']['connection']['execute']('Browser.getVersion',void 0x0,{'timeout':Math['min'](this['automator']['connection']['timeout'],0x1388)}),!![];}catch{return![];}}async['run'](){let B;try{if(this['automator']instanceof Browser&&this['frameStabilityTimeout'])this['automator']['frameStabilityTimeout']=this['frameStabilityTimeout'];await this['stabilize']('basic');const f=performance['now']();try{B=await this['handle']();}finally{this.#metrics['handleMs']=performance['now']()-f;}}catch(J){if(J instanceof StaleNodeError||J instanceof StaleRemoteObjectHandleError)return log('handlerRetriedOnStaleNode',{'error':J}),this.#metrics={'platform':this['automator']['type']},this['run']();else{if(J instanceof FlushError)log('handlerFlushed',{'error':J}),B={'status':'flushed','meta':{'reason':J['message']}};else{if(J instanceof AutomatorError){error('handlerAutomatorError',{'error':J});const {code:Y,meta:h}=translateAutomatorError(J,{'retriable':J instanceof CommandTimedOutError?await this.#isBrowserResponsive():void 0x0});B={'status':'error','error':J['message'],'code':Y,'meta':h};}else{if(J instanceof RunnerError)error('handlerRunnerError',{'error':J}),B={'status':'error','error':J['message'],'code':J['code'],'meta':J['meta']};else this['signal']['aborted']&&(J['code']==='ABORT_ERR'||J===this['signal']['reason'])?(error('handlerAborted',{'error':J}),B={'status':'aborted','meta':{'reason':J['cause']?.['message']??J['message']}}):(error('handlerInternalError',{'error':J}),B={'status':'error','error':J['message']??'unknown\x20error','code':ErrorCode['INTERNAL'],'meta':{'original':J}});}}}if(!Object['hasOwn'](this.#captures,'after')&&B['status']!=='aborted')await this['after']();}const Q=new Map(Array['from'](this.#stack['references'](),({reference:V,value:k,...t})=>[V,{'value':k,...t}])),a=new Map(Array['from'](this.#stack['extractors'](),({extractor:V,value:k,element:t,...K})=>[V,{'value':k,'element':t,...K}])),c=new Map(Array['from'](this.#stack['operands'](),({operand:V,value:k,element:t,...K})=>[V,{'value':k,'element':t,...K}])),X=getInstructionText(this['instruction']);return{...B,...this.#captures,...X?{'text':X}:{},'values':{'references':Q,'extractors':a,'operands':c},'metrics':this.#metrics};}async #accumulate(B,Q){const a=performance['now']();try{return await Q();}finally{this.#metrics[B]=(this.#metrics[B]??0x0)+(performance['now']()-a);}}async['stabilize'](B='strict'){return this.#accumulate('stabilizeMs',async()=>{await this['automator']['stabilize'](B,{'signal':this['signal'],'timeout':this['screenshotTimeout']});if(this['automator']instanceof Browser){if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);}});}async['evaluate'](B){return evaluateExpression(B,{'context':this['context'],'stack':this.#stack,'automator':this['automator'],'timeout':this['findTimeout']??0x2710,'signal':this['signal']});}async['element'](B){const Q=await this['context']['axOps']['findNode'](await this['evaluate'](B),{'stack':this.#stack,'timeout':this['findTimeout']??0x2710,'signal':this['signal'],'metrics':this.#metrics});return Q&&(this['context']['activeAXNode']=Q,this['dispatch'](new HandlerAXNodeFoundEvent(Q))),Q;}async['elements'](B){return this['context']['axOps']['findNodes'](await this['evaluate'](B),{'stack':this.#stack,'timeout':this['findTimeout']??0x2710,'signal':this['signal'],'metrics':this.#metrics});}async['capture'](){if(!this['shouldCapture'])return;try{await this['automator']['stabilize']('basic',{'signal':this['signal']});if(this['automator']['blocked'])return;const B=await this['automator']['captureScreenshot'](),Q=((async()=>{try{return await this['automator']['activePage']?.['mainFrame']['execute'](()=>({'width':innerWidth,'height':innerHeight,'scrollX':scrollX,'scrollY':scrollY}));}catch{return;}})());return{'image':B,'elements':await Array['from'](this.#stack['nodes']())['reduce'](async(a,{node:c,descriptor:X})=>{try{if(c===c['tree']['root'])return await a;const {x:f,y:J,width:Y,height:h}=await c['node']['getScreenBox'](),V=await c['node']['getDescription']();return await a['then'](k=>k['concat']({'region':{'x':f,'y':J,'width':Y,'height':h},'descriptor':X,'label':V}));}catch(k){return error('elementMarkerExtractionFailed',{'error':k}),a;}},Promise['resolve']([])),'viewport':await Q};}catch(a){error('captureFailed',{'error':a});}}async['reveal'](){if(!this['shouldCapture']||!(this['automator']instanceof Browser))return;return this.#accumulate('revealMs',async()=>{await revealElements(Array['from'](this.#stack['nodes']())['filter'](({node:B})=>B!==B['tree']['root']));});}async['before'](){bus['dispatch'](new ActionExecutionStartedEvent()),this.#captures['before']=await this.#accumulate('captureMs',()=>this['capture']());}async['after'](){this.#captures['after']=await this.#accumulate('captureMs',()=>this['capture']()),bus['dispatch'](new ActionExecutionFinishedEvent());}},HandlerAXNodeFoundEvent=class extends Event{['node'];constructor(B,Q){super('nodeFound',Q),this['node']=B;}},AssertHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const B=await this['evaluate'](this['action']['timeout'])??this['findTimeout']??0x7530,Q=Date['now']();let a=0x0,c=!![];const X=setTimeout(()=>c=![],B);do{this['throwIfAborted'](),++a;try{if(await this['evaluate'](this['action']['condition']))return clearTimeout(X),log('assertionEvaluated',{'passed':!![],'attempts':a,'durationMs':Date['now']()-Q,'condition':this['action']['condition']}),await this['reveal'](),await this['after'](),{'status':'asserted'};else{if(Array['from'](this['stack']['descriptors'](this['action']['condition']['operation']))['length']===0x0){clearTimeout(X);break;}}}catch(f){if(!c||this['signal']['aborted'])throw f;}await sleep(0x3e8,{'signal':this['signal']});}while(c);log('assertionEvaluated',{'passed':![],'attempts':a,'durationMs':Date['now']()-Q,'condition':this['action']['condition']}),await this['reveal'](),await this['after']();throw new RunnerError('Assertion\x20failed',{'code':ErrorCode['FAILED_ASSERTION']});}},EmptyHandler=class extends Handler{async['handle'](){return await this['stabilize'](),await this['before'](),await this['after'](),{'status':'empty'};}};function makeUrlData(B){const Q=new URL(B);return{'href':B,'protocol':Q['protocol']['replace'](/:$/,''),'user':Q['username'],'password':Q['password'],'host':Q['host'],'hostname':Q['hostname'],'port':Q['port'],'path':Q['pathname'],'query':Q['search'],'anchor':Q['hash'],[Symbol['for']('stringify')](){return B;}};}async function evaluateHeaders(B,{evaluate:Q,stack:a}){const c=new Headers(),X=new Set();for(const f of B){const J=await Q(f['name']);if(!/^[a-zA-Z0-9_-]+$/['test'](J))throw new RunnerError('The\x20header\x20name\x20\x22'+J+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_HEADER'],'header':f});const Y=await Q(f['value']),h=f['secret']||(a['isSecret'](f['value'])??![]);if(!/^[a-zA-Z0-9 :;.,\\/"'?!(){}[\]@<>=+*#$&`|~^%_-]+$/['test'](Y))throw new RunnerError(h?'The\x20value\x20of\x20the\x20\x22'+J+'\x22\x20header\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters':'The\x20header\x20value\x20\x22'+Y+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_HEADER'],'header':f});c['append'](J,Y);if(h)X['add'](J['toLowerCase']());}return{'headers':c,'secrets':X};}var FetchHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const B={'headers':new Set(),'cookies':new Set(),'body':![]},Q=await this['evaluate'](this['action']['url']);let a=this['action']['method']?.['toUpperCase']();if(!a&&this['action']['body'])a='POST';const c=new Request(Q,{'method':a});if(this['action']['headers']){const k=await evaluateHeaders(this['action']['headers'],{'evaluate':t=>this['evaluate'](t),'stack':this['stack']});k['headers']['forEach']((t,K)=>c['headers']['set'](K,t)),k['secrets']['forEach'](t=>B['headers']['add'](t));}let X;if(this['action']['body']){const t=await this['evaluate'](this['action']['body']['data']);B['body']=this['stack']['isSecret'](this['action']['body']['data'])??![];let K=this['action']['body']['type'];if(!K){if(typeof t==='string'){if(isJsonString(t))K='json';else{if(isXmlString(t))K='xml';}}else K='json';}if(K==='base64'){if(typeof t!=='string'||!isBase64String(t))throw new RunnerError('Body\x20is\x20not\x20of\x20base64\x20format');X=new Uint8Array(N['from'](t,'base64'));}else{if(K==='xml'){if(typeof t!=='string'){if(t&&typeof t==='object'&&!Array['isArray'](t))X=stringifyXml(t);else throw new RunnerError('Body\x20could\x20not\x20be\x20converted\x20to\x20XML\x20format');}else X=t;if(!c['headers']['has']('Content-Type'))c['headers']['set']('Content-Type','application/xml;charset=UTF-8');}else{X=typeof t!=='string'?stringifyJson(t):t;if(K==='json'&&!c['headers']['has']('Content-Type'))c['headers']['set']('Content-Type','application/json;charset=UTF-8');}}}if(this['action']['auth']){if(this['action']['auth']['type']==='basic'){const O=await this['evaluate'](this['action']['auth']['username']),S=await this['evaluate'](this['action']['auth']['password']),C='Authorization';c['headers']['set'](C,'Basic\x20'+N['from'](O+':'+S)['toString']('base64')),B['headers']['add'](C['toLowerCase']());}}if(this['action']['cookies']){const G=[];for(const W of this['action']['cookies']){const e=await this['evaluate'](W['name']);if(/=/['test'](e))throw new RunnerError('The\x20cookie\x20name\x20\x22'+e+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_COOKIE'],'cookie':W});const H=await this['evaluate'](W['value']),q=W['secret']||this['stack']['isSecret'](W['value']);G['push'](e+'='+H);if(q)B['cookies']['add'](e);}const E='Cookie';c['headers']['set'](E,G['join'](';\x20'));if(B['cookies']['size']>0x0)B['headers']['add'](E['toLowerCase']());}const f={'url':makeUrlData(c['url']),'headers':J(c['headers']),'cookies':Y(c['headers']),...X&&{'body':{'value':X,'secret':B['body']}}};try{const I=await z(c,{'body':X,'dispatcher':this['context']['dispatcher']}),n={'status':I['status'],'statustext':I['statusText'],'body':await V(I),'headers':J(I['headers']),'cookies':h(I['headers']),[Symbol['for']('get')](R){if(R==='body')return this['body']['value'];else return this[R];},[Symbol['for']('stringify')](){return this['body']['value'];}};this['context']['scope']['public']['response']={'value':n};if(this['action']['statuses']?this['action']['statuses']!=='*'&&!this['action']['statuses']['includes'](n['status']):n['status']<0xc8||n['status']>0x12b)throw new RunnerError('The\x20request\x20to\x20url\x20\x22'+Q+'\x22\x20resulted\x20with\x20an\x20unexpected\x20status\x20code\x20'+n['status'],{'code':ErrorCode['UNEXPECTED_REQUEST_STATUS'],'status':n['status'],'response':n,'request':f});return await this['after'](),{'status':'fetched','meta':{'response':n,'request':f}};}catch(R){if(R['message']==='fetch\x20failed')throw new RunnerError('Failed\x20to\x20send\x20the\x20request',{'code':ErrorCode['FETCH_FAILED'],'request':f,'cause':R['cause']});else throw R;}function J(F){const w={[Symbol['for']('get')](i){return this[i['toLowerCase']()]['value'];}};return F['forEach']((i,U)=>{w[U]={'value':i,'secret':B['headers']['has'](U)};}),w;}function Y(F){const w={[Symbol['for']('get')](i){return this[i]['value'];}};return(F['get']('Cookie')?.['split'](';')??[])['forEach'](i=>{const [U,d]=i['split'](/=(.+)/);w[U]={'value':d,'secret':B['cookies']['has'](U)};}),w;}function h(F){const w={[Symbol['for']('get')](i){return this[i]['value'];}};return F['getSetCookie']()['forEach'](i=>{const [U,d]=i['split'](/=(.+)/);w[U]={'value':d,'secret':B['cookies']['has'](U)};}),w;}async function V(F){const w=await F['text']();if(w){const i=F['headers']['get']('Content-Type');if(i?.['includes']('application/json'))return{'value':{...parseJsonString(w),[Symbol['for']('stringify')]:()=>w},'secret':![]};else{if(i?.['includes']('application/xml'))return{'value':{...parseXmlString(w),[Symbol['for']('stringify')]:()=>w},'secret':![]};}}return{'value':w,'secret':![]};}}},InitializeScopeHandler=class extends Handler{async['handle'](){return await this['stabilize'](),await this['before'](),this['context']['scope']['initialize']({'input':await(this['instruction']['parameters']??[])['reduce'](async(B,{name:Q,value:a,secret:c})=>{return B['then'](async X=>({...X,[Q]:{'value':await this['evaluate'](a),'secret':c}}));},Promise['resolve']({})),'public':{},'internal':{}}),this['context']['scope']['internal']['forceRunningAssertions']={'value':this['instruction']['options']?.['assertions']},this['context']['scope']['internal']['forceRunningNavigation']={'value':this['instruction']['options']?.['navigation']},await this['after'](),{'status':'scope\x20initialized','parameters':this['context']['scope']['active']?.['input']};}},SetVariableHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const B=this['action']['scope']??'public',Q=await this['evaluate'](this['action']['data']['value']),a=this['action']['data']['secret']||(this['stack']['isSecret'](this['action']['data']['value'])??![]);let c;if(this['action']['destruction']){if(Array['isArray'](Q))c=(f,J)=>Q[J];else{if(Q!==null&&typeof Q==='object')c=f=>Q[f];else c=()=>Q;}}else c=()=>Q;const X=this['action']['names']['map']((f,J)=>{const Y=f['name']['toLowerCase'](),h=c(f['name'],J),V=this['context']['scope'][B][Y],k={'value':h,'secret':a||f['secret']||![]};return this['context']['scope'][B][Y]=k,{'name':Y,'previous':V,'current':k};});return await this['after'](),{'status':'variable\x20set','meta':{'variables':X,'scope':B}};}};async function isolatePdfPage(B){const Q=B['activePage']?.['mainFrame'];if(!Q||!isPdfViewerFrame(Q))return noop$1;try{await callViewer(Q,'isolate');}catch(a){return error('pdfPageIsolationFailed',{'error':a}),noop$1;}return async()=>{await callViewer(Q,'restore')['catch'](c=>error('pdfPageRestoreFailed',{'error':c}));};}async function noop$1(){}function callViewer(B,Q){return B['defaultExecute'](a=>globalThis['nlpPdfState']?.[a]?.(),[Q]);}var VisualCheckHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']('paranoid');const B=await isolatePdfPage(this['automator']);try{return await this['before'](),await this['context']['actions']['check'](),await this['after'](),{'status':'visually\x20checked'};}finally{await B();}}},WaitHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const B=await this['evaluate'](this['action']['timeout']);if(B)this['throwIfExceededAllowedTimeout'](B);if(!this['action']['condition'])return await sleep(B??0x3e8,{'signal':this['signal']}),await this['after'](),{'status':'success'};const Q=B??this['findTimeout']??0xea60,a=Date['now']();let c=0x0,X=!![];const f=setTimeout(()=>X=![],Q);do{this['throwIfAborted'](),++c;try{const J=await this['evaluate'](this['action']['condition']);debug('waitConditionEvaluated',{'conditionMet':Boolean(J),'attempt':c,'elapsedMs':Date['now']()-a,'timeout':Q});if(J)return clearTimeout(f),await this['reveal'](),await this['after'](),{'status':'success'};}catch(Y){if(!X||this['signal']['aborted'])throw Y;}await sleep(0x3e8,{'signal':this['signal']});}while(X);throw new RunnerError('Timeout\x20waiting\x20for\x20condition\x20to\x20match',{'code':ErrorCode['CONDITION_TIMED_OUT'],'timeout':Q,'condition':this['action']['condition']});}},DefinePreinstructionsHandler=class extends Handler{async['handle'](){return{'status':'preinstructions\x20defined','meta':{'preinstructions':this['instruction']['type']==='set\x20preinstructions'?this['instruction']['instructions']:[]}};}},TryHandler=class extends Handler{async['handle'](){return{'status':'tried','meta':{'next':this['instruction']['instructions']}};}},IfHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const B=await this['evaluate'](this['instruction']['condition']);return await this['reveal'](),await this['after'](),{'status':'condition\x20evaluated','meta':{'met':B,'next':B?this['instruction']['then']:this['instruction']['otherwise']}};}};async function openLoopBindings(B,Q){const a=[];for(let X=B;X;X=X['parent'])a['unshift'](X);const c=[];for(const f of a){const J=await bindingsOf(f,Q);if(!J)continue;c['push'](Q['context']['scope']['bind'](J['values']));if(J['node'])Q['context']['activeAXNode']=J['node'];}return()=>{for(const Y of c['reverse']())Y();};}async function bindingsOf(B,Q){const a=B['iteration']-0x1;if(a<0x0)return void 0x0;const c=B['head'];if(!('iterable'in c))return{'values':{'index':{'value':a},'key':{'value':a}}};if(isElementIterable(c['iterable'])){await Q['automator']['stabilize']('strict',{'signal':Q['signal']});const J=await evaluateExpression(c['iterable'],Q),Y=(await Q['context']['axOps']['findNodes'](J,{'stack':Q['stack'],'signal':Q['signal']}))[a];if(!Y)return void 0x0;return{'values':{'index':{'value':a},'key':{'value':a}},'node':Y};}const X=await evaluateExpression(c['iterable'],Q),f=(await Array['fromAsync'](makeIterator(X,Q)))[a];if(!f)return void 0x0;return{'values':{...Object['fromEntries']((c['bindings']??[])['map'](h=>[h,{'value':f['item']}])),'it':{'value':f['item']},'index':{'value':f['index']},'key':{'value':f['key']}}};}function isElementIterable(B){if(!B||typeof B!=='object')return![];return!('isStructure'in B||'isRef'in B||'isJSExpressionRef'in B||'isInterpolatedString'in B);}const DEFAULT_ITERATION_LIMIT=0x14,MAX_ITERATION_LIMIT=0x64;var LoopHandler=class extends Handler{async['handle'](){const B=this['instruction'];if(B['instructions']['length']===0x0)return this.#decide(B);const Q=this.#state(),a='iterable'in B?await this.#iterate(B,Q):await this.#repeat(B,Q);if(!a&&!('iterable'in B))this.#bind(Q,{'index':Q['iteration'],'key':Q['iteration']});if(a)return Q['unbind']?.(),this['context']['loops']?.['delete'](B),{'status':'looped','meta':{'iteration':Q['iteration'],'done':!![]}};if(Q['iteration']>0x0){const c=await this['evaluate'](B['wait']);if(c)await sleep(c,{'signal':this['signal']});}return Q['iteration']+=0x1,log('loopIterationStarted',{'iteration':Q['iteration'],'total':Q['total'],'correlationId':this['correlationId']}),{'status':'looped','meta':{'iteration':Q['iteration'],'done':![],'next':B['instructions']}};}async #repeat(B,Q){const a=await this['evaluate'](B['times']);if(a!=null&&!B['condition'])Q['total']=a;const c=Math['min'](this['context']['scope']['internal']['loopIterationLimit']?.['value']??DEFAULT_ITERATION_LIMIT,MAX_ITERATION_LIMIT),X=a==null?c:Math['min'](a,c);if(Q['iteration']>=X){if(a!=null&&Q['iteration']>=a)return!![];throw new RunnerError('The\x20loop\x20exceeded\x20its\x20limit\x20of\x20'+c+'\x20iterations',{'code':ErrorCode['LOOP_LIMIT_EXCEEDED'],'meta':{'iteration':Q['iteration'],'limit':c}});}return Boolean(B['condition'])&&!await this['evaluate'](B['condition']);}async #iterate(B,Q){if(isElementIterable(B['iterable'])){await this['stabilize'](),Q['iterable']??=await this['evaluate'](B['iterable']);const f=await this['elements'](Q['iterable']);Q['total']=f['length'];const J=f[Q['iteration']];if(!J)return!![];return this.#bind(Q,{'index':Q['iteration'],'key':Q['iteration']},J),![];}const a=await this['evaluate'](B['iterable']);Q['entries']??=await Array['fromAsync'](makeIterator(a,{'context':this['context'],'stack':this['stack'],'automator':this['automator'],'signal':this['signal']})),Q['total']=Q['entries']['length'];const c=Q['entries'][Q['iteration']];if(!c)return!![];const X=Object['fromEntries']((B['bindings']??[])['map'](Y=>[Y,c['item']]));return this.#bind(Q,{...X,'it':c['item'],'index':c['index'],'key':c['key']}),![];}#bind(B,Q,a){B['unbind']?.(),B['unbind']=this['context']['scope']['bind'](Object['fromEntries'](Object['entries'](Q)['map'](([c,X])=>[c,{'value':X}])));if(a)this['context']['activeAXNode']=a;}async #decide(B){const Q=(this['loop']?.['id']===this.#id()?this['loop']:void 0x0)??{'id':this.#id(),'head':B,'parent':this['loop'],'iteration':0x0,'startedAt':Date['now']()},a={'iteration':Q['iteration'],'entries':void 0x0},c='iterable'in B?await this.#iterate(B,a):await this.#repeat(B,a);a['unbind']?.();if(c)return{'status':'looped','meta':{'iteration':Q['iteration'],'done':!![],'loop':Q}};if(Q['iteration']>0x0){const f=await this['evaluate'](B['wait']);if(f)await sleep(f,{'signal':this['signal']});}const X={...Q,'iteration':Q['iteration']+0x1};return log('loopIterationStarted',{'iteration':X['iteration'],'total':a['total'],'correlationId':this['correlationId']}),{'status':'looped','meta':{'iteration':X['iteration'],'done':![],'loop':X}};}#id(){return this['stepId']??(this['stepIndex']!=null?'step:'+this['stepIndex']:'loop:'+JSON['stringify'](this['instruction']));}#state(){const B=this['context']['loops']??=new Map();let Q=B['get'](this['instruction']);if(!Q)B['set'](this['instruction'],Q={'iteration':0x0});return Q;}},IntentHandler=class extends Handler{async['handle'](){throw new RunnerError('Intent\x20action\x20should\x20not\x20be\x20executed',{'code':ErrorCode['FORBIDDEN_ACTION']});}},CheckHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element']({...B,'type':B['type']??'checkbox'});this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const a=await Q['node']['execute'](c=>{if(c instanceof Element&&c['hasAttribute']('aria-checked'))return c['getAttribute']('aria-checked')==='true';if(c instanceof HTMLInputElement&&['checkbox','radio']['includes'](c['type']))return c['checked'];return![];});if(typeof this['action']['value']!=='boolean'||a!==this['action']['value'])await Q['node']['click']({'simulate':Q['type']['checkbox']===0x1||Q['type']['radio']===0x1,'signal':this['signal']});return this['context']['activeElement']=Q['node'],await this['after'](),{'status':'success'};}};async function activateBrowserTab(B,Q){if(Q['position']==='previous'){if(!await B['activatePreviousPage']())throw new RunnerError('Can\x27t\x20switch\x20to\x20the\x20previous\x20tab\x20because\x20there\x20is\x20no\x20history\x20of\x20navigation\x20among\x20the\x20tabs',{'code':ErrorCode['NO_TAB_HISTORY']});}else{if(Q['position']==='next'){if(!await B['activateNextPage']()){const a=Array['from'](B['pages']());if(a['length']<=0x1)throw new RunnerError('Can\x27t\x20switch\x20to\x20the\x20next\x20tab\x20because\x20the\x20current\x20tab\x20is\x20already\x20located\x20at\x20the\x20top\x20of\x20history\x20and\x20there\x20are\x20no\x20other\x20tabs\x20to\x20switch\x20to',{'code':ErrorCode['NO_NEXT_TAB']});await a[(a['findIndex'](c=>c===B['activePage'])+0x1)%a['length']]['activate']();}}else await findBrowserTab(B,Q)['activate']();}}async function closeBrowserTab(B,Q){if(Array['from'](B['pages']())['length']<=0x1)throw new RunnerError('Can\x27t\x20close\x20the\x20browser\x20tab\x20because\x20it\x20is\x20the\x20only\x20tab',{'code':ErrorCode['CLOSE_LAST_TAB']});await(Q['index']!=null||Q['title']!=null||Q['position']!=null?findBrowserTab(B,Q):B['activePage'])['close']();}function findBrowserTab(B,Q){const a=Array['from'](B['pages']());if(Q['index']!=null){if(Q['index']>=a['length'])throw new RunnerError('Can\x27t\x20find\x20browser\x20tab\x20with\x20index\x20'+Q['index']+',\x20because\x20there\x20is\x20only\x20'+a['length']+'\x20browser\x20tab(s)',{'code':ErrorCode['NO_TAB']});return a[Q['index']];}if(Q['title']!=null){const c=new RegExp('\x5cb'+Q['title']['replaceAll'](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+'\x5cb','i'),X=a['find'](f=>c['test'](f['title']));if(!X)throw new RunnerError('Can\x27t\x20find\x20the\x20browser\x20tab\x20with\x20title\x20\x22'+Q['title']+'\x22',{'code':ErrorCode['NO_TAB']});return X;}return a[(a['findIndex'](f=>f===B['activePage'])+(Q['position']==='previous'?-0x1:0x1)+a['length'])%a['length']];}var ClickHandler$1=class extends Handler{async['handle'](){if(isDialogElementDescriptor(this['action']['element']))return this['handleWithDialogElementDescriptor'](this['action']['element']);const B=this['automator']['activePage']['dialog'],Q=B&&B['type']!=='filepicker'?B:null;if(!Q)await this['stabilize']();const a=await this['evaluate'](this['action']['element']);if(isDialogElementDescriptor(a))return this['handleWithDialogElementDescriptor'](a);if(isChromeTabDescriptor(a))return this['throwIfBlocked'](),this['handleWithChromeTab'](a);if(isChromeElementDescriptor(a))return this['throwIfBlocked'](),this['handleWithChromeElementDescriptor'](a);if(Q){const X=toDialogElementDescriptor(a);if(X)return this['handleWithDialogElementDescriptor'](X);this['throwIfBlocked']();}const c=await this['element']({...a,'state':{...a['state'],'active':!![]},'hints':{'type':'button'}});if(a&&!c?.['node']){const f=toChromeElementDescriptor(a);if(f)return this['handleWithChromeElementDescriptor'](f);const J=toChromeTabDescriptor(a);if(J)return this['handleWithChromeTab'](J);}return this['throwIfNoElement'](c),this['handleWithElement'](c);}async['handleWithChromeTab'](B){return await this['before'](),await activateBrowserTab(this['automator'],B),await this['after'](),{'status':'success'};}async['handleWithDialogElementDescriptor'](B){const Q=this['automator']['activePage']['dialog'];if(!Q||Q['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});return await this['before'](),await Q['handle'](B['title']!=='cancel'),await this['after'](),{'status':'success'};}async['handleWithChromeElementDescriptor'](B){await this['before']();if(B['type']==='button'){if(B['title']==='refresh')await this['automator']['activePage']['reload']();else{if(B['title']==='back')await this['automator']['activePage']['navigateThroughHistory'](-0x1);else{if(B['title']==='forward')await this['automator']['activePage']['navigateThroughHistory'](0x1);}}}return await this['after'](),{'status':'success'};}async['handleWithElement'](B){await tryMakeElementNotObscured(B,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const {keys:Q,button:a,times:c}=this['action'];if(Q)await this['automator']['activePage']['keyboard']['down'](Q);await B['node']['click']({'simulate':B['type']['checkbox']===0x1||B['type']['radio']===0x1,'signal':this['signal'],'button':a,'times':c});if(Q)await this['automator']['activePage']['keyboard']['up'](Q);return await Promise['all']([B['node']['frame']['wait']('stable'),o(0x64)]),this['context']['activeElement']=B['node'],await this['after'](),{'status':'success'};}},TypeHandler$1=class extends Handler{async['handle'](){if(isDialogElementDescriptor(this['action']['element']))return this['handleWithDialogElementDescriptor']();this['throwIfBlocked'](),await this['stabilize']();const B=stringify(await this['evaluate'](this['action']['value']??''));if(isChromeElementDescriptor(this['action']['element']))this['action']['element']['type']==='textbox'&&this['action']['element']['title']==='url'&&(await this['before'](),await this['automator']['activePage']['navigate'](B),await this['after']());else{const Q=await this['evaluate'](this['action']['element'])??(isOTP(this['action']['value'])?{'type':'textbox','title':'code','fallback':{'state':{'focused':!![]}}}:{'state':{'focused':!![]}});if(isDialogElementDescriptor(Q))return this['handleWithDialogElementDescriptor']();const a=await this['element']({...Q,'state':{...Q['state'],'active':!![]},'type':[Q['type']??[],'textbox']['flat']()});this['throwIfNoElement'](a),await tryMakeElementNotObscured(a,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const c=a['node'];await this['throwIfCannotTypeToElement'](c),await c['focus']();if(await c['isContentEditable']())await c['setCaretPosition']('end');if(B['length']>=0xc8)await this['automator']['activePage']['keyboard']['insert'](B,{'keys':['ControlLeft','KeyV']});else await this['automator']['activePage']['keyboard']['type'](B);this['context']['activeElement']=c,await this['after']();}return{'status':'success'};}async['handleWithDialogElementDescriptor'](){const B=this['automator']['activePage']['dialog'];if(!B||B['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});const Q=stringify(await this['evaluate'](this['action']['value']??''));return await this['before'](),await B['handle'](!![],Q),await this['after'](),{'status':'success'};}},ClearHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element'])??{'state':{'focused':!![]}},Q=await this['element']({...B,'type':[B['type']??[],'inputbox']['flat']()});this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();if(Q['type']['textbox'])await Q['node']['focus'](),await this['automator']['activePage']['keyboard']['press'](['ControlLeft','KeyA'],{'commands':['selectAll']}),await this['automator']['activePage']['keyboard']['press']('Backspace');else{if(Q['type']['checkbox']){if(await Q['node']['execute'](a=>a instanceof HTMLInputElement&&a['type']==='checkbox'&&a['checked']||a instanceof Element&&a['getAttribute']('aria-checked')==='true'))await Q['node']['click']({'simulate':!![],'signal':this['signal']});}else throw new RunnerError('Can\x27t\x20clear\x20the\x20targeted\x20element',{'code':ErrorCode['ELEMENT_NOT_CLEARABLE']});}return this['context']['activeElement']=Q['node'],await this['after'](),{'status':'success'};}},ScrollHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();if('position'in this['action']){const B=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},Q=await this['element'](isViewportDescriptor(B)?{'type':'scrollable','fallback':{'type':'app'}}:B);this['throwIfNoElement'](Q);const a=Q['node'];let c,X;if(isViewportDescriptor(B)){const f=await this['automator']['activePage']['getViewportSize']();if(this['action']['position']==='center')X=0x0,c=0x0;else{if(this['action']['position']['includes']('top'))X=-(f['height']/0x2);else{if(this['action']['position']['includes']('bottom'))X=f['height']/0x2;}if(this['action']['position']['includes']('left'))c=-(f['width']/0x2);else{if(this['action']['position']['includes']('right'))c=f['width']/0x2;}}}else{const {scrollX:J,scrollY:Y,scrollWidth:h,scrollHeight:V,clientWidth:k,clientHeight:t}=await a['getMetrics']();if(this['action']['position']['includes']('center'))c=(h-k)/0x2-J,X=(V-t)/0x2-Y;else{if(this['action']['position']['includes']('top'))X=-Y;else{if(this['action']['position']['includes']('bottom'))X=V-t-Y;}if(this['action']['position']['includes']('left'))c=-J;else{if(this['action']['position']['includes']('right'))c=h-k-J;}}}await a['scrollBy']({'x':c,'y':X});}else{if('fraction'in this['action']){const K=await this['evaluate'](this['action']['fraction']),O=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},S=await this['element'](isViewportDescriptor(O)?{'type':'scrollable','fallback':{'type':'app'}}:O);this['throwIfNoElement'](S);const C=S['node'],G=this['action']['direction']??'down',E=await this['evaluate'](this['action']['times'])??0x1,W=isViewportDescriptor(O)?await this['automator']['activePage']['getViewportSize']():await C['getMetrics']()['then'](({scrollWidth:q,scrollHeight:I})=>({'width':q,'height':I}));let e,H;if(G==='up')H=-(W['height']*K);else{if(G==='down')H=W['height']*K;else{if(G==='left')e=-(W['width']*K);else{if(G==='right')e=W['width']*K;}}}for(let q=0x0;q<E;++q)await C['scrollBy']({'x':e,'y':H});}else{if('element'in this['action']&&!('direction'in this['action'])){const I=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},n=await this['element'](I);this['throwIfNoElement'](n),await tryMakeElementNotObscured(n,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']});}else{const R=this['action']['direction']??'down',F=R==='left'||R==='right'?'horizontal':'vertical';let w;if('element'in this['action']){const A=this['action']['element'],Z=await this['evaluate']('isElementReference'in A?A:{...A,'hints':{'scrollable':F,...A['hints']}});w=await this['element'](Z);}else w=await this['element']({'type':'scrollable','superlative':'largest','hints':{'scrollable':F},'fallback':{'type':'app'}});this['throwIfNoElement'](w);const i=w['node'],U=await this['evaluate'](this['action']['times'])??0x1,d=await this['evaluate'](this['action']['distance']);let L=0x0,s=0x0;if(!d){const m=await this['automator']['activePage']['getViewportSize'](),l=await i['getMetrics'](),p=Math['min'](l['clientHeight'],m['height']),D=Math['min'](l['clientWidth'],m['width']);if(R==='up')s=-p;else{if(R==='down')s=p;else{if(R==='left')L=-D;else{if(R==='right')L=D;}}}}else{if(R==='up')s=-d;else{if(R==='down')s=d;else{if(R==='left')L=-d;else{if(R==='right')L=d;}}}}for(let M=0x0;M<U;++M)await i['scrollBy']({'x':L,'y':s});}}}return await this['after'](),{'status':'success'};}},FindHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element'](B);return this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before'](),this['context']['activeElement']=Q['node'],await this['after'](),{'status':'found'};}},FocusHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element'](B);this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const a=Q['node'];if(!await a['focus']())throw new RunnerError('Element\x20is\x20not\x20interactive',{'code':ErrorCode['ELEMENT_NOT_INTERACTIVE']});return this['context']['activeElement']=a,await this['after'](),{'status':'success'};}},CloseHandler=class extends Handler{async['handle'](){if('isDialogDescriptor'in this['action']['element']){const J=this['automator']['activePage']['dialog'];if(!J||J['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});return await this['before'](),await J['handle'](![]),await this['after'](),{'status':'success'};}this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element']);if(isChromeTabDescriptor(B))return this['handleWithChromeTab'](B);const Q={...B,'hints':{'type':B['type']?B['type']:'popup'}},a=await this['element'](Q);if(!a?.['node']){const Y=toChromeTabDescriptor(B);if(Y)return this['handleWithChromeTab'](Y);}this['throwIfNoElement'](a);const c=a['role']==='close'?a:await this['element']({'hints':{'role':'close'},'anchor':{'position':'inside','element':Q}});this['throwIfNoElement'](c),await tryMakeElementNotObscured(c,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const X=c['node'],f=Boolean(c['type']['checkbox']||c['type']['radio']);return await X['click']({'simulate':f,'signal':this['signal']}),await Promise['all']([X['frame']['wait']('stable'),o(0x64)]),this['context']['activeElement']=X,await this['after'](),{'status':'success'};}async['handleWithChromeTab'](B){return await this['before'](),await closeBrowserTab(this['automator'],B),await this['after'](),{'status':'success'};}},CreateTargetHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const B=await this['evaluate'](this['action']['url']);return await this['automator']['page']({'url':B??void 0x0}),await this['after'](),{'status':'success'};}},EraseHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element'])??{'state':{'focused':!![]}},Q=await this['element']({...B,'state':{...B['state'],'active':!![]}});this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const a=await this['evaluate'](this['action']['size']),c=Q['node'];if(!await c['execute']((X,f)=>{if(X instanceof HTMLInputElement&&['text','search','url','tel','password']['includes'](X['type'])||X instanceof HTMLTextAreaElement){if(X===document['activeElement'])X['setSelectionRange'](Math['max'](0x0,X['selectionStart']-f),X['selectionStart']);else X['focus'](),X['setSelectionRange'](Math['max'](0x0,X['value']['length']-f),X['value']['length']);return!![];}return![];},[a]))throw new RunnerError('Element\x20is\x20not\x20a\x20textbox',{'code':ErrorCode['ELEMENT_NOT_TEXTBOX']});return await this['automator']['activePage']['keyboard']['press']('Backspace'),this['context']['activeElement']=c,await this['after'](),{'status':'success'};}},EvaluateHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();try{const B=await this['automator']['activePage']['mainFrame']['defaultEvaluate'](await this['evaluate'](this['action']['js']),{'await':!![]});return this['context']['scope']['public']['js-result']={'value':B},await this['after'](),{'status':'evaluated','meta':{'result':B}};}catch(Q){if(Q instanceof FlushError)throw Q;else throw new RunnerError('Evaluation\x20failed',{'code':ErrorCode['EVALUATION_FAILED'],'error':Q,'stack':Q['stack']});}}},NavigateHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();if('direction'in this['action']){const B=await this['evaluate'](this['action']['times'])??0x1;await this['automator']['activePage']['navigateThroughHistory'](this['action']['direction']==='forward'?B:-B),log('navigationPerformed',{'kind':'history','historyDirection':this['action']['direction'],'times':B});if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);return await this['after'](),{'status':'navigated'};}else{const Q=this['navigateTimeout'],a=await this['evaluate'](this['action']['url']||'');let c=this['action']['relative']||/^\.{0,2}\/|^[^\.\/]+$/['test'](a)?new URL(a,this['automator']['activePage']['url'])['toString']():a;if(/^mock\+/['test'](a))c='https://mock#'+a['replace'](/^mock\+/,'');let X;if(this['action']['headers']&&this['action']['headers']['length']>0x0){const J=await evaluateHeaders(this['action']['headers'],{'evaluate':Y=>this['evaluate'](Y),'stack':this['stack']});X=Object['fromEntries'](J['headers']);}const f=await(/^(?:data|about):|(?:https?|ftps?|chrome):\/\//['test'](c)?this['automator']['activePage']['navigate'](c,{'timeout':Q,'headers':X}):this['automator']['activePage']['navigate']('https://'+c,{'timeout':Q,'headers':X})['catch'](Y=>this['automator']['activePage']['navigate']('http://'+c,{'timeout':Q,'headers':X})['catch'](async()=>Promise['reject'](Y))))['catch'](async Y=>{await this['automator']['activePage']['cancelNavigation']();throw Y;});log('navigationPerformed',{'kind':'url','url':c,'statusCode':f['status']});if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);await this['after']();if(!this['shouldNotThrowOnUnexpectedNavigationStatus']){if(this['action']['statuses']!=='*'){const Y=[...this['action']['statuses']??[],...this['expectedNavigationStatuses']];if(Y['length']>0x0?!Y['includes'](f['status']):f['status']<0xc8||f['status']>0x12b)throw new RunnerError('The\x20navigation\x20to\x20url\x20\x22'+a+'\x22\x20resulted\x20with\x20an\x20unexpected\x20status\x20code\x20'+f['status'],{'code':ErrorCode['UNEXPECTED_NAVIGATION_STATUS'],'status':f['status'],'headers':f['headers']});}return{'status':'navigated','meta':{...f}};}else return{'status':'navigated','meta':{...f,'statusExpected':this['action']['statuses']&&(this['action']['statuses']==='*'||this['action']['statuses']['includes'](f['status']))}};}}},GoHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['target']),Q={'automator':this['automator'],'context':this['context'],'shouldCapture':this['shouldCapture'],'shouldNotThrowOnUnexpectedNavigationStatus':this['shouldNotThrowOnUnexpectedNavigationStatus'],'expectedNavigationStatuses':this['expectedNavigationStatuses']};return(isUrlString(B)?new NavigateHandler({...Q,'instruction':{'type':'navigate','url':B}}):new ScrollHandler$1({...Q,'instruction':{'type':'scroll','element':{'title':B}}}))['handle']();}},HitKeyHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const B=this['action']['keys'],Q=await this['evaluate'](this['action']['times'])??0x1;for(let a=0x0;a<Q;++a)if(['F5','ControlLeft+KeyR']['includes'](B['join']('+')))await this['automator']['activePage']['reload']();else{if(['ControlLeft+F5','ControlLeft+ShiftLeft+KeyR']['includes'](B['join']('+')))await this['automator']['activePage']['reload']({'hard':!![]});else{const c=await this['automator']['activePage']['mainFrame']['execute'](()=>{const X=document['activeElement'];return!!(X instanceof HTMLInputElement&&X['list']&&!['button','reset','submit']['includes'](X['type']));});await this['automator']['activePage']['keyboard']['press'](B,{'raw':c});}}return await this['after'](),{'status':'success'};}},HoverHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element']({...B,'state':{...B['state'],'active':!![]}});this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const a=Q['node'];return await a['hover']({'signal':this['signal']}),this['context']['activeElement']=a,await this['after'](),{'status':'success'};}},NavigatePdfHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const B=await this['evaluate'](this['action']['page']);if(!isPdfViewerFrame(this['automator']['activePage']['mainFrame']))throw new RunnerError('Cannot\x20navigate\x20to\x20a\x20PDF\x20page:\x20the\x20active\x20page\x20is\x20not\x20a\x20PDF\x20viewer',{'code':ErrorCode['NOT_PDF_VIEWER']});const {pageCount:Q,resolvedPage:a}=await this['automator']['activePage']['mainFrame']['defaultExecute'](c=>{const X=globalThis['nlpPdfState'];if(!X)return{'pageCount':0x0,'resolvedPage':0x0};const {viewer:f}=X,J=c<0x0?f['pagesCount']+c+0x1:c;if(J<0x1||J>f['pagesCount'])return{'pageCount':f['pagesCount'],'resolvedPage':J};return f['currentPageNumber']=J,{'pageCount':f['pagesCount'],'resolvedPage':J};},[B]);if(a<0x1||a>Q)throw new RunnerError('PDF\x20page\x20'+B+'\x20is\x20out\x20of\x20range',{'code':ErrorCode['PDF_PAGE_OUT_OF_RANGE'],'page':B,'pageCount':Q});return await this['after'](),{'status':'success'};}},RefreshHandler=class extends Handler{async['handle'](){return this['throwIfBlocked'](),await this['stabilize'](),await this['before'](),await this['automator']['activePage']['reload']({'hard':this['action']['value']==='hard'}),await this['after'](),{'status':'success'};}},SearchHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['element'])??{'type':'textbox','title':'search'},Q=await this['element']({...B,'type':[B['type']??[],'textbox']['flat']()});this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const a=await this['evaluate'](this['action']['value']||''),c=Q['node'];return await this['throwIfCannotTypeToElement'](c),await c['focus'](),await this['automator']['activePage']['keyboard']['type'](a),await this['automator']['activePage']['keyboard']['press']('Enter'),this['context']['activeElement']=c,await this['after'](),{'status':'success'};}};function formatDateTimeForInput(B,Q){if(Q==='time'&&B['match'](/^\d{2}:\d{2}(:\d{2})?$/))return B;const a=/(\d{4}-\d{2}-\d{2})T?(\d{2}:\d{2})?:?(\d{2})?/;if(a['test'](B))B=B['trim']()['endsWith']('Z')?B:B+'Z';else B+='\x20UTC';const c=new Date(B)['toISOString'](),X=c['match'](a);if(!X)return c;const f=X[0x1],J=parseInt(X[0x3]),Y=J?X[0x2]+':'+J:X[0x2];if(Q==='date')return f;if(Q==='time')return Y;return f+'T'+Y;}var SetValueHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const B=await this['evaluate'](this['action']['value']??'');if(isFileHandle(this['action']['value'])&&this['automator']['activePage']['dialog']?.['type']==='filepicker')await this.#setValueInFilepickerDialog(this['automator']['activePage']['dialog'],B);else{const Q=await this['evaluate'](this['action']['element']),a=await this['element']({...Q,'type':Q['type']??'inputbox'});this['throwIfNoElement'](a),await tryMakeElementNotObscured(a,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const c=a['node'];if(!await c['focus']()&&!await c['execute'](f=>f instanceof HTMLFieldSetElement))throw new RunnerError('Element\x20is\x20not\x20interactive',{'code':ErrorCode['ELEMENT_NOT_INTERACTIVE']});const X=await c['execute'](f=>{if(f instanceof HTMLFieldSetElement||f instanceof HTMLSelectElement)return'selectable';else{if(f instanceof HTMLInputElement&&f['type']==='color')return'colorpicker';else{if(f instanceof HTMLInputElement&&f['type']==='date')return'datepicker';else{if(f instanceof HTMLInputElement&&f['type']==='time')return'timepicker';else{if(f instanceof HTMLInputElement&&f['type']==='datetime-local')return'datetimepicker';else{if(f instanceof HTMLInputElement&&f['type']==='file')return'filepicker';else return'inputbox';}}}}}});if(X==='selectable')await this.#setValueInSelectable(c,B);else{if(X==='colorpicker')await this.#setValueInColorPicker(c,B);else{if(X==='datepicker')await this.#setValueInDatePicker(c,B);else{if(X==='timepicker')await this.#setValueInTimePicker(c,B);else{if(X==='datetimepicker')await this.#setValueInDateTimePicker(c,B);else await c['setValue'](B);}}}}this['context']['activeElement']=c;}return await this['after'](),{'status':'success'};}async #setValueInSelectable(B,Q){if(isRandomValue(this['action']['value'])&&this['action']['value']['type']==='number'){const a=await B['execute'](c=>{if(c instanceof HTMLSelectElement)return c['options']['length'];else{if(c instanceof HTMLFieldSetElement)return c['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')['length'];else return 0x0;}});Q=Math['floor'](Q*a);}if(!await B['execute'](async(c,X)=>{if(c instanceof HTMLSelectElement){let f;if(typeof X==='number')f=c['options'][X];else{if(typeof X==='string'){const J=Array['prototype']['find']['bind'](c['options']),Y=String(X)['toLowerCase']();f=J(h=>[h['value']['toLowerCase'](),h['textContent']['toLowerCase']()]['includes'](Y))??J(h=>h['text']['toLowerCase']()['includes'](Y));}}if(f)return f['selected']=!![],c['dispatchEvent'](new Event('input',{'bubbles':!![],'composed':!![]})),c['dispatchEvent'](new Event('change',{'bubbles':!![]})),!![];}else{if(c instanceof HTMLFieldSetElement){let h;if(typeof X==='number')h=c['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')[X];else{if(typeof X==='string'){const V=X['toLowerCase'](),k=Array['from'](c['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')),t=[K=>K===V,K=>K['startsWith'](V),K=>K['includes'](V)];for(const K of t)h=k['find'](O=>Array['from'](O['labels']??[])['some'](S=>S['innerText']&&K(S['innerText']['toLowerCase']()))||K(O['value']?.['toLowerCase']()));}}if(h)return h['checked']=!![],h['dispatchEvent'](new Event('input',{'bubbles':!![],'composed':!![]})),h['dispatchEvent'](new Event('change',{'bubbles':!![]})),!![];}}return![];},[Q],{'await':!![]}))throw new RunnerError('desired\x20option\x20'+JSON['stringify'](Q)+'\x20was\x20not\x20found',{'code':ErrorCode['NO_OPTION'],'value':Q});}async #setValueInColorPicker(B,Q){const {r:a,g:c,b:X}=stringToColorOrThrow(Q),f='#'+Number(a)['toString'](0x10)['padStart'](0x2,'0')+Number(c)['toString'](0x10)['padStart'](0x2,'0')+Number(X)['toString'](0x10)['padStart'](0x2,'0');await B['setValue'](f);}async #setValueInDatePicker(B,Q){await B['setValue'](formatDateTimeForInput(Q,'date'));}async #setValueInTimePicker(B,Q){await B['setValue'](formatDateTimeForInput(Q,'time'));}async #setValueInDateTimePicker(B,Q){await B['setValue'](formatDateTimeForInput(Q,'datetime'));}async #setValueInFilepickerDialog(B,Q){await B['handle']([Q]);}},SwitchHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=await this['evaluate'](this['action']['element']);if(isChromeTabDescriptor(B))return this['handleWithChromeTab'](B);const Q=await this['element']({...B,'state':{...B['state'],'active':!![]},'hints':{'type':'button',...B['hints']}});if(!Q?.['node']){const a=toChromeTabDescriptor(B);if(a)return this['handleWithChromeTab'](a);}return this['throwIfNoElement'](Q),await tryMakeElementNotObscured(Q,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before'](),await Q['node']['click']({'signal':this['signal']}),await Promise['all']([Q['node']['frame']['wait']('stable'),o(0x64)]),this['context']['activeElement']=Q['node'],await this['after'](),{'status':'success'};}async['handleWithChromeTab'](B){return await this['before'](),await activateBrowserTab(this['automator'],B),await this['after'](),{'status':'success'};}},CheckHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element']({...B,'type':B['type']??'checkbox'});this['throwIfNoElement'](Q),await this['before']();const a=Q['state']['checked']??![];if(typeof this['action']['value']!=='boolean'||a!==this['action']['value'])await Q['node']['click']();return await this['after'](),{'status':'success'};}},ClickHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element']({...B,'state':{...B&&'state'in B?B['state']:{},'active':!![]},'hints':{'type':'button'}});return this['throwIfNoElement'](Q),this['handleWithElement'](Q);}async['handleWithElement'](B){await this['before']();const {times:Q}=this['action'];return await B['node']['click']({'times':Q}),await sleep(0x64),await this['after'](),{'status':'success'};}},FindHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element'](B);return this['throwIfNoElement'](Q),await this['before'](),await this['after'](),{'status':'found'};}},FocusHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=await this['evaluate'](this['action']['element']),Q=await this['element'](B);return this['throwIfNoElement'](Q),await this['before'](),await Q['node']['focus'](),await this['after'](),{'status':'success'};}},ScrollHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();throw new RunnerError('Scroll\x20action\x20is\x20not\x20supported\x20on\x20mobile\x20yet',{'code':ErrorCode['NOT_IMPLEMENTED']});}},TypeHandler=class extends Handler{async['handle'](){await this['stabilize']();const B=stringify(await this['evaluate'](this['action']['value']??'')),Q=await this['evaluate'](this['action']['element'])??(isOTP(this['action']['value'])?{'type':'textbox','title':'code','fallback':{'state':{'focused':!![]}}}:{'state':{'focused':!![]}}),a=await this['element']({...Q,'state':{...Q&&'state'in Q?Q['state']:{},'active':!![]},'type':[(Q&&'type'in Q?Q['type']:void 0x0)??[],'textbox']['flat']()});return this['throwIfNoElement'](a),await this['before'](),await this['throwIfCannotTypeToElement'](a['node']),await a['node']['click'](),await a['node']['type'](B),await this['after'](),{'status':'success'};}};const noop={},common={'assert':AssertHandler,'wait':WaitHandler,'empty':EmptyHandler,'comment':EmptyHandler,'fetch':FetchHandler,'set\x20variable':SetVariableHandler,'visual\x20check':VisualCheckHandler,'intent':IntentHandler,'set\x20preinstructions':DefinePreinstructionsHandler,'drop\x20preinstructions':DefinePreinstructionsHandler,'initialize\x20scope':InitializeScopeHandler,'try':TryHandler,'if':IfHandler,'loop':LoopHandler},web={'check':CheckHandler$1,'clear':ClearHandler,'click':ClickHandler$1,'close':CloseHandler,'create\x20target':CreateTargetHandler,'erase':EraseHandler,'evaluate':EvaluateHandler,'find':FindHandler$1,'focus':FocusHandler$1,'hit\x20key':HitKeyHandler,'hover':HoverHandler,'navigate':NavigateHandler,'navigate\x20pdf':NavigatePdfHandler,'refresh':RefreshHandler,'scroll':ScrollHandler$1,'search':SearchHandler,'set\x20value':SetValueHandler,'switch':SwitchHandler,'type':TypeHandler$1,'visual\x20check':VisualCheckHandler,'go':GoHandler},mobile={'check':CheckHandler,'click':ClickHandler,'find':FindHandler,'focus':FocusHandler,'scroll':ScrollHandler,'type':TypeHandler},handlers={'web':{...noop,...common,...web},'mobile':{...noop,...common,...mobile}};function makeHandler(B){if(!(B['automator']['type']in handlers))throw new Error('The\x20automator\x20type\x20\x22'+B['automator']['type']+'\x22\x20isn\x27t\x20supported');if(!(B['instruction']['type']in handlers[B['automator']['type']]))throw new Error('The\x20instruction\x20type\x20\x22'+B['automator']['type']+'\x22\x20isn\x27t\x20supported\x20with\x20'+B['automator']['type']+'\x20automator');const Q=handlers[B['automator']['type']][B['instruction']['type']];return new Q(B);}var FlagStore=class extends EventTargetNode{#flags={'pdfViewer':{'description':'Intercept\x20PDF\x20requests\x20and\x20serve\x20the\x20NLP\x20DOM-based\x20viewer\x20instead\x20of\x20the\x20browser\x20PDF\x20viewer','value':![]}};#set(B,Q){const a=this.#flags[B]?.['value'];if(Q===a)return;this.#flags[B]['value']=Q,this['dispatch'](new FlagChangedEvent(B,Q,a));}get['pdfViewer'](){return this.#flags['pdfViewer']['value'];}set['pdfViewer'](B){this.#set('pdfViewer',B);}['set'](B){for(const Q of Object['keys'](B)){const a=B[Q];if(a!==void 0x0)this[Q]=a;}}['toJSON'](){return this.#flags;}},FlagChangedEvent=class extends Event{['key'];['value'];['previousValue'];constructor(B,Q,a){super('flagChanged'),this['key']=B,this['value']=Q,this['previousValue']=a;}};const flags=new FlagStore(),VIEWER_HTML_PATH=new URL('../../assets/index-C5rB_Uzy.html',import.meta.url);function installPdfInterceptor(B){return B['intercept']([{'resource':['Document'],'stage':['response']}],async Q=>{if(!flags['pdfViewer']||!(Q instanceof InterceptedResponse)||!isPdfResponse(Q))return;try{const a=await Q['base64'](),c=await getViewerHtml();if(!c['includes']('__NLP_PDF_BYTES__'))throw new Error('viewer\x20HTML\x20is\x20missing\x20the\x20bytes\x20placeholder\x20\x22'+PDF_BYTES_PLACEHOLDER+'\x22');const X=c['replace'](PDF_BYTES_PLACEHOLDER,a);await Q['fulfill']({'status':0xc8,'headers':{'content-type':'text/html;\x20charset=utf-8','x-nlp-pdf-viewer':'1'},'body':new TextEncoder()['encode'](X)}),log('pdfInterceptorReplaced',{'url':Q['request']['url']});}catch(f){error('pdfInterceptorFailed',{'error':f});}});}function isPdfResponse(B){const Q=Object['entries'](B['headers'])['find'](([a])=>a['toLowerCase']()==='content-type')?.[0x1]??'';return/^application\/(?:x-)?pdf\b/i['test'](Q);}let viewerHtmlPromise;function getViewerHtml(){if(!viewerHtmlPromise)viewerHtmlPromise=readFile(VIEWER_HTML_PATH,'utf8')['catch'](B=>{viewerHtmlPromise=void 0x0;throw B;});return viewerHtmlPromise;}function makeScope(B){return new Scope(B);}var Scope=class{#storages=new Map();#bindings=[];#global={};#main;#active;get['main'](){return this.#main;}get['active'](){return this.#active;}get['global'](){return this.#global;}get['public'](){let B={...this.#global},Q=this.#active;while(Q){B={...Q['input'],...Q['public'],...B},Q=Q['parent'];}for(const a of this.#bindings)B={...B,...a};return new Proxy(B,{'set':(c,X,f)=>{return this.#throwIfBound(X),this.#storages['forEach'](J=>Reflect['set'](J['public'],X,f)),!![];},'deleteProperty':(c,X)=>{return this.#throwIfBound(X),this.#storages['forEach'](f=>Reflect['deleteProperty'](f['public'],X)),!![];}});}#throwIfBound(B){const Q=String(B)['toLowerCase']();if(this.#bindings['some'](a=>Q in a))throw new RunnerError('Cannot\x20assign\x20to\x20\x22'+Q+'\x22\x20-\x20it\x20is\x20a\x20binding\x20and\x20only\x20its\x20loop\x20can\x20change\x20it',{'code':ErrorCode['ASSIGNMENT_TO_BINDING']});}get['internal'](){let B={},Q=this.#active;while(Q){B={...Q['internal'],...B},Q=Q['parent'];}return new Proxy(B,{'set':(a,c,X)=>{const f=this.#active;return Reflect['set'](f['internal'],c,X),!![];},'deleteProperty':(a,c)=>{return this.#storages['forEach'](X=>Reflect['deleteProperty'](X['internal'],c)),!![];}});}constructor(B){this.#global=B['global'],this.#main=this['set']('main',B),this.#active=this.#main;}['activate'](B){if(!this.#storages['has'](B))throw new Error('Unknown\x20scope\x20with\x20id\x20\x22'+B+'\x22');this.#active=this.#storages['get'](B);}['initialize'](B){this.#active['input']=Object['fromEntries'](Object['entries'](B['input']??{})['map'](([Q,a])=>[Q['toLowerCase'](),a])),this.#active['public']=Object['fromEntries'](Object['entries'](B['public']??{})['map'](([Q,a])=>[Q['toLowerCase'](),a])),this.#active['public']=B['internal'];}['available'](B){return this.#storages['get'](B)?.['parent']===this.#active;}['set'](B,Q){const a={'name':B,'parent':B==='main'?null:this.#active,'input':Object['fromEntries'](Object['entries'](Q['input']??{})['map'](([c,X])=>[c['toLowerCase'](),X])),'public':Object['fromEntries'](Object['entries'](Q['public']??{})['map'](([c,X])=>[c['toLowerCase'](),X])),'internal':Q['internal']??{}};return this.#storages['set'](B,a),a;}['bind'](B){const Q=Object['fromEntries'](Object['entries'](B)['map'](([a,c])=>[a['toLowerCase'](),c]));return this.#bindings['push'](Q),()=>{const a=this.#bindings['indexOf'](Q);if(a>=0x0)this.#bindings['splice'](a,0x1);};}['unbindAll'](){this.#bindings=[];}['reset'](){this.#bindings=[],this.#storages=new Map(),this.#main=this['set']('main',{...this.#main,'public':{}}),this.#active=this.#main;}};const connect=buildConnector({'allowH2':!![],'rejectUnauthorized':![]});function makeDispatcher({proxy:B}={}){return B?new Socks5ProxyAgent(B['url'],{'username':B['username'],'password':B['password'],'connect':connect}):new Agent({'connect':connect});}function makePageData({browser:B}){return{get 'url'(){return makeUrlData(B['activePage']['url']);},get 'title'(){return B['activePage']['title'];},get 'language'(){return'';},get 'status'(){return B['activePage']['mainFrame']['response']['status'];},get 'statustext'(){return B['activePage']['mainFrame']['response']['statusText'];},get 'headers'(){const Q=B['activePage']['mainFrame']['response']['headers'];return{...Object['fromEntries'](Object['entries'](Q)['map'](([a,c])=>[a['toLowerCase'](),c])),[Symbol['for']('get')](a){return this[a['toLowerCase']()];}};},get 'cookies'(){return{};},get 'meta'(){return{};},get 'width'(){return NaN;},get 'height'(){return NaN;},async[Symbol['for']('get')](Q){if(Q==='title')return B['activePage']['mainFrame']['evaluate']('document.title');else{if(Q==='language')return B['activePage']['mainFrame']['evaluate']('document.documentElement.lang');else{if(Q==='cookies'){const a=await B['activePage']['getCookies']();return Object['fromEntries'](a['entries']());}else{if(Q==='meta')return B['activePage']['mainFrame']['execute'](()=>{const c=document['head']['querySelectorAll']('meta[name],\x20meta[property]');return Array['from'](c)['reduce']((X,f)=>{const J=f['getAttribute']('property')||f['name'];if(J)X[J]=f['content']??'';return X;},{});});else{if(Q==='width')return B['activePage']['mainFrame']['evaluate']('document.scrollingElement.scrollWidth');else{if(Q==='height')return B['activePage']['mainFrame']['evaluate']('document.scrollingElement.scrollHeight');else return this[Q];}}}}}}};}function makePdfData({browser:B}){const Q={get 'name'(){return'';},get 'pagecount'(){return 0x0;},get 'currentpage'(){return 0x0;},async[Symbol['for']('get')](a){const c=a['toLowerCase']();if(c==='name')return B['activePage']['mainFrame']['defaultExecute'](()=>document['title']);else{if(c==='pagecount')return B['activePage']['mainFrame']['defaultExecute'](()=>globalThis['nlpPdfState']?.['viewer']?.['pagesCount']??0x0);else{if(c==='currentpage')return B['activePage']['mainFrame']['defaultExecute'](()=>globalThis['nlpPdfState']?.['viewer']?.['currentPageNumber']??0x0);}}}};return{get 'value'(){const a=B['activePage']?.['mainFrame'];if(!a||!isPdfViewerFrame(a))return null;return Q;}};}const TOKEN_BOUNDARY_PATTERN=/[^a-zA-Z0-9]+|(?<=[a-z])(?=[A-Z])/,INDICATOR_TOKEN_PATTERN=/^(?:spin(?:ner|ning)?|(?:pre)?load(?:ing|er)|progress(?:bar)?|wait(?:ing)?|busy)$/i;function isPageSpinnerVisible(B){return B['popups']['some'](nodeHasSpinnerIndicators);}function nodeHasSpinnerIndicators(B){const Q=B['attributes'];if(Q){if(Q['role']==='status'||Q['role']==='progressbar'||Q['aria-busy']==='true')return!![];if(hasIndicatorToken(Q['class'])||hasIndicatorToken(Q['id']))return!![];}return hasIndicatorToken(B['text'])||hasIndicatorToken(B['visibleLabel'])||hasIndicatorToken(B['declarativeLabel']);}function hasIndicatorToken(B){if(!B)return![];return B['split'](TOKEN_BOUNDARY_PATTERN)['some'](Q=>INDICATOR_TOKEN_PATTERN['test'](Q));}function parseIOSFrame(B){if(!B)return{'x':0x0,'y':0x0,'width':0x0,'height':0x0};const Q=B['match'](/\{\{([\d.]+),\s*([\d.]+)\},\s*\{([\d.]+),\s*([\d.]+)\}\}/);if(!Q)return{'x':0x0,'y':0x0,'width':0x0,'height':0x0};return{'x':parseFloat(Q[0x1]),'y':parseFloat(Q[0x2]),'width':parseFloat(Q[0x3]),'height':parseFloat(Q[0x4])};}function makeIOSNode(B){return new IOSNode(B);}var IOSNode=class{['handle'];#connection;constructor({connection:B,handle:Q}){this.#connection=B,this['handle']=Q;}async['equal'](B){return this===B;}async['click'](B){await this.#connection['sendGesture']({'type':B?.['times']===0x2?'doubleTap':'tap','target':{'type':'element','elementSnapshot':this['handle']},'parameters':{'taps':B?.['times']??0x1}});}async['focus'](){return await this['click'](),!![];}async['type'](B){await this.#connection['sendGesture']({'type':'typeText','target':{'type':'element','elementSnapshot':this['handle']},'parameters':{'text':B}});}async['isContentEditable'](){return![];}async['setCaretPosition'](B){}async['canTypeInto'](){return!![];}async['getBox'](){return parseIOSFrame(this['handle']['Frame']);}async['getScreenBox'](){return this['getBox']();}async['getContentBoxes'](){return[parseIOSFrame(this['handle']['Frame'])];}async['isVisible'](){return!![];}async['getText'](){return this['handle']['Value']||this['handle']['Label']||'';}async['getValue']({hint:hint='string'}={}){if(hint==='boolean'){if(this['handle']['ElementType']==='XCUIElementTypeSwitch')return String(this['handle']['Value'])==='1';}return this['handle']['Value'];}async['isEnabled'](){return this['handle']['Enabled']??null;}async['isHovered'](){return null;}async['getObscurationInfo'](){return{'ratio':0x0};}async['getDescription'](){return'';}},Device=class{['type']='mobile';['connection'];['blocked']=![];constructor({connection:B}){this['connection']=B;}async['stabilize'](B,Q){}async['captureScreenshot'](){return this['connection']['getScreenshot']();}async['extractFlatAXTree'](){const B=await this['connection']['extractFlatAXTree'](),Q={...B,'nodes':[]};for(const a of B['nodes'])Q['nodes']['push']({...a,'node':makeIOSNode({'connection':this['connection'],'handle':a['node']})});return Q;}};const extractAXTree$1=makeBundledScript({'name':'extractAXTree','url':new URL('../../assets/extract-ax-tree-BoQlk00-.js',import.meta.url)}),extractPdfAXTree=makeBundledScript({'name':'extractPdfAXTree','url':new URL('../../assets/extract-pdf-ax-tree-DFauJ1eB.js',import.meta.url)});makeBundledScript({'name':'wipeOriginStorage','url':new URL('../../assets/wipe-origin-storage-CF1Vf2FY.js',import.meta.url)}),makeBundledExpression({'name':'recorder','url':new URL('../../assets/recorder-YUoRBu4F.js',import.meta.url)}),makeBundledExpression({'name':'sessionReplay','url':new URL('../../assets/session-replay-CIK-O8Jw.js',import.meta.url)});const version$2='1.7.1';function coversViewport(B){const Q=new Rectangle(0x0,0x0,B['tree']['viewport']['width'],B['tree']['viewport']['height']);return(B['borderRect']['intersection'](Q)?.['area']??0x0)/Q['area']>=0.9;}var AXNodeView=class AXNodeView extends EventTarget$1{['_tree'];['_nodes']=[];['debugLog'];['_parent']=null;['_children']=[];['_host']=null;['_popup']=null;['_panel']=null;['_backgroundRoot']=null;['_stackingContextRoot']=null;['_overflowRoot']=null;['_controlNodes']=[];['_type']={};['_state']={};['_style']={};['_options'];['_text']='';['_visibleLabel']='';['_geometricLabel'];['_declarativeLabel']='';['_visibleDescription']='';['_declarativeDescription']='';['_attributes']=Object['create'](null);['_isStackingContextRoot']=![];['_elevation']=0x0;['_borderRect'];['_contentRect'];['_scrollable'];['_role'];['depth']=-0x1;['pre']=-0x1;['post']=-0x1;['rowCells'];['colCells'];['rows'];['columns'];get['tree'](){return this['_tree'];}get['node'](){return this['_nodes'][0x0];}get['incorporated'](){return this['_nodes'];}get['parent'](){return this['_parent'];}get['host'](){return this['_host'];}get['popup'](){return this['_popup'];}get['card'](){return this['_panel'];}get['backgroundRoot'](){return this['_backgroundRoot'];}get['controlNodes'](){return this['_controlNodes'];}get['stackingContextRoot'](){return this['_stackingContextRoot'];}get['overflowRoot'](){return this['_overflowRoot'];}get['children'](){return this['_children'];}get['disconnected'](){return!this['parent']?.['children']['includes'](this);}get['invisible'](){return this['style']['opacity']===0x0||this['_style']['hidden']||this['borderRect']['width']<=0x1&&this['borderRect']['height']<=0x1;}get['transparent'](){return!this['type']['image']&&!this['_style']['backgroundColor'];}get['appearance'](){return!this['style']['hidden']&&(!this['transparent']||this['hasBorder']);}get['inViewport'](){return new Rectangle(0x0,0x0,this['tree']['viewport']['width'],this['tree']['viewport']['height'])['intersects'](this['borderRect']);}get['type'](){return this['_type'];}get['state'](){return this['_state'];}get['style'](){return this['_style'];}get['options'](){return this['_options'];}get['text'](){return this['_text'];}get['visibleLabel'](){return this['_visibleLabel'];}get['geometricLabel'](){return this['_geometricLabel'];}get['declarativeLabel'](){return this['_declarativeLabel'];}get['visibleDescription'](){return this['_visibleDescription'];}get['declarativeDescription'](){return this['_declarativeDescription'];}get['titles'](){return{...this['_text']?{'text':this['_text']}:{},...this['_visibleLabel']?{'visibleLabel':this['_visibleLabel']}:{},...this['_geometricLabel']?{'geometricLabel':this['_geometricLabel']}:{},...this['_declarativeLabel']?{'declarativeLabel':this['_declarativeLabel']}:{}};}get['attributes'](){return this['_attributes'];}get['isStackingContextRoot'](){return this['_isStackingContextRoot'];}get['elevation'](){return this['_elevation'];}get['borderRect'](){return this['_borderRect'];}get['visibleBorderRect'](){if(!this['_overflowRoot'])return this['borderRect'];return this['borderRect']['intersection'](this['_overflowRoot']['contentRect'])??new Rectangle(this['borderRect']['x'],this['borderRect']['y'],0x0,0x0);}get['contentRect'](){return this['_contentRect'];}get['scrollable'](){return this['_scrollable'];}get['role'](){return this['_role'];}get['rects'](){return{'border':this['_borderRect'],'content':this['_contentRect']};}get['hasBorder'](){return this['_style']['border']&&this['_style']['border']['length']>0x0;}get['isContrastingToBackground'](){return this['_style']['backgroundColor']!=null||!!this['type']['image'];}get['computedBackground'](){if(this['_style']['backgroundColor'])return this['_style']['backgroundColor'];if(this['type']['image'])return'image';if(this['_backgroundRoot']){if(this['_backgroundRoot']['type']['image'])return'image';return this['_backgroundRoot']['style']['backgroundColor']??null;}return null;}get['isVisuallySeparated'](){return this['isContrastingToBackground']||this['hasBorder'];}get['isOpaque'](){if(this['transparent'])return![];const B=0.9;return(this['style']['backgroundColor']?.['a']??0x1)>=B||(this['_style']['opacity']??0x1)>=B;}constructor(B){super(),this['_tree']=B;}*['ancestors']({up:B}={}){B??=a=>a['parent'];let Q=B(this);while(Q){yield Q,Q=B(Q);}}*['descendants']({dead:B,leaf:Q}={}){const a=[...this['children']];while(a['length']>0x0){const c=a['shift']();if(B?.(c))continue;yield c;if(!Q?.(c))a['push'](...c['children']);}}*['nodes']({dead:B,leaf:Q}={}){const a=[this];while(a['length']>0x0){const c=a['shift']();if(B?.(c))continue;yield c;if(!Q?.(c))a['push'](...c['children']);}}['ancestor'](B){for(const Q of this['ancestors']())if(B(Q))return Q;return null;}['lca'](...B){let Q=this,a=B['reduce']((X,f)=>{if(f['depth']<Q['depth'])X['push'](Q),Q=f;else X['push'](f);return X;},[]),c=Q;while(c){a=a['filter'](X=>!c['contains'](X));if(a['length']===0x0)return c;else c=c['parent'];}return c;}['contains'](B){return this['pre']<B['pre']&&this['post']>B['post'];}['precedes'](B){return this['pre']<B['pre'];}['follows'](B){return this['pre']>B['pre'];}['beneath'](...B){const Q=[this,...this['ancestors']({'up':a=>a['stackingContextRoot']})];return B['some'](a=>{if(this===a)return![];if(a['contains'](this))return![];if(this['contains'](a))return a['borderRect']['contains'](this['borderRect'])&&(a['borderRect']['area']>this['borderRect']['area']||a['borderRect']['width']>=a['tree']['viewport']['width']&&a['borderRect']['height']>=a['tree']['viewport']['height']);if(!coversViewport(a)){const Y=this['borderRect']['intersection'](a['borderRect']);if(!Y||Y['area']/this['borderRect']['area']<0.5)return![];}const c=[a,...a['ancestors']({'up':h=>!Q['includes'](h)?h['stackingContextRoot']:null})];let X,f;const J=Q['lastIndexOf'](c['at'](-0x1));J===-0x1?(X=Q['at'](-0x1),f=c['at'](-0x1)):(X=Q[J-0x1],f=c['at'](-0x2));if(X['elevation']<f['elevation'])return!![];else{if(X['elevation']===f['elevation']){if(X['precedes'](f))return!![];}}});}['distance'](B){const Q=this['lca'](B);if(!Q)return Infinity;return this['depth']-Q['depth']+B['depth']-Q['depth'];}['toJSON'](){return{'type':this['_type'],'text':this['_text'],'visibleLabel':this['_visibleLabel'],'geometricLabel':this['geometricLabel'],'declarativeLabel':this['_declarativeLabel'],'visibleDescription':this['_visibleDescription'],'declarativeDescription':this['_declarativeDescription'],'attributes':this['_attributes'],'state':this['_state'],'style':this['_style'],'options':this['_options']?.['map'](({node:B,...Q})=>Q),'borderRect':this['_borderRect']?{'x':this['_borderRect']['x'],'y':this['_borderRect']['y'],'width':this['_borderRect']['width'],'height':this['_borderRect']['height']}:void 0x0,'elevation':this['_elevation'],'scrollable':this['_scrollable'],'role':this['_role'],'children':this['_children']['map'](B=>B['toJSON']()),'debugLog':this['debugLog']};}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){return'AXNode\x20'+a({'node':this['node']??{[Symbol['for']('nodejs.util.inspect.custom')]:(c,X)=>{const f=Object['keys'](this['type']),J=f['length']>0x0?f['reduce']((Y,h)=>this['type'][h]>this['type'][Y]?h:Y):'unknown';return X['stylize']('<'+J+'\x20/>','special');}},'attributes':this['attributes'],'type':this['type'],'titles':this['titles'],'state':this['state'],'style':this['style']},{...Q,'compact':!![],'breakLength':Infinity});}static['fromJSON'](B,Q,a){const c=new AXNodeView(B);c['_parent']=a,c['_type']=Q['type']??{},c['_text']=Q['text']??'',c['_visibleLabel']=Q['visibleLabel']??'',c['_geometricLabel']=Q['geometricLabel']??'',c['_declarativeLabel']=Q['declarativeLabel']??'',c['_visibleDescription']=Q['visibleDescription']??'',c['_declarativeDescription']=Q['declarativeDescription']??'',c['_attributes']=Q['attributes']??Object['create'](null),c['_state']=Q['state']??{},c['_style']=Q['style']??{},c['_options']=Q['options'];Q['borderRect']&&(c['_borderRect']=new Rectangle(Q['borderRect']['x'],Q['borderRect']['y'],Q['borderRect']['width'],Q['borderRect']['height']),c['_contentRect']=c['_borderRect']);if(Q['elevation']!==void 0x0)c['_elevation']=Q['elevation'];if(Q['scrollable'])c['_scrollable']=Q['scrollable'];if(Q['role'])c['_role']=Q['role'];if(Q['debugLog'])c['debugLog']=Q['debugLog'];return c['_children']=(Q['children']??[])['map'](X=>AXNodeView['fromJSON'](B,X,c)),c;}},AXTreeView=class AXTreeView{['_viewport'];['_direction'];['_version'];['_root'];['_hosts']=[];['_popups']=[];['_collected']=[];['_nodeCount']=0x0;['_rtree']=new RTree();['_mapping']=new Map();get['viewport'](){return this['_viewport'];}get['direction'](){return this['_direction'];}get['version'](){return this['_version'];}get['root'](){return this['_root'];}get['nodeCount'](){return this['_nodeCount'];}get['hosts'](){return this['_hosts'];}get['popups'](){return this['_popups'];}get['collected'](){return this['_collected'];}constructor(B){this['_viewport']=B['viewport'],this['_direction']=B['direction'],this['_version']=B['version'];}*['nodes'](){yield*this['_root']['nodes']();}['search'](B){return this['_rtree']['search'](B);}['lca']([B,...Q]){return B['lca'](...Q);}[Symbol['iterator']](){return this['nodes']();}['findByNode'](B){return this['_mapping']['get'](B);}['toJSON'](){return{'viewport':this['_viewport'],'direction':this['_direction'],'version':this['_version'],'root':this['_root']['toJSON'](),'hosts':this['_hosts']['map'](B=>B['toJSON']()),'popups':this['_popups']['map'](B=>B['toJSON']()),'collected':this['_collected']['map'](B=>B['toJSON']())};}[Symbol['for']('nodejs.util.inspect.custom')](B,Q,a){let c='';const X=[this['_root']];while(X['length']>0x0){const f=X['shift']();c+='\x20\x20'['repeat'](f['depth'])+a(f,Q)+'\x0a',X['unshift'](...f['children']);}return c;}static['fromJSON'](B){const Q=new AXTreeView({'viewport':B['viewport'],'direction':B['direction'],'version':B['version']});Q['_root']=AXNodeView['fromJSON'](Q,B['root'],null),Q['_nodeCount']=0x0;for(const a of Q['_root']['nodes']()){Q['_nodeCount']++;if(a['type']['text']&&a['rects']['border'])Q['_rtree']['insert']({'rect':a['borderRect'],'data':a});}return Q['_root']['depth']=0x0,orderSubtree(Q['_root']),Q;}};function orderSubtree(B){let Q=0x0,a=0x0;const c=[{'node':B,'visited':![]}];while(c['length']>0x0){const X=c['at'](-0x1);if(!X['visited']){X['node']['pre']=Q++;for(let f=X['node']['children']['length']-0x1;f>=0x0;--f){X['node']['children'][f]['depth']=X['node']['depth']+0x1,c['push']({'node':X['node']['children'][f],'visited':![]});}X['visited']=!![];}else X['node']['post']=a++,c['pop']();}}const HOST_STABILITY_TIMEOUT=0x1388;async function extractAXTree(B,Q){let a;if(B instanceof Browser)await B['wait']('stable'),a=await extractWebAXTree(B['activePage'],Q);else{if(B instanceof Device)a=await extractMobileAXTree(B);else throw new Error('Can\x27t\x20extract\x20ax\x20tree\x20of\x20unknown\x20automator\x20implementation');}return a['version']??=version$2,a;}async function extractWebAXTree(B,Q){const a=performance['now'](),c=Q?.['debug']||Boolean(process.env.AX_TREE_DEBUG);await B['wait']('stable');if(isPdfViewerFrame(B['mainFrame'])){const f=await extractPdfFlatAXTree(B['mainFrame']);return log('axTreeExtracted',{'kind':'pdf','durationMs':performance['now']()-a}),f;}const X=await extractWebFlatAXTree(B['mainFrame'],{'debug':c});while(X['unaccessibleHosts']['length']>0x0){const J=X['unaccessibleHosts']['shift']();try{const Y=X['nodes'][J],h=await Y['node']['getContentFrame']();if(h['isAd']){Y['type']['ad']=0x1;continue;}await h['wait']('stable',{'signal':AbortSignal['timeout'](HOST_STABILITY_TIMEOUT)});const V=await extractWebFlatAXTree(h,{'offset':{'index':X['nodes']['length'],'location':{'x':Y['contentRect']['x'],'y':Y['contentRect']['y']}},'debug':c});V['nodes']['length']>0x0&&(X['nodes']['push'](...V['nodes']),X['unaccessibleHosts']['push'](...V['unaccessibleHosts']),Y['children']=[V['offset']['index']]);}catch(k){log('axTreeExtractionAborted',{'error':k});}}return log('axTreeExtracted',{'kind':'ax','durationMs':performance['now']()-a}),X;}async function extractWebFlatAXTree(B,Q){return await B['execute'](extractAXTree$1,[Q]);}async function extractPdfFlatAXTree(B){return await B['defaultExecute'](extractPdfAXTree,[],{'await':!![]});}async function extractMobileAXTree(B){return B['extractFlatAXTree']();}var AXSnapshot=class{['collectIdentity']=![];['generation']=0x0;['flatAXTree'];['axTree'];['initFlatAXTree'](B){this['flatAXTree']=B,startCollapseLog();}['initAXTree'](B){this['axTree']=B,++this['generation'],flushCollapseLog(this['generation']);}['toJSON'](){return{'generation':this['generation'],'flatTree':this['flatAXTree']?{...this['flatAXTree'],'nodes':this['flatAXTree']['nodes']['map'](({node:B,...Q})=>Q)}:void 0x0,'axTree':this['axTree']?.['toJSON']()??void 0x0};}};const axSnapshot=new AXSnapshot(),MAX_LOGGED_COLLAPSES=0xc8,MAX_LOGGED_CANDIDATES=0xf,pendingCollapses=[];let collectingCollapses=![],omittedCollapses=0x0;function startCollapseLog(){pendingCollapses['length']=0x0,omittedCollapses=0x0,collectingCollapses=!![];}function flushCollapseLog(B){collectingCollapses=![];if(pendingCollapses['length']===0x0)return;debug('axTreeNodesCollapsed',{'generation':B,'collapses':pendingCollapses['splice'](0x0),...omittedCollapses>0x0?{'omitted':omittedCollapses}:{}});}debugBus['on']('node-collapsed',B=>{if(!collectingCollapses)return;if(pendingCollapses['length']<MAX_LOGGED_COLLAPSES)pendingCollapses['push'](B['payload']);else++omittedCollapses;}),debugBus['on']('prioritized-candidates',B=>{try{const {descriptor:Q,candidates:a,prioritizers:c,reason:X}=B['payload'];debug('axCandidatesPrioritized',{'generation':axSnapshot['generation'],'reason':X,'descriptor':projectDescriptor(Q),'candidates':projectPrioritizedCandidates(a['slice'](0x0,MAX_LOGGED_CANDIDATES),c),...a['length']>MAX_LOGGED_CANDIDATES?{'omitted':a['length']-MAX_LOGGED_CANDIDATES}:{}});}catch(f){error('findReasoningEmitFailed',{'error':f});}});var AXOps=class{['automator'];['axProvider'];constructor(B,Q){this['automator']=B,this['axProvider']=Q;}async['extractTree'](){const B=await extractAXTree(this['automator'],{'debug':axSnapshot['collectIdentity']});axSnapshot['initFlatAXTree'](B);const Q=await this['axProvider']['makeAXTree'](B);return axSnapshot['initAXTree'](Q),Q;}async['makeTree'](B){axSnapshot['initFlatAXTree'](B);const Q=await this['axProvider']['makeAXTree'](B);return axSnapshot['initAXTree'](Q),Q;}async['findCandidate'](B,Q,a){return this['axProvider']['findAXNode'](B,Q,a);}async['findCandidates'](B,Q,a){if(!this['axProvider']['findAXNodes'])throw new Error('The\x20configured\x20AXProvider\x20does\x20not\x20support\x20listing\x20all\x20candidates');return this['axProvider']['findAXNodes'](B,Q,a);}async['searchCandidates'](B,Q,a){const c={'useBackwardCompatibleTypeScore':![],...a},X=await this['findCandidates'](B,Q,c);if(!Q['title']||!Q['type'])return X;const {title:f,...J}=Q,Y=new Set(X['map'](V=>V['node'])),h=(await this['findCandidates'](B,J,c))['filter'](V=>!Y['has'](V['node']));return[...X,...h];}async['describeNode'](B,Q){return this['axProvider']['describeAXNode'](B,Q);}async['findNode'](B,Q){const {stack:a,timeout:timeout=0x0,signal:c,metrics:X}=Q,f=this['automator'];bus['dispatch'](new AXNodeSearchStartedEvent({'descriptor':B}));if(B['node']){const t=B['node'];return log('elementFound',{'node':projectAXNode(t),'descriptor':B}),a['node'](B,t),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':B,'node':t})),t;}const J=Date['now'](),Y=makeWatcher({'signal':c})['resolve'](void 0x0,{'delay':timeout||0x1}),h=makeWatcher({'signal':c})['resolve']();let V,k;if(isSelectorElementDescriptor(B)){if(f instanceof Browser)k=async()=>{if(X)X['findStrategy']='selector';const K=X?.['axTreeExtractionMs']??0x0,O=performance['now'](),S=await this.#findWithSelfHealing(B,{'browser':f,'metrics':X});if(X){const C=performance['now']()-O,G=(X['axTreeExtractionMs']??0x0)-K;X['findElementMs']=(X['findElementMs']??0x0)+(C-G);}return S;};else throw new Error('Can\x27t\x20find\x20ax\x20node\x20using\x20selector\x20description\x20with\x20non-web\x20automator');}else k=async()=>{if(X)X['findStrategy']='columbus';const K=performance['now']();V=await this['extractTree']();X&&(X['axTreeExtractionMs']=(X['axTreeExtractionMs']??0x0)+(performance['now']()-K),X['axTreeExtractionCount']=(X['axTreeExtractionCount']??0x0)+0x1,X['axNodeCount']=V['nodeCount']);const O=performance['now'](),S=await this.#findWithColumbus(B,V);if(X)X['findElementMs']=(X['findElementMs']??0x0)+(performance['now']()-O);return S;};while(Y['pending']||h['pending']){const K=await abortable(k(),c);if(K)return log('elementFound',{'node':projectAXNode(K),'descriptor':B}),Y['resolve'](),h['resolve'](),a['node'](B,K),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':B,'node':K})),K;V??=await this['extractTree']();if(timeout>0x0){if(isPageSpinnerVisible(V))!h['pending']&&(bus['dispatch'](new StabilizationWaitStartedEvent()),h['reset']()['resolve'](void 0x0,{'delay':0xea60-(Date['now']()-J)})['finally'](()=>bus['dispatch'](new StabilizationWaitFinishedEvent())));else{if(h['pending'])h['resolve']();}}await abortable(o(0x3e8,{'signal':c}),c);}return log('elementNotFound',{'durationMs':Date['now']()-J,'descriptor':B,'loadingPending':h['pending']}),Y['resolve'](),h['resolve'](),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':B})),null;}async['findNodes'](B,Q){const {stack:a,timeout:timeout=0x0,signal:c,metrics:X}=Q;if(isSelectorElementDescriptor(B))throw new Error('Cannot\x20resolve\x20an\x20element\x20collection\x20from\x20a\x20selector\x20descriptor');if(!this['axProvider']['findAXNodeCollection'])throw new Error('The\x20configured\x20AXProvider\x20does\x20not\x20support\x20resolving\x20an\x20element\x20collection');const f=Date['now']();while(!![]){if(X)X['findStrategy']='columbus';const J=performance['now'](),Y=await abortable(this['extractTree'](),c);X&&(X['axTreeExtractionMs']=(X['axTreeExtractionMs']??0x0)+(performance['now']()-J),X['axTreeExtractionCount']=(X['axTreeExtractionCount']??0x0)+0x1,X['axNodeCount']=Y['nodeCount']);const h=performance['now'](),V=await this['axProvider']['findAXNodeCollection'](Y,B,{'debug':{'reason':'find-element'}});if(X)X['findElementMs']=(X['findElementMs']??0x0)+(performance['now']()-h);if(V['length']>0x0||Date['now']()-f>=timeout){const k=V['map'](t=>t['node']);return k['forEach'](t=>a['node'](B,t)),log('elementCollectionFound',{'descriptor':B,'count':k['length']}),k;}await abortable(o(0x3e8,{'signal':c}),c);}}async #findWithColumbus(B,Q){let a=B;while(a){const c=await this['axProvider']['findAXNode'](Q,a,{'debug':{'reason':'find-element'}});if(c)return c['node'];a=a['fallback'];}return null;}async #findWithSelfHealing(B,{browser:Q,metrics:a}){const c=Q['activePage'],X=Q['driver'];await X['switchTo']()['window'](c['targetId']);const f=[[]];for(let Y=0x0;Y<f['length'];++Y){const h=f[Y-0x1]??[],V=f[Y],k=h['findIndex']((K,O)=>K['element']!==V[O]['element']);if(k>=0x0){for(const K of h['slice'](k))await X['switchTo']()['parentFrame']();for(const {element:O}of V['slice'](k))await X['switchTo']()['frame'](O);}else{for(const {element:S}of V['slice'](h['length']))await X['switchTo']()['frame'](S);}const t=await J(B);if(t){const C=await X['executeScript']('return\x20'+isElementAcceptableInvisible['source']+'(arguments[0])',t);if(await X['executeScript']((G,E)=>{const {width:W,height:e}=G['getBoundingClientRect']();if(E||W!==0x0||e!==0x0)return G['setAttribute']('data-webdriver-element-mark',''),!![];return![];},t,C)){let G=c['mainFrame'];for(const {index:I}of V)G=await(await G['execute'](n=>document['querySelectorAll']('iframe,\x20frame')[n],[I]))['getContentFrame']();const E=await G['execute'](()=>{const n=[document];for(const R of n){const F=R['querySelector']('[data-webdriver-element-mark]');if(F){F['removeAttribute']('data-webdriver-element-mark');if(F instanceof SVGElement){let w=F;while(w['viewportElement'])w=w['viewportElement'];return w;}return F;}Array['from'](R['querySelectorAll']('*'))['forEach'](i=>{if(i['shadowRoot'])n['push'](i['shadowRoot']);});}throw new Error('Cannot\x20re-find\x20element\x20that\x20was\x20marked\x20using\x20webdriver');}),W=performance['now'](),e=await this['extractTree']();a&&(a['axTreeExtractionMs']=(a['axTreeExtractionMs']??0x0)+(performance['now']()-W),a['axTreeExtractionCount']=(a['axTreeExtractionCount']??0x0)+0x1,a['axNodeCount']=e['nodeCount']);const H=await E['normalize']();let q;i:for(const n of e['nodes']())for(const R of n['incorporated'])if(await R['equal'](H)){q=n;break i;}if(q){const [F,w]=await Promise['all']([q['node']['getNodeId'](),E['getNodeId']()]);if(F!==w)return log('axNodeViewMismatch',{'descriptor':B}),new Proxy(q,{'get'(i,U){if(U==='node')return E;return Reflect['get'](i,U);}});else return q;}return null;}}(await X['executeScript'](()=>{return Array['from'](document['querySelectorAll']('iframe,\x20frame'))['reduce']((i,U,d)=>{const {width:L,height:s}=U['getBoundingClientRect']();if(L>0x0&&s>0x0)i['push']({'element':U,'index':d});return i;},[]);}))['forEach'](i=>f['push']([...V,i]));}return null;async function J(i){const [U,...d]=i['selector']['selector']['split']('>>>')['map'](s=>s['trim']());let L;if(!U)throw new Error('Selector\x20cannot\x20be\x20empty');L=await X['findElement']({[i['selector']['type']]:U})['catch'](()=>null);if(!L)return null;for(const s of d){if(/(?:\.\.\/|\.\/|\*\/|\/|\()/['test'](s))throw new Error('Only\x20CSS\x20selectors\x20are\x20supported\x20after\x20the\x20first\x20segment\x20(after\x20>>>)');L=await L['getShadowRoot']()['then'](async A=>A['findElement']({'css':s}))['catch'](()=>null);if(!L)return null;}return L;}}},version$1='5.17.0',version='5.17.0';async function makeRunner(B){if(B['logger'])eventLogger['downstream']=B['logger'];if(B['automator'])return new Runner({...B,'automator':B['automator']});else{if(B['browser'])return new Runner({...B,'automator':B['browser']});else{if(B['debuggerAddress']){const Q=await makeBrowser({'debuggerAddress':B['debuggerAddress'],'driver':B['driver']});return new Runner({...B,'automator':Q});}else{if(B['driver']){const a=await makeBrowser({'driver':B['driver']});return new Runner({...B,'automator':a});}}}}}var Runner=class extends EventTargetNode{#automator;#context;#statuses=[];#shouldRunPreinstructions=!![];#pdfInterceptorInstalled;get['__context'](){return this.#context;}get['automator'](){return this.#automator;}get['flags'](){return flags['toJSON']();}get['browser'](){return this.#automator instanceof Browser?this.#automator:void 0x0;}get['parameters'](){return this.#context['scope']['main']['input'];}set['parameters'](B){this.#context['scope']['main']['input']=Object['fromEntries'](Object['entries'](B)['map'](([Q,a])=>[Q['toLowerCase'](),a]));}get['variables'](){return this.#context['scope']['public'];}set['variables'](B){this.#context['scope']['active']['public']=Object['fromEntries'](Object['entries'](B)['map'](([Q,a])=>[Q['toLowerCase'](),a]));}get['status'](){return this.#statuses[0x0];}constructor(B){super(),this.#automator=B['automator'];if(B['flags'])flags['set'](B['flags']);this.#context={'axOps':new AXOps(B['automator'],B['axProvider']),'scope':makeScope({'global':this['browser']?{'page':{'value':makePageData({'browser':this['browser']})},'pdf':makePdfData({'browser':this['browser']})}:{},'input':Object['fromEntries'](Object['entries'](B['parameters']??{})['map'](([Q,a])=>[Q['toLowerCase'](),a])),'public':{},'internal':{...Object['fromEntries'](Object['entries'](B['timeouts']??{})['map'](([Q,a])=>[Q,{'value':a}])),...B['shouldSkipInitialNavigationInNestedScope']!==void 0x0?{'shouldSkipInitialNavigationInNestedScope':{'value':B['shouldSkipInitialNavigationInNestedScope']}}:{},...B['shouldSkipAssertionsInNestedScope']!==void 0x0?{'shouldSkipAssertionsInNestedScope':{'value':B['shouldSkipAssertionsInNestedScope']}}:{},...B['loopIterationLimit']!==void 0x0?{'loopIterationLimit':{'value':B['loopIterationLimit']}}:{}}}),'actions':{...B['actions']},'dispatcher':makeDispatcher({'proxy':B['proxy']}),'preinstructions':[]};if(B['shouldHideFilepickerDialogs'])this['browser']['hideFilepickers'](!![]);this['browser']&&(this.#pdfInterceptorInstalled=installPdfInterceptor(this['browser'])['catch'](Q=>{error('pdfInterceptorInstallFailed',{'error':Q});}),this['browser']['on']('stabilizingNavigation',({done:Q})=>bus['dispatch'](Q?new NavigationWaitFinishedEvent():new NavigationWaitStartedEvent())),this['browser']['on']('stabilizingLoad',({done:Q})=>bus['dispatch'](Q?new LoadWaitFinishedEvent():new LoadWaitStartedEvent())),this['browser']['on']('stabilizingOutgoingRequests',({done:Q})=>bus['dispatch'](Q?new OutgoingRequestsWaitFinishedEvent():new OutgoingRequestsWaitStartedEvent()))),this['on']('listenerAdded',async({event:Q,count:a})=>{if(Q==='filepickerDialogRequested'&&a===0x1)try{const c=await this['browser']?.['filepicker'](async X=>{this['dispatch'](new RunnerFilepickerDialogRequestedEvent(X));});this['on']('listenerRemoved',({event:X,count:f})=>{if(X==='filepickerDialogRequested'&&f===0x0)c();});}catch(X){log('filepickerAutoSetupFailed',{'error':X});}}),bus['on']('log',Q=>Q['component']==='runner'&&this['dispatch'](Q['clone']())),bus['on']('progress',Q=>{const a=this['status'];if(Q['done']){this.#statuses['splice'](this.#statuses['indexOf'](Q['status']),0x1);if(Q['status']==='searchingForElement'&&Q['node'])this['dispatch'](new RunnerAXNodeFoundEvent(Q['node']));}else this.#statuses['unshift'](Q['status']);if(this['status']&&a!==this['status'])this['dispatch'](new RunnerStatusChangedEvent({'previousStatus':a,'status':this['status']}));});}async['run'](B,Q={}){let a;if(typeof B==='string'){const [h]=parseText(B);if(h['error']){const V={'references':new Map(),'extractors':new Map(),'operands':new Map()};return{'status':'error','error':h['error']['message']??'Failed\x20to\x20parse\x20instruction:\x20'+h['text'],'code':ErrorCode['MESSAGE_PARSING'],'meta':{'pos':h['error']['pos'],'text':h['error']['text']},'results':[],'values':V};}a=h['result'];}else{if(Array['isArray'](B))a=B;else a=unseal(B);}!Q['runningPreinstructions']&&(this.#statuses=[],this.#shouldRunPreinstructions=!![],!Q['loop']&&(this.#context['scope']['unbindAll'](),this.#context['loops']?.['clear']()));if(this.#pdfInterceptorInstalled)await this.#pdfInterceptorInstalled;const c=Date['now']();log('runStarted',{'runnerVersion':version$1,'parserVersion':version,'nodeVersion':process['version']}),log('instructionExecutionStarted',{'instructions':a,'stepIndex':Q['stepIndex']}),bus['dispatch'](new InstructionExecutionStartedEvent({'preStep':Q['runningPreinstructions']}));const X=[],f={'references':new Map(),'extractors':new Map(),'operands':new Map()},J=Q['loop']?await openLoopBindings(Q['loop'],{'context':this.#context,'stack':makeValuesStack(),'automator':this.#automator,'signal':Q['signal']}):void 0x0,Y=a['map'](k=>({'instruction':k,'shouldFailOnError':!![]}));while(Y['length']>0x0){const {instruction:k,shouldFailOnError:t}=Y['shift'](),K=Date['now']();log('subinstructionExecutionStarted',{'instruction':k,'correlationId':Q['correlationId']});const O=await this['handle'](k,Q);debug('instructionResultHandled',{'status':O['status'],'code':O['status']==='error'?O['code']:void 0x0}),X['push'](O);if(O['status']==='tried')Y['unshift'](...O['meta']['next']['map'](C=>({'instruction':C,'shouldFailOnError':![]})));else{if(O['status']==='preinstructions\x20defined')this.#context['preinstructions']=O['meta']['preinstructions'];else{if(O['status']==='condition\x20evaluated'){if(O['meta']['next'])Y['unshift'](...O['meta']['next']['map'](C=>({'instruction':C,'shouldFailOnError':!![]})));}else{if(O['status']==='looped'){if(O['meta']['next'])Y['unshift'](...O['meta']['next']['map'](C=>({'instruction':C,'shouldFailOnError':!![]})),{'instruction':k,'shouldFailOnError':t});}}}}const S=Date['now']();log('subinstructionExecutionFinished',{'instruction':k,'duration':S-K,'status':O['status'],'errorcode':O['status']==='error'?O['code']:void 0x0,'metrics':O['metrics']});O['status']!=='skipped'&&(O['values']['references']['forEach']((C,G)=>f['references']['set'](G,C)),O['values']['extractors']['forEach']((C,G)=>f['extractors']['set'](G,C)),O['values']['operands']['forEach']((C,G)=>f['operands']['set'](G,C)));if(O['status']==='error'){if(!t)break;return log('instructionExecutionFinished',{'instructions':a,'duration':S-c,'status':O['status'],'errorcode':O['code']}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':Q['runningPreinstructions']})),J?.(),{'status':'error','error':O['error'],'code':O['code'],'meta':O['meta'],'results':X,'values':f};}else{if(O['status']==='aborted')return log('instructionExecutionFinished',{'instructions':a,'duration':S-c,'status':O['status']}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':Q['runningPreinstructions']})),J?.(),{'status':'aborted','results':X,'values':f};}}return log('instructionExecutionFinished',{'instructions':a,'duration':Date['now']()-c,'status':'success'}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':Q['runningPreinstructions']})),J?.(),{'status':'success','results':X,'values':f};}async['handle'](B,Q={}){const a=getInstructionText(B);if(this.#context['scope']['active']['parent']){const c=this.#context['scope']['internal']['shouldSkipAssertionsInNestedScope']?.['value'],X=this.#context['scope']['internal']['forceRunningAssertions']?.['value'];if(c&&X!=='all'){if(B['type']==='assert'){if(!X||X!=='nonvisual')return{'status':'skipped','text':a};}else{if(B['type']==='visual\x20check'){if(!X||X!=='visual')return{'status':'skipped','text':a};}}}const f=this.#context['scope']['internal']['shouldSkipInitialNavigationInNestedScope']?.['value'],J=this.#context['scope']['internal']['forceRunningNavigation']?.['value'];if(Q['stepIndex']===0x0&&f&&J!=='all'){if(B['type']==='navigate')return{'status':'skipped','text':a};}}return!B['type']['includes']('preinstruction')&&this.#shouldRunPreinstructions&&this.#context['preinstructions']['length']>0x0&&!Q['runningPreinstructions']&&(await this['run'](this.#context['preinstructions'],{'runningPreinstructions':!![]}),this.#shouldRunPreinstructions=![]),await makeHandler({'automator':this.#automator,'context':this.#context,'instruction':B,...Q})['run']();}async['find'](B,Q={}){let a;if(typeof B==='string'){const {result:J,error:Y}=parseElementFragment(B);if(Y||!J)throw new RunnerError('Failed\x20to\x20parse\x20element\x20descriptor:\x20'+B,{'code':ErrorCode['MESSAGE_PARSING']});a=J;}else a=B;const c=Q['timeout']??this.#context['scope']['internal']['findTimeout']?.['value']??this.#context['scope']['internal']['timeout']?.['value']??0x2710,X=makeValuesStack();await this.#automator['stabilize']('strict',{'signal':Q['signal'],'timeout':c});const f=await evaluateExpression(a,{'context':this.#context,'stack':X,'automator':this.#automator,'timeout':c,'signal':Q['signal']});return(await this.#context['axOps']['findNode'](f,{'stack':X,'timeout':c,'signal':Q['signal']}))?.['node']??null;}async['setScope'](...B){this.#context['scope']['activate']('main');for(const Q of B){if(!this.#context['scope']['available'](Q))this.#context['scope']['set'](Q,{'input':{},'public':{},'internal':{}});this.#context['scope']['activate'](Q);}}async['resetScope'](){this.#context['scope']['reset']();}async['dispose'](){if(this.#pdfInterceptorInstalled){const B=await this.#pdfInterceptorInstalled;this.#pdfInterceptorInstalled=void 0x0,B?.();}}async[Symbol['asyncDispose']](){return this['dispose']();}},RunnerAXNodeFoundEvent=class extends Event{['node'];constructor(B,Q){super('nodeFound',Q),this['node']=B;}},RunnerFilepickerDialogRequestedEvent=class extends Event{['dialog'];['frame'];['element'];['multiple'];['accept'];constructor(B){super('filepickerDialogRequested'),this['dialog']=B,this['frame']=B['frame'],this['element']=B['element'],this['multiple']=B['multiple'],this['accept']=B['accept'];}async['files'](B){const Q=[],a=[];for(const c of B){let X,f;if(typeof c==='string')X=c;else X=c['path'],f=c['alias'];Q['push'](X),a['push'](f??basename(X));}await this['dialog']['element']['execute']((J,Y)=>J['dataset']['nlpFileAliases']=JSON['stringify'](Y),[a]),await this['dialog']['handle'](Q);}async['close'](){}},RunnerStatusChangedEvent=class extends Event{['previousStatus'];['status'];constructor({previousStatus:B,status:Q}){super('statusChanged'),this['previousStatus']=B,this['status']=Q;}},spec_driver_exports=j({'childContext':()=>childContext,'executeBrowserCommands':()=>executeBrowserCommands,'executeScript':()=>executeScript,'extractContext':()=>extractContext,'findElement':()=>findElement,'findElements':()=>findElements,'getCookies':()=>getCookies,'getDriverInfo':()=>getDriverInfo,'getTitle':()=>getTitle,'getUrl':()=>getUrl,'getViewportSize':()=>getViewportSize,'isContext':()=>isContext,'isDriver':()=>isDriver,'isElement':()=>isElement,'isSelector':()=>isSelector,'isStaleElementError':()=>isStaleElementError,'mainContext':()=>mainContext,'parentContext':()=>parentContext,'setViewportSize':()=>setViewportSize,'takeScreenshot':()=>takeScreenshot,'toSelector':()=>toSelector,'toSimpleCommonSelector':()=>toSimpleCommonSelector,'visit':()=>visit});function transformArgument(B){const Q=[];return[a(B),...Q];function a(c){if(isElement(c))return Q['push'](c),{'isElement':!![]};else{if(Array['isArray'](c))return c['map'](a);else{if(c&&typeof c==='object')return Object['entries'](c)['reduce']((X,[f,J])=>{return Object['assign'](X,{[f]:a(J)});},{});else return c;}}}}function scriptRunner(B,Q,...a){return new Function(B['startsWith']('function')?'return\x20('+B+').apply(null,\x20arguments)':B)(c(Q));function c(X){if(!X)return X;else{if(X['isElement'])return a['shift']();else{if(Array['isArray'](X))return X['map'](c);else{if(typeof X==='object')return Object['entries'](X)['reduce']((f,[J,Y])=>{return Object['assign'](f,{[J]:c(Y)});},{});else return X;}}}}}const SELECTOR_PREFIXES=['/','(','../','./','*/'];function isXpathSelector(B){return SELECTOR_PREFIXES['some'](Q=>B['startsWith'](Q));}function isDriver(B){if(!B)return![];return B instanceof Target;}function isContext(B){if(!B)return![];return B instanceof Frame;}function isElement(B){if(!B)return![];return B instanceof WebNode;}function isSelector(B){return typeof B==='string';}function isStaleElementError(B){return B?.['constructor']?.['name']==='StaleNodeError'||B?.['constructor']?.['name']==='StaleRemoteObjectHandleError';}function toSelector(B){if(B&&typeof B==='object'&&'selector'in B)return B['selector'];return B;}function toSimpleCommonSelector(B){if(typeof B==='string')return{'type':isXpathSelector(B)?'xpath':'css','selector':B};return B;}function extractContext(B){return isDriver(B)?B['mainFrame']:B;}async function executeScript(B,Q,a){return Q=typeof Q==='string'?Q:'function()\x20{return\x20('+Q['toString']()+').apply(null,\x20arguments)}',await B['execute'](scriptRunner,[Q,...transformArgument(a)],{'timeout':0xafc8});}async function findElement(B,Q,a){return(a??B)['$'](Q);}async function findElements(B,Q,a){return(a??B)['$$'](Q);}async function mainContext(B){let Q=B;while(Q['parent'])Q=Q['parent'];return Q;}async function parentContext(B){return B['parent']??B;}async function childContext(B,Q){const a=await Q['getContentFrame']();return await a['evaluate']('true'),a;}async function getDriverInfo(B){return{'features':{'allCookies':!![]}};}async function getViewportSize(B){return B['getViewportSize']();}async function setViewportSize(B,Q){await B['emulate']({'viewport':Q,'timeout':0xafc8});}async function getCookies(B){return(await B['browser']['getCookies']())['map'](Q=>{const a={...Q,'expiry':Q['expires']};return delete a['expires'],delete a['size'],delete a['priority'],delete a['session'],delete a['sourceScheme'],delete a['sourcePort'],a;});}async function getTitle(B){return B['title'];}async function getUrl(B){return B['url'];}async function visit(B,Q){await B['navigate'](Q);}async function takeScreenshot(B){const Q=await B['captureScreenshot']();return Buffer['from'](Q,'base64');}async function executeBrowserCommands(B,Q){let a;for(const c of Q)a=await B['connection']['execute'](c['command'],c['params']);return a;}var RemoteAXProvider=class{async['makeAXTree'](B){const {tree:Q,refs:a}=await this['_rqMakeAXTree'](B),c=AXTreeView['fromJSON'](Q),X=[...c['root']['nodes']()];for(let f=0x0;f<X['length'];f++)X[f]['incorporated']['push'](...a[f]??[]);return c;}async['describeAXNode'](B,Q){const a=await this['_rqDescribeAXNode'](B,Q);if(!a)return void 0x0;const {nodeIndex:c,...X}=a;if(c===void 0x0)return X;const f=[...B['root']['nodes']()];return{...X,'node':f[c]};}async['findAXNode'](B,Q,a){const c=[...B],X=await this['_rqFindAXNode'](c,Q,a);if(!X)return null;const {nodeIndex:f,...J}=X;return{...J,'node':c[f]};}},HttpRemoteAXProvider=class extends RemoteAXProvider{#baseUrl;#getAuthToken;#fetch;constructor(B){super(),this.#baseUrl=new URL(B['url']);if(!this.#baseUrl['pathname']['endsWith']('/'))this.#baseUrl['pathname']+='/';this.#getAuthToken=B['getAuthToken'],this.#fetch=B['fetch']??defaultAXServerFetch;}async['_rqMakeAXTree'](B){const Q=B['nodes']['map'](f=>f['node']),a={...B,'nodes':B['nodes']['map']((f,J)=>({...f,'node':J}))},{tree:c,refs:X}=await this.#authPost('make-ax-tree',{'flat':a});return{'tree':c,'refs':X['map'](f=>f['map'](J=>Q[J]))};}async['_rqDescribeAXNode'](B,Q){const a=[...B['root']['nodes']()];return this.#authPost('describe-ax-node',{'tree':B['toJSON'](),'query':serializeQuery(Q,a)});}async['_rqFindAXNode'](B,Q,a){const [c]=B;if(!c)return null;return this.#authPost('find-ax-node',{'tree':c['tree']['toJSON'](),'descriptor':Q,'options':a?.['limit']!==void 0x0||a?.['debug']?.['reason']?{'limit':a['limit'],'debug':a['debug']}:void 0x0});}async #authPost(B,Q){const a=await this.#getAuthToken(),c=await(await this.#fetch({'url':new URL(B,this.#baseUrl)['href'],'method':'POST','token':a,'body':Q}))['json']();if(!c['ok']){const X=new Error(c['error']['message']);X['code']=c['error']['code'],X['reason']=c['error']['reason'];throw X;}return c['data'];}};function defaultAXServerFetch({url:B,method:Q,token:a,body:c}){return fetch(B,{'method':Q,'headers':{'content-type':'application/json','authorization':'Bearer\x20'+a},'body':JSON['stringify'](c)});}function serializeQuery(B,Q){const a=B['anchor']?{...B['anchor'],'element':B['anchor']['element']?serializeQuery(B['anchor']['element'],Q):void 0x0}:void 0x0;return{...B,'node':Q['indexOf'](B['node']),'anchor':a};}export{AbortError,AutomatorError,BlockingDialog,BodyConsumedError,Browser,BrowserActivePageChangedEvent,BrowserDisconnectedEvent,BrowserPageClosedEvent,BrowserPageCreatedEvent,BrowserPageNavigatedEvent,BrowserStabilizingLoadEvent,BrowserStabilizingNavigationEvent,BrowserStabilizingOutgoingRequestsEvent,BrowserTargetCrashedEvent,BrowserTargetCreatedEvent,BrowserWindowCreatedEvent,CommandTimedOutError,Connection,Debugger,DebuggerPausedEvent,DebuggerResumedEvent,DialogHandledEvent,Evaluator,EvaluatorDestroyedEvent,EvaluatorLogEvent,Expression,FilepickerDialog,FlagChangedEvent,FlushError,Frame,FrameDestroyedEvent,FrameDocumentRequestEvent,FrameDocumentResponseEvent,FrameEvaluatorAttached,FrameFetchError,FrameLifecycleEvent,FrameNavigatedEvent,FrameNavigatingEvent,FrameSwappedEvent,FrameSwappingEvent,HarRecorder,HarRecorderStatsChangedEvent,HttpRemoteAXProvider,Injection,InjectionEvaluatorAttachedEvent,InjectionIncommingMessageEvent,InjectionOutgoingMessageEvent,InjectionTargetAttachedEvent,Intercepted,InterceptedRequest,InterceptedResponse,Keyboard,Loader,LoaderRequestEvent,LoaderResponseEvent,Mouse,NavigationFailedError,NavigationTimedOutError,NoHistoryEntryError,Port,PortIncommingMessageEvent,PortOutgoingMessageEvent,RemoteAXProvider,RemoteFunctionHandle,RemoteObjectHandle,Runner,RunnerAXNodeFoundEvent,RunnerFilepickerDialogRequestedEvent,RunnerStatusChangedEvent,Script,StaleNodeError,StaleRemoteObjectHandleError,StylesheetHandle,Target,TargetActivatedEvent,TargetActivatingEvent,TargetAttachedEvent,TargetChangedEvent,TargetChildTargetCreatingEvent,TargetClosedEvent,TargetDetachedEvent,TargetDialogEvent,TargetElementSelectedEvent,TargetFilepickerDialogEvent,TargetFrameAttachedEvent,TargetFrameTargetCreatedEvent,TargetMainFrameReadyEvent,TargetNavigatedEvent,TargetVisibilityChangeEvent,WebNode,Window,WindowDestroyedEvent,WindowTargetAttachedEvent,WindowTargetDetachedEvent,flags,isElementAcceptableInvisible,localizeRemoteValue,makeBlockingDialog,makeBrowser,makeBundledExpression,makeBundledScript,makeConnection,makeDebugger,makeEvaluator,makeExpression,makeFilepickerDialog,makeFrame,makeInjection,makeIntercepted,makeInterceptedRequest,makeInterceptedResponse,makeInterceptionPatternMatcher,makeKeyboard,makeLoader,makeMouse,makePort,makeRunner,makeScript,makeTarget,makeWebNode,makeWindow,provideRolldownConfig,spec_driver_exports as spec,toCDPPattern};
|
|
1
|
+
import{t as L}from'../../_chunks/rolldown-runtime-D7D4PA-g.js';import{debuglog,inspect,styleText}from'node:util';import{basename}from'node:path';import{once,setMaxListeners}from'node:events';import{colornames}from'color-name-list/short';import j from'parse-color';import{differenceHyab,nearest,parse,rgb}from'culori';import{readFileSync}from'node:fs';import{execFileSync}from'node:child_process';import{Agent,Headers,Request,Socks5ProxyAgent,WebSocket,buildConnector,fetch as V}from'undici';import{Buffer as X}from'node:buffer';import{Readable}from'node:stream';import{buffer}from'node:stream/consumers';import{setImmediate,setTimeout as G}from'node:timers/promises';import{nextTick}from'node:process';import{harFromMessages}from'chrome-har';import{XMLBuilder,XMLParser,XMLValidator}from'fast-xml-parser';import{parse as d}from'csv-parse/sync';import{readFile}from'node:fs/promises';const contextProxyHandler={'has'(R,w){return R['data']['has'](w)||Reflect['has'](R,w);},'get'(R,w){if(R['data']['has'](w))return R['own'](),R['accessedKeys']['add'](w),R['data']['get'](w);else return Reflect['get'](R,w);},'set'(R,w,F){return R['own'](),R['mutatedKeys']['add'](w),R['data']['set'](w,F),!![];},'deleteProperty'(R,w){return R['own'](),R['mutatedKeys']['add'](w),R['data']['delete'](w);},'ownKeys'(R){return Array['from'](R['data']['keys']());}};var Context=class Context{['data']=new Map();['accessedKeys']=new Set();['mutatedKeys']=new Set();['sharedData']=![];get['accessed'](){return this['accessedKeys']['size']>0x0;}get['mutated'](){return this['mutatedKeys']['size']>0x0;}get['self'](){return this;}constructor(){return new Proxy(this,contextProxyHandler);}['share'](){const R=this['self'];return R['sharedData']=!![],{'data':R['data'],'accessedKeys':R['accessedKeys'],'mutatedKeys':R['mutatedKeys']};}static['materialize'](R){const w=Object['create'](Context['prototype']);return w['data']=R['data'],w['accessedKeys']=R['accessedKeys'],w['mutatedKeys']=R['mutatedKeys'],w['sharedData']=!![],new Proxy(w,contextProxyHandler);}['has'](R){return this['data']['has'](R);}['own'](){if(!this['sharedData'])return;this['data']=new Map(this['data']),this['accessedKeys']=new Set(this['accessedKeys']),this['mutatedKeys']=new Set(this['mutatedKeys']),this['sharedData']=![];}['refresh'](){const R=this['self'];R['own'](),R['data']['forEach']((w,F)=>{if(!R['accessedKeys']['has'](F)&&!R['mutatedKeys']['has'](F))R['data']['delete'](F);}),R['accessedKeys']['clear'](),R['mutatedKeys']['clear']();}['clone'](){const R=this['self'],w=Object['create'](Context['prototype']);return w['data']=R['data'],w['accessedKeys']=R['accessedKeys'],w['mutatedKeys']=R['mutatedKeys'],w['sharedData']=!![],R['sharedData']=!![],new Proxy(w,contextProxyHandler);}};const collectionsProxyHandler={'has'(R,w){return R['collections']['has'](w)||Reflect['has'](R,w);},'get'(R,w){if(!R['collections']['has'](w)&&Reflect['has'](R,w))return Reflect['get'](R,w);R['own']();let F=R['collections']['get'](w);return F===void 0x0&&(F=new Collection(),R['collections']['set'](w,F)),F;},'set'(R,w,F){return R['own'](),R['collections']['set'](w,F),!![];},'deleteProperty'(R,w){return R['own'](),R['collections']['delete'](w);}};var Collections=class Collections{['collections']=new Map();['sharedData']=![];get['self'](){return this;}constructor(){return new Proxy(this,collectionsProxyHandler);}['share'](){const R=this['self'];return R['sharedData']=!![],R['collections'];}static['materialize'](R){const w=Object['create'](Collections['prototype']);return w['collections']=R,w['sharedData']=!![],new Proxy(w,collectionsProxyHandler);}['own'](){if(!this['sharedData'])return;const R=new Map();this['collections']['forEach']((w,F)=>{if(w['length']>0x0)R['set'](F,w['clone']());}),this['collections']=R,this['sharedData']=![];}['keys'](){return this['collections']['keys']();}['equals'](R){if(this['collections']===R['collections'])return!![];for(const [w,F]of this['collections']){if(F['length']===0x0)continue;const E=R['collections']['get'](w);if(!E||!F['equals'](E))return![];}for(const [u,M]of R['collections'])if(M['length']>0x0&&!this['collections']['has'](u))return![];return!![];}['clone'](){const R=this['self'],w=Object['create'](Collections['prototype']);return w['collections']=R['collections'],w['sharedData']=!![],R['sharedData']=!![],new Proxy(w,collectionsProxyHandler);}},Collection=class Collection{['data']=[];['length']=0x0;['own'](){this['data']=this['data']['slice'](0x0,this['length']);}['at'](R,w){if(R<0x0)R=this['length']+R;if(arguments['length']===0x1)return this['data'][R];if(R<this['data']['length'])this['own']();return this['data'][R]=w;}['has'](R){for(let w=0x0;w<this['length'];++w)if(this['data'][w]===R)return!![];return![];}['find'](R){for(let w=0x0;w<this['length'];++w)if(R(this['data'][w]))return this['data'][w];}['findLast'](R){for(let w=this['length']-0x1;w>=0x0;--w)if(R(this['data'][w]))return this['data'][w];}['delete'](R){if(R>=this['length'])return;this['own'](),this['data']['splice'](R,0x1),--this['length'];}['push'](...R){if(this['data']['length']>this['length'])this['own']();for(const w of R)this['data'][this['length']++]=w;return this['length'];}['pop'](){if(this['length']>0x0)return this['data'][--this['length']];}['slice'](R,w){return this['data']['slice'](0x0,this['length'])['slice'](R,w);}['equals'](R){if(this['length']!==R['length'])return![];if(this['data']===R['data'])return!![];for(let w=0x0;w<this['length'];++w)if(this['data'][w]!==R['data'][w])return![];return!![];}['clone']({deep:R}={}){const w=Object['create'](Collection['prototype']);return w['data']=R?this['data']['slice'](0x0,this['length']):this['data'],w['length']=this['length'],w;}};function RegExpToken(R){return R=new RegExp(R['source'],R['flags']['includes']('y')?R['flags']:R['flags']+'y'),w=>{R['lastIndex']=w['pos'];const F=w['shared']['endPos']?w['text']['substring'](0x0,w['shared']['endPos']):w['text'],E=R['exec'](F);if(E){const u=w['move'](E[0x0]['length']),M=u['tokens']['boundary']?.(u)??u['clone']();if(M!==u){for(let N=0x1;N<E['length'];++N)M['collections']['results']['push'](E[N]);return M['logMatched'](R),M;}}return w['logMismatched'](R),w;};}function StringToken(R){return w=>{if((w['shared']['endPos']?w['text']['substring'](0x0,w['shared']['endPos']):w['text'])['startsWith'](R,w['pos'])){const F=w['move'](R['length']),E=F['tokens']['boundary']?.(F)??F['clone']();if(E!==F)return E['logMatched'](R),E;}return w['logMismatched'](R),w;};}function Use(R){if(typeof R==='function')return R;if(R instanceof RegExp)return RegExpToken(R);if(typeof R==='string')return StringToken(R);throw new Error('Invalid\x20rule');}const Never=R=>R,Nothing$1=R=>{if(R instanceof Cursor){const w=R;return w['logMatched']('<nothing>'),w['clone']();}else{const F=R;return Node(Nothing$1,()=>F);}};function Silent(R){const w=Use(R);return Pre(F=>F['logs']['enabled']?void(F['logs']['enabled']=![]):w(F),Post(w,F=>void(F['logs']['enabled']=!![])));}function LogGroup(R,w){let F,E=![];if(typeof R==='string')F=R;else F=R['name'],E=R['collapsed']??![];const u=E?Silent(Use(w)):Use(w);return Pre(M=>{if(!M['logs']['enabled'])return u(M);if(!E)M['logGroup'](F);},Post(u,(M,N)=>{M[!E?'logGroupEnd':'logCollapsedGroup'](M!==N?styleText(['reset','green'],F):styleText(['reset','red'],F));}));}function Pre(R,w){const F=Use(w);return E=>R(E)??F(E);}function Post(R,w){const F=Use(R),E=typeof w==='function'?(u,M)=>w(u,M)??u:(u,M)=>w[u!==M?'match':'unmatch']?.(u,M)??u;return u=>{const M=u,N=u['clone']();N['rest']['post']((l,Y)=>{if(l===Y)return Y;const I=E(l,M);return I===M?Y:I;});const e=F(N);return e['rest']['pop'](),E(e!==N?e:u,u);};}const Anything$1=Customizable(({threshold:threshold=0xa}={})=>{return R=>{let w=R['clone']();while(!![]){const F=Rest(w);if(F!==w&&(F['pos']>=w['text']['length']||F['pos']-w['pos']>=threshold))break;w=w['move'](0x1);if(w['pos']===w['text']['length'])break;}return w['collections']['results']['push'](w['text']['substring'](R['pos'],w['pos'])),w;};}),Rest=R=>{if(R['shared']['matchingRest'])return R['logSkip']('skipped\x20rest'),R;const w=R['clone'](),F=Pre(E=>{E['shared']['matchingRest']=!![],E['logs']['restDepth']??=E['logs']['depth'];},Post(LogGroup('Rest',R['rest']['probe']),E=>{E['logs']['restDepth']=w['logs']['restDepth'],E['shared']['matchingRest']=![];}))(w);return F!==w?F:R;};function Recursive(R){return w({'depth':0x0});function w({depth:F}){return R(Lazy(()=>w({'depth':++F})),{'depth':F});}}function Dynamic(R){return w=>{return Use(R(w))(w);};}function Lazy(R){let w;return Dynamic(()=>w??=Use(R()));}function Customizable(R){const w=new Map();function F(E){let u=w['get'](E);if(!u)w['set'](E,u=Use(R(E)));return u;}return E=>{if(E instanceof Cursor)return F()(E);else return Customizable(u=>F(E||u?{...E,...u}:void 0x0));};}function Boundary(R,w){const F=R&&Silent(Boundary(null,Use(R)));return Pre(E=>{E['tokens']={...E['tokens'],'boundary':F,'boundaryStack':[...E['tokens']['boundaryStack'],E['tokens']['boundary']]};},Post(w,E=>{E['tokens']={...E['tokens'],'boundary':E['tokens']['boundaryStack']['at'](-0x1)??null,'boundaryStack':E['tokens']['boundaryStack']['slice'](0x0,-0x1)};}));}function NoBoundary(R){return Post(Boundary(null,R),{'match':(w,F)=>{if(!w['tokens']['boundary'])return w;const E=w['tokens']['boundary'](w);if(E===w)return F;return E;}});}function Ignore(R,w){const F=R&&Use(R);return Pre(E=>{E['tokens']={...E['tokens'],'ignore':F,'ignoreStack':[...E['tokens']['ignoreStack'],E['tokens']['ignore']]};},Post(w,E=>{E['tokens']={...E['tokens'],'ignore':E['tokens']['ignoreStack']['at'](-0x1)??null,'ignoreStack':E['tokens']['ignoreStack']['slice'](0x0,-0x1)};}));}function Raw(R){return Ignore(null,Boundary(null,R));}function Not(R){return Post(R,{'match':(w,F)=>F,'unmatch':(w,F)=>F['clone']()});}function NonEmpty(R){return Post(R,{'match':(w,F)=>w['pos']===F['pos']&&w['collections']['equals'](F['collections'])?F:w});}function Optional(R){return Post(R,{'unmatch':(w,F)=>F['clone']()});}function Weak(R,{cost:cost=0x1}={}){const w=Use(R);return LogGroup('Weak',F=>{const E=F;F['shared']['weakDepth']+=cost;const u=w(E);F['shared']['weakDepth']-=cost;if(u===E)return F;if(F['shared']['matchingRest'])return F['clone']();return F['fork'](u,cost);});}function Any(...R){const w=R['map'](Use),F=w['map']((E,u)=>w['slice'](u+0x1));return E=>{const u={'upTo':-0x1};for(let M=0x0;M<w['length'];++M){const N=w[M],e=E['clone'](),l=F[M];if(l['length']>0x0)e['rest']['any'](E,l,M+0x1,u);const Y=N(e);if(l['length']>0x0)Y['rest']['pop']();u['upTo']=M;if(Y!==e)return Y;}return E;};}function Longest(...R){const w=R['map']((F,E)=>LogGroup('Longest\x20candidate\x20#'+(E+0x1),Use(F)));return LogGroup('Longest',F=>{return w['reduce']((E,u)=>{const M=F['clone'](),N=u(M);if(N!==M&&N['pos']>E['pos'])return N;return E;},F);});}function All(...R){const w=R['map'](Use);if(w['length']===0x1)return w[0x0];return F=>{let E=F['clone']();E['rest']['all'](w);for(let u=0x0;u<w['length'];++u){const M=w[u];E['rest']['pop']();const N=E['tokens']['ignore']?.(E)??E,e=M(N);if(e===N)return F;if(e['pos']!==N['pos']||!e['collections']['equals'](N['collections']))E=e;}return E;};}function Plus$1(R){const w=Use(R);return F=>{let E=F;while(!![]){const u=E===F?E['clone']():E['tokens']['ignore']?.(E)??E['clone']();u['rest']['plus'](w);const M=w(u);M['rest']['pop']();if(M===u)return E;if(M['pos']===u['pos']&&M['collections']['equals'](u['collections']))return E;E=M;}};}function Star(R){return Optional(Plus$1(R));}function PreCondition(R,w){return Pre(F=>{const E=!R(F)?F:void 0x0;if(E)F['logMismatched']('<precondition>');return E;},w);}function PostCondition(R,w){return Post(R,{'match':(F,E)=>{const u=!w(F['collections']['results']['slice'](E['collections']['results']['length']),F,E)?E:void 0x0;if(u)F['logMismatched']('<postcondition>');return u;}});}function As$1(R,w){const F=Use(R);return Pre(E=>{const u=F(E);if(u===E)return E;E['limit'](u['pos']);},Post(w,E=>E['limit'](void 0x0)));}function Effect(R,w){return Post(R,{'match':(F,E)=>void w(F['collections']['results']['slice'](E['collections']['results']['length']),F,E)});}function Node(R,w){return Effect(R,(F,E,u)=>{const M=w(F,E,u);E['collections']['results']['length']=u['collections']['results']['length'],E['collections']['results']['push'](M);});}function Text$2(R){return Node(R,(w,F,E)=>F['text']['substring'](E['pos'],F['pos']));}function Void(R){return Effect(R,(w,F,E)=>{F['collections']['results']['length']=E['collections']['results']['length'];});}function Important(R){return Effect(R,(w,F)=>F['collections']['important']['push'](!![]));}const log$1=debuglog('nlp:parse');var Cursor=class Cursor{['text'];['pos']=0x0;['__context']=new Context();['__contextParts']=null;['__collections']=new Collections();['__collectionsMap']=null;['rest']=new RestStorage();get['context'](){return this['__context']??=Context['materialize'](this['__contextParts']);}get['collections'](){return this['__collections']??=Collections['materialize'](this['__collectionsMap']);}['tokens']={'ignore':null,'boundary':null,'ignoreStack':[],'boundaryStack':[]};['logs']={'enabled':log$1['enabled'],'depth':0x0,'restDepth':void 0x0};['shared']={'forkId':void 0x0,'forks':[],'endPos':void 0x0,'farthestPos':0x0,'matchingRest':![],'weakDepth':0x0,'options':{}};get['options'](){return this['shared']['options'];}get['farthestPos'](){return this['shared']['farthestPos'];}constructor(R,w){this['text']=R,this['shared']['options']=w??{};}['clone'](){const R=Object['create'](Cursor['prototype']);return R['text']=this['text'],R['pos']=this['pos'],R['__context']=null,R['__contextParts']=this['__context']?this['__context']['share']():this['__contextParts'],R['__collections']=null,R['__collectionsMap']=this['__collections']?this['__collections']['share']():this['__collectionsMap'],R['tokens']=this['tokens'],R['rest']=this['rest']['clone'](),R['logs']=this['logs'],R['shared']=this['shared'],R;}['fork'](R,w=0x1){const F=this['clone'](),E=this['shared']['weakDepth']+w,u=R['clone']();return u['shared']={...u['shared'],'forkId':''+(F['shared']['forkId']?F['shared']['forkId']+'.':'')+(F['shared']['forks']['length']+0x1),'forks':[],'weakDepth':E},u['logs']={...u['logs']},u['rest']=new RestStorage(),F['shared']['forks']['push']({'$':u,'token':this['rest']['token'],'weight':E}),F['logSkip']('forked\x20#'+u['shared']['forkId']+'\x20(weight\x20'+E+')\x20'+u['getProgressString']()),F;}['limit'](R){if(R===void 0x0||R<0x0)this['shared']['endPos']=void 0x0;else this['shared']['endPos']=Math['min'](R,this['shared']['endPos']??this['text']['length']);}['move'](R){const w=this['clone']();w['pos']+=R;if(w['pos']>w['shared']['farthestPos'])w['shared']['farthestPos']=w['pos'];return w;}['getDepthStyle'](R){const w=['cyan','magenta','yellow','blue','cyanBright','magentaBright','yellowBright','blueBright'],F=R??this['logs']['depth'],E=w[Math['max'](0x0,F-0x1)%w['length']];return this['logs']['restDepth']!==void 0x0&&F>this['logs']['restDepth']?['dim',E]:[E];}['getProgressString'](R=this['pos']){return styleText('reset','['+styleText(['dim','underline'],this['text']['substring'](0x0,R))+this['text']['substring'](R)+']');}['log'](R){let w='';if(this['logs']['restDepth']!==void 0x0){for(let E=0x0;E<this['logs']['restDepth'];E++)w+=styleText(this['getDepthStyle'](E+0x1),'│\x20');const F=this['logs']['depth']-this['logs']['restDepth'];for(let u=0x0;u<F;u++)w+=styleText(this['getDepthStyle'](this['logs']['restDepth']+u+0x1),'┊\x20');}else{for(let M=0x0;M<this['logs']['depth'];M++)w+=styleText(this['getDepthStyle'](M+0x1),'│\x20');}log$1(''+(this['shared']['forkId']?'*':'')+w+R);}['logFork'](R){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'╞═\x20▼\x20'+R)),this['logs']['depth']+=0x1);}['logForkEnd'](R){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'╞═\x20△\x20'+R)+'\x20'+this['getProgressString']()));}['logGroup'](R){this['logs']['enabled']&&(this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'▼\x20'+R)),this['logs']['depth']+=0x1);}['logGroupEnd'](R){this['logs']['enabled']&&(this['logs']['depth']-=0x1,this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'△\x20'+R)+'\x20'+this['getProgressString']()));}['logCollapsedGroup'](R){if(this['logs']['enabled'])this['log'](styleText(this['getDepthStyle'](this['logs']['depth']+0x1),'▶\x20'+R)+'\x20'+this['getProgressString']());}['logMatched'](R){if(this['logs']['enabled'])this['log'](styleText('green','✓')+'\x20'+styleText('green',R['toString']())+'\x20\x20'+this['getProgressString']());}['logMismatched'](R){if(this['logs']['enabled'])this['log'](styleText('red','✗')+'\x20'+styleText('red',R['toString']())+'\x20'+this['getProgressString']());}['logSkip'](R){if(this['logs']['enabled'])this['log'](styleText('yellow','↷\x20'+R));}['logComplete'](){if(this['logs']['enabled']){if(this['pos']<this['text']['length'])log$1(styleText('red','parsing\x20finished\x20✗\x20'+this['getProgressString'](this['shared']['farthestPos'])));else log$1(styleText('green','parsing\x20finished\x20✓\x20'+this['getProgressString'](this['shared']['farthestPos'])));}}};let emptyContinuation;var RestStorage=class RestStorage{['head']=null;get['token'](){return this['compose']({'probing':![]});}get['probe'](){return this['compose']({'probing':!![]});}['compose']({probing:R}){const w=this['head'];if(!w)return emptyContinuation??=All(...[]);const F=R?w['probe']:w['token'];if(F)return F;let E=[];for(let M=w;M;M=M['next']){const N=M['item'];if(typeof N==='function')E['push'](N);else{if(!R||N['kind']!=='post')E=[N['wrap'](E)];}}const u=All(...E);if(R)w['probe']=u;else w['token']=u;return u;}['clone'](){const R=new RestStorage();return R['head']=this['head'],R;}['all'](R){for(let w=R['length']-0x1;w>=0x0;--w)this['head']={'item':R[w],'next':this['head']};}['post'](R){this['unshift']({'kind':'post','wrap':w=>{return Post(w['length']>0x0?All(...w):Important(Nothing$1),R);}});}['any'](R,w,F,E){const u=R;this['unshift']({'kind':'any','wrap':M=>{return Any(All(...M),...w['map']((N,e)=>l=>{if(F+e<=E['upTo'])return l;const Y=u['clone']();Y['shared']=l['shared'],Y['logs']=l['logs'],Y['rest']=l['rest']['clone']();const I=N(Y);return I!==Y?I:l;}));}});}['plus'](R){this['unshift']({'kind':'plus','wrap':w=>{return All(...w,Star(R));}});}['pop'](){this['head']=this['head']?.['next']??null;}['unshift'](R){this['head']={'item':R,'next':this['head']};}};function State(R,w){const F=Symbol('state\x20id');return w?E(w({'Mutate':M,'state':e,'mutate':N})):{'Provide':u,'Apply':E,'Mutate':M,'state':e,'mutate':N};function E(l){return u(Node(Void(l),(Y,I)=>e(I)));}function u(l){return Pre(Y=>void Y['collections'][F]['push']({'init':R,'mutators':[]}),Post(l,Y=>void Y['collections'][F]['pop']()));}function M(l,Y){return Effect(l,(I,f)=>N(f,t=>Y(t,I)));}function N(l,Y){l['collections'][F]=l['collections'][F]['clone']({'deep':!![]});const I=l['collections'][F]['at'](-0x1);if(!I)throw new Error('Cannot\x20mutate\x20state\x20that\x20wasn\x27t\x20provided');l['collections'][F]['at'](-0x1,{'init':I['init'],'mutators':[...I['mutators'],Y]});}function e(l){const Y=l['collections'][F]['at'](-0x1);if(!Y)throw new Error('Cannot\x20return\x20state\x20that\x20wasn\x27t\x20provided');const I=structuredClone(Y['init']);return Y['mutators']['forEach'](f=>f(I)),I;}}const MAX_FORK_QUEUE=0x3a98;function takeNextFork(R){let w=0x0;for(let F=0x1;F<R['length'];++F){const E=R[F],u=R[w];if(E['weight']<u['weight'])w=F;}return R['splice'](w,0x1)[0x0];}function makeParse(R){return(w,F)=>{if(typeof w!=='string')throw new Error('Parsing\x20function\x20expects\x20a\x20string\x20input');let E=null;const u=PostCondition(R,(e,l)=>{if(l['pos']===l['text']['length'])return!![];if(!E||l['pos']>E['pos'])E=l;return![];}),M=new Cursor(w,F);let N=u(M);if(N===M){const e=M['shared']['forks']['splice'](0x0,M['shared']['forks']['length']);while(e['length']>0x0){if(e['length']>MAX_FORK_QUEUE)break;const {$:l,token:Y}=takeNextFork(e);M['logFork']('Fork\x20#'+l['shared']['forkId']);const I=Y(l);I['logForkEnd']('Fork\x20#'+l['shared']['forkId']);if(I!==l){N=I;break;}e['push'](...I['shared']['forks']);}}if(N===M||N['pos']<w['length']){const f=N['farthestPos'];if(N===M&&E)N=E;N['collections']['errors']['push']({'type':'ParseError','pos':f,'text':w['slice'](f)});}return N['logComplete'](),Object['fromEntries'](Array['from'](N['collections']['keys']())['map'](t=>[t,N['collections'][t]['slice']()]));};}function test(R,w,F){if(typeof w!=='string')return![];const E=new Cursor(w,F),u=Use(R)(E);return E!==u&&u['pos']>=w['length'];}function startsWith$2(R,w,F){if(typeof w!=='string')return![];const E=new Cursor(w,F),u=Use(R)(E);return E!==u&&u['pos']>0x0;}function search(R,w,F){if(typeof w!=='string')return null;const E=new Cursor(w,F),u=Use(R);for(let M=0x0;M<w['length'];++M){const N=E['move'](M),e=u(N);if(e!==N&&e['pos']>N['pos'])return{'text':w['substring'](M,e['pos']),'pos':M};}return null;}const Article=R=>All(Optional(/the|an|a/i),R),Possessive=(R,{strict:w}={})=>Any(NoBoundary(All(R,/'s?/)),w?Never:R),Plural$1=R=>NoBoundary(All(R,/e?s/i)),InstructionTerminator=/[.;\s]*$/,ActionSeparator=/(?:(?:(?:,\s*)?(?:(?:and\s+)?(?:then|after)|and))|,)/i,ActionModifierSeparator=/[:,-]/,BlockSeparator=/[,;]/,AndListSeparator=/(?:,\s*)?and|,/i,OrListSeparator=/(?:,\s*)?(?:or|and)|,/i,The=/the(?:\s+the)?/i,IndefiniteArticle=/an|a/i,For=/for/i,To=/to/i,From=/from/i,Of=/of/i,By=/by/i,With=/with/i,Without=/without/i,As=/as/i,LocationPreposition=/into|within|inside|in|on|at/i,FunctionalPreposition=/as|under/i,RelationalPreposition=/from|of|in|at|as|below|under/i,EquivalencePreposition=/as|to/i,TemporalPreposition=/before|after|for/i,AssignmentPreposition=/with|as|to|in/i,StoragePreposition=/to|in|as|under/i,AssociationPreposition=/with|of/i,ConditionPreposition=/in|on|under/i,MembershipPreposition=/in|of|from/i,Only=/only/i,Last$1=/last/i,If$1=/if/i,And=/and/i,That=/that/i,When=/when/i,Then$1=/then/i,NumberSign=/#|№/,At=/at/i,Between=/between/i,Index$1=/index/i,Repeat$1=/repeat/i,Iterate=/iterate|loop/i,Over=/over|through|across/i,Until=/until/i,While=/while|as\s+long\s+as/i,Start=/Start/i,Bottom=/bottom/i,It=/it/i,Its=/its/i,Them=/them/i,This=/this/i,Demonstrative=/that|this|the\s+same|the\s+current/i,These=/these/i,Keyboard$1=/keyboard/i,KeyboardKey$1=All(Optional(Keyboard$1),/key|button/i),KeyboardKeys=All(Optional(Keyboard$1),/(?:key|button)s?/i),Character=/char(?:acter)?|symbol|letter/i,Characters=/(?:char(?:acter)?|symbol|letter)s?/i,Variables=/(?:var(?:iable)?|param(?:eter)?)s?/i,Parameters$1=/(?:arg(?:ument)?|var(?:iable)?|param(?:eter)?)s?/i,Value$6=/value|data|datum|content/i,Custom=/custom/i,Http=/https?|hyper\s*text\s+transfer\s+protocol/i,Pixels=/px|pixels?/i,Following=/following/i,Nothing=/nothing/i,Anything=/anything/i,Name$3=/name/i,Times$4=/times?/i,Iterations=/attempts?|iterations?|items?|loops?|times?/i,PlusSymbolic=/\+/,Plus=Any(PlusSymbolic,/plus/i),MinusSymbolic=/-/,Minus=Any(MinusSymbolic,/minus/i),MultiplySymbolic=/\*|×|·/,Multiply=Any(MultiplySymbolic,/times|multiplied\s+by/i),DivisionSymbolic=/(?<=\s)\/(?=\s)|÷/,Division=Any(DivisionSymbolic,/divided\s+by/i),Sum=/sum/i,Difference=/difference/i,Product=/product/i,Quotient=/quotient/i,Evaluation=/eval(?:uation)?|exec(?:ution)?|step/i,Request$1=/request|req/,Result=/result/,Length=/length|size/i,Width=/width/,Height=/height/,Assertions=/(?:assert(?:ion)?|verification|validation|check(?:point)?)s?/i,CustomFlowTest=/test|program|custom[-\s]?flow(?:\s+test)?/i,FunctionKeyword=/functions?/i,TestKeyword=/test/i,BeforeAllHook=/before\s+all(?:\s+tests?)?/i,BeforeEachHook=/before\s+each(?:\s+test)?/i,AfterEachHook=/after\s+each(?:\s+test)?/i,AfterAllHook=/after\s+all(?:\s+tests?)?/i,TestStep=/(?:test[-\s])?step/i,TestSteps=/(?:test[-\s])?steps?/i,Website=/(?:web[-\s]?)?(?:site|page|document)/i,Websites=/(?:web[-\s]?)?(?:site|page|document)s?/i,Url$4=/url|(?:hyper)?link|domain|address/i,Title$1=/title/i,Endpoint$1=/endpoint|api|url|address/i,BasicAuth$1=/(?:basic\s+)?auth(?:orization)?/i,User=/user/i,HttpCookie=/(?:request\s+)?cookie/i,HttpHeader$1=/(?:request\s+)?header/i,HttpBody=/(?:request\s+)?body/i,HttpResponse=/(?:https?\s+)?(?:request\s+)?response/i,HttpStatusCode=/(?:request\s+)?status(?:\s+code)?/i,HttpStatusCodes=/(?:request\s+)?status(?:es|(?:\s+codes?))?/i,CSSPseudoClass=/styl(?:e|ing)|pseudo[-\s]?class/i,JavaScript=/js|java-?script/i,CodeSnippet=/(?:code\s+)?(?:snippet|expression|statement|line)|code/i,CollectionItems=/items?|elements?|entr(?:y|eis)/i,CollectionPairs=/pairs?|mappings?/i,CollectionKeys=/keys?/i,CollectionValues=/values?/i,Secret$2=/(?:(?:(?:(?:access|auth(?:entication)?)\s+)?(?:token|password|pwd|pass|security|pin)(?:\s*(?:key|code))?|secret(?:\s*(?:pin|key|code))?)|(?:access|auth(?:entication)?)\s+(?:key|code)|credit\s*card)/i,OTP$1=/(?:otp|one\s*-?\s*time\s*-?\s*password)(?:\s+(?:(?:pin\s*-?\s*)?code|password|key|digits|pin|(?:pass\s*-?\s*)?phrase|secret|passcode))?/i,File=/file|attachment/i,SelectboxOption=/(radio\s+)?(button|option|item|entry|value|text|element)/i,Popup=/(?:pop(?:-|\s*)(?:up|over)|dialog)(?:\s+(?:item))?/i,Tooltip=/(?:tool|info|help|context)\s*tip|help\s*tip|(?:info|hint|help|text)\s+bubble/i,Page=/page/i,WebPage=/(?:web[-\s]?)?(?:page|document)|window/i,PdfPage$1=/(?:document|pdf)\s+page/i,App$1=/app(?:lication)?/i,Viewport$1=/screen|viewport/i,Selector$1=/selector|locator/i,String$1=/text/i,Color$2=/colou?r/i,Date$1=/date/i,Time=/time/i,DateTime=/date(?:-|\s+and\s+|\s+)?time/i,Number$1=/amount|sum|total|number/i,Price$1=/price|cost|fee/i,Code=/id|code/i,Having=/with|holding|containing|including/i,Percentage$1=/percent(?:age)?/i,Text$1=/label|text|string/i,Link=/link/i,Heading=/heading/i,Hamburger=/(?:ham)?burger(?:\s+menu)?/i,Item=/item|option|entry/i,Menu=/nav(?:igation)?[-\s]?bar|nav(?:igation)?(?:\s+menu)?|menu/i,MenuItem=NoBoundary(All(Menu,Item)),List$1=/list/i,ListItem=NoBoundary(All(List$1,Item)),Header$5=/header/i,Footer=/footer/i,Card=/card|panel/i,Paragraph=/paragraph/i,Textbox=/box|text[-\s]?(?:box|area|field|input)|edit[-\s]?(?:box|area)|bar/i,Searchbox=/search[-\s]?(?:box|bar)/i,Checkbox=/check[-\s]?box/i,CheckboxGroup=/check[-\s]?box\s*group/i,Radio=/radio/i,RadioGroup=/radio\s*group/i,ColorPicker=/colou?r(?:-|\s*)(?:picker|chooser|box|field|input)/i,DatePicker=/date(?:-|\s*)(?:picker|chooser|box|field|input)/i,TimePicker=/time(?:-|\s*)(?:picker|chooser|box|field|input)/i,DateTimePicker=/date(?:-|\s+and\s+|\s+)?time(?:-|\s*)(?:picker|chooser|box|field|input)/i,FilePicker=/file(?:-|\s*)(?:picker|chooser|box|field|input)/i,Inputbox=/form(?:-|\s*)(?:field|input)|input(?:[-\s]?(?:field|box|area))?|field/i,Selectbox=/select(?:-|\s+)?box/i,Valuebox=/value(?:-|\s+)?box/i,Combobox=/(?:drop[-\s]?down(?:\s+(?:menu|list))?|drop[-\s]?box|combo[-\s]?box)(?:\s+arrow)?/i,Listbox=/(?:list[-\s]?box)(?:\s+arrow)?/i,Option$1=/option/i,Form$1=/form/i,Image=/image|svg|picture|drawing|graphics?/i,Logo=/logo/i,Icon=/icon|svg|glyph/i,Button=/button|(?:tool\s*bar|tool|bar)(?:\s+item)?/i,Tab$1=/tab/i,TabList=/tab(?:s|[-\s]?(?:list|bar|strip))/i,TabPanel=/tab[-\s]?(?:panel|pane|content)/i,Slider=/slider/i,Ad=/advert(?:isement)?|ads?/i,Element$3=/element/i,Browser$1=/(?:(?:web|internet)[-\s])?browser/i,BrowserTab=All(Possessive(Browser$1),/tab/i),BrowserTabList=All(Possessive(Browser$1),TabList),BrowserToolbar=All(Possessive(Browser$1),Optional(/tool[-\s]?bar/i)),BrowserDialogType=/alert|prompt|confirm/i,BrowserDialog=Any(All(/native/i,Optional(Possessive(Browser$1)),Any(BrowserDialogType,Popup)),All(Possessive(Browser$1),Any(BrowserDialogType,Popup)),BrowserDialogType),Accept=/ok|accept|agree|allow|confirm|submit/i,Dismiss=/cancel|decline|reject|close|discard|dismiss/i,Table=/table/i,Cell=/cell/i,Row=/row/i,Column=/column/i,Stub=/stub/i,Be=/be|is|are/i,Wait$2=/wait/i,Waiting=/waiting|pausing/i,Skip=/skip|ignore/i,Skipping=/skipping|ignoring/i,Run=/run|do|execute|perform/i,Running=/running|doing|executing|performing/i,Expect=/expect|accept|allow|permit/i,Expecting=/expecting|accepting|allowing|permitting/i,Using=/using/i,Holding=/holding|pressing|hitting/i,Activate=/activate|define|add/i,Cancel=/cancel|undefine|clear|reset/i,Dont=/do\s+not|don't/i,Optionally=/optionally|if\s+possible/i,Random=/random(?:ly)?/i,Relative=/relative/i,Current=/current/i,Active=/active/i,Each=/each|every|all|any/i,Every=/every|each/i,Named=/named|called|titled|(?:(?:with|of|that\s+has|showing)\s+(?:the\s+)?(?:name|title|text)?)/i,Maximum=/maximum|max|no\s+more\s+than|at\s+most|a\s+(?:max|maximum)\s+of|up\s+to/i,Inside=/within|inside(?:\s+of)?|on(?:top(?:\s+of)?)?|in|at|of/i,Near=/(?:nearest|near)(?:\s+to)?|(?:closest|close|next|adjacent)\s+to/i,Background=/background/i,Foreground=/foreground/i,Back=/back/i,Forward=/forward/i,Previous=/prev(?:ious)?/i,Next=/next/i,Before=/before/i,After=/after/i,Prior=/before|prior(?:\s+to)?/i,Implicit=/implicit/i,Subsequent=/subsequent|remaining|next/i,Generated=/generated/i,New=/new/i,Zero=Use(/(zero)/i);Use(/(one)/i);const CardinalNumeralDigit=Use(/(one|two|three|four|five|six|seven|eight|nine)/i),CardinalNumeralTeen=Use(/(ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen)/i),CardinalNumeralTen=Use(/(twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety)/i),OrdinalNumeralDigit=Use(/(first|second|third|fourth|fifth|sixth|seventh|eighth|ninth)/i),OrdinalNumeralTeen=Use(/(tenth|eleventh|twelfth|thirteenth|fourteenth|fifteenth|sixteenth|seventeenth|eighteenth|nineteenth)/i),OrdinalNumeralTen=Use(/(twentieth|thirtieth|fortieth|fiftieth|sixtieth|seventieth|eightieth|ninetieth)/i),DenominatorNumeralDigit=Use(/(firsts?|half|halves|thirds?|fourths?|quoters?|fifths?|sixths?|sevenths?|eighths?|ninths?)/i),DenominatorNumeralTeen=Use(/(tenths?|elevenths?|twelfths?|thirteenths?|fourteenths?|fifteenths?|sixteenths?|seventeenths?|eighteenths?|nineteenths?)/i),DenominatorNumeralTen=Use(/(twentieths?|thirtieths?|fortieths?|fiftieths?|sixtieths?|seventieths?|eightieths?|ninetieths?)/i),MultiplicativeNumeral=Use(/(single|double|triple|quadruple|quintuple|sextuple|septuple|octuple|nonuple|decuple)/i),FractionNumeral=Use(/(half|quoter)/i),IterativeNumeral=Use(/(once|twice|thrice)/i),SkipSpaces=R=>All(Optional(/\s+/),Ignore(/\s+/,R)),TokenBoundary=R=>Boundary(/(?<!\w)|\b(?![-]|'\w)/,R),Sanitize$1=R=>TokenBoundary(SkipSpaces(R)),Continuous=(R,w)=>Any(PreCondition(F=>F['context']['self']['data']['has']('continuous'),w),R),Plural=(R,w)=>Any(PreCondition(F=>F['context']['self']['data']['get']('plural')===!![],w),R),Mark=(R,{type:w,subtype:F,regexp:E,mutate:u})=>Effect(R,(M,N,e)=>{const l=N['text']['slice'](e['pos'],N['pos']);if(l){let Y;if(E){const I=l['match'](E);if(I)Y={'pos':e['pos']+I['index'],'text':I[0x0],'type':w};}else Y={'pos':e['pos'],'text':l,'type':w};if(Y){if(F)Y['subtype']=F;u?.(Y,M,N,e),N['collections']['markers']['push'](Y);}}}),Fix=(R,w)=>Effect(Mark(R,{'type':'fixable'}),(F,E,u)=>{const M=E['text']['slice'](u['pos'],E['pos']);if(M)E['collections']['fixes']['push']({'pos':u['pos'],'text':M,'fix':w(M,F)});}),Disambiguate=(R,w)=>Effect(Mark(R,{'type':'ambiguous'}),(F,E,u)=>{const M=E['text']['slice'](u['pos'],E['pos']);if(M)E['collections']['disambiguations']['push']({'pos':u['pos'],'text':M,'replacements':w(M,F)});}),Wrap=(R,w)=>{const {left:F,right:E}=typeof R==='object'&&!(R instanceof RegExp)?R:{'left':R,'right':R};return All(F,w,E);},DoubleQuoted$1=R=>Mark(Wrap('\x22',R),{'type':'string','subtype':'double\x20quoted'}),SingleQuoted$1=R=>Mark(Wrap('\x27',R),{'type':'string','subtype':'single\x20quoted'}),Quoted$1=R=>Any(DoubleQuoted$1(R),SingleQuoted$1(R)),Stringish=R=>Any(Quoted$1(R),Mark(R,{'type':'string','subtype':'unquoted'})),Index=R=>Node(R,([w])=>typeof w==='number'?w-0x1:w),List=(R,w)=>All(R,Star(All(w,R))),WeakList=(R,w)=>All(R,Star(Weak(All(w,R)))),Mask=()=>{const {Provide:R,state:w,mutate:F}=State({'enabled':![],'markers':[]});function E(M,N=!![]){const e=N?'secret':'empty';F(M,l=>l['enabled']=N),w(M)['markers']['forEach'](l=>l['type']=e);}const u=M=>Mark(M,{'type':'empty','mutate':(N,e,l)=>{if(w(l)['enabled'])N['type']='secret';F(l,Y=>Y['markers']['push'](N));}});return{'Masker':R,'Maskable':u,'mask':E};},HorizontalAbsolutePosition=Any(Node(/(?:very\s+)?left(?:\s*(?:-\s*)?most)?|start|beginning/i,()=>'left'),Node(/(?:very\s+)?right(?:\s*(?:-\s*)?most)?|end/i,()=>'right')),VerticalAbsolutePosition=Any(Node(/(?:very\s+)?top(?:\s*(?:-\s*)?most)?/i,()=>'top'),Node(/(?:very\s+)?bottom(?:\s*(?:-\s*)?most)?/i,()=>'bottom')),CenterAbsolutePosition=Node(/middle|center/i,()=>'center'),OrthogonalAbsolutePosition=Any(Node(/left/i,()=>'left'),Node(/right/i,()=>'right'),Node(/top/i,()=>'top'),Node(/bottom/i,()=>'bottom')),AbsolutePosition$1=Any(Node(All(Optional(The),HorizontalAbsolutePosition,Optional(All(And,VerticalAbsolutePosition))),([R,w])=>''+(w??'')+R),Node(All(Optional(The),VerticalAbsolutePosition,Optional(All(And,HorizontalAbsolutePosition))),([R,w])=>''+R+(w??'')),All(Optional(The),CenterAbsolutePosition)),HorizontalRelativePosition=Any(Node(/left/i,()=>'leftof'),Node(/right/i,()=>'rightof')),VerticalRelativePosition=Any(Node(/above|over/i,()=>'above'),Node(/below|under/i,()=>'below')),BeforeRelativePosition=Any(Node(Before,()=>'belowleftof')),AfterRelativePosition=Any(Node(After,()=>'aboverightof')),RelativePosition=Any(Node(All(Optional(All(To,Optional(The))),HorizontalRelativePosition,Optional(All(And,Optional(All(To,Optional(The))),VerticalRelativePosition))),([R,w])=>''+(w??'')+R),Node(All(Optional(All(To,Optional(The))),VerticalRelativePosition,Optional(All(And,Optional(All(To,Optional(The))),HorizontalRelativePosition))),([R,w])=>''+R+(w??'')),BeforeRelativePosition,AfterRelativePosition),SequentialRelativePosition=R=>Any(Node(Any(All(Next,R),All(R,/that\s+(?:follows|comes\s+after)\s+(?:the\s+)?current/i)),([w])=>({'position':'next','object':w})),Node(Any(All(Previous,R),All(R,/that\s+comes\s+before\s+(?:the\s+)?current/i)),([w])=>({'position':'previous','object':w}))),BackspaceKey$1=Node(/backspace/i,()=>'Backspace'),DeleteKey$1=Node(/del(?:ete)?/i,()=>'Delete'),ArrowKey$1=Any(Node(/up(?:\s+arrow)?|arrow\s+up/i,()=>'ArrowUp'),Node(/down(?:\s+arrow)?|arrow\s+down/i,()=>'ArrowDown'),Node(/left(?:\s+arrow)?|arrow\s+left/i,()=>'ArrowLeft'),Node(/right(?:\s+arrow)?|arrow\s+right/i,()=>'ArrowRight')),ControlKey$1=Any(Node(/escape|esc/i,()=>'Escape'),Node(/f1/i,()=>'F1'),Node(/f2/i,()=>'F2'),Node(/f3/i,()=>'F3'),Node(/f4/i,()=>'F4'),Node(/f5/i,()=>'F5'),Node(/f6/i,()=>'F6'),Node(/f7/i,()=>'F7'),Node(/f8/i,()=>'F8'),Node(/f9/i,()=>'F9'),Node(/f10/i,()=>'F10'),Node(/f11/i,()=>'F11'),Node(/f12/i,()=>'F12'),Node(/caps(?:\s*lock)?/i,()=>'CapsLock'),Node(/tab/i,()=>'Tab'),Node(/enter|return/i,()=>'Enter'),Node(/(?:left\s+)?shift/i,()=>'ShiftLeft'),Node(/right\s+shift/i,()=>'ShiftRight'),Node(/(?:left\s+)?(?:control|ctrl)/i,()=>'ControlLeft'),Node(/right\s+(?:control|ctrl)/i,()=>'ControlRight'),Node(/(?:left\s+)?(?:meta|windows|command|cmd)/i,()=>'MetaLeft'),Node(/right\s+(?:meta|windows|command|cmd)/i,()=>'MetaRight'),Node(/(?:left\s+)?(?:alt|alternate|option)/i,()=>'AltLeft'),Node(/right\s+(?:alt|alternate|option)/i,()=>'AltRight'),Node(/(?:alt|alternate)\s*gr(?:aph)/i,()=>'AltGraph'),Node(/space/i,()=>'Space'),Node(/home/i,()=>'Home'),Node(/end/i,()=>'End'),Node(/page\s*up|pgup/i,()=>'PageUp'),Node(/page\s*down|pgdn/i,()=>'PageDown'),Node(/ins(?:ert)?/i,()=>'Insert'),BackspaceKey$1,DeleteKey$1),KeyboardKey=Any(ControlKey$1,ArrowKey$1,Any(Node(/\\|backslash/i,()=>'Backslash'),Node(/`(?!\S)|back\s*quote|back\s*tick/,()=>'Backquote'),Node(/1|one/i,()=>'Digit1'),Node(/2|two/i,()=>'Digit2'),Node(/3|thee/i,()=>'Digit3'),Node(/4|four/i,()=>'Digit4'),Node(/5|five/i,()=>'Digit5'),Node(/6|six/i,()=>'Digit6'),Node(/7|seven/i,()=>'Digit7'),Node(/8|eight/i,()=>'Digit8'),Node(/9|nine/i,()=>'Digit9'),Node(/0|zero/i,()=>'Digit0'),Node(/-(?!\S)|minus/i,()=>'Minus'),Node(/=(?!\S)|equal/i,()=>'Equal'),Node(/Q/i,()=>'KeyQ'),Node(/W/i,()=>'KeyW'),Node(/E/i,()=>'KeyE'),Node(/R/i,()=>'KeyR'),Node(/T/i,()=>'KeyT'),Node(/Y/i,()=>'KeyY'),Node(/U/i,()=>'KeyU'),Node(/I/i,()=>'KeyI'),Node(/O/i,()=>'KeyO'),Node(/P/i,()=>'KeyP'),Node(/\[(?!\S)|(?:left|open(?:ing)?)\s+bracket/i,()=>'BracketLeft'),Node(/\](?!\S)|(?:right|clos(?:e|ing))\s+bracket/i,()=>'BracketRight'),Node(/A/i,()=>'KeyA'),Node(/S/i,()=>'KeyS'),Node(/D/i,()=>'KeyD'),Node(/F/i,()=>'KeyF'),Node(/G/i,()=>'KeyG'),Node(/H/i,()=>'KeyH'),Node(/J/i,()=>'KeyJ'),Node(/K/i,()=>'KeyK'),Node(/L/i,()=>'KeyL'),Node(/;(?!\S)|semi(?:colon)?/i,()=>'Semicolon'),Node(/"(?!\S)|(?:double\s+)?quote/i,()=>'Quote'),Node(/Z/i,()=>'KeyZ'),Node(/X/i,()=>'KeyX'),Node(/C/i,()=>'KeyC'),Node(/V/i,()=>'KeyV'),Node(/B/i,()=>'KeyB'),Node(/N/i,()=>'KeyN'),Node(/M/i,()=>'KeyM'),Node(/,(?!\S)|comma/i,()=>'Comma'),Node(/\.(?!\S)|period|dot/i,()=>'Period'),Node(/\/(?!\S)|slash/i,()=>'Slash'))),InnerRelationalOffset=Any(Node(/half(?:\s*way)?/i,()=>0.5),Node(/entire|whole|full|all(?:\s+(?:the\s+)?way)?/i,()=>0x1)),Comment=Mark(Node(RegExpToken(/(?:\/\/|#)(.*)$/),([R])=>({'type':'comment','text':R['trim']()})),{'type':'comment'}),TrailingCommentText=RegExpToken(/(?:\/\/|#(?=\s|$))(.*)$/),TrailingComment=All(Void(/[\s.;]*/),Mark(Void(TrailingCommentText),{'type':'comment'})),CARDINAL_NUMERALS={'one':0x1,'two':0x2,'three':0x3,'four':0x4,'five':0x5,'six':0x6,'seven':0x7,'eight':0x8,'nine':0x9,'ten':0xa,'eleven':0xb,'twelve':0xd,'fourteen':0xe,'fifteen':0xf,'sixteen':0x10,'seventeen':0x11,'eighteen':0x12,'nineteen':0x13,'twenty':0x14,'thirty':0x1e,'forty':0x28,'fifty':0x32,'sixty':0x3c,'seventy':0x46,'eighty':0x50,'ninety':0x5a};function cardinalNumeralToNumber(R){return CARDINAL_NUMERALS[R]??NaN;}const ORDINAL_NUMERALS={...CARDINAL_NUMERALS,'first':0x1,'second':0x2,'third':0x3,'fourth':0x4,'fifth':0x5,'sixth':0x6,'seventh':0x7,'eighth':0x8,'ninth':0x9,'tenth':0xa,'eleventh':0xb,'twelfth':0xc,'thirteenth':0xd,'fourteenth':0xe,'fifteenth':0xf,'sixteenth':0x10,'seventeenth':0x11,'eighteenth':0x12,'nineteenth':0x13,'twentieth':0x14,'thirtieth':0x1e,'fortieth':0x28,'fiftieth':0x32,'sixtieth':0x3c,'seventieth':0x46,'eightieth':0x50,'ninetieth':0x5a};function ordinalNumeralToNumber(R){return ORDINAL_NUMERALS[R]??NaN;}const DENOMINATOR_NUMERALS={...ORDINAL_NUMERALS,'firsts':0x1,'half':0x2,'halves':0x2,'thirds':0x3,'fourths':0x4,'quoter':0x4,'quoters':0x4,'fifths':0x5,'sixths':0x6,'sevenths':0x7,'eighths':0x8,'ninths':0x9,'tenths':0xa,'elevenths':0xb,'twelfths':0xc,'thirteenths':0xd,'fourteenths':0xe,'fifteenths':0xf,'sixteenths':0x10,'seventeenths':0x11,'eighteenths':0x12,'nineteenths':0x13,'twentieths':0x14,'thirtieths':0x1e,'fortieths':0x28,'fiftieths':0x32,'sixtieths':0x3c,'seventieths':0x46,'eightieths':0x50,'ninetieths':0x5a};function denominatorNumeralToNumber(R){return DENOMINATOR_NUMERALS[R]??NaN;}const ITERATIVE_NUMERALS={'once':0x1,'twice':0x2,'thrice':0x3};function iterativeNumeralToInteger(R){return ITERATIVE_NUMERALS[R]??NaN;}const MULTIPLICATIVE_NUMERALS={'single':0x1,'double':0x2,'triple':0x3,'quadruple':0x4,'quintuple':0x5,'sextuple':0x6,'septuple':0x7,'octuple':0x8,'nonuple':0x9,'decuple':0xa};function multiplicativeNumeralToInteger(R){return MULTIPLICATIVE_NUMERALS[R]??NaN;}const FRACTIONAL_NUMERALS={'quoter':0.25,'half':0.5};function fractionalNumeralToNumber(R){return FRACTIONAL_NUMERALS[R]??NaN;}function replace(R,w,F,E){return R['substring'](0x0,w)+E+R['substring'](w+F);}function normalizeString(R,w=/[]/){return R['replaceAll'](new RegExp(String['raw']`\\([{\\nt]|${w['source']})`,'g'),(F,E)=>{if(E==='n')return'\x0a';else{if(E==='t')return'\x09';}return E;});}const GERUND_PARTICLES=new Set(['on','off','over','up','down','out']);function gerundize(R){const w=R['split'](/\s+/);let F=w['length']-0x1;if(w['length']>0x1&&GERUND_PARTICLES['has'](w[F]['toLowerCase']()))F-=0x1;const E=w[F]['toLowerCase']();if(/ee$/['test'](E))w[F]=E+'ing';else{if(/e$/['test'](E))w[F]=E['slice'](0x0,-0x1)+'ing';else{if(/[^aeiou][aeiou][^aeiouswxy]$/['test'](E))w[F]=''+E+E['at'](-0x1)+'ing';else w[F]=E+'ing';}}return w['join']('\x20');}const DEFAULT_LOCALE='en-US',SAMPLE_NUMBER=1234567.5,numberFormats=new Map();function numberFormatParts(R){try{return new Intl['NumberFormat'](R)['formatToParts'](SAMPLE_NUMBER);}catch{return new Intl['NumberFormat'](DEFAULT_LOCALE)['formatToParts'](SAMPLE_NUMBER);}}function numberFormat(R){const w=(R??'en-US')['replaceAll']('_','-');let F=numberFormats['get'](w);if(!F){const E=numberFormatParts(w);F={'group':E['find'](u=>u['type']==='group')?.['value']??'','decimal':E['find'](u=>u['type']==='decimal')?.['value']??'.'},numberFormats['set'](w,F);}return F;}const NUMBER_FORMAT_LOCALES=['en-US','de-DE'];function groupSeparatorPattern({group:R}){if(/\s/['test'](R))return String['raw']`\s`;if(R==='\x27'||R==='’')return'[\x27’]';return RegExp['escape'](R);}function normalizeNumericString(R,w){const F=numberFormat(w);return(F['group']?R['replaceAll'](new RegExp(groupSeparatorPattern(F),'g'),''):R)['replace'](F['decimal'],'.');}function mergeElementDescriptors(R,w){const F={...R,...w};if(R['type']&&w['type']){F['type']=[...new Set([R['type']??[],w['type']??[]]['flat']())];if(F['type']['length']===0x1)F['type']=F['type'][0x0];}if(R['anchor']&&w['anchor'])F['anchor']=[R['anchor']??[],w['anchor']??[]]['flat']();if(R['hints']?.['type']&&w['hints']?.['type']){F['hints']['type']=[...new Set([R['hints']['type']??[],w['hints']['type']??[]]['flat']())];if(F['hints']['type']['length']===0x1)F['hints']['type']=F['hints']['type'][0x0];}return F;}function attachAnchor(R,w){const F=Array['isArray'](w)?w:[w];if(R['anchor'])R['anchor']=[R['anchor'],...F]['flat']();else{if(F['length']===0x1)R['anchor']=F[0x0];else R['anchor']=F;}}function attachAnchorAtDeepest(R,w){if((Array['isArray'](w)?w:[w])['some'](({element:F})=>F===R))return;if(R['anchor']){for(const F of Array['isArray'](R['anchor'])?R['anchor']:[R['anchor']])if(F['element']&&!('isViewportDescriptor'in F['element'])&&!('isDialogDescriptor'in F['element']))attachAnchorAtDeepest(F['element'],w);}else R['anchor']=w;}function convertToStructure(R){if(Array['isArray'](R))return{'isStructure':!![],'type':'array','items':R['map'](w=>convertToStructure(w))};else{if(R&&typeof R==='object')return{'isStructure':!![],'type':'record','items':Object['entries'](R)['map'](([w,F])=>({'key':w,'value':convertToStructure(F)}))};}return R;}const RESERVED_NAMES=new Set(['page','response','js-result','it']);function isReservedName(R){return RESERVED_NAMES['has'](R);}function isSecretName(R){const w=new RegExp('(?:'+[/(?:access|o?auth(?:entication|orization)?)[\s_-]*(?:key|code)/,/(credential|token)(?:s)?/,/(?:api|app(?:lication)?|client|shared)[\s_-]*secret/,/(?:secret|api|private|encryption|verification|certificate)(?:[\s_-]*(?:pin|code|key))+/,/(?:pin|secret|otp)[\s_-]*(?:code)?/,/(?:secure|security|authenticator|2fa|mfa|(?:two|2)[\s_-]factor)[\s_-]*(?:code)?/,/pass[\s_-]*(?:code|word|phrase)/,/(credit|payment)[\s_-]*card/,/(?:cc|cvv|cvc)[\s_-]*(?:number|code|digits?)/]['map'](l=>l['source'])['join']('|')+')','i')['exec'](R);if(!w)return![];const F=w['index'],E=F+w[0x0]['length'],u=R[F-0x1]||'',M=R[E]||'';if(!/[A-Za-z0-9]/['test'](u)&&!/[A-Za-z0-9]/['test'](M))return!![];const N=/[a-z0-9]/['test'](u)&&/[A-Z]/['test'](w[0x0][0x0]),e=/[A-Z]/['test'](w[0x0]['slice'](-0x1))&&/[a-z0-9]/['test'](M);return N||e;}function isElementType(R){return test(Any(ElementType$1,NoopElementType),R);}function isPatternName(R){return test(NamedPattern,R);}function isNamedColor(R){if(typeof R!=='string')return![];return test(NamedColor,R['trim']());}function isNumberOperation(R){return typeof R==='object'&&R!==null&&'operator'in R&&(R['operator']==='add'||R['operator']==='sub'||R['operator']==='mul'||R['operator']==='div');}function variableNameToElementType(R){const w=R['toLowerCase']()['replace'](/[\s_-]+/g,'');if(/(link|url|address|uri|location)/['test'](w))return'link';if(/(btn|button|cta)/['test'](w))return'button';if(/(combo(?:box)|dropdown|select)/['test'](w))return'combobox';if(/(listbox)/['test'](w))return'listbox';if(/(radio)/['test'](w))return'radio';if(/(form)/['test'](w))return'form';if(/(check)/['test'](w))return'checkbox';if(/(popup|dialog|modal|alert)/['test'](w))return'popup';if(/(logo|brand)/['test'](w))return'logo';if(/(img|image|picture|photo)/['test'](w))return'image';if(/(heading|title|subtitle)/['test'](w))return'heading';if(/(item)/['test'](w))return'menuitem';if(/(menu|nav)/['test'](w))return'menu';if(/(burger)/['test'](w))return'hamburger';if(/(datetime)/['test'](w))return'datetimepicker';if(/(calendar|date)/['test'](w))return'datepicker';if(/(time)/['test'](w))return'timepicker';if(/(color)/['test'](w))return'colorpicker';if(/(header|topbar)/['test'](w))return'header';if(/(footer|bottombar)/['test'](w))return'footer';if(/(icon|glyph|symbol)/['test'](w))return'icon';if(/(range|slider)/['test'](w))return'slider';if(/(textbox|input|field)/['test'](w))return'textbox';if(/(text|label|paragraph|content)/['test'](w))return'text';return null;}function singularize(R){if(/[^aeiou]ies$/i['test'](R))return R['slice'](0x0,-0x3)+'y';if(/(?:ss|sh|ch|x|z)es$/i['test'](R))return R['slice'](0x0,-0x2);if(/[^su]s$/i['test'](R))return R['slice'](0x0,-0x1);return null;}function multiplyByTimeUnit(R,w){if(w==null)return R;return{'operator':'mul','operands':[{'isOperand':!![],'value':R},{'isOperand':!![],'value':w}]};}const Identifier$1=Use(/([^,.:\/'"{}[\]()/\s]+)/),SingularizedIdentifier=Node(Identifier$1,([R])=>singularize(R)??R),MultiWordIdentifier=Use(/([^,.:\/'"{}[\]()/]+)\b/),Reference$1=(R,{context:w}={})=>Lazy(()=>Sanitize$1(Recursive(()=>{const F=Any(Node(All('.',MultiWordIdentifier),([u])=>({'get':u})),Node(Wrap({'left':'[','right':']'},Any(IntegerNumberLiteral,QuotedInterpolatedStringLiteral,UnquotedInterpolatedStringLiteral({'escape':/[\]]/}))),([u])=>({'get':u}))),E=Node(RegExpLiteral,([u])=>({'match':u}));return Mark(Any(Node(Wrap({'left':'{%','right':'%}'},UnquotedJSExpressionLiteral({'char':/(?!%})./})),([u])=>{return{'isJSExpressionRef':!![],'expression':u,'type':R};}),Node(Wrap({'left':'{','right':'}'},All(MultiWordIdentifier,Star(Any(F,E)))),([u,...M],N)=>{let e;if(u==='it'&&N['context']['has']('reference'))e={...N['context']['reference'],'modifiers':[...N['context']['reference']?.['modifiers']??[],...M],'type':R};else{e={'isRef':!![],'name':u,'modifiers':M,'type':R};if(N['collections']['bindings']['find'](l=>l['names']['includes'](u['toLowerCase']())))e['binding']=!![];}return N['collections']['references']['push'](e),e;})),{'type':'reference','subtype':w});}))),VerboseReference=Any(Lazy(()=>{return Mark(Node(All(Optional(The),Optional(Last$1),HttpResponse,Optional(Any(Node(HttpBody,()=>[{'get':'body'}]),Node(All(HttpCookie,InterpolatedStringLiteral$1),([R])=>[{'get':'cookies'},{'get':R}]),Node(All(HttpHeader$1,InterpolatedStringLiteral$1),([R])=>[{'get':'headers'},{'get':R}])))),([R],w)=>{const F={'isRef':!![],'name':'response','modifiers':R,'type':'string'};return w['collections']['references']['push'](F),F;}),{'type':'reference'});}),Mark(Node(All(Optional(The),Optional(Last$1),JavaScript,Optional(Evaluation),Result),(R,w)=>{const F={'isRef':!![],'name':'js-result','type':'string'};return w['collections']['references']['push'](F),F;}),{'type':'reference'}),Lazy(()=>{const R=Any(Node(Url$4,()=>({'type':'string','modifiers':[{'get':'url'}]})),Node(Title$1,()=>({'type':'string','modifiers':[{'get':'title'}]})),Node(HttpStatusCode,()=>({'type':'number','modifiers':[{'get':'status'}]})),Node(Width,()=>({'type':'number','modifiers':[{'get':'width'}]})),Node(Height,()=>({'type':'number','modifiers':[{'get':'height'}]})),Node(All(HttpCookie,InterpolatedStringLiteral$1),([w])=>({'type':'string','modifiers':[{'get':'cookies'},{'get':w}]})),Node(All(HttpHeader$1,InterpolatedStringLiteral$1),([w])=>({'type':'string','modifiers':[{'get':'headers'},{'get':w}]})));return Mark(Node(Any(All(Optional(The),R,Of,Any(The,This),Optional(Current),WebPage),All(Optional(The),Possessive(WebPage),R)),([{type:w,modifiers:F}],E)=>{const u={'isRef':!![],'name':'page','modifiers':F,'type':w};return E['collections']['references']['push'](u),u;}),{'type':'reference'});}));function GroupedDigits(R){return'[1-9](?:'+groupSeparatorPattern(R)+'(?=\x5cd{3})|\x5cd)*';}function NumberLiteral(R,w){const F=new Map();return Mark(Dynamic(E=>{const u=numberFormat(E['options']['locale']);let M=F['get'](u);return!M&&(M=Node(Use(new RegExp('('+R(u)+')')),([N],e)=>w(normalizeNumericString(N,e['options']['locale']))),F['set'](u,M)),M;}),{'type':'number'});}const NaturalNumberLiteral=NumberLiteral(GroupedDigits,Number['parseInt']),NonnegativeDecimalNumberLiteral=NumberLiteral(R=>'(?:0|'+GroupedDigits(R)+')?'+RegExp['escape'](R['decimal'])+'\x5cd+',Number['parseFloat']),DecimalNumberLiteral=NumberLiteral(R=>'[-+]?(?:0|'+GroupedDigits(R)+')'+RegExp['escape'](R['decimal'])+'\x5cd+',Number['parseFloat']),NonnegativeIntegerNumberLiteral=NumberLiteral(R=>'0|'+GroupedDigits(R),Number['parseInt']),IntegerNumberLiteral=NumberLiteral(R=>'[-+]?(?:0|'+GroupedDigits(R)+')',Number['parseInt']),NumericLiteral=Any(DecimalNumberLiteral,IntegerNumberLiteral),NonnegativeRationalNumberLiteral=Node(Mark(All(NonnegativeIntegerNumberLiteral,All('/',NaturalNumberLiteral)),{'type':'number'}),([R,w])=>R/w),RationalNumberLiteral=Node(Mark(All(IntegerNumberLiteral,All('/',NaturalNumberLiteral)),{'type':'number'}),([R,w])=>R/w),CardinalNumberLiteral=Node(Mark(Any(NoBoundary(All(CardinalNumeralTen,Optional(All(Optional(/and|-/i),CardinalNumeralDigit)))),CardinalNumeralTeen,CardinalNumeralDigit),{'type':'number'}),R=>R['reduce']((w,F)=>w+cardinalNumeralToNumber(F),0x0)),OrdinalNumberLiteral$1=Mark(Any(Node(Use(/(\d*(?:(?:[0|4-9]|1\d)th|1st|2nd|3rd))/i),([R])=>Number['parseInt'](R)),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(/and|-/i),OrdinalNumeralDigit)),OrdinalNumeralTen,OrdinalNumeralTeen,OrdinalNumeralDigit),R=>R['reduce']((w,F)=>w+ordinalNumeralToNumber(F),0x0))),{'type':'number'}),FractionalNumberLiteral=Mark(Any(Node(All(Any(Node(Zero,()=>0x0),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(All(Optional(/and|-/i),CardinalNumeralTeen)))),CardinalNumeralTeen,CardinalNumeralDigit),R=>R['reduce']((w,F)=>w+cardinalNumeralToNumber(F),0x0))),Optional('-'),Node(Any(NoBoundary(All(CardinalNumeralTen,Optional(/and|-/i),DenominatorNumeralDigit)),DenominatorNumeralTen,DenominatorNumeralTeen,DenominatorNumeralDigit),R=>R['reduce']((w,F)=>w+denominatorNumeralToNumber(F),0x0))),([R,w])=>R/w),Node(FractionNumeral,([R])=>fractionalNumeralToNumber(R))),{'type':'number'}),QuantitativeNumberLiteral=Any(NonnegativeDecimalNumberLiteral,NonnegativeRationalNumberLiteral,NaturalNumberLiteral,FractionalNumberLiteral,CardinalNumberLiteral),PercentageNumberLiteral=Node(NoBoundary(All(Any(NonnegativeDecimalNumberLiteral,NonnegativeIntegerNumberLiteral),'%')),([R])=>R/0x64),IterativeNumberLiteral=Node(IterativeNumeral,([R])=>iterativeNumeralToInteger(R)),MultiplicativeNumberLiteral=Node(MultiplicativeNumeral,([R])=>multiplicativeNumeralToInteger(R)),IntegerNumberExpression=Any(Reference$1('number'),IntegerNumberLiteral,CardinalNumberLiteral),CardinalNumberExpression=Any(Reference$1('number'),NaturalNumberLiteral,CardinalNumberLiteral),IterativeNumberExpression=Any(Reference$1('number'),IterativeNumberLiteral),OrdinalNumberExpression$1=Any(Reference$1('number'),OrdinalNumberLiteral$1),NullLiteral=Mark(Node(/null|nil/i,()=>null),{'type':'null'}),TimeUnitLiteral=Any(Node(/milliseconds?|millis|msecs?|ms/i,()=>0x1),Node(/seconds?|secs?|s/i,()=>0x3e8),Node(/minutes?|mins?|m/i,()=>0xea60)),TimeIntervalLiteral=Node(NoBoundary(All(Any(QuantitativeNumberLiteral,Nothing$1(0x1)),Optional(IndefiniteArticle),TimeUnitLiteral)),([R,w])=>R*w),RegExpLiteral=Node(Use(/\/([^/]+)\/([gimsuy]*)/),([R,w])=>{return{'isPattern':!![],'pattern':R,'flags':w};}),NamedPattern=Node(Any(Node(Number$1,()=>'number'),Node(Price$1,()=>'price'),Node(Percentage$1,()=>'percentage'),Node(Date$1,()=>'date'),Node(Time,()=>'time'),Node(Code,()=>'code')),([R])=>{return{'isPattern':!![],'name':R};}),QuotedStringLiteral=Customizable((R={})=>{const w=R['char']??/./,F=Node(Use(new RegExp(String['raw']`"((?:(?:\\["\\nt])|(?:(?!["])${w['source']}))*)"`)),([u])=>normalizeString(u,/["]/)),E=Node(Use(new RegExp(String['raw']`'((?:(?:\\['\\nt])|(?:(?!['])${w['source']}))*)'`)),([u])=>normalizeString(u,/[']/));return Node(Any(Mark(F,{'type':'string','subtype':'double\x20quoted'}),Mark(E,{'type':'string','subtype':'single\x20quoted'})),([u])=>normalizeString(u,/['"]/));}),QuotedInterpolatedStringLiteral=Customizable((R={})=>{const w=R['char']??/./,F=Node(Use(new RegExp(String['raw']`({?(?:(?:\\["{\\nt])|(?:(?!["{])${w['source']}))+|{)`)),([M])=>normalizeString(M,/["]/)),E=Node(Use(new RegExp(String['raw']`({?(?:(?:\\['{\\nt])|(?:(?!['{])${w['source']}))+|{)`)),([M])=>normalizeString(M,/[']/)),u=Use(/(\s+)/);return Raw(Node(Any(Mark(Wrap('\x22',Star(Any(u,Reference$1('string',{'context':'double\x20quoted\x20string\x20chunk'}),F))),{'type':'string','subtype':'double\x20quoted'}),Mark(Wrap('\x27',Star(Any(u,Reference$1('string',{'context':'single\x20quoted\x20string\x20chunk'}),E))),{'type':'string','subtype':'single\x20quoted'})),M=>{M=M['reduce']((N,e)=>{if(typeof e==='string'){if(typeof N['at'](-0x1)==='string')N[N['length']-0x1]+=e;else N['push'](e);}else N['push'](e);return N;},[]);if(M['length']===0x0)return'';else{if(M['length']===0x1&&typeof M[0x0]==='string')return M[0x0];else return{'isInterpolatedString':!![],'chunks':M};}}));});function excludeParens(R){return new RegExp(R['source']+'|[()]');}const UnquotedStringLiteral$1=Customizable((R={})=>{const w=R['char']??/[^,\s]/,F=R['escape']??/[]/,E=R['allowParens']?F:excludeParens(F),u=R['weak'],M=Use(new RegExp('((?:(?![\x27\x22]|'+E['source']+')'+w['source']+')+)'));return Mark(u?NonEmpty(Weak(M)):M,{'type':'string','subtype':'unquoted'});}),UnquotedInterpolatedStringLiteral=Customizable((R={})=>{const w=R['char']??/[^,\s]/,F=R['escape']??/[]/,E=R['allowParens']?F:excludeParens(F),u=R['weak'],M=Use(new RegExp(String['raw']`({?(?:(?:\\(?:[{\\nt]|${E['source']}))|(?:(?![{]|${E['source']})${w['source']}))+|{)`)),N=Node(Plus$1(Any(All(Not(/["'\s]/),Reference$1('string',{'context':'unquoted\x20string\x20chunk'})),M)),e=>{e=e['map'](l=>typeof l==='string'?normalizeString(l,E):l);if(e['length']===0x1)return e[0x0];else return{'isInterpolatedString':!![],'chunks':e};});return Raw(Mark(u?NonEmpty(Weak(N)):N,{'type':'string','subtype':'unquoted'}));}),StandaloneInterpolatedStringLiteral=Customizable((R={})=>{const w=R['char']??/./,F=Use(new RegExp(String['raw']`({?(?:(?:\\[{\\nt])|(?:(?![{])${w['source']}))+|{)`));return Raw(Node(Mark(Star(Any(Use(/(\s+)/),Reference$1('string',{'context':'standalone\x20string\x20chunk'}),F)),{'type':'string','subtype':'standalone'}),E=>{E=E['reduce']((u,M)=>{if(typeof M==='string'){M=normalizeString(M);if(typeof u['at'](-0x1)==='string')u[u['length']-0x1]+=M;else u['push'](M);}else u['push'](M);return u;},[]);if(E['length']===0x0)return'';else{if(E['length']===0x1)return E[0x0];else return{'isInterpolatedString':!![],'chunks':E};}}));}),StringLiteral$1=Customizable((R={})=>{return Any(QuotedStringLiteral(R),UnquotedStringLiteral$1(R));}),InterpolatedStringLiteral$1=Customizable((R={})=>{return Any(QuotedInterpolatedStringLiteral(R),UnquotedInterpolatedStringLiteral(R));}),QuotedStringExpression=Customizable((R={})=>{return Any(Reference$1('string'),VerboseReference,QuotedInterpolatedStringLiteral(R));}),UnquotedStringExpression=Customizable((R={})=>{return Any(VerboseReference,UnquotedInterpolatedStringLiteral(R));}),StringExpression$1=Customizable((R={})=>{return LogGroup({'name':'StringExpression','collapsed':![]},Any(VerboseReference,InterpolatedStringLiteral$1(R)));}),StandaloneStringExpression=StandaloneInterpolatedStringLiteral,QuotedJSExpressionLiteral=Lazy(()=>{return Raw(Mark(Node(Any(Wrap('\x22',Star(Any(Reference$1('any'),Use(/(\{?(?:\\["{\\]|[^"{])+)/)))),Wrap('\x27',Star(Any(Reference$1('any'),Use(/(\{?(?:\\['{\\]|[^'{])+)/))))),R=>{return R=R['map'](w=>typeof w==='string'?w['replace'](/\\(["'{\\])/g,'$1'):w),{'isJSExpression':!![],'chunks':R};}),{'type':'js\x20code'}));}),UnquotedJSExpressionLiteral=Customizable((R={})=>{const w=R['char'];return Raw(Mark(Node(w?Star(Any(Reference$1('any'),Use(new RegExp(String['raw']`(\{?(?:\\[{\\]|(?![{])${w['source']})+)`)))):As$1(Anything$1,Star(Any(Reference$1('any'),Use(/(\{?(?:\\[{\\]|[^{])+)/)))),F=>{return F=F['map'](E=>typeof E==='string'?E['replace'](/\\(["'{\\])/g,'$1'):E),{'isJSExpression':!![],'chunks':F};}),{'type':'js\x20code'}));}),JSExpressionLiteral$1=Customizable((R={})=>{return Any(QuotedJSExpressionLiteral,UnquotedJSExpressionLiteral(R));}),StructureLiteral$1=Lazy(()=>Recursive(R=>{const w=Any(Reference$1('string'),Use(/([^:'",\s]+)/),InterpolatedStringLiteral$1),F=Any(Reference$1('any'),R,PrimitiveLiteral({'escape':/[\]]/})),E=Any(Reference$1('any'),R,PrimitiveLiteral({'escape':/[\}]/}));return Any(Node(Mark(Wrap({'left':'[','right':']'},Optional(List(F,','))),{'type':'array'}),u=>({'isStructure':!![],'type':'array','items':u})),Node(Mark(Wrap({'left':'{','right':'}'},Optional(List(Node(All(Mark(w,{'type':'record\x20key'}),':',E),([u,M])=>({'key':u,'value':M})),','))),{'type':'record'}),u=>({'isStructure':!![],'type':'record','items':u})));})),BooleanLiteral=Mark(Any(Node(/true/i,()=>!![]),Node(/false/i,()=>![])),{'type':'boolean'});Any(Reference$1('boolean'),BooleanLiteral);const PrimitiveLiteral=Customizable((R={})=>{return Any(NullLiteral,BooleanLiteral,RationalNumberLiteral,DecimalNumberLiteral,IntegerNumberLiteral,InterpolatedStringLiteral$1(R));}),Url$3=Mark(StringExpression$1,{'type':'secret','regexp':/(?<=^[^:]+:\/\/.+(?:(?=(?<!\\){)|:)).+(?=@.+)/}),ExplicitUrl=Mark(Stringish(Use(/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/)),{'type':'secret','regexp':/(?<=^[^:]+:\/\/.+(?:(?=(?<!\\){)|:)).+(?=@.+)/}),Viewport=Node(All(Optional(The),Viewport$1),()=>({'isViewportDescriptor':!![]})),Dialog=Node(All(Optional(The),BrowserDialog),(R,w)=>{const F={'isDialogDescriptor':!![]};return w['context']['element']=F,F;}),{Apply:Apply$34,Mutate:Mutate$34}=State({'isDialogElementDescriptor':!![]}),ButtonTitle$1=Any(Mutate$34(Stringish(Accept),R=>R['title']='ok'),Mutate$34(Stringish(Dismiss),R=>R['title']='cancel')),TextboxTitle$1=Mutate$34(Stringish(/prompt|answer/i),R=>R['title']='prompt'),DialogButton=Effect(Apply$34(All(Optional(The),Any(All(Optional(Possessive(BrowserDialog)),ButtonTitle$1),All(ButtonTitle$1,Optional(Possessive(BrowserDialog)))),Optional(Button))),([R],w)=>w['context']['element']=R),ExplicitDialogButton=Effect(Apply$34(All(Optional(The),Any(All(Possessive(BrowserDialog),ButtonTitle$1),All(ButtonTitle$1,Possessive(BrowserDialog))),Optional(Button))),([R],w)=>w['context']['element']=R),DialogTextbox=Effect(Apply$34(All(Optional(The),Optional(Possessive(BrowserDialog)),TextboxTitle$1,Optional(Textbox))),([R],w)=>w['context']['element']=R),ExplicitDialogTextbox=Effect(Apply$34(All(Optional(The),Possessive(BrowserDialog),TextboxTitle$1,Optional(Textbox))),([R],w)=>w['context']['element']=R),RelativeAnchor=({Element:R})=>Any(Node(All(Near,R),([w])=>({'position':'near','element':w})),Node(All(RelativePosition,Optional(Of),R),([w,F])=>({'position':w,'element':F}))),AbsoluteAnchor=({Element:R})=>{const w=Any(Viewport,Dialog,R),F=Node(PostCondition(List(R({'anchor':![]}),Inside),E=>E['length']>=0x2&&E['every'](u=>u['type']&&u['type']===E[0x0]['type'])),E=>{return E['reduceRight']((u,M)=>(attachAnchor(M,{'position':'inside','element':u}),M));});return Longest(Node(All(Optional(LocationPreposition),AbsolutePosition$1,Optional(All(Any(LocationPreposition,Of),w))),([E,u])=>u?{'position':E,'element':u}:{'position':E}),Node(All(Inside,WeakList(Any(F,w),AndListSeparator)),E=>{const u=E['map'](M=>({'position':'inside','element':M}));return u['length']>0x1?u:u[0x0];}));},Anchor$3=R=>{return LogGroup('Anchor',Mark(Any(RelativeAnchor(R),AbsoluteAnchor(R)),{'type':'anchor'}));},NamedColor=Any(Node(/red/i,()=>'red'),Node(/blue/i,()=>'blue'),Node(/green/i,()=>'green'),Node(/yellow/i,()=>'yellow'),Node(/orange/i,()=>'orange'),Node(/purple/i,()=>'purple'),Node(/pink/i,()=>'pink'),Node(/brown/i,()=>'brown'),Node(/black/i,()=>'black'),Node(/white/i,()=>'white'),Node(/gr[ae]y/i,()=>'gray'),Node(/cyan/i,()=>'cyan'),Node(/magenta/i,()=>'magenta'),Node(/lime/i,()=>'lime'),Node(/navy/i,()=>'navy'),Node(/teal/i,()=>'teal'),Node(/maroon/i,()=>'maroon'),Node(/olive/i,()=>'olive'),Node(/aqua/i,()=>'aqua'),Node(/silver/i,()=>'silver'),Node(/gold/i,()=>'gold'),Node(/indigo/i,()=>'indigo'),Node(/violet/i,()=>'violet'),Node(/crimson/i,()=>'crimson'),Node(/coral/i,()=>'coral'),Node(/salmon/i,()=>'salmon'),Node(/turquoise/i,()=>'turquoise'),Node(/lavender/i,()=>'lavender'),Node(/khaki/i,()=>'khaki'),Node(/tan/i,()=>'tan'),Node(/beige/i,()=>'beige'),Node(/ivory/i,()=>'ivory'),Node(/plum/i,()=>'plum'),Node(/azure/i,()=>'azure'),Node(/mint/i,()=>'mint'),Node(/peach/i,()=>'peach')),EncodedColor=Any(Use(/(rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\))/i),Use(/(rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d*\.?\d+\s*\))/i),Use(/(cmyk\(\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\))/i),Use(/(hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\))/i),Use(/(#[0-9A-F]{3}(?:[0-9A-F]{3})?)/i)),Color$1=Any(EncodedColor,NamedColor),{Apply:Apply$33,Mutate:Mutate$33,state:state$3}=State({}),Type$3=Void(Mutate$33(Use(/(css|xpath)/i),(R,[w])=>R['type']=w['toLowerCase']())),Value$5=Mutate$33(Node(StringExpression$1({'allowParens':!![]}),([R],w)=>({'type':state$3(w)['type']??(typeof R==='string'&&['/','(','../','./','*/']['some'](F=>R['startsWith'](F))?'xpath':'css'),'selector':R})),(R,[{type:w,selector:F}])=>{R['type']=w,R['selector']=F;}),ElementSelector=Apply$33(All(Any(All(Type$3,Optional(All(Optional(Any('-',With,By)),Selector$1))),All(Nothing$1(void 0x0),Selector$1)),Mark(Value$5,{'type':'selector','mutate':(R,[w])=>R['subtype']=w['type']}))),NoopElementType=Element$3,AppElementType=Node(Any(WebPage,App$1),()=>'app'),groups={'control':['checkboxgroup','checkbox','radiogroup','radio','textbox','combobox','listbox','option','datepicker','timepicker','datetimepicker','colorpicker','filepicker','slider','inputbox','selectbox','valuebox','button','tab','color'],'structural':['ad','header','footer','popup','tooltip','form','menu','menuitem','hamburger','list','listitem','heading','table','table-cell','table-row','table-head-row','table-column','table-stub-column','table-head-cell','card','pdfpage','tablist','tabpanel'],'content':['text','link','label','logo','image','icon','video','paragraph']},definitions=[['tooltip',Tooltip],['button',Button],['radiogroup',RadioGroup],['radio',Radio],['textbox',Textbox],['checkboxgroup',CheckboxGroup],['checkbox',Checkbox],['combobox',Combobox],['listbox',Listbox],['option',Option$1],['colorpicker',ColorPicker],['datepicker',DatePicker],['timepicker',TimePicker],['datetimepicker',DateTimePicker],['filepicker',FilePicker],['slider',Slider],['inputbox',Inputbox],['selectbox',Selectbox],['valuebox',Valuebox],['pdfpage',PdfPage$1],['ad',Ad],['table-head-cell',All(Optional(Table),Header$5,Cell)],['table-cell',All(Optional(Table),Cell)],['table-head-row',All(Optional(Table),Header$5,Row)],['table-row',All(Optional(Table),Row)],['table-stub-column',All(Optional(Table),Stub,Column)],['table-column',All(Optional(Table),Column)],['table',Table],['tabpanel',TabPanel],['tablist',TabList],['tab',Tab$1],['header',Header$5],['footer',Footer],['popup',Popup],['form',Form$1],['menuitem',MenuItem],['menu',Menu],['listitem',ListItem],['list',List$1],['hamburger',Hamburger],['heading',Heading],['card',Card],['text',Text$1],['link',Link],['logo',Logo],['image',Image],['icon',Icon],['paragraph',Paragraph]],pluralDefinitions=definitions['map'](([R,w])=>[R,Plural$1(w)]),ElementType$1=Customizable((R={})=>{function w(F){if(!R?.['allowed'])return F['map'](([u,M])=>Node(M,()=>u));const E=new Set(R['allowed']['flatMap'](u=>groups[u]??u));return F['flatMap'](([u,M])=>E['has'](u)?[Node(M,()=>u)]:[]);}return Plural(Any(...w(definitions)),Any(...w(pluralDefinitions)));}),{Apply:Apply$32,Mutate:Mutate$32}=State({}),Type$2=Customizable(R=>{const w=R?.['allowed']?.['filter'](E=>E!=='noop'),F=!w||w['length']<R['allowed']['length'];return Any(Mutate$32(ElementType$1({'allowed':w}),(E,[u])=>E['type']=u),!w||w['includes']('textbox')?Mutate$32(Any(All(Stringish(Use(/(search)/i)),Plural(/bar|box/i,Plural$1(/bar|box/i))),Plural(Searchbox,Plural$1(Searchbox))),(E,[u='search'])=>{E['type']='textbox',E['title']=u;}):Never,F?Plural(NoopElementType,Plural$1(Element$3)):Never);}),App=Mutate$32(AppElementType,(R,[w])=>R['type']=w),IndexedPdfPage=Mutate$32(All(Optional(The),Any(All(Index(OrdinalNumberExpression$1),Any(PdfPage$1,Page)),All(Any(PdfPage$1,Page),Optional(Any(NumberSign,Number$1)),Index(CardinalNumberExpression)))),(R,[w])=>(R['type']='pdfpage',R['nth']=w)),ExplicitColor=Mutate$32(Any(All(Color$2,Any(EncodedColor,StringExpression$1)),All(Any(EncodedColor,StringExpression$1),Color$2)),(R,[w])=>R['color']=w),KnownColor=Mutate$32(Color$1,(R,[w])=>R['color']=w),Colorable=R=>Any(All(R,Any(With,Of),Optional(The),ExplicitColor),All(Optional(KnownColor),R)),Selector=Mutate$32(All(Optional(All(Any(With,By),Optional(The))),ElementSelector),(R,[w])=>R['selector']=w),ElementReference$1=Mutate$32(Reference$1('any'),(R,[w])=>{R['reference']=w;}),Title=Customizable(({weak:R}={})=>Mutate$32(Any(All(Optional(All(Having,Optional(The))),NamedPattern),All(Named,Mark(StringExpression$1,{'type':'text'})),Mark(StringExpression$1({'weak':R}),{'type':'text'})),(w,[F])=>{w['title']=F;if(typeof F==='string'&&isSecretName(F))w['secret']=!![];})),Nth=Mutate$32(Index(OrdinalNumberExpression$1),(R,[w])=>R['nth']=w),Last=Mutate$32(Any(Last$1,Bottom),R=>R['orderDirection']='backward'),ExplicitIndex=Mutate$32(All(Any(With,At),Optional(The),Index$1,Optional(NumberSign),IntegerNumberExpression),(R,[w])=>R['nth']=w),SearchOrder=Any(Mutate$32(/from\s+(?:the\s+)?(?:beginning|top)/i,R=>R['orderDirection']='forward'),Mutate$32(/from\s+(?:the\s+)?(?:end|bottom)/i,R=>R['orderDirection']='backward')),ElementAnchor=R=>Mutate$32(Anchor$3({'Element':R}),(w,[F])=>attachAnchor(w,F)),AbsolutePositionAnchor=Mutate$32(OrthogonalAbsolutePosition,(R,[w])=>attachAnchor(R,{'position':w})),TypeAnchor=Mutate$32(All(Optional(The),Any(All(Nothing$1(void 0x0),Possessive(AppElementType,{'strict':!![]})),All(Node(Optional(OrthogonalAbsolutePosition),([R])=>R&&{'position':R}),Possessive(ElementType$1({'allowed':['structural']})))),Not(Any(Near,Inside,RelativePosition))),(R,[w,F])=>attachAnchor(R,{'position':'inside','element':w?{'type':F,'anchor':w}:{'type':F}})),Element$2=Recursive((R,{depth:w})=>{return Customizable(F=>{const E=PreCondition(W=>F?.['reference']!==![]&&W['collections']['bindings']['length']===0x0,ImplicitElement),u=F?.['explicit']&&w===0x0,M=F?.['anchor']!==![],N=!!F?.['types']&&!F['types']['includes']('noop'),e=Type$2({'allowed':F?.['types']}),l=M?List(ElementAnchor(R(F)),AndListSeparator):Never,Y=u?All(The,ElementReference$1):All(Optional(The),ElementReference$1),I=All(Optional(The),Any(All(e,Selector),All(Selector,Optional(e)))),f=Void(Any(All(Optional(The),Any(Last,ElementReference$1),Colorable(e),Optional(l)),All(Optional(The),Optional(Any(AbsolutePositionAnchor,Nth)),Optional(The),Any(All(Colorable(e),Optional(ExplicitIndex),Any(All(SearchOrder,Optional(Selector)),M?All(Optional(Selector),l):Never,All(Title({'weak':!![]}),Optional(Selector),Optional(l)),Optional(Selector))),All(Colorable(All(Title,Any(All(TypeAnchor,e),e))),Optional(ExplicitIndex),Optional(Selector),Optional(l)))))),t=PostCondition(All(Optional(The),Optional(Any(Nth,Last)),Any(All(Title,NonEmpty(All(Optional(ExplicitIndex),Optional(Selector),Optional(l)))),Title({'weak':!![]}))),(W,i,K)=>!u||!test(StringExpression$1,i['text']['substring'](K['pos'],i['pos'])));return Any(E,Effect(LogGroup('ElementDescriptor',Mark(Apply$32(Any(IndexedPdfPage,I,Longest(Y,M?All(TypeAnchor,f):Never,Any(f,Article(App),N?Never:t),M&&!N?All(TypeAnchor,t):Never))),{'type':'element\x20descriptor'})),([W],i)=>{if(W['type']!=='app')i['context']['element']=W;const K=W['title']&&typeof W['title']==='object'&&'isRef'in W['title']?W['title']:W['reference']&&'isRef'in W['reference']?W['reference']:void 0x0;if(K){const s=variableNameToElementType(K['name']);s&&(W['hints']=W['hints']??{},W['hints']['type']=[s]);}if(W['nth']!==void 0x0&&!W['title']){if(W['type']==='table-row')W['type']='table-leaf-row';if(W['type']==='table-column')W['type']='table-leaf-column';}if(Array['isArray'](W['anchor'])){function Q(S){if(!S)return![];return(Array['isArray'](S)?S:[S])['some'](a=>['table-column','table-row','table-leaf-column','table-leaf-row','table-stub-column','table-head-row']['includes'](a));}const k=W['anchor']['filter'](S=>S['position']==='inside'&&S['element']&&!('isViewportDescriptor'in S['element'])&&!('isDialogDescriptor'in S['element'])&&!('isElementReference'in S['element'])&&Q(S['element']['type']));if(k['length']>0x0){const S=k[k['length']-0x1];function a(H){if(H['type']==='table')return{'position':'inside','element':H};if(H['anchor']&&!Array['isArray'](H['anchor'])&&H['anchor']['position']==='inside'&&H['anchor']['element']&&!('isViewportDescriptor'in H['anchor']['element'])&&!('isDialogDescriptor'in H['anchor']['element']))return a(H['anchor']['element']);}const T=a(S['element']);if(T){const H=W['anchor']['indexOf'](S);W['anchor']=W['anchor']['map']((A,D)=>{if(D===H||!k['includes'](A))return A;if(a(A['element']))return A;const Z=structuredClone(A);return attachAnchorAtDeepest(Z['element'],T),Z;});}}}}));});}),ExplicitElement=Lazy(()=>Element$2({'explicit':!![]})),StringElement=Apply$32(Title),PageElement=Apply$32(All(Optional(The),App)),ImplicitElement=Customizable(({contextual:contextual=![]}={})=>{function R(F,E){const u=F['context']['has']('element')?F['context']['element']:void 0x0;return{'isElementReference':!![],...E?{'type':E}:{},...u?.['secret']?{'secret':!![]}:{}};}const w=Mark(Any(Node(It,(F,E)=>R(E)),Node(All(Demonstrative,Any(ElementType$1(),Node(Element$3,()=>void 0x0))),([F],E)=>R(E,F))),{'type':'element\x20reference'});return contextual?PreCondition(F=>F['context']['has']('element'),w):w;}),extractTypes={'number':'amount','price':'price','percentage':'percentage'},ElementValueExtractor=Customizable(({Element:Element=Element$2}={})=>{const R=Any(Node(All(Optional(Any(Node(Mark(Background,{'type':'color-type','subtype':'background'}),()=>'background-color'),Node(Mark(Any(Foreground,Text$1),{'type':'color-type','subtype':'foreground'}),()=>'foreground-color'))),Color$2),([w])=>w??'color'),Node(Value$6,()=>'any'),Node(String$1,()=>'string'));return Mark(Node(Any(Node(All(Optional(The),R,Any(All(Any(Of,From,LocationPreposition),Element),Node(Anchor$3({'Element':Element}),([w])=>({'anchor':w})))),([w,F])=>({'operator':'extract','operands':[{'isOperand':!![],'value':F},w]})),Node(All(ExplicitElement,R),([w,F])=>({'operator':'extract','operands':[{'isOperand':!![],'value':w},F]})),Node(PostCondition(All(ExplicitElement,NamedPattern),([w,F])=>!('isElementReference'in w)&&w['title']!=null&&!(typeof w['title']==='object'&&'isPattern'in w['title'])&&'name'in F&&F['name']in extractTypes),([w,F])=>({'operator':'extract','operands':[{'isOperand':!![],'value':w},extractTypes[F['name']]]})),Node(PostCondition(Element,([w])=>!!(w['type']==='text'&&!(w['nth']||w['title'])&&w['anchor']&&(!Array['isArray'](w['anchor'])||w['anchor']['length']===0x1))),([w])=>{return{'operator':'extract','operands':[{'isOperand':!![],'value':(Array['isArray'](w['anchor'])?w['anchor'][0x0]:w['anchor'])['element']},'string']};})),([w],F)=>{return F['collections']['extractors']['push'](w),w;}),{'type':'extractor'});}),Op=(R,w)=>Node(R,()=>w),SymbolicAddSubOperator=Mark(Any(Op(PlusSymbolic,'add'),Op(MinusSymbolic,'sub')),{'type':'operator'}),SymbolicMulDivOperator=Mark(Any(Op(MultiplySymbolic,'mul'),Op(DivisionSymbolic,'div')),{'type':'operator'}),AddSubOperator=Mark(Any(Op(Plus,'add'),Op(Minus,'sub')),{'type':'operator'}),MulDivOperator=Mark(Any(Op(Multiply,'mul'),Op(Division,'div')),{'type':'operator'}),VerboseOperationWord=Mark(Any(Op(Sum,'add'),Op(Difference,'sub'),Op(Product,'mul'),Op(Quotient,'div')),{'type':'operator'}),numberOperatorSymbols={'add':'+','sub':'-','mul':'*','div':'/'};function toOperand(R,w){const F={'isOperand':!![],'value':R['value']};return w['collections']['operands']['push'](F),F;}function reduceChainToOperation([R,...w],F){return w['reduce']((E,{operator:u,expression:M})=>{return{'value':{'operator':u,'operands':[toOperand(E,F),toOperand(M,F)]}};},R);}function reducePercentAwareChainToOperation([R,...w],F){return w['reduce']((E,{operator:u,expression:M})=>{const N=M['isPercent']?{'value':{'operator':'mul','operands':[toOperand(M,F),toOperand(E,F)]}}:M;return{'value':{'operator':u,'operands':[toOperand(E,F),toOperand(N,F)]}};},R);}const ArithmeticOperation=Customizable(({symbolic:symbolic=![]}={})=>{const R=symbolic?SymbolicAddSubOperator:AddSubOperator,w=symbolic?SymbolicMulDivOperator:MulDivOperator;return Node(PostCondition(Recursive(F=>{const E=Node(All(Optional(The),VerboseOperationWord,Of,PostCondition(List(F,AndListSeparator),N=>N['length']>=0x2)),([N,e,...l],Y)=>l['reduce']((I,f)=>({'value':{'operator':N,'operands':[toOperand(I,Y),toOperand(f,Y)]}}),e)),u=Any(Wrap({'left':'(','right':')'},F),PreCondition(()=>!symbolic,E),Node(All(PercentageNumberLiteral,Of,Lazy(()=>u)),([N,e],l)=>({'value':{'operator':'mul','operands':[toOperand({'value':N},l),toOperand(e,l)]}})),Node(PercentageNumberLiteral,([N])=>({'value':N,'isPercent':!![]})),Node(Lazy(()=>ElementValueExtractor),([N])=>({'value':N})),Node(Reference$1('number'),([N])=>({'value':N})),Node(Any(RationalNumberLiteral,NumericLiteral),([N])=>({'value':N}))),M=Node(All(u,Star(Node(All(w,u),([N,e])=>({'operator':N,'expression':e})))),reduceChainToOperation);return Node(All(M,Star(Node(All(R,M),([N,e])=>({'operator':N,'expression':e})))),reducePercentAwareChainToOperation);}),([F])=>isNumberOperation(F['value'])||!symbolic&&F['isPercent']===!![]),([F])=>F['value']);}),QuantitativeNumberExpression=Any(ArithmeticOperation({'symbolic':!![]}),Reference$1('number'),QuantitativeNumberLiteral),TimeIntervalExpression=Any(Node(NoBoundary(All(ArithmeticOperation({'symbolic':!![]}),Optional(All(Optional(IndefiniteArticle),TimeUnitLiteral)))),([R,w])=>multiplyByTimeUnit(R,w)),Node(NoBoundary(All(Reference$1('number'),Optional(TimeUnitLiteral))),([R,w])=>multiplyByTimeUnit(R,w)),TimeIntervalLiteral),AnyExpression$1=Any(ArithmeticOperation,Reference$1('any'),VerboseReference,StructureLiteral$1,PrimitiveLiteral),AnyVerboseExpression=Customizable((R={})=>{return Any(ArithmeticOperation,Reference$1('any'),VerboseReference,StructureLiteral$1,CardinalNumberLiteral,FractionalNumberLiteral,PrimitiveLiteral(R));}),FileHandleLiteral=Node(Mark(StringLiteral$1,{'type':'file'}),([R],w)=>{const F={'isFileHandle':!![],'filename':R};return w['collections']['files']['push'](F),F;}),FileFormatWord=Node(Text$2(Mark(/json|xml|csv|base64|(?:plain\s+)?text/i,{'type':'file\x20format'})),([R])=>R['toLowerCase']()['replace'](/^plain\s+/,'')),{Apply:Apply$31,Mutate:Mutate$31}=State({}),QualifiedFile=Apply$31(All(Optional(The),Optional(Mutate$31(FileFormatWord,(R,[w])=>R['format']=w)),File,Mutate$31(FileHandleLiteral,(R,[w])=>R['file']=w))),FileSourceLiteral=Node(All(Optional(The),Mark(/contents/i,{'type':'keyword'}),Of,QualifiedFile),([{file:R,format:w}])=>w?{'isFileSource':!![],'file':R,'format':w}:{'isFileSource':!![],'file':R}),IsWrapperOperator=R=>{return Node(All(Any(Node(/not|isn't|is\s+not|aren't|are\s+not|do(?:es)?n't|do(?:es)?\s+not|(?:can't|can\s+not)(\s+be)?|ha(?:ve|s)(?:n't|\s+not)\s+been/i,()=>![]),Node(/is|are|does|be|(?:to|can)(?:\s+be)?|(?:have|has)\s+been/i,()=>!![]),Nothing$1(!![])),R),([w,F])=>{return w?F:(...E)=>not(F(...E));});},IgnoreCase=Node(/case[\s-]?insensitive|(?:ignor(?:e|ing))\s+(?:cas(?:e|ing))/i,()=>ignoreCase),MatchCase=Node(/case[\s-]?sensitive|(?:match(?:ing)?|respect(?:ing)?)\s+(?:cas(?:e|ing))/i,()=>matchCase),ParensOperator=R=>{return Node(Wrap({'left':'(','right':')'},R),([w])=>parens(w));},BooleanOperator=Any(Node(/(?:,\s+)?(?:and|but)|,/i,()=>and),Node(/(?:,\s+)?or/i,()=>or)),IsOperator=Any(Node(/not|is(?:n't|\s+not)|are(?:n't|\s+not)|do(?:es)?(n't|\s+not)/,()=>(R,w)=>not(eq$1(R,w))),Node(/be|is|are|do(?:es)?/,()=>eq$1)),ComparisonOperator=Any(Node(/==?=?|equals?(?:\s+to)?|the\s+same\s+as|eq/i,()=>eq$1),Node(/!==?|different\s+(?:from|than)/i,()=>(R,w)=>not(eq$1(R,w))),Node(/>=|(?:greater|bigger|larger|more)\s+or\s+equals?\s(?:to|than)|gte/i,()=>gte$1),Node(/>|(?:greater|bigger|larger|more)\s+than|gt/i,()=>gt$1),Node(/<=|(?:lower|smaller|less)\s+or\s+equals?\s(?:to|than)|lte/i,()=>lte$1),Node(/<|(?:lower|smaller|less)\s+than|lt/i,()=>lt$1)),ValidateOperator=Node(Any(Node(Use(/(lower|upper|camel|pascal|snake|kebab)[\s-]?case/i),([R])=>R['toLowerCase']()+'case'),Node(/capitalized/i,()=>'capitalized'),Node(/(?:numeric|a\s+number)/i,()=>'numeric'),Node(/alpha-?numeric/i,()=>'alphanumeric')),([R])=>{return w=>validate$1(w,R);}),MatchOperator=Node(All(Optional(/match(?:es)?(?:(?:\s+the)?\s+(?:regexp?|rex|pattern|regular(?:-|\s+)expression))?/i),RegExpLiteral),([R])=>{return w=>match$1(w,R);}),SizeValidationOperator=Any(Node(/empty/i,()=>{return R=>eq$1({'isOperand':!![],'value':size(R)},{'isOperand':!![],'value':0x0});}),Node(/nonempty/i,()=>{return R=>gt$1({'isOperand':!![],'value':size(R)},{'isOperand':!![],'value':0x0});}),Node(All(/includes?|contains?|have|has/i,CardinalNumberExpression,Any(CollectionItems,CollectionPairs,CollectionValues,CollectionKeys)),([R])=>{return w=>gte$1({'isOperand':!![],'value':size(w)},{'isOperand':!![],'value':R});})),IncludesOnlyOperator=Node(All(/includes?|contains?|have|has/i,Only,Optional(Any(Node(All(Optional(The),CollectionValues),()=>values),Node(All(Optional(The),Any(All(CollectionKeys,Optional(/named|names?/i)),All(Any(CollectionItems,CollectionPairs),/named|names?/i))),()=>keys),Node(All(Optional(The),CollectionItems),()=>entries)))),([R])=>{return(w,F)=>includesOnly$1(R?{'isOperand':!![],'value':R(w)}:w,F);}),IncludesOperator=Node(All(/includes?|contains?|have|has/i,Optional(Any(Node(All(Optional(The),CollectionValues),()=>values),Node(All(Optional(The),Any(All(CollectionKeys,Optional(/named|names?/i)),All(Any(CollectionItems,CollectionPairs),/named|names?/i))),()=>keys),Node(All(Optional(The),CollectionItems),()=>entries)))),([R])=>{return(w,F)=>includes$1(R?{'isOperand':!![],'value':R(w)}:w,F);}),StartsWithOperator=Node(/starts?\s+with/i,()=>startsWith$1),EndsWithOperator=Node(/ends?\s+with/i,()=>endsWith$1),VisibleOperator=Node(All(/visible|shown|shows?(?:\s+up)?|appears?|apparent|displayed/i,Optional(Anchor$3({'Element':Element$2}))),([R])=>{if(R)return w=>{const F=w['value'];return visible$1({'isOperand':!![],'value':{...F,'anchor':F['anchor']?[F['anchor'],R]['flat']():R}});};else return visible$1;}),InvisibleOperator=Node(All(/invisible|hidden|disappear/i,Optional(Anchor$3({'Element':Element$2}))),()=>R=>not(visible$1(R))),ClickableOperator=Node(/clickable|clicked/i,()=>clickable$1),EnabledOperator=Node(/enabled/i,()=>enabled$1),DisabledOperator=Node(/disabled/i,()=>R=>not(enabled$1(R))),CheckedOperator=Node(/checked|ticked/i,()=>R=>checked$1(R,!![])),UncheckedOperator=Node(/unchecked|unselected|unticked/i,()=>R=>checked$1(R,![])),PopulatedOperator=Node(/populated|entered|set|filled(?:\s+in)?|(?:have|has)(?:\s+an?)?\s+value|holds?\s+input/i,()=>R=>populated$1(R)),NotPopulatedOperator=Node(Any(/unfilled/i,/unset/i,/blank/i),()=>R=>not(populated$1(R))),HoveredOperator=Node(Any(/hovered/i,All(/has\s+hover/i,CSSPseudoClass,/applied|active/i),All(Optional(ConditionPreposition),/hover(?:\s+state)?/i)),()=>hovered$1),HoveredReversedOperator=All(/hover/i,CSSPseudoClass,IsWrapperOperator(Node(/applied|active/i,()=>hovered$1)),LocationPreposition),SelectedOperator=Node(All(/selected/i,StoragePreposition),()=>eq$1),BetweenOperator=Node(All(/between/i,CardinalNumberExpression,And,CardinalNumberExpression),([R,w])=>{return F=>and(gte$1(F,{'isOperand':!![],'value':R}),lte$1(F,{'isOperand':!![],'value':w}));}),IterationOperator=Any(Node(/(?:every|each|all)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'every'})),Node(/(?:some|any)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'some'})),Node(/(?:none|no)(?:\s+of)?(?:\s+the)?/i,()=>({'type':'none'})),Node(All(/at\s+least/i,CardinalNumberExpression,Optional(Of),Optional(The)),([R])=>({'type':'some','min':R}))),UnaryOperator=IsWrapperOperator(Any(BetweenOperator,MatchOperator,ValidateOperator,SizeValidationOperator)),BinaryOperator=Any(IsWrapperOperator(Any(ComparisonOperator,IncludesOnlyOperator,IncludesOperator,StartsWithOperator,EndsWithOperator)),IsOperator),ElementUnaryOperator=IsWrapperOperator(Any(VisibleOperator,InvisibleOperator,CheckedOperator,UncheckedOperator,ClickableOperator,EnabledOperator,DisabledOperator,HoveredOperator,PopulatedOperator,NotPopulatedOperator)),FileUnaryOperator=IsWrapperOperator(Node(/exists?|present/i,()=>R=>fileExists$1(R))),ElementReversedUnaryOperator=Any(HoveredReversedOperator),ElementBinaryOperator=IsWrapperOperator(Any(SelectedOperator)),OperationExpression=Any(PreCondition(R=>R['context']['has']('element'),Node(All(Its,Optional(Any(Value$6,String$1)),Length),(R,w)=>size({'isOperand':!![],'value':w['context']['element']}))),Node(All(Optional(The),Length,Of,Any(ElementValueExtractor,Reference$1('any'),VerboseReference,StructureLiteral$1,Element$2)),([R])=>size({'isOperand':!![],'value':R})),Node(All(Element$2({'explicit':!![]}),Optional(Any(Value$6,String$1)),Length),([R])=>size({'isOperand':!![],'value':R}))),ConditionOperation=Recursive(R=>{const {Masker:w,Maskable:F,mask:E}=Mask(),u=Effect(Use(Secret$2),(Z,O)=>E(O)),M=Z=>{return LogGroup('Operand',Node(Mark(F(Z),{'type':'operand'}),([O],p)=>{const J={'isOperand':!![],'value':O};return p['collections']['operands']['push'](J),J;}));},N=M(AnyVerboseExpression({'weak':!![]})),e=M(PreCondition(Z=>Z['context']['has']('clipboard'),Mark(Node(Any(It,Them),(Z,O)=>O['context']['clipboard']),{'type':'reference'}))),l=M(VerboseReference),Y=M(Effect(ElementValueExtractor,([Z],O)=>Z['operands'][0x0]['value']['secret']&&E(O))),I=M(Effect(Element$2({'explicit':!![],'reference':![]}),([Z],O)=>!('isElementReference'in Z)&&Z['secret']&&E(O))),f=M(OperationExpression),t=M(ArithmeticOperation),W=M(Any(VerboseReference,Reference$1('any'),StructureLiteral$1)),i=M(PreCondition(Z=>Z['collections']['bindings']['length']>0x0,Node(Optional(Any(It,Them)),(Z,O)=>({...O['collections']['bindings']['at'](-0x1)['reference']})))),K=Any(f,t,All(Optional(u),Y),l,I,e,All(Optional(u),N),i),s=M(Node(QualifiedFile,([{file:Z}])=>Z)),Q=M(Any(Effect(Element$2,([Z],O)=>!('isElementReference'in Z)&&Z['secret']&&E(O)),Dialog,PreCondition(Z=>Z['collections']['bindings']['length']>0x0,Node(Optional(Any(It,Them)),(Z,O)=>({'reference':{...O['collections']['bindings']['at'](-0x1)['reference']}}))))),k=Node(All(K,Optional(Any(IgnoreCase,MatchCase))),([Z,O])=>{return{'operand':Z,'wrapper':O};}),S=Any(Node(UnaryOperator,([Z])=>({'operator':Z})),Node(All(BinaryOperator,K,Optional(Any(IgnoreCase,MatchCase))),([Z,O,p])=>{return{'operator':J=>p?.(Z(J,O))??Z(J,O)};})),a=Node(R,([Z])=>{return{'operation':Z};}),T=Node(All(Any(All(s,FileUnaryOperator),All(Q,ElementUnaryOperator),All(K,UnaryOperator)),Any(IgnoreCase,MatchCase,Nothing$1(Z=>Z)),Star(Node(All(BooleanOperator,Any(a,S)),([Z,O])=>{return{'connector':Z,'addition':O};}))),([Z,O,p,...J])=>{return J['reduce']((C,{connector:P,addition:h})=>{return P(C,'operator'in h?h['operator'](Z):h['operation']);},p(O(Z)));}),H=Node(All(All(ElementReversedUnaryOperator,Q),Star(Node(All(BooleanOperator,a),([Z,O])=>{return{'connector':Z,'addition':O};}))),([Z,O,...p])=>{return p['reduce']((J,{connector:C,addition:P})=>{return C(J,P['operation']);},Z(O));}),A=Node(All(Any(All(Q,ElementBinaryOperator),All(K,BinaryOperator)),K,Any(IgnoreCase,MatchCase,Nothing$1(Z=>Z)),Star(Any(Node(All(BooleanOperator,Any(a,S)),([Z,O])=>{return{'connector':Z,'addition':O};}),NonEmpty(Weak(Node(All(BooleanOperator,k),([Z,O])=>{return{'connector':Z,'addition':O};})))))),([Z,O,p,J,...C])=>{return C['reduce']((P,{connector:h,addition:q})=>{if('operand'in q){if(P['operator']==='includes\x20only')return P['operands']['push'](q['operand']),P;else return h(P,O(Z,q['operand']));}else{if('operator'in q)return h(P,q['operator'](Z));else return h(P,q['operation']);}},J(O(Z,p)));}),D=Any(Node(All(Mark(All(Optional(For),IterationOperator),{'type':'keyword'}),Effect(All(Mark(Identifier$1,{'type':'binding\x20name'}),MembershipPreposition,W),([Z],O)=>{O['collections']['bindings']['push']({'reference':{'isRef':!![],'name':Z,'binding':!![]},'names':[...bindingsOf$1(Z),'it','index','key']['map'](p=>p['toLowerCase']())});}),Optional(BlockSeparator),Optional(Any(That,Then$1)),R),([Z,O,p,J],C)=>{C['collections']['bindings']['pop']();const P={'isOperand':!![],'value':map(p,J,bindingsOf$1(O))},h=Z['type']==='every'?every(P):some(P,Z['min']);return Z['type']==='none'?not(h):h;}),H,T,A);return Node(Mark(w(All(Any(ParensOperator(D),D),Star(Node(All(BooleanOperator,Any(ParensOperator(D),D)),([Z,O])=>{return p=>Z(p,O);})))),{'type':'operation'}),([Z,...O])=>{return O['reduce']((p,J)=>J(p),Z);});}),Condition$2=Node(ConditionOperation,([R])=>({'isCondition':!![],'operation':R})),NegativeCondition$1=Node(ConditionOperation,([R])=>({'isCondition':!![],'operation':not(R)}));function parens(R){return{'operator':'parens','operands':[R]};}function ignoreCase(R){return{'operator':'ignore\x20case','operands':[R]};}function matchCase(R){return{'operator':'match\x20case','operands':[R]};}function not(R){return{'operator':'not','operands':[R]};}function and(R,w){return{'operator':'and','operands':[R,w]};}function or(R,w){return{'operator':'or','operands':[R,w]};}function eq$1(R,w){return{'operator':'eq','operands':[R,w]};}function gte$1(R,w){return{'operator':'gte','operands':[R,w]};}function gt$1(R,w){return{'operator':'gt','operands':[R,w]};}function lte$1(R,w){return{'operator':'lte','operands':[R,w]};}function lt$1(R,w){return{'operator':'lt','operands':[R,w]};}function validate$1(R,w){return{'operator':'validate','operands':[R,w]};}function size(R){return{'operator':'size','operands':[R]};}function map(R,w,F){return{'operator':'map','operands':[R,w],...F?.['length']?{'bindings':F}:{}};}function every(R){return{'operator':'every','operands':[R]};}function some(R,w){return{'operator':'some','operands':[R],...w!=null?{'min':w}:{}};}function bindingsOf$1(R){const w=singularize(R);return w?[R,w]:[R];}function keys(R){return{'operator':'keys','operands':[R]};}function values(R){return{'operator':'values','operands':[R]};}function entries(R){return{'operator':'entries','operands':[R]};}function match$1(R,w){return{'operator':'match','operands':[R,w]};}function includesOnly$1(R,w,...F){return{'operator':'includes\x20only','operands':[R,w,...F]};}function includes$1(R,w){return{'operator':'includes','operands':[R,w]};}function startsWith$1(R,w){return{'operator':'starts\x20with','operands':[R,w]};}function endsWith$1(R,w){return{'operator':'ends\x20with','operands':[R,w]};}function visible$1(R){return{'operator':'visible','operands':[R]};}function clickable$1(R){return{'operator':'clickable','operands':[R]};}function enabled$1(R){return{'operator':'enabled','operands':[R]};}function hovered$1(R){return{'operator':'hovered','operands':[R]};}function checked$1(R,w){return{'operator':'checked','operands':[R,w]};}function populated$1(R){return{'operator':'populated','operands':[R]};}function fileExists$1(R){return{'operator':'file\x20exists','operands':[R]};}const {Apply:Apply$30,Mutate:Mutate$30}=State({'isChromeElementDescriptor':!![]}),ButtonTitle=Mutate$30(Any(Mutate$30(Stringish(/(?:click\s+to\s+)?(?:go\s+)?(?:back|(?:to\s+)?(?:the\s+)?prev(?:ious)?(?:\s+page)?)|<-|</i),R=>R['title']='back'),Mutate$30(Stringish(/(?:click\s+to\s+)?(?:go\s+)?(?:fwd|forward|(?:to\s+)?(?:the\s+)?next(?:\s+page)?)|->|>/i),R=>R['title']='forward'),Mutate$30(Stringish(/(?:reload|refresh)(?:\s+(?:(?:(?:(?:this|the)\s+)?page)|this))?/i),R=>R['title']='refresh')),R=>R['type']='button'),TextboxTitle=Mutate$30(Stringish(/search|address|url/i),R=>(R['type']='textbox',R['title']='url')),TabTitle=Mutate$30(StringExpression$1,(R,[w])=>(R['type']='tab',R['title']=w)),TabOrdinalIndex=Mutate$30(Index(OrdinalNumberExpression$1),(R,[w])=>(R['type']='tab',R['index']=w)),TabCardinalIndex=Mutate$30(All(Any(With,At),Optional(The),Index$1,Optional(NumberSign),IntegerNumberExpression),(R,[w])=>(R['type']='tab',R['index']=w)),TabPosition=R=>Mutate$30(SequentialRelativePosition(R),(w,[{position:F}])=>(w['type']='tab',w['position']=F)),Tab=Any(TabPosition(Tab$1),All(TabOrdinalIndex,Tab$1),All(Tab$1,TabCardinalIndex),All(Tab$1,Optional(Named),TabTitle),All(TabTitle,Tab$1)),ChromeButton=Apply$30(All(Optional(The),Optional(BrowserToolbar),ButtonTitle,Optional(Button))),ExplicitChromeButton=Apply$30(Any(All(Optional(The),BrowserToolbar,ButtonTitle,Optional(Button)),All(Optional(The),ButtonTitle,Optional(Button),Inside,Optional(The),BrowserToolbar))),ChromeTextbox=Apply$30(All(Optional(The),Optional(BrowserToolbar),TextboxTitle,Optional(Textbox))),ExplicitChromeTextbox=Apply$30(Any(All(Optional(The),BrowserToolbar,TextboxTitle,Optional(Textbox)),All(Optional(The),TextboxTitle,Optional(Textbox),Inside,Optional(The),BrowserToolbar))),ExplicitChromeTabList=Node(All(Optional(The),Any(BrowserTabList,All(BrowserToolbar,TabList))),()=>({'isChromeElementDescriptor':!![],'type':'tablist'})),ChromeTab=Apply$30(All(Optional(The),Tab)),ExplicitChromeTab=Apply$30(All(Optional(The),Any(All(Possessive(BrowserTabList),Tab),All(Tab,Inside,ExplicitChromeTabList),TabPosition(BrowserTab),All(TabOrdinalIndex,BrowserTab),All(BrowserTab,TabCardinalIndex),All(BrowserTab,Optional(Named),TabTitle),All(Possessive(Browser$1),Any(TabPosition(Tab$1),All(TabOrdinalIndex,Tab$1),All(TabTitle,Tab$1))),All(TabTitle,BrowserTab)))),ActiveChromeTab=Apply$30(All(Optional(The),Optional(Any(Current,Active)),Mutate$30(BrowserTab,R=>R['type']='tab'))),{Apply:Apply$29,Mutate:Mutate$29,state:state$2}=State({'secret':![]}),Secret$1=Mutate$29(Article(Secret$2),R=>R['secret']=!![]),Name$2=Mutate$29(Mark(StringExpression$1({'escape':/[:]/}),{'type':'header\x20name'}),(R,[w])=>R['name']=w),StringValue$2=Mutate$29(Mark(StringExpression$1,{'type':'header\x20value'}),(R,[w])=>R['value']=w),DoubleQuotedValue=Mutate$29(Mark(UnquotedStringExpression({'char':/./,'escape':/["]/}),{'type':'header\x20value'}),(R,[w])=>R['value']=w),SingleQuotedValue=Mutate$29(Mark(UnquotedStringExpression({'char':/./,'escape':/[']/}),{'type':'header\x20value'}),(R,[w])=>R['value']=w),Maskable$2=R=>Dynamic(w=>state$2(w)['secret']?Mark(R,{'type':'secret'}):R),HttpHeader=Apply$29(All(Optional(The),Optional(Any(All(Secret$1,Optional(Article(Custom))),All(Article(Custom),Optional(Secret$1)))),HttpHeader$1,Any(All(Optional(Any(Named,Name$3)),Name$2,And,Optional(AssociationPreposition),Optional(HttpHeader$1),Optional(Secret$1),Value$6,Maskable$2(StringValue$2)),All(Name$2,':',Maskable$2(StringValue$2)),DoubleQuoted$1(All(Name$2,':',Maskable$2(DoubleQuotedValue))),SingleQuoted$1(All(Name$2,':',Maskable$2(SingleQuotedValue)))))),OTPLiteral=Node(All(Mark(All(Optional(IndefiniteArticle),Optional(Generated),OTP$1),{'type':'otp'}),For,Optional(The),Optional(User),Mark(StringExpression$1,{'type':'user'})),([R])=>({'isOTP':!![],'user':R})),Description$1=As$1(Anything$1,StandaloneStringExpression),RandomValueLiteral=Node(Mark(All(Optional(IndefiniteArticle),Optional(Random),Description$1),{'type':'random\x20value'}),([R],w)=>{const F={'isRandomValue':!![],'description':R};return w['collections']['randomValues']['push'](F),F;}),GrabAction=Mark(Continuous(/grab/i,/grabbing/i),{'type':'actionword'}),Clip=R=>Effect(R,([w],F)=>{if(typeof w==='object'&&w&&'isRef'in w)F['context']['reference']=w;F['context']['clipboard']=w;}),Grab=LogGroup('Grab',Void(All(GrabAction,Any(Clip(ElementValueExtractor),Longest(Clip(AnyExpression$1),ExplicitElement))))),{Apply:Apply$28,Mutate:Mutate$28}=State({'type':'set\x20variable','data':{'value':null},'names':[]}),SetVariableAction=Mark(Continuous(/set|assign|define/i,/setting|assigning|defining/i),{'type':'actionword'}),StoreValueAction=Mark(Continuous(/set|assign|remember|memorize|store|save/i,/setting|assigning|remembering|memorizing|storing|saving/i),{'type':'actionword'}),{Masker:Masker$1,Maskable:Maskable$1,mask:mask$1}=Mask(),SetOperator='=',Name$1=R=>Mutate$28(Effect(Mark(R,{'type':'variable\x20name'}),([w],F,E)=>{if(isReservedName(w))F['collections']['errors']['push']({'type':'ReservedVariableNameError','pos':E['pos'],'text':F['text']['slice'](E['pos'],F['pos']),'message':w+'\x20is\x20a\x20reserved\x20variable\x20which\x20cannot\x20be\x20set'});else{if(isSecretName(w))mask$1(F);}}),(w,[F])=>{const E={'name':F};if(isSecretName(F))E['secret']=!![];w['names']['push'](E);}),NamesList=R=>Mutate$28(List(R,AndListSeparator),(w,F)=>{if(F['length']>0x1)w['destruction']=!![];}),StringishName=Name$1(Any(Quoted$1(MultiWordIdentifier),Identifier$1,Fix(Wrap({'left':'{','right':'}'},MultiWordIdentifier),(R,[w])=>'\x22'+w+'\x22'))),StandaloneName=Name$1(Any(Identifier$1,Fix(Wrap({'left':'{','right':'}'},Identifier$1),(R,[w])=>w))),Value$3=R=>Mutate$28(Mark(Maskable$1(R),{'type':'variable\x20value'}),(w,[F])=>w['data']['value']=F),DataValue=Value$3(AnyExpression$1),ExtractorValue=Value$3(Any(ElementValueExtractor,Node(Element$2({'explicit':!![]}),([R])=>({'operator':'extract','operands':[{'isOperand':!![],'value':R},'string']})))),OTPValue$1=Mutate$28(Value$3(OTPLiteral),R=>R['data']['secret']=!![]),ClipboardValue$1=Value$3(Mark(Any(PreCondition(R=>R['context']['has']('clipboard'),Node(Any(It,Them),(R,w)=>w['context']['clipboard'])),PreCondition(R=>R['context']['has']('element'),Node(Any(It,All(Its,Value$6)),(R,w)=>({'operator':'extract','operands':[{'isOperand':!![],'value':w['context']['element']},'string']})))),{'type':'reference'})),LengthValue=Value$3(OperationExpression),SomeValue$1=Any(OTPValue$1,Value$3(FileSourceLiteral),LengthValue,ClipboardValue$1,Longest(DataValue,ExtractorValue)),AnyValue=Any(Mutate$28(Effect(Any(All(Article(Secret$2),SomeValue$1),All(SomeValue$1,Article(Secret$2))),(R,w)=>mask$1(w)),(R,w)=>R['data']['secret']=!![]),SomeValue$1),SetVariable=LogGroup('SetVariable',Effect(Apply$28(Masker$1(Any(All(StoreValueAction,AnyValue,As,Article(Value$6),Of,Optional(Article(Variables)),NamesList(StringishName)),All(StoreValueAction,AnyValue,StoragePreposition,Optional(The),Variables,NamesList(StringishName)),All(SetVariableAction,Optional(Article(Variables)),NamesList(StringishName),Any(AssignmentPreposition,SetOperator),Optional(Article(Value$6)),AnyValue),All(StoreValueAction,AnyValue,StoragePreposition,NamesList(StringishName)),All(NamesList(StandaloneName),SetOperator,AnyValue)))),([R],w)=>{if(R['destruction']&&R['data']['value']&&typeof R['data']['value']==='object'&&'isRef'in R['data']['value']&&R['data']['value']['name']==='random\x20value'&&R['data']['value']['scope']==='internal'){const F=w['collections']['randomValues']['at'](-0x1);F['properties']=R['names']['map'](({name:E})=>E);}if(R['destruction'])w['collections']['variables']['push'](...R['names']['map'](({name:E})=>({'name':E})));else w['collections']['variables']['push'](...R['names']['map'](({name:E})=>({'name':E,'value':R['data']['value']})));})),{Apply:Apply$27,Mutate:Mutate$27}=State({'type':'set\x20variable','data':{},'scope':'internal'}),SetTimeoutAction=Mark(Continuous(/set|assign|define/i,/setting|assigning|defining/i),{'type':'actionword'}),ImplicitlyWaitAction=Mark(Continuous(/(?:implicitly)?\s+wait|wait\s+(?:implicitly)?/i,/(?:implicitly)?\s+waiting|waiting\s+(?:implicitly)?/i),{'type':'actionword'}),TimeoutName=Any(Mutate$27(/(?:(?:browser|url)\s+)?nav(?:igation)?s?/i,R=>R['names']=[{'name':'navigateTimeout'}]),Mutate$27(/elements?(?:\s+(?:finding|locating))?|(?:finding|locating)\s+elements?/i,R=>R['names']=[{'name':'findTimeout'}]),Mutate$27(/(?:(?:taking|capturing)\s+)?(?:screenshots?|screen\s+captures?)/i,R=>R['names']=[{'name':'screenshotTimeout'}]),Mutate$27(/(?:(?:taking|capturing)\s+)?preview\s+(?:screenshots?|screen\s+captures?)/i,R=>R['names']=[{'name':'previewTimeout'}])),TimeoutDefaultName=Mutate$27(Nothing$1,R=>R['names']=[{'name':'timeout'}]),Value$2=Mutate$27(TimeIntervalExpression,(R,[w])=>R['data']['value']=w),SetTimeout=LogGroup('SetTimeout',Apply$27(Any(All(SetTimeoutAction,Optional(The),Optional(Implicit),Wait$2,Optional(Time),TemporalPreposition,TimeoutName,Optional(EquivalencePreposition),Value$2),All(SetTimeoutAction,Optional(The),Optional(Implicit),Any(TimeoutName,TimeoutDefaultName),Wait$2,Optional(Time),Optional(EquivalencePreposition),Value$2),All(ImplicitlyWaitAction,Maximum,Value$2,TemporalPreposition,TimeoutName),All(ImplicitlyWaitAction,Any(All(TemporalPreposition,TimeoutName),TimeoutDefaultName),Maximum,Value$2)))),{Apply:Apply$26,Mutate:Mutate$26,state:state$1}=State({'type':'set\x20value'}),SetValueAction=Mark(Continuous(/set/i,/setting/i),{'type':'actionword'}),SelectValueAction=Mutate$26(Mark(Continuous(/select|pick|choose/i,/selecting|picking|choosing/i),{'type':'actionword'}),R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'selectbox'}})),RandomlySelectAction=Mutate$26(Mark(Continuous(/randomly\s+(?:select|pick|choose)/i,/randomly\s+(?:selecting|picking|choosing)/i),{'type':'actionword'}),R=>{R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'selectbox'}}),R['value']={'isRandomValue':!![],'type':'number'};}),AttachAction=Mutate$26(Any(Mark(Continuous(/attach|upload/i,/attaching|uploading/i),{'type':'actionword'}),All(Mark(Continuous(/add|import/i,/adding|importing/i),{'type':'actionword'}),File)),R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'filepicker'}})),StringValue$1=Mutate$26(StringExpression$1,(R,[w])=>R['value']=w),StringReferenceValue=Mutate$26(Reference$1('string'),(R,[w])=>R['value']=w),FileHandleValue=Mutate$26(FileHandleLiteral,(R,[w])=>R['value']=w),OrdinalIndex$1=Mutate$26(Index(OrdinalNumberExpression$1),(R,[w])=>R['value']=w),CardinalIndex=Mutate$26(All(Optional(NumberSign),Index(CardinalNumberExpression)),(R,[w])=>R['value']=w),RandomIndex=Mutate$26(Random,R=>R['value']={'isRandomValue':!![],'type':'number'}),SelectboxHint=Mutate$26(SelectboxOption,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'selectbox'}})),FileHint=Mutate$26(File,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'filepicker'}})),Hint=Any(Mutate$26(Color$2,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'colorpicker'}})),Mutate$26(DateTime,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'datetimepicker'}})),Mutate$26(Date$1,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'datepicker'}})),Mutate$26(Time,R=>R['element']=mergeElementDescriptors(R['element']??{},{'hints':{'type':'timepicker'}}))),InputElement=Mutate$26(Element$2,(R,[w])=>R['element']=mergeElementDescriptors(R['element']??{},w)),StringInput=Mutate$26(StringElement,(R,[w])=>R['element']=mergeElementDescriptors(R['element']??{},w)),SetValue=LogGroup('SetValue',Apply$26(Any(All(SetValueAction,InputElement,Value$6,Optional(AssignmentPreposition),StringValue$1),All(Any(SetValueAction,SelectValueAction),Any(All(Article(Any(All(StringReferenceValue,Optional(RelationalPreposition)),OrdinalIndex$1,RandomIndex)),Any(All(SelectboxHint,Optional(RelationalPreposition),InputElement),All(StringInput,SelectboxHint),All(InputElement,Optional(SelectboxHint)))),All(Article(Any(All(Hint,StringValue$1),All(FileHint,Optional(Named),FileHandleValue),All(FileHandleValue,FileHint),All(SelectboxHint,Any(CardinalIndex,StringValue$1)),All(CardinalIndex,SelectboxHint),All(StringValue$1,Any(Hint,SelectboxHint)))),Dynamic(R=>{const w=All(Optional(Any(StoragePreposition,RelationalPreposition)),InputElement);return state$1(R)['element']?Optional(w):w;})),All(StringValue$1,Any(StoragePreposition,RelationalPreposition),InputElement))),All(RandomlySelectAction,Any(All(Optional(All(Optional(IndefiniteArticle),SelectboxHint)),Optional(RelationalPreposition),InputElement),All(Optional(RelationalPreposition),InputElement,Optional(SelectboxHint)))),All(AttachAction,Article(Any(All(FileHint,Optional(Named),FileHandleValue),All(FileHandleValue,Optional(FileHint)))),Optional(All(Optional(Any(StoragePreposition,RelationalPreposition)),InputElement)))))),{Apply:Apply$25,Mutate:Mutate$25}=State({'type':'set\x20variable','data':{},'scope':'internal'}),GenerateAction=Mark(Continuous(/generate/i,/generating/i),{'type':'actionword'}),RandomlyGenerateAction=Mark(Continuous(/randomly\s+generate/i,/randomly\s+generating/i),{'type':'actionword'}),OTP=Mutate$25(OTPLiteral,(R,[w])=>{R['names']=[{'name':'otp'}],R['data']['value']=w,R['data']['secret']=!![];}),RandomValue=Mutate$25(RandomValueLiteral,(R,[w])=>{R['names']=[{'name':'random\x20value'}],R['data']['value']=w;}),Generate=LogGroup('Generate',Effect(Apply$25(Any(All(GenerateAction,Any(OTP,RandomValue)),All(RandomlyGenerateAction,RandomValue))),([R],w)=>w['context']['clipboard']={'isRef':!![],'name':R['names']?.[0x0]?.['name'],'scope':R['scope']})),{Apply:Apply$24,Mutate:Mutate$24}=State({'type':'set\x20variable','data':{},'names':[{'name':'file'}],'scope':'internal'}),ReadAction=Mark(Continuous(/read|load/i,/reading|loading/i),{'type':'actionword'}),Secret=Mutate$24(Mark(Secret$2,{'type':'keyword'}),R=>R['data']['secret']=!![]),Source=Mutate$24(QualifiedFile,(R,[{file:w,format:F}])=>{const E={'isFileSource':!![],'file':w};if(F)E['format']=F;if(R['data']['secret'])E['secret']=!![];R['data']['value']=E;}),ReadFile=LogGroup('ReadFile',Effect(Apply$24(All(ReadAction,Optional(The),Optional(Secret),Source)),([R],w)=>w['context']['clipboard']={'isRef':!![],'name':R['names']?.[0x0]?.['name'],'scope':R['scope']})),{Apply:Apply$23,Mutate:Mutate$23}=State({'type':'write\x20file'}),WriteAction=Mark(Continuous(/write|save/i,/writing|saving/i),{'type':'actionword'}),AppendAction=Mark(Continuous(/append/i,/appending/i),{'type':'actionword'}),{Masker,Maskable,mask}=Mask(),SomeValue=Mutate$23(Mark(Maskable(Longest(AnyExpression$1,ElementValueExtractor)),{'type':'variable\x20value'}),(R,[w])=>R['data']=w),Value$1=Any(Mutate$23(Effect(All(Article(Secret$2),SomeValue),(R,w)=>mask(w)),R=>R['secret']=!![]),SomeValue),Target$2=Mutate$23(QualifiedFile,(R,[{file:w,format:F}])=>{R['file']=w;if(F)R['format']=F;}),WriteFile=LogGroup('WriteFile',Apply$23(Masker(Any(All(WriteAction,Value$1,To,Target$2),All(Mutate$23(AppendAction,R=>R['append']=!![]),Value$1,To,Target$2))))),RemoveFileAction=Mark(Continuous(/remove|delete/i,/removing|deleting/i),{'type':'actionword'}),RemoveFile=LogGroup('RemoveFile',State({'type':'remove\x20file'},({Mutate:R})=>All(RemoveFileAction,Optional(The),File,R(FileHandleLiteral,(w,[F])=>w['file']=F)))),Assert=LogGroup('Assert',Node(All(Mark(Continuous(/assert|check|validate|verify|make\s+sure/i,/asserting|checking|validating|verifying|making\s+sure/i),{'type':'actionword'}),Optional(That),Condition$2),([R])=>({'type':'assert','condition':R}))),{Apply:Apply$22,Mutate:Mutate$22}=State({'type':'fetch'}),FetchAction$1=Mark(Continuous(/send/i,/sending/i),{'type':'actionword'}),Url$2=Mutate$22(Mark(Url$3,{'type':'fetch\x20url'}),(R,[w])=>R['url']=w),Endpoint=All(Optional(Any(From,To)),Optional(The),Optional(Endpoint$1),Url$2),ExplicitEndpoint=All(Any(All(Any(From,To),Optional(The),Optional(Endpoint$1)),All(Optional(Any(From,To)),The,Optional(Endpoint$1)),All(Optional(Any(From,To)),Optional(The),Endpoint$1)),Url$2),Method$2=Mark(Mutate$22(Use(/(get|post|put|patch|head|options|trace|delete|connect)/i),(R,[w])=>R['method']=w['toLowerCase']()),{'type':'fetch\x20option','subtype':'method'}),Auth$1=Mutate$22(State({'type':'basic'},({Mutate:R})=>{const w=R(Mark(StringExpression$1({'escape':/[:]/}),{'type':'username'}),(e,[l])=>e['username']=l),F=R(Mark(UnquotedStringExpression({'char':/./,'escape':/[":]/}),{'type':'username'}),(e,[l])=>e['username']=l),E=R(Mark(UnquotedStringExpression({'char':/./,'escape':/[':]/}),{'type':'username'}),(e,[l])=>e['username']=l),u=R(Mark(Mark(StringExpression$1,{'type':'password'}),{'type':'secret'}),(e,[l])=>e['password']=l),M=R(Mark(Mark(UnquotedStringExpression({'char':/./,'escape':/[":]/}),{'type':'password'}),{'type':'secret'}),(e,[l])=>e['password']=l),N=R(Mark(Mark(UnquotedStringExpression({'char':/./,'escape':/[':]/}),{'type':'password'}),{'type':'secret'}),(e,[l])=>e['password']=l);return Mark(All(Optional(Any(As,With)),Optional(The),Mark(Any(User,BasicAuth$1),{'type':'auth\x20type'}),Any(All(w,':',u),DoubleQuoted$1(All(F,':',M)),SingleQuoted$1(All(E,':',N)))),{'type':'fetch\x20option','subtype':'auth'});}),(R,[w])=>R['auth']=w),Cookie$1=Mutate$22(State({'secret':![]},({Mutate:R,state:w})=>{const F=R(Article(Secret$2),I=>I['secret']=!![]),E=R(Mark(StringExpression$1({'escape':/[=]/}),{'type':'cookie\x20name'}),(I,[f])=>I['name']=f),u=R(Mark(UnquotedStringExpression({'char':/./,'escape':/["=]/}),{'type':'cookie\x20name'}),(I,[f])=>I['name']=f),M=R(Mark(UnquotedStringExpression({'char':/./,'escape':/['=]/}),{'type':'cookie\x20name'}),(I,[f])=>I['name']=f),N=R(Mark(StringExpression$1,{'type':'cookie\x20value'}),(I,[f])=>I['value']=f),e=R(Mark(UnquotedStringExpression({'char':/./,'escape':/["]/}),{'type':'cookie\x20value'}),(I,[f])=>I['value']=f),l=R(Mark(UnquotedStringExpression({'char':/./,'escape':/[']/}),{'type':'cookie\x20value'}),(I,[f])=>I['value']=f),Y=I=>Dynamic(f=>w(f)['secret']?Mark(I,{'type':'secret'}):I);return Mark(All(Optional(With),Optional(The),Optional(F),HttpCookie,Any(All(Optional(Any(Named,Name$3)),E,And,Optional(AssociationPreposition),Optional(HttpCookie),Optional(F),Value$6,Y(N)),All(E,'=',Y(N)),DoubleQuoted$1(All(u,'=',Y(e))),SingleQuoted$1(All(M,'=',Y(l))))),{'type':'fetch\x20option','subtype':'cookie'});}),(R,[w])=>(R['cookies']??=[])['push'](w)),Headers$3=List(Any(Auth$1,Mutate$22(Mark(All(Optional(With),HttpHeader),{'type':'fetch\x20option','subtype':'header'}),(R,[w])=>(R['headers']??=[])['push'](w)),Cookie$1),Optional(AndListSeparator)),BodyType=Mark(Mutate$22(Use(/(json|xml|csv|base64)/i),(R,[w])=>(R['body']??={'data':null})['type']=w['toLowerCase']()),{'type':'body\x20type'}),BodyData=Mark(Mutate$22(AnyExpression$1,(R,[w])=>(R['body']??={'data':null})['data']=w),{'type':'body\x20data'}),Body$2=Mark(All(Optional(With),Optional(BodyType),Optional(HttpBody),BodyData),{'type':'fetch\x20option','subtype':'body'}),StatusCodes$1=Mark(Mutate$22(Any(/any/i,List(Use(/([1-5]\d\d)/),Optional(OrListSeparator))),(R,w)=>R['statuses']=w['length']>0x0?w['map'](F=>Number['parseInt'](F)):'*'),{'type':'status\x20codes'}),Statuses$1=Mark(All(Optional(AndListSeparator),Any(Expect,Expecting),Any(All(Optional(The),HttpStatusCodes,Optional(':'),StatusCodes$1),All(StatusCodes$1,HttpStatusCodes))),{'type':'fetch\x20option','subtype':'statuses'}),Fetch=LogGroup('Fetch',Effect(Apply$22(All(Any(All(FetchAction$1,Method$2,Optional(Http)),All(FetchAction$1,Optional(IndefiniteArticle),Optional(Http),Optional(Method$2)),All(Optional(Http),Method$2)),Optional(Request$1),Any(All(Any(All(Headers$3,Optional(All(Optional(AndListSeparator),NonEmpty(Weak(Body$2))))),NonEmpty(Weak(Body$2))),Optional(All(Optional(AndListSeparator),Headers$3)),ExplicitEndpoint,Optional(Headers$3)),All(Optional(Headers$3),Endpoint,Optional(Any(All(Headers$3,Optional(All(Optional(AndListSeparator),NonEmpty(Weak(Body$2))))),NonEmpty(Weak(Body$2)))),Optional(All(Optional(AndListSeparator),Headers$3)))),Optional(Statuses$1))),([R],w)=>{w['collections']['fetches']['push'](R),w['collections']['variables']['push']({'name':'response'}),w['context']['clipboard']={'isRef':!![],'name':'response'};})),Evaluate=LogGroup('Evaluate',Effect(Node(All(Mark(Continuous(/evaluate|execute|run/i,/evaluating|executing|running/i),{'type':'actionword'}),Optional(The),JavaScript,Optional(CodeSnippet),Optional(/[:-]/),JSExpressionLiteral$1),([R])=>({'type':'evaluate','js':R})),(R,w)=>{w['collections']['variables']['push']({'name':'js-result'}),w['context']['clipboard']={'isRef':!![],'name':'js-result'};})),{Apply:Apply$21,Mutate:Mutate$21}=State({'type':'navigate'}),NavigateAction=All(Any(All(Mark(Continuous(/navigate/i,/navigating/i),{'type':'actionword'}),Optional(All(Optional(The),Browser$1))),Mark(Continuous(/goto|browse|visit|open/i,/browsing|visiting|opening/i),{'type':'actionword'})),Optional(To),Optional(The)),GoToPageAction=All(Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Optional(To),Optional(The)),AbsoluteUrl=Mutate$21(Mark(Url$3,{'type':'navigation\x20url'}),(R,[w])=>R['url']=w),ExplicitAbsoluteUrl=Mutate$21(Mark(ExplicitUrl,{'type':'navigation\x20url'}),(R,[w])=>R['url']=w),RelativeUrl=Mutate$21(Mark(StringExpression$1,{'type':'navigation\x20url'}),(R,[w])=>(R['url']=w,R['relative']=!![])),Direction$1=Any(Mutate$21(Any(Back,Previous),R=>R['direction']='back'),Mutate$21(Any(Forward,Next),R=>R['direction']='forward')),VerboseDirection=Any(Mutate$21(All(Back,To,Optional(The),Previous,Website),R=>R['direction']='back'),Mutate$21(All(Forward,To,Optional(The),Next,Website),R=>R['direction']='forward')),CardinalTimes=Mutate$21(CardinalNumberExpression,(R,[w])=>R['times']=w),IterativeTimes=Mutate$21(Any(All(CardinalNumberExpression,Times$4),IterativeNumberExpression),(R,[w])=>R['times']=w),StatusCodes=Mutate$21(Any(/any/i,List(Use(/([1-5]\d\d)/),Optional(OrListSeparator))),(R,w)=>R['statuses']=w['length']>0x0?w['map'](F=>Number['parseInt'](F)):'*'),Statuses=All(Optional(AndListSeparator),Any(Expect,Expecting),Any(All(Optional(The),HttpStatusCodes,Optional(':'),StatusCodes),All(StatusCodes,HttpStatusCodes))),Header$3=Mutate$21(Mark(All(Optional(With),HttpHeader),{'type':'navigation\x20option','subtype':'header'}),(R,[w])=>(R['headers']??=[])['push'](w)),Headers$2=All(Optional(AndListSeparator),List(Header$3,Optional(AndListSeparator))),ExplicitNavigateBody=Any(All(VerboseDirection,Optional(IterativeTimes)),All(CardinalTimes,Websites,Direction$1),All(Direction$1,Any(All(CardinalTimes,Websites),Optional(Website))),All(RelativeUrl,Relative,To,Optional(The),Current,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)),All(Any(Url$4,All(Website,Optional(LocationPreposition))),AbsoluteUrl,Optional(Headers$2),Optional(Statuses))),Navigate=LogGroup('Navigate',Apply$21(Any(All(NavigateAction,Any(ExplicitNavigateBody,All(AbsoluteUrl,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)))),All(GoToPageAction,Any(ExplicitNavigateBody,All(ExplicitAbsoluteUrl,Optional(Any(Url$4,Website)),Optional(Headers$2),Optional(Statuses)),All(AbsoluteUrl,Any(Url$4,Website),Optional(Headers$2),Optional(Statuses)),All(AbsoluteUrl,Optional(Any(Url$4,Website)),Any(Statuses,All(Headers$2,Optional(Statuses))))))))),{Apply:Apply$20,Mutate:Mutate$20}=State({'type':'focus'}),FocusAction=Mark(Continuous(/(?:(?:set\s+)?focus)/i,/setting\s+focus|focussing/i),{'type':'actionword'}),Element$1=Mutate$20(Element$2,(R,[w])=>R['element']=w),Focus=LogGroup('Focus',Apply$20(All(FocusAction,Optional(LocationPreposition),Element$1))),CheckAction=Mark(Continuous(/check|tick|select|(?:turn|switch)\s+on/i,/checking|ticking|selecting|(?:turning|switching)\s+on/i),{'type':'actionword'}),UncheckAction=Mark(Continuous(/uncheck|untick|unselect|(?:turn|switch)\s+off/i,/unchecking|unticking|unselecting|(?:turning|switching)\s+off/i),{'type':'actionword'}),Check=LogGroup('Check',Node(All(Any(Node(CheckAction,()=>!![]),Node(UncheckAction,()=>![])),Element$2),([R,w])=>({'type':'check','value':R,'element':w}))),Clear=LogGroup('Clear',Node(All(Mark(Continuous(/clear/i,/clearing/i),{'type':'actionword'}),Any(All(Article(String$1),LocationPreposition,Element$2),Longest(Node(String$1,()=>({'state':{'focused':!![]},'fallback':{'type':'textbox'}})),Element$2))),([R])=>({'type':'clear','element':R}))),{Apply:Apply$19,Mutate:Mutate$19}=State({'type':'erase'}),EraseAction=Mark(Continuous(/erase|delete|remove/i,/erasing|deleting|removing/i),{'type':'actionword'}),Size=Mutate$19(CardinalNumberExpression,(R,[w])=>R['size']=w),DefaultSize=Mutate$19(Optional(IndefiniteArticle),R=>R['size']=0x1),TargetTextbox=Mutate$19(Element$2,(R,[w])=>R['element']=w),Erase=LogGroup('Erase',Apply$19(All(EraseAction,Any(All(Size,Characters),All(DefaultSize,Character)),Optional(All(Optional(LocationPreposition),TargetTextbox))))),{Apply:Apply$18,Mutate:Mutate$18}=State({'type':'hover'}),HoverAction=Mark(Continuous(/hover(?:\s+(?:over|inside|on(?:(?:\s+the)?\s+center\s+of|\s+top(?:\s+of)?)?))?|(?:(?:move|place)?\s+(?:the\s+)?)?(?:cursor|mouse)\s+over/i,/hovering(?:\s+(?:over|inside|on(?:(?:\s+the)?\s+center\s+of|\s+top(?:\s+of)?)?))?|(?:mov|plac)ing\s+(?:the\s+)?(?:cursor|mouse)\s+over/i),{'type':'actionword'}),Anchor$2=Mutate$18(Anchor$3({'Element':Element$2}),(R,[w])=>{const F=R['element'];return F?F['anchor']=[w,F['anchor']??[]]['flat']():R['element']={'anchor':w};}),TargetElement$3=Mutate$18(Element$2,(R,[w])=>{const F=R['element'];if(!F||'isElementReference'in w)return R['element']=w;return Object['assign'](F,w,w['anchor']&&F['anchor']?{'anchor':[F['anchor']??[],w['anchor']??[]]['flat']()}:{});}),FocusedElement$2=Mutate$18(ImplicitElement,(R,[w])=>R['element']=w),Hover=LogGroup('Hover',Apply$18(All(HoverAction,Any(All(Optional(LocationPreposition),FocusedElement$2),All(Optional(Weak(Anchor$2)),Optional(LocationPreposition),TargetElement$3))))),{Apply:Apply$17,Mutate:Mutate$17}=State({'type':'type'}),TypeActionKeyword=Continuous(/type|enter|fill|write|insert/i,/typing|entering|filling|writing|inserting/i),TypeAction=Mark(TypeActionKeyword,{'type':'actionword'}),GenerateAndTypeAction=Mark(All(/generate/i,And,TypeActionKeyword),{'type':'actionword'}),Preposition=Any(LocationPreposition,FunctionalPreposition,For),StringValue=Mutate$17(Mark(StringExpression$1,{'type':'value'}),(R,[w])=>R['value']=w),OTPValue=Mutate$17(Mark(OTPLiteral,{'type':'value'}),(R,[w])=>R['value']=w),ClipboardValue=Mutate$17(Mark(Any(PreCondition(R=>R['context']['has']('element'),Node(All(Its,Value$6),(R,w)=>({'operator':'extract','operands':[{'isOperand':!![],'value':w['context']['element']},'string']}))),PreCondition(R=>R['context']['has']('clipboard'),Node(Any(It,Them),(R,w)=>w['context']['clipboard']))),{'type':'value'}),(R,[w])=>R['value']=w),UnquotedCompoundValue=Weak(Fix(Mutate$17(Mark(All(UnquotedStringLiteral$1,UnquotedStringLiteral$1),{'type':'value'}),(R,[w,F])=>R['value']=w+'\x20'+F),R=>'\x22'+R+'\x22')),Value=Any(OTPValue,ClipboardValue,StringValue),MaskedValue=Mutate$17(Mark(Value,{'type':'secret'}),R=>R['secret']=!![]),SecretValue=Any(All(Optional(The),Secret$2,MaskedValue),All(MaskedValue,Secret$2)),TextboxElement=Mutate$17(Any(ImplicitElement,Element$2),(R,[w])=>R['element']=w),AnchoredTextboxElement=Mutate$17(Anchor$3({'Element':Element$2}),(R,[w])=>R['element']={'anchor':w}),SecretTextboxElement=Longest(PostCondition(TextboxElement,([R])=>!!R['secret']),All(Optional(The),Secret$2,TextboxElement)),DefaultTextboxElement=Mutate$17(PreCondition(R=>R['context']['has']('element'),Node(Nothing$1,(R,w)=>w['context']['element'])),(R,[w])=>R['element']={'state':{'focused':!![]},'fallback':w}),SecretDefaultTextboxElement=PreCondition(R=>R['context']['has']('element')&&!!R['context']['element']['secret'],DefaultTextboxElement),ChromeTextboxElement=Mutate$17(ChromeTextbox,(R,[w])=>R['element']=w),ExplicitChromeTextboxElement=Mutate$17(ExplicitChromeTextbox,(R,[w])=>R['element']=w),DialogTextboxElement=Mutate$17(DialogTextbox,(R,[w])=>R['element']=w),ExplicitDialogTextboxElement=Mutate$17(ExplicitDialogTextbox,(R,[w])=>R['element']=w),InBrowserDialog=Mutate$17(All(LocationPreposition,Optional(The),BrowserDialog,Optional(ActionModifierSeparator)),R=>R['element']={'isDialogElementDescriptor':!![],'title':'prompt'}),ConventionalTextboxElement=Any(All(Preposition,TextboxElement),AnchoredTextboxElement),TypeBody=Any(All(Url$4,Value,Preposition,ChromeTextboxElement),All(Value,Preposition,Any(ExplicitChromeTextboxElement,ExplicitDialogTextboxElement)),All(MaskedValue,Preposition,SecretTextboxElement),All(Any(SecretValue,Value),ConventionalTextboxElement),All(SecretValue,Optional(DefaultTextboxElement)),All(SecretTextboxElement,MaskedValue),All(TextboxElement,SecretValue),All(OTPValue,Optional(DefaultTextboxElement)),Longest(All(MaskedValue,SecretDefaultTextboxElement),All(Value,Optional(DefaultTextboxElement)),UnquotedCompoundValue,All(TextboxElement,Weak(Value)))),Type$1=LogGroup('Type',Apply$17(Any(All(TypeAction,TypeBody),All(InBrowserDialog,TypeAction,Value,Optional(All(Preposition,DialogTextboxElement))),All(GenerateAndTypeAction,OTPValue,Optional(Any(ConventionalTextboxElement,DefaultTextboxElement)))))),PartialType=LogGroup('PartialType',Apply$17(TypeBody)),{Apply:Apply$16,Mutate:Mutate$16}=State({'type':'search'}),SearchAction=Mark(Continuous(/search/i,/searching/i),{'type':'actionword'}),QuotedValue=Mutate$16(Mark(QuotedStringExpression,{'type':'value'}),(R,[w])=>R['value']=w),UnquotedValue=Fix(Mutate$16(Mark(Anything$1,{'type':'value'}),(R,[w])=>R['value']=w['trim']()),R=>'\x22'+R+'\x22'),Input=Mutate$16(Element$2,(R,[w])=>R['element']=w),Search=LogGroup('Search',Dynamic(R=>{const w=Apply$16(All(SearchAction,Optional(For),Optional(The),Longest(All(Any(QuotedValue,UnquotedValue),Optional(All(Optional(LocationPreposition),PostCondition(Input,([F])=>'isElementReference'in F||!!F['type'])))),UnquotedValue)));if(!R['options']['intent'])return w;else return Node(Text$2(w),([F],E)=>{const u={'type':'intent','description':F};return E['collections']['intents']['push'](u),u;});})),{Apply:Apply$15,Mutate:Mutate$15}=State({'type':'click'}),ClickAction=Mark(NoBoundary(All(Optional(All(Any(Mutate$15(Any(Node(/left/i,()=>'left'),Node(/right/i,()=>'right')),(R,[w])=>R['button']=w),Mutate$15(MultiplicativeNumberLiteral,(R,[w])=>R['times']=w)),Optional('-'))),Continuous(/click|press|hit|tap|open|expand|collapse/i,/clicking|pressing|hitting|tapping|opening|expanding|collapsing/i))),{'type':'actionword'}),Anchor$1=Mutate$15(Anchor$3({'Element':Element$2}),(R,[w])=>{const F=R['element'];return F?F['anchor']=[w,F['anchor']??[]]['flat']():R['element']={'anchor':w};}),TargetElement$2=Mutate$15(Element$2,(R,[w])=>R['element']=R['element']?mergeElementDescriptors(R['element'],w):w),FocusedElement$1=Mutate$15(ImplicitElement,(R,[w])=>R['element']=w),ExplicitDialogElement=Mutate$15(ExplicitDialogButton,(R,[w])=>R['element']=w),DialogElement=Mutate$15(DialogButton,(R,[w])=>R['element']=w),ChromeElement=Mutate$15(Any(ChromeButton,ChromeTab),(R,[w])=>R['element']=w),ExplicitChromeTabElement$1=Mutate$15(Any(ExplicitChromeButton,ExplicitChromeTab),(R,[w])=>R['element']=w),ControlKey=Mutate$15(Mark(Stringish(ControlKey$1),{'type':'value'}),(R,[w])=>(R['keys']??=[])['push'](w)),Key$1=Mutate$15(Mark(Stringish(KeyboardKey),{'type':'value'}),(R,[w])=>(R['keys']??=[])['push'](w)),ChordSeparator$1=Any(AndListSeparator,'+',Nothing$1),Chord$1=List(All(Optional(The),Any(All(KeyboardKey$1,Key$1),All(Key$1,Optional(KeyboardKey$1)))),ChordSeparator$1),Click=LogGroup('Click',Apply$15(Any(All(Mutate$15(Mark(Continuous(Text$2(Any(Accept,Dismiss)),Text$2(/(?:ok|accept|agree|allow|confirm|submit|cancel|decline|reject|clos|discard|dismiss)ing/i)),{'type':'actionword'}),(R,[w])=>R['element']={'type':'button','title':w}),Optional(Mutate$15(Any(Dialog,Element$2),(R,[w])=>attachAnchor(R['element'],{'position':'inside','element':w})))),All(Optional(All(ControlKey,Optional(All(Optional(ChordSeparator$1),Chord$1)),Optional(ChordSeparator$1))),ClickAction,Any(All(Optional(LocationPreposition),Any(FocusedElement$1,ExplicitDialogElement,ExplicitChromeTabElement$1)),All(Optional(Weak(Anchor$1,{'cost':0x2})),Optional(LocationPreposition),TargetElement$2)),Optional(All(While,Holding,Chord$1))),All(LocationPreposition,Optional(The),BrowserToolbar,Optional(ActionModifierSeparator),ClickAction,Optional(LocationPreposition),ChromeElement),All(LocationPreposition,Optional(The),BrowserDialog,Optional(ActionModifierSeparator),ClickAction,Optional(LocationPreposition),DialogElement)))),{Apply:Apply$14,Mutate:Mutate$14}=State({'type':'scroll'}),ScrollAction=Mark(Continuous(/scroll/i,/scrolling/i),{'type':'actionword'}),GoToPositionAction=Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Direction=Mutate$14(Any(Node(/upwards?|up/i,()=>'up'),Node(/downwards?|down/i,()=>'down'),Node(/left/i,()=>'left'),Node(/right/i,()=>'right')),(R,[w])=>R['direction']=w),Times$2=Mutate$14(Any(IterativeNumberLiteral,All(CardinalNumberExpression,Times$4)),(R,[w])=>R['times']=w),Distance=Mutate$14(NoBoundary(All(QuantitativeNumberExpression,Optional(Pixels))),(R,[w])=>R['distance']=w),AbsolutePositionMutator=(R,[w])=>{delete R['direction'],delete R['fraction'],R['position']=w;},AbsolutePosition=Mutate$14(All(Optional(To),AbsolutePosition$1),AbsolutePositionMutator),ExplicitAbsolutePosition=Mutate$14(All(To,AbsolutePosition$1),AbsolutePositionMutator),Fraction=Mutate$14(All(Optional(The),Any(InnerRelationalOffset,QuantitativeNumberExpression)),(R,[w])=>R['fraction']=w),ContextElement=Mutate$14(Any(Viewport,Element$2),(R,[w])=>R['element']=w),PageContextElement=Mutate$14(Any(Viewport,PageElement),(R,[w])=>R['element']=w),TargetElement$1=Mutate$14(Element$2,(R,[w])=>{if(R['position']==='bottom'&&!('isElementReference'in w))w['orderDirection']='backward';delete R['direction'],delete R['position'],R['element']=w;}),TargetExplicitElement=Mutate$14(ExplicitElement,(R,[w])=>{if(R['position']==='bottom'&&!('isElementReference'in w))w['orderDirection']='backward';delete R['direction'],delete R['position'],R['element']=w;}),Scroll=LogGroup('Scroll',Apply$14(Any(All(Any(ScrollAction,GoToPositionAction),Any(All(Fraction,Any(All(ExplicitAbsolutePosition,Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))),All(Optional(Any(Of,LocationPreposition)),ContextElement,Optional(Any(Direction,AbsolutePosition))),All(Direction,Optional(AbsolutePosition),Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))),All(AbsolutePosition,Optional(All(Optional(Any(Of,LocationPreposition)),ContextElement))))),All(Direction,Optional(Any(All(Times$2,Optional(All(Optional(Fraction),Optional(AbsolutePosition),Optional(Any(Of,LocationPreposition)),ContextElement))),All(Optional(By),Distance),All(Optional(Fraction),Optional(AbsolutePosition),Optional(Any(Of,LocationPreposition)),Any(All(To,TargetElement$1),ContextElement)),Fraction))),All(AbsolutePosition,Optional(Any(All(Any(Of,LocationPreposition),ContextElement),PageContextElement,TargetElement$1))),All(ContextElement,Any(All(Direction,Optional(By),Distance),All(Direction,Optional(Times$2),Optional(Fraction)),All(Optional(Times$2),Fraction,Direction))))),All(ScrollAction,To,TargetElement$1),All(GoToPositionAction,To,TargetExplicitElement)))),{Apply:Apply$13,Mutate:Mutate$13}=State({'type':'navigate\x20pdf'}),NavigatePdfAction=Mark(Continuous(/go|navigate|jump|switch|flip/i,/going|navigating|jumping|switching|flipping/i),{'type':'actionword'}),ShowPdfPageAction=Mark(Continuous(/open|view|show/i,/opening|viewing|showing/i),{'type':'actionword'}),PdfPage=Mutate$13(Any(All(Any(OrdinalNumberExpression$1,Node(Last$1,()=>-0x1)),Any(PdfPage$1,Page)),All(Any(PdfPage$1,Page),Optional(Any(NumberSign,Number$1)),CardinalNumberExpression)),(R,[w])=>R['page']=w),NavigatePdf=Apply$13(All(Any(All(NavigatePdfAction,To),ShowPdfPageAction),Optional(The),PdfPage)),{Apply:Apply$12,Mutate:Mutate$12}=State({'type':'wait'}),WaitAction=Mark(Continuous(/wait|halt|pause|delay|block/i,/halting|blocking/i),{'type':'actionword'}),TimeInterval=Mutate$12(TimeIntervalExpression,(R,[w])=>R['timeout']=w),Condition$1=Any(Mutate$12(Condition$2,(R,[w])=>R['condition']=w),Mutate$12(Element$2,(R,[w])=>R['condition']={'isCondition':!![],'operation':{'operator':'visible','operands':[{'isOperand':!![],'value':w}]}})),Wait$1=LogGroup('Wait',Apply$12(All(WaitAction,Optional(Any(All(Optional(For),Optional(Maximum),TimeInterval,Optional(All(Any(For,Until),Condition$1))),All(Any(For,Until),Condition$1,Optional(All(Optional(For),Optional(Maximum),TimeInterval)))))))),{Apply:Apply$11,Mutate:Mutate$11}=State({'type':'refresh'}),RefreshAction=Mark(Continuous(/refresh|reload/i,/refreshing|reloading/i),{'type':'actionword'}),Type=Any(Mutate$11(/hard(?:ly)?|(?:ignore|ignoring|skip|skipping)(?:\s+the)?(?:\s+cache)/i,R=>R['value']='hard'),Mutate$11(/soft(?:ly)?/i,R=>R['value']='soft')),Refresh=LogGroup('Refresh',Apply$11(Any(All(RefreshAction,Optional(All(Optional(The),Any(Page,BrowserTab))),Optional(Type)),All(Type,RefreshAction,Optional(All(Optional(The),Any(Page,BrowserTab))))))),{Apply:Apply$10,Mutate:Mutate$10}=State({'type':'hit\x20key'}),HitKeyAction=Mark(Continuous(/hit|press/i,/hitting|pressing/i),{'type':'actionword'}),TypeKeyAction=Mark(Continuous(/type/i,/typing/i),{'type':'actionword'}),InputSource=All(LocationPreposition,Optional(The),Keyboard$1),Times$1=Mutate$10(Any(All(CardinalNumberExpression,Times$4),IterativeNumberExpression),(R,[w])=>R['times']=w),Key=Mutate$10(Mark(Stringish(KeyboardKey),{'type':'value'}),(R,[w])=>(R['keys']??=[])['push'](w)),ArrowKey=Mutate$10(ArrowKey$1,(R,[w])=>(R['keys']??=[])['push'](w)),BackspaceKey=Mutate$10(BackspaceKey$1,(R,[w])=>(R['keys']??=[])['push'](w)),DeleteKey=Mutate$10(DeleteKey$1,(R,[w])=>(R['keys']??=[])['push'](w)),ChordSeparator=Any(AndListSeparator,'+',Nothing$1),Chord=WeakList(All(Optional(The),Any(All(KeyboardKey$1,Key),All(Key,Optional(KeyboardKey$1)))),ChordSeparator),ExplicitChord=WeakList(All(Optional(The),Any(All(KeyboardKey$1,Key),All(Key,KeyboardKey$1))),ChordSeparator),HitKey=LogGroup('HitKey',Apply$10(Any(All(All(InputSource,Optional(','),Any(HitKeyAction,TypeKeyAction)),Optional(LocationPreposition),Chord,Optional(KeyboardKeys),Optional(Times$1)),All(HitKeyAction,Optional(LocationPreposition),Chord,Optional(Any(KeyboardKeys,InputSource)),Optional(Times$1)),All(TypeKeyAction,Optional(LocationPreposition),Any(All(ExplicitChord,Optional(Any(KeyboardKeys,InputSource))),All(Chord,Any(KeyboardKeys,InputSource))),Optional(Times$1))))),HitArrowKey=LogGroup('HitArrowKey',Apply$10(All(ArrowKey,Optional(Times$1)))),HitBackspaceKey=LogGroup('HitBackspaceKey',Apply$10(All(BackspaceKey,Optional(Times$1)))),HitDeleteKey=LogGroup('HitDeleteKey',Apply$10(All(DeleteKey,Optional(Times$1)))),{Apply:Apply$9,Mutate:Mutate$9}=State({'type':'switch'}),SwitchAction=Mark(Continuous(/switch\s+to|change\s+to/i,/switching\s+to|changing\s+to/i),{'type':'actionword'}),ActivateTabAction=Mark(Continuous(/activate|focus\s+on|select/i,/activating|focusing\s+on|selecting/i),{'type':'actionword'}),ExplicitChromeElement=Mutate$9(ExplicitChromeTab,(R,[w])=>R['element']=w),TabElement=Mutate$9(PostCondition(Element$2({'reference':![]}),([R])=>!('isElementReference'in R)&&(!R['type']||(Array['isArray'](R['type'])?R['type']:[R['type']])['includes']('tab'))),(R,[w])=>R['element']='isElementReference'in w||w['type']?w:{...w,'hints':{...w['hints'],'type':'tab'}}),ExplicitTabElement=Mutate$9(PostCondition(Element$2({'reference':![]}),([R])=>!('isElementReference'in R)&&(Array['isArray'](R['type'])?R['type']:[R['type']])['includes']('tab')),(R,[w])=>R['element']=w),Switch=LogGroup('Switch',Apply$9(Any(All(SwitchAction,Any(ExplicitChromeElement,TabElement)),All(ActivateTabAction,Any(ExplicitChromeElement,ExplicitTabElement))))),{Apply:Apply$8,Mutate:Mutate$8}=State({'type':'create\x20target'}),CreateTargetAction=Mark(Continuous(/create|open/i,/creating|opening/i),{'type':'actionword'}),Url$1=Mutate$8(Mark(Url$3,{'type':'navigation\x20url'}),(R,[w])=>R['url']=w),CreateTarget=LogGroup('CreateTarget',Apply$8(All(CreateTargetAction,Article(All(Optional(New),BrowserTab)),Optional(All(Any(LocationPreposition,AssociationPreposition),Article(Any(Url$4,Website)),Url$1))))),{Apply:Apply$7,Mutate:Mutate$7}=State({'type':'close'}),CloseAction=Mark(Continuous(Dismiss,/cancell?ing|declining|rejecting|closing|discarding|dismissing/i),{'type':'actionword'}),ExplicitChromeTabElement=Mutate$7(Longest(ActiveChromeTab,ExplicitChromeTab),(R,[w])=>R['element']=w),TargetElement=Mutate$7(Any(Dialog,Element$2),(R,[w])=>R['element']=w),FocusedElement=Mutate$7(ImplicitElement,(R,[w])=>R['element']=w),Close=LogGroup('Close',Apply$7(All(CloseAction,Optional(LocationPreposition),Any(FocusedElement,ExplicitChromeTabElement,TargetElement)))),{Apply:Apply$6,Mutate:Mutate$6}=State({'type':'go'}),Go=LogGroup('Go',Apply$6(All(Disambiguate(All(Mark(Continuous(/go/i,/going/i),{'type':'actionword'}),Optional(To),Optional(The)),R=>[R+'\x20url',R+'\x20element']),Mutate$6(StringExpression$1,(R,[w])=>R['target']=w)))),VisualCheck=LogGroup('VisualCheck',Node(Mark(Continuous(/visual\s+check/i,/visually\s+checking|visual\s+checking/i),{'type':'actionword'}),()=>({'type':'visual\x20check'}))),{Apply:Apply$5,Mutate:Mutate$5}=State({'type':'intent'}),FillAction=Mark(Continuous(/fill/i,/filling/i),{'type':'actionword'}),FillOutAction=Mark(Continuous(/fill\s+out/i,/filling\s+out/i),{'type':'actionword'}),Form=PostCondition(Element$2({'reference':![]}),([R])=>!('isElementReference'in R)&&R['type']==='form'),Description=R=>Mutate$5(Text$2(R),(w,[F])=>w['description']=F),Intent=LogGroup('Intent',PreCondition(R=>R['options']['intent'],Effect(Apply$5(Any(Description(All(FillOutAction,Anything$1)),Description(All(FillAction,Form)))),([R],w)=>w['collections']['intents']['push'](R)))),{Apply:Apply$4,Mutate:Mutate$4,state}=State({'type':'initialize\x20scope'}),InitializeScopeAction=Mark(Continuous(/run|execute|invoke|call|do|perform/i,/running|executing|invoking|calling|doing|performing/i),{'type':'actionword'}),ScopeName=Mutate$4(Mark(StringLiteral$1,{'type':'scope\x20name'}),(R,[w])=>R['name']=w),FunctionKind=Mutate$4(Mark(FunctionKeyword,{'type':'keyword'}),R=>R['kind']='function'),Scope$1=Mark(All(Optional(All(Optional(Each),Optional(Of),Optional(The),TestSteps,Optional(Any(LocationPreposition,Of)))),Optional(The),Any(All(FunctionKind,ScopeName),All(CustomFlowTest,ScopeName),All(ScopeName,Optional(Any(FunctionKind,CustomFlowTest))))),{'type':'scope\x20definition'}),Parameter$1=Mutate$4(Effect(State({'secret':![]},({Mutate:R,state:w})=>{const F=R(Article(Secret$2),l=>l['secret']=!![]),E=R(Effect(Mark(Node(StringLiteral$1({'escape':/[:=]/}),([l])=>l['toLowerCase']()),{'type':'parameter\x20name'}),([l],Y,I)=>{if(isReservedName(l))Y['collections']['errors']['push']({'type':'ReservedParameterNameError','pos':I['pos'],'text':Y['text']['slice'](I['pos'],Y['pos']),'message':l+'\x20is\x20a\x20reserved\x20variable\x20name\x20and\x20cannot\x20be\x20used\x20as\x20an\x20argument'});}),(l,[Y])=>{l['name']=Y;if(isSecretName(Y))l['secret']=!![];}),u=PostCondition(E,(l,Y)=>w(Y)['secret']),M=R(Mark(AnyExpression$1,{'type':'parameter\x20value'}),(l,[Y])=>l['value']=Y),N=Mark(M,{'type':'secret'}),e=l=>Dynamic(Y=>w(Y)['secret']?Mark(l,{'type':'secret'}):l);return Any(All(N,StoragePreposition,Optional(The),u),All(Optional(F),e(M),StoragePreposition,Optional(The),E),All(E,Any(All(Any(AssignmentPreposition,Be),Optional(The)),/[:=]/),Optional(F),e(M)));}),([R],w,F)=>{if(state(w)['parameters']?.['some'](({name:E})=>E===R['name']))w['collections']['errors']['push']({'type':'RedefinedParameterError','pos':F['pos'],'text':w['text']['slice'](F['pos'],w['pos']),'message':'The\x20argument\x20'+R['name']+'\x20is\x20already\x20defined'});}),(R,[w])=>(R['parameters']??=[])['push'](w)),Parameters=Mark(List(All(Optional(Any(With,When,Using)),Optional(Parameters$1),Parameter$1),AndListSeparator),{'type':'scope\x20parameters'}),AssertionType=Any(Node(/visual\s+and\s+(?:non[-\s]?visual|textual)|(?:non[-\s]?visual|textual)\s+and\s+visual/i,()=>'all'),Node(/visual/i,()=>'visual'),Node(/non[-\s]?visual|textual/i,()=>'nonvisual')),Options$1=Mark(List(All(Any(All(Any(Run,Running),Optional(All(Each,Optional(All(Of,Optional(The)))))),All(Dont,Skip),All(Without,Skipping)),Any(Mutate$4(All(Optional(AssertionType),Assertions),(R,[w='all'])=>{const F=R['options']??={};if(!F['assertions']||w==='all')F['assertions']=w;else{if(F['assertions']!=='all'&&F['assertions']!==w)F['assertions']='all';}}),Mutate$4(Article(All(Start,Url$4)),R=>(R['options']??={})['navigation']='all'))),AndListSeparator),{'type':'scope\x20options'}),InitializeScope=Effect(Apply$4(Mark(All(InitializeScopeAction,Scope$1,Optional(All(Optional(AndListSeparator),Parameters)),Optional(All(Optional(AndListSeparator),Options$1))),{'type':'control\x20flow','subtype':'initialize\x20scope'})),([R],w)=>w['collections']['scopes']['push']({'name':R['name'],'parameters':(R['parameters']??[])['map'](({name:F})=>F),'options':R['options']})),IfKeyword=Mark(/(?:only\s+)?if(?:\s+and\s+only\s+if)?|(?:given|providing)\s+that/i,{'type':'keyword'}),UnlessKeyword=Mark(/unless/i,{'type':'keyword'}),ElseKeyword=Mark(/else|otherwise/i,{'type':'keyword'}),Block$1=(R,{collapseElseif:collapseElseif=![]}={})=>Mark(R,{'type':'block','mutate':collapseElseif?(w,[F])=>{if(F?.['length']===0x1&&F[0x0]?.['type']==='if')w['type']='empty';}:void 0x0}),Then=All(Then$1,Optional(All(Run,Optional(All(Optional(Any(The,These,This)),Following)),Optional(TestStep),Optional(TestSteps))),Optional(ActionModifierSeparator)),Else=R=>{return LogGroup('Else',Node(All(Optional(BlockSeparator),Mark(ElseKeyword,{'type':'control\x20flow','subtype':'else'}),Optional(ActionModifierSeparator),Block$1(Optional(R),{'collapseElseif':!![]})),([w],F)=>{return F['collections']['conditionals']['length']=0x0,F['collections']['conditionals']['push'](w?.[0x0]['type']==='if'?'elseif':'else'),w??[];}));},If=R=>{return LogGroup('If',Node(All(Mark(Any(All(IfKeyword,Condition$2),All(UnlessKeyword,NegativeCondition$1)),{'type':'control\x20flow','subtype':'if'}),Optional(Any(All(Optional(ActionModifierSeparator),Then),ActionModifierSeparator)),Block$1(Optional(R)),Optional(Else(R))),([w,F,E],u)=>{u['collections']['conditionals']['length']=0x0,u['collections']['conditionals']['push']('if');const M={'type':'if','condition':w};if(F)M['then']=F;if(E)M['otherwise']=E;return M;}));},{Apply:Apply$3,Mutate:Mutate$3}=State({'type':'loop','instructions':[]}),RunKeyword=Mark(Run,{'type':'keyword'}),RepeatKeyword=Mark(Any(Repeat$1,Iterate),{'type':'keyword'}),ForEachKeyword=Mark(Any(/for[-\s]?(?:each|every|any)/i,All(Iterate,Over,/each|every|any/i),/for(?![-\s]?all)/i),{'type':'keyword'}),ForAllKeyword=Effect(Mark(Any(/for[-\s]?all/i,All(Iterate,Over,Optional(/all/i))),{'type':'keyword'}),(R,w)=>{w['context']['plural']=!![];}),UntilKeyword=Mark(Until,{'type':'keyword'}),WhileKeyword=Mark(While,{'type':'keyword'}),KeepKeyword=Effect(Mark(/keep(?:\s+on)?/i,{'type':'keyword'}),(R,w)=>{w['context']['continuous']=!![];}),Condition=Mutate$3(Condition$2,(R,[w])=>R['condition']=w),NegativeCondition=Mutate$3(NegativeCondition$1,(R,[w])=>R['condition']=w),Times=Mutate$3(Any(IterativeNumberLiteral,All(CardinalNumberExpression,Times$4)),(R,[w])=>R['times']=w),Delay=Mutate$3(TimeIntervalExpression,(R,[w])=>R['wait']=w),Wait=Any(All(Any(Wait$2,Waiting),Optional(For),Delay,Optional(All(Between,Optional(Every),Iterations))),All(Every,Delay)),Binding=R=>Mutate$3(Effect(Mark(R,{'type':'binding\x20name'}),([w],F)=>F['collections']['variables']['push']({'name':w},{'name':'it'})),(w,[F])=>w['bindings']=[F]),IterableData=Mutate$3(PostCondition(AnyExpression$1,([R])=>typeof R!=='string'||!/^it\b/i['test'](R)),(R,[w])=>R['iterable']=w),IterableElement=Mutate$3(Element$2,(R,[w])=>R['iterable']=w),Declaration=R=>Effect(R,(w,F)=>F['collections']['variables']['push']({'name':'index'},{'name':'key'})),Block=R=>Mutate$3(Mark(R,{'type':'block'}),(w,[F])=>{if(F)w['instructions']=F;}),Repeat=R=>{return LogGroup('Repeat',Apply$3(Declaration(Any(All(Mark(Any(All(Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Any(Repeat$1,Iterate,Run),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait))),All(Any(RepeatKeyword,RunKeyword),Optional(All(Optional(Any(The,These,This)),Following,Optional(Any(TestStep,TestSteps)))),Any(All(Optional(Maximum),Times,Optional(Any(All(While,Condition),All(Until,NegativeCondition)))),Any(All(While,Condition),All(Until,NegativeCondition))),Optional(All(Optional(BlockSeparator),Wait)))),{'type':'control\x20flow','subtype':'loop'}),Optional(ActionModifierSeparator),Block(Optional(R))),All(KeepKeyword,Block(R),Optional(ActionModifierSeparator),Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait)))))));},ForEach=R=>{return LogGroup('ForEach',Apply$3(Declaration(All(Mark(All(Any(All(ForEachKeyword,Any(All(Binding(Identifier$1),RelationalPreposition,IterableData),IterableElement)),All(ForAllKeyword,Effect(Any(All(Binding(SingularizedIdentifier),RelationalPreposition,IterableData),IterableElement),(w,F)=>F['context']['plural']=![]))),Optional(All(Optional(BlockSeparator),Wait))),{'type':'control\x20flow','subtype':'loop'}),Optional(ActionModifierSeparator),Block(Optional(R))))));},Loop=R=>Any(Repeat(R),ForEach(R)),LoopPostlude=Node(LogGroup('LoopPostlude',Apply$3(Declaration(All(Any(All(WhileKeyword,Condition),All(UntilKeyword,NegativeCondition)),Optional(All(Optional(BlockSeparator),Optional(Maximum),Times)),Optional(All(Optional(BlockSeparator),Wait)))))),([R])=>(w,F,E)=>{const u=Math['min'](F['context']['self']['data']['get']('group')??0x1,w['length']);R['instructions']=w['slice'](-u);if(u>=w['length'])return R;const M=F['text']['slice'](E['pos'],F['pos']),N=F['collections']['markers']['slice']()['filter'](e=>e['type']==='actionword'&&e['pos']>=E['pos'])['toReversed']()['reduce']((e,l)=>replace(e,l['pos']-E['pos'],l['text']['length'],gerundize(l['text'])),M);return F['collections']['disambiguations']['push']({'pos':E['pos'],'text':M,'replacements':['keep\x20'+N]}),[...w['slice'](0x0,-u),R];});Sanitize$1(ElementType$1);const Empty=LogGroup('Empty',Node(/$/,()=>({'type':'empty'}))),PreinstructionKeyword=Mark(/pre(?:-|\s+)?step/i,{'type':'keyword'}),PreinstructionDescription=All(Prior,Optional(Running),Any(Each,The),Optional(Subsequent),Optional(TestSteps)),SetPreinstructions=R=>{return Node(Mark(All(Any(All(Activate,Optional(IndefiniteArticle),PreinstructionKeyword,Optional(ActionModifierSeparator)),All(Optional(Run),Optional(All(Optional(The),Following)),Any(PreinstructionKeyword,PreinstructionDescription),Optional(ActionModifierSeparator))),R),{'type':'control\x20flow','subtype':'set\x20preinstructions'}),([w])=>({'type':'set\x20preinstructions','instructions':w}));},SetPreinstructionsPostlude=Node(All(Optional(ActionModifierSeparator),PreinstructionDescription),()=>R=>({'type':'set\x20preinstructions','instructions':R})),DropPreinstructions=Node(Mark(Any(All(Cancel,Optional(The),PreinstructionKeyword),All(Any(All(Run,Nothing),All(Dont,Run,Anything)),PreinstructionDescription)),{'type':'control\x20flow','subtype':'drop\x20preinstructions'}),()=>({'type':'drop\x20preinstructions'})),TryKeyword=Mark(/try|optional/i,{'type':'keyword'}),Try=R=>{return Node(Mark(All(Any(All(TryKeyword,Optional(ActionModifierSeparator)),All(Optionally,Optional(All(Run,Optional(All(Optional(The),Following)),Optional(Any(TestStep,TestSteps)))),Optional(ActionModifierSeparator))),R),{'type':'control\x20flow','subtype':'try'}),([w])=>({'type':'try','instructions':w}));},TryPostlude=Node(PreCondition(R=>R['context']['has']('element'),All(Optional(Only),If$1,Optional(It),Optional(/is|does|be|(?:to|can)(?:\s+be)?|(?:have|has)\s+been/i),/visible|shown|shows?(?:\s+up)?|appears?|apparent|displayed/i)),()=>R=>({'type':'try','instructions':R}));function Instructions({allowed:R,disabled:w}={}){function F(u,M){if(w?.['includes'](u))return Never;if(R&&!R['includes'](u))return Never;return M;}const E=Node(List(Mark(Effect(Any(F('intent',Intent),F('switch',Switch),F('close',Close),F('create\x20target',CreateTarget),F('hit\x20key',HitKey),F('write\x20file',WriteFile),F('remove\x20file',RemoveFile),F('type',Type$1),F('navigate\x20pdf',NavigatePdf),F('click',Click),Longest(F('navigate',Navigate),F('scroll',Scroll)),F('go',Go),F('search',Search),F('assert',Assert),F('visual\x20check',VisualCheck),F('hover',Hover),F('erase',Erase),F('clear',Clear),F('wait',Wait$1),F('refresh',Refresh),F('hit\x20key',Weak(HitArrowKey)),F('hit\x20key',Weak(HitBackspaceKey)),F('focus',Focus),F('set\x20variable',SetTimeout),F('set\x20variable',SetVariable),F('set\x20value',SetValue),F('check',Check),F('set\x20variable',Generate),F('set\x20variable',ReadFile),Longest(F('hit\x20key',HitDeleteKey),F('fetch',Fetch)),F('evaluate',Evaluate),Grab,F('type',PreCondition(u=>u['context']['action']?.['type']==='type',PartialType))),([u],M)=>M['context']['action']=u),{'type':'action','mutate':(u,[M],N)=>{u['subtype']=M?.['type']??'empty';if(N['context']['accessed'])u['type']='dependent\x20action',N['context']['group']=(N['context']['self']['data']['get']('group')??0x1)+0x1;else N['context']['group']=0x1;if(N['context']['has']('continuous'))N['context']['continuous']=!![];N['context']['refresh']();}}),ActionSeparator),u=>u);return All(Sanitize$1(Recursive((u,{depth:M})=>{return Customizable(({avoid:N}={})=>{return Node(Any(PreCondition(()=>M===0x0,F('empty',Empty)),PreCondition(()=>M===0x0,F('comment',Comment)),PreCondition(()=>N!=='try',F('try',Try(u({'avoid':'try'})))),PreCondition(()=>N!=='preinstruction',F('set\x20preinstructions',SetPreinstructions(u({'avoid':'preinstruction'})))),PreCondition(()=>N!=='preinstruction',F('drop\x20preinstructions',DropPreinstructions)),F('if',If(u({'avoid':'conditional'}))),F('if',Else(u)),F('loop',Loop(u({'avoid':'loop'}))),Node(All(E,Optional(Any(PreCondition(()=>N!=='try',F('try',TryPostlude)),PreCondition(()=>N!=='loop',F('loop',LoopPostlude)),PreCondition(()=>N!=='preinstruction',F('set\x20preinstructions',SetPreinstructionsPostlude))))),([e,l],Y,I)=>l?l(e,Y,I):e),F('initialize\x20scope',InitializeScope)),([e])=>Array['isArray'](e)?e:[e]);});})),Optional(TrailingComment),Optional(InstructionTerminator));}const store$1=new WeakMap();function flatten(R){return R['flatMap'](w=>{if(w['type']==='if')return[w,...flatten(w['then']??[]),...flatten(w['otherwise']??[])];else{if(w['type']==='try'||w['type']==='set\x20preinstructions')return[w,...flatten(w['instructions'])];}return[w];});}function instructionMarkers(R){const w=R['filter'](F=>{if(F['type']==='comment')return!![];if(F['type']==='action'||F['type']==='dependent\x20action'||F['type']==='control\x20flow')return Boolean(F['subtype'])&&F['subtype']!=='empty';return![];});return w['filter'](F=>{if(F['type']!=='control\x20flow')return!![];return!w['some'](E=>E!==F&&contains(F,E));})['toSorted']((F,E)=>F['pos']-E['pos']);}function contains(R,w){return w['pos']>=R['pos']&&w['pos']+w['text']['length']<=R['pos']+R['text']['length'];}function typeOf$1(R){return R['type']==='comment'?'comment':R['subtype'];}function getInstructionTexts(R){const w=instructionMarkers(R['meta']['markers']??[]),F=new Map();let E=0x0;for(const u of flatten(R['result'])){const M=w['slice'](E)['findIndex'](N=>typeOf$1(N)===u['type']);M>=0x0&&(F['set'](u,w[E+M]['text']['trim']()),E+=M+0x1);}return F;}function registerInstructionTexts(R){getInstructionTexts(R)['forEach']((w,F)=>store$1['set'](F,w));}function getInstructionText(R){return store$1['get'](R);}function maskText(R,{meta:w,mask:mask='***'}){let F=R;const E=[],u=[],M=[];for(const Y of w['markers']??[])if(Y['type']==='secret'){let I=Y['pos'];for(const f of M)if(f['pos']>=Y['pos']&&f['pos']+f['length']<=Y['pos']+Y['text']['length']){if(f['pos']>I){const t={'pos':I,'length':f['pos']-I,'text':mask};if(!u['some'](W=>W['pos']<=t['pos']&&W['pos']+W['length']>=t['pos']+t['length']))u['push'](t);}I=f['pos']+f['length'];}if(Y['pos']+Y['text']['length']>I){const W={'pos':I,'length':Y['pos']+Y['text']['length']-I,'text':mask};if(!u['some'](i=>i['pos']<=W['pos']&&i['pos']+i['length']>=W['pos']+W['length']))u['push'](W);}}else{if(Y['type']==='reference'||Y['type']==='element\x20descriptor')M['push']({'pos':Y['pos'],'length':Y['text']['length']});}for(let i of w['markers']??[]){let K=0x0;i=u['reduce']((s,Q)=>{if(s['pos']<=Q['pos']+K&&s['pos']+s['text']['length']>=Q['pos']+K+Q['length'])s['text']=replace(s['text'],Q['pos']+K-s['pos'],Q['length'],Q['text']);else{if(s['pos']>=Q['pos']+K+Q['length'])s['pos']+=Q['text']['length']-Q['length'];}return K+=Q['text']['length']-Q['length'],s;},{...i}),E['push'](i);}const N=[];let e=0x0;for(const s of u){N['push']({'pos':s['pos']+e,'length':s['text']['length'],'text':F['substring'](s['pos']+e,s['pos']+e+s['length'])}),F=replace(F,s['pos']+e,s['length'],s['text']),e+=s['text']['length']-s['length'];}const l={'text':F,'meta':{...w,'markers':E,'masks':N}};if(l['meta']['navigationUrls'])l['meta']['navigationUrls']=l['meta']['markers']['reduce']((Q,k)=>{if(k['type']==='navigation\x20url')Q['push'](k['text']['replaceAll'](/^['"]|['"]$/g,''));return Q;},[]);return l;}function normalizeCurlString(R,w=/[]/){return R['replaceAll'](new RegExp(String['raw']`\\([{\\nt]|${w['source']})`,'g'),(F,E)=>{if(E==='n')return'\x0a';else{if(E==='t')return'\x09';}return E;})['replaceAll'](/\\u([0-9a-fA-F]{4})/g,(F,E)=>String['fromCharCode'](parseInt(E,0x10)))['replaceAll'](/\\x([0-9a-fA-F]{2})/g,(F,E)=>String['fromCharCode'](parseInt(E,0x10)));}const CurlString=Any(Any(Node(Use(/\$'([^']*)'/),([R])=>normalizeCurlString(R)),Use(/"([^"]+)"/),Use(/'([^']+)'/)),Use(/(\S+)/)),Sanitize=R=>TokenBoundary(Ignore(/[\s\\]+/,R)),{Apply:Apply$2,Mutate:Mutate$2}=State({'type':'fetch'}),Curl=/curl/i,CliOption=(R,w)=>{return All(Any(All(/--/,R['longhand']),R['shorthand']?All(/-/,R['shorthand']):Never,R['optional']?Nothing$1:Never),w);},Url=Mutate$2(CliOption({'longhand':'url','optional':!![]},CurlString),(R,[w])=>R['url']=w),BasicAuth=Mutate$2(CliOption({'longhand':'user','shorthand':'u'},CurlString),(R,[w])=>{const [F,E]=w['split'](':',0x2)['map'](u=>u['trim']());R['auth']={'type':'basic','username':F,'password':E};}),Header$2=Mutate$2(CliOption({'longhand':'header','shorthand':'H'},CurlString),(R,[w])=>{const F=w['indexOf'](':'),E=F>-0x1?w['slice'](0x0,F)['trim']():w['trim'](),u=F>-0x1?w['slice'](F+0x1)['trim']():'';R['headers']??=[],R['headers']['push']({'name':E,'value':u,'secret':![]});}),Method$1=Mutate$2(Any(CliOption({'longhand':'request','shorthand':'X'},CurlString)),(R,[w])=>{R['method']=w['toLowerCase']();}),DataBody=Mutate$2(CliOption({'longhand':Any('data-urlencode','data-ascii','data'),'shorthand':'d'},CurlString),(R,[w])=>{const [F,E]=w['split']('=',0x2)['map'](N=>N['trim']());if(!E){R['body']??={'data':null},R['body']['data']=F;return;}R['body']??={'data':null};const u=typeof R['body']['data']==='string'?R['body']['data']['split']('&'):[],M=F+'='+E;R['body']['data']=[...u,M]['join']('&');}),Options=Any(BasicAuth,Header$2,Method$1,Any(Mutate$2(CliOption({'longhand':'data-raw'},CurlString),(R,[w])=>{R['body']??={'data':w};}),DataBody,Mutate$2(CliOption({'longhand':'json'},CurlString),(R,[w])=>{R['body']??={'data':null};try{R['body']['data']=convertToStructure(JSON['parse'](w));}catch{R['body']['data']=w;}finally{R['body']['type']='json';}})),Mutate$2(CliOption({'longhand':'cookie','shorthand':'b'},CurlString),(R,[w])=>{R['cookies']??=[];const F=w['split'](';')['map'](E=>E['trim']());for(const E of F){const [u,M]=E['split']('=',0x2);R['cookies']['push']({'name':u,'value':M,'secret':![]});}}),Raw(CliOption({'longhand':/[a-zA-Z0-9.-]+/,'shorthand':/[a-zA-Z]/},Optional(CurlString)))),parse$7=makeParse(Apply$2(Sanitize(All(Curl,Star(Options),Url,Star(Options)))));function parseCurl(R){const w=parse$7(R);if(w['errors']||!w['results'])return null;const [F]=w['results'];return F;}const {Apply:Apply$1,Mutate:Mutate$1}=State({'type':'fetch'}),URI=Any(Mutate$1(Use(/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/),(R,[w])=>R['url']=w),Mutate$1(Use(/(\S+)/),(R,[w])=>{R['url']=''+(w['startsWith']('/')?'':'/')+w;})),Method=Mutate$1(Use(/(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)/i),(R,[w])=>R['method']=w['toLowerCase']()),HttpVersion=Use(/HTTP\/[0-9.]+/i),Headers$1=All(/\n/,List(Mutate$1(All(Use(/([^:\n]+)/),/:\s*/,Use(/([^\n]*)/)),(R,[w,F])=>{R['headers']??=[],R['headers']['push']({'name':w,'value':F,'secret':![]});}),/\n/)),Body$1=Mutate$1(Use(/(.+)/s),(R,[w])=>{R['body']={'data':w};}),parse$6=makeParse(Apply$1(All(Method,/\s+/,URI,/\s+/,HttpVersion,Optional(Headers$1),Optional(All(/\n\n/,Body$1)))));function parseHttp(R){const w=parse$6(R);if(w['errors']||!w['results'])return null;const F=w['results'][0x0],E=F['headers']?.['find'](u=>u['name']==='Host')?.['value'];if(E)F['url']='https://'+E+F['url'];return F;}function FetchAction(R){const w=['send\x20http'];if(R['method'])w['push'](R['method']);w['push']('request\x20to\x20'+StringExpression(R['url']));const F=[];if(R['auth'])F['push'](Auth(R['auth']));if(R['headers'])R['headers']['forEach'](({name:E,value:u})=>{F['push'](Header({'name':E,'value':u}));});if(R['cookies'])R['cookies']['forEach'](({name:E,value:u})=>{F['push'](Cookie({'name':E,'value':u}));});if(R['body'])F['push'](Body(R['body']));if(F['length']>0x0)w['push'](F['join']('\x20and\x20'));if(R['statuses'])w['push'](Status(R['statuses']));return w['join']('\x20');}function Cookie(R){const w=['with'];if(R['secret'])w['push']('secret');return w['push']('cookie\x20'+StringExpression(R['name'])+'\x20=\x20'+StringExpression(R['value'])),w['join']('\x20');}function Header(R){const w=['with'];if(R['secret'])w['push']('secret');return w['push']('header\x20'+StringExpression(R['name'])+':\x20'+StringExpression(R['value'])),w['join']('\x20');}function Body(R){if(R['type'])return'with\x20'+R['type']+'\x20body\x20'+AnyExpression(R['data']);else return'with\x20body\x20'+AnyExpression(R['data']);}function Status(R){if(R==='*')return'expecting\x20any\x20status\x20code';else return'expecting\x20status\x20code'+(R['length']>0x1?'s':'')+'\x20'+R['join']('\x20or\x20');}function Auth(R,w={}){return'with\x20basic\x20auth\x20'+StringExpression(R['username'])+':'+StringExpression(R['password']);}function ElementReference(R){return R['type']?'that\x20'+ElementType(R['type']):'it';}function ElementDescriptor(R){if('isElementReference'in R)return ElementReference(R);const w=['the'];if(R['nth']!=null)w['push'](OrdinalIndex(R['nth']));if(R['reference'])w['push'](Reference(R['reference'])),w['push'](R['type']?ElementType(R['type'],R['vocabulary']):'element');else{if(R['orderDirection']==='backward'){w['push']('last'),w['push'](R['type']?ElementType(R['type'],R['vocabulary']):'element');if(typeof R['title']==='string')w['push']('with\x20text\x20'+StringExpression(R['title']));else{if(R['title']&&'name'in R['title'])w['push']('with\x20'+R['title']['name']);}}else{if(R['title']&&typeof R['title']==='object'&&'isPattern'in R['title']){w['push'](R['type']?ElementType(R['type']):'element');if('name'in R['title'])w['push']('with\x20'+R['title']['name']);}else{if(typeof R['title']==='string'&&isPatternName(R['title']))w['push'](R['type']?ElementType(R['type']):'element'),w['push']('with\x20text\x20'+StringExpression(R['title']));else{if(R['title']&&typeof R['title']==='string'&&isNamedColor(R['title']))w['push'](R['type']?ElementType(R['type'],R['vocabulary']):'element'),w['push']('with\x20text\x20'+StringExpression(R['title'],{'avoid':'unquoted'}));else{if(typeof R['color']==='string'&&isNamedColor(R['color']))w['push'](R['color']);const F=R['title']!=null&&typeof R['title']==='object'&&('isRef'in R['title']||'isJSExpressionRef'in R['title']||R['title']['chunks']['length']===0x1&&typeof R['title']['chunks'][0x0]!=='string');if(R['title']&&!F)w['push'](StringExpression(R['title'],{'avoid':typeof R['title']==='string'&&isElementType(R['title'])?'unquoted':void 0x0}));w['push'](R['type']?ElementType(R['type'],R['vocabulary']):'element');if(typeof R['color']==='string'&&!isNamedColor(R['color']))w['push']('with\x20color\x20'+StringExpression(R['color']));if(R['title']&&F)w['push']('with\x20text\x20'+StringExpression(R['title']));}}}}}if(R['selector']){if(R['selector']['type']==='css')w['push']('with\x20css\x20selector\x20'+StringExpression(R['selector']['selector'],{'prefer':'single\x20quoted'}));else{if(R['selector']['type']==='xpath')w['push']('with\x20xpath\x20selector\x20'+StringExpression(R['selector']['selector'],{'prefer':'single\x20quoted'}));}}if(R['anchor'])w['push'](Anchor(R['anchor']));return w['join']('\x20');}function ElementType(R,w){R=Array['isArray'](R)?R[0x0]:R;if(w&&w[R])return w[R];switch(R){case'table-cell':return'cell';case'table-head-cell':return'header\x20cell';case'table-row':return'row';case'table-column':return'column';case'table-leaf-row':return'row';case'table-leaf-column':return'column';case'table-stub-column':return'stub\x20column';case'table-head-row':return'header\x20row';case'textbox':return'field';case'inputbox':return'field';case'combobox':return'dropdown';case'datetimepicker':return'date\x20and\x20time\x20picker';case'datepicker':return'date\x20picker';case'timepicker':return'time\x20picker';case'colorpicker':return'color\x20picker';case'radiogroup':return'radio\x20group';case'checkboxgroup':return'checkbox\x20group';case'listitem':return'list\x20item';case'menuitem':return'menu\x20item';case'pdfpage':return'document\x20page';case'tablist':return'tab\x20list';case'tabpanel':return'tab\x20panel';default:return R;}}function Anchor(R){if(Array['isArray'](R)&&R['length']===0x2&&(typeIs(R[0x0],'table-column')||typeIs(R[0x0],'table-row'))&&(typeIs(R[0x1],'table-column')||typeIs(R[0x1],'table-row'))){const E=extractCommonTableAnchor(R[0x0],R[0x1]),u=E?removeDeepestTableAnchor(R[0x0]):R[0x0],M=E?removeDeepestTableAnchor(R[0x1]):R[0x1];let N=Anchor(u)+'\x20and\x20'+Anchor(M);if(E)N+='\x20'+Anchor(E);return N;}const w=Array['isArray'](R)?R[0x0]:R,F=[];if(w['position']==='near')F['push']('near\x20to');else{if(w['position']==='leftof')F['push']('to\x20the\x20left\x20of');else{if(w['position']==='rightof')F['push']('to\x20the\x20right\x20of');else{if(w['position']==='below')F['push']('below\x20of');else{if(w['position']==='above')F['push']('above\x20of');else{if(w['position']==='aboveleftof')F['push']('to\x20the\x20left\x20and\x20above\x20of');else{if(w['position']==='aboverightof')F['push']('to\x20the\x20right\x20and\x20above\x20of');else{if(w['position']==='belowleftof')F['push']('to\x20the\x20left\x20and\x20below\x20of');else{if(w['position']==='belowrightof')F['push']('to\x20the\x20right\x20and\x20below\x20of');else{if(w['position']==='inside'&&typeIs(w,'table'))F['push']('of');else{if(w['position']==='inside')F['push']('in');else{if(w['position']==='left')F['push'](w['element']?'at\x20the\x20left\x20of':'at\x20the\x20left');else{if(w['position']==='right')F['push'](w['element']?'at\x20the\x20right\x20of':'at\x20the\x20right');else{if(w['position']==='top')F['push'](w['element']?'at\x20the\x20top\x20of':'at\x20the\x20top');else{if(w['position']==='bottom')F['push'](w['element']?'at\x20the\x20bottom\x20of':'at\x20the\x20bottom');else{if(w['position']==='topleft')F['push'](w['element']?'at\x20the\x20left\x20and\x20top\x20of':'at\x20the\x20left\x20and\x20top');else{if(w['position']==='topright')F['push'](w['element']?'at\x20the\x20right\x20and\x20top\x20of':'at\x20the\x20right\x20and\x20top');else{if(w['position']==='bottomleft')F['push'](w['element']?'at\x20the\x20left\x20and\x20bottom\x20of':'at\x20the\x20left\x20and\x20bottom');else{if(w['position']==='bottomright')F['push'](w['element']?'at\x20the\x20right\x20and\x20bottom\x20of':'at\x20the\x20right\x20and\x20bottom');}}}}}}}}}}}}}}}}}}if(w['element']){if('isViewportDescriptor'in w['element'])F['push']('the\x20viewport');else{if('isDialogDescriptor'in w['element'])F['push']('the\x20native\x20browser\x20dialog');else F['push'](ElementDescriptor(w['element']));}}return F['join']('\x20');}function Reference(R){if('isRef'in R)return'{'+ReferenceName(R)+'}';else return'{%'+JSExpressionLiteral(R['expression'])+'%}';}function ReferenceName(R){return(R['modifiers']??[])['reduce']((w,F)=>{if('get'in F){if(typeof F['get']==='string')return test(Identifier$1,F['get'])?w+'.'+F['get']:w+'['+StringLiteral(F['get'])+']';else{if(typeof F['get']==='number')return w+'['+F['get']+']';else{if('isRef'in F['get']||'isJSExpressionRef'in F['get'])return w+'['+Reference(F['get'])+']';else{if('isInterpolatedString'in F['get'])return w+'['+InterpolatedStringLiteral(F['get'])+']';}}}}else{if('match'in F){const E=F['match'];if('pattern'in E)return w+'/'+E['pattern']+'/';else{if('name'in E)return w+'/'+E['name']+'/';}return w+'/'+String(E)+'/';}}return w;},R['name']);}function Literal(R,w){if(typeof R==='string')return StringLiteral(R,w?.['quoting']);else return JSON['stringify'](R);}function AnyExpression(R,w){if(R&&typeof R==='object'){if('isInterpolatedString'in R)return InterpolatedStringLiteral(R,w?.['quoting']);else{if('isStructure'in R)return StructureLiteral(R,w);else{if('isRef'in R||'isJSExpressionRef'in R)return Reference(R);else{if('operator'in R)return NumberOperationLiteral(R);}}}return'';}else return Literal(R,w);}function NumberOperationLiteral(R){const [w,F]=R['operands'];return[NumberOperandLiteral(w,{'operator':R['operator'],'position':'left'}),numberOperatorSymbols[R['operator']],NumberOperandLiteral(F,{'operator':R['operator'],'position':'right'})]['join']('\x20');}function NumberOperandLiteral(R,{operator:w,position:F}){const E={'add':0x1,'sub':0x1,'mul':0x2,'div':0x2},u=R['value'];if(u&&typeof u==='object'&&'operator'in u){if(u['operator']==='extract')return ExtractOperationLiteral(u);if(isNumberOperation(u)){const M=NumberOperationLiteral(u),N=E[u['operator']],e=E[w];return N<e||F==='right'&&N===e?'('+M+')':M;}return'';}return AnyExpression(u);}function ExtractOperationLiteral(R){const w={'color':'color','background-color':'background\x20color','foreground-color':'foreground\x20color','any':'value'},[F,E]=R['operands'];return(w[E]??'text')+'\x20of\x20'+ElementDescriptor(F['value']);}function JSExpressionLiteral(R){if(R['chunks']['length']===0x1)return typeof R['chunks'][0x0]==='string'?UnquotedStringLiteral(R['chunks'][0x0]):Reference(R['chunks'][0x0]);return R['chunks']['reduce']((w,F)=>{return w+(typeof F==='string'?UnquotedStringChunk(F):Reference(F));},'');}function StructureLiteral(R,w){if(R['type']==='array')return'['+R['items']['map'](F=>AnyExpression(F,w))['join'](',\x20')+']';else return'{'+R['items']['map'](F=>StringExpression(F['key'],w?.['quoting'])+':\x20'+AnyExpression(F['value'],w))['join'](',\x20')+'}';}function StringExpression(R,w){if(typeof R==='string')return StringLiteral(R,w);else{if('isInterpolatedString'in R)return InterpolatedStringLiteral(R,w);else return Reference(R);}}function Quoted(R,w='double\x20quoted'){if(w==='double\x20quoted')return DoubleQuoted(R);else{if(w==='single\x20quoted')return SingleQuoted(R);else{if(w==='unquoted')return R;else return'';}}}function DoubleQuoted(R){return'\x22'+R+'\x22';}function SingleQuoted(R){return'\x27'+R+'\x27';}function includesParens(R){return/[()]/['test'](R);}function StringLiteral(R,w){if(w?.['prefer']&&w['prefer']!==w?.['avoid']){if(w['prefer']==='unquoted'&&!R['includes']('\x20')&&!includesParens(R)&&!/^['"]|^[\d,.]+$/['test'](R))return UnquotedStringChunk(R);else{if(w['prefer']==='double\x20quoted'&&!R['includes']('\x22'))return DoubleQuoted(DoubleQuotedStringChunk(R));else{if(w['prefer']==='single\x20quoted'&&!R['includes']('\x27'))return SingleQuoted(SingleQuotedStringChunk(R));}}}if(w?.['avoid']!=='unquoted'&&!R['includes']('\x20')&&!includesParens(R)&&!/^['"]/['test'](R))return UnquotedStringChunk(R);if(w?.['avoid']!=='double\x20quoted'&&!R['includes']('\x22'))return DoubleQuoted(DoubleQuotedStringChunk(R));else{if(w?.['avoid']!=='single\x20quoted'&&!R['includes']('\x27'))return SingleQuoted(SingleQuotedStringChunk(R));else return w?.['avoid']!=='double\x20quoted'?DoubleQuoted(DoubleQuotedStringChunk(R)):SingleQuoted(SingleQuotedStringChunk(R));}}function UnquotedStringLiteral(R){return UnquotedStringChunk(R);}function InterpolatedStringLiteral(R,w){if(R['chunks']['length']===0x1)return typeof R['chunks'][0x0]==='string'?StringLiteral(R['chunks'][0x0],w):Reference(R['chunks'][0x0]);const F=R['chunks']['reduce']((u,M,N)=>{if(typeof M==='string'){if(M['includes']('\x20')||includesParens(M)||N===0x0&&/^['"]/['test'](M))u['delete']('unquoted');else{if(M['includes']('\x22'))u['delete']('double\x20quoted');else{if(M['includes']('\x27'))u['delete']('single\x20quoted');}}}return u;},new Set(['unquoted','double\x20quoted','single\x20quoted']));if(w?.['avoid'])F['delete'](w?.['avoid']);const E=[...F][0x0]??(w?.['avoid']!=='double\x20quoted'?'double\x20quoted':'single\x20quoted');return Quoted(R['chunks']['reduce']((u,M)=>{return u+(typeof M==='string'?StringChunk(M,E):Reference(M));},''),E);}function StringChunk(R,w='double\x20quoted'){if(w==='unquoted')return UnquotedStringChunk(R);else{if(w==='double\x20quoted')return DoubleQuotedStringChunk(R);else{if(w==='single\x20quoted')return SingleQuotedStringChunk(R);else return'';}}}function UnquotedStringChunk(R){return R['replaceAll'](/[{]|\\(?=[\{])/g,(w,F)=>{return w==='{'&&!startsWith$2(Reference$1('any'),R['substring'](F))?w:'\x5c'+w;});}function SingleQuotedStringChunk(R){return R['replaceAll'](/['{]|\\(?=[\'{])/g,(w,F)=>{return w==='{'&&!startsWith$2(Reference$1('any'),R['substring'](F))?w:'\x5c'+w;});}function DoubleQuotedStringChunk(R){return R['replaceAll'](/["{]|\\(?=[\"{])/g,(w,F)=>{return w==='{'&&!startsWith$2(Reference$1('any'),R['substring'](F))?w:'\x5c'+w;});}function OrdinalIndex(R){return OrdinalNumberExpression(typeof R==='number'?R+0x1:R);}function OrdinalNumberExpression(R){if(typeof R==='number')return OrdinalNumberLiteral(R);else{if('isRef'in R||'isJSExpressionRef'in R)return Reference(R);else return'';}}function OrdinalNumberLiteral(R){if(R===0x1)return'first';else{if(R===0x2)return'second';else{if(R===0x3)return'third';}}const w=R%0x64;if(w>=0xb&&w<=0xd)return R+'th';switch(R%0xa){case 0x1:return R+'st';case 0x2:return R+'nd';case 0x3:return R+'rd';default:return R+'th';}}function typeIs(R,w){return Boolean(R&&R['element']&&'type'in R['element']===!![]&&R['element']['type']===w);}function findDeepestTableAnchor(R){if(!R['element']||'isViewportDescriptor'in R['element']||'isDialogDescriptor'in R['element']||'isElementReference'in R['element'])return;if(typeIs(R,'table')){if(R['element']['anchor']&&!Array['isArray'](R['element']['anchor']))return findDeepestTableAnchor(R['element']['anchor'])||R;return R;}if(R['element']['anchor']&&!Array['isArray'](R['element']['anchor']))return findDeepestTableAnchor(R['element']['anchor']);}function extractCommonTableAnchor(R,w){const F=findDeepestTableAnchor(R),E=findDeepestTableAnchor(w);if(!F||!E)return;if(F['position']===E['position']&&F['element']&&E['element']){const u=F['element'],M=E['element'];if(!('isElementReference'in u)&&!('isElementReference'in M)&&'type'in u&&'type'in M&&u['type']===M['type']&&u['title']===M['title'])return F;}}function removeDeepestTableAnchor(R){if(!R['element']||'isViewportDescriptor'in R['element']||'isDialogDescriptor'in R['element']||'isElementReference'in R['element']||Array['isArray'](R['element']['anchor']))return R;if(R['element']['anchor']&&!Array['isArray'](R['element']['anchor'])&&typeIs(R['element']['anchor'],'table')){const w=R['element']['anchor'];if(w['element']&&!('isViewportDescriptor'in w['element'])&&!('isDialogDescriptor'in w['element'])&&!('isElementReference'in w['element'])&&!w['element']['anchor']){const {anchor:F,...E}=R['element'];return{...R,'element':E};}}if(R['element']['anchor']&&!Array['isArray'](R['element']['anchor']))return{...R,'element':{...R['element'],'anchor':removeDeepestTableAnchor(R['element']['anchor'])}};return R;}const cache=new Map();function getParse({allowed:R,disabled:w}){const F=(R?R['toSorted']()['join'](','):'*')+'|'+(w?w['toSorted']()['join'](','):'');let E=cache['get'](F);if(!E)cache['set'](F,E=makeParse(Instructions({'allowed':R,'disabled':w})));return E;}function parseText(R,{split:w,fix:F,mask:E,replacements:u,intent:intent=!![],locale:locale=DEFAULT_LOCALE,allowed:M,disabled:N}={}){let e=0x0;for(const f of u??[]){R=replace(R,f['pos']+e,f['length'],f['text']),e+=f['text']['length']-f['length'];}const l=getParse({'allowed':M,'disabled':N})(R,{'intent':intent,'locale':locale});if(F&&l['errors']){const t=parseCurl(R);if(t)return parseText(FetchAction(t),{'split':w,'intent':intent,'fix':F,'mask':E,'locale':locale});const W=parseHttp(R);if(W)return parseText(FetchAction(W),{'split':w,'intent':intent,'fix':F,'mask':E,'locale':locale});}if(F&&l['fixes']&&!l['errors'])return parseText(l['fixes']['sort']((i,K)=>K['pos']-i['pos'])['reduce']((i,{pos:K,text:s,fix:Q})=>replace(i,K,s['length'],Q),R),{'split':w,'mask':E,'intent':intent,'locale':locale});if(w&&!l['errors']){const i=[];for(let K=l['markers']['length']-0x1;K>=0x0;--K){const s=l['markers'][K];if(s['type']==='action'||s['type']==='dependent\x20action'||s['type']==='control\x20flow'){const Q=i[0x0];if(!Q||Q['pos']>s['pos']){if(Q&&Q['type']==='dependent\x20action'&&s['type']!=='control\x20flow')i[0x0]={...s,'text':R['substring'](s['pos'],Q['pos']+Q['text']['length'])};else{if(Q&&s['subtype']==='else'&&Q['subtype']==='if')i[0x0]={...s,'text':R['substring'](s['pos'],Q['pos']+Q['text']['length'])};else i['unshift'](s);}}}}if(i['length']>0x1)return nestPieces(i['map'](k=>({'pos':k['pos'],'result':parseText(k['text'],{'intent':intent,'mask':E,'locale':locale})[0x0]})),l['markers']['filter'](k=>k['type']==='block'));}const Y=l['results']?.[0x0]??[],I={'text':R,'result':Y,'meta':{}};I['meta']['instructions']=Y['map'](k=>k['type']);if(l['fixes'])I['meta']['fixes']=l['fixes'];if(l['disambiguations'])I['meta']['disambiguations']=l['disambiguations'];if(l['variables'])I['meta']['variables']=l['variables'];if(l['extractors'])I['meta']['extractors']=l['extractors'];if(l['operands'])I['meta']['operands']=l['operands'];if(l['randomValues'])I['meta']['randomValues']=l['randomValues'];if(l['files'])I['meta']['files']=l['files'];if(l['fetches'])I['meta']['fetches']=l['fetches'];if(l['intents'])I['meta']['intents']=l['intents'];if(l['conditionals'])I['meta']['conditional']=l['conditionals'][0x0];if(l['scopes'])I['meta']['scope']=l['scopes']['at'](-0x1);l['references']&&(I['meta']['references']=l['references'],I['meta']['parameters']=l['references']['reduce']((k,S)=>{if(!S['binding']&&!k['some'](a=>a['name']===S['name'])&&!l['variables']?.['some'](a=>a['name']===S['name']))k['push']({'name':S['name'],'type':S['type']});return k;},[]));if(l['markers']){I['meta']['markers']=l['markers']['filter'](S=>S['type']!=='empty'&&S['type']!=='block');const k=I['meta']['markers']['reduce']((S,a)=>{if(a['type']==='navigation\x20url')S['push'](a['text']['replaceAll'](/^['"]|['"]$/g,''));return S;},[]);if(k['length']>0x0)I['meta']['navigationUrls']=k;}if(l['errors']?.[0x0])I['error']=l['errors'][0x0];if(E){const S=maskText(R,{'meta':I['meta']});I['text']=S['text'],I['meta']=S['meta'];}return registerInstructionTexts(I),[I];}function nestPieces(R,w){function F(M){return w['reduce']((N,e)=>e['pos']<=M&&M<e['pos']+e['text']['length']?N+0x1:N,0x0);}const E=[],u=[];for(const M of R){const N=F(M['pos']);while(u['length']>0x0&&u['at'](-0x1)['depth']>=N)u['pop']();const e={'result':M['result'],'children':[]};(u['at'](-0x1)?.['node']['children']??E)['push'](e),u['push']({'node':e,'depth':N});}return E['map'](function l(Y){return Y['children']['length']>0x0?{'head':Y['result'],'body':Y['children']['map'](l)}:Y['result'];});}[...new Set([{'category':'action','snippet':'click\x20the\x20\x22Zqx\x22\x20button','require':'action'},{'category':'control\x20flow','snippet':'if\x20\x22Zqx\x22\x20is\x20\x22Zqy\x22\x20click\x20the\x20\x22Zqx\x22\x20button','require':'control\x20flow'},{'category':'element\x20descriptor','snippet':'the\x20\x22Zqx\x22\x20button','require':'element\x20descriptor'},{'category':'element\x20type','snippet':'button','within':'element\x20descriptor'},{'category':'anchor','snippet':'below\x20the\x20\x22Zqx\x22\x20heading','require':'anchor'},{'category':'condition','snippet':'\x22Zqx\x22\x20is\x20\x22Zqy\x22','forbid':'value'},{'category':'unary\x20operator','snippet':'is\x20visible','forbid':'value'},{'category':'binary\x20operator','snippet':'is\x2042','require':'operand'},{'category':'boolean\x20operator','snippet':'and\x20\x22Zqx\x22\x20is\x20\x22Zqy\x22','forbid':'value'},{'category':'string','snippet':'\x22Zqx\x22','require':'string'},{'category':'number','snippet':'42','require':'number'},{'category':'reference','snippet':'{zqx}','require':'reference'},{'category':'timespan','snippet':'5\x20seconds','forbid':'value'},{'category':'timespan','snippet':'seconds','forbid':'string','after':'number'},{'category':'distance','snippet':'30\x20px','forbid':'value'},{'category':'distance','snippet':'px','forbid':'string','after':'number'},{'category':'times','snippet':'3\x20times','forbid':'value'},{'category':'times','snippet':'times','forbid':'string','after':'number'},{'category':'url','snippet':'https://zqx.example.com','require':'navigation\x20url'}]['map'](R=>R['category']))];const Currency=Any(Any(/USD/i,/\$/,/U\.?S\.?\s*D(?:ollars?)?/i,/United\s*States\s*D(?:ollars?)?/i),Any(/EUR?O?s?/i,/€/),Any(/GBP/i,/£/,/Pounds?\s*(?:Sterling)?/i,/Great\s*Britain\s*Pounds?/i),Any(/JPY/i,/¥/,/(?:Japanese\s*)?Yen/i),Any(/CHF/i,/Fr\.?/i,/(?:Swiss\s*)?Francs?/i),Any(/CAD/i,/C(?:an)?\$/,/Canad(?:ian|a)\s*D(?:ollars?)?/i),Any(/AUD/i,/A(?:us)?\$/,/Austral(?:ian|ia)\s*D(?:ollars?)?/i),Any(/NZD/i,/NZ\$/,/New\s*Zealand\s*D(?:ollars?)?/i),Any(/CNY/i,/RMB/i,/CN¥/,/元/,/(?:Chinese\s*)?Yuan/i,/Renminbi/i),Any(/HKD/i,/HK\$/,/Hong\s*Kong\s*D(?:ollars?)?/i),Any(/SGD/i,/S\$/,/Singapore\s*D(?:ollars?)?/i),Any(/KRW/i,/₩/,/(?:South\s*)?Korean\s*Won/i),Any(/INR/i,/₹/,/Rs\.?/i,/(?:Indian\s*)?Rupees?/i),Any(/SEK/i,/(?:Swedish\s*)?Kron(?:a|or)/i),Any(/NOK/i,/(?:Norwegian\s*)?Kron(?:e|er)/i),Any(/TRY/i,/₺/,/TL/i,/(?:Turkish\s*)?Liras?/i),Any(/MXN/i,/Mex\$/,/(?:Mexican\s*)?Pesos?/i),Any(/BRL/i,/R\$/,/(?:Brazilian\s*)?Re(?:al|ais)/i),Any(/ZAR/i,/Rand/i,/R/)),SUPPORTED_LOCALES=['en','tr','es','fr','de','it','pt','he'];function getMonthsPattern(R){const w=new Set(),F=new Intl['DateTimeFormat'](R,{'month':'long'}),E=new Intl['DateTimeFormat'](R,{'month':'short'});for(let M=0x0;M<0xc;M++){const N=new Date(0x7d0,M,0x1);w['add'](F['format'](N)['toLowerCase']()),w['add'](E['format'](N)['toLowerCase']());}const u=Array['from'](w)['join']('|');return Use(new RegExp(u,'i'));}const Month=Any(...SUPPORTED_LOCALES['map'](R=>getMonthsPattern(R))),DateDelim=/[\/\-\.]/,TimeValue=Use(/(?:\d{1,2}:\d{2}(?::\d{2})?(?:\s*[ap]m)?)|(?:\d{1,2}\s*[ap]m)/i),TimeZone=Any(/Z/i,All(/[+-]/,/\d{2}/,Optional(All(/:?/,/\d{2}/)))),Year=/\d{4}/,IsoDate=All(Year,/-/,/\d{2}/,/-/,/\d{2}/,Optional(All(/T|\s+/,TimeValue,Optional(TimeZone)))),NumericDate=All(/\d{1,2}/,DateDelim,/\d{1,2}/,DateDelim,/\d{2,4}/),TextDateMonthFirst=All(Month,Optional(/\./),Optional(/\s+/),OrdinalNumberLiteral$1,Optional(All(/,?\s+/,Year))),TextDateDayFirst=All(OrdinalNumberLiteral$1,Optional(/\s+/),Optional(Of),Optional(/\s+/),Month,Optional(/\.?/),Optional(All(/,?\s+/,Year))),DateValue=Mark(Any(IsoDate,NumericDate,All(Month,Optional(/\./),Optional(/\s+/),Any(OrdinalNumberLiteral$1,NonnegativeIntegerNumberLiteral),Optional(/,/),/\s+/,Year),TextDateMonthFirst,TextDateDayFirst),{'type':'date'}),NumberValue=NumericLiteral,Percentage=Any(All(Optional(/[-+]/),Any(All(/%/,Optional(/\s+/),QuantitativeNumberLiteral),NoBoundary(All(QuantitativeNumberLiteral,Optional(/\s+/),/%/)))),Mark(All(QuantitativeNumberLiteral,Optional(/\s+/),Percentage$1),{'type':'percentage'})),Price=Mark(Any(All(NumericLiteral,Optional(/\s+/),Currency),All(Currency,Optional(/\s+/),NumericLiteral),All(/-/,Optional(/\s+/),Currency,Optional(/\s+/),QuantitativeNumberLiteral)),{'type':'price'}),Identifier=Mark(Any(/\S+/),{'type':'identifier'});Sanitize$1(StructureLiteral$1);const store=new WeakMap();function unseal(R){return store['get'](R);}function Fragment(R){return All(Sanitize$1(R),Optional(TrailingComment));}function parseElementFragment(R,{locale:w}={}){const F=makeParse(Fragment(Element$2()))(R['trim'](),{'locale':w});return{'text':R,'result':F['results']?.[0x0],'error':F['errors']?.[0x0],'meta':{'markers':F['markers']}};}const {Apply,Mutate}=State({'colon':![]}),HookHead=Any(...[[BeforeAllHook,'before\x20all'],[BeforeEachHook,'before\x20each'],[AfterEachHook,'after\x20each'],[AfterAllHook,'after\x20all']]['map'](([R,w])=>Mutate(Mark(R,{'type':'keyword'}),F=>F['kind']=w))),Name=Mutate(Mark(QuotedStringLiteral(),{'type':'declaration\x20name'}),(R,[w])=>R['name']=w),TestHead=All(Mutate(Mark(TestKeyword,{'type':'keyword'}),R=>R['kind']='test'),Name),Parameter=Mutate(Mark(Node(StringLiteral$1({'escape':/:/}),([R])=>String(R)['toLowerCase']()),{'type':'binding\x20name'}),(R,[w])=>(R['parameters']??=[])['push'](w)),FunctionHead=All(Mutate(Mark(FunctionKeyword,{'type':'keyword'}),R=>R['kind']='function'),Name,Optional(All(Mark(With,{'type':'keyword'}),List(Parameter,AndListSeparator)))),Colon=Mutate(Mark(/:/,{'type':'keyword'}),R=>R['colon']=!![]);All(Sanitize$1(Apply(All(Any(HookHead,TestHead,FunctionHead),Optional(Colon)))),Optional(TrailingComment));const parse$2=makeParse(Any(Index(OrdinalNumberLiteral$1),NonnegativeIntegerNumberLiteral,CardinalNumberLiteral));function parseIndex(R){if(typeof R==='number')return Number['isInteger'](R)&&R>=0x0?R:null;if(typeof R!=='string')return null;const {results:w,errors:F}=parse$2(R['trim']()['toLowerCase']());return!F?.['length']&&Number['isInteger'](w?.[0x0])?w[0x0]:null;}const PATTERNS$1={'price':Price,'percentage':Percentage,'number':NumberValue,'date':DateValue,'time':TimeValue,'code':Identifier},SEPARATORS=new RegExp('['+[...new Set(NUMBER_FORMAT_LOCALES['flatMap'](R=>[numberFormat(R)['group'],numberFormat(R)['decimal']]))]['map'](R=>RegExp['escape'](R))['join']('')+']');function extractPattern(R,w,{locale:F}={}){const E=PATTERNS$1[R];if(!E)return null;return conventions(w,{'locale':F})['reduce']((u,M)=>{const N=search(E,w,{'locale':M})?.['text'];return N&&(!u||N['length']>u['length'])?N:u;},null);}function extractNumber(R,{locale:w,preferredLocale:F}={}){const E=conventions(R,{'locale':w,'preferredLocale':F})['reduce']((u,M)=>{const N=search(NumberValue,R,{'locale':M});return N&&(!u||N['text']['length']>u['text']['length'])?{...N,'locale':M}:u;},null);return E&&{'text':E['text'],'pos':E['pos'],'value':Number['parseFloat'](normalizeNumericString(E['text'],E['locale']))};}function conventions(R,{locale:w,preferredLocale:F}){if(w)return[w];if(!SEPARATORS['test'](R))return[DEFAULT_LOCALE];if(!F)return NUMBER_FORMAT_LOCALES;return NUMBER_FORMAT_LOCALES['toSorted']((E,u)=>Number(sameConvention(u,F))-Number(sameConvention(E,F)));}function sameConvention(R,w){const F=numberFormat(R),E=numberFormat(w);return F['group']===E['group']&&F['decimal']===E['decimal'];}function brandedHasInstance(R,w){return function(F){if(this!==R)return Function['prototype'][Symbol['hasInstance']]['call'](this,F);return typeof F==='object'&&F!==null&&F[w]===!![];};}function classBrand(R){return Symbol['for']('@applitools/nlp-utils.'+R);}function setBrand(R,w){Object['defineProperty'](R,w,{'value':!![]});}const EVENT_TARGET_BRAND=classBrand('EventTarget');var EventTarget$1=class EventTarget$1 extends globalThis['EventTarget']{static [Symbol['hasInstance']]=brandedHasInstance(EventTarget$1,EVENT_TARGET_BRAND);#listeners=new Map();#queue=new Set();#corked=![];#groups=new Map();#addListener(R,w){if(this.#listeners['has'](R))this.#listeners['get'](R)['add'](w);else this.#listeners['set'](R,new Set([w]));this['addEventListener'](R,w);if(R!=='listenerAdded'&&R!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerAddedEvent({'event':R,'count':this.#listeners['get'](R)['size']}));}#addOnceListener(R,w){if(this.#listeners['has'](R))this.#listeners['get'](R)['add'](w);else this.#listeners['set'](R,new Set([w]));this['addEventListener'](R,F=>{w(F),this.#listeners['get'](R)?.['delete'](w);if(R!=='listenerAdded'&&R!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerRemovedEvent({'event':R,'count':this.#listeners['get'](R)['size']}));},{'once':!![]});if(R!=='listenerAdded'&&R!=='listenerRemoved')super['dispatchEvent'](new EventTargetListenerAddedEvent({'event':R,'count':this.#listeners['get'](R)['size']}));}#removeListener(R,w){this.#listeners['get'](R)?.['delete'](w),this['removeEventListener'](R,w);}get['corked'](){return this.#corked;}constructor(){super(),setBrand(this,EVENT_TARGET_BRAND);}['dispatch'](R){this['dispatchEvent'](R);}['on'](R,w,F){this.#addListener(R,w);const E=()=>this['off'](R,w);if(F?.['key']){let u=this.#groups['get'](F['key']);if(!u)this.#groups['set'](F['key'],u=[]);u['push'](E);}return E;}['once'](R,w,F){if(w){this.#addOnceListener(R,w);const E=()=>this['off'](R,w);if(F?.['key']){let u=this.#groups['get'](F['key']);if(!u)this.#groups['set'](F['key'],u=[]);u['push'](E);}return E;}else return new Promise(M=>this.#addOnceListener(R,M));}['off'](R,w){if(!R)this.#listeners['forEach']((F,E)=>F['forEach'](u=>this.#removeListener(E,u))),this.#listeners['clear']();else{if(!w){if(this.#listeners['has'](R)){const F=R;this.#listeners['get'](F)?.['forEach'](E=>this.#removeListener(F,E)),this.#listeners['delete'](F);}else{const E=R;this.#groups['get'](E)?.['forEach'](u=>u()),this.#groups['delete'](E);}}else{const u=R;this.#removeListener(u,w);}}}['cork'](){this.#corked=!![];}['uncork'](){this.#corked=![],this.#queue['forEach'](R=>this['dispatch'](R)),this.#queue['clear']();}['dispatchEvent'](R){if(this.#corked)return this.#queue['add'](R),![];return super['dispatchEvent'](R);}['addEventListener'](R,w,F){return super['addEventListener'](R,w,F);}['removeEventListener'](R,w,F){return super['removeEventListener'](R,w,F);}},EventTargetListenerAddedEvent=class extends Event{['event'];['count'];constructor({event:R,count:w}){super('listenerAdded'),this['event']=R,this['count']=w;}},EventTargetListenerRemovedEvent=class extends Event{['event'];['count'];constructor({event:R,count:w}){super('listenerRemoved'),this['event']=R,this['count']=w;}};function on(R,w,F){return R['addEventListener'](w,F),()=>R['removeEventListener'](w,F);}function once$1(R,w,F){return R['addEventListener'](w,F,{'once':!![]}),()=>R['removeEventListener'](w,F);}async function abortable(R,w){if(w){if(w['aborted'])return Promise['reject'](w['reason']);let F;const E=new Promise((u,M)=>{F=once$1(w,'abort',()=>{M(w['reason']);});});return Promise['race']([R['finally'](()=>F()),E]);}else return R;}const EVENT_TARGET_NODE_BRAND=classBrand('EventTargetNode');var EventTargetNode=class EventTargetNode extends EventTarget$1{static [Symbol['hasInstance']]=brandedHasInstance(EventTargetNode,EVENT_TARGET_NODE_BRAND);constructor(){super(),setMaxListeners(0x64,this),setBrand(this,EVENT_TARGET_NODE_BRAND);}};const debugLogger={'log':(R,w)=>debuglog('nlp:runner')('%s\x20%o',R,w),'error':(R,w)=>debuglog('nlp:runner:error')('%s\x20%o',R,w),'trace':(R,w)=>debuglog('nlp:runner:trace')('%s\x20%o',R,w),'debug':(R,w)=>debuglog('nlp:runner:debug')('%s\x20%o',R,w)};let activeLogger=debugLogger;function use(R){activeLogger=R??debugLogger;}function log(R,w){activeLogger['log'](R,w);}function error(R,w){activeLogger['error'](R,w);}function trace(R,w){activeLogger['trace'](R,w);}function debug(R,w){activeLogger['debug'](R,w);}function serializeError(R){if(R instanceof Error){const w={'name':R['name'],'message':R['message']};if(R['stack'])w['stack']=R['stack'];const F=R['code'];if(typeof F==='string')w['code']=F;if(R['cause']!==void 0x0)w['cause']=serializeError(R['cause']);return w;}return{'name':'Error','message':typeof R==='string'?R:inspect(R,{'depth':0x3})};}const LEVEL_WEIGHT={'trace':0x0,'debug':0x1,'info':0x2,'error':0x3};function makeEventLogger({downstream:R}={}){const w=new Set();function F(u,M,N){E['downstream']?.[levelMethod(u)](M,N);if(LEVEL_WEIGHT[u]<LEVEL_WEIGHT[E['minLevel']]||w['size']===0x0)return;const e={'type':M,'level':u,'timestamp':Date['now'](),'data':serializeErrors(N)};for(const l of w)try{l(e);}catch{}}const E={'minLevel':'trace','downstream':R,'log':(u,M)=>F('info',u,M),'error':(u,M)=>F('error',u,M),'trace':(u,M)=>F('trace',u,M),'debug':(u,M)=>F('debug',u,M),'onLog'(u){return w['add'](u),()=>w['delete'](u);}};return E;}function levelMethod(R){return R==='info'?'log':R;}function serializeErrors(R){let w;for(const [F,E]of Object['entries'](R))E instanceof Error&&(w??={...R},w[F]=serializeError(E));return w??R;}const COLOR_BRAND=classBrand('Color');var Color=class Color{static [Symbol['hasInstance']]=brandedHasInstance(Color,COLOR_BRAND);['r'];['g'];['b'];['a'];constructor(R,w,F,E=0x1){this['r']=R,this['g']=w,this['b']=F,this['a']=E,setBrand(this,COLOR_BRAND);}static['from'](R){return new Color(R['r'],R['g'],R['b'],R['a']);}['toString'](){return colorToString(this);}['equals'](R,w=0x5){return Math['abs'](this['r']-R['r'])<=w&&Math['abs'](this['g']-R['g'])<=w&&Math['abs'](this['b']-R['b'])<=w&&Math['abs'](this['a']-R['a'])<=w;}['toRGBAString'](){return'rgba('+this['r']+',\x20'+this['g']+',\x20'+this['b']+',\x20'+this['a']+')';}['diff'](R){return differenceHyab()(this['toCulori'](),R['toCulori']())/0x15e;}['getColorFamily'](){const R=nearest(colorFamilies['flatMap'](w=>w['colors']),differenceHyab())(this['toCulori']())[0x0];return colorFamilies['find'](w=>w['colors']['includes'](R))?.['name']||'unknown';}['similarTo'](R,w=0.75){return this['getSimilarity'](R)>=w;}['getSimilarity'](R){const w=this['getColorFamily']()===R['getColorFamily']();return Math['min']((0x1-this['diff'](R))*(w?1.2:0.8),0x1);}['toCulori'](){return{'mode':'rgb','r':this['r']/0xff,'g':this['g']/0xff,'b':this['b']/0xff,'alpha':this['a']};}static['fromCulori'](R){const w=rgb(R);return new Color(w['r']*0xff,w['g']*0xff,w['b']*0xff,R['alpha']);}};function stringToColor(R){const w=R?.['trim']();if(!w)return null;const F=parse(w['replace'](/\s/g,'')['toLowerCase']());if(F)return Color['fromCulori'](F);const E=getKnownColor(w);if(E)return new Color(E['r'],E['g'],E['b'],0x1);const {rgba:u}=j(w);if(u){const [M,N,e,l]=u;return new Color(clampByte(M),clampByte(N),clampByte(e),clampAlpha(l));}return null;}function stringToColorOrThrow(R){const w=stringToColor(R);if(w===null)throw new Error('Invalid\x20color\x20string:\x20'+R);return w;}function objectToColor(R){if(R==null)return null;if(!('r'in R)||!('g'in R)||!('b'in R))return null;return new Color(R['r'],R['g'],R['b'],'a'in R?R['a']:0x1);}let knownColors=null;function getKnownColor(R){function w(F){return F['toLowerCase']()['replaceAll']('\x20','');}if(!knownColors)knownColors=Object['fromEntries'](colornames['map'](({name:F,hex:E})=>{return[w(F),{'r':parseInt(E['slice'](0x1,0x3),0x10),'g':parseInt(E['slice'](0x3,0x5),0x10),'b':parseInt(E['slice'](0x5,0x7),0x10)}];}));return knownColors[w(R)];}function clampByte(R){if(Number['isNaN'](R))return NaN;return Math['max'](0x0,Math['min'](0xff,R|0x0));}function clampAlpha(R){if(Number['isNaN'](R))return NaN;return Math['max'](0x0,Math['min'](0x1,R));}function colorToString(R){const w=colornames['find'](({hex:F})=>F===rgbaToHex(R));if(w)return w['name']['toLowerCase']()['replaceAll']('\x20','');return'rgba('+R['r']+',\x20'+R['g']+',\x20'+R['b']+',\x20'+R['a']+')';}function rgbaToHex(R){return'#'+R['r']['toString'](0x10)['padStart'](0x2,'0')+R['g']['toString'](0x10)['padStart'](0x2,'0')+R['b']['toString'](0x10)['padStart'](0x2,'0');}const colorFamilies=[{'name':'red','colors':['#CD5C5C','#F08080','#FA8072','#E9967A','#FFA07A','#DC143C','#FF0000','#B22222','#8B0000']},{'name':'pink','colors':['#FFC0CB','#FFB6C1','#DB7093','#FF69B4','#FF1493','#C71585']},{'name':'orange','colors':['#FFA07A','#FF7F50','#FF6347','#FF4500','#FF8C00','#FFA500']},{'name':'yellow','colors':['#FFFFE0','#FFFACD','#FAFAD2','#FFEFD5','#FFE4B5','#FFDAB9','#EEE8AA','#FFD700','#FFFF00','#F0E68C','#BDB76B']},{'name':'purple','colors':['#E6E6FA','#D8BFD8','#DDA0DD','#EE82EE','#DA70D6','#FF00FF','#BA55D3','#9370DB','#7B68EE','#6A5ACD','#663399','#8A2BE2','#9400D3','#9932CC','#8B008B','#800080','#4B0082','#483D8B']},{'name':'green','colors':['#ADFF2F','#7FFF00','#7CFC00','#9ACD32','#6B8E23','#808000','#556B2F','#00FF00','#32CD32','#98FB98','#90EE90','#228B22','#008000','#006400','#00FA9A','#00FF7F','#3CB371','#2E8B57','#66CDAA','#8FBC8B','#20B2AA','#008B8B','#008080']},{'name':'blue','colors':['#00FFFF','#E0FFFF','#AFEEEE','#7FFFD4','#40E0D0','#48D1CC','#00CED1','#5F9EA0','#B0E0E6','#ADD8E6','#87CEEB','#87CEFA','#00BFFF','#1E90FF','#4682B4','#B0C4DE','#6495ED','#7B68EE','#4169E1','#0000FF','#0000CD','#00008B','#000080','#191970']},{'name':'brown','colors':['#FFF8DC','#FFEBCD','#FFE4C4','#FFDEAD','#F5DEB3','#DEB887','#D2B48C','#BC8F8F','#F4A460','#DAA520','#B8860B','#CD853F','#D2691E','#8B4513','#A0522D','#A52A2A','#800000']},{'name':'white','colors':['#FFFFFF','#FFFAFA','#F0FFF0','#F5FFFA','#F0FFFF','#F0F8FF','#F8F8FF','#F5F5F5','#FFF5EE','#F5F5DC','#FDF5E6','#FFFAF0','#FFFFF0','#FAEBD7','#FAF0E6','#FFF0F5','#FFE4E1']},{'name':'gray','colors':['#DCDCDC','#D3D3D3','#C0C0C0','#A9A9A9','#808080','#696969','#778899','#708090','#2F4F4F']},{'name':'black','colors':['#000000']}],POINT_BRAND=classBrand('Point');var Point=class Point{static [Symbol['hasInstance']]=brandedHasInstance(Point,POINT_BRAND);['x'];['y'];constructor(R,w){this['x']=R,this['y']=w,setBrand(this,POINT_BRAND);}['equals'](R,w=0.1){return Math['abs'](this['x']-R['x'])<w&&Math['abs'](this['y']-R['y'])<w;}['distance'](R){return Math['hypot'](this['x']-R['x'],this['y']-R['y']);}};const VECTOR_BRAND=classBrand('Vector');var Vector=class Vector{static [Symbol['hasInstance']]=brandedHasInstance(Vector,VECTOR_BRAND);static ['down']=new Vector(0x0,0x1);static ['left']=new Vector(-0x1,0x0);static ['right']=new Vector(0x1,0x0);static ['up']=new Vector(0x0,-0x1);static ['leftUp']=new Vector(-0x1,-0x1);static ['rightUp']=new Vector(0x1,-0x1);static ['leftDown']=new Vector(-0x1,0x1);static ['rightDown']=new Vector(0x1,0x1);static['fromPoints'](R,w){return new Vector(w['x']-R['x'],w['y']-R['y']);}['x'];['y'];constructor(R,w){this['x']=R,this['y']=w,setBrand(this,VECTOR_BRAND);}get['magnitude'](){return Math['hypot'](this['x'],this['y']);}['cross'](R){return this['x']*R['y']-this['y']*R['x'];}['dot'](R){return this['x']*R['x']+this['y']*R['y'];}};const SEGMENT_BRAND=classBrand('Segment');var Segment=class Segment{static [Symbol['hasInstance']]=brandedHasInstance(Segment,SEGMENT_BRAND);['start'];['end'];constructor(R,w){this['start']=R instanceof Point?R:new Point(R['x'],R['y']),this['end']=w instanceof Point?w:new Point(w['x'],w['y']),setBrand(this,SEGMENT_BRAND);}['toOrthogonal'](){const R=Math['abs'](this['end']['x']-this['start']['x'])<=Math['abs'](this['end']['y']-this['start']['y'])?new Point(this['end']['x'],this['start']['y']):new Point(this['start']['x'],this['end']['y']);return[new Segment(this['start'],R),new Segment(R,this['end'])];}['contains'](R){const w=Vector['fromPoints'](this['start'],this['end']),F=Vector['fromPoints'](this['start'],R);if(w['cross'](F)!==0x0)return![];return Math['min'](this['start']['x'],this['end']['x'])<=R['x']&&R['x']<=Math['max'](this['start']['x'],this['end']['x'])&&Math['min'](this['start']['y'],this['end']['y'])<=R['y']&&R['y']<=Math['max'](this['start']['y'],this['end']['y']);}};const RECTANGLE_BRAND=classBrand('Rectangle');var Rectangle=class Rectangle{static [Symbol['hasInstance']]=brandedHasInstance(Rectangle,RECTANGLE_BRAND);static['min'](...R){return R['reduce']((w,F)=>F['area']<w['area']?F:w);}static['max'](...R){return R['reduce']((w,F)=>F['area']>w['area']?F:w);}static['union'](R){const [w,...F]=R;return w['union'](...F);}static['intersection'](R){const [w,...F]=R;let E=w;for(const u of F){E=E['intersection'](u);if(!E)return null;}return E;}static['from'](R){return new Rectangle(R['x'],R['y'],R['width'],R['height']);}static['fromQuad'](R){const w=[R[0x0],R[0x2],R[0x4],R[0x6]],F=[R[0x1],R[0x3],R[0x5],R[0x7]],E=Math['min'](...w),u=Math['min'](...F);return new Rectangle(E,u,Math['max'](...w)-E,Math['max'](...F)-u);}['left'];['top'];['right'];['bottom'];get['center'](){return new Point(this['left']+this['width']/0x2,this['top']+this['height']/0x2);}get['leftTop'](){return new Point(this['left'],this['top']);}get['rightTop'](){return new Point(this['right'],this['top']);}get['rightBottom'](){return new Point(this['right'],this['bottom']);}get['leftBottom'](){return new Point(this['left'],this['bottom']);}get['edges'](){return[new Segment(this['leftTop'],this['rightTop']),new Segment(this['rightTop'],this['rightBottom']),new Segment(this['rightBottom'],this['leftBottom']),new Segment(this['leftBottom'],this['leftTop'])];}get['vertices'](){return[this['leftTop'],this['rightTop'],this['rightBottom'],this['leftBottom']];}get['area'](){return this['width']*this['height'];}['x'];['y'];['width'];['height'];constructor(R,w,F,E){this['x']=R,this['y']=w,this['width']=F,this['height']=E,this['left']=R,this['top']=w,this['right']=F===Infinity?Infinity:R+F,this['bottom']=E===Infinity?Infinity:w+E,setBrand(this,RECTANGLE_BRAND);}['offset'](R){return new Rectangle(this['x']+R['x'],this['y']+R['y'],this['width'],this['height']);}['scale'](R){return new Rectangle(this['x']*R,this['y']*R,this['width']*R,this['height']*R);}['resize']({left:R,right:w,top:F,bottom:E}){const u=this['left']-(R??0x0),M=Math['max'](u,this['right']+(w??0x0)),N=this['top']-(F??0x0),e=Math['max'](N,this['bottom']+(E??0x0));return new Rectangle(u,N,M-u,e-N);}['union'](...R){let w=this['left'],F=this['top'],E=this['right'],u=this['bottom'];for(const M of R){w=Math['min'](w,M['left']),F=Math['min'](F,M['top']),E=Math['max'](E,M['right']),u=Math['max'](u,M['bottom']);}return new Rectangle(w,F,E-w,u-F);}['intersection'](R){if(!this['intersects'](R))return null;const w=Math['max'](this['left'],R['left']),F=Math['min'](this['right'],R['right']),E=Math['max'](this['top'],R['top']),u=Math['min'](this['bottom'],R['bottom']);return new Rectangle(w,E,F-w,u-E);}['equals'](R){return this['x']===R['x']&&this['y']===R['y']&&this['width']===R['width']&&this['height']===R['height'];}['contains'](R){if(R instanceof Rectangle)return Math['round'](this['left'])<=Math['round'](R['left'])&&Math['round'](this['top'])<=Math['round'](R['top'])&&Math['round'](this['right'])>=Math['round'](R['right'])&&Math['round'](this['bottom'])>=Math['round'](R['bottom']);else return R['x']>=this['left']&&R['x']<=this['right']&&R['y']>=this['top']&&R['y']<=this['bottom'];}['intersects'](R){return this['left']<R['right']&&this['right']>R['left']&&this['top']<R['bottom']&&this['bottom']>R['top'];}['distance'](R){const w=Math['max'](0x0,R['left']-this['right'],this['left']-R['right']),F=Math['max'](0x0,R['top']-this['bottom'],this['top']-R['bottom']);return Math['hypot'](w,F);}['toJSON'](){return{'x':this['x'],'y':this['y'],'width':this['width'],'height':this['height']};}[Symbol['for']('nodejs.util.inspect.custom')](R,w){return'('+w['stylize'](this['left']['toFixed'](0x1),'number')+',\x20'+w['stylize'](this['top']['toFixed'](0x1),'number')+')\x20'+w['stylize'](this['width']['toFixed'](0x1),'number')+'\x20x\x20'+w['stylize'](this['height']['toFixed'](0x1),'number');}};const RTREE_BRAND=classBrand('RTree');var RTree=class RTree{static [Symbol['hasInstance']]=brandedHasInstance(RTree,RTREE_BRAND);#root;#maxItems;#minItems;constructor({maxItems:maxItems=0x9,minItems:R}={}){this.#maxItems=Math['max'](0x4,maxItems),this.#minItems=R??Math['max'](0x2,Math['floor'](this.#maxItems*0.4)),this.#root=new RNode({'leaf':!![],'minItems':this.#minItems}),setBrand(this,RTREE_BRAND);}*['levels'](){let R=[this.#root];while(R['length']>0x0)if(R[0x0]['leaf']){yield R['flatMap'](w=>w['children']['map'](F=>F['rect']));return;}else{const w=[],F=[];for(const E of R){w['push'](E['rect']),F['push'](...E['children']);}yield w,R=F;}}['insert'](R){const w=[];let F=this.#root;while(!F['leaf']){w['push'](F),F=F['chooseChild'](R['rect']);}return w['push'](F),F['add'](R),this.#balance(w),this;}['search'](R){const w=[],F=[this.#root];while(F['length']>0x0){const E=F['shift']();if(E['rect']['intersects'](R)){if(E['leaf']){for(const u of E['children'])if(u['rect']['intersects'](R))w['push'](u['data']);}else F['push'](...E['children']);}}return w;}#balance(R){for(let w=R['length']-0x1;w>=0x0;--w){const F=R[w];if(F['children']['length']>this.#maxItems){const E=F['split']();if(w===0x0)this.#root=new RNode({'leaf':![],'minItems':this.#minItems})['add'](F,E);else R[w-0x1]['add'](E);}}}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){let E='';const u=[{'node':this.#root,'depth':0x0}];while(u['length']>0x0){const {node:M,depth:N}=u['shift']();if(M instanceof RNode)u['unshift'](...M['children']['map'](e=>({'node':e,'depth':N+0x1}))),E+='\x20\x20'['repeat'](N)+F(M,w)+'\x0a';else E+='\x20\x20'['repeat'](N)+('RItem\x20'+F({'rect':M['rect'],'data':M['data']},{...w,'compact':!![],'breakLength':Infinity})+'\x0a');}return E;}},RNode=class RNode{#rect;#children=[];#leaf;#minItems;get['rect'](){return this.#rect??new Rectangle(0x0,0x0,0x0,0x0);}get['children'](){return this.#children;}get['leaf'](){return this.#leaf;}constructor({leaf:R,minItems:w}){this.#leaf=R,this.#minItems=w;}*['descendants'](){const R=[this];while(R['length']>0x0){const w=R['shift']();yield w;if(w['leaf'])yield*w['children'];else R['push'](...w['children']);}}['chooseChild'](R){let w=this.#children[0x0],F=w['rect']['union'](R)['area']-w['rect']['area'],E=w['rect']['area'];for(let u=0x1;u<this.#children['length'];++u){const M=this.#children[u],N=M['rect']['union'](R)['area']-M['rect']['area'];(N<F||N===F&&M['rect']['area']<E)&&(F=N,E=M['rect']['area'],w=M);}return w;}['add'](...R){return this.#children['push'](...R),this.#rect=this.#rect?this.#rect['union'](...R['map'](w=>w['rect'])):Rectangle['union'](R['map'](w=>w['rect'])),this;}['split'](){const R=[...this.#children],[w,F]=findSeeds(R)['map'](u=>({'rect':R[u]['rect'],'nodes':R['splice'](u,0x1)}));while(R['length']>0x0){if(F['nodes']['length']+R['length']<=this.#minItems){F['nodes']['push'](...R),F['rect']=F['rect']['union'](...R['map'](M=>M['rect']));break;}if(w['nodes']['length']+R['length']<=this.#minItems){w['nodes']['push'](...R),w['rect']=w['rect']['union'](...R['map'](M=>M['rect']));break;}let u={'difference':-Infinity,'index':0x0,'group':F,'rect':F['rect']};for(let M=0x0;M<R['length'];++M){const N=R[M],e={'rect':F['rect']['union'](N['rect']),'group':F},l=e['rect']['area']-F['rect']['area'],Y={'rect':w['rect']['union'](N['rect']),'group':w},I=Y['rect']['area']-w['rect']['area'],f=Math['abs'](l-I);if(f>u['difference'])u={'difference':f,'index':M,...l<I?e:Y};}u['group']['nodes']['push'](...R['splice'](u['index'],0x1)),u['group']['rect']=u['group']['rect']['union'](u['rect']);}this.#children=F['nodes'],this.#rect=F['rect'];const E=new RNode({'leaf':this.#leaf,'minItems':this.#minItems});return E.#children=w['nodes'],E.#rect=w['rect'],E;}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){return'RNode\x20'+F({'rect':this['rect'],'leaf':this['leaf']},{...w,'compact':!![],'breakLength':Infinity});}};function findSeeds(R){let w=-0x1,F=[0x0,0x0];for(let E=0x0;E<R['length'];E++){const u=R[E];for(let M=E+0x1;M<R['length'];M++){const N=R[M],e=u['rect']['union'](N['rect'])['area']-u['rect']['area']-N['rect']['area'];e>w&&(w=e,F=[M,E]);}}return F;}const RAY_BRAND=classBrand('Ray');(class Ray{static [Symbol['hasInstance']]=brandedHasInstance(Ray,RAY_BRAND);static['fromPoints'](R,w){return new Ray(R,Vector['fromPoints'](R,w));}['origin'];['direction'];constructor(R,w){this['origin']=R,this['direction']=w,setBrand(this,RAY_BRAND);}['contains'](R){const w=new Vector(R['x']-this['origin']['x'],R['y']-this['origin']['y']);if(w['cross'](this['direction'])!==0x0)return![];return w['dot'](this['direction'])>=0x0;}['intersection'](R){const w=R['direction']['cross'](this['direction']);if(Math['abs'](w)<Number['EPSILON'])return null;const F=R['origin']['x']-this['origin']['x'],E=R['origin']['y']-this['origin']['y'],M=(R['direction']['x']*E-R['direction']['y']*F)/w,N=(this['direction']['x']*E-this['direction']['y']*F)/w;if(M>=0x0&&N>=0x0)return new Point(this['origin']['x']+M*this['direction']['x'],this['origin']['y']+M*this['direction']['y']);return null;}['distance'](R){const w=Vector['fromPoints'](this['origin'],R);if(this['direction']['dot'](w)<0x0)return this['origin']['distance'](R);return Math['abs'](this['direction']['cross'](w)/this['direction']['magnitude']);}});const PATTERNS={'price':R=>extractPattern('price',R),'percentage':R=>extractPattern('percentage',R),'number':R=>extractPattern('number',R),'date':R=>extractPattern('date',R),'time':R=>extractPattern('time',R),'code':R=>extractPattern('code',R)};function getPatternMatcher(R){return PATTERNS[R];}const DEBUG_BUS_KEY=Symbol['for']('applitools.nlp.debugBus'),debugBus=globalThis[DEBUG_BUS_KEY]??=new EventTarget$1(),WATCHER_BRAND=classBrand('Watcher');function makeWatcher(R){return new Watcher(R);}var Watcher=class Watcher{static [Symbol['hasInstance']]=brandedHasInstance(Watcher,WATCHER_BRAND);#promise;#resolve;#reject;#result;#hint;#signal;#timers=new Map();#listeners=[];get['promise'](){if(!this.#promise){this.#promise=new Promise((...R)=>[this.#resolve,this.#reject]=R);if(this.#result){if(this.#result['status']==='fulfilled')this.#resolve(this.#result['value']);else this.#reject(this.#result['reason']);}}return this.#promise;}get['pending'](){return!this.#result;}get['settled'](){return!!this.#result;}get['hint'](){return this.#hint;}get[Symbol['toStringTag']](){return'Watcher';}constructor(R){this.#hint=R?.['hint'],this.#signal=R?.['signal'];if(this.#signal){if(this.#signal['aborted'])this['reject'](this.#signal['reason']);else this.#listeners['push'](once$1(this.#signal,'abort',()=>void this['reject'](this.#signal['reason'])));}setBrand(this,WATCHER_BRAND);}async['then'](R,w){return this['promise']['then'](R,w);}async['catch'](R){return this['promise']['catch'](R);}async['finally'](R){return this['promise']['finally'](R);}['reset'](R){this.#timers['forEach'](w=>w['cancel']()),this.#hint=R?.['hint'];if(this.#signal!==R?.['signal'])this.#signal=R?.['signal'];this.#listeners['forEach'](w=>w()),this.#listeners=[];this.#result&&(this.#result=void 0x0,this.#promise=void 0x0,this.#resolve=void 0x0,this.#reject=void 0x0);if(this.#signal){if(this.#signal['aborted'])this['reject'](this.#signal['reason']);else this.#listeners['push'](once$1(this.#signal,'abort',()=>void this['reject'](this.#signal['reason'])));}return this;}['resolve'](R,{delay:w,key:F}={}){if(w&&w>0x0){F??='default',this.#timers['get'](F)?.['cancel']();const E=setTimeout(()=>void this['resolve'](R),w);this.#timers['set'](F,{'cancel':()=>(clearTimeout(E),this.#timers['delete'](F))});}else this.#timers['forEach'](u=>u['cancel']()),this.#result??={'status':'fulfilled','value':R},this.#resolve?.(R);return this;}['reject'](R,{delay:w,key:F}={}){if(w&&w>0x0){F??='default',this.#timers['get'](F)?.['cancel']();const E=setTimeout(()=>void this['reject'](R),w);this.#timers['set'](F,{'cancel':()=>(clearTimeout(E),this.#timers['delete'](F))});}else this.#timers['forEach'](u=>u['cancel']()),this.#result??={'status':'rejected','reason':R},this.#reject?.(R);return this;}};function sleep(R,{signal:w}={}){return makeWatcher({'signal':w})['resolve'](void 0x0,{'delay':R});}function until(R,{timeout:w,signal:F}){const E=sleep(w,{'signal':F});return R['finally'](()=>void E['resolve']()),E;}const PROGRESS_EVENT_BRAND=classBrand('ProgressEvent');var ProgressEvent=class ProgressEvent extends Event{static [Symbol['hasInstance']]=brandedHasInstance(ProgressEvent,PROGRESS_EVENT_BRAND);constructor(){super('progress'),setBrand(this,PROGRESS_EVENT_BRAND);}};function rectToSamplingPoints(R){const w=Math['round'](R['left']+R['width']/0x2),F=Math['round'](R['top']+R['height']/0x2),E=w+Math['floor'](R['width']/0x4),u=w-Math['ceil'](R['width']/0x4),M=R['height']/0x2*0.15,N=Math['ceil'](R['top']+M),e=Math['floor'](R['top']+R['height']-M);return[{'x':u,'y':F},{'x':E,'y':F},{'x':w,'y':F},{'x':w,'y':N},{'x':w,'y':e}];}function calculateObscurationRatio(R){if(R['length']===0x0)return 0x1;const w=R['flat']();return w['filter'](F=>F)['length']/w['length'];}const MAX_PROJECTED_TEXT=0xa0;function clip(R){return R['length']>MAX_PROJECTED_TEXT?R['slice'](0x0,MAX_PROJECTED_TEXT)+'…':R;}function projectAXNode(R){if(!R)return null;const w={};try{if(R['type'])w['type']={...R['type']};if(R['text'])w['text']=clip(R['text']);const F=R['visibleLabel']||R['geometricLabel']||R['declarativeLabel'];if(F)w['label']=clip(F);const E=R['borderRect'];if(E)w['rect']={'x':E['x'],'y':E['y'],'width':E['width'],'height':E['height']};}catch{}return w;}function projectDescriptor(R){if(!R)return R;const {node:w,anchor:F,fallback:E,...u}=R,M={...u};if(w)M['node']=projectAXNode(w);if(F)M['anchor']=(Array['isArray'](F)?F:[F])['map'](N=>({...N,'element':N['element']&&!('isViewportDescriptor'in N['element'])?projectDescriptor(N['element']):N['element']}));if(E)M['fallback']=projectDescriptor(E);return M;}function projectPrioritizedCandidates(R,w){return R['map'](F=>{let E=0x1;return{'nodeId':F['node']['debugLog']?.['id'],'node':projectAXNode(F['node']),'quality':F['quality'],'prioritizers':w['map'](u=>{let M;try{const N=u['value'](F);M=Array['isArray'](N)?N['join'](',\x20'):N;}catch{M=void 0x0;}return{'name':u['name'],'priorityOrder':E++,'order':typeof u['compare']==='function'?'custom':u['compare']['order']??'asc','value':typeof M==='string'?clip(M):M};})};});}const eventLogger=makeEventLogger();use(eventLogger);const RUNNER_TYPES=new Set(['instructionExecutionStarted','instructionExecutionFinished','subinstructionExecutionStarted','subinstructionExecutionFinished']),RECORDER_TYPES=new Set(['recordingStarted','recordingStopped','instructionRecorded','elementSelectionStarted','elementSelectionStopped','elementDescriptorGenerated','elementSelectorGenerated','recorderError']);function isLegacyLogEventType(R){return RUNNER_TYPES['has'](R)||RECORDER_TYPES['has'](R);}function makeLogEventFromStructured(R){return new LogEvent(R['data']!=null&&!(typeof R['data']==='object'&&Object['keys'](R['data'])['length']===0x0)?{'type':R['type'],'data':R['data']}:{'type':R['type']});}var LogEvent=class LogEvent extends CustomEvent{['component'];constructor(R){super('log',{'detail':{...R,'timestamp':R['timestamp']??Date['now']()}}),this['component']=RUNNER_TYPES['has'](R['type'])?'runner':'recorder';}['clone'](){return new LogEvent(this['detail']);}};const bus=new EventTarget$1();eventLogger['onLog'](R=>{if(isLegacyLogEventType(R['type']))bus['dispatch'](makeLogEventFromStructured(R));});function makeScript(R){if(R instanceof Script)return R;else{if(typeof R!=='object')return new Script({'source':R});else return new Script(R);}}function makeBundledScript({name:R,url:w}){return new Script({'source':readFileSync(w,{'encoding':'utf8'}),'name':R,'bundled':!![]});}var Script=class{['source'];['name'];['bundled'];constructor({source:R,name:w,bundled:F}){this['source']=R['toString'](),this['name']=w,this['bundled']=!!F;}async['compile'](R){if(this['bundled']&&this['name']&&knownBundledSnippets['has'](this['name']))return await R['evaluate'](makeExpression({'name':'registerRuntimeBundled_'+this['name'],'source':bundleSnippet(this['name'])})),makeScript({'name':this['name'],'source':'(...args)\x20=>\x20'+this['name']+'(...args)'});return this;}['toString'](){return this['source'];}['toJSON'](){return this['source'];}[Symbol['toPrimitive']](){return this['source'];}[Symbol['for']('nodejs.util.inspect.custom')](){return this['name']?'NamedScript('+this['name']+')':'Script('+(this['source']['length']>0xc8?this['source']['substring'](0x0,0xc8)+'...':this['source'])+')';}};function makeExpression(R){return R instanceof Expression?R:new Expression(typeof R==='object'?R:{'source':R});}function makeBundledExpression({name:R,url:w}){return new Expression({'source':readFileSync(w,{'encoding':'utf8'}),'name':R,'bundled':!![]});}var Expression=class{['source'];['name'];['bundled'];constructor({source:R,name:w,bundled:F}){this['source']=typeof R==='string'?R:'('+R['toString']()+')()',this['name']=w,this['bundled']=!!F;}async['compile'](){if(this['bundled']&&this['name']&&knownBundledSnippets['has'](this['name']))return makeExpression({'name':this['name'],'source':bundleSnippet(this['name'])});return this;}['toString'](){return this['source'];}['toJSON'](){return this['source'];}[Symbol['toPrimitive']](){return this['source'];}[Symbol['for']('nodejs.util.inspect.custom')](){return this['name']?'NamedExpression('+this['name']+')':'Expression('+(this['source']['length']>0xc8?this['source']['substring'](0x0,0xc8)+'...':this['source'])+')';}};const knownBundledSnippets=new Map();function provideRolldownConfig(R){for(const w of R)if(!Array['isArray'](w['output'])&&w['output']?.['name'])knownBundledSnippets['set'](w['output']['name'],w);}function bundleSnippet(R){return execFileSync(process['execPath'],[new URL('../../assets/bundler-CqGVGUSF.ts',import.meta.url)['pathname'],JSON['stringify'](knownBundledSnippets['get'](R))],{'maxBuffer':0xa*0x400*0x400,'encoding':'utf8'});}const findNodeBySelector=makeBundledScript({'name':'findNodeBySelector','url':new URL('../../assets/find-node-by-selector-FKXS0K9G.js',import.meta.url)}),findNodesBySelector=makeBundledScript({'name':'findNodesBySelector','url':new URL('../../assets/find-nodes-by-selector-Cbl5Yyn7.js',import.meta.url)}),getElementSelector=makeBundledScript({'name':'getElementSelector','url':new URL('../../assets/get-element-selector-DdXbhL__.js',import.meta.url)}),getElementValue=makeBundledScript({'name':'getElementValue','url':new URL('../../assets/get-element-value-Br7RXcCX.js',import.meta.url)}),setElementValue=makeBundledScript({'name':'setElementValue','url':new URL('../../assets/set-element-value-CipEuFvw.js',import.meta.url)}),canTypeIntoElement=makeBundledScript({'name':'canTypeToElement','url':new URL('../../assets/can-type-to-element-Ly-SUrz_.js',import.meta.url)}),isElementAcceptableInvisible=makeBundledScript({'name':'isElementAcceptableInvisible','url':new URL('../../assets/is-element-acceptable-invisible-BWAx59YN.js',import.meta.url)}),checkVisibility=makeBundledScript({'name':'checkVisibility','url':new URL('../../assets/check-visibility-NBT6SZvi.js',import.meta.url)}),isFrameContentVisible=makeBundledScript({'name':'isFrameContentVisible','url':new URL('../../assets/is-frame-content-visible-D-Jj5gM9.js',import.meta.url)}),getObscurationRatio=makeBundledScript({'name':'getObscurationRatio','url':new URL('../../assets/get-obscuration-ratio-zVFVUD5T.js',import.meta.url)}),setElementCaretPosition=makeBundledScript({'name':'setElementCaretPosition','url':new URL('../../assets/set-element-caret-position-2rBkIsy9.js',import.meta.url)}),registerPort=makeBundledScript({'name':'registerPort','url':new URL('../../assets/register-port-BZpidK-7.js',import.meta.url)}),visibilityTracker=makeBundledExpression({'name':'visibilityTracker','url':new URL('../../assets/visibility-tracker-BscfcZdV.js',import.meta.url)}),filepickerMocker=makeBundledExpression({'name':'filepickerMocker','url':new URL('../../assets/filepicker-mocker-BCrF2vqr.js',import.meta.url)});var AbortError=class extends Error{['retriable'];constructor(R,w){super(R,w),this['retriable']=w?.['retriable']??![];}},FlushError=class extends Error{},AutomatorError=class extends Error{constructor(R){super(R),this['name']=this['constructor']['name'];}},NavigationFailedError=class extends AutomatorError{['url'];['reason'];constructor({url:R,reason:w}){super('Navigation\x20failed\x20due\x20to\x20the\x20page\x20being\x20unavailable'),this['url']=R,this['reason']=w;}},NavigationTimedOutError=class extends AutomatorError{['url'];['timeout'];constructor({url:R,timeout:w}){super('Navigation\x20timed\x20out'),this['url']=R,this['timeout']=w;}},NoHistoryEntryError=class extends AutomatorError{['offset'];constructor({offset:R}){super('Can’t\x20go\x20to\x20the\x20'+(R>0x0?'next':'previous')+'\x20page'),this['offset']=R;}},BodyConsumedError=class extends AutomatorError{['accessor'];constructor({accessor:R}){super('Response\x20body\x20has\x20already\x20been\x20consumed;\x20cannot\x20call\x20\x22'+R+'\x22\x20again'),this['accessor']=R;}},CommandTimedOutError=class extends AutomatorError{['method'];['commandId'];['sessionId'];constructor({method:R,commandId:w,sessionId:F}){super('Devtools\x20command\x20\x22'+R+'\x22\x20that\x20was\x20sent\x20with\x20id\x20'+w+'\x20to\x20the\x20session\x20\x22'+F+'\x22\x20is\x20timed\x20out'),this['method']=R,this['commandId']=w,this['sessionId']=F;}};function makeConnection(R){return new Connection(R);}let index=0x0;const MAX_LOGGED_MESSAGE=0x20*0x400;var Connection=class{#commands=new Map();#events=new Map();#listeners=[];#signal;#timeout=0x7530;async #handleMessage(R){try{const w=R['data']['length'],F=JSON['parse'](R['data']['toString']('utf8'));if(F['id']!==void 0x0){const E=this.#commands['get'](F['id']);if(E){trace('cdpCommandSucceeded',{'method':E['method'],'payload':w>MAX_LOGGED_MESSAGE?{'id':F['id'],'omittedBytes':w}:F,'sessionId':this['sessionId']});if(F['error'])error('cdpCommandFailed',{'method':E['method'],'params':E['params'],'response':F,'sessionId':this['sessionId']}),E['watcher']['reject'](new Error(F['error']['message']));else E['watcher']['resolve'](F['result']);}}else{if(this['sessionId']===F['sessionId'])this.#events['get'](F['method'])?.['forEach'](async u=>{try{await u?.(F['params']);}catch(M){error('cdpEventHandlerFailed',{'method':F['method'],'sessionId':this['sessionId'],'raw':R['data']['toString']('utf8'),'error':M});}});}}catch(u){error('cdpMessageParsingFailed',{'sessionId':this['sessionId'],'raw':R['data']['toString']('utf8'),'error':u});}}['socket'];['sessionId'];constructor(R){this['socket']=R['socket'],setMaxListeners(0x3e8,this['socket']),this['sessionId']=R['sessionId'],this.#signal=R['signal'];if(R['timeout']!=null)this.#timeout=R['timeout'];this.#listeners['push'](on(this['socket'],'message',this.#handleMessage['bind'](this))),this.#listeners['push'](on(this['socket'],'error',({error:w})=>{error('connectionSocketError',{'sessionId':this['sessionId'],'error':w});})),this.#listeners['push'](on(this['socket'],'close',({code:w,reason:F})=>{log('connectionSocketClosed',{'sessionId':this['sessionId'],'code':w,'reason':F});}));if(this.#signal)this.#listeners['push'](once$1(this.#signal,'abort',()=>this['abort'](this.#signal['reason'])));}get['timeout'](){return this.#timeout;}set['timeout'](R){this.#timeout=R;}['abort'](R){this.#listeners['forEach'](w=>w()),this.#commands['forEach'](({method:w,params:F,watcher:E})=>{error('cdpCommandAborted',{'method':w,'params':F,'reason':R,'sessionId':this['sessionId']}),E['reject'](R);}),this.#commands['clear'](),this.#events['clear']();}['flush'](R){this.#commands['forEach'](({method:w,params:F,watcher:E})=>{error('cdpCommandFlushed',{'method':w,'params':F,'reason':R,'sessionId':this['sessionId']}),E['reject'](R);});}async['execute'](R,w,{signal:F,timeout:E}={}){const u=makeWatcher();if(F?.['aborted']||this.#signal?.['aborted'])return error('cdpCommandNotSent',{'method':R,'params':w,'sessionId':this['sessionId'],'reason':F?.['reason']||this.#signal?.['reason']}),u['reject'](F?.['reason']||this.#signal?.['reason']),u;let M;if(F)M=once$1(F,'abort',()=>{if(u['settled'])return;error('cdpCommandAborted',{'method':R,'params':w,'reason':F['reason'],'sessionId':this['sessionId']}),u['reject'](F['reason']);});const N=++index,e=E??this.#timeout;if(!process.env.PLAY&&Number['isFinite'](e)&&e>0x0)u['reject'](new CommandTimedOutError({'method':R,'commandId':N,'sessionId':this['sessionId']}),{'delay':e});this.#commands['set'](N,{'method':R,'params':w,'watcher':u});const l=JSON['stringify']({'sessionId':this['sessionId'],'id':N,'method':R,'params':w});return trace('cdpCommandSent',{'method':R,'commandId':N,'params':l['length']>MAX_LOGGED_MESSAGE?{'omittedBytes':l['length']}:w,'sessionId':this['sessionId'],'awaitsResponse':!![]}),this['socket']['send'](l),u['finally'](()=>{this.#commands['delete'](N),M?.();});}['send'](R,w){const F=++index,E=JSON['stringify']({'sessionId':this['sessionId'],'id':F,'method':R,'params':w});trace('cdpCommandSent',{'method':R,'params':E['length']>MAX_LOGGED_MESSAGE?{'omittedBytes':E['length']}:w,'sessionId':this['sessionId'],'awaitsResponse':![]}),this['socket']['send'](E);}['on'](R,w){let F=this.#events['get'](R);if(!F)this.#events['set'](R,F=new Set());return F['add'](w),()=>F['delete'](w);}['once'](R,w){if(w){const F=this['on'](R,(...E)=>{return F(),w(...E);});return F;}else return new Promise((E,u)=>{const M=this['on'](R,(...N)=>{return M(),E(...N);});});}};function makeFrameManager(){return new FrameManager();}var FrameManager=class{#tree=new Map();['has'](R){return!!this.#tree['get'](R)?.['frame'];}*['getFramesIterator'](R){const w=this.#tree['get'](R);if(!w||!w['frame'])throw new Error('Cannot\x20recreate\x20the\x20frame\x20tree,\x20because\x20root\x20frame\x20with\x20id\x20'+R+'\x20is\x20missing');const F=[R];for(let E=0x0;E<F['length'];++E){const u=F[E],M=this.#tree['get'](u);if(M){if(!M['frame'])throw new Error('Cannot\x20recreate\x20the\x20frame\x20tree,\x20because\x20frame\x20with\x20id\x20'+u+'\x20is\x20missing');yield M['frame'],F['push'](...M['childFrameIds']);}}}['get'](R){return this.#tree['get'](R)?.['frame'];}['add'](R){const w=this.#tree['get'](R['frameId']);if(!w||w['frame']){if(w?.['frame'])this['delete'](R['frameId']);this.#tree['set'](R['frameId'],{'frame':R,'childFrameIds':new Set()});}else w['frame']=R;if(R['parentFrameId']){if(!this.#tree['has'](R['parentFrameId']))this.#tree['set'](R['parentFrameId'],{'frame':void 0x0,'childFrameIds':new Set([R['frameId']])});else this.#tree['get'](R['parentFrameId'])['childFrameIds']['add'](R['frameId']);}}['delete'](R){const w=this.#tree['get'](R);if(w?.['frame']?.['parentFrameId'])this.#tree['get'](w['frame']['parentFrameId'])?.['childFrameIds']['delete'](R);this.#tree['delete'](R);const F=[R];for(let E=0x0;E<F['length'];++E){const u=F[E],M=this.#tree['get'](u);M&&(F['push'](...M['childFrameIds']),this.#tree['delete'](u));}}['deleteDescendants'](R){const w=this.#tree['get'](R);if(w){const F=[...w['childFrameIds']];for(let E=0x0;E<F['length'];++E){const u=F[E],M=this.#tree['get'](u);M&&(F['push'](...M['childFrameIds']),this.#tree['delete'](u));}w['childFrameIds']['clear']();}}};function makeWindow(R){return new Window(R);}var Window=class extends EventTargetNode{#targets=new Set();['windowId'];['browser'];constructor({browser:R,windowId:w}){super(),this['browser']=R,this['windowId']=w,this['on']('targetAttached',({target:F})=>{this.#targets['add'](F);}),this['on']('targetDetached',({target:F})=>{this.#targets['delete'](F);if(this.#targets['size']===0x0)this['dispatch'](new WindowDestroyedEvent(this));});}*['targets'](){yield*this.#targets['values']();}*['pages'](){yield*this.#targets['values']()['filter'](R=>R['type']==='page');}async['setBounds'](R){await this['browser']['connection']['execute']('Browser.setWindowBounds',{'windowId':this['windowId'],'bounds':{'left':R['x'],'top':R['y'],'width':R['width'],'height':R['height'],'windowState':'normal'}});}async['setSize'](R){await this['browser']['connection']['execute']('Browser.setWindowBounds',{'windowId':this['windowId'],'bounds':{'left':0x0,'top':0x0,'width':R['width'],'height':R['height'],'windowState':'normal'}});}async['setContentsSize'](R){await this['browser']['connection']['execute']('Browser.setContentsSize',{'windowId':this['windowId'],...R});}},WindowTargetAttachedEvent=class extends Event{['target'];constructor(R){super('targetAttached'),this['target']=R;}},WindowTargetDetachedEvent=class extends Event{['target'];constructor(R){super('targetDetached'),this['target']=R;}},WindowDestroyedEvent=class extends Event{['window'];constructor(R){super('destroyed'),this['window']=R;}};function makeWindowManager(){return new WindowManager();}var WindowManager=class{#windows=new Map();['get'](R){return this.#windows['get'](R);}['getOrCreate']({windowId:R,browser:w}){const F=this.#windows['get'](R);if(F)return F;const E=makeWindow({'browser':w,'windowId':R});return this.#windows['set'](R,E),E['once']('destroyed',()=>this.#windows['delete'](R)),w['dispatch'](new BrowserWindowCreatedEvent(E)),E;}*[Symbol['iterator']](){yield*this.#windows['values']();}};function makePagesHistory(R){return new PagesHistory(R);}var PagesHistory=class{#activatingPage;#stack=[];#index=0x0;constructor({browser:R}){R['on']('activePageChanged',({target:w})=>{this.#activatingPage!==w&&(this['push'](w),this.#activatingPage=void 0x0);}),R['on']('pageClosed',({target:w})=>this['delete'](w));}get['nextPage'](){if(this.#index<this.#stack['length']-0x1)return this.#stack[this.#index+0x1];}get['previousPage'](){if(this.#index>0x0)return this.#stack[this.#index-0x1];}['push'](R){if(this.#index<this.#stack['length']-0x1)this.#stack=this.#stack['slice'](0x0,this.#index+0x1);const w=this.#stack[this.#stack['length']-0x1];if(!(w&&w===R))this.#stack['push'](R);this.#index=this.#stack['length']-0x1;}['delete'](R){this.#stack=this.#stack['filter'](w=>w['targetId']!==R['targetId']);if(this.#stack['length']<=0x1)this.#index=0x0;else{if(this.#index>=this.#stack['length'])this.#index=this.#stack['length']-0x1;}}async['activatePreviousPage'](){this.#activatingPage=this['previousPage'];if(!this.#activatingPage)return![];return this.#activatingPage['once']('activated',()=>this.#index-=0x1),await this.#activatingPage['activate'](),!![];}async['activateNextPage'](){this.#activatingPage=this['nextPage'];if(!this.#activatingPage)return![];return this.#activatingPage['once']('activated',()=>this.#index+=0x1),await this.#activatingPage['activate'](),!![];}};function localizeRemoteValue({evaluator:R,value:w}){const F=w['type'];if(F==='undefined'||F==='boolean'||F==='string')return w['value'];else{if(F==='number'){if(w['value']['unserializableValue']){if(w['value']['unserializableValue']==='Infinity')return Infinity;else{if(w['value']['unserializableValue']==='-Infinity')return-Infinity;else{if(w['value']['unserializableValue']==='-0')return-0x0;else{if(w['value']['unserializableValue']==='NaN')return NaN;}}}}return w['value'];}else{if(F==='bigint')return BigInt(w['unserializableValue']['slice'](0x0,-0x1));else{if(F==='symbol')return null;else{if(F==='object'){if(w['subtype']==='null')return null;return new RemoteObjectHandle({'evaluator':R,'value':w});}else{if(F==='function')return new RemoteFunctionHandle({'evaluator':R,'value':w});}}}}}return null;}var RemoteObjectHandle=class{#value;#cache=new Map();#revoked=![];async #resolveSerializedValue(R,{path:path=[]}={}){const w=R['weakLocalObjectReference'];if(w!==void 0x0&&this.#cache['has'](w))return this.#cache['get'](w);let F;const E=R['type'];if(E==='undefined'||E==='boolean'||E==='string')F=R['value'];else{if(E==='null')F=null;else{if(E==='number'){if(R['value']==='Infinity')F=Infinity;else{if(R['value']==='-Infinity')F=-Infinity;else{if(R['value']==='-0')F=-0x0;else{if(R['value']==='NaN')F=NaN;else F=R['value'];}}}}else{if(E==='bigint')F=BigInt(R['value']);else{if(E==='symbol')F=null;else{if(E==='node')F=makeWebNode({'evaluator':this['evaluator'],'handle':path['length']===0x0?this:void 0x0,'nodeId':R['value']['backendNodeId'],'preview':'<'+(R['value']['localName']??'#node')+'\x20'+(R['value']['attributes']?Object['entries'](R['value']['attributes'])['map'](([u,M])=>u+'=\x22'+M+'\x22')['join']('\x20'):'')+'/>'});else{if(E==='array'){const u=[],M=R['value'];for(const [N,e]of M['entries']())u['push'](await this.#resolveSerializedValue(e,{'path':[...path,{'type':'value','index':N}]}));F=u;}else{if(E==='set'){const l=new Set(),Y=R['value'];for(const [I,f]of Y['entries']())l['add'](await this.#resolveSerializedValue(f,{'path':[...path,{'type':'value','index':I}]}));F=l;}else{if(E==='object'){const t={},W=R['value'];for(const [i,[K,s]]of W['entries']())t[K]=await this.#resolveSerializedValue(s,{'path':[...path,{'type':'value','index':i}]});F=t;}else{if(E==='map'){const Q=new Map(),k=R['value'];for(const [S,[a,T]]of k['entries']()){const H=typeof a==='string'?a:await this.#resolveSerializedValue(a,{'path':[...path,{'type':'key','index':S}]}),A=await this.#resolveSerializedValue(T,{'path':[...path,{'type':'value','index':S}]});Q['set'](H,A);}F=Q;}else{if(E==='function')F=await this['evaluator']['execute']((D,Z)=>{for(const O of Z){const p=(Array['isArray'](D)||D instanceof Set||D instanceof Map?Array['from'](D['entries']()):Object['entries'](D))[O['index']];if(!p)throw new Error('Can\x27t\x20resolve\x20remote\x20object');D=p[O['type']==='key'?0x0:0x1];}return D;},[this,path]);else throw new Error('Can\x27t\x20resolve\x20serialized\x20remote\x20value\x20of\x20type\x20\x22'+E+'\x22');}}}}}}}}}}if(w!==void 0x0)this.#cache['set'](w,F);return F;}['evaluator'];get['objectId'](){return this.#value['objectId'];}get['revoked'](){return this.#revoked;}constructor({evaluator:R,value:w}){this['evaluator']=R,this.#value=w;}async['resolve'](){if(this.#value['type']==='object'&&this.#value['subtype']==='node')return makeWebNode({'evaluator':this['evaluator'],'handle':this});else{if(this.#value['deepSerializedValue']){const R=await this.#resolveSerializedValue(this.#value['deepSerializedValue']);return await this['revoke'](),R;}else throw new Error('Can\x27t\x20resolve\x20unserialized\x20remote\x20object');}}async['revoke'](){!this.#revoked&&(this.#revoked=!![],await this['evaluator']['target']['connection']['execute']('Runtime.releaseObject',{'objectId':this['objectId']}));}['asArgument'](){if(this['evaluator']['destroyed'])throw new StaleRemoteObjectHandleError('Remote\x20object\x20with\x20id\x20'+this['objectId']+'\x20is\x20stale');return!this.#revoked?{'objectId':this['objectId']}:{'value':null};}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){let E;if(this.#value['deepSerializedValue']){E=stringifySerializedRemoteValue(this.#value['deepSerializedValue'],{'depth':R-0x1});if(this.#value['deepSerializedValue']['type']==='node'&&w['maxStringLength'])E=E['substring'](0x0,w['maxStringLength'])+'...';}else{if(this.#value['preview'])E=stringifyRemoteValuePreview(this.#value['preview']);else E=this.#value['description']??'';}return'RemoteObjectHandle\x20{'+E+'}';}},RemoteFunctionHandle=class extends RemoteObjectHandle{async['resolve'](){const R=(...w)=>this['call'](...w);return R['handle']=this,R;}async['call'](...R){return await this['evaluator']['execute']((w,F)=>w(...F),[this,R]);}},StaleRemoteObjectHandleError=class extends Error{};function previewRemoteValue(R,{maxLength:maxLength=0x7d0}={}){let w;const F=R['type'];if(F==='string')w=String(R['value']??R['description']??'');else{if(F==='undefined')w='undefined';else{if(F==='boolean'||F==='number'||F==='bigint')w=String(R['value']??R['unserializableValue']??R['description']??'');else{if(F==='object'&&R['subtype']==='null')w='null';else{if(R['preview'])w=stringifyRemoteValuePreview(R['preview']);else w=R['description']??(F==='object'?R['subtype']??'Object':F);}}}}return w['length']>maxLength?w['substring'](0x0,maxLength)+'…':w;}function stringifyRemoteValuePreview(R){const w=R['type'];if(w==='object'){const E=R['subtype'];if(E==='null'||E==='regexp')return R['description'];else{if(E==='node')return'<'+R['description']+'/>';else{if(E==='array')return'['+R['properties']['map'](u=>F(u))['join'](',\x20')+(R['overflow']?'\x20...,\x20[length]:\x20'+/\d+/['exec'](R['description'])?.[0x0]:'')+']';else{if(E==='set'||E==='weakset')return R['description']+'\x20{'+(R['entries']??[])['map'](u=>stringifyRemoteValuePreview(u['value']))['join'](',\x20')+(R['overflow']?'\x20...':'')+'}';else{if(!E)return'['+R['properties']['map'](u=>u['name']+':\x20'+F(u))['join'](',\x20')+(R['overflow']?'\x20...':'')+']';else{if(E==='map'||E==='weakmap')return R['description']+'\x20{'+(R['entries']??[])['map'](u=>stringifyRemoteValuePreview(u['key'])+'\x20=>\x20'+stringifyRemoteValuePreview(u['value']))['join'](',\x20')+'\x20'+(R['overflow']?'...':'')+'}';else{if(E==='date')return'Date\x20{'+R['description']+'}';else{if(E==='promise'){const u=R['properties']['find'](N=>N['name']==='[[PromiseState]]')?.['value']??'pending',M=R['properties']['find'](N=>N['name']==='[[PromiseResult]]');return'Promise\x20{<'+u+'>'+(u!=='pending'&&M?F(M):'')+'}';}else{if(E==='error')return'Error\x20{'+R['description']+'}';else return'{<unknown>:\x20'+E+'}';}}}}}}}}}else{if(w==='string')return'\x27'+R['description']?.['replaceAll']('\x27','\x5c\x27')+'\x27';else return R['description'];}function F(N){return N['valuePreview']?stringifyRemoteValuePreview(N['valuePreview']):N['value'];}}function stringifySerializedRemoteValue(R,{depth:w}){const F=R['type'];if(F==='undefined'||F==='null')return F;else{if(F==='boolean'||F==='number')return R['value'];else{if(F==='bigint')return R['value']+'n';else{if(F==='string')return'\x27'+R['value']['replaceAll']('\x27','\x5c\x27')+'\x27';else{if(F==='symbol')return'';else{if(F==='node'){const E=Object['entries'](R['value']['attributes']??{})['map'](([u,M])=>u+'=\x22'+M+'\x22')['join']('\x20');return'<'+(R['value']['localName']??'#node')+'\x20'+E+'/>';}else{if(F==='regexp')return'';else{if(F==='date')return'';else{if(F==='array'){const u='Array('+R['value']['length']+')';if(w===0x0)return u;return'['+R['value']['map'](M=>stringifySerializedRemoteValue(M,{'depth':w-0x1}))['join'](',\x20')+']';}else{if(F==='set'){const M='Set('+R['value']['length']+')';if(w===0x0)return M;return M+'\x20{'+R['value']['map'](N=>stringifySerializedRemoteValue(N,{'depth':w-0x1}))['join'](',\x20')+'}';}else{if(F==='object'){const N='Object('+R['value']['length']+')';if(w===0x0)return N;return'{'+R['value']['map'](([e,l])=>e+':\x20'+stringifySerializedRemoteValue(l,{'depth':w-0x1}))['join'](',\x20')+'}';}else{if(F==='map'){const e='Map('+R['value']['length']+')';if(w===0x0)return e;return e+'\x20{'+R['value']['map'](([l,Y])=>(typeof l==='string'?l:stringifySerializedRemoteValue(l,{'depth':w-0x1}))+'\x20=>\x20'+stringifySerializedRemoteValue(Y,{'depth':w-0x1}))['join'](',\x20')+'}';}else return'{<unknown>:\x20'+F+'}';}}}}}}}}}}}}function boxToRect(R){return{'x':R['x'],'y':R['y'],'width':R['width'],'height':R['height'],'top':R['height']<0x0?R['y']+R['height']:R['y'],'left':R['width']<0x0?R['x']+R['width']:R['x']};}function hostnameOf(R){if(!R)return void 0x0;try{return new URL(R)['hostname'];}catch{return;}}function matchesDomain(R,w){return w['some'](F=>R===F||R['endsWith']('.'+F));}const AD_FRAME_PATTERNS=/(?:doubleclick\.net|googlesyndication\.com|googleadservices\.com|google(?:tag|ad)manager\.com|adnxs\.com|pubmatic\.com|amazon-adsystem\.com|rubiconproject\.com|casalemedia\.com|criteo\.(?:com|net)|sharethrough\.com|yieldmo\.com|gumgum\.com|openx\.net|bidswitch\.net|media\.net|seedtag\.com|3lift\.com|undertone\.com|ads\.yahoo\.com|pub\.network|lijit\.com|adsrvr\.org|2mdn\.net|moatads\.com|serving-sys\.com|taboola\.com|outbrain\.com)/i;function isAdUrl(R){const w=hostnameOf(R);return w?AD_FRAME_PATTERNS['test'](w):![];}const ANALYTICS_DOMAINS=['google-analytics.com','analytics.google.com','omtrdc.net','2o7.net','demdex.net','contentsquare.net','hotjar.com','fullstory.com','mixpanel.com','amplitude.com','segment.io','segment.com','newrelic.com','nr-data.net','scorecardresearch.com','quantserve.com','chartbeat.com','clarity.ms'],ANALYTICS_HOSTNAME_PREFIX=/^s?metrics\./i;function isAnalyticsUrl(R){const w=hostnameOf(R);if(!w)return![];return matchesDomain(w,ANALYTICS_DOMAINS)||ANALYTICS_HOSTNAME_PREFIX['test'](w);}function isNonBlockingRequest(R,w){return R==='Ping'||R==='EventSource'||isAdUrl(w)||isAnalyticsUrl(w);}function makeWebNode(R){return new WebNode(R);}var WebNode=class{#handle;#nodeId;#contentFrame=void 0x0;#attributes;#description;#preview;async #getDescription(){if(this.#description)return this.#description;const R=await this['frame']['target']['connection']['execute']('DOM.describeNode',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});return this.#description=R['node'];}['evaluator'];get['frame'](){return this['evaluator']['frame'];}constructor({evaluator:R,handle:w,nodeId:F,preview:E}){this['evaluator']=R,this.#handle=w,this.#nodeId=F,this.#preview=E;}async['asRemoteObjectHandle'](){if(this.#handle)return this.#handle;const R=await this['frame']['target']['connection']['execute']('DOM.resolveNode',{'executionContextId':this['evaluator']['evaluatorId'],'backendNodeId':this.#nodeId});return this.#handle=localizeRemoteValue({'evaluator':this['evaluator'],'value':R['object']});}async['equal'](R){if(this['frame']!==R['frame'])return![];const w=await Promise['all']([this['getNodeId'](),R['getNodeId']()]);return w[0x0]===w[0x1];}async['normalize'](){return this['execute'](R=>{if(R instanceof Element&&['::before','::after']['includes'](R['tagName']))return R['parentElement'];if(R instanceof SVGElement){let w=R;while(w['viewportElement'])w=w['viewportElement'];return w;}return R;});}async['isConnected'](){return this['execute'](R=>R['isConnected'])['catch'](()=>![]);}async['isEnabled'](){return this['execute'](R=>R instanceof Element?R['matches'](':enabled'):![]);}async['isHovered'](){return this['execute'](R=>R instanceof Element?R['matches'](':hover'):R['parentElement']?.['matches'](':hover')??![]);}async['getNodeId'](){if(this.#nodeId)return this.#nodeId;return(await this.#getDescription())['backendNodeId'];}async['getValue']({hint:hint='string',acceptFormValue:R}={}){return await this['execute'](getElementValue,[{'hint':hint,'acceptFormValue':R}]);}async['getText'](){return await this['execute'](R=>R['textContent']);}async['getScreenBox'](){let R=await this['getBox']();try{let w=this['frame'];while(w&&!w['isMain']){if(w['isOutOfProcess']){const F=await(await w['getOwnerNode']())['getBox']();R=R['offset'](F);}w=w['parent'];}return R;}catch(E){throw new Error('Node\x20screen\x20box\x20calculation\x20is\x20failed',{'cause':E});}}async['getBox'](){try{const {model:R}=await this['frame']['target']['connection']['execute']('DOM.getBoxModel',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});return new Rectangle(R['border'][0x0],R['border'][0x1],R['border'][0x4]-R['border'][0x0],R['border'][0x5]-R['border'][0x1]);}catch(w){error('nodeBoxCalculationFailed',{'error':w});throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');}}async['getMetrics'](){return this['execute'](R=>{const w=R instanceof Element?R:R['parentElement'];return{'scrollX':w['scrollLeft'],'scrollY':w['scrollTop'],'scrollWidth':w['scrollWidth'],'scrollHeight':w['scrollHeight'],'clientWidth':w['clientWidth'],'clientHeight':w['clientHeight']};});}async['getContentBoxes'](){try{const {quads:R}=await this['frame']['target']['connection']['execute']('DOM.getContentQuads',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']}),w=R['map'](F=>Rectangle['fromQuad'](F))['filter'](F=>F['width']>0x0&&F['height']>0x0);if(w['length']===0x0)throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');return w;}catch(F){error('nodeBoxCalculationFailed',{'error':F});throw new StaleNodeError('Node\x20with\x20object\x20id\x20'+this.#nodeId+'\x20is\x20stale');}}async['getTagName'](){return(await this.#getDescription())['nodeName']['toLowerCase']();}async['getAttribute'](R){if(!this.#attributes){const w=await this.#getDescription();this.#attributes=new Map();if(w['attributes']){for(let F=0x0;F<(w['attributes']?.['length']??0x0);F+=0x2)this.#attributes['set'](w['attributes'][F],w['attributes'][F+0x1]);}}return this.#attributes['get'](R);}async['getContentFrame'](){if(this.#contentFrame===void 0x0){const R=(await this.#getDescription())['frameId'];this.#contentFrame=R?this['frame']['target']['browser']['frameManager']['get'](R):null;if(!this.#contentFrame)throw new Error('Cannot\x20find\x20content\x20frame\x20of\x20the\x20iframe\x20node\x20with\x20with\x20object\x20id\x20\x22'+this.#nodeId+'\x22');}return this.#contentFrame;}async['$'](R){const w=['/','(','../','./','*/']['some'](F=>R['startsWith'](F))?'xpath':'css';return await this['execute']((F,E,u)=>{if(u==='xpath')return document['evaluate'](E['replaceAll']('/svg','/*[local-name()\x20=\x20\x27svg\x27]'),F,null,XPathResult['FIRST_ORDERED_NODE_TYPE'],null)['singleNodeValue'];else return(F instanceof Element?F:F['parentElement'])['querySelector'](E);},[R,w]);}async['$$'](R){const w=['/','(','../','./','*/']['some'](F=>R['startsWith'](F))?'xpath':'css';return await this['execute']((F,E,u)=>{if(u==='xpath'){const M=document['evaluate'](E['replaceAll']('/svg','/*[local-name()\x20=\x20\x27svg\x27]'),F,null,XPathResult['ORDERED_NODE_ITERATOR_TYPE'],null),N=[];let e;while(e=M['iterateNext']())N['push'](e);return N;}else{const l=F instanceof Element?F:F['parentElement'];return Array['from'](l['querySelectorAll'](E));}},[R,w]);}async['execute'](R,w,F){return this['evaluator']['execute'](R,[this,...w??[]],F);}async['focus'](){try{return await this['frame']['target']['connection']['execute']('DOM.focus',{'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']}),!![];}catch{const R=await this['getTagName']();if(R==='html'||R==='body')return!![];if(await this['execute'](w=>w instanceof Element?w['shadowRoot']?.['delegatesFocus']:![])===![])return!![];return![];}}async['hover']({signal:R}){const w=(await this['getBox']())['center'],F=this['frame']['target']['mouse']['position'],E=[[w]],u=await this['frame']['target']['getViewportSize']();E['push']([{'x':w['x'],'y':u['height']+0x64},w]);const M=new Segment(F,w)['toOrthogonal']();E['push'](M['map'](N=>N['end']));for(const N of E){await this['frame']['target']['mouse']['move'](N,{'signal':R});const {isObscured:e}=await this['isObscured']();if(!e){const l=await this['getBox']();if(l['center']['distance'](this['frame']['target']['mouse']['position'])>0x1)await this['frame']['target']['mouse']['move'](l['center'],{'signal':R});return;}await this['frame']['target']['mouse']['move'](F,{'signal':R}),await G(0x3e8);}}async['click']({simulate:R,signal:w,...F}={}){if(R)await this['execute'](E=>E['click']());else{await this['hover']({'signal':w});const [E]=await this['getContentBoxes'](),u={'x':E['x']+E['width']/0x2,'y':E['y']+E['height']/0x2};await this['frame']['target']['mouse']['click'](u,F);}}async['scrollIntoView']({block:block='nearest',inline:inline='nearest'}={}){await this['execute'](async(R,{block:w,inline:F})=>{(R instanceof Element?R:R['parentElement'])['scrollIntoView']({'block':w,'inline':F,'behavior':'instant'}),await new Promise(requestAnimationFrame);},[{'block':block,'inline':inline}],{'await':!![]});}async['tryToUnobscure'](){await this['scrollIntoView']();const {ratio:R}=await this['getObscurationInfo']();if(R!==0x0)await this['scrollIntoView']({'block':'center','inline':'center'});}async['isVisible'](){const {isVisible:R}=await this['execute'](checkVisibility,[{'minSize':0x1,'checkParentsVisibility':!![]}]);return R;}async['getObscurationInfo'](){if(!await this['isVisible']())return{'ratio':0x1,'obscuringElement':null};const {ratio:R,obscuringElement:w}=await this['execute'](getObscurationRatio);if(R===0x0)return{'ratio':0x0,'obscuringElement':null};const F=await this['getContentBoxes']();if(F['length']===0x0)return{'ratio':0x1,'obscuringElement':null};const {dx:E,dy:u}=await this['frame']['target']['mainFrame']['execute'](()=>({'dx':window['scrollX'],'dy':window['scrollY']})),M=await this['execute'](Y=>Y instanceof Element?Y:Y['parentElement']),N=[];let e=null;for(const Y of F){const I=rectToSamplingPoints(boxToRect(Y)),f=await Promise['all'](I['map'](async W=>{const i={'x':W['x']+E,'y':W['y']+u},K=await this['frame']['target']['resolveFromLocation'](i);if(!K)return{'isObscured':![],'node':null};if(await M['equal'](K))return{'isObscured':![],'node':null};if(await M['contains'](K))return{'isObscured':![],'node':null};return{'isObscured':!![],'node':K};})),t=f['map'](W=>W['isObscured']);if(!e){const W=f['find'](i=>i['isObscured']&&i['node']);if(W)e=W['node'];}N['push'](t);}const l=calculateObscurationRatio(N);return{'ratio':Math['min'](l,R),'obscuringElement':e??w};}async['isObscured'](){const {ratio:R,obscuringElement:w}=await this['getObscurationInfo']();return{'isObscured':R>0.5,'obscuringElement':w};}async['isAcceptableInvisible'](){return this['execute'](isElementAcceptableInvisible);}async['scrollTo'](R){await this['execute']((w,{x:F,y:E})=>{if(!(w instanceof Element))return;let u;if(F==='end')u=w['scrollWidth'];else{if(F==='center')u=w['scrollWidth']/0x2;else u=F;}let M;if(E==='end')M=w['scrollHeight'];else{if(E==='center')M=w['scrollHeight']/0x2;else M=E;}w['scrollTo']({'left':u,'top':M,'behavior':'instant'});},[R]);}async['scrollBy'](R){if(await this['execute'](async(F,{x:E,y:u})=>{if(!(F instanceof Element))return!![];const M=F['scrollTop'],N=F['scrollLeft'];return F['scrollBy']({'left':E,'top':u,'behavior':'instant'}),new Promise(e=>{requestAnimationFrame(()=>{const l=F['scrollTop'],Y=F['scrollLeft'];if(l===M&&Y===N)e(![]);else e(!![]);});});},[R],{'await':!![]}))return;const w=await this['getBox']();await this['frame']['target']['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseWheel','x':w['x']+w['width']-0x1,'y':w['y']+0x1,'deltaX':R['x']??0x0,'deltaY':R['y']??0x0});}async['setValue'](R){if(await this['execute'](w=>w instanceof HTMLInputElement&&w['type']==='file')){if(typeof R!=='string'&&!Array['isArray'](R))throw new Error('Can\x27t\x20set\x20value\x20of\x20type\x20'+typeof R+'\x20in\x20a\x20filepicker');await this['frame']['target']['connection']['execute']('DOM.setFileInputFiles',{'files':Array['isArray'](R)?R:[R],'backendNodeId':this.#nodeId,'objectId':this.#handle?.['objectId']});}else await this['execute'](setElementValue,[R]);}async['canTypeInto'](){return this['execute'](canTypeIntoElement);}async['type'](R){throw new Error('Web\x20elements\x20do\x20not\x20support\x20direct\x20typing.\x20Use\x20keyboard.type()\x20instead.');}async['contains'](R){if(this['frame']!==R['frame'])return![];return this['execute']((w,F)=>w['contains'](F),[await this['evaluator']['adopt'](R)]);}async['generateXpath'](){return this['execute'](R=>{let w='';const F=R['ownerDocument'];if(!F)return w;let E=R;if(R instanceof Element&&R['id'])w='//'+R['tagName']+'[@id=\x22'+R['id']+'\x22]';else while(E&&E!==F){const u=E['parentNode'];if(u){const M=E['tagName'];w='/'+M+'['+(Array['prototype']['filter']['call'](u['childNodes'],N=>N['tagName']===M)['indexOf'](E)+0x1)+']'+w;}E=u;}return w;});}async['getDescription'](){return this['generateXpath']();}async['isTextNode'](){return this['execute'](R=>R instanceof Text);}async['getParent'](){return await this['execute'](R=>R['parentElement']);}async['getSelector'](){return this['execute'](getElementSelector);}async['isContentEditable'](){return this['execute'](R=>R instanceof HTMLElement?R['isContentEditable']:![]);}async['setCaretPosition'](R){return this['execute'](setElementCaretPosition,[R]);}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){F['styles']['node']='magentaBright';const E=this.#handle?.[Symbol['for']('nodejs.util.inspect.custom')](R,w,F)??this.#preview;return E?w['stylize'](E,'node'):'Node\x20'+F({'nodeId':this.#nodeId},{...w,'compact':!![],'breakLength':Infinity});}async['isLabelOf'](R){if(this['frame']!==R['frame'])return![];return this['execute']((w,F)=>{if(!(F instanceof HTMLInputElement)||!F['labels'])return![];return Array['from'](F['labels'])['some'](E=>E['contains'](w));},[await this['evaluator']['adopt'](R)]);}},StaleNodeError=class extends Error{},PortOutgoingMessageEvent=class extends Event{['name'];['payload'];constructor(R,w){super('outgoingMessage'),this['name']=R,this['payload']=w;}},PortIncommingMessageEvent=class extends Event{['name'];['payload'];constructor(R,w){super('incommingMessage'),this['name']=R,this['payload']=w;}};function makePort(R){return new Port(R);}var Port=class extends EventTargetNode{#watchers={'initialized':makeWatcher()};async #initialize(){const R='__'+this['name']['replaceAll']('\x20','_')+'_post_message';this['evaluator']['target']['connection']['on']('Runtime.bindingCalled',({executionContextId:w,name:F,payload:E})=>{if(this['evaluator']['evaluatorId']===w&&F===R){const u=JSON['parse'](E);this['dispatch'](new PortIncommingMessageEvent(u['name'],u['payload']));}}),await this['evaluator']['target']['connection']['execute']('Runtime.addBinding',{'name':R,'executionContextId':this['evaluator']['evaluatorId']}),await this['evaluator']['execute'](registerPort,[this['name']]),log('portInitialized',{'portName':this['name'],'evaluatorId':this['evaluator']['evaluatorId'],'frameId':this['evaluator']['frame']?.['frameId']});}#closed=![];['evaluator'];['name'];constructor({evaluator:R,name:w}){super(),this['evaluator']=R,this['name']=w,this.#initialize()['then'](()=>this.#watchers['initialized']['resolve']())['catch'](F=>this.#watchers['initialized']['reject'](F)),this['evaluator']['on']('destroyed',()=>{if(this.#closed)return;this.#closed=!![],log('portClosed',{'portName':this['name'],'evaluatorId':this['evaluator']['evaluatorId']});}),this['on']('outgoingMessage',async({name:F,payload:E})=>{try{await this['evaluator']['execute']((u,M,N)=>{const e=globalThis;e['ports'][u]['dispatchEvent'](new e['PortIncommingMessageEvent'](M,N));},[this['name'],F,E]);}catch(u){error('portMessageSendFailed',{'portName':this['name'],'messageName':F,'evaluatorId':this['evaluator']['evaluatorId'],'error':u});}});}['send'](R,w){this['dispatch'](new PortOutgoingMessageEvent(R,w));}async['wait'](R){await this.#watchers[R];}};function makeEvaluator(R){return new Evaluator(R);}var Evaluator=class extends EventTargetNode{#evaluatorId;#destroyed=![];#controller=new AbortController();['type'];['name'];['target'];['frame'];get['evaluatorId'](){return this.#evaluatorId;}get['destroyed'](){return this.#destroyed;}constructor(R){super(),this.#evaluatorId=R['evaluatorId'];if('target'in R)this['target']=R['target'];else this['target']=R['frame']['target'],this['frame']=R['frame'];this['name']=R['name'],this['type']=R['type'],this['target']['connection']['on']('Runtime.executionContextsCleared',()=>{log('executionContextDestroyed',{'contextId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'cleared'}),log('evaluatorDestroyed',{'evaluatorId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'cleared'}),this.#controller['abort'](new AbortError('Evaluator\x20with\x20id\x20\x22'+this.#evaluatorId+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation',{'retriable':this['frame']&&!this['frame']['destroyed']})),this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),this.#controller=new AbortController();}),this['target']['connection']['on']('Runtime.executionContextDestroyed',({executionContextId:F})=>{this.#evaluatorId===F&&(log('executionContextDestroyed',{'contextId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'destroyed'}),log('evaluatorDestroyed',{'evaluatorId':this.#evaluatorId,'frameId':this['frame']?.['frameId'],'targetId':this['target']['targetId'],'reason':'destroyed'}),this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),this.#controller=new AbortController());});if(R['logs'])this['target']['connection']['on']('Runtime.consoleAPICalled',({executionContextId:F,type:E,timestamp:u,args:M})=>{if(this.#evaluatorId===F)try{const N=M['map'](e=>localizeRemoteValue({'evaluator':this,'value':e}));this['dispatch'](new EvaluatorLogEvent({'type':E,'timestamp':u,'args':N}));}catch{}});const w=this['type']+'-'+this.#evaluatorId;this['frame']?.['on']('destroyed',()=>this['dispatch'](new EvaluatorDestroyedEvent({'evaluatorId':this.#evaluatorId})),{'key':w}),this['on']('destroyed',()=>{this.#destroyed=!![],this.#controller['abort'](new AbortError('Evaluator\x20with\x20id\x20\x22'+this.#evaluatorId+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation',{'retriable':this['frame']&&!this['frame']['destroyed']})),this['frame']?.['off'](w);});}async['execute'](R,w,F){const E=await this['target']['connection']['execute']('Runtime.callFunctionOn',{'executionContextId':this.#evaluatorId,'functionDeclaration':await makeScript(R)['compile'](this),'arguments':await Promise['all']((w??[])['map'](async M=>{if(M instanceof RemoteObjectHandle)return M['asArgument']();if(M instanceof WebNode)return(await M['asRemoteObjectHandle']())['asArgument']();if(typeof M==='bigint')return{'unserializableValue':M+'n'};if(M===Infinity)return{'unserializableValue':'Infinity'};if(M===-Infinity)return{'unserializableValue':'-Infinity'};if(Object['is'](M,-0x0))return{'unserializableValue':'-0'};if(Number['isNaN'](M))return{'unserializableValue':'NaN'};return{'value':M};})),'awaitPromise':F?.['await'],'serializationOptions':{'serialization':'deep'}},{'signal':this.#controller['signal'],'timeout':F?.['timeout']});if(E['exceptionDetails']){const M=E['exceptionDetails']['exception']?.['description']?.['replace'](/^\w+:\s*/,'')['replace'](/\n.*/s,'');throw new Error(M??'Error\x20during\x20script\x20evaluation');}const u=localizeRemoteValue({'evaluator':this,'value':E['result']});return u instanceof RemoteObjectHandle?await u['resolve']():u;}async['evaluate'](R,w){const F=await this['target']['connection']['execute']('Runtime.evaluate',{'contextId':this.#evaluatorId,'expression':await makeExpression(R)['compile'](),'awaitPromise':w?.['await'],'serializationOptions':{'serialization':'deep'}},{'signal':this.#controller['signal'],'timeout':w?.['timeout']});if(F['exceptionDetails']){const u=F['exceptionDetails']['exception']?.['description']?.['replace'](/^\w+:\s*/,'')['replace'](/\n.*/s,'');throw new Error(u??'Error\x20during\x20script\x20evaluation');}const E=localizeRemoteValue({'evaluator':this,'value':F['result']});return E instanceof RemoteObjectHandle?await E['resolve']():E;}async['resolve']({nodeId:R}){const w=await this['target']['connection']['execute']('DOM.resolveNode',{'executionContextId':this['evaluatorId'],'backendNodeId':R});return await localizeRemoteValue({'evaluator':this,'value':w['object']})['resolve']();}async['adopt'](R){if(R['evaluator']===this)return R;if(R['frame']!==this['frame'])throw new Error('Can\x27t\x20adopt\x20a\x20node\x20from\x20a\x20different\x20frame');return this['resolve']({'nodeId':await R['getNodeId']()});}async['port'](R){const w=makePort({'evaluator':this,'name':R});return await w['wait']('initialized'),w;}},EvaluatorLogEvent=class extends Event{['type'];['timestamp'];['args'];constructor({type:R,timestamp:w,args:F},E){super('log',E),this['type']=R,this['timestamp']=w,this['args']=F;}},EvaluatorDestroyedEvent=class extends Event{['evaluatorId'];constructor({evaluatorId:R},w){super('destroyed',w),this['evaluatorId']=R;}};function makeRemoteStream(R,w){let F=typeof w==='string'?w:void 0x0;const E=typeof w==='function'?w:void 0x0;let u=![],M;async function N(){if(F)return F;return M??=E()['then'](l=>F=l),M;}async function e(){if(u)return;u=!![];if(!F)return;try{await R['execute']('IO.close',{'handle':F});}catch{}}return new Readable({'read'(l){N()['then'](Y=>R['execute']('IO.read',{'handle':Y,'size':Math['max'](l,0x40*0x400)}))['then'](({data:Y,base64Encoded:I,eof:f})=>{if(Y['length']>0x0)this['push'](I?X['from'](Y,'base64'):X['from'](Y,'utf8'));f&&(this['push'](null),e());},Y=>this['destroy'](Y instanceof Error?Y:new Error(String(Y))));},'destroy'(l,Y){e()['finally'](()=>Y(l));}});}const BFCACHE_LIMIT=0x6;var StylesheetsManager=class{#current={'sheets':new Map()};#bfcache=new Map();get['current'](){return[...this.#current['sheets']['values']()];}['add'](R){this.#current['sheets']['set'](R['stylesheetId'],R);}['remove'](R){return this.#current['sheets']['delete'](R);}['beginNavigation'](){if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']);this.#current={'sheets':new Map()};}['commitNavigation'](R,w){if(this.#current['loaderId']===R)return;if(w==='restoration'){const F=this.#bfcache['get'](R);if(F){if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']);this.#bfcache['delete'](R),this.#current={'loaderId':R,'sheets':F},this.#evictBfcache(R);return;}}if(this.#current['loaderId']&&this.#current['sheets']['size']>0x0)this.#bfcache['set'](this.#current['loaderId'],this.#current['sheets']),this.#current={'loaderId':R,'sheets':new Map()};else this.#current['loaderId']=R;this.#evictBfcache(R);}#evictBfcache(R){while(this.#bfcache['size']>BFCACHE_LIMIT){let w=![];for(const F of this.#bfcache['keys']()){if(F===R)continue;this.#bfcache['delete'](F),w=!![];break;}if(!w)break;}}},FrameFetchError=class extends Error{['netError'];constructor(R){super(R),this['name']='FrameFetchError',this['netError']=R;}};function makeFrame(R){return new Frame(R);}var Frame=class extends EventTargetNode{#target;#node;#defaultEvaluator;#isolatedEvaluator;#response;#controller=new AbortController();#destroyed=![];#watchers={'determined':makeWatcher({'signal':this.#controller['signal']}),'defaultEvaluatorAttached':makeWatcher({'signal':this.#controller['signal']}),'navigated':makeWatcher({'signal':this.#controller['signal']}),'loaded':makeWatcher({'signal':this.#controller['signal']}),'networkAlmostIdle':makeWatcher({'signal':this.#controller['signal']}),'networkIdle':makeWatcher({'signal':this.#controller['signal']}),'stable':makeWatcher({'signal':this.#controller['signal']})};#isAd=![];#navigatedAt=0x0;#stylesheets=new StylesheetsManager();async #getDefaultEvaluator(){return await this.#watchers['defaultEvaluatorAttached'],this.#defaultEvaluator;}async #getIsolatedEvaluator(){if(this.#isolatedEvaluator)return this.#isolatedEvaluator;const R=await this.#target['connection']['execute']('Page.createIsolatedWorld',{'frameId':this['frameId'],'worldName':'isolated-'+this['frameId']},{'signal':this.#controller['signal']});return this.#isolatedEvaluator=makeEvaluator({'frame':this,'evaluatorId':R['executionContextId'],'type':'isolated','logs':!![]}),log('evaluatorCreated',{'evaluatorId':this.#isolatedEvaluator['evaluatorId'],'frameId':this['frameId']}),this.#isolatedEvaluator['once']('destroyed',()=>this.#isolatedEvaluator=void 0x0),this['dispatch'](new FrameEvaluatorAttached(this.#isolatedEvaluator)),this.#isolatedEvaluator;}async #execute(R,w,F,E){await this['wait']('determined');let u;if(R==='isolated')u=await this.#getIsolatedEvaluator();else u=await this.#getDefaultEvaluator();try{return await u['execute'](w,F,E);}catch(M){if(M instanceof AbortError&&M['retriable'])return this.#execute(R,w,F,E);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#execute(R,w,F,E);throw M;}}async #evaluate(R,w,F){await this['wait']('determined');let E;if(R==='isolated')E=await this.#getIsolatedEvaluator();else E=await this.#getDefaultEvaluator();try{return await E['evaluate'](w,F);}catch(u){if(u instanceof AbortError&&u['retriable'])return this.#evaluate(R,w,F);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#evaluate(R,w,F);throw u;}}async #resolve(R,w){await this['wait']('determined');let F;if(R==='isolated')F=await this.#getIsolatedEvaluator();else F=await this.#getDefaultEvaluator();try{return await F['resolve'](w);}catch(E){if(E instanceof AbortError&&E['retriable'])return this.#resolve(R,w);if(!this.#watchers['loaded']['settled'])return await this['wait']('loaded'),this.#resolve(R,w);throw E;}}['frameId'];['parentFrameId'];get['loaded'](){return this.#watchers['loaded']['settled'];}get['stable'](){return this.#watchers['stable']['settled'];}get['destroyed'](){return this.#destroyed;}get['target'](){return this.#target;}get['response'](){return this.#response;}get['isMain'](){return!this['parentFrameId'];}get['isOutOfProcess'](){return!this['isMain']&&this['frameId']===this.#target['targetId'];}get['isAd'](){return this.#isAd;}get['parent'](){if(!this['parentFrameId'])return null;return this['target']['browser']['frameManager']['get'](this['parentFrameId'])??null;}get['defaultEvaluator'](){return this.#defaultEvaluator;}get['navigatedAt'](){return this.#navigatedAt;}get['stylesheets'](){return this.#stylesheets['current'];}['addStylesheet'](R){this.#stylesheets['add'](R);}['removeStylesheet'](R){return this.#stylesheets['remove'](R);}constructor({target:R,frameId:w,parentFrameId:F}){super(),this.#target=R,this['frameId']=w,this['parentFrameId']=F,this.#watchers['determined']['resolve'](),this.#watchers['navigated']['resolve'](),this['on']('evaluatorAttached',({evaluator:E})=>{E['type']==='default'&&(this.#defaultEvaluator=E,this.#watchers['defaultEvaluatorAttached']['resolve'](),E['on']('log',({type:u,args:M})=>{log('frameConsoleMessage',{'frameId':this['frameId'],'consoleType':u,'args':M});}));}),this['on']('request',({request:E})=>{if(this.#watchers['navigated']['settled'])this['dispatch'](new FrameNavigatingEvent({'url':E['url'],'reason':'unknown'}));}),this['on']('response',({response:E})=>this.#response=E),this['on']('navigating',()=>{this.#watchers['navigated']['reset']({'signal':this.#controller['signal']}),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('navigated',({url:E,reason:u,loaderId:M})=>{if(!this['isMain'])this.#isAd=isAdUrl(E);this.#navigatedAt=Date['now'](),this.#watchers['navigated']['resolve']();if(u!=='local')this.#stylesheets['commitNavigation'](M,u);u==='remote'?(this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']})):(this.#watchers['loaded']['resolve'](),this.#watchers['stable']['resolve'](),this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['resolve']());}),this['on']('loading',()=>{if(this['isAd'])return;this.#stylesheets['beginNavigation'](),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('loaded',()=>{this.#watchers['loaded']['resolve'](),this.#watchers['stable']['resolve']();}),this['on']('networkAlmostIdle',()=>{this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('networkIdle',()=>{this.#watchers['networkAlmostIdle']['resolve'](),this.#watchers['networkIdle']['resolve']();}),this['on']('swapping',()=>{log('frameTargetSwapping',{'frameId':this['frameId']}),this.#watchers['determined']['reset']({'signal':this.#controller['signal']}),this.#defaultEvaluator=void 0x0,this.#isolatedEvaluator=void 0x0;}),this['on']('swapped',({target:E})=>{log('frameTargetSwapped',{'frameId':this['frameId'],'targetId':E['targetId']}),this.#target=E,this.#watchers['determined']['resolve'](),this.#watchers['loaded']['reset']({'signal':this.#controller['signal']}),this.#watchers['stable']['reset']({'signal':this.#controller['signal']})['resolve'](void 0x0,{'delay':this.#target['browser']['frameStabilityTimeout']}),this.#watchers['networkAlmostIdle']['reset']({'signal':this.#controller['signal']}),this.#watchers['networkIdle']['reset']({'signal':this.#controller['signal']});}),this['on']('destroyed',()=>{this.#destroyed=!![],this.#controller['abort'](new AbortError('Frame\x20with\x20id\x20\x22'+this['frameId']+'\x22\x20is\x20destroyed\x20in\x20the\x20middle\x20of\x20operation'));});}async['isVisible'](){if(this['isMain'])return!![];const R=await this['getOwnerNode']();if(!R)return![];return await R['execute'](isFrameContentVisible);}async['wait'](R,{signal:w}={}){return abortable(this.#watchers[R],w);}async['getOwnerNode'](){if(this.#node!==void 0x0)return this.#node;if(!this['parent'])return this.#node=null;const R=await this['parent']['$$']('iframe,\x20frame');for(const w of R)if(await w['getContentFrame']()===this)return this.#node=w;throw new Error('Cannot\x20find\x20owner\x20node\x20for\x20the\x20frame');}async['$'](R){const w=[R]['flat']();let F=this;for(const E of w['keys']()){const u=w[E],M=await F['execute'](findNodeBySelector,[u]);if(!M)return null;if(E<w['length']-0x1)F=await M['getContentFrame']();else return M;}return null;}async['$$'](R){const w=[R]['flat']();let F=[this];for(const E of w['keys']()){const u=w[E],M=await F['reduce'](async(N,e)=>{const l=await e['execute'](findNodesBySelector,[u]),Y=await N;return Y['push'](...l),Y;},Promise['resolve']([]));if(M['length']===0x0)return[];if(E<w['length']-0x1)F=await Promise['all'](M['map'](async N=>N['getContentFrame']()));else return M;}return[];}async['fetch'](R,w={}){const F=this['target']['connection'],E={'disableCache':w['disableCache']??![],'includeCredentials':w['includeCredentials']??!![]};let u;try{u=await F['execute']('Network.loadNetworkResource',{'frameId':this['frameId'],'url':R,'options':E});}catch(t){throw new FrameFetchError(t instanceof Error?t['message']:String(t));}const {success:M,httpStatusCode:N,headers:e,netErrorName:l,stream:Y}=u['resource'];if(!M&&N===void 0x0)throw new FrameFetchError(l??'unknown');const I={};for(const [W,i]of Object['entries'](e??{}))I[W['toLowerCase']()]=typeof i==='string'?i:String(i);let f;if(Y)try{f=await buffer(makeRemoteStream(F,Y));}catch(K){throw new FrameFetchError(K instanceof Error?K['message']:String(K));}else f=X['alloc'](0x0);return{'request':{'url':R,'method':'GET','headers':{},'body':()=>Promise['resolve'](new Uint8Array())},'status':N??0xc8,'headers':I,get 'body'(){return Readable['from'](f);},'arrayBuffer':()=>Promise['resolve'](new Uint8Array(f)['buffer']),'base64':()=>Promise['resolve'](f['toString']('base64'))};}async['execute'](R,w,F){return this.#execute('isolated',R,w,F);}async['defaultExecute'](R,w,F){return this.#execute('default',R,w,F);}async['evaluate'](R,w){return this.#evaluate('isolated',R,w);}async['defaultEvaluate'](R,w){return this.#evaluate('default',R,w);}async['resolve'](R){return this.#resolve('isolated',R);}async['defaultResolve'](R){return this.#resolve('default',R);}},FrameEvaluatorAttached=class extends Event{['evaluator'];constructor(R){super('evaluatorAttached'),this['evaluator']=R;}},FrameLifecycleEvent=class extends Event{constructor(R){super(R);}},FrameNavigatingEvent=class extends Event{['url'];['reason'];constructor({url:R,reason:w}){super('navigating'),this['url']=R,this['reason']=w;}},FrameNavigatedEvent=class extends Event{['url'];['reason'];['loaderId'];constructor({url:R,reason:w,loaderId:F}){super('navigated'),this['url']=R,this['reason']=w,this['loaderId']=F;}},FrameDocumentRequestEvent=class extends Event{['request'];constructor(R){super('request'),this['request']=R;}},FrameDocumentResponseEvent=class extends Event{['response'];constructor(R){super('response'),this['response']=R;}},FrameSwappingEvent=class extends Event{constructor(){super('swapping');}},FrameSwappedEvent=class extends Event{['target'];constructor(R){super('swapped'),this['target']=R;}},FrameDestroyedEvent=class extends Event{constructor(){super('destroyed');}};function makeLoader(R){return new Loader(R);}var Loader=class extends EventTargetNode{#frame;constructor({frame:R}){super(),this.#frame=R,this.#frame&&(this['on']('request',({resource:w,request:F})=>{if(w==='Document')this.#frame['dispatch'](new FrameDocumentRequestEvent(F));}),this['on']('response',({resource:w,response:F})=>{if(w==='Document')this.#frame['dispatch'](new FrameDocumentResponseEvent(F));}));}async*['responses'](){const R=makeWatcher();let w=[];this['on']('response',({response:F})=>{w['push'](F),R['resolve'](),R['reset']();});while(!![]){await R,yield*w,w=[];}}},LoaderRequestEvent=class extends Event{['requestId'];['request'];['resource'];constructor(R,{requestId:w,resource:F},E){super('request',E),this['requestId']=w,this['resource']=F,this['request']=R;}},LoaderResponseEvent=class extends Event{['requestId'];['response'];['resource'];constructor(R,{requestId:w,resource:F},E){super('response',E),this['requestId']=w,this['resource']=F,this['response']=R;}};function makeBlockingDialog(R){return new BlockingDialog(R);}var BlockingDialog=class extends EventTargetNode{#handled=![];['target'];['type'];['message'];constructor({target:R,type:w,message:F}){super(),this['target']=R,this['type']=w,this['message']=F;}get['handled'](){return this.#handled;}async['handle'](R,w){log('dialogHandling',{'targetId':this['target']['targetId']}),this.#handled=!![],await this['target']['connection']['execute']('Page.handleJavaScriptDialog',{'accept':R,'promptText':w}),this['dispatch'](new DialogHandledEvent());}};function makeFilepickerDialog(R){return new FilepickerDialog(R);}var FilepickerDialog=class extends EventTargetNode{#handled=![];['frame'];['element'];['multiple'];['accept'];['type']='filepicker';constructor({frame:R,element:w,multiple:F,accept:E}){super(),this['frame']=R,this['element']=w,this['multiple']=F,this['accept']=E;}get['handled'](){return this.#handled;}async['handle'](R){try{await this['element']['setValue'](R),this.#handled=!![],this['dispatch'](new DialogHandledEvent());}catch(w){error('filepickerHandleFailed',{'error':w});}}},DialogHandledEvent=class extends Event{constructor(){super('handled');}};function makeDebugger(R){return new Debugger(R);}var Debugger=class extends EventTargetNode{#watchers={'holds':new Set(),'paused':makeWatcher()};#initialize(){this['target']['connection']['on']('Debugger.paused',async()=>{log('debuggerPaused',{'targetId':this['target']['targetId'],'reason':this.#watchers['paused']['settled']?'manual':'programmatic'});if(this.#watchers['paused']['settled'])this.#watchers['paused']['reset']({'hint':'manual'});this['dispatch'](new DebuggerPausedEvent({'reason':this.#watchers['paused']['hint']}));}),this['target']['connection']['on']('Debugger.resumed',async()=>{log('debuggerResumed',{'targetId':this['target']['targetId']}),this.#watchers['paused']['resolve'](),this.#watchers['holds']['forEach'](R=>R['resolve']()),this.#watchers['holds']['clear'](),this['dispatch'](new DebuggerResumedEvent());}),this.#watchers['paused']['resolve']();}['target'];get['paused'](){return!this.#watchers['paused']['settled'];}constructor({target:R}){super(),this['target']=R,this['target']['wait']('initialized')['then'](()=>this.#initialize());}['hold'](){if(this.#watchers['paused']['settled'])return()=>void 0x0;const R=makeWatcher();return this.#watchers['holds']['add'](R),()=>{this.#watchers['holds']['delete'](R),R['resolve']();};}async['pause'](){this.#watchers['paused']['reset']({'hint':'programmatic'}),await this['target']['connection']['execute']('Debugger.pause'),this['target']['mainFrame']['defaultEvaluate']('1\x20+\x201')['catch'](()=>null);}async['resume'](){await Promise['allSettled'](this.#watchers['holds']);if(!this.#watchers['paused']['settled'])await this['target']['connection']['execute']('Debugger.resume',{'terminateOnResume':![]});}},DebuggerPausedEvent=class extends Event{['reason'];constructor({reason:R},w){super('paused',w),this['reason']=R;}},DebuggerResumedEvent=class extends Event{constructor(R){super('resumed',R);}};const us=buildLayout({'us':{'Escape':{'keyCode':0x1b,'key':'Escape'},'F1':{'keyCode':0x70,'key':'F1'},'F2':{'keyCode':0x71,'key':'F2'},'F3':{'keyCode':0x72,'key':'F3'},'F4':{'keyCode':0x73,'key':'F4'},'F5':{'keyCode':0x74,'key':'F5'},'F6':{'keyCode':0x75,'key':'F6'},'F7':{'keyCode':0x76,'key':'F7'},'F8':{'keyCode':0x77,'key':'F8'},'F9':{'keyCode':0x78,'key':'F9'},'F10':{'keyCode':0x79,'key':'F10'},'F11':{'keyCode':0x7a,'key':'F11'},'F12':{'keyCode':0x7b,'key':'F12'},'Backquote':{'keyCode':0xc0,'shiftKey':'~','key':'`'},'Digit1':{'keyCode':0x31,'shiftKey':'!','key':'1'},'Digit2':{'keyCode':0x32,'shiftKey':'@','key':'2'},'Digit3':{'keyCode':0x33,'shiftKey':'#','key':'3'},'Digit4':{'keyCode':0x34,'shiftKey':'$','key':'4'},'Digit5':{'keyCode':0x35,'shiftKey':'%','key':'5'},'Digit6':{'keyCode':0x36,'shiftKey':'^','key':'6'},'Digit7':{'keyCode':0x37,'shiftKey':'&','key':'7'},'Digit8':{'keyCode':0x38,'shiftKey':'*','key':'8'},'Digit9':{'keyCode':0x39,'shiftKey':'(','key':'9'},'Digit0':{'keyCode':0x30,'shiftKey':')','key':'0'},'Minus':{'keyCode':0xbd,'shiftKey':'_','key':'-'},'Equal':{'keyCode':0xbb,'shiftKey':'+','key':'='},'Backslash':{'keyCode':0xdc,'shiftKey':'|','key':'\x5c'},'Backspace':{'keyCode':0x8,'key':'Backspace'},'Tab':{'keyCode':0x9,'key':'Tab'},'KeyQ':{'keyCode':0x51,'shiftKey':'Q','key':'q'},'KeyW':{'keyCode':0x57,'shiftKey':'W','key':'w'},'KeyE':{'keyCode':0x45,'shiftKey':'E','key':'e'},'KeyR':{'keyCode':0x52,'shiftKey':'R','key':'r'},'KeyT':{'keyCode':0x54,'shiftKey':'T','key':'t'},'KeyY':{'keyCode':0x59,'shiftKey':'Y','key':'y'},'KeyU':{'keyCode':0x55,'shiftKey':'U','key':'u'},'KeyI':{'keyCode':0x49,'shiftKey':'I','key':'i'},'KeyO':{'keyCode':0x4f,'shiftKey':'O','key':'o'},'KeyP':{'keyCode':0x50,'shiftKey':'P','key':'p'},'BracketLeft':{'keyCode':0xdb,'shiftKey':'{','key':'['},'BracketRight':{'keyCode':0xdd,'shiftKey':'}','key':']'},'CapsLock':{'keyCode':0x14,'key':'CapsLock'},'KeyA':{'keyCode':0x41,'shiftKey':'A','key':'a'},'KeyS':{'keyCode':0x53,'shiftKey':'S','key':'s'},'KeyD':{'keyCode':0x44,'shiftKey':'D','key':'d'},'KeyF':{'keyCode':0x46,'shiftKey':'F','key':'f'},'KeyG':{'keyCode':0x47,'shiftKey':'G','key':'g'},'KeyH':{'keyCode':0x48,'shiftKey':'H','key':'h'},'KeyJ':{'keyCode':0x4a,'shiftKey':'J','key':'j'},'KeyK':{'keyCode':0x4b,'shiftKey':'K','key':'k'},'KeyL':{'keyCode':0x4c,'shiftKey':'L','key':'l'},'Semicolon':{'keyCode':0xba,'shiftKey':':','key':';'},'Quote':{'keyCode':0xde,'shiftKey':'\x22','key':'\x27'},'Enter':{'keyCode':0xd,'key':'Enter','text':'\x0d'},'ShiftLeft':{'keyCode':0xa0,'keyCodeWithoutLocation':0x10,'key':'Shift','location':0x1},'KeyZ':{'keyCode':0x5a,'shiftKey':'Z','key':'z'},'KeyX':{'keyCode':0x58,'shiftKey':'X','key':'x'},'KeyC':{'keyCode':0x43,'shiftKey':'C','key':'c'},'KeyV':{'keyCode':0x56,'shiftKey':'V','key':'v'},'KeyB':{'keyCode':0x42,'shiftKey':'B','key':'b'},'KeyN':{'keyCode':0x4e,'shiftKey':'N','key':'n'},'KeyM':{'keyCode':0x4d,'shiftKey':'M','key':'m'},'Comma':{'keyCode':0xbc,'shiftKey':'<','key':','},'Period':{'keyCode':0xbe,'shiftKey':'>','key':'.'},'Slash':{'keyCode':0xbf,'shiftKey':'?','key':'/'},'ShiftRight':{'keyCode':0xa1,'keyCodeWithoutLocation':0x10,'key':'Shift','location':0x2},'ControlLeft':{'keyCode':0xa2,'keyCodeWithoutLocation':0x11,'key':'Control','location':0x1},'MetaLeft':{'keyCode':0x5b,'key':'Meta','location':0x1},'AltLeft':{'keyCode':0xa4,'keyCodeWithoutLocation':0x12,'key':'Alt','location':0x1},'Space':{'keyCode':0x20,'key':'\x20'},'AltRight':{'keyCode':0xa5,'keyCodeWithoutLocation':0x12,'key':'Alt','location':0x2},'AltGraph':{'keyCode':0xe1,'key':'AltGraph'},'MetaRight':{'keyCode':0x5c,'key':'Meta','location':0x2},'ContextMenu':{'keyCode':0x5d,'key':'ContextMenu'},'ControlRight':{'keyCode':0xa3,'keyCodeWithoutLocation':0x11,'key':'Control','location':0x2},'PrintScreen':{'keyCode':0x2c,'key':'PrintScreen'},'ScrollLock':{'keyCode':0x91,'key':'ScrollLock'},'Pause':{'keyCode':0x13,'key':'Pause'},'PageUp':{'keyCode':0x21,'key':'PageUp'},'PageDown':{'keyCode':0x22,'key':'PageDown'},'Insert':{'keyCode':0x2d,'key':'Insert'},'Delete':{'keyCode':0x2e,'key':'Delete'},'Home':{'keyCode':0x24,'key':'Home'},'End':{'keyCode':0x23,'key':'End'},'ArrowLeft':{'keyCode':0x25,'key':'ArrowLeft'},'ArrowUp':{'keyCode':0x26,'key':'ArrowUp'},'ArrowRight':{'keyCode':0x27,'key':'ArrowRight'},'ArrowDown':{'keyCode':0x28,'key':'ArrowDown'},'NumLock':{'keyCode':0x90,'key':'NumLock'},'NumpadDivide':{'keyCode':0x6f,'key':'/','location':0x3},'NumpadMultiply':{'keyCode':0x6a,'key':'*','location':0x3},'NumpadSubtract':{'keyCode':0x6d,'key':'-','location':0x3},'Numpad7':{'keyCode':0x24,'shiftKeyCode':0x67,'key':'Home','shiftKey':'7','location':0x3},'Numpad8':{'keyCode':0x26,'shiftKeyCode':0x68,'key':'ArrowUp','shiftKey':'8','location':0x3},'Numpad9':{'keyCode':0x21,'shiftKeyCode':0x69,'key':'PageUp','shiftKey':'9','location':0x3},'Numpad4':{'keyCode':0x25,'shiftKeyCode':0x64,'key':'ArrowLeft','shiftKey':'4','location':0x3},'Numpad5':{'keyCode':0xc,'shiftKeyCode':0x65,'key':'Clear','shiftKey':'5','location':0x3},'Numpad6':{'keyCode':0x27,'shiftKeyCode':0x66,'key':'ArrowRight','shiftKey':'6','location':0x3},'NumpadAdd':{'keyCode':0x6b,'key':'+','location':0x3},'Numpad1':{'keyCode':0x23,'shiftKeyCode':0x61,'key':'End','shiftKey':'1','location':0x3},'Numpad2':{'keyCode':0x28,'shiftKeyCode':0x62,'key':'ArrowDown','shiftKey':'2','location':0x3},'Numpad3':{'keyCode':0x22,'shiftKeyCode':0x63,'key':'PageDown','shiftKey':'3','location':0x3},'Numpad0':{'keyCode':0x2d,'shiftKeyCode':0x60,'key':'Insert','shiftKey':'0','location':0x3},'NumpadDecimal':{'keyCode':0x2e,'shiftKeyCode':0x6e,'key':'\x00','shiftKey':'.','location':0x3},'NumpadEnter':{'keyCode':0xd,'key':'Enter','text':'\x0d','location':0x3}}}['us']);function buildLayout(R){const w=new Map();for(const F in R){const E=R[F],u={'name':F,'key':E['key']||'','code':E['keyCodeWithoutLocation']||E['keyCode']||0x0,'text':E['text']??(E['key']['length']===0x1?E['key']:''),'modifier':['Shift','Control','Alt','Meta']['includes'](E['key']),'commands':E['commands']};let M;if(E['shiftKey']){M={...u},M['key']=E['shiftKey'],M['text']=E['shiftKey'];if(E['shiftKeyCode'])M['code']=E['shiftKeyCode'];}w['set'](F,{...u,'shifted':M});if(u['key']['length']===0x1)w['set'](u['key'],u);if(M)w['set'](M['key'],M);}return w;}function makeMouse(R){return new Mouse(R);}var Mouse=class{#target;#position=new Point(0x0,0x0);constructor({target:R}){this.#target=R;}get['position'](){return this.#position;}async['move'](R,{signal:w}){const F=Array['isArray'](R)?R:[R];for(const E of F){const {x:u,y:M}=E,N=this.#position,e=1.7,l=0x5,Y=Math['hypot'](u-N['x'],M-N['y'])/e,I=Math['ceil'](Y/l);for(let f=0x0;f<I;f++){w?.['throwIfAborted']();const W=f/I,i=lerp(N['x'],u,W),K=lerp(N['y'],M,W);await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseMoved','x':i,'y':K},{'signal':w}),await G(l,void 0x0,{'signal':w});}await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseMoved','x':u,'y':M},{'signal':w}),this.#position=new Point(u,M);}}async['click']({x:R,y:w},{button:button='left',times:times=0x1}={}){await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mousePressed','x':R,'y':w,'button':button,'clickCount':times}),await this.#target['connection']['execute']('Input.dispatchMouseEvent',{'type':'mouseReleased','x':R,'y':w,'button':button,'clickCount':times}),this.#position=new Point(R,w);}};function makeKeyboard(R){return new Keyboard(R);}const SLOW_TYPING_BUDGET_MS=0x7d0,WHITESPACE_CONTROL=/[\n\r\t]/;var Keyboard=class{#target;#pressed={'modifiers':new Set(),'keys':new Set()};constructor({target:R}){this.#target=R;}async['press'](R,{raw:w,commands:F}={}){await this['down'](R,{'raw':w,'commands':F}),await G(0xa),await this['up'](R);}async['down'](R,{raw:w,commands:F}={}){for(const E of Array['isArray'](R)?R:[R]){let u=us['get'](E);if(!u)throw new Error('Unknown\x20key\x20\x22'+E+'\x22');if(this.#pressed['modifiers']['has']('Shift')&&u['shifted'])u=u['shifted'];w=!u['text']||w&&u['key']!==u['text'],await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':w?'rawKeyDown':'keyDown','modifiers':toModifiersMask(this.#pressed['modifiers']),'windowsVirtualKeyCode':u['code'],'nativeVirtualKeyCode':u['code'],'code':u['name'],'key':u['key'],'text':w?'':u['text'],'unmodifiedText':w?'':u['text'],'commands':[...F??[],...u['commands']??[]]});if(u['modifier'])this.#pressed['modifiers']['add'](u['key']);else this.#pressed['keys']['add'](u['key']);}}async['up'](R){for(const w of Array['isArray'](R)?R['toReversed']():[R]){const F=us['get'](w);if(!F)throw new Error('Unknown\x20key\x20\x22'+w+'\x22');await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':'keyUp','modifiers':toModifiersMask(this.#pressed['modifiers']),'windowsVirtualKeyCode':F['code'],'nativeVirtualKeyCode':F['code'],'code':F['name'],'key':F['key']});if(F['modifier'])this.#pressed['modifiers']['delete'](F['key']);else this.#pressed['keys']['delete'](F['key']);}}async['type'](R,{signal:w}={}){const F=[...R];let E=0x0;for(let u=0x0;u<F['length'];u++){const M=F[u],N=Date['now']();if(us['has'](M))await this['press'](M);else{if(WHITESPACE_CONTROL['test'](M))await this.#target['connection']['execute']('Input.insertText',{'text':M});else await this.#target['connection']['execute']('Input.dispatchKeyEvent',{'type':'char','text':M});}E+=Date['now']()-N,w?.['throwIfAborted']();if(E>SLOW_TYPING_BUDGET_MS&&u<F['length']-0x1)return this['insert'](F['slice'](u+0x1)['join'](''));await G(0x64);}}async['insert'](R,{keys:w}={}){if(w)await this['press'](w);const F=[...R],E=us['has'](F['at'](-0x1)??'')?F['pop']():void 0x0;if(F['length']>0x0)await this.#target['connection']['execute']('Input.insertText',{'text':F['join']('')});if(E)await this['press'](E);}};function toModifiersMask(R){let w=0x0;if(R['has']('Alt'))w|=0x1;if(R['has']('Control'))w|=0x2;if(R['has']('Meta'))w|=0x4;if(R['has']('Shift'))w|=0x8;return w;}function lerp(R,w,F){return R*(0x1-F)+w*F;}function makeInjection(R){return new Injection(R);}var Injection=class extends EventTargetNode{#targets=new Set();#evaluators=new Map();#isolated=!![];#deep=!![];#watchers={'injected':makeWatcher()};async #inject(R){try{log('injectionStarted',{'name':this['name'],'targetId':R['targetId']}),await R['wait']('initialized'),this.#targets['add'](R),R['on']('closed',()=>this.#targets['delete'](R));for(const w of R['frames']()){if(!this.#isolated&&w['defaultEvaluator'])await this.#attach(w['defaultEvaluator']);w['on']('evaluatorAttached',async({evaluator:F})=>{if(this.#isolated?F['name']===this['name']:F['type']==='default')await this.#attach(F);});}R['on']('frameAttached',({frame:F})=>{F['on']('evaluatorAttached',async({evaluator:E})=>{if(this.#isolated?E['name']===this['name']:E['type']==='default')await this.#attach(E);});}),R['connection']['on']('Runtime.bindingCalled',({executionContextId:F,name:E,payload:u})=>{if(E===this['binding']){const M=this.#evaluators['get'](R['targetId']+':'+F);if(M){const N=JSON['parse'](u);this['dispatch'](new InjectionIncommingMessageEvent(M,N['name'],N['payload']));}}}),await R['connection']['execute']('Runtime.addBinding',{'name':this['binding'],'executionContextName':this.#isolated?this['name']:void 0x0}),await R['connection']['execute']('Page.addScriptToEvaluateOnNewDocument',{'source':await makeExpression(this['expression'])['compile'](),'worldName':this.#isolated?this['name']:void 0x0,'runImmediately':!![]}),this['dispatch'](new InjectionTargetAttachedEvent(R)),this.#deep&&(R['on']('frameTargetCreated',async({target:F})=>this.#inject(F)),await Promise['all'](Array['from'](R['targets'](),async F=>this.#inject(F))));}catch(F){if(F instanceof AbortError)log('injectionTargetAborted',{'name':this['name'],'targetId':R['targetId'],'error':F});else throw F;}}async #attach(R){log('injectionEvaluatorAttached',{'name':this['name'],'evaluatorId':R['evaluatorId'],'evaluatorName':R['name'],'frameId':R['frame']?.['frameId']}),this.#evaluators['set'](R['target']['targetId']+':'+R['evaluatorId'],R),R['on']('destroyed',({evaluatorId:w})=>this.#evaluators['delete'](R['target']['targetId']+':'+w)),this['dispatch'](new InjectionEvaluatorAttachedEvent(R));}['name'];['binding'];['expression'];constructor({target:R,expression:w,name:F,deep:E,isolated:u}){super(),F??=w instanceof Expression?w['name']:F;if(!F)throw new Error('Cannot\x20create\x20an\x20injection\x20without\x20a\x20name');this['expression']=w,this['name']=F,this['binding']='__'+F['replaceAll']('\x20','_')+'_post_message',this.#deep=E??!![],this.#isolated=u??!![],this['cork'](),this.#inject(R)['then'](()=>{this.#watchers['injected']['resolve']();})['catch'](M=>{this.#watchers['injected']['reject'](M);if(M instanceof AbortError)log('injectionAborted',{'targetId':R['targetId'],'error':M});else error('injectionFailed',{'targetId':R['targetId'],'error':M});})['finally'](()=>nextTick(()=>this['uncork']())),this['on']('outgoingMessage',async({name:M,payload:N,filter:e})=>{try{await this['execute']((l,Y,I)=>{const f=globalThis,t=f['ports']?.[l];if(t)setTimeout(()=>t['dispatchEvent'](new f['PortIncommingMessageEvent'](Y,I)),0x0);},[this['name'],M,N],{'filter':e});}catch(l){error('injectionPortSendFailed',{'portName':this['name'],'messageName':M,'error':l});}});}*['targets'](){yield*this.#targets['values']();}async['wait'](R){await this.#watchers[R];}async['execute'](R,w,F){let E=Array['from'](this.#evaluators['values']());if(F?.['filter'])E=E['filter'](F['filter']);return Promise['all'](E['map'](u=>u['execute'](R,w,F)));}async['evaluate'](R,w){let F=Array['from'](this.#evaluators['values']());if(w?.['filter'])F=F['filter'](w['filter']);return Promise['all'](F['map'](E=>E['evaluate'](R,w)));}['send'](R,w,F){this['dispatch'](new InjectionOutgoingMessageEvent(R,w,F));}},InjectionTargetAttachedEvent=class extends Event{['target'];constructor(R){super('evaluatorAttached'),this['target']=R;}},InjectionEvaluatorAttachedEvent=class extends Event{['evaluator'];constructor(R){super('evaluatorAttached'),this['evaluator']=R;}},InjectionOutgoingMessageEvent=class extends Event{['name'];['payload'];['filter'];constructor(R,w,F){super('outgoingMessage'),this['name']=R,this['payload']=w,this['filter']=F?.['filter'];}},InjectionIncommingMessageEvent=class extends Event{['evaluator'];['name'];['payload'];constructor(R,w,F){super('incommingMessage'),this['evaluator']=R,this['name']=w,this['payload']=F;}};function makeRequestsTracker(){return new RequestsTracker();}var RequestsTracker=class{#requestsWatchers=new Map();#allDoneWatcher=makeWatcher();get['pending'](){return this.#allDoneWatcher['settled'];}get[Symbol['toStringTag']](){return'RequestTracker';}constructor(){this.#allDoneWatcher['resolve']();}async['wait'](){await this.#allDoneWatcher;}['track'](R,w){this.#requestsWatchers['set'](R,w);if(this.#allDoneWatcher['settled'])this.#allDoneWatcher['reset']();w['finally'](()=>{if(this.#requestsWatchers['get'](R)===w)this['untrack'](R);});}['untrack'](R){const w=this.#requestsWatchers['delete'](R);if(w&&this.#requestsWatchers['size']===0x0)this.#allDoneWatcher['resolve']();return w;}['resolveBy'](R){this.#requestsWatchers['get'](R)?.['resolve']();}['debounceBy'](R,w){this.#requestsWatchers['get'](R)?.['resolve'](void 0x0,{'delay':w,'key':'debounce'});}};function makeIntercepted(R){if(R['intercepted']['responseStatusCode']===void 0x0&&R['intercepted']['responseErrorReason']===void 0x0)return makeInterceptedRequest(R);return makeInterceptedResponse(R);}var Intercepted=class{['_handled']=![];['target'];['frame'];['requestId'];['stage'];['resource'];constructor({target:R,intercepted:w}){this['target']=R,this['frame']=R['browser']['frameManager']['get'](w['frameId']),this['requestId']=w['requestId'],this['resource']=w['resourceType'],this['stage']=w['responseStatusCode']===void 0x0&&w['responseErrorReason']===void 0x0?'request':'response';}get['handled'](){return this['_handled'];}async['fulfill']({status:R,headers:w,body:F}){await this['target']['connection']['execute']('Fetch.fulfillRequest',{'requestId':this['requestId'],'responseCode':R,'responseHeaders':w&&Object['entries'](w)['map'](([E,u])=>({'name':E,'value':u})),'body':F&&X['from'](F)['toString']('base64')}),this['_handled']=!![];}};function makeInterceptedRequest(R){return new InterceptedRequest(R);}var InterceptedRequest=class extends Intercepted{#networkId;#body;['stage']='request';['url'];['method'];['headers'];constructor({target:R,intercepted:w}){super({'target':R,'intercepted':w}),this['url']=w['request']['url']+(w['request']['urlFragment']??''),this['method']=w['request']['method'],this['headers']=w['request']['headers'],this.#networkId=w['networkId'];if(!w['request']['hasPostData'])this.#body=new Uint8Array();else{if(w['request']['postDataEntries']?.['length'])this.#body=X['concat'](w['request']['postDataEntries']['map'](F=>X['from'](F['bytes']??'','base64')));}}async['continue']({headers:R,url:w,method:F,body:E,interceptResponse:u}={}){await this['target']['connection']['execute']('Fetch.continueRequest',{'requestId':this['requestId'],'headers':R&&Object['entries'](R)['map'](([M,N])=>({'name':M,'value':N})),'url':w,'method':F,'postData':E!==void 0x0?X['from'](E)['toString']('base64'):void 0x0,'interceptResponse':u}),this['_handled']=!![];}async['body'](){if(this.#body)return this.#body;if(this.#networkId){const {postData:R}=await this['target']['connection']['execute']('Network.getRequestPostData',{'requestId':this.#networkId});return new TextEncoder()['encode'](R);}return new Uint8Array();}};function makeInterceptedResponse(R){return new InterceptedResponse(R);}var InterceptedResponse=class extends Intercepted{#consumed=![];['stage']='response';['request'];['status'];['error'];['headers'];['body'];constructor({target:R,intercepted:w}){if(w['responseStatusCode']===void 0x0&&w['responseErrorReason']===void 0x0)throw new Error('InterceptedResponse\x20requires\x20a\x20response-stage\x20Fetch\x20event');super({'target':R,'intercepted':w}),this['status']=w['responseStatusCode']??-0x1,this['error']=w['responseErrorReason'],this['headers']=Object['fromEntries']((w['responseHeaders']??[])['map'](({name:F,value:E})=>[F,E])),this['request']=makeInterceptedRequest({'target':R,'intercepted':w}),this['body']=makeRemoteStream(this['target']['connection'],async()=>{this.#assertNotConsumed('body'),this.#consumed=!![];const {stream:F}=await this['target']['connection']['execute']('Fetch.takeResponseBodyAsStream',{'requestId':this['requestId']});return F;});}async['continue'](){await this['target']['connection']['execute']('Fetch.continueResponse',{'requestId':this['requestId']}),this['_handled']=!![];}async['arrayBuffer'](){this.#assertNotConsumed('arrayBuffer'),this.#consumed=!![];const {body:R,base64Encoded:w}=await this['target']['connection']['execute']('Fetch.getResponseBody',{'requestId':this['requestId']}),F=w?X['from'](R,'base64'):X['from'](R,'utf8');return new Uint8Array(F)['buffer'];}async['base64'](){this.#assertNotConsumed('base64'),this.#consumed=!![];const {body:R,base64Encoded:w}=await this['target']['connection']['execute']('Fetch.getResponseBody',{'requestId':this['requestId']});return w?R:X['from'](R,'utf8')['toString']('base64');}#assertNotConsumed(R){if(this.#consumed)throw new BodyConsumedError({'accessor':R});}};function makeInterceptionPatternMatcher(R){const w=[];if(R['url'])w['push'](F=>R['url']['test'](F['request']['url']+(F['request']['urlFragment']??'')));if(R['resource'])w['push'](F=>R['resource']['includes'](F['resourceType']));if(R['stage'])w['push'](F=>R['stage']['includes'](F['responseStatusCode']===void 0x0&&F['responseErrorReason']===void 0x0?'request':'response'));return F=>w['every'](E=>E(F));}function toCDPPattern(R){const w=R['resource']??[void 0x0],F=R['stage']??['request'],E=[];for(const u of w)for(const M of F)E['push']({'urlPattern':'*',...u&&{'resourceType':u},'requestStage':M==='response'?'Response':'Request'});return E;}var StylesheetHandle=class{['stylesheetId'];['frame'];['url'];['inline'];['constructed'];['ownerNode'];constructor({stylesheetId:R,frame:w,url:F,inline:E,constructed:u,ownerNode:M}){this['stylesheetId']=R,this['frame']=w,this['url']=F,this['inline']=E,this['constructed']=u,this['ownerNode']=M;}async['text'](){const {text:R}=await this['frame']['target']['connection']['execute']('CSS.getStyleSheetText',{'styleSheetId':this['stylesheetId']});return R;}};function makeTarget(R){return new Target(R);}var Target=class extends EventTargetNode{#connection;#browser;#evaluator;#url;#title;#mode='normal';#filepickersHidden=![];#loaders=new Map();#dialog=null;#injections=new Map();#visible=void 0x0;#controller=new AbortController();#watchers={'attached':makeWatcher(),'initialized':makeWatcher(),'navigated':makeWatcher({'hint':'chrome'}),'dialogOpened':makeWatcher(),'windowResolved':makeWatcher()};#window;#requestsTracker=makeRequestsTracker();#requestInterceptors=new Set();#filepickerHandlers=new Set();async #initialize(R){try{this.#connection=makeConnection({'socket':this.#browser['connection']['socket'],'signal':this.#controller['signal'],'sessionId':R}),this.#watchers['attached']['resolve'](),await setImmediate();if(this['mainFrame'])this['dispatch'](new TargetMainFrameReadyEvent(this['mainFrame']));this['kind']==='renderer'&&(this.#handleExistentFrames()['catch'](w=>{error('framesExtractionFailed',{'targetId':this['targetId'],'error':w});}),this.#resolveWindow()['catch'](w=>{error('windowResolutionFailed',{'targetId':this['targetId'],'error':w}),this.#watchers['windowResolved']['reject'](w);}),this['connection']['on']('Overlay.inspectNodeRequested',async({backendNodeId:w})=>{if(this.#mode==='element\x20selection')this['dispatch'](new TargetElementSelectedEvent(await this['resolve']({'nodeId':w})));}),this['connection']['on']('Page.frameAttached',({frameId:w,parentFrameId:F})=>{if(this.#browser['frameManager']['has'](w)){log('frameAttached',{'frameId':w,'parentFrameId':F,'reattached':!![]});const E=this.#browser['frameManager']['get'](w);E['dispatch'](new FrameSwappingEvent()),E['dispatch'](new FrameSwappedEvent(this));}else{log('frameAttached',{'frameId':w,'parentFrameId':F,'reattached':![]});const u=makeFrame({'target':this,'frameId':w,'parentFrameId':F});this.#browser['frameManager']['add'](u),this['dispatch'](new TargetFrameAttachedEvent(u));}}),this['connection']['on']('Page.frameDetached',({frameId:w,reason:F})=>{const E=this.#browser['frameManager']['get'](w);if(F==='remove'){log('frameRemoved',{'frameId':w});if(!E)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20is\x20removed\x20but\x20the\x20frame\x20wasn\x27t\x20found');E['dispatch'](new FrameDestroyedEvent()),this.#browser['frameManager']['delete'](w);}else{if(F==='swap'){log('frameSwapped',{'frameId':w,'ownTargetFound':!![]});if(!E)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20is\x20swapped\x20but\x20the\x20frame\x20wasn\x27t\x20found');const u=this.#browser['targetManager']['get'](w);if(!u)return log('frameSwapped',{'frameId':w,'ownTargetFound':![]});E['dispatch'](new FrameSwappedEvent(u));}}}),this['connection']['on']('Page.frameRequestedNavigation',async({frameId:w,reason:F,url:E})=>{log('frameNavigationRequested',{'frameId':w,'url':E,'reason':F});const u=this.#browser['frameManager']['get'](w);if(!u)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20requested\x20navigation\x20but\x20the\x20frame\x20wasn\x27t\x20found');u['dispatch'](new FrameNavigatingEvent({'url':E,'reason':F}));}),this['connection']['on']('Page.frameNavigated',({frame:{id:w,url:F,loaderId:E},type:u})=>{log('frameNavigated',{'frameId':w,'url':F,'navigationType':u});const M=this.#browser['frameManager']['get'](w);if(!M)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20is\x20navigated\x20but\x20the\x20frame\x20wasn\x27t\x20found');this.#browser['frameManager']['deleteDescendants'](w),M['dispatch'](new FrameNavigatedEvent({'url':F,'reason':u==='Navigation'?'remote':'restoration','loaderId':E}));}),this['connection']['on']('Page.navigatedWithinDocument',({frameId:w,url:F})=>{log('frameNavigatedWithinDocument',{'frameId':w,'url':F});const E=this.#browser['frameManager']['get'](w);if(!E)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20is\x20navigated\x20within\x20document\x20but\x20the\x20frame\x20wasn\x27t\x20found');E['dispatch'](new FrameNavigatedEvent({'url':F,'reason':'local','loaderId':''}));}),this['connection']['on']('Page.frameStartedLoading',({frameId:w})=>{log('frameLoadingStarted',{'frameId':w});const F=this.#browser['frameManager']['get'](w);if(!F)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20started\x20loading\x20but\x20the\x20frame\x20wasn\x27t\x20found');F['dispatch'](new FrameLifecycleEvent('loading'));}),this['connection']['on']('Page.frameStoppedLoading',({frameId:w})=>{log('frameLoadingStopped',{'frameId':w});const F=this.#browser['frameManager']['get'](w);if(!F)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20stopped\x20loading\x20but\x20the\x20frame\x20wasn\x27t\x20found');F['dispatch'](new FrameLifecycleEvent('loaded'));}),this['connection']['on']('Page.lifecycleEvent',({frameId:w,name:F})=>{log('frameLifecycleEvent',{'frameId':w,'name':F});const E=this.#browser['frameManager']['get'](w);if(!E)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20fired\x20a\x20lifecycle\x20event\x20but\x20the\x20frame\x20wasn\x27t\x20found');if(F==='load'&&!this.#watchers['initialized']['settled'])E['dispatch'](new FrameLifecycleEvent('loaded'));else{if(F==='networkAlmostIdle')E['dispatch'](new FrameLifecycleEvent('networkAlmostIdle'));else{if(F==='networkIdle')E['dispatch'](new FrameLifecycleEvent('networkIdle'));}}}),this['connection']['on']('Page.javascriptDialogOpening',({type:w,message:F})=>{log('dialogOpened',{'dialogType':w,'message':F}),this.#dialog=makeBlockingDialog({'target':this,'type':w,'message':F}),this.#watchers['dialogOpened']['resolve'](),this['dispatch'](new TargetDialogEvent('opened',this.#dialog));}),this['connection']['on']('Page.javascriptDialogClosed',({result:w,userInput:F})=>{log('dialogClosed',{}),this.#watchers['dialogOpened']['reset'](),this['dispatch'](new TargetDialogEvent('closed',this.#dialog,{'result':w,'value':F})),this.#dialog=null;}),this['connection']['on']('Page.fileChooserOpened',async({frameId:w,backendNodeId:F,mode:E})=>{log('filepickerOpened',{'frameId':w});const u=this.#browser['frameManager']['get'](w);if(!u)throw new Error('Filepicker\x20dialog\x20opened\x20in\x20frame\x20with\x20id\x20\x22'+w+'\x22\x20but\x20the\x20frame\x20wasn\x27t\x20found');const M=F?await u['resolve']({'nodeId':F}):await u['defaultExecute'](()=>globalThis['__mockFilepicker']),N=E==='selectMultiple',e=await M?.['execute'](l=>l['accept'])??'';this.#dialog=makeFilepickerDialog({'frame':u,'element':M,'multiple':N,'accept':e}),this.#dialog['once']('handled',()=>this.#dialog=null);if(this.#filepickerHandlers['size']>0x0)for(const l of this.#filepickerHandlers){await l(this.#dialog);if(this.#dialog['handled'])break;}else this.#watchers['dialogOpened']['resolve'](),this['dispatch'](new TargetFilepickerDialogEvent(this.#dialog));}),this['connection']['on']('Page.windowOpen',async()=>{log('childTargetCreated',{'targetId':this['targetId']}),this['dispatch'](new TargetChildTargetCreatingEvent());}),this['connection']['on']('CSS.styleSheetAdded',({header:w})=>{if(w['origin']==='user-agent'||w['origin']==='inspector')return;const F=this.#browser['frameManager']['get'](w['frameId']);if(!F)return;F['addStylesheet'](new StylesheetHandle({'stylesheetId':w['styleSheetId'],'frame':F,'url':w['sourceURL'],'inline':w['isInline'],'constructed':w['isConstructed'],'ownerNode':w['ownerNode']}));}),this['connection']['on']('CSS.styleSheetRemoved',({styleSheetId:w})=>{for(const F of this['frames']())if(F['removeStylesheet'](w))break;})),this['connection']['on']('Target.attachedToTarget',async({sessionId:w,targetInfo:F})=>{log('targetAttached',{'targetId':F['targetId'],'targetType':F['type'],'parentTargetId':this['targetId'],'sessionId':w});if(F['type']==='worker'){await makeConnection({'socket':this.#browser['connection']['socket'],'sessionId':w})['execute']('Runtime.runIfWaitingForDebugger')['catch'](E=>{error('workerResumeFailed',{'targetId':F['targetId'],'error':E});});return;}this.#browser['targetManager']['get'](F['targetId'])?.['dispatch'](new TargetAttachedEvent(w));}),this['connection']['on']('Runtime.executionContextCreated',({context:w})=>{if(w['auxData']?.['frameId']){log('executionContextCreated',{'contextId':w['id'],'contextName':w['name'],'frameId':w['auxData']['frameId']});const F=this['browser']['frameManager']['get'](w['auxData']['frameId']);if(!F)throw new Error('Execution\x20context\x20with\x20id\x20\x22'+w['id']+'\x22\x20and\x20name\x20\x22'+w['name']+'\x22\x20is\x20created\x20for\x20frame\x20with\x20id\x20\x22'+w['auxData']['frameId']+'\x22\x20but\x20the\x20frame\x20wasn\x27t\x20found');const E=makeEvaluator({'frame':F,'name':w['name'],'evaluatorId':w['id'],'type':w['auxData']['type']});F['dispatch'](new FrameEvaluatorAttached(E));}else log('executionContextCreated',{'contextId':w['id'],'targetId':this['targetId']}),this.#evaluator=makeEvaluator({'target':this,'name':w['name'],'evaluatorId':w['id'],'type':'default'});}),this['connection']['on']('Network.requestWillBeSent',({loaderId:w,frameId:F,requestId:E,type:u,request:M,hasUserGesture:N})=>{if(u==='Document')log('requestSent',{'frameId':F,'url':M['url'],'kind':'navigation','resourceType':u});else{if(M['url']['startsWith']('blob:'))log('requestSent',{'frameId':F,'url':M['url'],'kind':'blob','resourceType':u});else{if(N){const l=!isNonBlockingRequest(u,M['url']);log('requestSent',{'targetId':this['targetId'],'url':M['url'],'kind':'userInitiated','resourceType':u,'tracked':l});if(l)this.#requestsTracker['track'](E,makeWatcher()['resolve'](void 0x0,{'delay':0x9c40}));}else{if(F){const Y=this.#browser['frameManager']['get'](F);if(Y&&Date['now']()-Y['navigatedAt']<0xbb8){const I=!isNonBlockingRequest(u,M['url']);log('requestSent',{'frameId':F,'url':M['url'],'kind':'frameSubresource','resourceType':u,'tracked':I});if(I)this.#requestsTracker['track'](E,makeWatcher()['resolve'](void 0x0,{'delay':0x2710}));}}}}}let e=this.#loaders['get'](w);if(!e){if(F){const f=this.#browser['frameManager']['get'](F);if(!f)throw new Error('Frame\x20with\x20id\x20\x22'+F+'\x22\x20received\x20a\x20response\x20but\x20the\x20frame\x20wasn\x27t\x20found');e=makeLoader({'loaderId':w,'frame':f});}else e=makeLoader({'loaderId':w});this.#loaders['set'](w,e);}e['dispatch'](new LoaderRequestEvent(M,{'requestId':E,'resource':u??'Other'}));}),this['connection']['on']('Network.responseReceived',({loaderId:w,frameId:F,requestId:E,type:u,response:M})=>{let N=this.#loaders['get'](w);if(!N){if(F){const Y=this.#browser['frameManager']['get'](F);if(!Y)throw new Error('Frame\x20with\x20id\x20\x22'+F+'\x22\x20received\x20a\x20response\x20but\x20the\x20frame\x20wasn\x27t\x20found');N=makeLoader({'loaderId':w,'frame':Y});}else N=makeLoader({'loaderId':w});this.#loaders['set'](w,N);}N['dispatch'](new LoaderResponseEvent(M,{'requestId':E,'resource':u}));const e=[/^text\/event-stream$/,/^application\/octet-stream$/,/video\/*/],l=M['headers']['content-type']||'';if(e['some'](I=>I['test'](l)))this.#requestsTracker['resolveBy'](E);else this.#requestsTracker['debounceBy'](E,0xbb8);}),this['connection']['on']('Network.dataReceived',({requestId:w})=>{this.#requestsTracker['debounceBy'](w,0xbb8);}),this['connection']['on']('Network.loadingFinished',({requestId:w})=>{this.#requestsTracker['resolveBy'](w);}),this['connection']['on']('Network.loadingFailed',({requestId:w})=>{this.#requestsTracker['resolveBy'](w);}),this['connection']['on']('Fetch.requestPaused',async w=>{const F=makeIntercepted({'target':this,'intercepted':w});for(const {matchers:E,handler:u}of this.#requestInterceptors){if(!E['some'](M=>M(w)))continue;await u(F);if(F['handled'])return;}await F['continue']();}),await Promise['all']([this['kind']==='renderer'&&this['connection']['execute']('Page.enable',{'enableFileChooserOpenedEvent':!![]}),this['kind']==='renderer'&&this['connection']['execute']('Page.setLifecycleEventsEnabled',{'enabled':!![]}),this['connection']['execute']('Network.enable'),this['connection']['execute']('Runtime.enable'),this['kind']==='renderer'&&this['connection']['execute']('DOM.enable'),this['kind']==='renderer'&&this['connection']['execute']('Overlay.enable'),this['kind']==='renderer'&&this['connection']['execute']('CSS.enable'),this['kind']==='renderer'&&this['connection']['execute']('Target.setAutoAttach',{'autoAttach':!![],'flatten':!![],'filter':[{'type':'page'},{'type':'iframe'},{'type':'worker'}],'waitForDebuggerOnStart':!![]}),this['connection']['execute']('Runtime.runIfWaitingForDebugger')]);}catch(w){if(w instanceof AbortError)log('targetInitAborted',{'targetId':this['targetId'],'error':w});else throw w;}this.#watchers['initialized']['resolve']();if(!this.#browser['headless']&&this['kind']==='renderer'&&this['type']!=='iframe')this.#trackVisibility()['catch'](F=>{error('visibilityTrackingFailed',{'targetId':this['targetId'],'error':F});});this.#mockProgrammaticFilepickers()['catch'](F=>{error('filepickerMockingFailed',{'targetId':this['targetId'],'error':F});});if(this['kind']==='renderer')this['hideFilepickers'](this.#browser['filepickersHidden']);}async #resolveWindow(){const {windowId:R}=await this.#browser['connection']['execute']('Browser.getWindowForTarget',{'targetId':this['targetId']});this.#window=this.#browser['windowManager']['getOrCreate']({'windowId':R,'browser':this.#browser}),this.#window['dispatch'](new WindowTargetAttachedEvent(this)),this.#watchers['windowResolved']['resolve']();}async #handleExistentFrames(){const {frameTree:R}=await this['connection']['execute']('Page.getFrameTree'),w=[R];for(let F=0x0;F<w['length'];++F){const E=w[F];if(!this.#browser['frameManager']['has'](E['frame']['id'])){const u=makeFrame({'target':this,'frameId':E['frame']['id'],'parentFrameId':E['frame']['parentId']??null});this.#browser['frameManager']['add'](u),this['dispatch'](new TargetFrameAttachedEvent(u));if(u['frameId']===this['targetId'])this['dispatch'](new TargetMainFrameReadyEvent(this['mainFrame']));}if(E['childFrames'])w['push'](...E['childFrames']);}}async #trackVisibility(){const R=await this['inject'](visibilityTracker,{'name':'visibility_tracker','deep':![]});this.#visible=![],R['on']('incommingMessage',({name:w,payload:F})=>{if(w==='visibilityChanged'){log('targetVisibilityChanged',{'targetId':this['targetId'],'visibility':F});const E=F==='visible';this.#visible!==E&&(this.#visible=E,this['dispatch'](new TargetVisibilityChangeEvent(F)));}}),this['on']('childTargetCreating',async()=>R['send']('childTargetCreating',void 0x0));}async #mockProgrammaticFilepickers(){await this['inject'](filepickerMocker,{'name':'filepicker_mocker','isolated':![]});}['targetId'];['type'];['kind'];['createdAt']=Date['now']();['parent'];['debugger']=makeDebugger({'target':this});['mouse']=makeMouse({'target':this});['keyboard']=makeKeyboard({'target':this});get['initialized'](){return this.#watchers['initialized']['settled'];}get['attached'](){return!!this.#connection;}get['navigated'](){return this.#watchers['initialized']['settled']&&this.#watchers['navigated']['settled'];}get['stable'](){return this.#watchers['initialized']['settled']&&this.#watchers['navigated']['settled']&&(this['mainFrame']['stable']||this.#watchers['dialogOpened']['settled']);}get['pendingRequests'](){return this.#requestsTracker['pending'];}get['download'](){const R=this['mainFrame']['response']?.['headers']??{};return!!(Object['entries'](R)['find'](([w])=>w['toLowerCase']()==='content-disposition')?.[0x1])?.['startsWith']('attachment');}get['visible'](){return this.#visible;}get['mode'](){return this.#mode;}get['title'](){return this.#title;}get['url'](){return this.#url;}get['connection'](){return this.#connection;}get['browser'](){return this.#browser;}get['window'](){return this.#window;}get['popup'](){return!!this['parent']&&this['window']!==this['parent']['window'];}get['mainFrame'](){return this.#browser['frameManager']['get'](this['targetId']);}get['dialog'](){return this.#dialog;}get['injections'](){return Object['fromEntries'](this.#injections['entries']());}constructor({browser:R,parent:w,targetId:F,type:E,url:u,title:M}){super(),this.#browser=R,this.#url=u,this.#title=M,this['parent']=w,this['targetId']=F,this['type']=E,this['kind']=E==='page'||E==='iframe'||E==='other'&&u['startsWith']('devtools:')?'renderer':'worker';if(this['type']==='page'){const N=makeFrame({'target':this,'frameId':this['targetId'],'parentFrameId':null});this.#browser['frameManager']['add'](N);}else{if(this['type']==='iframe'){const e=this.#browser['frameManager']['get'](this['targetId']);if(e){const l=e['target'];e['dispatch'](new FrameSwappingEvent()),this['on']('detached',()=>e['dispatch'](new FrameSwappedEvent(l)));}}}if(this.#browser['headless'])this.#visible=!![];this['on']('attached',({sessionId:Y})=>{this.#initialize(Y);}),this['on']('changed',({url:Y,title:I})=>{this.#url=Y,this.#title=I;}),this['on']('closed',()=>{this.#controller['abort'](new AbortError('Target\x20with\x20id\x20\x22'+this['targetId']+'\x22\x20and\x20of\x20type\x20\x22'+this['type']+'\x22\x20is\x20closed\x20in\x20the\x20middle\x20of\x20operation'));if(this.#window)this.#window['dispatch'](new WindowTargetDetachedEvent(this));}),this['on']('dialogOpened',()=>{this['connection']['flush'](new FlushError('Target\x20with\x20id\x20\x22'+this['targetId']+'\x22\x20and\x20of\x20type\x20\x22'+this['type']+'\x22\x20is\x20blocked\x20due\x20to\x20dialog\x20opening'));}),this['on']('mainFrameReady',()=>{this['mainFrame']['on']('navigating',({reason:Y})=>{this.#watchers['navigated']['reset']({'hint':Y==='unknown'?'chrome':Y==='programmatic'?'programmatic':'page'});}),this['mainFrame']['on']('navigated',({url:Y,reason:I})=>{this.#watchers['navigated']['resolve']();const f=this.#url;this.#url=Y;if(I==='local')this['dispatch'](new TargetNavigatedEvent({'from':f,'to':Y,'reason':'page'}));else{if(Y!=='chrome-error://chromewebdata/')this['dispatch'](new TargetNavigatedEvent({'from':f,'to':Y,'reason':this.#watchers['navigated']['hint']}));}}),this['mainFrame']['on']('loading',()=>{}),this['mainFrame']['on']('loaded',()=>{this.#watchers['navigated']['resolve']();});}),this['on']('frameTargetCreated',({target:Y})=>{Y['on']('filepickerDialogOpened',({dialog:I})=>this['dispatch'](new TargetFilepickerDialogEvent(I)));});}*['frames'](){if(this.#controller['signal']['aborted']||!this.#browser['frameManager']['has'](this['targetId']))return;yield*this.#browser['frameManager']['getFramesIterator'](this['targetId']);}*['targets'](){yield*this['frames']()['filter'](R=>R['frameId']!==this['targetId']&&R['isOutOfProcess'])['map'](R=>R['target']);}async['wait'](R,{signal:w}={}){if(R==='stable')await abortable(this.#watchers['initialized'],w),this['kind']==='renderer'&&(await abortable(this.#watchers['navigated'],w),await abortable(Promise['race']([this['mainFrame']['wait']('stable'),this.#watchers['dialogOpened']]),w));else{if(R==='pendingRequests')await abortable(this.#requestsTracker['wait'](),w);else await abortable(this.#watchers[R],w);}}async['activate'](){if(this['type']!=='page')throw new Error('Only\x20page\x20target\x20could\x20be\x20activated');this['dispatch'](new TargetActivatingEvent()),await this['connection']['execute']('Page.bringToFront');if(this.#browser['headless'])this['dispatch'](new TargetActivatedEvent({'reason':'programmatic'}));}async['emulate']({viewport:R,scale:scale=0x1,mobile:mobile=![],timeout:w}){return this['connection']['execute']('Emulation.setDeviceMetricsOverride',{...R,'deviceScaleFactor':scale,'mobile':mobile},{'timeout':w});}async['getViewportSize'](){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20get\x20a\x20viewport\x20size\x20of\x20a\x20non-renderer\x20target');const {offsetX:R,offsetY:w}=await this['mainFrame']['execute'](()=>{return{'offsetX':innerWidth-Math['round'](visualViewport['width']),'offsetY':innerHeight-Math['round'](visualViewport['height'])};}),{cssVisualViewport:F}=await this['connection']['execute']('Page.getLayoutMetrics'),{clientWidth:E,clientHeight:u,scale:scale=0x1,zoom:zoom=0x1}=F;return{'width':Math['round']((E+R)*zoom*scale),'height':Math['round']((u+w)*zoom*scale)};}async['captureScreenshot'](R){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20capture\x20screenshot\x20of\x20a\x20non-renderer\x20target');return await this['connection']['execute']('Emulation.setVisibleSize',await this['getViewportSize']()),(await this['connection']['execute']('Page.captureScreenshot',{'format':R?.['format']??'png',...R?.['quality']===void 0x0?{}:{'quality':R['quality']}}))['data'];}async['execute'](R,w,F){await this['wait']('stable');if(this['kind']==='renderer')throw new Error('Can\x27t\x20execute\x20script\x20in\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return this.#evaluator['execute'](R,w,F);}async['evaluate'](R,w){if(this['kind']==='renderer')throw new Error('Can\x27t\x20evaluate\x20expression\x20in\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return await this['wait']('stable'),this.#evaluator['evaluate'](R,w);}async['resolve'](R){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20resolve\x20node\x20with\x20a\x20non-renderer\x20target');for(const w of this['frames']()){const F=await w['resolve'](R);if(F)return F;}throw new Error('Cannot\x20resolve\x20node\x20by\x20backend\x20id\x20\x22'+R['nodeId']+'\x22\x20in\x20target\x20with\x20id\x20\x22'+this['targetId']+'\x22');}async['resolveFromLocation'](R,{ignorePointerEventsNone:ignorePointerEventsNone=!![]}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20resolve\x20node\x20with\x20a\x20non-renderer\x20target');try{const {frameId:w,...F}=await this['connection']['execute']('DOM.getNodeForLocation',{'x':Math['round'](R['x']),'y':Math['round'](R['y']),'ignorePointerEventsNone':ignorePointerEventsNone,'includeUserAgentShadowDOM':![]}),E=this['browser']['frameManager']['get'](w);if(!E)throw new Error('Frame\x20with\x20id\x20\x22'+w+'\x22\x20resolved\x20a\x20node\x20but\x20the\x20frame\x20wasn\x27t\x20found');return await E['resolve']({'nodeId':F['backendNodeId']});}catch(u){return error('nodeResolutionFailed',{'error':u}),null;}}async['port'](R){if(this['kind']==='renderer')throw new Error('Can\x27t\x20create\x20a\x20port\x20to\x20renderer\x20target,\x20use\x20target\x27s\x20main\x20frame\x20instead');return this.#evaluator['port'](R);}async['filepicker'](R){const w=[];try{this.#filepickerHandlers['size']===0x0&&(await this['wait']('initialized'),await this['hideFilepickers'](!![])),this.#filepickerHandlers['add'](R),this.#controller['signal']['throwIfAborted'](),w['push'](this['on']('frameTargetCreated',async({target:F})=>w['push'](await F['filepicker'](R)))),w['push'](...await Promise['all'](Array['from'](this['targets'](),F=>F['filepicker'](R))));}catch(F){if(F instanceof AbortError)log('filepickerSetupAborted',{'targetId':this['targetId'],'error':F});else throw F;}return()=>{this.#filepickerHandlers['delete'](R),w['forEach'](E=>E());if(this.#filepickerHandlers['size']===0x0)this['hideFilepickers'](![]);};}async['intercept'](R,w){const F=w??R,E=w?Array['isArray'](R)?R:[R]:[{'stage':['request']}],u={'matchers':E['map'](N=>makeInterceptionPatternMatcher(N)),'patterns':E['flatMap'](N=>toCDPPattern(N)),'handler':F},M=[];try{this.#requestInterceptors['add'](u),await this['wait']('attached'),this['connection']['send']('Fetch.enable',{'patterns':Array['from'](this.#requestInterceptors)['flatMap'](({patterns:N})=>N)}),this.#controller['signal']['throwIfAborted'](),await this['wait']('initialized'),M['push'](this['on']('frameTargetCreated',async({target:N})=>M['push'](await N['intercept'](E,F)))),M['push'](...await Promise['all'](Array['from'](this['targets'](),N=>N['intercept'](E,F))));}catch(N){if(N instanceof AbortError)log('interceptorSetupAborted',{'targetId':this['targetId'],'error':N});else throw N;}return()=>{this.#requestInterceptors['delete'](u),M['forEach'](e=>e());if(this.#requestInterceptors['size']===0x0)this['connection']['send']('Fetch.disable');else this['connection']['send']('Fetch.enable',{'patterns':Array['from'](this.#requestInterceptors)['flatMap'](({patterns:e})=>e)});};}async['navigateThroughHistory'](R){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');const {currentIndex:w,entries:F}=await this['connection']['execute']('Page.getNavigationHistory'),E=F[w+R];if(!E)throw new NoHistoryEntryError({'offset':R});this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':E['url'],'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'}),await this['connection']['execute']('Page.navigateToHistoryEntry',{'entryId':E['id']});}async['navigate'](R,{timeout:w,headers:F}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');if(!this.#watchers['navigated']['settled'])await Promise['allSettled']([this.#watchers['navigated']]);let E;if(F){const M=URL['parse'](R)?.['host'];E=await this['intercept']([{'stage':['request']}],async N=>{if(N['stage']!=='request')return;if(URL['parse'](N['url'])?.['host']!==M)return;await N['continue']({'headers':{...N['headers'],...F}});});}this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':R,'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'});if(w)this.#watchers['navigated']['reject'](new NavigationTimedOutError({'url':R,'timeout':w}),{'delay':w});const u=new AbortController();this.#watchers['navigated']['catch'](N=>u['abort'](N));try{const {errorText:N}=await this['connection']['execute']('Page.navigate',{'url':R},{'signal':u['signal'],'timeout':w?w+0x1388:void 0x0});if(N){if(N==='net::ERR_INVALID_AUTH_CREDENTIALS')this.#watchers['navigated']['resolve']();else{if(N==='net::ERR_ABORTED'&&[0xcc,0xcd]['includes'](this['mainFrame']['response']['status']))this.#watchers['navigated']['resolve']();else this.#watchers['navigated']['reject'](new NavigationFailedError({'url':R,'reason':N}));}}await this.#watchers['navigated'];}catch(e){E?.();throw e;}if(E)this['mainFrame']['once']('navigating',E);return{'url':R,'status':this['mainFrame']['response']['status'],'headers':this['mainFrame']['response']['headers']};}async['reload']({hard:R}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');if(R)await this.#browser['clearCookies']();this['mainFrame']['dispatch'](new FrameNavigatingEvent({'url':this['url'],'reason':'programmatic'})),this.#watchers['navigated']['reset']({'hint':'programmatic'}),await this['connection']['execute']('Page.reload',{'ignoreCache':R}),await this.#watchers['navigated'],await Promise['race']([this['wait']('dialogOpened'),this['mainFrame']['wait']('networkAlmostIdle')]);}async['cancelNavigation'](){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20navigate\x20a\x20non-renderer\x20target');await this['connection']['execute']('Page.stopLoading')['catch'](()=>null);}async['devtools'](R){const {targetId:w}=await this.#browser['connection']['execute']('Target.openDevTools',{'targetId':this['targetId']});await this.#browser['wait']('attachedTargets');const F=this.#browser['targetManager']['get'](w);if(R?.['panel']){await F['wait']('stable');const E=AbortSignal['timeout'](0x1388);let u;while(!E['aborted']){u=await F['mainFrame']['$']('.tabbed-pane>>>[aria-label=\x22'+R['panel']+'\x22\x20i]');if(u){await u['click']();break;}}}return F;}async['highlight'](R,w){if(R){const F={'x':Math['round'](R['x']),'y':Math['round'](R['y']),'width':Math['round'](R['width']),'height':Math['round'](R['height']),'color':w?.['color']??{'r':0x6f,'g':0xa8,'b':0xdc,'a':0.66},'outlineColor':w?.['outlineColor']};if(w?.['blink']){const E=0x5;for(let u=0x0;u<E;u++){await this['connection']['execute']('Overlay.highlightRect',F),await sleep(0xfa),await this['connection']['execute']('Overlay.hideHighlight'),await sleep(0x96);}}else await this['connection']['execute']('Overlay.highlightRect',F);}else await this['connection']['execute']('Overlay.hideHighlight');}async['bypassCSP'](R=!![]){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20bypass\x20csp\x20of\x20a\x20non-renderer\x20target');await this['connection']['execute']('Page.setBypassCSP',{'enabled':R});}async['getCookies'](){const {cookies:R}=await this['connection']['execute']('Network.getCookies');return R['reduce']((w,{name:F,value:E})=>w['set'](F,E),new Map());}async['setCookies'](R){await this['connection']['execute']('Network.setCookies',{'cookies':R});}async['inject'](R,{name:w,deep:F,isolated:E}={}){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20peform\x20an\x20injection\x20in\x20a\x20non-renderer\x20target');const u=makeInjection({'target':this,'expression':R,'name':w,'deep':F,'isolated':E});return await u['wait']('injected'),this.#injections['set'](u['name'],u),u;}async['changeMode'](R,w){if(this['kind']!=='renderer')throw new Error('Can\x27t\x20change\x20mode\x20of\x20a\x20non-renderer\x20target');await this['wait']('initialized');if(R==='element\x20selection'){const F=w?.['color']?{'contentColor':w['color'],'paddingColor':w['color'],'borderColor':w['color'],'shapeColor':w['color']}:{};await this['connection']['execute']('Overlay.setInspectMode',{'mode':'searchForNode','highlightConfig':F}),this['on']('frameTargetCreated',({target:E})=>{E['on']('elementSelected',({element:u})=>this['dispatch'](new TargetElementSelectedEvent(u)),{'key':'modeChanger'}),E['changeMode'](R,w);},{'key':'modeChanger'}),await Promise['all'](Array['from'](this['targets'](),E=>{return E['on']('elementSelected',({element:u})=>this['dispatch'](new TargetElementSelectedEvent(u)),{'key':'modeChanger'}),E['changeMode'](R,w);}));}else await this['connection']['execute']('Overlay.setInspectMode',{'mode':'none','highlightConfig':{}}),this['off']('modeChanger'),await Promise['all'](Array['from'](this['targets'](),E=>{return E['off']('modeChanger'),E['changeMode'](R);}));this.#mode=R;}async['hideFilepickers'](R=!![]){try{this.#filepickersHidden!==R&&(await this['connection']['execute']('Page.setInterceptFileChooserDialog',{'enabled':R}),this.#filepickersHidden=R);}catch(w){error('filepickerHideFailed',{'error':w});}}async['close'](){this['dispatch'](new TargetClosedEvent()),this['connection']['send']('Target.closeTarget',{'targetId':this['targetId']});}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){return'Target\x20'+F({'targetId':this['targetId'],'type':this['type'],'url':this['url'],'title':this['title']},w);}},TargetAttachedEvent=class extends Event{['sessionId'];constructor(R){super('attached'),this['sessionId']=R;}},TargetDetachedEvent=class extends Event{constructor(){super('detached');}},TargetActivatingEvent=class extends Event{constructor(){super('activating');}},TargetActivatedEvent=class extends Event{['reason'];constructor({reason:R}){super('activated'),this['reason']=R;}},TargetChangedEvent=class extends Event{['url'];['title'];constructor(R){super('changed'),this['url']=R['url'],this['title']=R['title'];}},TargetNavigatedEvent=class extends Event{['from'];['to'];['reason'];constructor({from:R,to:w,reason:F}){super('navigated'),this['from']=R,this['to']=w,this['reason']=F;}},TargetClosedEvent=class extends Event{constructor(){super('closed');}},TargetVisibilityChangeEvent=class extends Event{['visibility'];constructor(R){super('visibilityChanged'),this['visibility']=R;}},TargetMainFrameReadyEvent=class extends Event{['frame'];constructor(R){super('mainFrameReady'),this['frame']=R;}},TargetFrameAttachedEvent=class extends Event{['frame'];constructor(R){super('frameAttached'),this['frame']=R;}},TargetFrameTargetCreatedEvent=class extends Event{['target'];constructor(R){super('frameTargetCreated'),this['target']=R;}},TargetDialogEvent=class extends Event{['state'];['dialog'];['result'];['value'];constructor(R,w,F={}){super('dialog'+(R[0x0]['toUpperCase']()+R['substring'](0x1))),this['state']=R,this['dialog']=w,this['result']=F['result'],this['value']=F['value'];}},TargetFilepickerDialogEvent=class extends Event{['dialog'];constructor(R){super('filepickerDialogOpened'),this['dialog']=R;}},TargetChildTargetCreatingEvent=class extends Event{constructor(){super('childTargetCreating');}},TargetElementSelectedEvent=class extends Event{['element'];constructor(R){super('elementSelected'),this['element']=R;}};const browsers=new WeakMap();async function makeBrowser(R){if(R['driver']&&browsers['has'](R['driver']))return browsers['get'](R['driver']);if(R['socket']){const w=new Browser({'socket':R['socket'],'driver':R['driver']});if(R['driver'])browsers['set'](R['driver'],w);return w;}else{if(R['wsDebuggerUrl']){const F=new Agent()['compose'](u=>{return(M,N)=>{return M['headers']=M['headers']&&Object['fromEntries'](Object['entries'](M['headers'])['filter'](([e])=>e['toLowerCase']()!=='sec-websocket-extensions')),u(M,N);};}),E=new WebSocket(R['wsDebuggerUrl'],{'dispatcher':F});return await once(E,'open'),makeBrowser({'socket':E,'driver':R['driver']});}else{if(R['debuggerAddress']){const u='http://'+R['debuggerAddress']['replace']('localhost','127.0.0.1'),M=await fetch(u+'/json/version')['catch'](()=>null);if(M?.['status']!==0xc8)throw new Error('Failed\x20to\x20extract\x20websocket\x20debugger\x20url');return makeBrowser({'wsDebuggerUrl':(await M['json']())['webSocketDebuggerUrl']['replace']('localhost','127.0.0.1'),'driver':R['driver']});}else{if(R['driver']){const N=await R['driver']['getCapabilities'](),e=N['get']('se:cdp')?.['replace'](/172.\d+.0.2/,'localhost');if(e)return makeBrowser({'wsDebuggerUrl':e,'driver':R['driver']});return makeBrowser({'debuggerAddress':N['get']('goog:chromeOptions')?.['debuggerAddress']??N['get']('ms:edgeOptions')?.['debuggerAddress']??N['get']('moz:debuggerAddress')??'localhost:9245','driver':R['driver']});}else throw new Error('Cannot\x20create\x20browser\x20-\x20no\x20connection\x20options\x20provided');}}}}var Browser=class extends EventTargetNode{#targets=new Map();#pages=[];#extensions=[];#activePage;#headless;#product;#filepickersHidden=![];#closed=![];#history=makePagesHistory({'browser':this});#watchers={'initialized':makeWatcher(),'attachedTargets':makeWatcher(),'activePage':makeWatcher(),'history':makeWatcher()};async #initialize(){on(this['connection']['socket'],'close',({code:E,reason:u})=>{if(this.#closed)return;log('browserSocketClosed',{'code':E,'reason':u}),this['dispatch'](new BrowserDisconnectedEvent({'code':E,'reason':u}));});const {product:R,userAgent:w}=await this['connection']['execute']('Browser.getVersion');this.#product=R,this.#headless=w['includes']('HeadlessChrome');const F=this.#headless?await this['driver']?.['getWindowHandle']():void 0x0;this['connection']['on']('Target.targetCreated',async({targetInfo:E})=>{log('targetCreated',{'targetId':E['targetId'],'targetType':E['type'],'openerTargetId':E['openerId'],'openerFrameId':E['openerFrameId']});if(!(E['type']==='page'||E['type']==='iframe'&&this['frameManager']['has'](E['targetId'])||E['type']==='service_worker'&&E['url']['startsWith']('chrome-extension://')||E['url']['startsWith']('devtools://')))return;const u=makeTarget({'browser':this,'parent':E['openerId']?this.#targets['get'](E['openerId']):void 0x0,'targetId':E['targetId'],'type':E['type'],'url':E['url'],'title':E['title']});this.#targets['set'](u['targetId'],u),this.#watchers['attachedTargets']['reset'](),this['dispatch'](new BrowserTargetCreatedEvent(u));if(E['type']==='other'&&E['url']['startsWith']('devtools://'))await this['connection']['execute']('Target.attachToTarget',{'targetId':E['targetId'],'flatten':!![]});u['on']('attached',()=>{if(Array['from'](this.#targets['values']())['every'](M=>M['attached'])&&!this.#watchers['attachedTargets']['settled'])this.#watchers['attachedTargets']['resolve']();});if(u['type']==='page'&&!u['url']['startsWith']('devtools://'))this['dispatch'](new BrowserPageCreatedEvent(u)),this.#pages['push'](u),u['on']('attached',()=>{if(this.#activePage){log('activePageChanging',{'reason':this.#activePage===u['parent']?'childOfActive':'newPage'});if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'automatic'});if(this['headless'])u['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else this.#activePage=void 0x0;}else this.#headless&&u['targetId']===F&&(log('activePageChanging',{'reason':'webdriver'}),u['dispatch'](new TargetActivatedEvent({'reason':'programmatic'})));}),u['on']('activating',()=>{if(this['activePage']!==u&&this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'programmatic'});}),u['on']('activated',({reason:M})=>{this.#activePage=u,log('activePageChanged',{'targetId':u['targetId']}),this.#watchers['activePage']['resolve'](),this['dispatch'](new BrowserActivePageChangedEvent(u,{'reason':M}));}),u['on']('navigated',({from:M,to:N,reason:e})=>{log('pageNavigated',{'targetId':u['targetId']}),this['dispatch'](new BrowserPageNavigatedEvent(u,{'from':M,'to':N,'reason':e}));}),u['on']('closed',()=>{log('pageClosed',{'targetId':u['targetId']});const M=!u['download']&&(u['initialized']&&!this.#activePage||this.#activePage===u);this['dispatch'](new BrowserPageClosedEvent(u,{'wasActive':M})),this.#targets['delete'](u['targetId']),this.#pages['splice'](this.#pages['indexOf'](u),0x1);if(this.#activePage===u||!this['activePage']&&u['visible']===void 0x0){log('activePageClosed',{'targetId':u['targetId']}),this.#watchers['activePage']['reset']({'hint':'automatic'});if(this['headless']&&u['parent'])log('activePageChanging',{'reason':'parentOfClosed'}),u['parent']['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else{const N=this.#pages['findLast'](e=>e['visible']);N?(log('activePageChanging',{'reason':'otherVisible'}),N['dispatch'](new TargetActivatedEvent({'reason':'automatic'}))):(log('activePageVacated',{'reason':'noVisiblePage'}),this.#activePage=void 0x0);}}else{if(!this.#activePage)this.#watchers['activePage']['reset']({'hint':'automatic'});}}),u['on']('visibilityChanged',({visibility:M})=>{if(M==='visible'){if(!this.#activePage)log('activePageChanging',{'reason':'becameVisible'}),u['dispatch'](new TargetActivatedEvent({'reason':this.#watchers['activePage']['hint']}));else{if(this.#activePage!==u){if(u['popup'])log('activePageChanging',{'reason':'popupStole'}),u['dispatch'](new TargetActivatedEvent({'reason':'automatic'}));else{log('activePageContested',{});if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'manual'});}}}}else{if(this.#activePage===u&&M==='hidden'&&u['navigated']){log('activePageVacated',{'reason':'activePageHidden'});const N=this.#pages['findLast'](e=>e['visible']);if(N)log('activePageChanging',{'reason':'otherVisible'}),N['dispatch'](new TargetActivatedEvent({'reason':this.#watchers['activePage']['hint']}));else{if(this.#watchers['activePage']['settled'])this.#watchers['activePage']['reset']({'hint':'manual'});this.#activePage=void 0x0;}}}}),u['on']('childTargetCreating',()=>{this.#watchers['attachedTargets']['reset']();});else{if(u['type']==='iframe')this['frameManager']['get'](u['mainFrame']['parentFrameId'])?.['target']['dispatch'](new TargetFrameTargetCreatedEvent(u));else{if(u['type']==='service_worker')this.#extensions['push'](u);}}}),this['connection']['on']('Target.targetDestroyed',({targetId:E})=>{const u=this.#targets['get'](E);u&&(log('targetDestroyed',{'targetId':u['targetId'],'targetType':u['type']}),this.#targets['delete'](E),u['dispatch'](new TargetClosedEvent()));}),this['connection']['on']('Target.targetCrashed',({targetId:E,status:u,errorCode:M})=>{log('targetCrashed',{'targetId':E,'status':u,'errorCode':M});const N=this.#targets['get'](E)??null;this['dispatch'](new BrowserTargetCrashedEvent(N,{'targetId':E,'status':u,'errorCode':M}));}),this['connection']['on']('Target.targetInfoChanged',({targetInfo:E})=>{this.#targets['get'](E['targetId'])?.['dispatch'](new TargetChangedEvent(E));}),this['connection']['on']('Target.attachedToTarget',async({sessionId:E,targetInfo:u})=>{log('targetAttached',{'targetId':u['targetId'],'targetType':u['type'],'sessionId':E}),this.#targets['get'](u['targetId'])?.['dispatch'](new TargetAttachedEvent(E));}),this['connection']['on']('Target.detachedFromTarget',async({sessionId:E,targetId:u})=>{log('targetDetached',{'targetId':u,'sessionId':E}),this.#targets['get'](u)?.['dispatch'](new TargetDetachedEvent());}),await this['connection']['execute']('Target.setDiscoverTargets',{'discover':!![]}),await this['connection']['execute']('Target.setAutoAttach',{'autoAttach':!![],'flatten':!![],'filter':[{'type':'page'},{'type':'iframe'},{'type':'service_worker'}],'waitForDebuggerOnStart':!![]});}['type']='web';['targetManager']=this.#targets;['frameManager']=makeFrameManager();['windowManager']=makeWindowManager();['extensions']=this.#extensions;['driver'];['connection'];['frameStabilityTimeout']=0x9c40;get['headless'](){return this.#headless;}get['product'](){return this.#product;}get['blocked'](){return!!this.#activePage?.['dialog']&&this.#activePage['dialog']['type']!=='filepicker';}get['activePage'](){return this.#activePage;}get['filepickersHidden'](){return this.#filepickersHidden;}get['__previousPage'](){return this.#history['previousPage'];}get['__nextPage'](){return this.#history['nextPage'];}constructor({driver:R,socket:w}){super(),this['driver']=R,this['connection']=makeConnection({'socket':w}),this.#initialize()['then'](()=>this.#watchers['initialized']['resolve']())['catch'](F=>this.#watchers['initialized']['reject'](F));}*['targets'](){yield*this.#targets['values']();}*['pages'](){yield*this.#pages;}async['stabilize'](R,{signal:w,timeout:F}={}){await this['wait']('stable',{'signal':w});const E=this['activePage'];if(!E)return this['stabilize'](R,{'signal':w,'timeout':F});if(R==='basic')await this.#stabilizeBasic(E,{'signal':w});else{if(R==='strict')await this.#stabilizeStrict(E,{'signal':w});else{if(R==='paranoid')await until(this.#stabilizeParanoid(E,{'signal':w}),{'timeout':F??0xea60,'signal':w});}}if(this.#activePage!==E||!this.#watchers['activePage']['settled'])return this['stabilize'](R,{'signal':w,'timeout':F});}async #stabilizeBasic(R,{signal:w}){await R['wait']('initialized',{'signal':w}),!R['navigated']&&(this['dispatch'](new BrowserStabilizingNavigationEvent({'done':![]})),await R['wait']('navigated',{'signal':w}),this['dispatch'](new BrowserStabilizingNavigationEvent({'done':!![]}))),!R['stable']&&(this['dispatch'](new BrowserStabilizingLoadEvent({'done':![]})),await R['wait']('stable',{'signal':w}),this['dispatch'](new BrowserStabilizingLoadEvent({'done':!![]})));}async #stabilizeStrict(R,{signal:w}){await this.#stabilizeBasic(R,{'signal':w}),!R['pendingRequests']&&(this['dispatch'](new BrowserStabilizingOutgoingRequestsEvent({'done':![]})),await R['wait']('pendingRequests',{'signal':w}),this['dispatch'](new BrowserStabilizingOutgoingRequestsEvent({'done':!![]})));}async #stabilizeParanoid(R,{signal:w}){await this.#stabilizeStrict(R,{'signal':w});for(const F of R['frames']())try{if(await F['isVisible']())await F['wait']('loaded',{'signal':w});}catch(E){if(w?.['aborted']&&w['reason']===E)throw E;}}async['wait'](R,{signal:w}={}){if(R==='stable')await abortable(this.#watchers['initialized'],w),await abortable(this.#watchers['attachedTargets'],w),await abortable(this.#watchers['activePage'],w);else await abortable(this.#watchers[R],w);}async['page']({url:R,automationTimeout:w}){await this.#watchers['activePage'],this.#watchers['attachedTargets']['reset']();const {targetId:F}=await this['connection']['execute']('Target.createTarget',{'url':'about:blank'});await this.#watchers['attachedTargets'];const E=this.#targets['get'](F);if(w!=null)E['connection']['timeout']=w;return await Promise['all']([E['activate'](),R?E['wait']('stable')['then'](()=>E['navigate'](R)['then'](()=>E['wait']('stable'))):null]),E;}async['activatePreviousPage'](){return await this.#watchers['activePage'],this.#history['activatePreviousPage']();}async['activateNextPage'](){return await this.#watchers['activePage'],this.#history['activateNextPage']();}async['intercept'](R,w){const F=w??R,E=w?R:void 0x0,u=[];u['push'](this['on']('pageCreated',async({target:N})=>u['push'](await M(N)))),u['push'](...await Promise['all'](Array['from'](this['pages'](),M)));return()=>u['forEach'](N=>N());function M(N){return E!==void 0x0?N['intercept'](E,F):N['intercept'](F);}}async['filepicker'](R){const w=[];return this['on']('pageCreated',async({target:F})=>w['push'](await F['filepicker'](R))),w['push'](...await Promise['all'](Array['from'](this['pages'](),F=>F['filepicker'](R)))),()=>w['forEach'](F=>F());}async['getCookies'](){const {cookies:R}=await this['connection']['execute']('Storage.getCookies');return R;}async['setCookies'](R){await this['connection']['execute']('Storage.setCookies',{'cookies':R});}async['clearCookies'](){await this['connection']['execute']('Storage.clearCookies');}async['clearOriginStorage'](R){await this['connection']['execute']('Storage.clearDataForOrigin',{'origin':R,'storageTypes':'all'});}async['setWindowSize'](R){await this.#watchers['activePage'],await this['activePage']['wait']('windowResolved'),await this.#activePage['window']['setSize'](R);}async['setViewportSize'](R){await this.#watchers['activePage'],await this['activePage']['wait']('windowResolved');const w=this.#activePage['window'];if(this.#headless){await w['setSize'](R);const F=await this['activePage']['getViewportSize']();if(F['width']!==R['width']||F['height']!==R['height'])await w['setSize']({'width':R['width']+R['width']-F['width'],'height':R['height']+R['height']-F['height']});}else await w['setContentsSize'](R);}async['captureScreenshot'](R){return await this['wait']('stable'),this['activePage']['captureScreenshot'](R);}async['hideFilepickers'](R=!![]){await Promise['all'](Array['from'](this['targets'](),w=>w['hideFilepickers'](R))),this.#filepickersHidden=R;}async['close'](){log('browserClosing',{}),this.#closed=!![],this.#targets['forEach'](R=>R['dispatch'](new TargetClosedEvent()));if(this['driver'])await this['driver']?.['quit']();else await this['connection']['execute']('Browser.close');}},BrowserTargetCreatedEvent=class extends Event{['target'];constructor(R,w){super('targetCreated',w),this['target']=R;}},BrowserPageCreatedEvent=class extends Event{['target'];constructor(R,w){super('pageCreated',w),this['target']=R;}},BrowserPageNavigatedEvent=class extends Event{['target'];['from'];['to'];['reason'];constructor(R,{from:w,to:F,reason:E},u){super('pageNavigated',u),this['target']=R,this['from']=w,this['to']=F,this['reason']=E;}},BrowserPageClosedEvent=class extends Event{['target'];['wasActive'];constructor(R,{wasActive:wasActive=![]}={},w){super('pageClosed',w),this['target']=R,this['wasActive']=wasActive;}},BrowserActivePageChangedEvent=class extends Event{['target'];['reason'];constructor(R,{reason:w},F){super('activePageChanged',F),this['target']=R,this['reason']=w;}},BrowserDisconnectedEvent=class extends Event{['code'];['reason'];constructor({code:R,reason:w},F){super('disconnected',F),this['code']=R,this['reason']=w;}},BrowserTargetCrashedEvent=class extends Event{['target'];['targetId'];['status'];['errorCode'];constructor(R,{targetId:w,status:F,errorCode:E},u){super('targetCrashed',u),this['target']=R,this['targetId']=w,this['status']=F,this['errorCode']=E;}},BrowserWindowCreatedEvent=class extends Event{['window'];constructor(R){super('windowCreated'),this['window']=R;}},BrowserStabilizingNavigationEvent=class extends Event{['done'];constructor({done:R}){super('stabilizingNavigation'),this['done']=R;}},BrowserStabilizingLoadEvent=class extends Event{['done'];constructor({done:R}){super('stabilizingLoad'),this['done']=R;}},BrowserStabilizingOutgoingRequestsEvent=class extends Event{['done'];constructor({done:R}){super('stabilizingOutgoingRequests'),this['done']=R;}},HarRecorder=class extends EventTargetNode{#target;#includeBodies;#unsubscribes=[];#disposed=![];#events=[];#bodies=new Map();#seenRequestIds=new Set();#cachedRequestIds=new Set();#stats={'requestCount':0x0,'bytesIn':0x0,'bytesOut':0x0};constructor({target:R,includeBodies:includeBodies=![]}){super(),this.#target=R,this.#includeBodies=includeBodies,this.#subscribe(),this.#seedActivePage();}get['stats'](){return this.#stats;}get['target'](){return this.#target;}get['includeBodies'](){return this.#includeBodies;}['setIncludeBodies'](R){this.#includeBodies=R;}['toHar'](){const R=this.#events['map'](({method:F,params:E})=>({'method':F,'params':E}));let w;try{w=harFromMessages(R,{'includeTextFromResponseBody':![]});}catch{w=emptyHar();}for(const F of w['log']['entries']){const E=F['_requestId'];if(!E)continue;const u=this.#bodies['get'](E);if(!u||!F['response']?.['content'])continue;F['response']['content']['text']=u['body'];if(u['base64Encoded'])F['response']['content']['encoding']='base64';}return{'har':w,'eventCount':R['length'],'requestCount':this.#stats['requestCount']};}['dispose'](){if(this.#disposed)return;this.#disposed=!![];for(const R of this.#unsubscribes)try{R();}catch{}this.#unsubscribes=[];}#subscribe(){const R=this.#target['connection'];if(!R)return;for(const w of CDP_NETWORK_METHODS)this.#unsubscribes['push'](R['on'](w,F=>{this.#capture(w,F);if(w==='Network.requestWillBeSent')this.#onRequestWillBeSent(F);else{if(w==='Network.requestServedFromCache')this.#onRequestServedFromCache(F);else{if(w==='Network.dataReceived')this.#onDataReceived(F);else{if(w==='Network.loadingFinished')this.#onLoadingFinished(F);}}}}));for(const F of CDP_PAGE_METHODS)this.#unsubscribes['push'](R['on'](F,E=>this.#capture(F,E)));}#seedActivePage(){if(this.#disposed)return;this.#capture('Page.frameStartedLoading',{'frameId':this.#target['targetId']});}#capture(R,w){if(this.#disposed)return;this.#events['push']({'method':R,'params':w,'timestamp':Date['now']()});}#onRequestWillBeSent(R){if(!/^https?:/i['test'](R['request']?.['url']??''))return;this.#seenRequestIds['add'](R['requestId']),this.#stats['requestCount']+=0x1;const w=R['request']?.['postData']?.['length']??0x0;if(w>0x0)this.#stats['bytesOut']+=w;this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onRequestServedFromCache(R){if(!this.#seenRequestIds['has'](R['requestId']))return;if(this.#cachedRequestIds['has'](R['requestId']))return;this.#cachedRequestIds['add'](R['requestId']),this.#stats['requestCount']-=0x1,this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onDataReceived(R){if(!this.#seenRequestIds['has'](R['requestId']))return;if(this.#cachedRequestIds['has'](R['requestId']))return;if(typeof R['encodedDataLength']==='number')this.#stats['bytesIn']+=R['encodedDataLength'];this['dispatch'](new HarRecorderStatsChangedEvent(this.#stats));}#onLoadingFinished(R){if(!this.#includeBodies)return;if(!this.#seenRequestIds['has'](R['requestId']))return;if(this.#cachedRequestIds['has'](R['requestId']))return;this.#fetchBody(R['requestId']);}async #fetchBody(R){if(this.#disposed)return;const w=this.#target['connection'];if(!w)return;try{const F=await w['execute']('Network.getResponseBody',{'requestId':R});if(this.#disposed)return;this.#bodies['set'](R,{'body':F['body'],'base64Encoded':F['base64Encoded']});}catch{}}};const CDP_NETWORK_METHODS=['Network.requestWillBeSent','Network.requestWillBeSentExtraInfo','Network.responseReceived','Network.responseReceivedExtraInfo','Network.dataReceived','Network.loadingFinished','Network.loadingFailed','Network.requestServedFromCache'],CDP_PAGE_METHODS=['Page.frameStartedLoading','Page.frameRequestedNavigation','Page.navigatedWithinDocument','Page.frameAttached','Page.loadEventFired','Page.domContentEventFired'];function emptyHar(){return{'log':{'version':'1.2','creator':{'name':'automator','version':''},'pages':[],'entries':[]}};}var HarRecorderStatsChangedEvent=class extends Event{['stats'];constructor(R){super('statsChanged'),this['stats']=R;}};const ErrorCode={'NOT_IMPLEMENTED':'NOT_IMPLEMENTED','HANDLER_ABORTED':'HANDLER_ABORTED','UNKNOWN_ACTION':'UNKNOWN_ACTION','UNRESOLVED_REF':'UNRESOLVED_REF','FAILED_ASSERTION':'FAILED_ASSERTION','MALFORMED_COOKIE':'MALFORMED_COOKIE','MALFORMED_HEADER':'MALFORMED_HEADER','EVALUATION_FAILED':'EVALUATION_FAILED','SWITCH_TO_CURRENT_TAB':'SWITCH_TO_CURRENT_TAB','CLOSE_LAST_TAB':'CLOSE_LAST_TAB','NO_TAB_HISTORY':'NO_TAB_HISTORY','NO_TAB':'NO_TAB','NO_NEXT_TAB':'NO_NEXT_TAB','NO_HISTORY_ENTRY':'NO_HISTORY_ENTRY','UNEXPECTED_REQUEST_STATUS':'UNEXPECTED_REQUEST_STATUS','UNEXPECTED_NAVIGATION_STATUS':'UNEXPECTED_NAVIGATION_STATUS','ELEMENT_NOT_INTERACTIVE':'ELEMENT_NOT_INTERACTIVE','ELEMENT_NOT_TEXTBOX':'ELEMENT_NOT_TEXTBOX','ELEMENT_NOT_CLEARABLE':'ELEMENT_NOT_CLEARABLE','UNHANDLED_DIALOG':'UNHANDLED_DIALOG','NO_ELEMENT':'NO_ELEMENT','ILLEGAL_ELEMENT_DESCRIPTOR':'ILLEGAL_ELEMENT_DESCRIPTOR','NO_OPTION':'NO_OPTION','NO_DIALOG':'NO_DIALOG','CONDITION_TIMED_OUT':'CONDITION_TIMED_OUT','NAVIGATION_FAILED':'NAVIGATION_FAILED','NAVIGATION_TIMED_OUT':'NAVIGATION_TIMED_OUT','FETCH_FAILED':'FETCH_FAILED','FILE_ACCESS':'FILE_ACCESS','UNRESPONSIVE_TAB':'UNRESPONSIVE_TAB','INTERNAL':'INTERNAL','MESSAGE_PARSING':'MESSAGE_PARSING','INVALID_DATA':'INVALID_DATA','OBSCURED_ELEMENT':'OBSCURED_ELEMENT','FORBIDDEN_ACTION':'FORBIDDEN_ACTION','EXCEEDED_ALLOWED_TIMEOUT':'EXCEEDED_ALLOWED_TIMEOUT','LOOP_LIMIT_EXCEEDED':'LOOP_LIMIT_EXCEEDED','ASSIGNMENT_TO_BINDING':'ASSIGNMENT_TO_BINDING','NOT_PDF_VIEWER':'NOT_PDF_VIEWER','PDF_PAGE_OUT_OF_RANGE':'PDF_PAGE_OUT_OF_RANGE'};var RunnerError=class extends Error{['code'];['meta'];constructor(R,{code:code=ErrorCode['INTERNAL'],error:w,...F}={}){super(),this['name']=this['constructor']['name'],this['message']=R,this['code']=code,this['meta']=F,w instanceof Error&&(this['message']=R+':\x20'+w['message'],this['stack']=w['stack']);}};function translateAutomatorError(R,w={}){if(R instanceof NavigationFailedError)return{'code':ErrorCode['NAVIGATION_FAILED'],'meta':{'url':R['url'],'reason':R['reason']}};if(R instanceof NavigationTimedOutError)return{'code':ErrorCode['NAVIGATION_TIMED_OUT'],'meta':{'url':R['url'],'timeout':R['timeout']}};if(R instanceof NoHistoryEntryError)return{'code':ErrorCode['NO_HISTORY_ENTRY'],'meta':{'offset':R['offset']}};if(R instanceof CommandTimedOutError){const {method:F,commandId:E,sessionId:u}=R;return{'code':ErrorCode['UNRESPONSIVE_TAB'],'meta':{'method':F,'commandId':E,'sessionId':u,'retriable':w['retriable']}};}return{'code':ErrorCode['INTERNAL'],'meta':{'original':R}};}async function evaluateJSExpression(R,{context:w,stack:F,automator:E,signal:u}){if(!(E instanceof Browser))throw new Error('Can\x27t\x20evaluate\x20js\x20expression\x20with\x20a\x20non-web\x20automator');const M=await evaluateExpression(R,{'context':w,'stack':F,'automator':E,'signal':u});return await E['wait']('stable'),await E['activePage']['wait']('stable'),await E['activePage']['mainFrame']['defaultEvaluate'](M,{'await':!![]});}function isBase64String(R){return/^[A-Za-z0-9+/]*={0,2}$/['test'](R);}function isUrlString(R){return/(https?:\/\/(?:localhost|[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4})(?::\d{1,5})?\b[-a-zA-Z0-9@:%_\+.~#?&/=]*)/['test'](R);}function isXmlString(R){try{return XMLValidator['validate'](R,{'allowBooleanAttributes':!![]})===!![];}catch{return![];}}function parseXmlString(R){const w=XMLValidator['validate'](R,{'allowBooleanAttributes':!![]});if(w!==!![])throw new RunnerError('Failed\x20to\x20parse\x20malformed\x20XML,\x20with\x20an\x20error\x20\x22'+w['err']['msg']+'\x22');return new XMLParser()['parse'](R);}function stringifyXml(R){return new XMLBuilder()['build'](R);}function stringifyJson(R){return JSON['stringify'](R);}function isJsonString(R){try{return JSON['parse'](R),!![];}catch{return![];}}function parseJsonString(R){try{return JSON['parse'](R);}catch(w){throw new RunnerError('Failed\x20to\x20parse\x20malformed\x20JSON,\x20with\x20an\x20error\x20\x22'+w['message']+'\x22');}}function parseCsvString(R){try{return d(R,{'columns':!![],'skipEmptyLines':!![],'relaxColumnCount':!![],'bom':!![]});}catch(w){throw new RunnerError('Failed\x20to\x20parse\x20malformed\x20CSV,\x20with\x20an\x20error\x20\x22'+w['message']+'\x22');}}function stringifyCsv(R){const w=[...new Set(R['flatMap'](F=>Object['keys'](F)))];return[w['map'](csvCell)['join'](','),...R['map'](F=>w['map'](E=>csvCell(F[E]))['join'](','))]['join']('\x0a');}function csvCell(R){const w=R==null?'':String(R);return/[",\r\n]/['test'](w)?'\x22'+w['replaceAll']('\x22','\x22\x22')+'\x22':w;}function parseByFormat(R,{format:w,filename:F}={}){const E=w??formatOfExtension(F)??sniffFormat(R);if(E==='text'||E==='base64')return R;return withSourceText(E==='json'?parseJsonString(R):E==='xml'?parseXmlString(R):parseCsvString(R),R);}function formatOfExtension(R){const w=R?.['match'](/\.(\w+)$/)?.[0x1]['toLowerCase']();if(w==='json'||w==='xml'||w==='csv')return w;}function sniffFormat(R){if(isJsonString(R))return'json';else{if(isXmlString(R))return'xml';else return'text';}}function withSourceText(R,w){return Object['defineProperty'](R,Symbol['for']('stringify'),{'value':()=>w,'enumerable':![]});}function stringifyJSLiteral(R){if(typeof R==='bigint')return R+'n';else{if(R===Infinity)return'Infinity';else{if(R===-Infinity)return'-Infinity';else{if(Object['is'](R,-0x0))return'-0';else{if(Number['isNaN'](R))return'NaN';else return JSON['stringify'](R);}}}}}function isAlphaNumeric(R){return/^[\p{L}\p{N}]+$/u['test'](R);}function isNumeric(R){return/^\p{N}+$/u['test'](R);}function isCapitalized(R){return/^\p{Lu}/u['test'](R);}function isLowerCase(R){return!/\p{Lu}/u['test'](R);}function isUpperCase(R){return!/\p{Ll}/u['test'](R);}function isCamelCase(R){return/^\p{Ll}[\p{L}\p{N}]*$/u['test'](R);}function isPascalCase(R){return/^\p{Lu}[\p{L}\p{N}]*$/u['test'](R);}function isSnakeCase(R){return/^[\p{Ll}\p{N}_]+$/u['test'](R);}function isKebabCase(R){return/^[\p{Ll}\p{N}-]+$/u['test'](R);}function isReference(R){return!!(R?.['isRef']&&R['name']);}function isJSExpressionReference(R){return!!(R?.['isJSExpressionRef']&&R['expression']);}function isInterpolatedString(R){return!!(R?.['isInterpolatedString']&&R['chunks']);}function isJSExpression(R){return!!(R?.['isJSExpression']&&R['chunks']);}function isStructure(R){return!!(R?.['isStructure']&&R['type']);}function isPattern(R){return!!(R?.['isPattern']&&(R['pattern']||R['name']));}function isExtractor(R){return R?.['operator']==='extract'&&Array['isArray'](R['operands']);}function isOTP(R){return!!R?.['isOTP'];}function isRandomValue(R){return!!R?.['isRandomValue'];}function isFileHandle(R){return!!R?.['isFileHandle'];}function isFileSource(R){return!!R?.['isFileSource'];}function isCondition(R){return!!R?.['isCondition'];}function isOperation(R){return!!(R?.['operator']&&R['operands']);}function isExpressionOperation(R){return!!(R?.['operator']&&R['operands']);}function isMapOperation(R){return isOperation(R)&&R['operator']==='map';}const expressionOperators=new Set(['size','keys','values','entries','add','sub','mul','div','extract','map','every','some']);function isConditionOperation(R){return isOperation(R)&&!expressionOperators['has'](R['operator']);}function isElementDescriptor(R){if(R&&typeof R==='object')return Object['keys'](R)['every'](w=>['hints','type','title','color','anchor','nth','reference','selector','orderDirection','superlative','secret']['includes'](w));return![];}function isElementReference(R){return!!R&&typeof R==='object'&&'isElementReference'in R;}function isSelectorElementDescriptor(R){return!!(R&&typeof R==='object'&&typeof R['selector']==='object'&&R['selector']['type']&&R['selector']['selector']);}function isViewportDescriptor(R){return!!R?.['isViewportDescriptor'];}function isDialogDescriptor(R){return!!R?.['isDialogDescriptor'];}function isDialogElementDescriptor(R){return!!R?.['isDialogElementDescriptor'];}function isChromeTabDescriptor(R){return!!R?.['isChromeElementDescriptor']&&R?.['type']==='tab';}function toChromeTabDescriptor(R){if(!Object['keys'](R)['every'](w=>['type','title','nth','hints']['includes'](w)))return null;if(!(Array['isArray'](R['type'])?R['type']:[R['type']])['includes']('tab')){if(R['type']!=null)return null;if(R['hints']==null||Object['keys'](R['hints'])['length']!==0x1||R['hints']['type']!=='tab')return null;}else{if(R['hints']!=null)return null;}if(R['title']==null&&R['nth']==null)return null;if(R['title']!=null&&typeof R['title']!=='string')return null;return{'isChromeElementDescriptor':!![],'type':'tab',...R['nth']!=null?{'index':R['nth']}:{},...R['title']!=null?{'title':R['title']}:{}};}const DIALOG_ACCEPT_TITLES=new Set(['ok','accept','agree','allow','confirm','submit','yes']),DIALOG_DISMISS_TITLES=new Set(['cancel','decline','reject','dismiss','discard','close','no']);function toDialogButtonTitle(R){if(typeof R!=='string')return null;if(DIALOG_ACCEPT_TITLES['has'](R['toLowerCase']()))return'ok';if(DIALOG_DISMISS_TITLES['has'](R['toLowerCase']()))return'cancel';return null;}function toDialogElementDescriptor(R){if(R['type']&&R['type']!=='button')return null;if(!Object['keys'](R)['every'](F=>['type','title']['includes'](F)))return null;const w=toDialogButtonTitle(R['title']);return w?{'isDialogElementDescriptor':!![],'title':w}:null;}function isChromeElementDescriptor(R){return!!R?.['isChromeElementDescriptor'];}function toChromeElementDescriptor(R){if(!R['title']||typeof R['title']!=='string')return null;if(!Object['keys'](R)['every'](w=>['type','title']['includes'](w)))return null;if(/^(?:(?:reload|refresh)(?:\s+(?:(?:(?:(?:this|the)\s+)?page)|this))?)$/i['test'](R['title'])){if(R['type']&&R['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'refresh'};}else{if(/^(?:(?:(?:click\s+to\s+)?(?:go\s+)?(?:back|(?:to\s+)?(?:the\s+)?prev(?:ious)?(?:\s+page)?))|<-|<)$/i['test'](R['title'])){if(R['type']&&R['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'back'};}else{if(/^(?:(?:(?:click\s+to\s+)?(?:go\s+)?(?:fwd|forward|(?:to\s+)?(?:the\s+)?next(?:\s+page)?))|->|>)$/i['test'](R['title'])){if(R['type']&&R['type']!=='button')return null;return{'isChromeElementDescriptor':!![],'type':'button','title':'forward'};}}}return null;}function stringify(R){if(R&&R[Symbol['for']('stringify')])return stringify(R[Symbol['for']('stringify')]());else{if(Array['isArray'](R))return R['map'](stringify)['join']('\x20');else{if(typeof R==='object')return stringifyJson(R);else return String(R);}}}function sizeOf(R){const w=0x5*0x400*0x400;if(typeof R==='string'){if(R['length']>w)throw new RunnerError('String\x20length\x20exceeds\x20the\x20safety\x20limit\x20of\x20'+w+'\x20characters',{'code':ErrorCode['INVALID_DATA']});const F=new Intl['Segmenter']('en',{'granularity':'grapheme'});let E=0x0;for(const u of F['segment'](R))E++;return E;}else{if(Array['isArray'](R))return R['length'];else{if(R instanceof Set||R instanceof Map)return R['size'];else{if(R&&typeof R==='object')return Object['keys'](R)['length'];else throw new RunnerError('Cannot\x20get\x20size\x20of\x20the\x20'+typeof R+'\x20value');}}}}function keysOf(R){if(R instanceof Map)return Array['from'](R['keys']());else{if(R&&typeof R==='object'&&!Array['isArray'](R))return Object['keys'](R);else throw new RunnerError('Cannot\x20get\x20keys\x20of\x20the\x20'+(Array['isArray'](R)?'array':typeof R)+'\x20value');}}function valuesOf(R){if(Array['isArray'](R)||R instanceof Set||R instanceof Map)return Array['from'](R['values']());else{if(R&&typeof R==='object')return Object['values'](R);else throw new RunnerError('Cannot\x20get\x20values\x20of\x20the\x20'+typeof R+'\x20value');}}function entriesOf$1(R){if(typeof R==='string')return R;else{if(Array['isArray'](R)||R instanceof Set)return Array['from'](R['values']());else{if(R instanceof Map)return Array['from'](R['keys']());else{if(R&&typeof R==='object')return Object['keys'](R);else throw new RunnerError('Cannot\x20get\x20entries\x20of\x20the\x20'+typeof R+'\x20value');}}}}const patternNames={'amount':'number','price':'price','percentage':'percentage'};function typeOf(R){if(isElementDescriptor(R)||isDialogDescriptor(R))return'string';else{if(isExtractor(R))return R['operands'][0x1]['includes']('color')||R['operands'][0x1]in patternNames?'string':R['operands'][0x1];else{if(isReference(R))return R['type']??'any';else{if(isInterpolatedString(R))return'string';else{if(isStructure(R))return'any';else{if(isOperation(R)){if(['add','sub','mul','div','size']['includes'](R['operator']))return'number';else return'any';}else{if(R===null)return'null';else return typeof R;}}}}}}}function arrayOf(...R){return R['flatMap'](w=>{if(Array['isArray'](w))return w;if(w!==void 0x0)return[w];return[];});}function toLowerCase(R){if(typeof R==='string')return R['toLowerCase']();else{if(Array['isArray'](R))return R['map'](w=>toLowerCase(w));else return R;}}async function extractValue(R,{context:w,stack:F,automator:E,timeout:u,signal:M}){const N=F['extractor'](R),e=R['operands'][0x1];let l=await evaluateExpression(R['operands'][0x0]['value'],{'context':w,'stack':F,'automator':E,'timeout':u,'signal':M});const Y=patternNames[e];if(Y)l={'title':{'isPattern':!![],'name':Y},'anchor':{'position':'near','element':l}};const I=await w['axOps']['findNode']({...l,'hints':{...l['hints'],'type':arrayOf(l['hints']?.['type'],e==='string'?['text','valuebox']:['valuebox','text'])}},{'stack':F,'timeout':u??0x0,'signal':M??new AbortController()['signal']});if(!I)return null;w['activeAXNode']=I;const f=N(await I['node']['getValue']({'hint':e})??null);if(e['includes']('color'))return objectToColor(f);return f;}async function evaluateOperand(R,{context:w,stack:F,automator:E,hint:u,signal:M}){const {done:N,value:e}=await evaluateOperandSequence(R,{'context':w,'stack':F,'automator':E,'hint':u,'signal':M})['next']();if(N)throw new RunnerError('Operand\x20not\x20evaluatable');return e;}async function*evaluateOperandSequence(R,{context:w,stack:F,automator:E,hint:u,signal:M}){const N=F['operand'](R);if(isElementReference(R['value'])){const e=await extractValue({'operator':'extract','operands':[{'isOperand':!![],'value':R['value']},u??'string']},{'context':w,'stack':F,'automator':E,'signal':M});if(e===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});yield N(e);}else{if(isElementDescriptor(R['value'])){const l=R['value'],Y=await extractValue({'operator':'extract','operands':[{'isOperand':!![],'value':{...l,'hints':{...l['hints'],'type':arrayOf('valuebox',l['hints']?.['type'])}}},u??'string']},{'context':w,'stack':F,'automator':E,'signal':M});if(Y===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});yield N(Y);}else{if(isDialogDescriptor(R['value'])){const I=E instanceof Browser?(E?.['activePage']['dialog']&&E['activePage']['dialog']['type']!=='filepicker'&&E['activePage']['dialog']['message'])??null:null;if(I===null)throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});yield N(I);}else{const f=await evaluateExpression(R['value'],{'context':w,'stack':F,'automator':E,'signal':M});yield N(u==='string'&&typeof f?.[Symbol['for']('stringify')]==='function'?stringify(f):f,{'secret':F['isSecret'](R['value'])??![]});}}}}async function resolveFilename(R,w){const F=w['actions']['resolveFilename'];if(!F)return R;try{return await F(R)??R;}catch(E){if(E instanceof RunnerError)throw E;return R;}}function requireFileAction(R,w){const F=w['actions'][R];if(!F)throw new RunnerError('File\x20access\x20is\x20not\x20available\x20in\x20this\x20environment\x20(no\x20\x22'+R+'\x22\x20was\x20provided\x20to\x20the\x20runner)',{'code':ErrorCode['FILE_ACCESS']});return F;}async function throughFileAction(R,{filename:w,failure:F}){try{return await R();}catch(E){if(E instanceof RunnerError)throw E;throw new RunnerError('The\x20file\x20\x22'+w+'\x22\x20could\x20not\x20be\x20'+F+':\x20'+(E?.['message']??E),{'code':ErrorCode['FILE_ACCESS'],'filename':w,'error':E});}}const operations={'validate':validate,'eq':eq,'lt':lt,'gt':gt,'lte':lte,'gte':gte,'match':match,'includes\x20only':includesOnly,'includes':includes,'starts\x20with':startsWith,'ends\x20with':endsWith,'visible':visible,'clickable':clickable,'enabled':enabled,'hovered':hovered,'checked':checked,'populated':populated,'file\x20exists':fileExists},transformers={'ignore\x20case':toLowerCase,'match\x20case':R=>R};function isSizeOperand(R){return isExpressionOperation(R['value'])&&R['value']['operator']==='size';}function validateLengthBoundary(R){const w=typeof R==='number'?R:Number(R);if(w<0x0)throw new RunnerError('Invalid\x20boundary:\x20length\x20comparison\x20values\x20must\x20be\x20non-negative',{'code':ErrorCode['INVALID_DATA']});if(!Number['isFinite'](w))throw new RunnerError('Invalid\x20boundary:\x20non-finite\x20values\x20are\x20not\x20allowed\x20for\x20length\x20comparisons',{'code':ErrorCode['INVALID_DATA']});}async function evaluateCondition(R,{context:w,stack:F,automator:E,signal:u}){const M=new Map();return l(R['operation']);async function*N(Y,{hint:I}={}){const f=stringify(Y);let t=M['get'](f);if(!t)t={'values':[],'iterator':evaluateOperandSequence(Y,{'context':w,'stack':F,'automator':E,'hint':I,'signal':u})},M['set'](f,t);else yield*t['values'];for await(const W of t['iterator']){t['values']['push'](W),yield W;}}async function*e(...[Y,...I]){if(!Y)yield[];else{const f=[];for await(const t of Y){for(const W of f)yield[t,...W];for await(const i of e(...I)){f['push'](i),yield[t,...i];}}}}async function l(Y,I={}){const f=F['operation'](Y),{operator:t,operands:W}=Y;switch(t){case'parens':return f(await l(W[0x0],I));case'ignore\x20case':case'match\x20case':return f(await l(W[0x0],{...I,'mode':t}));case'not':return f(!await l(W[0x0],I));case'and':return f(await l(W[0x0],I)&&await l(W[0x1],I));case'or':return f(await l(W[0x0],I)||await l(W[0x1],I));case'validate':case'match':for await(const i of N(W[0x0])){if(I['mode']&&isPattern(W[0x1])){W[0x1]['flags']??='';if(I['mode']==='ignore\x20case'&&!W[0x1]['flags']['includes']('i'))W[0x1]['flags']+='i';else{if(I['mode']==='match\x20case')W[0x1]['flags']=W[0x1]['flags']['replace']('i','');}}const K=operations[t](stringify(i),await evaluateExpression(W[0x1],{'context':w,'stack':F,'automator':E,'signal':u}));if(K)return f(K);}return f(![]);case'eq':case'lt':case'gt':case'lte':case'gte':case'includes':case'starts\x20with':case'ends\x20with':{const s=typeOf(W[0x1]['value']),Q=typeOf(W[0x0]['value']),k=transformers[I['mode']??'match\x20case'],S=['eq','lt','gt','lte','gte']['includes'](t),a=S?await w['scope']['global']['page']?.['value'][Symbol['for']('get')]('language')['catch'](()=>void 0x0):void 0x0;for await(const [T,H]of e(N(W[0x0],{'hint':s}),N(W[0x1],{'hint':Q}))){const A=F['nodeFor'](W[0x0],T),D=F['nodeFor'](W[0x1],H);if(A&&D&&await A['node']['equal'](D['node']))continue;S&&(isSizeOperand(W[0x0])||isSizeOperand(W[0x1]))&&(validateLengthBoundary(T),validateLengthBoundary(H));const Z=operations[t](k(T),k(H),a);if(Z)return f(Z);}return f(![]);}case'includes\x20only':{const O=typeOf(W[0x0]),p=transformers[I['mode']??'match\x20case'];for await(const [J,C]of e(N(W[0x0]),e(...W['slice'](0x1)['map'](P=>N(P,{'hint':O}))))){const P=operations[t](p(J),p(C));if(P)return f(P);}return f(![]);}case'visible':return f(await operations['visible'](W[0x0]['value'],{'context':w,'stack':F,'automator':E,'signal':u}));case'clickable':case'enabled':case'hovered':return f(await operations[t](W[0x0]['value'],{'context':w,'stack':F,'automator':E,'signal':u}));case'checked':return f(await operations['checked'](W[0x0]['value'],W[0x1],{'context':w,'stack':F,'automator':E,'signal':u}));case'populated':return f(await operations['populated'](W[0x0]['value'],{'context':w,'stack':F,'automator':E,'signal':u}));case'file\x20exists':return f(await operations['file\x20exists'](W[0x0]['value'],{'context':w,'stack':F,'automator':E,'signal':u}));case'every':case'some':return f(await evaluateExpression(Y,{'context':w,'stack':F,'automator':E,'signal':u}));default:throw new RunnerError('Unknown\x20condition\x20operator\x20\x22'+Y['operator']+'\x22',{'code':ErrorCode['INTERNAL']});}}}function validate(R,w){if(w==='alphanumeric')return isAlphaNumeric(R);else{if(w==='numeric')return isNumeric(R);else{if(w==='capitalized')return isCapitalized(R);else{if(w==='lowercase')return isLowerCase(R);else{if(w==='uppercase')return isUpperCase(R);else{if(w==='camelcase')return isCamelCase(R);else{if(w==='pascalcase')return isPascalCase(R);else{if(w==='snakecase')return isSnakeCase(R);else{if(w==='kebabcase')return isKebabCase(R);else return![];}}}}}}}}}function compare(R,w,F){if(R instanceof Color||w instanceof Color){const N=R instanceof Color?R:stringToColor(R),e=w instanceof Color?w:stringToColor(w);if(!N||!e)return 0x1;return N['similarTo'](e)?0x0:0x1;}const E=stringify(R),u=stringify(w),M=compareNumerically(E,u,F);if(M!=null)return M;return E===u?0x0:E>u?0x1:-0x1;}function compareNumerically(R,w,F){const E=extractNumber(R,{'preferredLocale':F}),u=extractNumber(w,{'preferredLocale':F});if(!E||!u)return null;if(R['slice'](0x0,E['pos'])===w['slice'](0x0,u['pos'])&&R['slice'](E['pos']+E['text']['length'])===w['slice'](u['pos']+u['text']['length']))return E['value']-u['value'];const M=E['text']===R['trim']();if(M===(u['text']===w['trim']()))return null;const N=M?priceOrPercentageValue(w,u):priceOrPercentageValue(R,E);if(N==null)return null;return M?E['value']-N:N-u['value'];}function priceOrPercentageValue(R,w){const F=R['trim']();if(extractPattern('price',F)!==F&&extractPattern('percentage',F)!==F)return null;return F['startsWith']('-')&&!w['text']['startsWith']('-')?-w['value']:w['value'];}function eq(R,w,F){return stringify(R)===stringify(w)||compare(R,w,F)===0x0;}function lt(R,w,F){return compare(R,w,F)<0x0;}function lte(R,w,F){return compare(R,w,F)<=0x0;}function gt(R,w,F){return compare(R,w,F)>0x0;}function gte(R,w,F){return compare(R,w,F)>=0x0;}function match(R,w){return w['test'](stringify(R));}function startsWith(R,w,F){if(typeof R==='string')return R['startsWith'](stringify(w));else{if(Array['isArray'](R))return R['at'](0x0)===w;else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof R+'\x20value');}}function endsWith(R,w,F){if(typeof R==='string')return R['endsWith'](stringify(w));else{if(Array['isArray'](R))return R['at'](-0x1)===w;else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof R+'\x20value');}}function includes(R,w,F){if(typeof R==='string')return R['includes'](stringify(w));else{if(Array['isArray'](R))return R['includes'](w);else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof R+'\x20value');}}function includesOnly(R,w){if(typeof R==='string')return!R['replace'](new RegExp(w['map'](F=>stringify(F))['join']('|'),'g'),'')['trim']();else{if(Array['isArray'](R))return R['every'](F=>w['includes'](F));else throw new RunnerError('Cannot\x20verify\x20that\x20the\x20item\x20is\x20contained\x20within\x20'+typeof R+'\x20value');}}async function visible(R,{context:w,stack:F,automator:E,signal:u}){if(isElementDescriptor(R)||isElementReference(R)){const M=await evaluateExpression(R,{'context':w,'stack':F,'automator':E,'signal':u}),N=await w['axOps']['findNode'](M,{'stack':F,'signal':u});if(!N)return![];w['activeAXNode']=N;const {ratio:e=0x1}=await N['node']['getObscurationInfo']();return e<=0.5;}else return E instanceof Browser&&!!E['activePage']?.['dialog'];}async function populated(R,{context:w,stack:F,automator:E,signal:u}){const M=await evaluateExpression({...R,'type':[R['type']??[],'inputbox']['flat']()},{'context':w,'stack':F,'automator':E,'signal':u}),N=await w['axOps']['findNode'](M,{'stack':F,'signal':u});if(!N)return![];return w['activeAXNode']=N,!!await N['node']['getValue']({'hint':'boolean','acceptFormValue':!![]});}async function fileExists(R,{context:w,stack:F,automator:E,signal:u}){const M=await resolveFilename(await evaluateExpression(R['filename'],{'context':w,'stack':F,'automator':E,'signal':u}),w);return requireFileAction('fileExists',w)(M);}async function clickable(R,{context:w,stack:F,automator:E,signal:u}){const M=await evaluateExpression(R,{'context':w,'stack':F,'automator':E,'signal':u}),N=await w['axOps']['findNode'](M,{'stack':F,'signal':u});if(!N)return![];return w['activeAXNode']=N,await N['node']['isEnabled']()??![];}async function enabled(R,{context:w,stack:F,automator:E,signal:u}){const M=await evaluateExpression(R,{'context':w,'stack':F,'automator':E,'signal':u}),N=await w['axOps']['findNode'](M,{'stack':F,'signal':u});if(!N)return![];return w['activeAXNode']=N,!N['state']['disabled']&&!N['state']['inert'];}async function hovered(R,{context:w,stack:F,automator:E,signal:u}){const M=await evaluateExpression(R,{'context':w,'stack':F,'automator':E,'signal':u}),N=await w['axOps']['findNode'](M,{'stack':F,'signal':u});if(!N)return![];return w['activeAXNode']=N,await N['node']['isHovered']()??![];}async function checked(R,w,{context:F,stack:E,automator:u,signal:M}){const N=await evaluateExpression({'type':'checkbox',...R},{'context':F,'stack':E,'automator':u,'signal':M}),e=await F['axOps']['findNode'](N,{'stack':E,'signal':M});if(!e)return![];return F['activeAXNode']=e,await e['node']['getValue']({'hint':'boolean'})===w;}async function*makeIterator(R,{context:w,stack:F,automator:E,signal:u}){if(!isMapOperation(R)){for(const Y of entriesOf(R))yield{...Y,'result':Y['item']};return;}const [M,N]=R['operands'],e=await evaluateOperand(M,{'context':w,'stack':F,'automator':E,'signal':u}),l=['it',...(R['bindings']??[])['map'](I=>I['toLowerCase']())];for(const {index:I,key:f,item:t}of entriesOf(e)){const W=w['scope']['bind']({...Object['fromEntries'](l['map'](i=>[i,{'value':t}])),'index':{'value':I},'key':{'value':f}});try{yield{'index':I,'key':f,'item':t,'result':isConditionOperation(N)?await evaluateCondition({'isCondition':!![],'operation':N},{'context':w,'stack':F,'automator':E,'signal':u}):await evaluateExpression(N,{'context':w,'stack':F,'automator':E,'signal':u})};}finally{W();}}}function entriesOf(R){if(typeof R==='string')return[...R]['map']((w,F)=>({'index':F,'key':F,'item':w}));if(Array['isArray'](R))return R['map']((w,F)=>({'index':F,'key':F,'item':w}));if(R&&typeof R==='object')return Object['entries'](R)['map'](([w,F],E)=>({'index':E,'key':w,'item':F}));throw new RunnerError('Cannot\x20iterate\x20over\x20the\x20value\x20'+stringify(R)+'\x20as\x20it\x20is\x20not\x20iterable',{'code':ErrorCode['INVALID_DATA']});}async function evaluateExpression(R,{context:w,stack:F,automator:E,timeout:u,signal:M}){return N(R);async function N(e){if(isReference(e)){const l=e,Y=l['scope']??'public';if(!(l['name']['toLowerCase']()in w['scope'][Y]))throw new RunnerError('Unable\x20to\x20resolve\x20parameter\x20or\x20variable\x20with\x20the\x20name\x20\x22'+l['name']+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':l});const I=F['reference'](l),f=w['scope'][Y][l['name']['toLowerCase']()],t=await(l['modifiers']??[])['reduce'](async(W,i)=>{let K=await W;if('get'in i){const s=await N(i['get']);if(typeof K==='string'){if(isJsonString(K))K=parseJsonString(K);else{if(isXmlString(K))K=parseXmlString(K);}}if(Array['isArray'](K)){if(typeof s==='number'){const Q=K['at'](s);if(Q===void 0x0)throw new RunnerError('No\x20list\x20value\x20was\x20found\x20at\x20index\x20'+s,{'code':ErrorCode['UNRESOLVED_REF'],'ref':l});return Q;}}else{if(K&&typeof K==='object'){const k=await K[Symbol['for']('get')]?.(s)??K[s];if(k===void 0x0)throw new RunnerError('No\x20value\x20is\x20mapped\x20to\x20the\x20key\x20\x22'+s+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':l});return k;}}throw new RunnerError('Can’t\x20convert\x20the\x20value\x20'+stringifyJson(K)+'\x20to\x20a\x20dictionary\x20as\x20it\x20is\x20not\x20a\x20valid\x20json\x20object\x20or\x20an\x20XML\x20fragment',{'code':ErrorCode['UNRESOLVED_REF'],'ref':l});}else{if('match'in i){const S=stringify(K),a=await N(i['match']);let T=null;if(typeof a==='function'){const H=a(S);H&&(T=[H],T['index']=S['indexOf'](H),T['input']=S);}else T=S['match'](a);if(!T)throw new RunnerError('The\x20regex\x20'+(typeof a==='function'?'custom\x20matcher':'/'+a['source']+'/')+'\x20does\x20not\x20match\x20the\x20value\x20\x22'+S+'\x22',{'code':ErrorCode['UNRESOLVED_REF'],'ref':l});return T['groups']?{...T['groups']}:T['length']===0x1?T[0x0]:T['slice'](0x1);}else return K;}},Promise['resolve'](f['value']));return I(l['type']==='string'?stringify(t):t,{'secret':f['secret']});}else{if(isJSExpressionReference(e))return await evaluateJSExpression(e['expression'],{'context':w,'stack':F,'automator':E,'signal':M});else{if(isInterpolatedString(e))return(await Promise['all'](e['chunks']['map'](async W=>isReference(W)||isJSExpressionReference(W)?N(W):W)))['join']('');else{if(isJSExpression(e))return(await Promise['all'](e['chunks']['map'](async W=>isReference(W)||isJSExpressionReference(W)?stringifyJSLiteral(await N(W)):W)))['join']('');else{if(isPattern(e))return'name'in e?getPatternMatcher(e['name']):new RegExp(e['pattern'],e['flags']);else{if(isStructure(e)){if(e['type']==='array')return Promise['all'](e['items']['map'](async W=>N(W)));else return Object['fromEntries'](await Promise['all'](e['items']['map'](async({key:W,value:i})=>[await N(W),await N(i)])));}else{if(isChromeTabDescriptor(e))return{...e,...'index'in e&&e['index']!=null?{'index':await N(e['index'])}:{},...'title'in e&&e['title']!=null?{'title':await N(e['title'])}:{}};else{if(isElementReference(e)){const W=w['activeAXNode'];if(!W)throw new RunnerError('`it`\x20does\x20not\x20refer\x20to\x20any\x20element\x20yet',{'code':ErrorCode['UNRESOLVED_REF']});return F['descriptor'](e)({'node':W});}else{if(isElementDescriptor(e)){if(!Array['isArray'](e['anchor'])&&isDialogDescriptor(e['anchor']?.['element'])){if(isPattern(e['title']))throw new RunnerError('An\x20element\x20with\x20a\x20pattern\x20title\x20cannot\x20target\x20the\x20native\x20browser\x20dialog',{'code':ErrorCode['ILLEGAL_ELEMENT_DESCRIPTOR']});return{'isDialogElementDescriptor':!![],'title':toDialogButtonTitle(await N(e['title']))??'ok'};}async function i(k){if(isDialogDescriptor(k))throw new RunnerError('The\x20native\x20browser\x20dialog\x20can\x20only\x20be\x20used\x20as\x20the\x20single\x20direct\x20anchor\x20of\x20the\x20target\x20element',{'code':ErrorCode['ILLEGAL_ELEMENT_DESCRIPTOR']});return N(k);}const {reference:K,...s}=e;let Q={};if(K){const k=await N(K),S=parseIndex(k);Q=S!==null?{'nth':S}:{'title':stringify(k)};}else{if('nth'in e){const a=await N(e['nth']);Q={'nth':typeof a==='number'?a:parseIndex(a)??Number(a)};}}return F['descriptor'](e)({...s,...Q,...'title'in e&&!isPattern(e['title'])?{'title':await N(e['title'])}:{},...'color'in e?{'color':await N(e['color'])}:{},...'selector'in e&&e['selector']?.['selector']?{'selector':{...e['selector'],'selector':await N(e['selector']['selector'])}}:{},...'anchor'in e&&e['anchor']?{'anchor':Array['isArray'](e['anchor'])?await Promise['all'](e['anchor']['map'](async T=>({...T,'element':T['element']&&await i(T['element'])}))):{...e['anchor'],'element':e['anchor']['element']&&await i(e['anchor']['element'])}}:{},...'fallback'in e?{'fallback':await N(e['fallback'])}:{}});}else{if(isExtractor(e)){const T=await extractValue(e,{'context':w,'stack':F,'automator':E,'timeout':u,'signal':M});if(T===null)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});return T;}else{if(isExpressionOperation(e)){const H=F['operation'](e);if(e['operator']==='every'||e['operator']==='some'){const D=e['operands'][0x0]['value'],Z=e['operator']==='some'?Number(await N(e['min']??0x1)):null;if(Z!==null&&(!Number['isInteger'](Z)||Z<0x1))throw new RunnerError('The\x20minimum\x20number\x20of\x20matching\x20items\x20must\x20be\x20a\x20positive\x20integer,\x20but\x20got\x20'+Z,{'code':ErrorCode['INVALID_DATA']});let O=0x0,p=![];for await(const J of makeIterator(D,{'context':w,'stack':F,'automator':E,'signal':M})){if(J['result'])++O;else p=!![];if(Z===null?p:O>=Z)break;}return H(Z===null?!p:O>=Z);}else{if(e['operator']==='map')return H(await Array['fromAsync'](makeIterator(e,{'context':w,'stack':F,'automator':E,'signal':M}),C=>C['result']));}const A=await e['operands']['reduce'](async(C,P)=>{const h=await C;return h['push'](await evaluateOperand(P,{'context':w,'stack':F,'automator':E,'signal':M})),h;},Promise['resolve']([]));if(e['operator']==='size')return H(sizeOf(A[0x0]));else{if(e['operator']==='keys')return H(keysOf(A[0x0]));else{if(e['operator']==='values')return H(valuesOf(A[0x0]));else{if(e['operator']==='entries')return H(entriesOf$1(A[0x0]));else{if(isNumberOperation(e)){const [C,P]=A['map'](h=>{const q=typeof h==='string'&&h['trim']()!==''?Number(h):h;if(typeof q!=='number'||Number['isNaN'](q))throw new RunnerError('Cannot\x20evaluate\x20\x22'+e['operator']+'\x22\x20operation\x20on\x20a\x20non-numeric\x20value\x20'+JSON['stringify'](h),{'code':ErrorCode['INVALID_DATA']});return q;});if(e['operator']==='add')return H(C+P);else{if(e['operator']==='sub')return H(C-P);else{if(e['operator']==='div')return H(C/P);else return H(C*P);}}}else throw new RunnerError('Unknown\x20operator');}}}}}else{if(isCondition(e))return evaluateCondition(e,{'context':w,'stack':F,'automator':E,'signal':M});else{if(isOTP(e)){if(!w['actions']['generateOTP'])throw new RunnerError('generateOTP\x20callback\x20not\x20provided',{'code':ErrorCode['INTERNAL']});const h=F['generator'](e),q=await N(e['user']);return h(await w['actions']['generateOTP'](q));}else{if(isFileSource(e)){const z=F['generator'](e),o=await resolveFilename(await N(e['file']['filename']),w),n=requireFileAction('readFile',w),c=e['format']==='base64'?'base64':'utf8';return z(parseByFormat(await throughFileAction(()=>n(o,{'encoding':c}),{'filename':o,'failure':'read'}),{'format':e['format'],'filename':o}),{'secret':e['secret']});}else{if(isFileHandle(e))return await resolveFilename(await N(e['filename']),w);else{if(isRandomValue(e)){const U=F['generator'](e);if(e['type']==='number')return U(Math['random']());else{if(!w['actions']['generateRandomValue'])throw new RunnerError('generateRandomValue\x20callback\x20not\x20provided',{'code':ErrorCode['INTERNAL']});return U(await w['actions']['generateRandomValue']({...e,'description':e['description']?await N(e['description']):void 0x0}));}}else return e;}}}}}}}}}}}}}}}}}var InstructionExecutionStartedEvent=class extends ProgressEvent{['status'];['done']=![];constructor({preStep:R}={}){super(),this['status']=R?'runningPreStepInstruction':'runningInstruction';}},InstructionExecutionFinishedEvent=class extends ProgressEvent{['status'];['done']=!![];constructor({preStep:R}={}){super(),this['status']=R?'runningPreStepInstruction':'runningInstruction';}},ActionExecutionStartedEvent=class extends ProgressEvent{['status']='runningAction';['done']=![];},ActionExecutionFinishedEvent=class extends ProgressEvent{['status']='runningAction';['done']=!![];},AXNodeSearchStartedEvent=class extends ProgressEvent{['status']='searchingForElement';['done']=![];['descriptor'];constructor({descriptor:R}){super(),this['descriptor']=R;}},AXNodeSearchFinishedEvent=class extends ProgressEvent{['status']='searchingForElement';['done']=!![];['descriptor'];['node'];constructor({descriptor:R,node:w}){super(),this['descriptor']=R,this['node']=w;}},NavigationWaitStartedEvent=class extends ProgressEvent{['status']='waitingForNavigation';['done']=![];},NavigationWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForNavigation';['done']=!![];},LoadWaitStartedEvent=class extends ProgressEvent{['status']='waitingForResourcesLoad';['done']=![];},LoadWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForResourcesLoad';['done']=!![];},OutgoingRequestsWaitStartedEvent=class extends ProgressEvent{['status']='waitingForOutgoingRequests';['done']=![];},OutgoingRequestsWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForOutgoingRequests';['done']=!![];},StabilizationWaitStartedEvent=class extends ProgressEvent{['status']='waitingForStabilization';['done']=![];},StabilizationWaitFinishedEvent=class extends ProgressEvent{['status']='waitingForStabilization';['done']=!![];};function makeValuesStack(){return new ValuesStack();}var ValuesStack=class{#id=0x1;#pending=new Set();#items=new Map();#entities=new Map();#relations=new Map();#item(R,w,F,E){const u=this.#id++;if(F)return this.#add(u,{'type':R,'entity':w,'value':F,...E});else return this.#pending['add'](u),this.#relations['set'](u,[]),(M,N)=>{return this.#pending['delete'](u),this.#add(u,{'type':R,'entity':w,'value':M,...N});};}#add(R,w){this.#items['set'](R,w),this.#pending['forEach'](E=>this.#relations['get'](E)['push'](R));let F=this.#entities['get'](w['entity']);if(!F)this.#entities['set'](w['entity'],F=[]);return F['push'](R),w['value'];}*#related(R,w){for(const F of[R,...this.#relations['get'](R)??[]]){const E=this.#items['get'](F);if(E&&(!w||w===E['type']))yield E;}}['descriptor'](R,w){return w?this.#item('descriptor',R,w):this.#item('descriptor',R);}['node'](R,w){return w?this.#item('node',R,w):this.#item('node',R);}['reference'](R,w,F){return w?this.#item('reference',R,w,F):this.#item('reference',R);}['extractor'](R,w,F){return w?this.#item('extractor',R,w,F):this.#item('extractor',R);}['generator'](R,w,F){return w?this.#item('generator',R,w,F):this.#item('generator',R);}['operand'](R,w,F){return w?this.#item('operand',R,w,F):this.#item('operand',R);}['operation'](R,w){return w?this.#item('operation',R,w):this.#item('operation',R);}['nodeFor'](R,w){const F=this.#entities['get'](R)?.['find'](E=>this.#items['get'](E)?.['value']===w);if(F)return Array['from'](this.#related(F,'node'))[0x0]?.['value'];}['isSecret'](R){if(isReference(R)){const [w]=this.#entities['get'](R)??[];if(w)return Array['from'](this.#related(w,'reference'))[0x0]?.['secret'];}else{if(isInterpolatedString(R))return R['chunks']['some'](F=>this['isSecret'](F));else{if(isStructure(R)){if(R['type']==='array')return R['items']['some'](F=>this['isSecret'](F));else return R['items']['some'](F=>this['isSecret'](F['key'])||this['isSecret'](F['value']));}}}}*['descriptors'](R){if(R){const w=this.#entities['get'](R)??[];for(const F of w)for(const {value:E}of this.#related(F,'descriptor'))yield E;}else{for(const {type:u,value:M}of this.#items['values']())if(u==='descriptor')yield M;}}*['nodes'](R){if(R){const w=this.#entities['get'](R)??[];for(const F of w)for(const {entity:E,value:u}of this.#related(F,'node'))yield{'node':u,'descriptor':E};}else{for(const {type:M,entity:N,value:e}of this.#items['values']())if(M==='node')yield{'node':e,'descriptor':N};}}*['references'](){for(const {type:R,entity:w,value:F,...E}of this.#items['values']())if(R==='reference')yield{'reference':w,'value':F,...E};}*['extractors'](){for(const [R,{type:w,entity:F,value:E,...u}]of this.#items['entries']())if(w==='extractor')yield{'extractor':F,'value':E,'element':Array['from'](this.#related(R,'node'))[0x0]?.['entity'],...u};}*['operands'](){for(const [R,{type:w,entity:F,value:E,...u}]of this.#items['entries']())if(w==='operand')yield{'operand':F,'value':E,'element':Array['from'](this.#related(R,'node'))[0x0]?.['entity'],...u};}};async function tryMakeElementNotObscured(R,{timeout:w,signal:F}){const E=await getVisibleElementFromNode(R);if(!E)return;let u=!![];const M=setTimeout(()=>u=![],w);do{await E['tryToUnobscure']();const {isObscured:N,obscuringElement:e}=await E['isObscured']();if(!N){clearTimeout(M);return;}if(e&&await e['isLabelOf'](R['node'])){clearTimeout(M);return;}await sleep(0x3e8,{'signal':F});}while(u);throw new RunnerError('Element\x20is\x20obscured',{'code':ErrorCode['OBSCURED_ELEMENT']});}async function getVisibleElementFromNode(R){let w;for(const F of R['incorporated'])if(await F['isVisible']()&&await F['execute'](E=>E instanceof Element)){w=F;break;}if(!w){if(!R['parent'])return;return getVisibleElementFromNode(R['parent']);}return w;}async function revealElements(R){const w=[];for(const {node:F}of R){const E=(await Promise['all'](w['map'](async u=>u['node']['equal'](F['node'])['catch'](()=>![]))))['indexOf'](!![]);if(E>=0x0)w['splice'](E,0x1);w['push'](F);}for(const u of w)try{await(await getVisibleElementFromNode(u))?.['scrollIntoView']();}catch(M){error('elementRevealFailed',{'error':M});}}const PDF_STATE={'ready':'data-nlp-pdf-ready','error':'data-nlp-pdf-error','currentPage':'data-nlp-pdf-current-page','isolate':'data-nlp-pdf-isolate','isolatedPage':'data-nlp-pdf-isolated-page'},PDF_BYTES_PLACEHOLDER='__NLP_PDF_BYTES__';function isPdfViewerFrame(R){return Object['entries'](R['response']?.['headers']??{})['some'](([w])=>w['toLowerCase']()==='x-nlp-pdf-viewer');}async function waitForReady(R,w=0x4e20){return R['defaultExecute'](async(F,E,u)=>{const M=document['documentElement'];function N(){return M['getAttribute'](F)==='true'||M['getAttribute'](E)!=null;}if(N())return;await new Promise(e=>{function l(){Y['disconnect'](),clearTimeout(I),e();}const Y=new MutationObserver(()=>N()&&l());Y['observe'](M,{'attributes':!![],'attributeFilter':[F,E]});const I=setTimeout(l,u);});},[PDF_STATE['ready'],PDF_STATE['error'],w],{'await':!![]});}var Handler=class extends EventTargetNode{#captures={};#controller=new AbortController();#stack=makeValuesStack();#metrics;['automator'];['context'];['instruction'];['signal'];['shouldCapture'];['loop'];['stepId'];['correlationId'];['stepIndex'];['shouldNotThrowOnUnexpectedNavigationStatus'];['expectedNavigationStatuses'];get['action'](){return this['instruction'];}get['stack'](){return this.#stack;}get['metrics'](){return this.#metrics;}get['findTimeout'](){return this['context']['scope']['internal']['findTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['frameStabilityTimeout'](){return this['context']['scope']['internal']['frameStabilityTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['navigateTimeout'](){return this['context']['scope']['internal']['navigateTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}get['screenshotTimeout'](){return this['context']['scope']['internal']['screenshotTimeout']?.['value']??this['context']['scope']['internal']['timeout']?.['value'];}constructor({automator:R,context:w,instruction:F,signal:E,shouldCapture:u,loop:M,stepId:N,correlationId:e,stepIndex:l,shouldNotThrowOnUnexpectedNavigationStatus:Y,expectedNavigationStatuses:I}){super(),this.#metrics={'platform':R['type']},this['automator']=R,this['context']=w,this['instruction']=F,this['loop']=M,this['stepId']=N,this['stepIndex']=l,this['correlationId']=e,this['signal']=E?AbortSignal['any']([this.#controller['signal'],E]):this.#controller['signal'],this['shouldCapture']=u??![],this['shouldNotThrowOnUnexpectedNavigationStatus']=Y??![],this['expectedNavigationStatuses']=I??[];}['abort'](R){this.#controller['abort'](R??new RunnerError('The\x20instruction\x20was\x20aborted\x20before\x20it\x20got\x20to\x20finish',{'core':ErrorCode['HANDLER_ABORTED']}));}['throwIfAborted'](){this['signal']['throwIfAborted']();}['throwIfNoElement'](R){if(!R)throw new RunnerError('Element\x20not\x20found',{'code':ErrorCode['NO_ELEMENT']});}['throwIfBlocked'](){if(this['automator']instanceof Browser&&this['automator']['activePage']['dialog']&&this['automator']['activePage']['dialog']['type']!=='filepicker')throw new RunnerError('Cannot\x20proceed\x20until\x20native\x20blocking\x20dialog\x20is\x20handled',{'code':ErrorCode['UNHANDLED_DIALOG']});}['throwIfExceededAllowedTimeout'](R){const w=this['context']['scope']['internal']['maxWaitTimeout']?.['value']??0x1d4c0;if(R>w)throw new RunnerError('Timeout\x20of\x20'+R+'ms\x20exceeds\x20maximum\x20allowed\x20timeout\x20of\x20'+w+'ms',{'code':ErrorCode['EXCEEDED_ALLOWED_TIMEOUT'],'timeout':R});}async['throwIfCannotTypeToElement'](R){if(!R||!await R['canTypeInto']())throw new RunnerError('Element\x20is\x20not\x20a\x20textbox',{'code':ErrorCode['ELEMENT_NOT_TEXTBOX']});}async #isBrowserResponsive(){if(!(this['automator']instanceof Browser))return void 0x0;try{return await this['automator']['connection']['execute']('Browser.getVersion',void 0x0,{'timeout':Math['min'](this['automator']['connection']['timeout'],0x1388)}),!![];}catch{return![];}}async['run'](){let R;try{if(this['automator']instanceof Browser&&this['frameStabilityTimeout'])this['automator']['frameStabilityTimeout']=this['frameStabilityTimeout'];await this['stabilize']('basic');const M=performance['now']();try{R=await this['handle']();}finally{this.#metrics['handleMs']=performance['now']()-M;}}catch(N){if(N instanceof StaleNodeError||N instanceof StaleRemoteObjectHandleError)return log('handlerRetriedOnStaleNode',{'error':N}),this.#metrics={'platform':this['automator']['type']},this['run']();else{if(N instanceof FlushError)log('handlerFlushed',{'error':N}),R={'status':'flushed','meta':{'reason':N['message']}};else{if(N instanceof AutomatorError){error('handlerAutomatorError',{'error':N});const {code:e,meta:l}=translateAutomatorError(N,{'retriable':N instanceof CommandTimedOutError?await this.#isBrowserResponsive():void 0x0});R={'status':'error','error':N['message'],'code':e,'meta':l};}else{if(N instanceof RunnerError)error('handlerRunnerError',{'error':N}),R={'status':'error','error':N['message'],'code':N['code'],'meta':N['meta']};else this['signal']['aborted']&&(N['code']==='ABORT_ERR'||N===this['signal']['reason'])?(error('handlerAborted',{'error':N}),R={'status':'aborted','meta':{'reason':N['cause']?.['message']??N['message']}}):(error('handlerInternalError',{'error':N}),R={'status':'error','error':N['message']??'unknown\x20error','code':ErrorCode['INTERNAL'],'meta':{'original':N}});}}}if(!Object['hasOwn'](this.#captures,'after')&&R['status']!=='aborted')await this['after']();}const w=new Map(Array['from'](this.#stack['references'](),({reference:Y,value:I,...f})=>[Y,{'value':I,...f}])),F=new Map(Array['from'](this.#stack['extractors'](),({extractor:Y,value:I,element:f,...t})=>[Y,{'value':I,'element':f,...t}])),E=new Map(Array['from'](this.#stack['operands'](),({operand:Y,value:I,element:f,...t})=>[Y,{'value':I,'element':f,...t}])),u=getInstructionText(this['instruction']);return{...R,...this.#captures,...u?{'text':u}:{},'values':{'references':w,'extractors':F,'operands':E},'metrics':this.#metrics};}async #accumulate(R,w){const F=performance['now']();try{return await w();}finally{this.#metrics[R]=(this.#metrics[R]??0x0)+(performance['now']()-F);}}async['stabilize'](R='strict'){return this.#accumulate('stabilizeMs',async()=>{await this['automator']['stabilize'](R,{'signal':this['signal'],'timeout':this['screenshotTimeout']});if(this['automator']instanceof Browser){if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);}});}async['evaluate'](R){return evaluateExpression(R,{'context':this['context'],'stack':this.#stack,'automator':this['automator'],'timeout':this['findTimeout']??0x2710,'signal':this['signal']});}async['element'](R){const w=await this['context']['axOps']['findNode'](await this['evaluate'](R),{'stack':this.#stack,'timeout':this['findTimeout']??0x2710,'signal':this['signal'],'metrics':this.#metrics});return w&&(this['context']['activeAXNode']=w,this['dispatch'](new HandlerAXNodeFoundEvent(w))),w;}async['elements'](R){return this['context']['axOps']['findNodes'](await this['evaluate'](R),{'stack':this.#stack,'timeout':this['findTimeout']??0x2710,'signal':this['signal'],'metrics':this.#metrics});}async['capture'](){if(!this['shouldCapture'])return;try{await this['automator']['stabilize']('basic',{'signal':this['signal']});if(this['automator']['blocked'])return;const R=await this['automator']['captureScreenshot'](this['context']['screenshot']),w=Date['now'](),F=((async()=>{try{return await this['automator']['activePage']?.['mainFrame']['execute'](()=>({'width':innerWidth,'height':innerHeight,'scrollX':scrollX,'scrollY':scrollY}));}catch{return;}})());return{'image':R,'at':w,'elements':await Array['from'](this.#stack['nodes']())['reduce'](async(E,{node:u,descriptor:M})=>{try{if(u===u['tree']['root'])return await E;const {x:N,y:e,width:l,height:Y}=await u['node']['getScreenBox'](),I=await u['node']['getDescription']();return await E['then'](f=>f['concat']({'region':{'x':N,'y':e,'width':l,'height':Y},'descriptor':M,'label':I}));}catch(f){return error('elementMarkerExtractionFailed',{'error':f}),E;}},Promise['resolve']([])),'viewport':await F};}catch(E){error('captureFailed',{'error':E});}}async['reveal'](){if(!this['shouldCapture']||!(this['automator']instanceof Browser))return;return this.#accumulate('revealMs',async()=>{await revealElements(Array['from'](this.#stack['nodes']())['filter'](({node:R})=>R!==R['tree']['root']));});}async['before'](){bus['dispatch'](new ActionExecutionStartedEvent()),this.#captures['before']=await this.#accumulate('captureMs',()=>this['capture']());}async['after'](){this.#captures['after']=await this.#accumulate('captureMs',()=>this['capture']()),bus['dispatch'](new ActionExecutionFinishedEvent());}},HandlerAXNodeFoundEvent=class extends Event{['node'];constructor(R,w){super('nodeFound',w),this['node']=R;}},AssertHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['action']['timeout'])??this['findTimeout']??0x7530,w=Date['now']();let F=0x0,E=!![];const u=setTimeout(()=>E=![],R);do{this['throwIfAborted'](),++F;try{if(await this['evaluate'](this['action']['condition']))return clearTimeout(u),log('assertionEvaluated',{'passed':!![],'attempts':F,'durationMs':Date['now']()-w,'condition':this['action']['condition']}),await this['reveal'](),await this['after'](),{'status':'asserted'};else{if(Array['from'](this['stack']['descriptors'](this['action']['condition']['operation']))['length']===0x0){clearTimeout(u);break;}}}catch(M){if(!E||this['signal']['aborted']||M instanceof RunnerError&&M['code']===ErrorCode['FILE_ACCESS'])throw M;}await sleep(0x3e8,{'signal':this['signal']});}while(E);log('assertionEvaluated',{'passed':![],'attempts':F,'durationMs':Date['now']()-w,'condition':this['action']['condition']}),await this['reveal'](),await this['after']();throw new RunnerError('Assertion\x20failed',{'code':ErrorCode['FAILED_ASSERTION']});}},EmptyHandler=class extends Handler{async['handle'](){return await this['stabilize'](),await this['before'](),await this['after'](),{'status':'empty'};}};function makeUrlData(R){const w=new URL(R);return{'href':R,'protocol':w['protocol']['replace'](/:$/,''),'user':w['username'],'password':w['password'],'host':w['host'],'hostname':w['hostname'],'port':w['port'],'path':w['pathname'],'query':w['search'],'anchor':w['hash'],[Symbol['for']('stringify')](){return R;}};}async function evaluateHeaders(R,{evaluate:w,stack:F}){const E=new Headers(),u=new Set();for(const M of R){const N=await w(M['name']);if(!/^[a-zA-Z0-9_-]+$/['test'](N))throw new RunnerError('The\x20header\x20name\x20\x22'+N+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_HEADER'],'header':M});const e=await w(M['value']),l=M['secret']||(F['isSecret'](M['value'])??![]);if(!/^[a-zA-Z0-9 :;.,\\/"'?!(){}[\]@<>=+*#$&`|~^%_-]+$/['test'](e))throw new RunnerError(l?'The\x20value\x20of\x20the\x20\x22'+N+'\x22\x20header\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters':'The\x20header\x20value\x20\x22'+e+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_HEADER'],'header':M});E['append'](N,e);if(l)u['add'](N['toLowerCase']());}return{'headers':E,'secrets':u};}var FetchHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const R={'headers':new Set(),'cookies':new Set(),'body':![]},w=await this['evaluate'](this['action']['url']);let F=this['action']['method']?.['toUpperCase']();if(!F&&this['action']['body'])F='POST';const E=new Request(w,{'method':F});if(this['action']['headers']){const I=await evaluateHeaders(this['action']['headers'],{'evaluate':f=>this['evaluate'](f),'stack':this['stack']});I['headers']['forEach']((f,t)=>E['headers']['set'](t,f)),I['secrets']['forEach'](f=>R['headers']['add'](f));}let u;if(this['action']['body']){const f=await this['evaluate'](this['action']['body']['data']);R['body']=this['stack']['isSecret'](this['action']['body']['data'])??![];let t=this['action']['body']['type'];if(!t){if(typeof f==='string'){if(isJsonString(f))t='json';else{if(isXmlString(f))t='xml';}}else t='json';}if(t==='csv'){if(typeof f==='string')u=f;else{if(Array['isArray'](f))u=stringifyCsv(f);else throw new RunnerError('Only\x20a\x20list\x20of\x20records\x20can\x20be\x20sent\x20as\x20CSV');}if(!E['headers']['has']('Content-Type'))E['headers']['set']('Content-Type','text/csv;charset=UTF-8');}else{if(t==='base64'){if(typeof f!=='string'||!isBase64String(f))throw new RunnerError('Body\x20is\x20not\x20of\x20base64\x20format');u=new Uint8Array(X['from'](f,'base64'));}else{if(t==='xml'){if(typeof f!=='string'){if(f&&typeof f==='object'&&!Array['isArray'](f))u=stringifyXml(f);else throw new RunnerError('Body\x20could\x20not\x20be\x20converted\x20to\x20XML\x20format');}else u=f;if(!E['headers']['has']('Content-Type'))E['headers']['set']('Content-Type','application/xml;charset=UTF-8');}else{u=typeof f!=='string'?stringifyJson(f):f;if(t==='json'&&!E['headers']['has']('Content-Type'))E['headers']['set']('Content-Type','application/json;charset=UTF-8');}}}}if(this['action']['auth']){if(this['action']['auth']['type']==='basic'){const W=await this['evaluate'](this['action']['auth']['username']),i=await this['evaluate'](this['action']['auth']['password']),K='Authorization';E['headers']['set'](K,'Basic\x20'+X['from'](W+':'+i)['toString']('base64')),R['headers']['add'](K['toLowerCase']());}}if(this['action']['cookies']){const s=[];for(const k of this['action']['cookies']){const S=await this['evaluate'](k['name']);if(/=/['test'](S))throw new RunnerError('The\x20cookie\x20name\x20\x22'+S+'\x22\x20is\x20malformed,\x20it\x20contains\x20illegal\x20characters',{'code':ErrorCode['MALFORMED_COOKIE'],'cookie':k});const a=await this['evaluate'](k['value']),T=k['secret']||this['stack']['isSecret'](k['value']);s['push'](S+'='+a);if(T)R['cookies']['add'](S);}const Q='Cookie';E['headers']['set'](Q,s['join'](';\x20'));if(R['cookies']['size']>0x0)R['headers']['add'](Q['toLowerCase']());}const M={'url':makeUrlData(E['url']),'headers':N(E['headers']),'cookies':e(E['headers']),...u&&{'body':{'value':u,'secret':R['body']}}};try{const H=await V(E,{'body':u,'dispatcher':this['context']['dispatcher']}),A={'status':H['status'],'statustext':H['statusText'],'body':await Y(H),'headers':N(H['headers']),'cookies':l(H['headers']),[Symbol['for']('get')](D){if(D==='body')return this['body']['value'];else return this[D];},[Symbol['for']('stringify')](){return this['body']['value'];}};this['context']['scope']['public']['response']={'value':A};if(this['action']['statuses']?this['action']['statuses']!=='*'&&!this['action']['statuses']['includes'](A['status']):A['status']<0xc8||A['status']>0x12b)throw new RunnerError('The\x20request\x20to\x20url\x20\x22'+w+'\x22\x20resulted\x20with\x20an\x20unexpected\x20status\x20code\x20'+A['status'],{'code':ErrorCode['UNEXPECTED_REQUEST_STATUS'],'status':A['status'],'response':A,'request':M});return await this['after'](),{'status':'fetched','meta':{'response':A,'request':M}};}catch(D){if(D['message']==='fetch\x20failed')throw new RunnerError('Failed\x20to\x20send\x20the\x20request',{'code':ErrorCode['FETCH_FAILED'],'request':M,'cause':D['cause']});else throw D;}function N(Z){const O={[Symbol['for']('get')](p){return this[p['toLowerCase']()]['value'];}};return Z['forEach']((p,J)=>{O[J]={'value':p,'secret':R['headers']['has'](J)};}),O;}function e(Z){const O={[Symbol['for']('get')](p){return this[p]['value'];}};return(Z['get']('Cookie')?.['split'](';')??[])['forEach'](p=>{const [J,C]=p['split'](/=(.+)/);O[J]={'value':C,'secret':R['cookies']['has'](J)};}),O;}function l(Z){const O={[Symbol['for']('get')](p){return this[p]['value'];}};return Z['getSetCookie']()['forEach'](p=>{const [J,C]=p['split'](/=(.+)/);O[J]={'value':C,'secret':R['cookies']['has'](J)};}),O;}async function Y(Z){const O=await Z['text']();if(O){const p=Z['headers']['get']('Content-Type');if(p?.['includes']('application/json'))return{'value':{...parseJsonString(O),[Symbol['for']('stringify')]:()=>O},'secret':![]};else{if(p?.['includes']('application/xml'))return{'value':{...parseXmlString(O),[Symbol['for']('stringify')]:()=>O},'secret':![]};else{if(p?.['includes']('text/csv')){const J=parseCsvString(O);return{'value':Object['defineProperty'](J,Symbol['for']('stringify'),{'value':()=>O}),'secret':![]};}}}}return{'value':O,'secret':![]};}}},InitializeScopeHandler=class extends Handler{async['handle'](){return await this['stabilize'](),await this['before'](),this['context']['scope']['initialize']({'input':await(this['instruction']['parameters']??[])['reduce'](async(R,{name:w,value:F,secret:E})=>{return R['then'](async u=>({...u,[w]:{'value':await this['evaluate'](F),'secret':E}}));},Promise['resolve']({})),'public':{},'internal':{}}),this['context']['scope']['internal']['forceRunningAssertions']={'value':this['instruction']['options']?.['assertions']},this['context']['scope']['internal']['forceRunningNavigation']={'value':this['instruction']['options']?.['navigation']},await this['after'](),{'status':'scope\x20initialized','parameters':this['context']['scope']['active']?.['input']};}},SetVariableHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const R=this['action']['scope']??'public',w=await this['evaluate'](this['action']['data']['value']),F=this['action']['data']['secret']||(this['stack']['isSecret'](this['action']['data']['value'])??![]);let E;if(this['action']['destruction']){if(Array['isArray'](w))E=(M,N)=>w[N];else{if(w!==null&&typeof w==='object')E=M=>w[M];else E=()=>w;}}else E=()=>w;const u=this['action']['names']['map']((M,N)=>{const e=M['name']['toLowerCase'](),l=E(M['name'],N),Y=this['context']['scope'][R][e],I={'value':l,'secret':F||M['secret']||![]};return this['context']['scope'][R][e]=I,{'name':e,'previous':Y,'current':I};});return await this['after'](),{'status':'variable\x20set','meta':{'variables':u,'scope':R}};}},WriteFileHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['action']['data']),w=await resolveFilename(await this['evaluate'](this['action']['file']['filename']),this['context']),F=serialize(R,this['action']['format']??formatOfExtension(w)),E=this['action']['append']??![];return await throughFileAction(()=>requireFileAction('writeFile',this['context'])(w,F,{'append':E}),{'filename':w,'failure':'written'}),await this['after'](),{'status':'file\x20written','meta':{'filename':w,'bytes':Buffer['byteLength'](F),'append':E,'format':this['action']['format']}};}};function serialize(R,w){if(w==='csv'){if(!Array['isArray'](R))throw new RunnerError('Only\x20a\x20list\x20of\x20records\x20can\x20be\x20written\x20as\x20CSV',{'code':ErrorCode['INVALID_DATA']});return stringifyCsv(R);}if(w==='json')return stringifyJson(R);if(w==='xml')return stringifyXml(R);return stringify(R);}var RemoveFileHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const R=await resolveFilename(await this['evaluate'](this['action']['file']['filename']),this['context']);return await throughFileAction(()=>requireFileAction('removeFile',this['context'])(R),{'filename':R,'failure':'removed'}),await this['after'](),{'status':'file\x20removed','meta':{'filename':R}};}};async function isolatePdfPage(R){const w=R['activePage']?.['mainFrame'];if(!w||!isPdfViewerFrame(w))return noop$1;try{await callViewer(w,'isolate');}catch(F){return error('pdfPageIsolationFailed',{'error':F}),noop$1;}return async()=>{await callViewer(w,'restore')['catch'](E=>error('pdfPageRestoreFailed',{'error':E}));};}async function noop$1(){}function callViewer(R,w){return R['defaultExecute'](F=>globalThis['nlpPdfState']?.[F]?.(),[w]);}var VisualCheckHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']('paranoid');const R=await isolatePdfPage(this['automator']);try{return await this['before'](),await this['context']['actions']['check'](),await this['after'](),{'status':'visually\x20checked'};}finally{await R();}}},WaitHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['action']['timeout']);if(R)this['throwIfExceededAllowedTimeout'](R);if(!this['action']['condition'])return await sleep(R??0x3e8,{'signal':this['signal']}),await this['after'](),{'status':'success'};const w=R??this['findTimeout']??0xea60,F=Date['now']();let E=0x0,u=!![];const M=setTimeout(()=>u=![],w);do{this['throwIfAborted'](),++E;try{const N=await this['evaluate'](this['action']['condition']);debug('waitConditionEvaluated',{'conditionMet':Boolean(N),'attempt':E,'elapsedMs':Date['now']()-F,'timeout':w});if(N)return clearTimeout(M),await this['reveal'](),await this['after'](),{'status':'success'};}catch(e){if(!u||this['signal']['aborted'])throw e;}await sleep(0x3e8,{'signal':this['signal']});}while(u);throw new RunnerError('Timeout\x20waiting\x20for\x20condition\x20to\x20match',{'code':ErrorCode['CONDITION_TIMED_OUT'],'timeout':w,'condition':this['action']['condition']});}},DefinePreinstructionsHandler=class extends Handler{async['handle'](){return{'status':'preinstructions\x20defined','meta':{'preinstructions':this['instruction']['type']==='set\x20preinstructions'?this['instruction']['instructions']:[]}};}},TryHandler=class extends Handler{async['handle'](){return{'status':'tried','meta':{'next':this['instruction']['instructions']}};}},IfHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['instruction']['condition']);return await this['reveal'](),await this['after'](),{'status':'condition\x20evaluated','meta':{'met':R,'next':R?this['instruction']['then']:this['instruction']['otherwise']}};}};async function openLoopBindings(R,w){const F=[];for(let u=R;u;u=u['parent'])F['unshift'](u);const E=[];for(const M of F){const N=await bindingsOf(M,w);if(!N)continue;E['push'](w['context']['scope']['bind'](N['values']));if(N['node'])w['context']['activeAXNode']=N['node'];}return()=>{for(const e of E['reverse']())e();};}async function bindingsOf(R,w){const F=R['iteration']-0x1;if(F<0x0)return void 0x0;const E=R['head'];if(!('iterable'in E))return{'values':{'index':{'value':F},'key':{'value':F}}};if(isElementIterable(E['iterable'])){await w['automator']['stabilize']('strict',{'signal':w['signal']});const N=await evaluateExpression(E['iterable'],w),e=(await w['context']['axOps']['findNodes'](N,{'stack':w['stack'],'signal':w['signal']}))[F];if(!e)return void 0x0;return{'values':{'index':{'value':F},'key':{'value':F}},'node':e};}const u=await evaluateExpression(E['iterable'],w),M=(await Array['fromAsync'](makeIterator(u,w)))[F];if(!M)return void 0x0;return{'values':{...Object['fromEntries']((E['bindings']??[])['map'](l=>[l,{'value':M['item']}])),'it':{'value':M['item']},'index':{'value':M['index']},'key':{'value':M['key']}}};}function isElementIterable(R){if(!R||typeof R!=='object')return![];return!('isStructure'in R||'isRef'in R||'isJSExpressionRef'in R||'isInterpolatedString'in R);}const DEFAULT_ITERATION_LIMIT=0x14,MAX_ITERATION_LIMIT=0x64;var LoopHandler=class extends Handler{async['handle'](){const R=this['instruction'];if(R['instructions']['length']===0x0)return this.#decide(R);const w=this.#state(),F='iterable'in R?await this.#iterate(R,w):await this.#repeat(R,w);if(!F&&!('iterable'in R))this.#bind(w,{'index':w['iteration'],'key':w['iteration']});if(F)return w['unbind']?.(),this['context']['loops']?.['delete'](R),{'status':'looped','meta':{'iteration':w['iteration'],'done':!![]}};if(w['iteration']>0x0){const E=await this['evaluate'](R['wait']);if(E)await sleep(E,{'signal':this['signal']});}return w['iteration']+=0x1,log('loopIterationStarted',{'iteration':w['iteration'],'total':w['total'],'correlationId':this['correlationId']}),{'status':'looped','meta':{'iteration':w['iteration'],'done':![],'next':R['instructions']}};}async #repeat(R,w){const F=await this['evaluate'](R['times']);if(F!=null&&!R['condition'])w['total']=F;const E=Math['min'](this['context']['scope']['internal']['loopIterationLimit']?.['value']??DEFAULT_ITERATION_LIMIT,MAX_ITERATION_LIMIT),u=F==null?E:Math['min'](F,E);if(w['iteration']>=u){if(F!=null&&w['iteration']>=F)return!![];throw new RunnerError('The\x20loop\x20exceeded\x20its\x20limit\x20of\x20'+E+'\x20iterations',{'code':ErrorCode['LOOP_LIMIT_EXCEEDED'],'meta':{'iteration':w['iteration'],'limit':E}});}return Boolean(R['condition'])&&!await this['evaluate'](R['condition']);}async #iterate(R,w){if(isElementIterable(R['iterable'])){await this['stabilize'](),w['iterable']??=await this['evaluate'](R['iterable']);const M=await this['elements'](w['iterable']);w['total']=M['length'];const N=M[w['iteration']];if(!N)return!![];return this.#bind(w,{'index':w['iteration'],'key':w['iteration']},N),![];}const F=await this['evaluate'](R['iterable']);w['entries']??=await Array['fromAsync'](makeIterator(F,{'context':this['context'],'stack':this['stack'],'automator':this['automator'],'signal':this['signal']})),w['total']=w['entries']['length'];const E=w['entries'][w['iteration']];if(!E)return!![];const u=Object['fromEntries']((R['bindings']??[])['map'](e=>[e,E['item']]));return this.#bind(w,{...u,'it':E['item'],'index':E['index'],'key':E['key']}),![];}#bind(R,w,F){R['unbind']?.(),R['unbind']=this['context']['scope']['bind'](Object['fromEntries'](Object['entries'](w)['map'](([E,u])=>[E,{'value':u}])));if(F)this['context']['activeAXNode']=F;}async #decide(R){const w=(this['loop']?.['id']===this.#id()?this['loop']:void 0x0)??{'id':this.#id(),'head':R,'parent':this['loop'],'iteration':0x0,'startedAt':Date['now']()},F={'iteration':w['iteration'],'entries':void 0x0},E='iterable'in R?await this.#iterate(R,F):await this.#repeat(R,F);F['unbind']?.();if(E)return{'status':'looped','meta':{'iteration':w['iteration'],'done':!![],'loop':w}};if(w['iteration']>0x0){const M=await this['evaluate'](R['wait']);if(M)await sleep(M,{'signal':this['signal']});}const u={...w,'iteration':w['iteration']+0x1};return log('loopIterationStarted',{'iteration':u['iteration'],'total':F['total'],'correlationId':this['correlationId']}),{'status':'looped','meta':{'iteration':u['iteration'],'done':![],'loop':u}};}#id(){return this['stepId']??(this['stepIndex']!=null?'step:'+this['stepIndex']:'loop:'+JSON['stringify'](this['instruction']));}#state(){const R=this['context']['loops']??=new Map();let w=R['get'](this['instruction']);if(!w)R['set'](this['instruction'],w={'iteration':0x0});return w;}},IntentHandler=class extends Handler{async['handle'](){throw new RunnerError('Intent\x20action\x20should\x20not\x20be\x20executed',{'code':ErrorCode['FORBIDDEN_ACTION']});}},CheckHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element']({...R,'type':R['type']??'checkbox'});this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const F=await w['node']['execute'](E=>{if(E instanceof Element&&E['hasAttribute']('aria-checked'))return E['getAttribute']('aria-checked')==='true';if(E instanceof HTMLInputElement&&['checkbox','radio']['includes'](E['type']))return E['checked'];return![];});if(typeof this['action']['value']!=='boolean'||F!==this['action']['value'])await w['node']['click']({'simulate':w['type']['checkbox']===0x1||w['type']['radio']===0x1,'signal':this['signal']});return this['context']['activeElement']=w['node'],await this['after'](),{'status':'success'};}};async function activateBrowserTab(R,w){if(w['position']==='previous'){if(!await R['activatePreviousPage']())throw new RunnerError('Can\x27t\x20switch\x20to\x20the\x20previous\x20tab\x20because\x20there\x20is\x20no\x20history\x20of\x20navigation\x20among\x20the\x20tabs',{'code':ErrorCode['NO_TAB_HISTORY']});}else{if(w['position']==='next'){if(!await R['activateNextPage']()){const F=Array['from'](R['pages']());if(F['length']<=0x1)throw new RunnerError('Can\x27t\x20switch\x20to\x20the\x20next\x20tab\x20because\x20the\x20current\x20tab\x20is\x20already\x20located\x20at\x20the\x20top\x20of\x20history\x20and\x20there\x20are\x20no\x20other\x20tabs\x20to\x20switch\x20to',{'code':ErrorCode['NO_NEXT_TAB']});await F[(F['findIndex'](E=>E===R['activePage'])+0x1)%F['length']]['activate']();}}else await findBrowserTab(R,w)['activate']();}}async function closeBrowserTab(R,w){if(Array['from'](R['pages']())['length']<=0x1)throw new RunnerError('Can\x27t\x20close\x20the\x20browser\x20tab\x20because\x20it\x20is\x20the\x20only\x20tab',{'code':ErrorCode['CLOSE_LAST_TAB']});await(w['index']!=null||w['title']!=null||w['position']!=null?findBrowserTab(R,w):R['activePage'])['close']();}function findBrowserTab(R,w){const F=Array['from'](R['pages']());if(w['index']!=null){if(w['index']>=F['length'])throw new RunnerError('Can\x27t\x20find\x20browser\x20tab\x20with\x20index\x20'+w['index']+',\x20because\x20there\x20is\x20only\x20'+F['length']+'\x20browser\x20tab(s)',{'code':ErrorCode['NO_TAB']});return F[w['index']];}if(w['title']!=null){const E=new RegExp('\x5cb'+w['title']['replaceAll'](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+'\x5cb','i'),u=F['find'](M=>E['test'](M['title']));if(!u)throw new RunnerError('Can\x27t\x20find\x20the\x20browser\x20tab\x20with\x20title\x20\x22'+w['title']+'\x22',{'code':ErrorCode['NO_TAB']});return u;}return F[(F['findIndex'](M=>M===R['activePage'])+(w['position']==='previous'?-0x1:0x1)+F['length'])%F['length']];}var ClickHandler$1=class extends Handler{async['handle'](){if(isDialogElementDescriptor(this['action']['element']))return this['handleWithDialogElementDescriptor'](this['action']['element']);const R=this['automator']['activePage']['dialog'],w=R&&R['type']!=='filepicker'?R:null;if(!w)await this['stabilize']();const F=await this['evaluate'](this['action']['element']);if(isDialogElementDescriptor(F))return this['handleWithDialogElementDescriptor'](F);if(isChromeTabDescriptor(F))return this['throwIfBlocked'](),this['handleWithChromeTab'](F);if(isChromeElementDescriptor(F))return this['throwIfBlocked'](),this['handleWithChromeElementDescriptor'](F);if(w){const u=toDialogElementDescriptor(F);if(u)return this['handleWithDialogElementDescriptor'](u);this['throwIfBlocked']();}const E=await this['element']({...F,'state':{...F['state'],'active':!![]},'hints':{'type':'button'}});if(F&&!E?.['node']){const M=toChromeElementDescriptor(F);if(M)return this['handleWithChromeElementDescriptor'](M);const N=toChromeTabDescriptor(F);if(N)return this['handleWithChromeTab'](N);}return this['throwIfNoElement'](E),this['handleWithElement'](E);}async['handleWithChromeTab'](R){return await this['before'](),await activateBrowserTab(this['automator'],R),await this['after'](),{'status':'success'};}async['handleWithDialogElementDescriptor'](R){const w=this['automator']['activePage']['dialog'];if(!w||w['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});return await this['before'](),await w['handle'](R['title']!=='cancel'),await this['after'](),{'status':'success'};}async['handleWithChromeElementDescriptor'](R){await this['before']();if(R['type']==='button'){if(R['title']==='refresh')await this['automator']['activePage']['reload']();else{if(R['title']==='back')await this['automator']['activePage']['navigateThroughHistory'](-0x1);else{if(R['title']==='forward')await this['automator']['activePage']['navigateThroughHistory'](0x1);}}}return await this['after'](),{'status':'success'};}async['handleWithElement'](R){await tryMakeElementNotObscured(R,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const {keys:w,button:F,times:E}=this['action'];if(w)await this['automator']['activePage']['keyboard']['down'](w);await R['node']['click']({'simulate':R['type']['checkbox']===0x1||R['type']['radio']===0x1,'signal':this['signal'],'button':F,'times':E});if(w)await this['automator']['activePage']['keyboard']['up'](w);return await Promise['all']([R['node']['frame']['wait']('stable'),G(0x64)]),this['context']['activeElement']=R['node'],await this['after'](),{'status':'success'};}},TypeHandler$1=class extends Handler{async['handle'](){if(isDialogElementDescriptor(this['action']['element']))return this['handleWithDialogElementDescriptor']();this['throwIfBlocked'](),await this['stabilize']();const R=stringify(await this['evaluate'](this['action']['value']??''));if(isChromeElementDescriptor(this['action']['element']))this['action']['element']['type']==='textbox'&&this['action']['element']['title']==='url'&&(await this['before'](),await this['automator']['activePage']['navigate'](R),await this['after']());else{const w=await this['evaluate'](this['action']['element'])??(isOTP(this['action']['value'])?{'type':'textbox','title':'code','fallback':{'state':{'focused':!![]}}}:{'state':{'focused':!![]}});if(isDialogElementDescriptor(w))return this['handleWithDialogElementDescriptor']();const F=await this['element']({...w,'state':{...w['state'],'active':!![]},'type':[w['type']??[],'textbox']['flat']()});this['throwIfNoElement'](F),await tryMakeElementNotObscured(F,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const E=F['node'];await this['throwIfCannotTypeToElement'](E),await E['focus']();if(await E['isContentEditable']())await E['setCaretPosition']('end');if(R['length']>=0xc8)await this['automator']['activePage']['keyboard']['insert'](R,{'keys':['ControlLeft','KeyV']});else await this['automator']['activePage']['keyboard']['type'](R);this['context']['activeElement']=E,await this['after']();}return{'status':'success'};}async['handleWithDialogElementDescriptor'](){const R=this['automator']['activePage']['dialog'];if(!R||R['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});const w=stringify(await this['evaluate'](this['action']['value']??''));return await this['before'](),await R['handle'](!![],w),await this['after'](),{'status':'success'};}},ClearHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element'])??{'state':{'focused':!![]}},w=await this['element']({...R,'type':[R['type']??[],'inputbox']['flat']()});this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();if(w['type']['textbox'])await w['node']['focus'](),await this['automator']['activePage']['keyboard']['press'](['ControlLeft','KeyA'],{'commands':['selectAll']}),await this['automator']['activePage']['keyboard']['press']('Backspace');else{if(w['type']['checkbox']){if(await w['node']['execute'](F=>F instanceof HTMLInputElement&&F['type']==='checkbox'&&F['checked']||F instanceof Element&&F['getAttribute']('aria-checked')==='true'))await w['node']['click']({'simulate':!![],'signal':this['signal']});}else throw new RunnerError('Can\x27t\x20clear\x20the\x20targeted\x20element',{'code':ErrorCode['ELEMENT_NOT_CLEARABLE']});}return this['context']['activeElement']=w['node'],await this['after'](),{'status':'success'};}},ScrollHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();if('position'in this['action']){const R=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},w=await this['element'](isViewportDescriptor(R)?{'type':'scrollable','fallback':{'type':'app'}}:R);this['throwIfNoElement'](w);const F=w['node'];let E,u;if(isViewportDescriptor(R)){const M=await this['automator']['activePage']['getViewportSize']();if(this['action']['position']==='center')u=0x0,E=0x0;else{if(this['action']['position']['includes']('top'))u=-(M['height']/0x2);else{if(this['action']['position']['includes']('bottom'))u=M['height']/0x2;}if(this['action']['position']['includes']('left'))E=-(M['width']/0x2);else{if(this['action']['position']['includes']('right'))E=M['width']/0x2;}}}else{const {scrollX:N,scrollY:e,scrollWidth:l,scrollHeight:Y,clientWidth:I,clientHeight:f}=await F['getMetrics']();if(this['action']['position']['includes']('center'))E=(l-I)/0x2-N,u=(Y-f)/0x2-e;else{if(this['action']['position']['includes']('top'))u=-e;else{if(this['action']['position']['includes']('bottom'))u=Y-f-e;}if(this['action']['position']['includes']('left'))E=-N;else{if(this['action']['position']['includes']('right'))E=l-I-N;}}}await F['scrollBy']({'x':E,'y':u});}else{if('fraction'in this['action']){const t=await this['evaluate'](this['action']['fraction']),W=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},i=await this['element'](isViewportDescriptor(W)?{'type':'scrollable','fallback':{'type':'app'}}:W);this['throwIfNoElement'](i);const K=i['node'],s=this['action']['direction']??'down',Q=await this['evaluate'](this['action']['times'])??0x1,k=isViewportDescriptor(W)?await this['automator']['activePage']['getViewportSize']():await K['getMetrics']()['then'](({scrollWidth:T,scrollHeight:H})=>({'width':T,'height':H}));let S,a;if(s==='up')a=-(k['height']*t);else{if(s==='down')a=k['height']*t;else{if(s==='left')S=-(k['width']*t);else{if(s==='right')S=k['width']*t;}}}for(let T=0x0;T<Q;++T)await K['scrollBy']({'x':S,'y':a});}else{if('element'in this['action']&&!('direction'in this['action'])){const H=this['action']['element']?await this['evaluate'](this['action']['element']):{'type':'scrollable','fallback':{'type':'app'}},A=await this['element'](H);this['throwIfNoElement'](A),await tryMakeElementNotObscured(A,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']});}else{const D=this['action']['direction']??'down',Z=D==='left'||D==='right'?'horizontal':'vertical';let O;if('element'in this['action']){const q=this['action']['element'],z=await this['evaluate']('isElementReference'in q?q:{...q,'hints':{'scrollable':Z,...q['hints']}});O=await this['element'](z);}else O=await this['element']({'type':'scrollable','superlative':'largest','hints':{'scrollable':Z},'fallback':{'type':'app'}});this['throwIfNoElement'](O);const p=O['node'],J=await this['evaluate'](this['action']['times'])??0x1,C=await this['evaluate'](this['action']['distance']);let P=0x0,h=0x0;if(!C){const o=await this['automator']['activePage']['getViewportSize'](),n=await p['getMetrics'](),c=Math['min'](n['clientHeight'],o['height']),U=Math['min'](n['clientWidth'],o['width']);if(D==='up')h=-c;else{if(D==='down')h=c;else{if(D==='left')P=-U;else{if(D==='right')P=U;}}}}else{if(D==='up')h=-C;else{if(D==='down')h=C;else{if(D==='left')P=-C;else{if(D==='right')P=C;}}}}for(let m=0x0;m<J;++m)await p['scrollBy']({'x':P,'y':h});}}}return await this['after'](),{'status':'success'};}},FindHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element'](R);return this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before'](),this['context']['activeElement']=w['node'],await this['after'](),{'status':'found'};}},FocusHandler$1=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element'](R);this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const F=w['node'];if(!await F['focus']())throw new RunnerError('Element\x20is\x20not\x20interactive',{'code':ErrorCode['ELEMENT_NOT_INTERACTIVE']});return this['context']['activeElement']=F,await this['after'](),{'status':'success'};}},CloseHandler=class extends Handler{async['handle'](){if('isDialogDescriptor'in this['action']['element']){const N=this['automator']['activePage']['dialog'];if(!N||N['type']==='filepicker')throw new RunnerError('Native\x20dialog\x20not\x20found',{'code':ErrorCode['NO_DIALOG']});return await this['before'](),await N['handle'](![]),await this['after'](),{'status':'success'};}this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element']);if(isChromeTabDescriptor(R))return this['handleWithChromeTab'](R);const w={...R,'hints':{'type':R['type']?R['type']:'popup'}},F=await this['element'](w);if(!F?.['node']){const e=toChromeTabDescriptor(R);if(e)return this['handleWithChromeTab'](e);}this['throwIfNoElement'](F);const E=F['role']==='close'?F:await this['element']({'hints':{'role':'close'},'anchor':{'position':'inside','element':w}});this['throwIfNoElement'](E),await tryMakeElementNotObscured(E,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const u=E['node'],M=Boolean(E['type']['checkbox']||E['type']['radio']);return await u['click']({'simulate':M,'signal':this['signal']}),await Promise['all']([u['frame']['wait']('stable'),G(0x64)]),this['context']['activeElement']=u,await this['after'](),{'status':'success'};}async['handleWithChromeTab'](R){return await this['before'](),await closeBrowserTab(this['automator'],R),await this['after'](),{'status':'success'};}},CreateTargetHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['action']['url']);return await this['automator']['page']({'url':R??void 0x0}),await this['after'](),{'status':'success'};}},EraseHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element'])??{'state':{'focused':!![]}},w=await this['element']({...R,'state':{...R['state'],'active':!![]}});this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const F=await this['evaluate'](this['action']['size']),E=w['node'];if(!await E['execute']((u,M)=>{if(u instanceof HTMLInputElement&&['text','search','url','tel','password']['includes'](u['type'])||u instanceof HTMLTextAreaElement){if(u===document['activeElement'])u['setSelectionRange'](Math['max'](0x0,u['selectionStart']-M),u['selectionStart']);else u['focus'](),u['setSelectionRange'](Math['max'](0x0,u['value']['length']-M),u['value']['length']);return!![];}return![];},[F]))throw new RunnerError('Element\x20is\x20not\x20a\x20textbox',{'code':ErrorCode['ELEMENT_NOT_TEXTBOX']});return await this['automator']['activePage']['keyboard']['press']('Backspace'),this['context']['activeElement']=E,await this['after'](),{'status':'success'};}},EvaluateHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();try{const R=await this['automator']['activePage']['mainFrame']['defaultEvaluate'](await this['evaluate'](this['action']['js']),{'await':!![]});return this['context']['scope']['public']['js-result']={'value':R},await this['after'](),{'status':'evaluated','meta':{'result':R}};}catch(w){if(w instanceof FlushError)throw w;else throw new RunnerError('Evaluation\x20failed',{'code':ErrorCode['EVALUATION_FAILED'],'error':w,'stack':w['stack']});}}},NavigateHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();if('direction'in this['action']){const R=await this['evaluate'](this['action']['times'])??0x1;await this['automator']['activePage']['navigateThroughHistory'](this['action']['direction']==='forward'?R:-R),log('navigationPerformed',{'kind':'history','historyDirection':this['action']['direction'],'times':R});if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);return await this['after'](),{'status':'navigated'};}else{const w=this['navigateTimeout'],F=await this['evaluate'](this['action']['url']||'');let E=this['action']['relative']||/^\.{0,2}\/|^[^\.\/]+$/['test'](F)?new URL(F,this['automator']['activePage']['url'])['toString']():F;if(/^mock\+/['test'](F))E='https://mock#'+F['replace'](/^mock\+/,'');let u;if(this['action']['headers']&&this['action']['headers']['length']>0x0){const N=await evaluateHeaders(this['action']['headers'],{'evaluate':e=>this['evaluate'](e),'stack':this['stack']});u=Object['fromEntries'](N['headers']);}const M=await(/^(?:data|about):|(?:https?|ftps?|chrome):\/\//['test'](E)?this['automator']['activePage']['navigate'](E,{'timeout':w,'headers':u}):this['automator']['activePage']['navigate']('https://'+E,{'timeout':w,'headers':u})['catch'](e=>this['automator']['activePage']['navigate']('http://'+E,{'timeout':w,'headers':u})['catch'](async()=>Promise['reject'](e))))['catch'](async e=>{await this['automator']['activePage']['cancelNavigation']();throw e;});log('navigationPerformed',{'kind':'url','url':E,'statusCode':M['status']});if(isPdfViewerFrame(this['automator']['activePage']['mainFrame']))await waitForReady(this['automator']['activePage']['mainFrame']);await this['after']();if(!this['shouldNotThrowOnUnexpectedNavigationStatus']){if(this['action']['statuses']!=='*'){const e=[...this['action']['statuses']??[],...this['expectedNavigationStatuses']];if(e['length']>0x0?!e['includes'](M['status']):M['status']<0xc8||M['status']>0x12b)throw new RunnerError('The\x20navigation\x20to\x20url\x20\x22'+F+'\x22\x20resulted\x20with\x20an\x20unexpected\x20status\x20code\x20'+M['status'],{'code':ErrorCode['UNEXPECTED_NAVIGATION_STATUS'],'status':M['status'],'headers':M['headers']});}return{'status':'navigated','meta':{...M}};}else return{'status':'navigated','meta':{...M,'statusExpected':this['action']['statuses']&&(this['action']['statuses']==='*'||this['action']['statuses']['includes'](M['status']))}};}}},GoHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['target']),w={'automator':this['automator'],'context':this['context'],'shouldCapture':this['shouldCapture'],'shouldNotThrowOnUnexpectedNavigationStatus':this['shouldNotThrowOnUnexpectedNavigationStatus'],'expectedNavigationStatuses':this['expectedNavigationStatuses']};return(isUrlString(R)?new NavigateHandler({...w,'instruction':{'type':'navigate','url':R}}):new ScrollHandler$1({...w,'instruction':{'type':'scroll','element':{'title':R}}}))['handle']();}},HitKeyHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const R=this['action']['keys'],w=await this['evaluate'](this['action']['times'])??0x1;for(let F=0x0;F<w;++F)if(['F5','ControlLeft+KeyR']['includes'](R['join']('+')))await this['automator']['activePage']['reload']();else{if(['ControlLeft+F5','ControlLeft+ShiftLeft+KeyR']['includes'](R['join']('+')))await this['automator']['activePage']['reload']({'hard':!![]});else{const E=await this['automator']['activePage']['mainFrame']['execute'](()=>{const u=document['activeElement'];return!!(u instanceof HTMLInputElement&&u['list']&&!['button','reset','submit']['includes'](u['type']));});await this['automator']['activePage']['keyboard']['press'](R,{'raw':E});}}return await this['after'](),{'status':'success'};}},HoverHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element']({...R,'state':{...R['state'],'active':!![]}});this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const F=w['node'];return await F['hover']({'signal':this['signal']}),this['context']['activeElement']=F,await this['after'](),{'status':'success'};}},NavigatePdfHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize'](),await this['before']();const R=await this['evaluate'](this['action']['page']);if(!isPdfViewerFrame(this['automator']['activePage']['mainFrame']))throw new RunnerError('Cannot\x20navigate\x20to\x20a\x20PDF\x20page:\x20the\x20active\x20page\x20is\x20not\x20a\x20PDF\x20viewer',{'code':ErrorCode['NOT_PDF_VIEWER']});const {pageCount:w,resolvedPage:F}=await this['automator']['activePage']['mainFrame']['defaultExecute'](E=>{const u=globalThis['nlpPdfState'];if(!u)return{'pageCount':0x0,'resolvedPage':0x0};const {viewer:M}=u,N=E<0x0?M['pagesCount']+E+0x1:E;if(N<0x1||N>M['pagesCount'])return{'pageCount':M['pagesCount'],'resolvedPage':N};return M['currentPageNumber']=N,{'pageCount':M['pagesCount'],'resolvedPage':N};},[R]);if(F<0x1||F>w)throw new RunnerError('PDF\x20page\x20'+R+'\x20is\x20out\x20of\x20range',{'code':ErrorCode['PDF_PAGE_OUT_OF_RANGE'],'page':R,'pageCount':w});return await this['after'](),{'status':'success'};}},RefreshHandler=class extends Handler{async['handle'](){return this['throwIfBlocked'](),await this['stabilize'](),await this['before'](),await this['automator']['activePage']['reload']({'hard':this['action']['value']==='hard'}),await this['after'](),{'status':'success'};}},SearchHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['element'])??{'type':'textbox','title':'search'},w=await this['element']({...R,'type':[R['type']??[],'textbox']['flat']()});this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const F=await this['evaluate'](this['action']['value']||''),E=w['node'];return await this['throwIfCannotTypeToElement'](E),await E['focus'](),await this['automator']['activePage']['keyboard']['type'](F),await this['automator']['activePage']['keyboard']['press']('Enter'),this['context']['activeElement']=E,await this['after'](),{'status':'success'};}};function formatDateTimeForInput(R,w){if(w==='time'&&R['match'](/^\d{2}:\d{2}(:\d{2})?$/))return R;const F=/(\d{4}-\d{2}-\d{2})T?(\d{2}:\d{2})?:?(\d{2})?/;if(F['test'](R))R=R['trim']()['endsWith']('Z')?R:R+'Z';else R+='\x20UTC';const E=new Date(R)['toISOString'](),u=E['match'](F);if(!u)return E;const M=u[0x1],N=parseInt(u[0x3]),e=N?u[0x2]+':'+N:u[0x2];if(w==='date')return M;if(w==='time')return e;return M+'T'+e;}var SetValueHandler=class extends Handler{async['handle'](){this['throwIfBlocked'](),await this['stabilize']();const R=await this['evaluate'](this['action']['value']??'');if(isFileHandle(this['action']['value'])&&this['automator']['activePage']['dialog']?.['type']==='filepicker')await this.#setValueInFilepickerDialog(this['automator']['activePage']['dialog'],R);else{const w=await this['evaluate'](this['action']['element']),F=await this['element']({...w,'type':w['type']??'inputbox'});this['throwIfNoElement'](F),await tryMakeElementNotObscured(F,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before']();const E=F['node'];if(!await E['focus']()&&!await E['execute'](M=>M instanceof HTMLFieldSetElement))throw new RunnerError('Element\x20is\x20not\x20interactive',{'code':ErrorCode['ELEMENT_NOT_INTERACTIVE']});const u=await E['execute'](M=>{if(M instanceof HTMLFieldSetElement||M instanceof HTMLSelectElement)return'selectable';else{if(M instanceof HTMLInputElement&&M['type']==='color')return'colorpicker';else{if(M instanceof HTMLInputElement&&M['type']==='date')return'datepicker';else{if(M instanceof HTMLInputElement&&M['type']==='time')return'timepicker';else{if(M instanceof HTMLInputElement&&M['type']==='datetime-local')return'datetimepicker';else{if(M instanceof HTMLInputElement&&M['type']==='file')return'filepicker';else return'inputbox';}}}}}});if(u==='selectable')await this.#setValueInSelectable(E,R);else{if(u==='colorpicker')await this.#setValueInColorPicker(E,R);else{if(u==='datepicker')await this.#setValueInDatePicker(E,R);else{if(u==='timepicker')await this.#setValueInTimePicker(E,R);else{if(u==='datetimepicker')await this.#setValueInDateTimePicker(E,R);else await E['setValue'](R);}}}}this['context']['activeElement']=E;}return await this['after'](),{'status':'success'};}async #setValueInSelectable(R,w){if(isRandomValue(this['action']['value'])&&this['action']['value']['type']==='number'){const F=await R['execute'](E=>{if(E instanceof HTMLSelectElement)return E['options']['length'];else{if(E instanceof HTMLFieldSetElement)return E['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')['length'];else return 0x0;}});w=Math['floor'](w*F);}if(!await R['execute'](async(E,u)=>{if(E instanceof HTMLSelectElement){let M;if(typeof u==='number')M=E['options'][u];else{if(typeof u==='string'){const N=Array['prototype']['find']['bind'](E['options']),e=String(u)['toLowerCase']();M=N(l=>[l['value']['toLowerCase'](),l['textContent']['toLowerCase']()]['includes'](e))??N(l=>l['text']['toLowerCase']()['includes'](e));}}if(M)return M['selected']=!![],E['dispatchEvent'](new Event('input',{'bubbles':!![],'composed':!![]})),E['dispatchEvent'](new Event('change',{'bubbles':!![]})),!![];}else{if(E instanceof HTMLFieldSetElement){let l;if(typeof u==='number')l=E['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')[u];else{if(typeof u==='string'){const Y=u['toLowerCase'](),I=Array['from'](E['querySelectorAll']('input[type=\x22radio\x22],input[type=\x22checkbox\x22]')),f=[t=>t===Y,t=>t['startsWith'](Y),t=>t['includes'](Y)];for(const t of f)l=I['find'](W=>Array['from'](W['labels']??[])['some'](i=>i['innerText']&&t(i['innerText']['toLowerCase']()))||t(W['value']?.['toLowerCase']()));}}if(l)return l['checked']=!![],l['dispatchEvent'](new Event('input',{'bubbles':!![],'composed':!![]})),l['dispatchEvent'](new Event('change',{'bubbles':!![]})),!![];}}return![];},[w],{'await':!![]}))throw new RunnerError('desired\x20option\x20'+JSON['stringify'](w)+'\x20was\x20not\x20found',{'code':ErrorCode['NO_OPTION'],'value':w});}async #setValueInColorPicker(R,w){const {r:F,g:E,b:u}=stringToColorOrThrow(w),M='#'+Number(F)['toString'](0x10)['padStart'](0x2,'0')+Number(E)['toString'](0x10)['padStart'](0x2,'0')+Number(u)['toString'](0x10)['padStart'](0x2,'0');await R['setValue'](M);}async #setValueInDatePicker(R,w){await R['setValue'](formatDateTimeForInput(w,'date'));}async #setValueInTimePicker(R,w){await R['setValue'](formatDateTimeForInput(w,'time'));}async #setValueInDateTimePicker(R,w){await R['setValue'](formatDateTimeForInput(w,'datetime'));}async #setValueInFilepickerDialog(R,w){await R['handle']([w]);}},SwitchHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=await this['evaluate'](this['action']['element']);if(isChromeTabDescriptor(R))return this['handleWithChromeTab'](R);const w=await this['element']({...R,'state':{...R['state'],'active':!![]},'hints':{'type':'button',...R['hints']}});if(!w?.['node']){const F=toChromeTabDescriptor(R);if(F)return this['handleWithChromeTab'](F);}return this['throwIfNoElement'](w),await tryMakeElementNotObscured(w,{'timeout':this['findTimeout']??0x2710,'signal':this['signal']}),await this['before'](),await w['node']['click']({'signal':this['signal']}),await Promise['all']([w['node']['frame']['wait']('stable'),G(0x64)]),this['context']['activeElement']=w['node'],await this['after'](),{'status':'success'};}async['handleWithChromeTab'](R){return await this['before'](),await activateBrowserTab(this['automator'],R),await this['after'](),{'status':'success'};}},CheckHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element']({...R,'type':R['type']??'checkbox'});this['throwIfNoElement'](w),await this['before']();const F=w['state']['checked']??![];if(typeof this['action']['value']!=='boolean'||F!==this['action']['value'])await w['node']['click']();return await this['after'](),{'status':'success'};}},ClickHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element']({...R,'state':{...R&&'state'in R?R['state']:{},'active':!![]},'hints':{'type':'button'}});return this['throwIfNoElement'](w),this['handleWithElement'](w);}async['handleWithElement'](R){await this['before']();const {times:w}=this['action'];return await R['node']['click']({'times':w}),await sleep(0x64),await this['after'](),{'status':'success'};}},FindHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element'](R);return this['throwIfNoElement'](w),await this['before'](),await this['after'](),{'status':'found'};}},FocusHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=await this['evaluate'](this['action']['element']),w=await this['element'](R);return this['throwIfNoElement'](w),await this['before'](),await w['node']['focus'](),await this['after'](),{'status':'success'};}},ScrollHandler=class extends Handler{async['handle'](){await this['stabilize'](),await this['before']();throw new RunnerError('Scroll\x20action\x20is\x20not\x20supported\x20on\x20mobile\x20yet',{'code':ErrorCode['NOT_IMPLEMENTED']});}},TypeHandler=class extends Handler{async['handle'](){await this['stabilize']();const R=stringify(await this['evaluate'](this['action']['value']??'')),w=await this['evaluate'](this['action']['element'])??(isOTP(this['action']['value'])?{'type':'textbox','title':'code','fallback':{'state':{'focused':!![]}}}:{'state':{'focused':!![]}}),F=await this['element']({...w,'state':{...w&&'state'in w?w['state']:{},'active':!![]},'type':[(w&&'type'in w?w['type']:void 0x0)??[],'textbox']['flat']()});return this['throwIfNoElement'](F),await this['before'](),await this['throwIfCannotTypeToElement'](F['node']),await F['node']['click'](),await F['node']['type'](R),await this['after'](),{'status':'success'};}};const noop={},common={'assert':AssertHandler,'wait':WaitHandler,'empty':EmptyHandler,'comment':EmptyHandler,'fetch':FetchHandler,'set\x20variable':SetVariableHandler,'write\x20file':WriteFileHandler,'remove\x20file':RemoveFileHandler,'visual\x20check':VisualCheckHandler,'intent':IntentHandler,'set\x20preinstructions':DefinePreinstructionsHandler,'drop\x20preinstructions':DefinePreinstructionsHandler,'initialize\x20scope':InitializeScopeHandler,'try':TryHandler,'if':IfHandler,'loop':LoopHandler},web={'check':CheckHandler$1,'clear':ClearHandler,'click':ClickHandler$1,'close':CloseHandler,'create\x20target':CreateTargetHandler,'erase':EraseHandler,'evaluate':EvaluateHandler,'find':FindHandler$1,'focus':FocusHandler$1,'hit\x20key':HitKeyHandler,'hover':HoverHandler,'navigate':NavigateHandler,'navigate\x20pdf':NavigatePdfHandler,'refresh':RefreshHandler,'scroll':ScrollHandler$1,'search':SearchHandler,'set\x20value':SetValueHandler,'switch':SwitchHandler,'type':TypeHandler$1,'visual\x20check':VisualCheckHandler,'go':GoHandler},mobile={'check':CheckHandler,'click':ClickHandler,'find':FindHandler,'focus':FocusHandler,'scroll':ScrollHandler,'type':TypeHandler},handlers={'web':{...noop,...common,...web},'mobile':{...noop,...common,...mobile}};function makeHandler(R){if(!(R['automator']['type']in handlers))throw new Error('The\x20automator\x20type\x20\x22'+R['automator']['type']+'\x22\x20isn\x27t\x20supported');if(!(R['instruction']['type']in handlers[R['automator']['type']]))throw new Error('The\x20instruction\x20type\x20\x22'+R['automator']['type']+'\x22\x20isn\x27t\x20supported\x20with\x20'+R['automator']['type']+'\x20automator');const w=handlers[R['automator']['type']][R['instruction']['type']];return new w(R);}var FlagStore=class extends EventTargetNode{#flags={'pdfViewer':{'description':'Intercept\x20PDF\x20requests\x20and\x20serve\x20the\x20NLP\x20DOM-based\x20viewer\x20instead\x20of\x20the\x20browser\x20PDF\x20viewer','value':![]}};#set(R,w){const F=this.#flags[R]?.['value'];if(w===F)return;this.#flags[R]['value']=w,this['dispatch'](new FlagChangedEvent(R,w,F));}get['pdfViewer'](){return this.#flags['pdfViewer']['value'];}set['pdfViewer'](R){this.#set('pdfViewer',R);}['set'](R){for(const w of Object['keys'](R)){const F=R[w];if(F!==void 0x0)this[w]=F;}}['toJSON'](){return this.#flags;}},FlagChangedEvent=class extends Event{['key'];['value'];['previousValue'];constructor(R,w,F){super('flagChanged'),this['key']=R,this['value']=w,this['previousValue']=F;}};const flags=new FlagStore(),VIEWER_HTML_PATH=new URL('../../assets/index-C5rB_Uzy.html',import.meta.url);function installPdfInterceptor(R){return R['intercept']([{'resource':['Document'],'stage':['response']}],async w=>{if(!flags['pdfViewer']||!(w instanceof InterceptedResponse)||!isPdfResponse(w))return;try{const F=await w['base64'](),E=await getViewerHtml();if(!E['includes']('__NLP_PDF_BYTES__'))throw new Error('viewer\x20HTML\x20is\x20missing\x20the\x20bytes\x20placeholder\x20\x22'+PDF_BYTES_PLACEHOLDER+'\x22');const u=E['replace'](PDF_BYTES_PLACEHOLDER,F);await w['fulfill']({'status':0xc8,'headers':{'content-type':'text/html;\x20charset=utf-8','x-nlp-pdf-viewer':'1'},'body':new TextEncoder()['encode'](u)}),log('pdfInterceptorReplaced',{'url':w['request']['url']});}catch(M){error('pdfInterceptorFailed',{'error':M});}});}function isPdfResponse(R){const w=Object['entries'](R['headers'])['find'](([F])=>F['toLowerCase']()==='content-type')?.[0x1]??'';return/^application\/(?:x-)?pdf\b/i['test'](w);}let viewerHtmlPromise;function getViewerHtml(){if(!viewerHtmlPromise)viewerHtmlPromise=readFile(VIEWER_HTML_PATH,'utf8')['catch'](R=>{viewerHtmlPromise=void 0x0;throw R;});return viewerHtmlPromise;}function makeScope(R){return new Scope(R);}var Scope=class{#storages=new Map();#bindings=[];#global={};#main;#active;get['main'](){return this.#main;}get['active'](){return this.#active;}get['global'](){return this.#global;}get['bindings'](){let R={};for(const w of this.#bindings)R={...R,...w};return R;}get['public'](){let R={...this.#global},w=this.#active;while(w){R={...w['input'],...w['public'],...R},w=w['parent'];}for(const F of this.#bindings)R={...R,...F};return new Proxy(R,{'set':(E,u,M)=>{return this.#throwIfBound(u),this.#storages['forEach'](N=>Reflect['set'](N['public'],u,M)),!![];},'deleteProperty':(E,u)=>{return this.#throwIfBound(u),this.#storages['forEach'](M=>Reflect['deleteProperty'](M['public'],u)),!![];}});}#throwIfBound(R){const w=String(R)['toLowerCase']();if(this.#bindings['some'](F=>w in F))throw new RunnerError('Cannot\x20assign\x20to\x20\x22'+w+'\x22\x20-\x20it\x20is\x20a\x20binding\x20and\x20only\x20its\x20loop\x20can\x20change\x20it',{'code':ErrorCode['ASSIGNMENT_TO_BINDING']});}get['internal'](){let R={},w=this.#active;while(w){R={...w['internal'],...R},w=w['parent'];}return new Proxy(R,{'set':(F,E,u)=>{const M=this.#active;return Reflect['set'](M['internal'],E,u),!![];},'deleteProperty':(F,E)=>{return this.#storages['forEach'](u=>Reflect['deleteProperty'](u['internal'],E)),!![];}});}constructor(R){this.#global=R['global'],this.#main=this['set']('main',R),this.#active=this.#main;}['activate'](R){if(!this.#storages['has'](R))throw new Error('Unknown\x20scope\x20with\x20id\x20\x22'+R+'\x22');this.#active=this.#storages['get'](R);}['initialize'](R){this.#active['input']=Object['fromEntries'](Object['entries'](R['input']??{})['map'](([w,F])=>[w['toLowerCase'](),F])),this.#active['public']=Object['fromEntries'](Object['entries'](R['public']??{})['map'](([w,F])=>[w['toLowerCase'](),F])),this.#active['public']=R['internal'];}['available'](R){return this.#storages['get'](R)?.['parent']===this.#active;}['set'](R,w){const F={'name':R,'parent':R==='main'?null:this.#active,'input':Object['fromEntries'](Object['entries'](w['input']??{})['map'](([E,u])=>[E['toLowerCase'](),u])),'public':Object['fromEntries'](Object['entries'](w['public']??{})['map'](([E,u])=>[E['toLowerCase'](),u])),'internal':w['internal']??{}};return this.#storages['set'](R,F),F;}['bind'](R){const w=Object['fromEntries'](Object['entries'](R)['map'](([F,E])=>[F['toLowerCase'](),E]));return this.#bindings['push'](w),()=>{const F=this.#bindings['indexOf'](w);if(F>=0x0)this.#bindings['splice'](F,0x1);};}['unbindAll'](){this.#bindings=[];}['reset'](){this.#bindings=[],this.#storages=new Map(),this.#main=this['set']('main',{...this.#main,'public':{}}),this.#active=this.#main;}};const connect=buildConnector({'allowH2':!![],'rejectUnauthorized':![]});function makeDispatcher({proxy:R}={}){return R?new Socks5ProxyAgent(R['url'],{'username':R['username'],'password':R['password'],'connect':connect}):new Agent({'connect':connect});}function makePageData({browser:R}){return{get 'url'(){return makeUrlData(R['activePage']['url']);},get 'title'(){return R['activePage']['title'];},get 'language'(){return'';},get 'status'(){return R['activePage']['mainFrame']['response']['status'];},get 'statustext'(){return R['activePage']['mainFrame']['response']['statusText'];},get 'headers'(){const w=R['activePage']['mainFrame']['response']['headers'];return{...Object['fromEntries'](Object['entries'](w)['map'](([F,E])=>[F['toLowerCase'](),E])),[Symbol['for']('get')](F){return this[F['toLowerCase']()];}};},get 'cookies'(){return{};},get 'meta'(){return{};},get 'width'(){return NaN;},get 'height'(){return NaN;},async[Symbol['for']('get')](w){if(w==='title')return R['activePage']['mainFrame']['evaluate']('document.title');else{if(w==='language')return R['activePage']['mainFrame']['evaluate']('document.documentElement.lang');else{if(w==='cookies'){const F=await R['activePage']['getCookies']();return Object['fromEntries'](F['entries']());}else{if(w==='meta')return R['activePage']['mainFrame']['execute'](()=>{const E=document['head']['querySelectorAll']('meta[name],\x20meta[property]');return Array['from'](E)['reduce']((u,M)=>{const N=M['getAttribute']('property')||M['name'];if(N)u[N]=M['content']??'';return u;},{});});else{if(w==='width')return R['activePage']['mainFrame']['evaluate']('document.scrollingElement.scrollWidth');else{if(w==='height')return R['activePage']['mainFrame']['evaluate']('document.scrollingElement.scrollHeight');else return this[w];}}}}}}};}function makePdfData({browser:R}){const w={get 'name'(){return'';},get 'pagecount'(){return 0x0;},get 'currentpage'(){return 0x0;},async[Symbol['for']('get')](F){const E=F['toLowerCase']();if(E==='name')return R['activePage']['mainFrame']['defaultExecute'](()=>document['title']);else{if(E==='pagecount')return R['activePage']['mainFrame']['defaultExecute'](()=>globalThis['nlpPdfState']?.['viewer']?.['pagesCount']??0x0);else{if(E==='currentpage')return R['activePage']['mainFrame']['defaultExecute'](()=>globalThis['nlpPdfState']?.['viewer']?.['currentPageNumber']??0x0);}}}};return{get 'value'(){const F=R['activePage']?.['mainFrame'];if(!F||!isPdfViewerFrame(F))return null;return w;}};}var AXTreeExtractedEvent=class AXTreeExtractedEvent extends Event{['tree'];['at'];constructor(R,w){super('axTreeExtracted'),this['tree']=R,this['at']=w;}['clone'](){return new AXTreeExtractedEvent(this['tree'],this['at']);}};const TOKEN_BOUNDARY_PATTERN=/[^a-zA-Z0-9]+|(?<=[a-z])(?=[A-Z])/,INDICATOR_TOKEN_PATTERN=/^(?:spin(?:ner|ning)?|(?:pre)?load(?:ing|er)|progress(?:bar)?|wait(?:ing)?|busy)$/i;function isPageSpinnerVisible(R){return R['popups']['some'](nodeHasSpinnerIndicators);}function nodeHasSpinnerIndicators(R){const w=R['attributes'];if(w){if(w['role']==='status'||w['role']==='progressbar'||w['aria-busy']==='true')return!![];if(hasIndicatorToken(w['class'])||hasIndicatorToken(w['id']))return!![];}return hasIndicatorToken(R['text'])||hasIndicatorToken(R['visibleLabel'])||hasIndicatorToken(R['declarativeLabel']);}function hasIndicatorToken(R){if(!R)return![];return R['split'](TOKEN_BOUNDARY_PATTERN)['some'](w=>INDICATOR_TOKEN_PATTERN['test'](w));}function parseIOSFrame(R){if(!R)return{'x':0x0,'y':0x0,'width':0x0,'height':0x0};const w=R['match'](/\{\{([\d.]+),\s*([\d.]+)\},\s*\{([\d.]+),\s*([\d.]+)\}\}/);if(!w)return{'x':0x0,'y':0x0,'width':0x0,'height':0x0};return{'x':parseFloat(w[0x1]),'y':parseFloat(w[0x2]),'width':parseFloat(w[0x3]),'height':parseFloat(w[0x4])};}function makeIOSNode(R){return new IOSNode(R);}var IOSNode=class{['handle'];#connection;constructor({connection:R,handle:w}){this.#connection=R,this['handle']=w;}async['equal'](R){return this===R;}async['click'](R){await this.#connection['sendGesture']({'type':R?.['times']===0x2?'doubleTap':'tap','target':{'type':'element','elementSnapshot':this['handle']},'parameters':{'taps':R?.['times']??0x1}});}async['focus'](){return await this['click'](),!![];}async['type'](R){await this.#connection['sendGesture']({'type':'typeText','target':{'type':'element','elementSnapshot':this['handle']},'parameters':{'text':R}});}async['isContentEditable'](){return![];}async['setCaretPosition'](R){}async['canTypeInto'](){return!![];}async['getBox'](){return parseIOSFrame(this['handle']['Frame']);}async['getScreenBox'](){return this['getBox']();}async['getContentBoxes'](){return[parseIOSFrame(this['handle']['Frame'])];}async['isVisible'](){return!![];}async['getText'](){return this['handle']['Value']||this['handle']['Label']||'';}async['getValue']({hint:hint='string'}={}){if(hint==='boolean'){if(this['handle']['ElementType']==='XCUIElementTypeSwitch')return String(this['handle']['Value'])==='1';}return this['handle']['Value'];}async['isEnabled'](){return this['handle']['Enabled']??null;}async['isHovered'](){return null;}async['getObscurationInfo'](){return{'ratio':0x0};}async['getDescription'](){return'';}},Device=class{['type']='mobile';['connection'];['blocked']=![];constructor({connection:R}){this['connection']=R;}async['stabilize'](R,w){}async['captureScreenshot'](R){return this['connection']['getScreenshot']();}async['extractFlatAXTree'](){const R=await this['connection']['extractFlatAXTree'](),w={...R,'nodes':[]};for(const F of R['nodes'])w['nodes']['push']({...F,'node':makeIOSNode({'connection':this['connection'],'handle':F['node']})});return w;}};const extractAXTree$1=makeBundledScript({'name':'extractAXTree','url':new URL('../../assets/extract-ax-tree-BoQlk00-.js',import.meta.url)}),extractPdfAXTree=makeBundledScript({'name':'extractPdfAXTree','url':new URL('../../assets/extract-pdf-ax-tree-DFauJ1eB.js',import.meta.url)});makeBundledScript({'name':'wipeOriginStorage','url':new URL('../../assets/wipe-origin-storage-CF1Vf2FY.js',import.meta.url)}),makeBundledExpression({'name':'recorder','url':new URL('../../assets/recorder-YUoRBu4F.js',import.meta.url)}),makeBundledExpression({'name':'sessionReplay','url':new URL('../../assets/session-replay-BbzxeL6s.js',import.meta.url)});const version$2='1.7.1';function coversViewport(R){const w=new Rectangle(0x0,0x0,R['tree']['viewport']['width'],R['tree']['viewport']['height']);return(R['borderRect']['intersection'](w)?.['area']??0x0)/w['area']>=0.9;}var AXNodeView=class AXNodeView extends EventTarget$1{['_tree'];['_nodes']=[];['debugLog'];['_parent']=null;['_children']=[];['_host']=null;['_popup']=null;['_panel']=null;['_backgroundRoot']=null;['_stackingContextRoot']=null;['_overflowRoot']=null;['_controlNodes']=[];['_type']={};['_state']={};['_style']={};['_options'];['_text']='';['_visibleLabel']='';['_geometricLabel'];['_declarativeLabel']='';['_visibleDescription']='';['_declarativeDescription']='';['_attributes']=Object['create'](null);['_isStackingContextRoot']=![];['_elevation']=0x0;['_borderRect'];['_contentRect'];['_scrollable'];['_role'];['depth']=-0x1;['pre']=-0x1;['post']=-0x1;['rowCells'];['colCells'];['rows'];['columns'];get['tree'](){return this['_tree'];}get['node'](){return this['_nodes'][0x0];}get['incorporated'](){return this['_nodes'];}get['parent'](){return this['_parent'];}get['host'](){return this['_host'];}get['popup'](){return this['_popup'];}get['card'](){return this['_panel'];}get['backgroundRoot'](){return this['_backgroundRoot'];}get['controlNodes'](){return this['_controlNodes'];}get['stackingContextRoot'](){return this['_stackingContextRoot'];}get['overflowRoot'](){return this['_overflowRoot'];}get['children'](){return this['_children'];}get['disconnected'](){return!this['parent']?.['children']['includes'](this);}get['invisible'](){return this['style']['opacity']===0x0||this['_style']['hidden']||this['borderRect']['width']<=0x1&&this['borderRect']['height']<=0x1;}get['transparent'](){return!this['type']['image']&&!this['_style']['backgroundColor'];}get['appearance'](){return!this['style']['hidden']&&(!this['transparent']||this['hasBorder']);}get['inViewport'](){return new Rectangle(0x0,0x0,this['tree']['viewport']['width'],this['tree']['viewport']['height'])['intersects'](this['borderRect']);}get['type'](){return this['_type'];}get['state'](){return this['_state'];}get['style'](){return this['_style'];}get['options'](){return this['_options'];}get['text'](){return this['_text'];}get['visibleLabel'](){return this['_visibleLabel'];}get['geometricLabel'](){return this['_geometricLabel'];}get['declarativeLabel'](){return this['_declarativeLabel'];}get['visibleDescription'](){return this['_visibleDescription'];}get['declarativeDescription'](){return this['_declarativeDescription'];}get['titles'](){return{...this['_text']?{'text':this['_text']}:{},...this['_visibleLabel']?{'visibleLabel':this['_visibleLabel']}:{},...this['_geometricLabel']?{'geometricLabel':this['_geometricLabel']}:{},...this['_declarativeLabel']?{'declarativeLabel':this['_declarativeLabel']}:{}};}get['attributes'](){return this['_attributes'];}get['isStackingContextRoot'](){return this['_isStackingContextRoot'];}get['elevation'](){return this['_elevation'];}get['borderRect'](){return this['_borderRect'];}get['visibleBorderRect'](){if(!this['_overflowRoot'])return this['borderRect'];return this['borderRect']['intersection'](this['_overflowRoot']['contentRect'])??new Rectangle(this['borderRect']['x'],this['borderRect']['y'],0x0,0x0);}get['contentRect'](){return this['_contentRect'];}get['scrollable'](){return this['_scrollable'];}get['role'](){return this['_role'];}get['rects'](){return{'border':this['_borderRect'],'content':this['_contentRect']};}get['hasBorder'](){return this['_style']['border']&&this['_style']['border']['length']>0x0;}get['isContrastingToBackground'](){return this['_style']['backgroundColor']!=null||!!this['type']['image'];}get['computedBackground'](){if(this['_style']['backgroundColor'])return this['_style']['backgroundColor'];if(this['type']['image'])return'image';if(this['_backgroundRoot']){if(this['_backgroundRoot']['type']['image'])return'image';return this['_backgroundRoot']['style']['backgroundColor']??null;}return null;}get['isVisuallySeparated'](){return this['isContrastingToBackground']||this['hasBorder'];}get['isOpaque'](){if(this['transparent'])return![];const R=0.9;return(this['style']['backgroundColor']?.['a']??0x1)>=R||(this['_style']['opacity']??0x1)>=R;}constructor(R){super(),this['_tree']=R;}*['ancestors']({up:R}={}){R??=F=>F['parent'];let w=R(this);while(w){yield w,w=R(w);}}*['descendants']({dead:R,leaf:w}={}){const F=[...this['children']];while(F['length']>0x0){const E=F['shift']();if(R?.(E))continue;yield E;if(!w?.(E))F['push'](...E['children']);}}*['nodes']({dead:R,leaf:w}={}){const F=[this];while(F['length']>0x0){const E=F['shift']();if(R?.(E))continue;yield E;if(!w?.(E))F['push'](...E['children']);}}['ancestor'](R){for(const w of this['ancestors']())if(R(w))return w;return null;}['lca'](...R){let w=this,F=R['reduce']((u,M)=>{if(M['depth']<w['depth'])u['push'](w),w=M;else u['push'](M);return u;},[]),E=w;while(E){F=F['filter'](u=>!E['contains'](u));if(F['length']===0x0)return E;else E=E['parent'];}return E;}['contains'](R){return this['pre']<R['pre']&&this['post']>R['post'];}['precedes'](R){return this['pre']<R['pre'];}['follows'](R){return this['pre']>R['pre'];}['beneath'](...R){const w=[this,...this['ancestors']({'up':F=>F['stackingContextRoot']})];return R['some'](F=>{if(this===F)return![];if(F['contains'](this))return![];if(this['contains'](F))return F['borderRect']['contains'](this['borderRect'])&&(F['borderRect']['area']>this['borderRect']['area']||F['borderRect']['width']>=F['tree']['viewport']['width']&&F['borderRect']['height']>=F['tree']['viewport']['height']);if(!coversViewport(F)){const e=this['borderRect']['intersection'](F['borderRect']);if(!e||e['area']/this['borderRect']['area']<0.5)return![];}const E=[F,...F['ancestors']({'up':l=>!w['includes'](l)?l['stackingContextRoot']:null})];let u,M;const N=w['lastIndexOf'](E['at'](-0x1));N===-0x1?(u=w['at'](-0x1),M=E['at'](-0x1)):(u=w[N-0x1],M=E['at'](-0x2));if(u['elevation']<M['elevation'])return!![];else{if(u['elevation']===M['elevation']){if(u['precedes'](M))return!![];}}});}['distance'](R){const w=this['lca'](R);if(!w)return Infinity;return this['depth']-w['depth']+R['depth']-w['depth'];}['toJSON'](){return{'type':this['_type'],'text':this['_text'],'visibleLabel':this['_visibleLabel'],'geometricLabel':this['geometricLabel'],'declarativeLabel':this['_declarativeLabel'],'visibleDescription':this['_visibleDescription'],'declarativeDescription':this['_declarativeDescription'],'attributes':this['_attributes'],'state':this['_state'],'style':this['_style'],'options':this['_options']?.['map'](({node:R,...w})=>w),'borderRect':this['_borderRect']?{'x':this['_borderRect']['x'],'y':this['_borderRect']['y'],'width':this['_borderRect']['width'],'height':this['_borderRect']['height']}:void 0x0,'elevation':this['_elevation'],'scrollable':this['_scrollable'],'role':this['_role'],'children':this['_children']['map'](R=>R['toJSON']()),'debugLog':this['debugLog']};}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){return'AXNode\x20'+F({'node':this['node']??{[Symbol['for']('nodejs.util.inspect.custom')]:(E,u)=>{const M=Object['keys'](this['type']),N=M['length']>0x0?M['reduce']((e,l)=>this['type'][l]>this['type'][e]?l:e):'unknown';return u['stylize']('<'+N+'\x20/>','special');}},'attributes':this['attributes'],'type':this['type'],'titles':this['titles'],'state':this['state'],'style':this['style']},{...w,'compact':!![],'breakLength':Infinity});}static['fromJSON'](R,w,F){const E=new AXNodeView(R);E['_parent']=F,E['_type']=w['type']??{},E['_text']=w['text']??'',E['_visibleLabel']=w['visibleLabel']??'',E['_geometricLabel']=w['geometricLabel']??'',E['_declarativeLabel']=w['declarativeLabel']??'',E['_visibleDescription']=w['visibleDescription']??'',E['_declarativeDescription']=w['declarativeDescription']??'',E['_attributes']=w['attributes']??Object['create'](null),E['_state']=w['state']??{},E['_style']=w['style']??{},E['_options']=w['options'];w['borderRect']&&(E['_borderRect']=new Rectangle(w['borderRect']['x'],w['borderRect']['y'],w['borderRect']['width'],w['borderRect']['height']),E['_contentRect']=E['_borderRect']);if(w['elevation']!==void 0x0)E['_elevation']=w['elevation'];if(w['scrollable'])E['_scrollable']=w['scrollable'];if(w['role'])E['_role']=w['role'];if(w['debugLog'])E['debugLog']=w['debugLog'];return E['_children']=(w['children']??[])['map'](u=>AXNodeView['fromJSON'](R,u,E)),E;}},AXTreeView=class AXTreeView{['_viewport'];['_direction'];['_version'];['_root'];['_hosts']=[];['_popups']=[];['_collected']=[];['_nodeCount']=0x0;['_rtree']=new RTree();['_mapping']=new Map();get['viewport'](){return this['_viewport'];}get['direction'](){return this['_direction'];}get['version'](){return this['_version'];}get['root'](){return this['_root'];}get['nodeCount'](){return this['_nodeCount'];}get['hosts'](){return this['_hosts'];}get['popups'](){return this['_popups'];}get['collected'](){return this['_collected'];}constructor(R){this['_viewport']=R['viewport'],this['_direction']=R['direction'],this['_version']=R['version'];}*['nodes'](){yield*this['_root']['nodes']();}['search'](R){return this['_rtree']['search'](R);}['lca']([R,...w]){return R['lca'](...w);}[Symbol['iterator']](){return this['nodes']();}['findByNode'](R){return this['_mapping']['get'](R);}['toJSON'](){return{'viewport':this['_viewport'],'direction':this['_direction'],'version':this['_version'],'root':this['_root']['toJSON'](),'hosts':this['_hosts']['map'](R=>R['toJSON']()),'popups':this['_popups']['map'](R=>R['toJSON']()),'collected':this['_collected']['map'](R=>R['toJSON']())};}[Symbol['for']('nodejs.util.inspect.custom')](R,w,F){let E='';const u=[this['_root']];while(u['length']>0x0){const M=u['shift']();E+='\x20\x20'['repeat'](M['depth'])+F(M,w)+'\x0a',u['unshift'](...M['children']);}return E;}static['fromJSON'](R){const w=new AXTreeView({'viewport':R['viewport'],'direction':R['direction'],'version':R['version']});w['_root']=AXNodeView['fromJSON'](w,R['root'],null),w['_nodeCount']=0x0;for(const F of w['_root']['nodes']()){w['_nodeCount']++;if(F['type']['text']&&F['rects']['border'])w['_rtree']['insert']({'rect':F['borderRect'],'data':F});}return w['_root']['depth']=0x0,orderSubtree(w['_root']),w;}};function orderSubtree(R){let w=0x0,F=0x0;const E=[{'node':R,'visited':![]}];while(E['length']>0x0){const u=E['at'](-0x1);if(!u['visited']){u['node']['pre']=w++;for(let M=u['node']['children']['length']-0x1;M>=0x0;--M){u['node']['children'][M]['depth']=u['node']['depth']+0x1,E['push']({'node':u['node']['children'][M],'visited':![]});}u['visited']=!![];}else u['node']['post']=F++,E['pop']();}}const HOST_STABILITY_TIMEOUT=0x1388;async function extractAXTree(R,w){let F;if(R instanceof Browser)await R['wait']('stable'),F=await extractWebAXTree(R['activePage'],w);else{if(R instanceof Device)F=await extractMobileAXTree(R);else throw new Error('Can\x27t\x20extract\x20ax\x20tree\x20of\x20unknown\x20automator\x20implementation');}return F['version']??=version$2,F;}async function extractWebAXTree(R,w){const F=performance['now'](),E=w?.['debug']||Boolean(process.env.AX_TREE_DEBUG);await R['wait']('stable');if(isPdfViewerFrame(R['mainFrame'])){const M=await extractPdfFlatAXTree(R['mainFrame']);return log('axTreeExtracted',{'kind':'pdf','durationMs':performance['now']()-F}),M;}const u=await extractWebFlatAXTree(R['mainFrame'],{'debug':E});while(u['unaccessibleHosts']['length']>0x0){const N=u['unaccessibleHosts']['shift']();try{const e=u['nodes'][N],l=await e['node']['getContentFrame']();if(l['isAd']){e['type']['ad']=0x1;continue;}await l['wait']('stable',{'signal':AbortSignal['timeout'](HOST_STABILITY_TIMEOUT)});const Y=await extractWebFlatAXTree(l,{'offset':{'index':u['nodes']['length'],'location':{'x':e['contentRect']['x'],'y':e['contentRect']['y']}},'debug':E});Y['nodes']['length']>0x0&&(u['nodes']['push'](...Y['nodes']),u['unaccessibleHosts']['push'](...Y['unaccessibleHosts']),e['children']=[Y['offset']['index']]);}catch(I){log('axTreeExtractionAborted',{'error':I});}}return log('axTreeExtracted',{'kind':'ax','durationMs':performance['now']()-F}),u;}async function extractWebFlatAXTree(R,w){return await R['execute'](extractAXTree$1,[w]);}async function extractPdfFlatAXTree(R){return await R['defaultExecute'](extractPdfAXTree,[],{'await':!![]});}async function extractMobileAXTree(R){return R['extractFlatAXTree']();}var AXSnapshot=class{['collectIdentity']=![];['generation']=0x0;['flatAXTree'];['axTree'];['initFlatAXTree'](R){this['flatAXTree']=R,startCollapseLog();}['initAXTree'](R){this['axTree']=R,++this['generation'],flushCollapseLog(this['generation']);}['toJSON'](){return{'generation':this['generation'],'flatTree':this['flatAXTree']?{...this['flatAXTree'],'nodes':this['flatAXTree']['nodes']['map'](({node:R,...w})=>w)}:void 0x0,'axTree':this['axTree']?.['toJSON']()??void 0x0};}};const axSnapshot=new AXSnapshot(),MAX_LOGGED_COLLAPSES=0xc8,MAX_LOGGED_CANDIDATES=0xf,pendingCollapses=[];let collectingCollapses=![],omittedCollapses=0x0;function startCollapseLog(){pendingCollapses['length']=0x0,omittedCollapses=0x0,collectingCollapses=!![];}function flushCollapseLog(R){collectingCollapses=![];if(pendingCollapses['length']===0x0)return;debug('axTreeNodesCollapsed',{'generation':R,'collapses':pendingCollapses['splice'](0x0),...omittedCollapses>0x0?{'omitted':omittedCollapses}:{}});}debugBus['on']('node-collapsed',R=>{if(!collectingCollapses)return;if(pendingCollapses['length']<MAX_LOGGED_COLLAPSES)pendingCollapses['push'](R['payload']);else++omittedCollapses;}),debugBus['on']('prioritized-candidates',R=>{try{const {descriptor:w,candidates:F,prioritizers:E,reason:u}=R['payload'];debug('axCandidatesPrioritized',{'generation':axSnapshot['generation'],'reason':u,'descriptor':projectDescriptor(w),'candidates':projectPrioritizedCandidates(F['slice'](0x0,MAX_LOGGED_CANDIDATES),E),...F['length']>MAX_LOGGED_CANDIDATES?{'omitted':F['length']-MAX_LOGGED_CANDIDATES}:{}});}catch(M){error('findReasoningEmitFailed',{'error':M});}});var AXOps=class{['automator'];['axProvider'];constructor(R,w){this['automator']=R,this['axProvider']=w;}async['extractTree'](){const R=await extractAXTree(this['automator'],{'debug':axSnapshot['collectIdentity']});axSnapshot['initFlatAXTree'](R);const w=await this['axProvider']['makeAXTree'](R);return axSnapshot['initAXTree'](w),bus['dispatch'](new AXTreeExtractedEvent(w,Date['now']())),w;}async['makeTree'](R){axSnapshot['initFlatAXTree'](R);const w=await this['axProvider']['makeAXTree'](R);return axSnapshot['initAXTree'](w),bus['dispatch'](new AXTreeExtractedEvent(w,Date['now']())),w;}async['findCandidate'](R,w,F){return this['axProvider']['findAXNode'](R,w,F);}async['findCandidates'](R,w,F){if(!this['axProvider']['findAXNodes'])throw new Error('The\x20configured\x20AXProvider\x20does\x20not\x20support\x20listing\x20all\x20candidates');return this['axProvider']['findAXNodes'](R,w,F);}async['searchCandidates'](R,w,F){const E={'useBackwardCompatibleTypeScore':![],...F},u=await this['findCandidates'](R,w,E);if(!w['title']||!w['type'])return u;const {title:M,...N}=w,e=new Set(u['map'](Y=>Y['node'])),l=(await this['findCandidates'](R,N,E))['filter'](Y=>!e['has'](Y['node']));return[...u,...l];}async['describeNode'](R,w){return this['axProvider']['describeAXNode'](R,w);}async['findNode'](R,w){const {stack:F,timeout:timeout=0x0,signal:E,metrics:u}=w,M=this['automator'];bus['dispatch'](new AXNodeSearchStartedEvent({'descriptor':R}));if(R['node']){const f=R['node'];return log('elementFound',{'node':projectAXNode(f),'descriptor':R}),F['node'](R,f),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':R,'node':f})),f;}const N=Date['now'](),e=makeWatcher({'signal':E})['resolve'](void 0x0,{'delay':timeout||0x1}),l=makeWatcher({'signal':E})['resolve']();let Y,I;if(isSelectorElementDescriptor(R)){if(M instanceof Browser)I=async()=>{if(u)u['findStrategy']='selector';const t=u?.['axTreeExtractionMs']??0x0,W=performance['now'](),i=await this.#findWithSelfHealing(R,{'browser':M,'metrics':u});if(u){const K=performance['now']()-W,s=(u['axTreeExtractionMs']??0x0)-t;u['findElementMs']=(u['findElementMs']??0x0)+(K-s);}return i;};else throw new Error('Can\x27t\x20find\x20ax\x20node\x20using\x20selector\x20description\x20with\x20non-web\x20automator');}else I=async()=>{if(u)u['findStrategy']='columbus';const t=performance['now']();Y=await this['extractTree']();u&&(u['axTreeExtractionMs']=(u['axTreeExtractionMs']??0x0)+(performance['now']()-t),u['axTreeExtractionCount']=(u['axTreeExtractionCount']??0x0)+0x1,u['axNodeCount']=Y['nodeCount']);const W=performance['now'](),i=await this.#findWithColumbus(R,Y);if(u)u['findElementMs']=(u['findElementMs']??0x0)+(performance['now']()-W);return i;};while(e['pending']||l['pending']){const t=await abortable(I(),E);if(t)return log('elementFound',{'node':projectAXNode(t),'descriptor':R}),e['resolve'](),l['resolve'](),F['node'](R,t),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':R,'node':t})),t;Y??=await this['extractTree']();if(timeout>0x0){if(isPageSpinnerVisible(Y))!l['pending']&&(bus['dispatch'](new StabilizationWaitStartedEvent()),l['reset']()['resolve'](void 0x0,{'delay':0xea60-(Date['now']()-N)})['finally'](()=>bus['dispatch'](new StabilizationWaitFinishedEvent())));else{if(l['pending'])l['resolve']();}}await abortable(G(0x3e8,{'signal':E}),E);}return log('elementNotFound',{'durationMs':Date['now']()-N,'descriptor':R,'loadingPending':l['pending']}),e['resolve'](),l['resolve'](),bus['dispatch'](new AXNodeSearchFinishedEvent({'descriptor':R})),null;}async['findNodes'](R,w){const {stack:F,timeout:timeout=0x0,signal:E,metrics:u}=w;if(isSelectorElementDescriptor(R))throw new Error('Cannot\x20resolve\x20an\x20element\x20collection\x20from\x20a\x20selector\x20descriptor');if(!this['axProvider']['findAXNodeCollection'])throw new Error('The\x20configured\x20AXProvider\x20does\x20not\x20support\x20resolving\x20an\x20element\x20collection');const M=Date['now']();while(!![]){if(u)u['findStrategy']='columbus';const N=performance['now'](),e=await abortable(this['extractTree'](),E);u&&(u['axTreeExtractionMs']=(u['axTreeExtractionMs']??0x0)+(performance['now']()-N),u['axTreeExtractionCount']=(u['axTreeExtractionCount']??0x0)+0x1,u['axNodeCount']=e['nodeCount']);const l=performance['now'](),Y=await this['axProvider']['findAXNodeCollection'](e,R,{'debug':{'reason':'find-element'}});if(u)u['findElementMs']=(u['findElementMs']??0x0)+(performance['now']()-l);if(Y['length']>0x0||Date['now']()-M>=timeout){const I=Y['map'](f=>f['node']);return I['forEach'](f=>F['node'](R,f)),log('elementCollectionFound',{'descriptor':R,'count':I['length']}),I;}await abortable(G(0x3e8,{'signal':E}),E);}}async #findWithColumbus(R,w){let F=R;while(F){const E=await this['axProvider']['findAXNode'](w,F,{'debug':{'reason':'find-element'}});if(E)return E['node'];F=F['fallback'];}return null;}async #findWithSelfHealing(R,{browser:w,metrics:F}){const E=w['activePage'],u=w['driver'];await u['switchTo']()['window'](E['targetId']);const M=[[]];for(let e=0x0;e<M['length'];++e){const l=M[e-0x1]??[],Y=M[e],I=l['findIndex']((t,W)=>t['element']!==Y[W]['element']);if(I>=0x0){for(const t of l['slice'](I))await u['switchTo']()['parentFrame']();for(const {element:W}of Y['slice'](I))await u['switchTo']()['frame'](W);}else{for(const {element:i}of Y['slice'](l['length']))await u['switchTo']()['frame'](i);}const f=await N(R);if(f){const K=await u['executeScript']('return\x20'+isElementAcceptableInvisible['source']+'(arguments[0])',f);if(await u['executeScript']((s,Q)=>{const {width:k,height:S}=s['getBoundingClientRect']();if(Q||k!==0x0||S!==0x0)return s['setAttribute']('data-webdriver-element-mark',''),!![];return![];},f,K)){let s=E['mainFrame'];for(const {index:H}of Y)s=await(await s['execute'](A=>document['querySelectorAll']('iframe,\x20frame')[A],[H]))['getContentFrame']();const Q=await s['execute'](()=>{const A=[document];for(const D of A){const Z=D['querySelector']('[data-webdriver-element-mark]');if(Z){Z['removeAttribute']('data-webdriver-element-mark');if(Z instanceof SVGElement){let O=Z;while(O['viewportElement'])O=O['viewportElement'];return O;}return Z;}Array['from'](D['querySelectorAll']('*'))['forEach'](p=>{if(p['shadowRoot'])A['push'](p['shadowRoot']);});}throw new Error('Cannot\x20re-find\x20element\x20that\x20was\x20marked\x20using\x20webdriver');}),k=performance['now'](),S=await this['extractTree']();F&&(F['axTreeExtractionMs']=(F['axTreeExtractionMs']??0x0)+(performance['now']()-k),F['axTreeExtractionCount']=(F['axTreeExtractionCount']??0x0)+0x1,F['axNodeCount']=S['nodeCount']);const a=await Q['normalize']();let T;p:for(const A of S['nodes']())for(const D of A['incorporated'])if(await D['equal'](a)){T=A;break p;}if(T){const [Z,O]=await Promise['all']([T['node']['getNodeId'](),Q['getNodeId']()]);if(Z!==O)return log('axNodeViewMismatch',{'descriptor':R}),new Proxy(T,{'get'(p,J){if(J==='node')return Q;return Reflect['get'](p,J);}});else return T;}return null;}}(await u['executeScript'](()=>{return Array['from'](document['querySelectorAll']('iframe,\x20frame'))['reduce']((p,J,C)=>{const {width:P,height:h}=J['getBoundingClientRect']();if(P>0x0&&h>0x0)p['push']({'element':J,'index':C});return p;},[]);}))['forEach'](p=>M['push']([...Y,p]));}return null;async function N(p){const [J,...C]=p['selector']['selector']['split']('>>>')['map'](h=>h['trim']());let P;if(!J)throw new Error('Selector\x20cannot\x20be\x20empty');P=await u['findElement']({[p['selector']['type']]:J})['catch'](()=>null);if(!P)return null;for(const h of C){if(/(?:\.\.\/|\.\/|\*\/|\/|\()/['test'](h))throw new Error('Only\x20CSS\x20selectors\x20are\x20supported\x20after\x20the\x20first\x20segment\x20(after\x20>>>)');P=await P['getShadowRoot']()['then'](async q=>q['findElement']({'css':h}))['catch'](()=>null);if(!P)return null;}return P;}}};function serializeCandidateMetrics(R){const w={};if(R['title'])w['title']={'source':R['title']['source'],'text':R['title']['text'],'pattern':R['title']['pattern'],'coverage':R['title']['partialText'],'startsWith':R['title']['startWith'],'priority':R['title']['priority']};if(R['type'])w['type']={'required':[...R['type']['required']],'hint':[...R['type']['hint']]};if(R['obscured']!=null)w['obscured']=R['obscured'];if(R['color']!=null)w['color']=R['color'];if(R['anchor']&&R['anchor']['length']>0x0)w['anchors']=R['anchor']['map'](F=>({'position':Array['isArray'](F['position'])?F['position']['join'](','):F['position'],'positionType':F['positionType'],'distance':F['distance'],...F['alignment']!=null?{'alignment':F['alignment']}:{},...F['candidate']?.['node']['debugLog']?.['id']!=null?{'anchorId':F['candidate']['node']['debugLog']['id']}:{}}));return Object['keys'](w)['length']>0x0?w:void 0x0;}var version$1='5.18.0',version='5.18.0';async function makeRunner(R){if(R['logger'])eventLogger['downstream']=R['logger'];if(R['automator'])return new Runner({...R,'automator':R['automator']});else{if(R['browser'])return new Runner({...R,'automator':R['browser']});else{if(R['debuggerAddress']){const w=await makeBrowser({'debuggerAddress':R['debuggerAddress'],'driver':R['driver']});return new Runner({...R,'automator':w});}else{if(R['driver']){const F=await makeBrowser({'driver':R['driver']});return new Runner({...R,'automator':F});}}}}}var Runner=class extends EventTargetNode{#automator;#context;#statuses=[];#shouldRunPreinstructions=!![];#pdfInterceptorInstalled;get['__context'](){return this.#context;}get['automator'](){return this.#automator;}get['flags'](){return flags['toJSON']();}get['browser'](){return this.#automator instanceof Browser?this.#automator:void 0x0;}get['parameters'](){return this.#context['scope']['main']['input'];}set['parameters'](R){this.#context['scope']['main']['input']=Object['fromEntries'](Object['entries'](R)['map'](([w,F])=>[w['toLowerCase'](),F]));}get['variables'](){return this.#context['scope']['public'];}get['globals'](){return this.#context['scope']['global'];}get['bindings'](){return this.#context['scope']['bindings'];}set['variables'](R){this.#context['scope']['active']['public']=Object['fromEntries'](Object['entries'](R)['map'](([w,F])=>[w['toLowerCase'](),F]));}get['status'](){return this.#statuses[0x0];}constructor(R){super(),this.#automator=R['automator'];if(R['flags'])flags['set'](R['flags']);this.#context={'axOps':new AXOps(R['automator'],R['axProvider']),'scope':makeScope({'global':{...this['browser']?{'page':{'value':makePageData({'browser':this['browser']})},'pdf':makePdfData({'browser':this['browser']})}:{},...R['globals']},'input':Object['fromEntries'](Object['entries'](R['parameters']??{})['map'](([w,F])=>[w['toLowerCase'](),F])),'public':{},'internal':{...Object['fromEntries'](Object['entries'](R['timeouts']??{})['map'](([w,F])=>[w,{'value':F}])),...R['shouldSkipInitialNavigationInNestedScope']!==void 0x0?{'shouldSkipInitialNavigationInNestedScope':{'value':R['shouldSkipInitialNavigationInNestedScope']}}:{},...R['shouldSkipAssertionsInNestedScope']!==void 0x0?{'shouldSkipAssertionsInNestedScope':{'value':R['shouldSkipAssertionsInNestedScope']}}:{},...R['loopIterationLimit']!==void 0x0?{'loopIterationLimit':{'value':R['loopIterationLimit']}}:{}}}),'actions':{...R['actions']},...R['screenshot']?{'screenshot':R['screenshot']}:{},'dispatcher':makeDispatcher({'proxy':R['proxy']}),'preinstructions':[]};if(R['shouldHideFilepickerDialogs'])this['browser']['hideFilepickers'](!![]);this['browser']&&(this.#pdfInterceptorInstalled=installPdfInterceptor(this['browser'])['catch'](w=>{error('pdfInterceptorInstallFailed',{'error':w});}),this['browser']['on']('stabilizingNavigation',({done:w})=>bus['dispatch'](w?new NavigationWaitFinishedEvent():new NavigationWaitStartedEvent())),this['browser']['on']('stabilizingLoad',({done:w})=>bus['dispatch'](w?new LoadWaitFinishedEvent():new LoadWaitStartedEvent())),this['browser']['on']('stabilizingOutgoingRequests',({done:w})=>bus['dispatch'](w?new OutgoingRequestsWaitFinishedEvent():new OutgoingRequestsWaitStartedEvent()))),this['on']('listenerAdded',async({event:w,count:F})=>{if(w==='filepickerDialogRequested'&&F===0x1)try{const E=await this['browser']?.['filepicker'](async u=>{this['dispatch'](new RunnerFilepickerDialogRequestedEvent(u));});this['on']('listenerRemoved',({event:u,count:M})=>{if(u==='filepickerDialogRequested'&&M===0x0)E();});}catch(u){log('filepickerAutoSetupFailed',{'error':u});}}),bus['on']('log',w=>w['component']==='runner'&&this['dispatch'](w['clone']())),bus['on']('axTreeExtracted',w=>this['dispatch'](w['clone']())),bus['on']('progress',w=>{const F=this['status'];if(w['done']){this.#statuses['splice'](this.#statuses['indexOf'](w['status']),0x1);if(w['status']==='searchingForElement'&&w['node'])this['dispatch'](new RunnerAXNodeFoundEvent(w['node']));}else this.#statuses['unshift'](w['status']);if(this['status']&&F!==this['status'])this['dispatch'](new RunnerStatusChangedEvent({'previousStatus':F,'status':this['status']}));});}async['run'](R,w={}){let F;if(typeof R==='string'){const [e]=parseText(R);if(e['error']){const l={'references':new Map(),'extractors':new Map(),'operands':new Map()};return{'status':'error','error':e['error']['message']??'Failed\x20to\x20parse\x20instruction:\x20'+e['text'],'code':ErrorCode['MESSAGE_PARSING'],'meta':{'pos':e['error']['pos'],'text':e['error']['text']},'results':[],'values':l};}F=e['result'];}else{if(Array['isArray'](R))F=R;else F=unseal(R);}if(!w['runningPreinstructions']){this.#statuses=[],this.#shouldRunPreinstructions=!![],this.#context['scope']['unbindAll']();if(!w['loop'])this.#context['loops']?.['clear']();}if(this.#pdfInterceptorInstalled)await this.#pdfInterceptorInstalled;const E=Date['now']();log('runStarted',{'runnerVersion':version$1,'parserVersion':version,'nodeVersion':process['version']}),log('instructionExecutionStarted',{'instructions':F,'stepIndex':w['stepIndex']}),bus['dispatch'](new InstructionExecutionStartedEvent({'preStep':w['runningPreinstructions']}));const u=[],M={'references':new Map(),'extractors':new Map(),'operands':new Map()};if(w['loop'])await openLoopBindings(w['loop'],{'context':this.#context,'stack':makeValuesStack(),'automator':this.#automator,'signal':w['signal']});const N=F['map'](Y=>({'instruction':Y,'shouldFailOnError':!![]}));while(N['length']>0x0){const {instruction:Y,shouldFailOnError:I}=N['shift'](),f=Date['now']();log('subinstructionExecutionStarted',{'instruction':Y,'correlationId':w['correlationId']});const t=await this['handle'](Y,w);debug('instructionResultHandled',{'status':t['status'],'code':t['status']==='error'?t['code']:void 0x0}),Object['assign'](t,{'at':f,'durationMs':Date['now']()-f}),u['push'](t);if(t['status']==='tried')N['unshift'](...t['meta']['next']['map'](i=>({'instruction':i,'shouldFailOnError':![]})));else{if(t['status']==='preinstructions\x20defined')this.#context['preinstructions']=t['meta']['preinstructions'];else{if(t['status']==='condition\x20evaluated'){if(t['meta']['next'])N['unshift'](...t['meta']['next']['map'](i=>({'instruction':i,'shouldFailOnError':!![]})));}else{if(t['status']==='looped'){if(t['meta']['next'])N['unshift'](...t['meta']['next']['map'](i=>({'instruction':i,'shouldFailOnError':!![]})),{'instruction':Y,'shouldFailOnError':I});}}}}const W=Date['now']();log('subinstructionExecutionFinished',{'instruction':Y,'duration':W-f,'status':t['status'],'errorcode':t['status']==='error'?t['code']:void 0x0,'metrics':t['metrics']});t['status']!=='skipped'&&(t['values']['references']['forEach']((i,K)=>M['references']['set'](K,i)),t['values']['extractors']['forEach']((i,K)=>M['extractors']['set'](K,i)),t['values']['operands']['forEach']((i,K)=>M['operands']['set'](K,i)));if(t['status']==='error'){if(!I)break;return log('instructionExecutionFinished',{'instructions':F,'duration':W-E,'status':t['status'],'errorcode':t['code']}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':w['runningPreinstructions']})),{'status':'error','error':t['error'],'code':t['code'],'meta':t['meta'],'results':u,'values':M};}else{if(t['status']==='aborted')return log('instructionExecutionFinished',{'instructions':F,'duration':W-E,'status':t['status']}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':w['runningPreinstructions']})),{'status':'aborted','results':u,'values':M};}}return log('instructionExecutionFinished',{'instructions':F,'duration':Date['now']()-E,'status':'success'}),bus['dispatch'](new InstructionExecutionFinishedEvent({'preStep':w['runningPreinstructions']})),{'status':'success','results':u,'values':M};}async['handle'](R,w={}){const F=getInstructionText(R);if(this.#context['scope']['active']['parent']){const E=this.#context['scope']['internal']['shouldSkipAssertionsInNestedScope']?.['value'],u=this.#context['scope']['internal']['forceRunningAssertions']?.['value'];if(E&&u!=='all'){if(R['type']==='assert'){if(!u||u!=='nonvisual')return{'status':'skipped','text':F};}else{if(R['type']==='visual\x20check'){if(!u||u!=='visual')return{'status':'skipped','text':F};}}}const M=this.#context['scope']['internal']['shouldSkipInitialNavigationInNestedScope']?.['value'],N=this.#context['scope']['internal']['forceRunningNavigation']?.['value'];if(w['stepIndex']===0x0&&M&&N!=='all'){if(R['type']==='navigate')return{'status':'skipped','text':F};}}return!R['type']['includes']('preinstruction')&&this.#shouldRunPreinstructions&&this.#context['preinstructions']['length']>0x0&&!w['runningPreinstructions']&&(await this['run'](this.#context['preinstructions'],{'runningPreinstructions':!![]}),this.#shouldRunPreinstructions=![]),await makeHandler({'automator':this.#automator,'context':this.#context,'instruction':R,...w})['run']();}async['find'](R,w={}){let F;if(typeof R==='string'){const {result:N,error:e}=parseElementFragment(R);if(e||!N)throw new RunnerError('Failed\x20to\x20parse\x20element\x20descriptor:\x20'+R,{'code':ErrorCode['MESSAGE_PARSING']});F=N;}else F=R;const E=w['timeout']??this.#context['scope']['internal']['findTimeout']?.['value']??this.#context['scope']['internal']['timeout']?.['value']??0x2710,u=makeValuesStack();await this.#automator['stabilize']('strict',{'signal':w['signal'],'timeout':E});const M=await evaluateExpression(F,{'context':this.#context,'stack':u,'automator':this.#automator,'timeout':E,'signal':w['signal']});return(await this.#context['axOps']['findNode'](M,{'stack':u,'timeout':E,'signal':w['signal']}))?.['node']??null;}async['tree'](){return await this.#automator['stabilize']('basic'),this.#context['axOps']['extractTree']();}async['describe'](R,w,{limit:limit=0x5}={}){const F=this.#context['axOps']['axProvider'],E={'node':w,'color':{'use':'avoid'}},u=F['describeAXNodeOptions']?(await F['describeAXNodeOptions'](R,E,{'limit':limit}))['map'](M=>M['descriptor']):[await F['describeAXNode'](R,E)]['filter'](M=>M!=null);return[...new Set(u['map'](M=>ElementDescriptor(M)))];}async['search'](R,{tree:w,limit:limit=0xa,explain:explain=![],signal:F}={}){let E;if(typeof R==='string'){const {result:N,error:e}=parseElementFragment(R);if(e||!N)throw new RunnerError('Failed\x20to\x20parse\x20element\x20descriptor:\x20'+R,{'code':ErrorCode['MESSAGE_PARSING']});E=N;}else E=R;const u=w??await this['tree'](),M=await evaluateExpression(E,{'context':this.#context,'stack':makeValuesStack(),'automator':this.#automator,'timeout':0x0,'signal':F});return(await this.#context['axOps']['searchCandidates'](u,M,{'limit':limit}))['map'](l=>({'node':l['node'],'quality':l['quality'],...explain?{'metrics':serializeCandidateMetrics(l)}:{}}));}async['setScope'](...R){this.#context['scope']['activate']('main');for(const w of R){if(!this.#context['scope']['available'](w))this.#context['scope']['set'](w,{'input':{},'public':{},'internal':{}});this.#context['scope']['activate'](w);}}async['resetScope'](){this.#context['scope']['reset']();}async['dispose'](){if(this.#pdfInterceptorInstalled){const R=await this.#pdfInterceptorInstalled;this.#pdfInterceptorInstalled=void 0x0,R?.();}}async[Symbol['asyncDispose']](){return this['dispose']();}},RunnerAXNodeFoundEvent=class extends Event{['node'];constructor(R,w){super('nodeFound',w),this['node']=R;}},RunnerFilepickerDialogRequestedEvent=class extends Event{['dialog'];['frame'];['element'];['multiple'];['accept'];constructor(R){super('filepickerDialogRequested'),this['dialog']=R,this['frame']=R['frame'],this['element']=R['element'],this['multiple']=R['multiple'],this['accept']=R['accept'];}async['files'](R){const w=[],F=[];for(const E of R){let u,M;if(typeof E==='string')u=E;else u=E['path'],M=E['alias'];w['push'](u),F['push'](M??basename(u));}await this['dialog']['element']['execute']((N,e)=>N['dataset']['nlpFileAliases']=JSON['stringify'](e),[F]),await this['dialog']['handle'](w);}async['close'](){}},RunnerStatusChangedEvent=class extends Event{['previousStatus'];['status'];constructor({previousStatus:R,status:w}){super('statusChanged'),this['previousStatus']=R,this['status']=w;}},spec_driver_exports=L({'childContext':()=>childContext,'executeBrowserCommands':()=>executeBrowserCommands,'executeScript':()=>executeScript,'extractContext':()=>extractContext,'findElement':()=>findElement,'findElements':()=>findElements,'getCookies':()=>getCookies,'getDriverInfo':()=>getDriverInfo,'getTitle':()=>getTitle,'getUrl':()=>getUrl,'getViewportSize':()=>getViewportSize,'isContext':()=>isContext,'isDriver':()=>isDriver,'isElement':()=>isElement,'isSelector':()=>isSelector,'isStaleElementError':()=>isStaleElementError,'mainContext':()=>mainContext,'parentContext':()=>parentContext,'setViewportSize':()=>setViewportSize,'takeScreenshot':()=>takeScreenshot,'toSelector':()=>toSelector,'toSimpleCommonSelector':()=>toSimpleCommonSelector,'visit':()=>visit});function transformArgument(R){const w=[];return[F(R),...w];function F(E){if(isElement(E))return w['push'](E),{'isElement':!![]};else{if(Array['isArray'](E))return E['map'](F);else{if(E&&typeof E==='object')return Object['entries'](E)['reduce']((u,[M,N])=>{return Object['assign'](u,{[M]:F(N)});},{});else return E;}}}}function scriptRunner(R,w,...F){return new Function(R['startsWith']('function')?'return\x20('+R+').apply(null,\x20arguments)':R)(E(w));function E(u){if(!u)return u;else{if(u['isElement'])return F['shift']();else{if(Array['isArray'](u))return u['map'](E);else{if(typeof u==='object')return Object['entries'](u)['reduce']((M,[N,e])=>{return Object['assign'](M,{[N]:E(e)});},{});else return u;}}}}}const SELECTOR_PREFIXES=['/','(','../','./','*/'];function isXpathSelector(R){return SELECTOR_PREFIXES['some'](w=>R['startsWith'](w));}function isDriver(R){if(!R)return![];return R instanceof Target;}function isContext(R){if(!R)return![];return R instanceof Frame;}function isElement(R){if(!R)return![];return R instanceof WebNode;}function isSelector(R){return typeof R==='string';}function isStaleElementError(R){return R?.['constructor']?.['name']==='StaleNodeError'||R?.['constructor']?.['name']==='StaleRemoteObjectHandleError';}function toSelector(R){if(R&&typeof R==='object'&&'selector'in R)return R['selector'];return R;}function toSimpleCommonSelector(R){if(typeof R==='string')return{'type':isXpathSelector(R)?'xpath':'css','selector':R};return R;}function extractContext(R){return isDriver(R)?R['mainFrame']:R;}async function executeScript(R,w,F){return w=typeof w==='string'?w:'function()\x20{return\x20('+w['toString']()+').apply(null,\x20arguments)}',await R['execute'](scriptRunner,[w,...transformArgument(F)],{'timeout':0xafc8});}async function findElement(R,w,F){return(F??R)['$'](w);}async function findElements(R,w,F){return(F??R)['$$'](w);}async function mainContext(R){let w=R;while(w['parent'])w=w['parent'];return w;}async function parentContext(R){return R['parent']??R;}async function childContext(R,w){const F=await w['getContentFrame']();return await F['evaluate']('true'),F;}async function getDriverInfo(R){return{'features':{'allCookies':!![]}};}async function getViewportSize(R){return R['getViewportSize']();}async function setViewportSize(R,w){await R['emulate']({'viewport':w,'timeout':0xafc8});}async function getCookies(R){return(await R['browser']['getCookies']())['map'](w=>{const F={...w,'expiry':w['expires']};return delete F['expires'],delete F['size'],delete F['priority'],delete F['session'],delete F['sourceScheme'],delete F['sourcePort'],F;});}async function getTitle(R){return R['title'];}async function getUrl(R){return R['url'];}async function visit(R,w){await R['navigate'](w);}async function takeScreenshot(R){const w=await R['captureScreenshot']();return Buffer['from'](w,'base64');}async function executeBrowserCommands(R,w){let F;for(const E of w)F=await R['connection']['execute'](E['command'],E['params']);return F;}var RemoteAXProvider=class{async['makeAXTree'](R){const {tree:w,refs:F}=await this['_rqMakeAXTree'](R),E=AXTreeView['fromJSON'](w),u=[...E['root']['nodes']()];for(let M=0x0;M<u['length'];M++)u[M]['incorporated']['push'](...F[M]??[]);return E;}async['describeAXNode'](R,w){const F=await this['_rqDescribeAXNode'](R,w);if(!F)return void 0x0;const {nodeIndex:E,...u}=F;if(E===void 0x0)return u;const M=[...R['root']['nodes']()];return{...u,'node':M[E]};}async['findAXNode'](R,w,F){const E=[...R],u=await this['_rqFindAXNode'](E,w,F);if(!u)return null;const {nodeIndex:M,...N}=u;return{...N,'node':E[M]};}},HttpRemoteAXProvider=class extends RemoteAXProvider{#baseUrl;#getAuthToken;#fetch;constructor(R){super(),this.#baseUrl=new URL(R['url']);if(!this.#baseUrl['pathname']['endsWith']('/'))this.#baseUrl['pathname']+='/';this.#getAuthToken=R['getAuthToken'],this.#fetch=R['fetch']??defaultAXServerFetch;}async['_rqMakeAXTree'](R){const w=R['nodes']['map'](M=>M['node']),F={...R,'nodes':R['nodes']['map']((M,N)=>({...M,'node':N}))},{tree:E,refs:u}=await this.#authPost('make-ax-tree',{'flat':F});return{'tree':E,'refs':u['map'](M=>M['map'](N=>w[N]))};}async['_rqDescribeAXNode'](R,w){const F=[...R['root']['nodes']()];return this.#authPost('describe-ax-node',{'tree':R['toJSON'](),'query':serializeQuery(w,F)});}async['_rqFindAXNode'](R,w,F){const [E]=R;if(!E)return null;return this.#authPost('find-ax-node',{'tree':E['tree']['toJSON'](),'descriptor':w,'options':F?.['limit']!==void 0x0||F?.['debug']?.['reason']?{'limit':F['limit'],'debug':F['debug']}:void 0x0});}async #authPost(R,w){const F=await this.#getAuthToken(),E=await(await this.#fetch({'url':new URL(R,this.#baseUrl)['href'],'method':'POST','token':F,'body':w}))['json']();if(!E['ok']){const u=new Error(E['error']['message']);u['code']=E['error']['code'],u['reason']=E['error']['reason'];throw u;}return E['data'];}};function defaultAXServerFetch({url:R,method:w,token:F,body:E}){return fetch(R,{'method':w,'headers':{'content-type':'application/json','authorization':'Bearer\x20'+F},'body':JSON['stringify'](E)});}function serializeQuery(R,w){const F=R['anchor']?{...R['anchor'],'element':R['anchor']['element']?serializeQuery(R['anchor']['element'],w):void 0x0}:void 0x0;return{...R,'node':w['indexOf'](R['node']),'anchor':F};}export{AbortError,AutomatorError,BlockingDialog,BodyConsumedError,Browser,BrowserActivePageChangedEvent,BrowserDisconnectedEvent,BrowserPageClosedEvent,BrowserPageCreatedEvent,BrowserPageNavigatedEvent,BrowserStabilizingLoadEvent,BrowserStabilizingNavigationEvent,BrowserStabilizingOutgoingRequestsEvent,BrowserTargetCrashedEvent,BrowserTargetCreatedEvent,BrowserWindowCreatedEvent,CommandTimedOutError,Connection,Debugger,DebuggerPausedEvent,DebuggerResumedEvent,DialogHandledEvent,Evaluator,EvaluatorDestroyedEvent,EvaluatorLogEvent,Expression,FilepickerDialog,FlagChangedEvent,FlushError,Frame,FrameDestroyedEvent,FrameDocumentRequestEvent,FrameDocumentResponseEvent,FrameEvaluatorAttached,FrameFetchError,FrameLifecycleEvent,FrameNavigatedEvent,FrameNavigatingEvent,FrameSwappedEvent,FrameSwappingEvent,HarRecorder,HarRecorderStatsChangedEvent,HttpRemoteAXProvider,Injection,InjectionEvaluatorAttachedEvent,InjectionIncommingMessageEvent,InjectionOutgoingMessageEvent,InjectionTargetAttachedEvent,Intercepted,InterceptedRequest,InterceptedResponse,Keyboard,Loader,LoaderRequestEvent,LoaderResponseEvent,Mouse,NavigationFailedError,NavigationTimedOutError,NoHistoryEntryError,Port,PortIncommingMessageEvent,PortOutgoingMessageEvent,RemoteAXProvider,RemoteFunctionHandle,RemoteObjectHandle,Runner,RunnerAXNodeFoundEvent,RunnerFilepickerDialogRequestedEvent,RunnerStatusChangedEvent,Script,StaleNodeError,StaleRemoteObjectHandleError,StylesheetHandle,Target,TargetActivatedEvent,TargetActivatingEvent,TargetAttachedEvent,TargetChangedEvent,TargetChildTargetCreatingEvent,TargetClosedEvent,TargetDetachedEvent,TargetDialogEvent,TargetElementSelectedEvent,TargetFilepickerDialogEvent,TargetFrameAttachedEvent,TargetFrameTargetCreatedEvent,TargetMainFrameReadyEvent,TargetNavigatedEvent,TargetVisibilityChangeEvent,WebNode,Window,WindowDestroyedEvent,WindowTargetAttachedEvent,WindowTargetDetachedEvent,flags,isElementAcceptableInvisible,localizeRemoteValue,makeBlockingDialog,makeBrowser,makeBundledExpression,makeBundledScript,makeConnection,makeDebugger,makeEvaluator,makeExpression,makeFilepickerDialog,makeFrame,makeInjection,makeIntercepted,makeInterceptedRequest,makeInterceptedResponse,makeInterceptionPatternMatcher,makeKeyboard,makeLoader,makeMouse,makePort,makeRunner,makeScript,makeTarget,makeWebNode,makeWindow,previewRemoteValue,provideRolldownConfig,spec_driver_exports as spec,toCDPPattern};
|