@checksum-ai/runtime 3.0.2 → 3.0.3-alpha.1

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/index.js CHANGED
@@ -739,7 +739,7 @@ ${c}`;return{success:!0,pages:s,message:p}}async switchPageHandler(i){if(!i.page
739
739
  ${r}`)}get createChecksumStep(){return r=>this.checksumPage.createChecksumStep(r)}get step(){return this.checksumPage.step.bind(this.checksumPage)}get runConditionallyWithinStep(){return(r,i,s)=>this.checksumPage.runConditionallyWithinStep(r,i,s)}async getScreenshotForElement(r){var i;try{let s=await this.getSelectionDataForChecksumId(r);if(!s)throw new Error(`Locator not found for checksumId: ${r}`);let c=((i=this.arConfig.modelConfig)==null?void 0:i.provider)==="anthropic"?"jpeg":"png";return(await this.page.locator(s.selector).screenshot({type:c})).toString("base64")}catch{throw new Error(`Failed to get screenshot for element: ${r}`)}}get analytics(){return this._analytics}get pageInteractor(){return this._pageInteractor}};e(W5e,"AutoRecoveryRuntimeIteratorUtils"),W5e.currentChecksumId="0";PBt=W5e});var dye,_ye,pSn=Ws(()=>{"use strict";Rte();Oit();aSn();lSn();O1e();dye=class dye extends zfe{constructor(r,i,s,c,p,_,v){super(r,i,s,c,p,_,v),this.runtimePageContext=_}init(r){var i;return this.initializationData=r,(i=this.initializationData.fallbackConfig).arMode??(i.arMode="fast"),this}canResolve(r){return!0}get failingThought(){return this.initializationData.thoughts.failing}getRecoveryAttemptTitle(){switch(this.initializationData.type){case"action":return`Checksum Auto-Recovery: trying to achieve action "${this.failingThought}"...`;case"assertion":return`Checksum Auto-Recovery: trying to verify assertion "${this.failingThought}"...`}}static async registerSession(r){let i=r.config.apiURL,s=r.config.apiKey;return await(await fetch(`${i}${dye.API_BASE_ROUTE}/register-auto-recovery-session`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:s},body:JSON.stringify({appName:r.testIdentification.testFileName,fallbackData:r})})).json()}async prepareSession(r){let i=await dye.registerSession(this.initializationData);this.utils=new PBt({page:this.page,evaluateWithChecksum:this.evaluateWithChecksum,checksumPage:this.checksumPage,pageInteractor:this.pageInteractor,arConfig:i.arConfig,sessionId:i.sessionId,runtimeFallbackData:this.initializationData,fallbackData:r,variableStore:this.variables,runtimePage:this.runtimePageContext,context:this.context});try{this.agent=await kBt.build(this.utils)}catch(s){let c=s instanceof Error?s.message:String(s),p=s instanceof Error?s.stack:void 0;throw new Error(`Failed to prepare ARFallback: ${c}`)}}async resolve(r){let i=null,s=new Promise((p,_)=>{i=setTimeout(()=>{i=null,this.utils.analytics.ARError({error:`Auto-recovery timed out after ${dye.TIMEOUT_MS/1e3} seconds`});let v="Auto-Recovery attempt finished unsuccessfully";this.utils.createChecksumStep({title:v,withError:!0}),this.utils.addAutoRecoveryErrorToReport(v,!1),_(new Error(v))},dye.TIMEOUT_MS)}),c=Date.now();await this.prepareSession(r),this.utils.analytics.ARStart();try{let p=await Promise.race([this.agent.init(),s]);return i!==null&&(clearTimeout(i),i=null),this.utils.analytics.ARFinish({duration:Date.now()-c}),{fbResult:p.result,thought:p.finalThought,stepsThoughts:p.stepsThoughts,steps:[]}}catch(p){throw i!==null&&(clearTimeout(i),i=null),this.utils.analytics.ARFinish({duration:Date.now()-c}),p}}};e(dye,"ARFallback"),dye.API_BASE_ROUTE="/auto-recovery",dye.TIMEOUT_MS=12e4;_ye=dye});var fSn,dSn=Ws(()=>{"use strict";fSn=e(n=>{let r=n.info();return r.annotations.some(i=>i.type==="bug")||r.tags.some(i=>i==="@bug")},"isKnownBugTest")});var _Sn={};pH(_Sn,{VtgUserStoryService:()=>qct});var nNr,qct,iNr=Ws(()=>{"use strict";aw();xU();g6();nNr=class nNr{constructor(r,i){this.apiService=r;this.config=i}getStory(){return this.story}getTestGenerationData(){return this.userStoryTestGeneration}hasTestGenerationData(){return!!this.userStoryTestGeneration}async fetchStory(r){if(Hd.vtg.useFakeStory){this.story={...Hd.vtg.fakeStory,id:"fake-story",environment:{name:void 0,userRole:void 0},internalTestId:"fake-internal-test-id"},Yp.info("Using fake flow data",this.story);return}if(!r)throw new Error("no story id provided");try{let s=await(await this.apiService.post(`test-generation/info/${r}`)).json();if(!(s!=null&&s.id))throw new Error(`Story ${r} not found`);let{id:c,title:p,steps:_,startUrl:v,userRole:E,environment:D,internalTestId:w,version:B,collectionName:N}=s;this.story={id:c,goal:p,instructions:_,url:v,internalTestId:w,environment:{userRole:E,name:D},version:B,collectionName:N}}catch(i){throw Yp.error(`Error fetching story by id ${r}:`,i),new Error(`Couldn't fetch story by id ${r}. Make sure the server is running and the story id is correct. Original error: ${JSON.stringify(i)}`)}}getEnvInfo(){return $ct(this.config,{role:this.story.environment.userRole,environment:this.story.environment.name})}async createTestGeneration(){if(!this.story.id)return;let r=await this.apiService.post(`test-generation/create/${this.story.id}`,{internalTestId:this.story.internalTestId}),{testGenerationId:i}=await r.json();return this.userStoryTestGeneration={testGenerationId:i},this.userStoryTestGeneration}setTestGenerationData(r){this.userStoryTestGeneration=r}};e(nNr,"VtgUserStoryService");qct=nNr});var aNr,NBt,mSn=Ws(()=>{"use strict";aNr=class aNr{constructor(r,i){this.config=r;this.baseURL=r.apiURL+i}getBaseURL(){return this.baseURL}get(r){let i=`${this.baseURL}/${r}`;return fetch(i,{method:"GET",headers:{ChecksumAppCode:this.config.apiKey}})}put(r,i){return fetch(`${this.baseURL}/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",ChecksumAppCode:this.config.apiKey},body:i?JSON.stringify(i):void 0})}post(r,i){return fetch(`${this.baseURL}/${r}`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:this.config.apiKey},body:i?JSON.stringify(i):void 0})}delete(r){return fetch(`${this.baseURL}/${r}`,{method:"DELETE",headers:{ChecksumAppCode:this.config.apiKey}})}putFile(r,i){return fetch(r,{method:"PUT",headers:{"Content-Type":i.type},body:i})}};e(aNr,"RuntimeAPIService");NBt=aNr});var hSn={};pH(hSn,{VtgCloudAPIService:()=>Vct});var sNr,Vct,oNr=Ws(()=>{"use strict";mSn();sNr=class sNr extends NBt{constructor(i){super(i,"/client-api/runtime");this.config=i}};e(sNr,"VtgCloudAPIService");Vct=sNr});var D$,gSn,jY,cNr,mye,BBt,uNr=Ws(()=>{"use strict";iS();RYr();fH();O1e();BEe();L8t();Rte();M1r();D$=require("fs"),gSn=H0(Tyr()),jY=H0(require("path"));Drn();Byr();aw();Rcn();Lcn();Mcn();jcn();Ucn();H1n();xU();USr();pSn();SFr();dSn();cNr=1e3*30,mye=class mye extends kje{constructor(i,s="normal",c,p,_,v,E,D,w,B,N,L,M){var ue,le,de;super(i,c,N,()=>this.pageInteractor,void 0);this.page=i;this.runMode=s;this.testRunAnalytics=p;this.monitorBridge=_;this.testInfo=v;this.checksumTestId=E;this.test=D;this.options=w;this.isReplMode=B;this.config=N;this.pageInteractorAPI=L;this.lastInteractionTime=Date.now();this.hasRuntimeStartedTrace=!1;this.unzippedHarData=[];this.fallbacks=[];this.hasUsedAutoRecovery=!1;this.hasSuccessfulAutoRecovery=!1;this.arSummaries=[];this.arStepIds=[];this.arResults=[];this.failedSteps=[];this.thoughtsCounter=0;this.highLevelThoughts=[];this.framesMsgBroker=new LRe;this.previousSteps=[];this.scriptLoadWrapper=e(async(i,s)=>(!this.isTimeMachineFrame(s)&&this.navigationPromise&&await this.navigationPromise,this.wrapInternalSteps(i,s.page())),"scriptLoadWrapper");this.scriptLoadCheck=e(async i=>i.evaluate(()=>!!window.checksum),"scriptLoadCheck");this.scriptLoadCallback=e(async i=>{await i.evaluate(async({appSpecificRules:s,esraTimeout:c,sessionRecorder:p,showFrontendLogs:_,showTMSeeker:v,filesObserver:E,nativeDialogObserver:D,assertionsObserver:w,actionsObserver:B,recordOptions:N})=>{var L;(L=window.checksum)==null||L.testGenerator.init(s,{esraTimeout:c,showFrontendLogs:_,skipElementHighlighting:!0,recordOptions:N},{assertionGenerator:!1,sessionRecorder:p,filesObserver:E,nativeDialogObserver:D,assertionsObserver:w,actionsObserver:B});try{v&&window.checksum.timeMachine.openSeekbar()}catch{}},{appSpecificRules:this.appSpecificRules,esraTimeout:cNr,sessionRecorder:!!(!this.isTimeMachineFrame(i)&&(this.timeMachine||this.isVTG)),showFrontendLogs:Hd.isDevMode,showTMSeeker:this.isTimeMachineFrame(i)&&process.env.CHECKSUM_SHOW_TIME_MACHINE==="true",filesObserver:this.isVTG&&!this.isTimeMachineFrame(i),nativeDialogObserver:this.isVTG&&!this.isTimeMachineFrame(i),assertionsObserver:this.isVTG&&!this.isTimeMachineFrame(i),actionsObserver:this.isVTG&&!this.isTimeMachineFrame(i),recordOptions:this.isVTG?this.getVTGRecordOptions():void 0}),mv(`[init] init script loaded for ${i.page().url()}`)},"scriptLoadCallback");ySn(w.printLogs),this.isVTG&&(this.options={...this.options,useChecksumAI:{actions:!1,assertions:!1,arVersion:1,visualComparison:!1},useMockData:!1,useChecksumSelectors:!1,autoHealPRs:!1},OBt(this.page)),fSn(D)&&this.config.options.useChecksumAI.skipTestsWithKnownBugs&&(console.log("Auto recovery will not run for this test as it is marked as a known bug"),this.config.options.useChecksumAI.actions=!1,this.config.options.useChecksumAI.assertions=!1,this.config.options.useChecksumAI.visualComparison=!1),this.injectedScriptManager.setScriptLoadWrapper(this.scriptLoadWrapper).setScriptLoadCallback(this.scriptLoadCallback).setScriptLoadCheck(this.scriptLoadCheck);let V=hye({config:this.config,throwIfAuthFailed:!0}),Z=this.getPlaywrightProjectConfig();if(this.pageInteractor=new L1e(this.evaluateWithChecksum.bind(this),()=>this.page.mainFrame(),()=>this.timeMachine,{log:mv,logError:mv},{navigationTimeout:(ue=Z.use)==null?void 0:ue.navigationTimeout,actionTimeout:(le=Z.use)==null?void 0:le.actionTimeout,testAssetsDir:_nt(Ote()),waitActionDelay:1e3},this.pageInteractorAPI,V),this.checkForActiveTracing(),this.resetFallbacks(),M&&(this.highLevelThoughts=M.highLevelThoughts??[],this.timeMachineBrowserContext=M.timeMachineBrowserContext,this.variableStore=M.variableStore),Hd.testRun.timeMachine.active){let xe=this.shouldRecordRRwebEvents()?{recordRRwebEventsToFile:!0,recordRRwebEventsToFilePath:$Yr(this.checksumTestId,this.testInfo.retry)}:{};this.isVTG||(this.timeMachine=new vIt(this.framesMsgBroker,this.injectedScriptManager,{...xe,headless:process.env.CHECKSUM_SHOW_TIME_MACHINE==="true"?!1:Hd.testRun.timeMachine.headless,webProxy:(de=v.project.use)==null?void 0:de.proxy}),this.timeMachineBrowserContext&&this.timeMachine.setTimeMachineBrowserContext(this.timeMachineBrowserContext))}}previousThoughtsAndTimestamps(){return this.previousSteps}static async init(i,s,c,p,_,v,E,D,w,B=!1){let N=!1;E||(E=await mye.fetchVtgInternalTestId(w),E||(E=F8t(5),N=!0,console.warn(`Checksum test id was not defined for test "${v.title}" and was auto-generated. Please replace - "${v.title}" with -
740
740
  test(defineChecksumTest("${v.title}", "${E}"), async ({ page }) => {...`))),p.addTestInfo(E,v.testId,N),w.options.useChecksumAI!==void 0&&typeof w.options.useChecksumAI=="boolean"&&(w.options.useChecksumAI={actions:w.options.useChecksumAI,assertions:!1,visualComparison:!1});let L=new pLe(w),M=new mye(i,w.runMode,s,c,p,v,E,D,{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1},newAssertionsEnabled:w.runMode!=="normal",useMockData:!1,printLogs:!1,...w.options},B,w,L,{variableStore:_});return s.pages().length===0&&(D._checksum.expect.setPage(M),D._checksum.checksumAI.page=M,_.clearAll(),M.testRunAnalytics.testRunStart()),await M.asyncInit(),M.proxy}static async fetchVtgInternalTestId(i){try{let s=process.env.CHECKSUM_VTG_TEST_FILE_RUN_CONFIG;if(!s)return;let c=JSON.parse(s);if(c.mode!=="start"||!c.storyId)return;let{VtgUserStoryService:p}=await Promise.resolve().then(()=>(iNr(),_Sn)),{VtgCloudAPIService:_}=await Promise.resolve().then(()=>(oNr(),hSn)),v=new _(i),E=new p(v,i);await E.fetchStory(c.storyId);let D=E.getStory();return D==null?void 0:D.internalTestId}catch(s){console.warn("Failed to fetch VTG internalTestId from story:",s);return}}async asyncInit(i=!1){await this.loadAppSpecificRules(),await this.wrapInternalSteps(async()=>{await this.page.addInitScript(()=>{window.sessionStorage.setItem("checksumai:disable","true")})}),this.timeMachine&&(await this.timeMachine.prepare(this.page.mainFrame()),this.timeMachineBrowserContext=this.timeMachine.getTimeMachineBrowserContext()),this.pageInteractor.init(),i||await this.prepareForTestArtifacts();let s=jY.resolve(__dirname,"mock-auto-heal-agent.js");await this.page.addInitScript({path:s})}async makePage(i){let s=new mye(i,this.runMode,this._context,this.testRunAnalytics,this.monitorBridge,this.testInfo,this.checksumTestId,this.test,this.options,this.isReplMode,this.config,this.pageInteractorAPI,{highLevelThoughts:this.highLevelThoughts,timeMachineBrowserContext:this.timeMachineBrowserContext,variableStore:this.variableStore});return await s.asyncInit(!0),s.proxy}getTimeMachinePage(){var i;return(i=this.timeMachine)==null?void 0:i.getPage()}getFramesMessageBroker(){return this.framesMsgBroker}isTimeMachineFrame(i){var s;return i===((s=this.timeMachine)==null?void 0:s.getFrame())}shouldRecordRRwebEvents(){return Hd.testRun.timeMachine.recordRRwebEventsToFile&&this.config.options.hostReports}recordInteraction(){let i=this.getPageGuid(this.page);mye.recentlyInteracted.set(i,Date.now()),this.lastInteractionTime=Date.now()}static getMostRecentPage(i){let s=i.pages(),c=s[0],p=0;for(let _ of s){let v=_._guid,E=mye.recentlyInteracted.get(v)||0;E>p&&(p=E,c=_)}return c}async goto(i,s){return this.recordInteraction(),this.page.goto(i,s)}async reload(i){return this.recordInteraction(),this.page.reload(i)}async goBack(i){return this.recordInteraction(),this.page.goBack(i)}async goForward(i){return this.recordInteraction(),this.page.goForward(i)}async click(i,s){return this.recordInteraction(),this.page.click(i,s)}async dblclick(i,s){return this.recordInteraction(),this.page.dblclick(i,s)}async fill(i,s,c){return this.recordInteraction(),this.page.fill(i,s,c)}async press(i,s,c){return this.recordInteraction(),this.page.press(i,s,c)}async check(i,s){return this.recordInteraction(),this.page.check(i,s)}async uncheck(i,s){return this.recordInteraction(),this.page.uncheck(i,s)}async selectOption(i,s,c){return this.recordInteraction(),this.page.selectOption(i,s,c)}async hover(i,s){return this.recordInteraction(),this.page.hover(i,s)}async type(i,s,c){return this.recordInteraction(),this.page.type(i,s,c)}async setInputFiles(i,s,c){return this.recordInteraction(),this.page.setInputFiles(i,s,c)}async tap(i,s){return this.recordInteraction(),this.page.tap(i,s)}async dragAndDrop(i,s,c){return this.recordInteraction(),this.page.dragAndDrop(i,s,c)}getPlaywrightProjectConfig(){return this.testInfo.project}checkForActiveTracing(){var c;let s=(c=this.getPlaywrightProjectConfig().use)==null?void 0:c.trace;this.traceMode=typeof s=="string"?s:s==null?void 0:s.mode}registerPageEvents(){super.registerPageEvents(),this.injectedScriptManager.addTrackedFrame(this.page),this.page.on("framenavigated",async i=>{this.injectedScriptManager.onFrameNavigated(i)})}checksumSelector(i){return this.checksumStepId=i,this.options.useChecksumSelectors&&this.setSelectorFallback(i),this.proxy}checksumAI(i,s,c){let p=this.addNewThought(i,"action",!!s);this.previousSteps.push({thought:p.thought,timestamp:Date.now()});let _=this.getPageGuid(this.page);return L1e.setLastAction(_,i),s&&typeof s=="function"?this.test.step(i,async v=>{var E;try{return c!=null&&c.withDialog&&this.pageInteractor.listenToDialog(),await s()}catch(D){if(p.children=[],!this.options.useChecksumAI.actions||c!=null&&c.withDialog||c!=null&&c.skipAutoRecovery)throw D;this.setAIFallback(i,"action");try{return await this.initiateFallbackSequence({type:"action",error:D,method:void 0,args:[],testInfo:this.testInfo,step:v},{fallbackTypes:[rge,_ye]})}catch(w){throw this.testRunAnalytics.testRunError({failedThought:i,error:(w==null?void 0:w.message)||"Unknown error"}),w}}finally{this.pageInteractor.removeListener("dialog"),this.currentThought=(E=this.currentThought)==null?void 0:E.parent}}):(this.options.useChecksumAI.actions&&!(c!=null&&c.skipAutoRecovery)&&this.setAIFallback(i,"action"),this.proxy)}resolveAssetsFolder(i){return i.map(s=>jY.join(_nt(Ote()),s))}getRuntimeOptions(){return this.options}addPwAnnotation(i){this.testInfo.annotations.push({type:i.type,description:`
741
741
  ${i.description}`})}async onTestComplete(i){this.testRunAnalytics.testRunEnd({success:i,autoRecoveryTriggered:this.hasUsedAutoRecovery,summaries:this.arSummaries}),this.monitorBridge.addChecksumTestMetadata({checksumTestId:this.checksumTestId,pwTestId:this.testInfo.testId,retry:this.testInfo.retry,type:"autoRecoveryMetadata",data:{autoRecoveryTriggered:this.hasUsedAutoRecovery,autoRecovered:this.hasSuccessfulAutoRecovery&&i}}),this.monitorBridge.addChecksumTestMetadata({checksumTestId:this.checksumTestId,pwTestId:this.testInfo.testId,retry:this.testInfo.retry,type:"autoRecoverySummaries",data:this.arSummaries}),this.cleanupMockData()}async wrapInternalSteps(i,s=this.page){try{return s.mainFrame()._checksumInternal=!0,s._checksumInternal=!0,await i()}finally{s.mainFrame()._checksumInternal=!1,s._checksumInternal=!1}}async conditionallyWrapInternalSteps(i,s){return i?this.wrapInternalSteps(s):s()}async wrapNoLocationSteps(i){try{return this.testInfo._checksumNoLocation=!0,await i()}finally{this.testInfo._checksumNoLocation=!1}}findAllStepsRecursively(i,s,c=[]){for(let p of i){(p._stepId===s||p.stepId===s)&&c.push(p);let _=[p.steps,p._testInfoSteps,p._steps].filter(Boolean);for(let v of _)this.findAllStepsRecursively(v,s,c)}return c}makeChecksumStepFunction(i){return s=>{if(!i)return;let c=s._stepId||s.stepId;this.findAllStepsRecursively(s._testInfo._steps,c).forEach(_=>{_.error={message:"ChecksumStepError",stack:"Fallback Failed",cause:void 0}})}}async createChecksumStep(i){let s,c={box:!0,noLocation:!0,obtainStep:e(p=>{s=p},"obtainStep")};return await this.step(i.title,this.makeChecksumStepFunction(i.withError),!1,c),s!=null&&s.stepId&&this.arStepIds.push(s.stepId),s}async step(i,s,c=!0,{obtainStep:p=void 0,box:_=!1,noLocation:v=void 0}={}){let E=this.testInfo._checksumNoLocation;try{this.testInfo._checksumInternal=c===!0,v!==void 0&&(this.testInfo._checksumNoLocation=v),await this.test.step(i,s||(()=>{}),{obtainStep:p,box:_})}finally{this.testInfo._checksumInternal=!1,this.testInfo._checksumNoLocation=E}}addErrorMessage(i,s){this.testInfo.addError(i,s)}async evaluateWithChecksum(i,s,c=!0){return this.navigationPromise&&await this.navigationPromise,this.conditionallyWrapInternalSteps(c,()=>this.page.evaluate(i,s))}getChecksumTestId(){return this.checksumTestId}addNewThought(i,s,c=!1){let p={id:void 0,thought:i,type:s,children:c?[]:void 0,parent:void 0};if(!this.currentThought)this.highLevelThoughts.push(p);else if(this.currentThought.children)this.currentThought.children.push(p),p.parent=this.currentThought;else{let _=this.currentThought.parent;_?(_.children.push(p),p.parent=_):this.highLevelThoughts.push(p)}return p.parent?p.id=`${p.parent.id}.${p.parent.children.length}`:p.id=`${++this.thoughtsCounter}`,this.currentThought=p,p}buildThoughtsChainForFallback(i=this.highLevelThoughts){let s=[];return i.forEach(c=>{s.push(c.thought),c.children&&s.push(...this.buildThoughtsChainForFallback(c.children))}),s}getVTGRecordOptions(){return{recordCanvas:!0,recordCrossOriginIframes:this.isVTG,sampling:{mousemove:!1},slimDOMOptions:"all"}}compoundSelection(...i){let s=super.compoundSelection(...i);return s.setAnalytics(()=>this.testRunAnalytics),this.checksumStepId&&this.options.useChecksumSelectors&&this.setCompoundSelectorFallback(this.checksumStepId),s}setSelectorFallback(i){let s={checksumId:i,fileName:this.testInfo.file,testId:this.checksumTestId,apiKey:this.config.apiKey,apiURL:this.config.apiURL,timeout:cNr};this.pushFallback(this.constructFallback(jit).init(s)),this.pushFallback(this.constructFallback(Lit).init(s))}setCompoundSelectorFallback(i){this.pushFallback(this.constructFallback(Mit).init({checksumId:i,fileName:this.testInfo.file,testId:this.checksumTestId,apiKey:this.config.apiKey,apiURL:this.config.apiURL,timeout:cNr}))}setAIFallback(i,s){var v;let c=((v=this.options.useChecksumAI)==null?void 0:v.arVersion)===1,p=e(()=>{var L,M;let E=this.buildThoughtsChainForFallback(),D={title:this.testInfo.title},w={testFileName:this.testInfo.file,testId:this.testInfo.testId,testSuiteId:process.env.CHECKSUM_TEST_SUITE_ID||""},B={previous:E.slice(0,-1),failing:i,next:E.slice(1)},N={storyInfo:D,testIdentification:w,fallbackConfig:{arMode:(L=this.options.useChecksumAI)==null?void 0:L.arMode,overrideOptions:(M=this.options.useChecksumAI)==null?void 0:M.overrideOptions},thoughts:B,config:{apiURL:this.config.apiURL,apiKey:this.config.apiKey},type:s};return this.constructFallback(_ye).init(N)},"createArFallback"),_=e(()=>{var E,D;return this.constructFallback(rge).init({goal:this.testInfo.title,testFile:this.testInfo.file,apiKey:this.config.apiKey,apiURL:this.config.apiURL,testId:this.checksumTestId,thoughts:this.buildThoughtsChainForFallback(),benchmark:Hd.benchmark,arMode:(E=this.options.useChecksumAI)==null?void 0:E.arMode,overrideOptions:(D=this.options.useChecksumAI)==null?void 0:D.overrideOptions,fallbackType:s})},"createAIFallback");return c?this.pushFallback(_()):this.pushFallback(p()),this.proxy}pushFallback(i){this.fallbacks.push(i),this.sortFallbacks()}handleAIFallback(i,s,c,p){let _=i.fallbackAnalyticsPayload.iterationSteps,v=_.length>0?p/_.length:0;this.testRunAnalytics.testRunFallbackExecution({result:c.fbResult,failedThought:i.getFailedThought(),summary:c.summary,stepsPayload:i.fallbackAnalyticsPayload,type:i.fallbackType??s.type,benchmark:Hd.benchmark.toString(),duration:p,avgDuration:v,success:["finish","soft_assertion"].includes(c.fbResult)}),this.arResults.push({failedThought:i.getFailedThought(),result:c.fbResult,thought:c.thought})}handleAutoRecovery(i,s,c,p){let _=c.stepsThoughts.length>0?p/c.stepsThoughts.length:0;this.testRunAnalytics.testRunAutoRecovery({failingThought:i.failingThought,type:s.type,finalThought:c.thought,result:c.fbResult,duration:p,avgStepDuration:_,stepsThoughts:c.stepsThoughts,version:"v1"})}async runFallback(i,s){let c=Date.now(),p=i.resolve(s),_=await WS(p,i.timeout),v=Date.now()-c;i instanceof rge&&(this.hasUsedAutoRecovery=!0,this.handleAIFallback(i,s,_,v)),i instanceof _ye&&(this.hasUsedAutoRecovery=!0,this.handleAutoRecovery(i,s,_,v));let E=_.thought?`: ${_.thought}`:"";if(!_||_.fbResult==="failed")throw this.hasSuccessfulAutoRecovery=!1,this.createChecksumStep({title:`Recovery Failed${E}`,withError:!0}),new Error("Fallback failed");if(_.fbResult==="hard_assertion")throw this.hasSuccessfulAutoRecovery=!1,this.createChecksumStep({title:`Recovery Failed${E}`,withError:!0}),new Znt(_.fbResult);if(this.hasUsedAutoRecovery&&(this.hasSuccessfulAutoRecovery=!0),i instanceof rge&&_.summary&&this.arSummaries.push(_.summary),i instanceof _ye&&_.thought&&this.arSummaries.push(_.thought),this.createChecksumStep({title:`Recovery Complete${E}`}),_.steps.length===1){let D=_.steps[0];D.thought&&(this.currentThought.thought=D.thought)}else this.currentThought.children=_.steps.map((D,w)=>({id:`${this.currentThought.id}.${w+1}`,thought:D.thought,type:D.type,children:void 0,parent:this.currentThought}))}async runConditionallyWithinStep(i,s,c){return i?await this.step(s,c):await c()}async onExecutionError(i){try{return await this.initiateFallbackSequence({type:"action",...i})}catch(s){if(!this.currentThought){let{locator:c,method:p}=i;this.testRunAnalytics.testRunActionExecutionFailure({locator:c.toString(),selector:c._selector,method:p,checksumStepId:this.checksumStepId,error:s.toString()})}throw s}}async initiateFallbackSequence(i,{fallbackTypes:s=void 0}={}){mv(`[initiateFallbackSequence] with type: ${i.type}...`);let c=this.fallbacks.find(v=>v instanceof rge);if(c){let v=c.getFailedThought(),E=this.variableStore.getActiveVariables();this.fallbacks.forEach(D=>{D.setThought(v),D.setVariables(E)})}let p=this.fallbacks.find(v=>v instanceof _ye);if(p){let v=p.failingThought;this.fallbacks.forEach(E=>{E instanceof _ye&&E.setVariables(this.variableStore.getActiveVariables()),E.setThought(v)})}let _=this.fallbacks;s&&(_=_.filter(v=>s.reduce((E,D)=>E||v instanceof D,!1))),_=_.filter(v=>v.canResolve(i));try{for(let v of _){let E=v==null?void 0:v.toString();E&&console.log(`Using ${E}`);let D;try{let w=await this.runConditionallyWithinStep(i.type!=="assertion"||!i.withChecksumAI,v.getRecoveryAttemptTitle(i),async()=>await this.runFallback(v,i));D=!0}catch(w){if(D=!1,i.withChecksumAI&&w.message==="fetch failed")throw new Error(pCe);w instanceof Znt&&w.fallbackResult==="hard_assertion"&&(i.error.fallbackResult="hard_assertion"),E&&console.log(`Failed to use ${E}`),v.cancel();continue}return!0}throw i.error}finally{this.resetFallbacks()}}resetFallbacks(){this.fallbacks=[this.constructFallback(Uit).init()]}async shutdown(){if(this.shouldRecordRRwebEvents()){try{await this.timeMachine.flushRRwebEventsToFile();let i=this.timeMachine.getRRwebFilePath();this.monitorBridge.addAsset({type:"rrweb-recording",path:i,testId:this.checksumTestId,fileName:jY.basename(i)})}catch(i){mv("Error shutting down RRweb events recording",i)}if(this.testRunAnalytics)return mv("Flushing analytics events......"),this.testRunAnalytics.close()}}sortFallbacks(){let i=[Uit,Mit,jit,Lit,rge];this.fallbacks.sort((s,c)=>i.indexOf(s.constructor)-i.indexOf(c.constructor))}constructFallback(i){return new i(this.page,this.evaluateWithChecksum.bind(this),this,this.pageInteractor,{generateSelectionData:this.runMode!=="normal"},this,this._context)}async prepareForTestArtifacts(){if((this.options.useMockData||this.runMode==="refactor")&&await this.prepareAPIMock(),this.traceMode&&this.traceMode!=="off"){let s=await this.getTraceFilePath();s&&this.monitorBridge.addAsset({type:"trace",path:s,testId:this.checksumTestId,project:this.testInfo.project.name})}if(!1){let s=qYr(N8t(this.testInfo.file),this.checksumTestId);this.monitorBridge.addAsset({type:"har",path:s,testId:this.checksumTestId})}}async getTraceFilePath(){try{return this.hasRuntimeStartedTrace?VYr(N8t(this.testInfo.file),this.checksumTestId).replace(".zip",".original.zip"):this.testInfo.outputPath("trace.zip")}catch{return}}async prepareMockData(){let i=S1r(N8t(this.testInfo.file)),s=jY.join(i,`${this.checksumTestId}.har.zip`);if(!(0,D$.existsSync)(s))throw new Error("Could not find har file or zip file");let c=jY.join(i,"tmp");(0,D$.existsSync)(c)||(0,D$.mkdirSync)(c);let p=(0,D$.readFileSync)(s),_=await(0,gSn.loadAsync)(p);for(let E of Object.keys(_.files)){let D=await _.file(E).async("string"),w=jY.join(c,E);(0,D$.writeFileSync)(w,D),this.unzippedHarData.push(w)}let v=jY.join(c,"test.har");if(!(0,D$.existsSync)(v))throw this.cleanupMockData(),new Error(`Could not find har file ${v} after unzipping ${s}`);return v}cleanupMockData(){this.unzippedHarData.forEach(i=>{(0,D$.rmSync)(i)}),this.unzippedHarData.length>0&&(0,D$.rmSync)(jY.dirname(this.unzippedHarData[0]),{recursive:!0,force:!0})}async prepareAPIMock(){let i={GET:0,POST:0,PUT:0,DELETE:0};try{let s=await this.prepareMockData();await this.page.routeFromHAR(s,{url:"*/**",notFound:"fallback",update:!1});let c=this.page._routes[0].handler;await this.page.route("**/*",p=>{let _=p.request().headers(),v=p.request().method();_["Checksum-Id"]=(++i[v]).toString(),p.request()._applyFallbackOverrides({headers:_}),c(p)})}catch(s){mv("Error setting up mock data",s.message)}}async loadAppSpecificRules(){this.appSpecificRules={};let i=jY.join(swe(Ote()),"settings.asr");if(!(0,D$.existsSync)(i)){mv("Could not find ASR file");return}let{ungzip:s}=D1r();try{let c=await s((0,D$.readFileSync)(i));this.appSpecificRules=JSON.parse(c)||{}}catch(c){mv("Could not read ASR file",c.message)}}addAutoRecoveryStepId(i){this.arStepIds.push(i)}};e(mye,"RuntimePage"),mye.recentlyInteracted=new Map;BBt=mye});function GWi(n,r){return r}function KWi(n,r){return n.filter(i=>i!==void 0)}function ASn(n){return typeof n!="object"||n===null?0:Array.isArray(n)?2:ZWi(n)?1:n instanceof Set?3:n instanceof Map?4:5}function YWi(n){let r=new Set;for(let i of n)for(let s of[...Object.keys(i),...Object.getOwnPropertySymbols(i)])r.add(s);return r}function XWi(n,r){return typeof n=="object"&&Object.prototype.propertyIsEnumerable.call(n,r)}function bSn(n){var s;let r=0,i=(s=n[0])==null?void 0:s[Symbol.iterator]();return{[Symbol.iterator](){return{next(){var c;do{if(i===void 0)return{done:!0,value:void 0};let p=i.next();if(p.done===!0){r+=1,i=(c=n[r])==null?void 0:c[Symbol.iterator]();continue}return{done:!1,value:p.value}}while(!0)}}}}}function ZWi(n){if(!xSn.includes(Object.prototype.toString.call(n)))return!1;let{constructor:r}=n;if(r===void 0)return!0;let i=r.prototype;return!(i===null||typeof i!="object"||!xSn.includes(Object.prototype.toString.call(i))||!i.hasOwnProperty("isPrototypeOf"))}function eGi(n,r,i){let s={};for(let c of YWi(n)){let p=[];for(let E of n)XWi(E,c)&&p.push(E[c]);if(p.length===0)continue;let _=r.metaDataUpdater(i,{key:c,parents:n}),v=ESn(p,r,_);v!==k6e.skip&&(c==="__proto__"?Object.defineProperty(s,c,{value:v,configurable:!0,enumerable:!0,writable:!0}):s[c]=v)}return s}function tGi(n){return n.flat()}function rGi(n){return new Set(bSn(n))}function nGi(n){return new Map(bSn(n))}function iGi(n){return n.at(-1)}function LBt(...n){return aGi({})(...n)}function aGi(n,r){let i=sGi(n,s);function s(...c){return ESn(c,i,r)}return e(s,"customizedDeepmerge"),s}function sGi(n,r){return{defaultMergeFunctions:RBt,mergeFunctions:{...RBt,...Object.fromEntries(Object.entries(n).filter(([i,s])=>Object.hasOwn(RBt,i)).map(([i,s])=>s===!1?[i,RBt.mergeOthers]:[i,s]))},metaDataUpdater:n.metaDataUpdater??GWi,deepmerge:r,useImplicitDefaultMerging:n.enableImplicitDefaultMerging??!1,filterValues:n.filterValues===!1?void 0:n.filterValues??KWi,actions:k6e}}function ESn(n,r,i){var p;let s=((p=r.filterValues)==null?void 0:p.call(r,n,i))??n;if(s.length===0)return;if(s.length===1)return lNr(s,r,i);let c=ASn(s[0]);if(c!==0&&c!==5){for(let _=1;_<s.length;_++)if(ASn(s[_])!==c)return lNr(s,r,i)}switch(c){case 1:return oGi(s,r,i);case 2:return cGi(s,r,i);case 3:return uGi(s,r,i);case 4:return lGi(s,r,i);default:return lNr(s,r,i)}}function oGi(n,r,i){let s=r.mergeFunctions.mergeRecords(n,r,i);return s===k6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeRecords!==r.defaultMergeFunctions.mergeRecords?r.defaultMergeFunctions.mergeRecords(n,r,i):s}function cGi(n,r,i){let s=r.mergeFunctions.mergeArrays(n,r,i);return s===k6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeArrays!==r.defaultMergeFunctions.mergeArrays?r.defaultMergeFunctions.mergeArrays(n):s}function uGi(n,r,i){let s=r.mergeFunctions.mergeSets(n,r,i);return s===k6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeSets!==r.defaultMergeFunctions.mergeSets?r.defaultMergeFunctions.mergeSets(n):s}function lGi(n,r,i){let s=r.mergeFunctions.mergeMaps(n,r,i);return s===k6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeMaps!==r.defaultMergeFunctions.mergeMaps?r.defaultMergeFunctions.mergeMaps(n):s}function lNr(n,r,i){let s=r.mergeFunctions.mergeOthers(n,r,i);return s===k6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeOthers!==r.defaultMergeFunctions.mergeOthers?r.defaultMergeFunctions.mergeOthers(n):s}var k6e,tXa,vSn,xSn,RBt,pNr=Ws(()=>{k6e={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},tXa={defaultMerge:k6e.defaultMerge};e(GWi,"defaultMetaDataUpdater");e(KWi,"defaultFilterValues");(function(n){n[n.NOT=0]="NOT",n[n.RECORD=1]="RECORD",n[n.ARRAY=2]="ARRAY",n[n.SET=3]="SET",n[n.MAP=4]="MAP",n[n.OTHER=5]="OTHER"})(vSn||(vSn={}));e(ASn,"getObjectType");e(YWi,"getKeys");e(XWi,"objectHasProperty");e(bSn,"getIterableOfIterables");xSn=["[object Object]","[object Module]"];e(ZWi,"isRecord");e(eGi,"mergeRecords$1");e(tGi,"mergeArrays$1");e(rGi,"mergeSets$1");e(nGi,"mergeMaps$1");e(iGi,"mergeOthers$1");RBt={mergeRecords:eGi,mergeArrays:tGi,mergeSets:rGi,mergeMaps:nGi,mergeOthers:iGi};e(LBt,"deepmerge");e(aGi,"deepmergeCustom");e(sGi,"getUtils");e(ESn,"mergeUnknowns");e(oGi,"mergeRecords");e(cGi,"mergeArrays");e(uGi,"mergeSets");e(lGi,"mergeMaps");e(lNr,"mergeOthers")});function ySn(n){CSn=n}function mv(...n){CSn&&console.log(...n)}async function Icn(n,r,i,s=6e4){if(!(r in n))return n;let c=e(()=>n[r](...i),"executor");return s===null?c():WS(c(),s,"Execution timeout")}function $ct(n,{role:r,environment:i}={},s=!1){var v,E;let c;if(i&&(c=(v=n.environments)==null?void 0:v.find(({name:D})=>i===D)),c||(c=(E=n.environments)==null?void 0:E.find(({default:D})=>D)),!c)throw new Error("Environment not found. Please make sure your environments are properly defined in the checksum.config.ts file.");let p=c.users,_;if(p&&(r!==void 0&&(_=p.find(D=>D.role===r)),_||(_=p.find(D=>D.default))),!_)throw new Error(`User not found. Please make sure the users array for the "${c.name}" environment is properly defined in the checksum.config.ts file.`);if(i&&c.name!==i){if(s)throw new Error(`Could not find environment with name "${i}" in config file`);console.warn(`Could not find environment with name "${i}" in config file, trying to use default environment`)}if(r&&_.role!==r){if(s)throw new Error(`Could not find user with role "${r}" for environment "${i}" in config file`);console.warn(`Could not find user with role "${r}" for environment "${i}" in config file, trying to login with environment's default user`)}return{environment:c,user:_}}function pGi(n){let r=`${n??Ote()}/login.ts`;if(!(0,MBt.existsSync)(r))throw console.warn(`Could not locate the login.ts file. Please make sure your login file exists at ${r}`),new Error("Could not find login.ts file");try{return require(r).default}catch(i){throw console.warn("Error loading login.ts file",i),i}}async function fGi(n,r,{environment:i,user:s,config:c}){try{let p=e(()=>r(n,{environment:i,user:s,config:c}),"performLogin");"checksumAI"in n?await n.checksumAI(`Log in${s!=null&&s.role?` using ${s.role} role`:""}${i!=null&&i.name?` in ${i.name} environment`:""}`,p,{skipAutoRecovery:!0}):await p()}catch(p){throw console.warn(`The login method threw an exception, please check the login.ts file for the following error:
742
- `,p),p}}function hye(n){let{config:r,folder:i,throwIfAuthFailed:s}=n,c=pGi(i);return async(p,{role:_,environment:v}={})=>{let{environment:E,user:D}=$ct(r,{role:_,environment:v},n.throwIfEnvInfoInvalid);if(s&&!D)throw new Error("Could not find user credentials matching the provided role and/or environment");await fGi(p,c,{environment:E,user:D,config:r})}}function DSn(n,{environmentName:r,userRole:i}){let s=hye(n);return c=>s(c,{environment:r,role:i})}function SIt(){if(PQe)return PQe;try{let n=(0,MBt.existsSync)(`${Ote()}/checksum.config.ts`)?"checksum.config.ts":(0,MBt.existsSync)(`${Ote()}/checksum.config.tmp.ts`)?"checksum.config.tmp.ts":void 0;if(n)return jBt(require(`${Ote()}/${n}`).default)}catch{console.warn("Could not find checksum config file, will run with defaults")}return jBt()}function jBt(n={}){var i,s,c,p;let r={apiKey:void 0,runMode:"normal",apiURL:"https://api.checksum.ai",options:{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1,skipTestsWithKnownBugs:!0},newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,consecutiveActionDelay:100,hideReports:process.env.AUTHORIZE_REPORTS==="true"}};return((s=(i=n.options)==null?void 0:i.useChecksumAI)==null?void 0:s.visualComparison)===void 0&&((p=(c=n.options)==null?void 0:c.useChecksumAI)!=null&&p.assertions)&&(n.options.useChecksumAI.visualComparison=!0),PQe=LBt(r,n),Hd.testRun.disableAutoRecovery&&(PQe.options.useChecksumAI={actions:!1,assertions:!1,visualComparison:!1}),Hd.testRun.disableHostReports&&(PQe.options.hostReports=!1),PQe}function OBt(n){let r=e(i=>{i.on("dialog",s=>{})},"makeDialogHandler");n.context().pages().forEach(r),n.context().on("page",i=>{r(i)})}var MBt,CSn,PQe,pCe,xU=Ws(()=>{"use strict";uNr();iS();BEe();MBt=require("fs");aw();pNr();CSn=!1;e(ySn,"setLogToConsole");e(mv,"log");e(Icn,"executePlaywrightMethodWithTimeout");e($ct,"resolveEnvironment");e(pGi,"requireLogin");e(fGi,"proceedWithLogin");e(hye,"makeUnboundLogin");e(DSn,"makeBoundLogin");e(SIt,"loadChecksumConfig");e(jBt,"getChecksumConfig");e(OBt,"preventDialogAutoDismissal");pCe="Checksum failed connecting to the server"});var P6e=Qr((OXa,PSn)=>{var ANr=require("tty"),ISn,HBt,FSn,mGi=((FSn=(HBt=(ISn=ANr==null?void 0:ANr.WriteStream)==null?void 0:ISn.prototype)==null?void 0:HBt.hasColors)==null?void 0:FSn.call(HBt))??!1,Px=e((n,r)=>{if(!mGi)return c=>c;let i=`\x1B[${n}m`,s=`\x1B[${r}m`;return c=>{let p=c+"",_=p.indexOf(s);if(_===-1)return i+p+s;let v=i,E=0;for(;_!==-1;)v+=p.slice(E,_)+i,E=_+s.length,_=p.indexOf(s,E);return v+=p.slice(E)+s,v}},"format"),dx={};dx.reset=Px(0,0);dx.bold=Px(1,22);dx.dim=Px(2,22);dx.italic=Px(3,23);dx.underline=Px(4,24);dx.overline=Px(53,55);dx.inverse=Px(7,27);dx.hidden=Px(8,28);dx.strikethrough=Px(9,29);dx.black=Px(30,39);dx.red=Px(31,39);dx.green=Px(32,39);dx.yellow=Px(33,39);dx.blue=Px(34,39);dx.magenta=Px(35,39);dx.cyan=Px(36,39);dx.white=Px(37,39);dx.gray=Px(90,39);dx.bgBlack=Px(40,49);dx.bgRed=Px(41,49);dx.bgGreen=Px(42,49);dx.bgYellow=Px(43,49);dx.bgBlue=Px(44,49);dx.bgMagenta=Px(45,49);dx.bgCyan=Px(46,49);dx.bgWhite=Px(47,49);dx.bgGray=Px(100,49);dx.redBright=Px(91,39);dx.greenBright=Px(92,39);dx.yellowBright=Px(93,39);dx.blueBright=Px(94,39);dx.magentaBright=Px(95,39);dx.cyanBright=Px(96,39);dx.whiteBright=Px(97,39);dx.bgRedBright=Px(101,49);dx.bgGreenBright=Px(102,49);dx.bgYellowBright=Px(103,49);dx.bgBlueBright=Px(104,49);dx.bgMagentaBright=Px(105,49);dx.bgCyanBright=Px(106,49);dx.bgWhiteBright=Px(107,49);PSn.exports=dx});var jSn=Qr((cZa,MSn)=>{"use strict";MSn.exports=EGi;function bGi(n){let r={defaultWidth:0,output:process.stdout,tty:require("tty")};return n?(Object.keys(r).forEach(function(i){n[i]||(n[i]=r[i])}),n):r}e(bGi,"normalizeOpts");function EGi(n){let r=bGi(n);if(r.output.getWindowSize)return r.output.getWindowSize()[0]||r.defaultWidth;if(r.tty.getWindowSize)return r.tty.getWindowSize()[1]||r.defaultWidth;if(r.output.columns)return r.output.columns;if(process.env.CLI_WIDTH){let i=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(i)&&i!==0)return i}return r.defaultWidth}e(EGi,"cliWidth")});var QSn=Qr((lZa,USn)=>{"use strict";USn.exports=({onlyFirst:n=!1}={})=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(r,n?void 0:"g")}});var GBt=Qr((pZa,qSn)=>{"use strict";var CGi=QSn();qSn.exports=n=>typeof n=="string"?n.replace(CGi(),""):n});var VSn=Qr((fZa,bNr)=>{"use strict";var $Sn=e(n=>Number.isNaN(n)?!1:n>=4352&&(n<=4447||n===9001||n===9002||11904<=n&&n<=12871&&n!==12351||12880<=n&&n<=19903||19968<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65131||65281<=n&&n<=65376||65504<=n&&n<=65510||110592<=n&&n<=110593||127488<=n&&n<=127569||131072<=n&&n<=262141),"isFullwidthCodePoint");bNr.exports=$Sn;bNr.exports.default=$Sn});var zSn=Qr((_Za,JSn)=>{"use strict";JSn.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var WSn=Qr((mZa,ENr)=>{"use strict";var DGi=GBt(),SGi=VSn(),wGi=zSn(),HSn=e(n=>{if(typeof n!="string"||n.length===0||(n=DGi(n),n.length===0))return 0;n=n.replace(wGi()," ");let r=0;for(let i=0;i<n.length;i++){let s=n.codePointAt(i);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&i++,r+=SGi(s)?2:1)}return r},"stringWidth");ENr.exports=HSn;ENr.exports.default=HSn});var KSn=Qr((gZa,GSn)=>{"use strict";GSn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var CNr=Qr((yZa,XSn)=>{var Jct=KSn(),YSn={};for(let n of Object.keys(Jct))YSn[Jct[n]]=n;var gy={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};XSn.exports=gy;for(let n of Object.keys(gy)){if(!("channels"in gy[n]))throw new Error("missing channels property: "+n);if(!("labels"in gy[n]))throw new Error("missing channel labels property: "+n);if(gy[n].labels.length!==gy[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:r,labels:i}=gy[n];delete gy[n].channels,delete gy[n].labels,Object.defineProperty(gy[n],"channels",{value:r}),Object.defineProperty(gy[n],"labels",{value:i})}gy.rgb.hsl=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.min(r,i,s),p=Math.max(r,i,s),_=p-c,v,E;p===c?v=0:r===p?v=(i-s)/_:i===p?v=2+(s-r)/_:s===p&&(v=4+(r-i)/_),v=Math.min(v*60,360),v<0&&(v+=360);let D=(c+p)/2;return p===c?E=0:D<=.5?E=_/(p+c):E=_/(2-p-c),[v,E*100,D*100]};gy.rgb.hsv=function(n){let r,i,s,c,p,_=n[0]/255,v=n[1]/255,E=n[2]/255,D=Math.max(_,v,E),w=D-Math.min(_,v,E),B=e(function(N){return(D-N)/6/w+1/2},"diffc");return w===0?(c=0,p=0):(p=w/D,r=B(_),i=B(v),s=B(E),_===D?c=s-i:v===D?c=1/3+r-s:E===D&&(c=2/3+i-r),c<0?c+=1:c>1&&(c-=1)),[c*360,p*100,D*100]};gy.rgb.hwb=function(n){let r=n[0],i=n[1],s=n[2],c=gy.rgb.hsl(n)[0],p=1/255*Math.min(r,Math.min(i,s));return s=1-1/255*Math.max(r,Math.max(i,s)),[c,p*100,s*100]};gy.rgb.cmyk=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.min(1-r,1-i,1-s),p=(1-r-c)/(1-c)||0,_=(1-i-c)/(1-c)||0,v=(1-s-c)/(1-c)||0;return[p*100,_*100,v*100,c*100]};function TGi(n,r){return(n[0]-r[0])**2+(n[1]-r[1])**2+(n[2]-r[2])**2}e(TGi,"comparativeDistance");gy.rgb.keyword=function(n){let r=YSn[n];if(r)return r;let i=1/0,s;for(let c of Object.keys(Jct)){let p=Jct[c],_=TGi(n,p);_<i&&(i=_,s=c)}return s};gy.keyword.rgb=function(n){return Jct[n]};gy.rgb.xyz=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let c=r*.4124+i*.3576+s*.1805,p=r*.2126+i*.7152+s*.0722,_=r*.0193+i*.1192+s*.9505;return[c*100,p*100,_*100]};gy.rgb.lab=function(n){let r=gy.rgb.xyz(n),i=r[0],s=r[1],c=r[2];i/=95.047,s/=100,c/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let p=116*s-16,_=500*(i-s),v=200*(s-c);return[p,_,v]};gy.hsl.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100,c,p,_;if(i===0)return _=s*255,[_,_,_];s<.5?c=s*(1+i):c=s+i-s*i;let v=2*s-c,E=[0,0,0];for(let D=0;D<3;D++)p=r+1/3*-(D-1),p<0&&p++,p>1&&p--,6*p<1?_=v+(c-v)*6*p:2*p<1?_=c:3*p<2?_=v+(c-v)*(2/3-p)*6:_=v,E[D]=_*255;return E};gy.hsl.hsv=function(n){let r=n[0],i=n[1]/100,s=n[2]/100,c=i,p=Math.max(s,.01);s*=2,i*=s<=1?s:2-s,c*=p<=1?p:2-p;let _=(s+i)/2,v=s===0?2*c/(p+c):2*i/(s+i);return[r,v*100,_*100]};gy.hsv.rgb=function(n){let r=n[0]/60,i=n[1]/100,s=n[2]/100,c=Math.floor(r)%6,p=r-Math.floor(r),_=255*s*(1-i),v=255*s*(1-i*p),E=255*s*(1-i*(1-p));switch(s*=255,c){case 0:return[s,E,_];case 1:return[v,s,_];case 2:return[_,s,E];case 3:return[_,v,s];case 4:return[E,_,s];case 5:return[s,_,v]}};gy.hsv.hsl=function(n){let r=n[0],i=n[1]/100,s=n[2]/100,c=Math.max(s,.01),p,_;_=(2-i)*s;let v=(2-i)*c;return p=i*c,p/=v<=1?v:2-v,p=p||0,_/=2,[r,p*100,_*100]};gy.hwb.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100,c=i+s,p;c>1&&(i/=c,s/=c);let _=Math.floor(6*r),v=1-s;p=6*r-_,_&1&&(p=1-p);let E=i+p*(v-i),D,w,B;switch(_){default:case 6:case 0:D=v,w=E,B=i;break;case 1:D=E,w=v,B=i;break;case 2:D=i,w=v,B=E;break;case 3:D=i,w=E,B=v;break;case 4:D=E,w=i,B=v;break;case 5:D=v,w=i,B=E;break}return[D*255,w*255,B*255]};gy.cmyk.rgb=function(n){let r=n[0]/100,i=n[1]/100,s=n[2]/100,c=n[3]/100,p=1-Math.min(1,r*(1-c)+c),_=1-Math.min(1,i*(1-c)+c),v=1-Math.min(1,s*(1-c)+c);return[p*255,_*255,v*255]};gy.xyz.rgb=function(n){let r=n[0]/100,i=n[1]/100,s=n[2]/100,c,p,_;return c=r*3.2406+i*-1.5372+s*-.4986,p=r*-.9689+i*1.8758+s*.0415,_=r*.0557+i*-.204+s*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,_=_>.0031308?1.055*_**(1/2.4)-.055:_*12.92,c=Math.min(Math.max(0,c),1),p=Math.min(Math.max(0,p),1),_=Math.min(Math.max(0,_),1),[c*255,p*255,_*255]};gy.xyz.lab=function(n){let r=n[0],i=n[1],s=n[2];r/=95.047,i/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let c=116*i-16,p=500*(r-i),_=200*(i-s);return[c,p,_]};gy.lab.xyz=function(n){let r=n[0],i=n[1],s=n[2],c,p,_;p=(r+16)/116,c=i/500+p,_=p-s/200;let v=p**3,E=c**3,D=_**3;return p=v>.008856?v:(p-16/116)/7.787,c=E>.008856?E:(c-16/116)/7.787,_=D>.008856?D:(_-16/116)/7.787,c*=95.047,p*=100,_*=108.883,[c,p,_]};gy.lab.lch=function(n){let r=n[0],i=n[1],s=n[2],c;c=Math.atan2(s,i)*360/2/Math.PI,c<0&&(c+=360);let _=Math.sqrt(i*i+s*s);return[r,_,c]};gy.lch.lab=function(n){let r=n[0],i=n[1],c=n[2]/360*2*Math.PI,p=i*Math.cos(c),_=i*Math.sin(c);return[r,p,_]};gy.rgb.ansi16=function(n,r=null){let[i,s,c]=n,p=r===null?gy.rgb.hsv(n)[2]:r;if(p=Math.round(p/50),p===0)return 30;let _=30+(Math.round(c/255)<<2|Math.round(s/255)<<1|Math.round(i/255));return p===2&&(_+=60),_};gy.hsv.ansi16=function(n){return gy.rgb.ansi16(gy.hsv.rgb(n),n[2])};gy.rgb.ansi256=function(n){let r=n[0],i=n[1],s=n[2];return r===i&&i===s?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(i/255*5)+Math.round(s/255*5)};gy.ansi16.rgb=function(n){let r=n%10;if(r===0||r===7)return n>50&&(r+=3.5),r=r/10.5*255,[r,r,r];let i=(~~(n>50)+1)*.5,s=(r&1)*i*255,c=(r>>1&1)*i*255,p=(r>>2&1)*i*255;return[s,c,p]};gy.ansi256.rgb=function(n){if(n>=232){let p=(n-232)*10+8;return[p,p,p]}n-=16;let r,i=Math.floor(n/36)/5*255,s=Math.floor((r=n%36)/6)/5*255,c=r%6/5*255;return[i,s,c]};gy.rgb.hex=function(n){let i=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i};gy.hex.rgb=function(n){let r=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];let i=r[0];r[0].length===3&&(i=i.split("").map(v=>v+v).join(""));let s=parseInt(i,16),c=s>>16&255,p=s>>8&255,_=s&255;return[c,p,_]};gy.rgb.hcg=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.max(Math.max(r,i),s),p=Math.min(Math.min(r,i),s),_=c-p,v,E;return _<1?v=p/(1-_):v=0,_<=0?E=0:c===r?E=(i-s)/_%6:c===i?E=2+(s-r)/_:E=4+(r-i)/_,E/=6,E%=1,[E*360,_*100,v*100]};gy.hsl.hcg=function(n){let r=n[1]/100,i=n[2]/100,s=i<.5?2*r*i:2*r*(1-i),c=0;return s<1&&(c=(i-.5*s)/(1-s)),[n[0],s*100,c*100]};gy.hsv.hcg=function(n){let r=n[1]/100,i=n[2]/100,s=r*i,c=0;return s<1&&(c=(i-s)/(1-s)),[n[0],s*100,c*100]};gy.hcg.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100;if(i===0)return[s*255,s*255,s*255];let c=[0,0,0],p=r%1*6,_=p%1,v=1-_,E=0;switch(Math.floor(p)){case 0:c[0]=1,c[1]=_,c[2]=0;break;case 1:c[0]=v,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=_;break;case 3:c[0]=0,c[1]=v,c[2]=1;break;case 4:c[0]=_,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=v}return E=(1-i)*s,[(i*c[0]+E)*255,(i*c[1]+E)*255,(i*c[2]+E)*255]};gy.hcg.hsv=function(n){let r=n[1]/100,i=n[2]/100,s=r+i*(1-r),c=0;return s>0&&(c=r/s),[n[0],c*100,s*100]};gy.hcg.hsl=function(n){let r=n[1]/100,s=n[2]/100*(1-r)+.5*r,c=0;return s>0&&s<.5?c=r/(2*s):s>=.5&&s<1&&(c=r/(2*(1-s))),[n[0],c*100,s*100]};gy.hcg.hwb=function(n){let r=n[1]/100,i=n[2]/100,s=r+i*(1-r);return[n[0],(s-r)*100,(1-s)*100]};gy.hwb.hcg=function(n){let r=n[1]/100,s=1-n[2]/100,c=s-r,p=0;return c<1&&(p=(s-c)/(1-c)),[n[0],c*100,p*100]};gy.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};gy.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};gy.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};gy.gray.hsl=function(n){return[0,0,n[0]]};gy.gray.hsv=gy.gray.hsl;gy.gray.hwb=function(n){return[0,100,n[0]]};gy.gray.cmyk=function(n){return[0,0,0,n[0]]};gy.gray.lab=function(n){return[n[0],0,0]};gy.gray.hex=function(n){let r=Math.round(n[0]/100*255)&255,s=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".substring(s.length)+s};gy.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var e3n=Qr((AZa,ZSn)=>{var KBt=CNr();function kGi(){let n={},r=Object.keys(KBt);for(let i=r.length,s=0;s<i;s++)n[r[s]]={distance:-1,parent:null};return n}e(kGi,"buildGraph");function IGi(n){let r=kGi(),i=[n];for(r[n].distance=0;i.length;){let s=i.pop(),c=Object.keys(KBt[s]);for(let p=c.length,_=0;_<p;_++){let v=c[_],E=r[v];E.distance===-1&&(E.distance=r[s].distance+1,E.parent=s,i.unshift(v))}}return r}e(IGi,"deriveBFS");function FGi(n,r){return function(i){return r(n(i))}}e(FGi,"link");function PGi(n,r){let i=[r[n].parent,n],s=KBt[r[n].parent][n],c=r[n].parent;for(;r[c].parent;)i.unshift(r[c].parent),s=FGi(KBt[r[c].parent][c],s),c=r[c].parent;return s.conversion=i,s}e(PGi,"wrapConversion");ZSn.exports=function(n){let r=IGi(n),i={},s=Object.keys(r);for(let c=s.length,p=0;p<c;p++){let _=s[p];r[_].parent!==null&&(i[_]=PGi(_,r))}return i}});var r3n=Qr((bZa,t3n)=>{var DNr=CNr(),NGi=e3n(),LQe={},BGi=Object.keys(DNr);function OGi(n){let r=e(function(...i){let s=i[0];return s==null?s:(s.length>1&&(i=s),n(i))},"wrappedFn");return"conversion"in n&&(r.conversion=n.conversion),r}e(OGi,"wrapRaw");function RGi(n){let r=e(function(...i){let s=i[0];if(s==null)return s;s.length>1&&(i=s);let c=n(i);if(typeof c=="object")for(let p=c.length,_=0;_<p;_++)c[_]=Math.round(c[_]);return c},"wrappedFn");return"conversion"in n&&(r.conversion=n.conversion),r}e(RGi,"wrapRounded");BGi.forEach(n=>{LQe[n]={},Object.defineProperty(LQe[n],"channels",{value:DNr[n].channels}),Object.defineProperty(LQe[n],"labels",{value:DNr[n].labels});let r=NGi(n);Object.keys(r).forEach(s=>{let c=r[s];LQe[n][s]=RGi(c),LQe[n][s].raw=OGi(c)})});t3n.exports=LQe});var c3n=Qr((CZa,o3n)=>{"use strict";var n3n=e((n,r)=>(...i)=>`\x1B[${n(...i)+r}m`,"wrapAnsi16"),i3n=e((n,r)=>(...i)=>{let s=n(...i);return`\x1B[${38+r};5;${s}m`},"wrapAnsi256"),a3n=e((n,r)=>(...i)=>{let s=n(...i);return`\x1B[${38+r};2;${s[0]};${s[1]};${s[2]}m`},"wrapAnsi16m"),YBt=e(n=>n,"ansi2ansi"),s3n=e((n,r,i)=>[n,r,i],"rgb2rgb"),MQe=e((n,r,i)=>{Object.defineProperty(n,r,{get:e(()=>{let s=i();return Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0}),s},"get"),enumerable:!0,configurable:!0})},"setLazyProperty"),SNr,jQe=e((n,r,i,s)=>{SNr===void 0&&(SNr=r3n());let c=s?10:0,p={};for(let[_,v]of Object.entries(SNr)){let E=_==="ansi16"?"ansi":_;_===r?p[E]=n(i,c):typeof v=="object"&&(p[E]=n(v[r],c))}return p},"makeDynamicStyles");function LGi(){let n=new Map,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright,r.bgColor.bgGray=r.bgColor.bgBlackBright,r.color.grey=r.color.blackBright,r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(let[i,s]of Object.entries(r)){for(let[c,p]of Object.entries(s))r[c]={open:`\x1B[${p[0]}m`,close:`\x1B[${p[1]}m`},s[c]=r[c],n.set(p[0],p[1]);Object.defineProperty(r,i,{value:s,enumerable:!1})}return Object.defineProperty(r,"codes",{value:n,enumerable:!1}),r.color.close="\x1B[39m",r.bgColor.close="\x1B[49m",MQe(r.color,"ansi",()=>jQe(n3n,"ansi16",YBt,!1)),MQe(r.color,"ansi256",()=>jQe(i3n,"ansi256",YBt,!1)),MQe(r.color,"ansi16m",()=>jQe(a3n,"rgb",s3n,!1)),MQe(r.bgColor,"ansi",()=>jQe(n3n,"ansi16",YBt,!0)),MQe(r.bgColor,"ansi256",()=>jQe(i3n,"ansi256",YBt,!0)),MQe(r.bgColor,"ansi16m",()=>jQe(a3n,"rgb",s3n,!0)),r}e(LGi,"assembleStyles");Object.defineProperty(o3n,"exports",{enumerable:!0,get:LGi})});var p3n=Qr((SZa,l3n)=>{"use strict";var zct=WSn(),MGi=GBt(),jGi=c3n(),TNr=new Set(["\x1B","\x9B"]),UGi=39,u3n=e(n=>`${TNr.values().next().value}[${n}m`,"wrapAnsi"),QGi=e(n=>n.split(" ").map(r=>zct(r)),"wordLengths"),wNr=e((n,r,i)=>{let s=[...r],c=!1,p=zct(MGi(n[n.length-1]));for(let[_,v]of s.entries()){let E=zct(v);if(p+E<=i?n[n.length-1]+=v:(n.push(v),p=0),TNr.has(v))c=!0;else if(c&&v==="m"){c=!1;continue}c||(p+=E,p===i&&_<s.length-1&&(n.push(""),p=0))}!p&&n[n.length-1].length>0&&n.length>1&&(n[n.length-2]+=n.pop())},"wrapWord"),qGi=e(n=>{let r=n.split(" "),i=r.length;for(;i>0&&!(zct(r[i-1])>0);)i--;return i===r.length?n:r.slice(0,i).join(" ")+r.slice(i).join("")},"stringVisibleTrimSpacesRight"),$Gi=e((n,r,i={})=>{if(i.trim!==!1&&n.trim()==="")return"";let s="",c="",p,_=QGi(n),v=[""];for(let[E,D]of n.split(" ").entries()){i.trim!==!1&&(v[v.length-1]=v[v.length-1].trimLeft());let w=zct(v[v.length-1]);if(E!==0&&(w>=r&&(i.wordWrap===!1||i.trim===!1)&&(v.push(""),w=0),(w>0||i.trim===!1)&&(v[v.length-1]+=" ",w++)),i.hard&&_[E]>r){let B=r-w,N=1+Math.floor((_[E]-B-1)/r);Math.floor((_[E]-1)/r)<N&&v.push(""),wNr(v,D,r);continue}if(w+_[E]>r&&w>0&&_[E]>0){if(i.wordWrap===!1&&w<r){wNr(v,D,r);continue}v.push("")}if(w+_[E]>r&&i.wordWrap===!1){wNr(v,D,r);continue}v[v.length-1]+=D}i.trim!==!1&&(v=v.map(qGi)),s=v.join(`
742
+ `,p),p}}function hye(n){let{config:r,folder:i,throwIfAuthFailed:s}=n,c=pGi(i);return async(p,{role:_,environment:v}={})=>{let E=process.env.CHECKSUM_RUNTIME_ENV_OVERRIDE_NAME??v,D=process.env.CHECKSUM_RUNTIME_ENV_OVERRIDE_ROLE??_,{environment:w,user:B}=$ct(r,{role:D,environment:E},n.throwIfEnvInfoInvalid);if(s&&!B)throw new Error("Could not find user credentials matching the provided role and/or environment");await fGi(p,c,{environment:w,user:B,config:r})}}function DSn(n,{environmentName:r,userRole:i}){let s=hye(n);return c=>s(c,{environment:r,role:i})}function SIt(){if(PQe)return PQe;try{let n=(0,MBt.existsSync)(`${Ote()}/checksum.config.ts`)?"checksum.config.ts":(0,MBt.existsSync)(`${Ote()}/checksum.config.tmp.ts`)?"checksum.config.tmp.ts":void 0;if(n)return jBt(require(`${Ote()}/${n}`).default)}catch{console.warn("Could not find checksum config file, will run with defaults")}return jBt()}function jBt(n={}){var i,s,c,p;let r={apiKey:void 0,runMode:"normal",apiURL:"https://api.checksum.ai",options:{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1,skipTestsWithKnownBugs:!0},newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,consecutiveActionDelay:100,hideReports:process.env.AUTHORIZE_REPORTS==="true"}};return((s=(i=n.options)==null?void 0:i.useChecksumAI)==null?void 0:s.visualComparison)===void 0&&((p=(c=n.options)==null?void 0:c.useChecksumAI)!=null&&p.assertions)&&(n.options.useChecksumAI.visualComparison=!0),PQe=LBt(r,n),Hd.testRun.disableAutoRecovery&&(PQe.options.useChecksumAI={actions:!1,assertions:!1,visualComparison:!1}),Hd.testRun.disableHostReports&&(PQe.options.hostReports=!1),PQe}function OBt(n){let r=e(i=>{i.on("dialog",s=>{})},"makeDialogHandler");n.context().pages().forEach(r),n.context().on("page",i=>{r(i)})}var MBt,CSn,PQe,pCe,xU=Ws(()=>{"use strict";uNr();iS();BEe();MBt=require("fs");aw();pNr();CSn=!1;e(ySn,"setLogToConsole");e(mv,"log");e(Icn,"executePlaywrightMethodWithTimeout");e($ct,"resolveEnvironment");e(pGi,"requireLogin");e(fGi,"proceedWithLogin");e(hye,"makeUnboundLogin");e(DSn,"makeBoundLogin");e(SIt,"loadChecksumConfig");e(jBt,"getChecksumConfig");e(OBt,"preventDialogAutoDismissal");pCe="Checksum failed connecting to the server"});var P6e=Qr((OXa,PSn)=>{var ANr=require("tty"),ISn,HBt,FSn,mGi=((FSn=(HBt=(ISn=ANr==null?void 0:ANr.WriteStream)==null?void 0:ISn.prototype)==null?void 0:HBt.hasColors)==null?void 0:FSn.call(HBt))??!1,Px=e((n,r)=>{if(!mGi)return c=>c;let i=`\x1B[${n}m`,s=`\x1B[${r}m`;return c=>{let p=c+"",_=p.indexOf(s);if(_===-1)return i+p+s;let v=i,E=0;for(;_!==-1;)v+=p.slice(E,_)+i,E=_+s.length,_=p.indexOf(s,E);return v+=p.slice(E)+s,v}},"format"),dx={};dx.reset=Px(0,0);dx.bold=Px(1,22);dx.dim=Px(2,22);dx.italic=Px(3,23);dx.underline=Px(4,24);dx.overline=Px(53,55);dx.inverse=Px(7,27);dx.hidden=Px(8,28);dx.strikethrough=Px(9,29);dx.black=Px(30,39);dx.red=Px(31,39);dx.green=Px(32,39);dx.yellow=Px(33,39);dx.blue=Px(34,39);dx.magenta=Px(35,39);dx.cyan=Px(36,39);dx.white=Px(37,39);dx.gray=Px(90,39);dx.bgBlack=Px(40,49);dx.bgRed=Px(41,49);dx.bgGreen=Px(42,49);dx.bgYellow=Px(43,49);dx.bgBlue=Px(44,49);dx.bgMagenta=Px(45,49);dx.bgCyan=Px(46,49);dx.bgWhite=Px(47,49);dx.bgGray=Px(100,49);dx.redBright=Px(91,39);dx.greenBright=Px(92,39);dx.yellowBright=Px(93,39);dx.blueBright=Px(94,39);dx.magentaBright=Px(95,39);dx.cyanBright=Px(96,39);dx.whiteBright=Px(97,39);dx.bgRedBright=Px(101,49);dx.bgGreenBright=Px(102,49);dx.bgYellowBright=Px(103,49);dx.bgBlueBright=Px(104,49);dx.bgMagentaBright=Px(105,49);dx.bgCyanBright=Px(106,49);dx.bgWhiteBright=Px(107,49);PSn.exports=dx});var jSn=Qr((cZa,MSn)=>{"use strict";MSn.exports=EGi;function bGi(n){let r={defaultWidth:0,output:process.stdout,tty:require("tty")};return n?(Object.keys(r).forEach(function(i){n[i]||(n[i]=r[i])}),n):r}e(bGi,"normalizeOpts");function EGi(n){let r=bGi(n);if(r.output.getWindowSize)return r.output.getWindowSize()[0]||r.defaultWidth;if(r.tty.getWindowSize)return r.tty.getWindowSize()[1]||r.defaultWidth;if(r.output.columns)return r.output.columns;if(process.env.CLI_WIDTH){let i=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(i)&&i!==0)return i}return r.defaultWidth}e(EGi,"cliWidth")});var QSn=Qr((lZa,USn)=>{"use strict";USn.exports=({onlyFirst:n=!1}={})=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(r,n?void 0:"g")}});var GBt=Qr((pZa,qSn)=>{"use strict";var CGi=QSn();qSn.exports=n=>typeof n=="string"?n.replace(CGi(),""):n});var VSn=Qr((fZa,bNr)=>{"use strict";var $Sn=e(n=>Number.isNaN(n)?!1:n>=4352&&(n<=4447||n===9001||n===9002||11904<=n&&n<=12871&&n!==12351||12880<=n&&n<=19903||19968<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65131||65281<=n&&n<=65376||65504<=n&&n<=65510||110592<=n&&n<=110593||127488<=n&&n<=127569||131072<=n&&n<=262141),"isFullwidthCodePoint");bNr.exports=$Sn;bNr.exports.default=$Sn});var zSn=Qr((_Za,JSn)=>{"use strict";JSn.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var WSn=Qr((mZa,ENr)=>{"use strict";var DGi=GBt(),SGi=VSn(),wGi=zSn(),HSn=e(n=>{if(typeof n!="string"||n.length===0||(n=DGi(n),n.length===0))return 0;n=n.replace(wGi()," ");let r=0;for(let i=0;i<n.length;i++){let s=n.codePointAt(i);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&i++,r+=SGi(s)?2:1)}return r},"stringWidth");ENr.exports=HSn;ENr.exports.default=HSn});var KSn=Qr((gZa,GSn)=>{"use strict";GSn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var CNr=Qr((yZa,XSn)=>{var Jct=KSn(),YSn={};for(let n of Object.keys(Jct))YSn[Jct[n]]=n;var gy={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};XSn.exports=gy;for(let n of Object.keys(gy)){if(!("channels"in gy[n]))throw new Error("missing channels property: "+n);if(!("labels"in gy[n]))throw new Error("missing channel labels property: "+n);if(gy[n].labels.length!==gy[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:r,labels:i}=gy[n];delete gy[n].channels,delete gy[n].labels,Object.defineProperty(gy[n],"channels",{value:r}),Object.defineProperty(gy[n],"labels",{value:i})}gy.rgb.hsl=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.min(r,i,s),p=Math.max(r,i,s),_=p-c,v,E;p===c?v=0:r===p?v=(i-s)/_:i===p?v=2+(s-r)/_:s===p&&(v=4+(r-i)/_),v=Math.min(v*60,360),v<0&&(v+=360);let D=(c+p)/2;return p===c?E=0:D<=.5?E=_/(p+c):E=_/(2-p-c),[v,E*100,D*100]};gy.rgb.hsv=function(n){let r,i,s,c,p,_=n[0]/255,v=n[1]/255,E=n[2]/255,D=Math.max(_,v,E),w=D-Math.min(_,v,E),B=e(function(N){return(D-N)/6/w+1/2},"diffc");return w===0?(c=0,p=0):(p=w/D,r=B(_),i=B(v),s=B(E),_===D?c=s-i:v===D?c=1/3+r-s:E===D&&(c=2/3+i-r),c<0?c+=1:c>1&&(c-=1)),[c*360,p*100,D*100]};gy.rgb.hwb=function(n){let r=n[0],i=n[1],s=n[2],c=gy.rgb.hsl(n)[0],p=1/255*Math.min(r,Math.min(i,s));return s=1-1/255*Math.max(r,Math.max(i,s)),[c,p*100,s*100]};gy.rgb.cmyk=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.min(1-r,1-i,1-s),p=(1-r-c)/(1-c)||0,_=(1-i-c)/(1-c)||0,v=(1-s-c)/(1-c)||0;return[p*100,_*100,v*100,c*100]};function TGi(n,r){return(n[0]-r[0])**2+(n[1]-r[1])**2+(n[2]-r[2])**2}e(TGi,"comparativeDistance");gy.rgb.keyword=function(n){let r=YSn[n];if(r)return r;let i=1/0,s;for(let c of Object.keys(Jct)){let p=Jct[c],_=TGi(n,p);_<i&&(i=_,s=c)}return s};gy.keyword.rgb=function(n){return Jct[n]};gy.rgb.xyz=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let c=r*.4124+i*.3576+s*.1805,p=r*.2126+i*.7152+s*.0722,_=r*.0193+i*.1192+s*.9505;return[c*100,p*100,_*100]};gy.rgb.lab=function(n){let r=gy.rgb.xyz(n),i=r[0],s=r[1],c=r[2];i/=95.047,s/=100,c/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let p=116*s-16,_=500*(i-s),v=200*(s-c);return[p,_,v]};gy.hsl.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100,c,p,_;if(i===0)return _=s*255,[_,_,_];s<.5?c=s*(1+i):c=s+i-s*i;let v=2*s-c,E=[0,0,0];for(let D=0;D<3;D++)p=r+1/3*-(D-1),p<0&&p++,p>1&&p--,6*p<1?_=v+(c-v)*6*p:2*p<1?_=c:3*p<2?_=v+(c-v)*(2/3-p)*6:_=v,E[D]=_*255;return E};gy.hsl.hsv=function(n){let r=n[0],i=n[1]/100,s=n[2]/100,c=i,p=Math.max(s,.01);s*=2,i*=s<=1?s:2-s,c*=p<=1?p:2-p;let _=(s+i)/2,v=s===0?2*c/(p+c):2*i/(s+i);return[r,v*100,_*100]};gy.hsv.rgb=function(n){let r=n[0]/60,i=n[1]/100,s=n[2]/100,c=Math.floor(r)%6,p=r-Math.floor(r),_=255*s*(1-i),v=255*s*(1-i*p),E=255*s*(1-i*(1-p));switch(s*=255,c){case 0:return[s,E,_];case 1:return[v,s,_];case 2:return[_,s,E];case 3:return[_,v,s];case 4:return[E,_,s];case 5:return[s,_,v]}};gy.hsv.hsl=function(n){let r=n[0],i=n[1]/100,s=n[2]/100,c=Math.max(s,.01),p,_;_=(2-i)*s;let v=(2-i)*c;return p=i*c,p/=v<=1?v:2-v,p=p||0,_/=2,[r,p*100,_*100]};gy.hwb.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100,c=i+s,p;c>1&&(i/=c,s/=c);let _=Math.floor(6*r),v=1-s;p=6*r-_,_&1&&(p=1-p);let E=i+p*(v-i),D,w,B;switch(_){default:case 6:case 0:D=v,w=E,B=i;break;case 1:D=E,w=v,B=i;break;case 2:D=i,w=v,B=E;break;case 3:D=i,w=E,B=v;break;case 4:D=E,w=i,B=v;break;case 5:D=v,w=i,B=E;break}return[D*255,w*255,B*255]};gy.cmyk.rgb=function(n){let r=n[0]/100,i=n[1]/100,s=n[2]/100,c=n[3]/100,p=1-Math.min(1,r*(1-c)+c),_=1-Math.min(1,i*(1-c)+c),v=1-Math.min(1,s*(1-c)+c);return[p*255,_*255,v*255]};gy.xyz.rgb=function(n){let r=n[0]/100,i=n[1]/100,s=n[2]/100,c,p,_;return c=r*3.2406+i*-1.5372+s*-.4986,p=r*-.9689+i*1.8758+s*.0415,_=r*.0557+i*-.204+s*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,_=_>.0031308?1.055*_**(1/2.4)-.055:_*12.92,c=Math.min(Math.max(0,c),1),p=Math.min(Math.max(0,p),1),_=Math.min(Math.max(0,_),1),[c*255,p*255,_*255]};gy.xyz.lab=function(n){let r=n[0],i=n[1],s=n[2];r/=95.047,i/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let c=116*i-16,p=500*(r-i),_=200*(i-s);return[c,p,_]};gy.lab.xyz=function(n){let r=n[0],i=n[1],s=n[2],c,p,_;p=(r+16)/116,c=i/500+p,_=p-s/200;let v=p**3,E=c**3,D=_**3;return p=v>.008856?v:(p-16/116)/7.787,c=E>.008856?E:(c-16/116)/7.787,_=D>.008856?D:(_-16/116)/7.787,c*=95.047,p*=100,_*=108.883,[c,p,_]};gy.lab.lch=function(n){let r=n[0],i=n[1],s=n[2],c;c=Math.atan2(s,i)*360/2/Math.PI,c<0&&(c+=360);let _=Math.sqrt(i*i+s*s);return[r,_,c]};gy.lch.lab=function(n){let r=n[0],i=n[1],c=n[2]/360*2*Math.PI,p=i*Math.cos(c),_=i*Math.sin(c);return[r,p,_]};gy.rgb.ansi16=function(n,r=null){let[i,s,c]=n,p=r===null?gy.rgb.hsv(n)[2]:r;if(p=Math.round(p/50),p===0)return 30;let _=30+(Math.round(c/255)<<2|Math.round(s/255)<<1|Math.round(i/255));return p===2&&(_+=60),_};gy.hsv.ansi16=function(n){return gy.rgb.ansi16(gy.hsv.rgb(n),n[2])};gy.rgb.ansi256=function(n){let r=n[0],i=n[1],s=n[2];return r===i&&i===s?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(i/255*5)+Math.round(s/255*5)};gy.ansi16.rgb=function(n){let r=n%10;if(r===0||r===7)return n>50&&(r+=3.5),r=r/10.5*255,[r,r,r];let i=(~~(n>50)+1)*.5,s=(r&1)*i*255,c=(r>>1&1)*i*255,p=(r>>2&1)*i*255;return[s,c,p]};gy.ansi256.rgb=function(n){if(n>=232){let p=(n-232)*10+8;return[p,p,p]}n-=16;let r,i=Math.floor(n/36)/5*255,s=Math.floor((r=n%36)/6)/5*255,c=r%6/5*255;return[i,s,c]};gy.rgb.hex=function(n){let i=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i};gy.hex.rgb=function(n){let r=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];let i=r[0];r[0].length===3&&(i=i.split("").map(v=>v+v).join(""));let s=parseInt(i,16),c=s>>16&255,p=s>>8&255,_=s&255;return[c,p,_]};gy.rgb.hcg=function(n){let r=n[0]/255,i=n[1]/255,s=n[2]/255,c=Math.max(Math.max(r,i),s),p=Math.min(Math.min(r,i),s),_=c-p,v,E;return _<1?v=p/(1-_):v=0,_<=0?E=0:c===r?E=(i-s)/_%6:c===i?E=2+(s-r)/_:E=4+(r-i)/_,E/=6,E%=1,[E*360,_*100,v*100]};gy.hsl.hcg=function(n){let r=n[1]/100,i=n[2]/100,s=i<.5?2*r*i:2*r*(1-i),c=0;return s<1&&(c=(i-.5*s)/(1-s)),[n[0],s*100,c*100]};gy.hsv.hcg=function(n){let r=n[1]/100,i=n[2]/100,s=r*i,c=0;return s<1&&(c=(i-s)/(1-s)),[n[0],s*100,c*100]};gy.hcg.rgb=function(n){let r=n[0]/360,i=n[1]/100,s=n[2]/100;if(i===0)return[s*255,s*255,s*255];let c=[0,0,0],p=r%1*6,_=p%1,v=1-_,E=0;switch(Math.floor(p)){case 0:c[0]=1,c[1]=_,c[2]=0;break;case 1:c[0]=v,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=_;break;case 3:c[0]=0,c[1]=v,c[2]=1;break;case 4:c[0]=_,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=v}return E=(1-i)*s,[(i*c[0]+E)*255,(i*c[1]+E)*255,(i*c[2]+E)*255]};gy.hcg.hsv=function(n){let r=n[1]/100,i=n[2]/100,s=r+i*(1-r),c=0;return s>0&&(c=r/s),[n[0],c*100,s*100]};gy.hcg.hsl=function(n){let r=n[1]/100,s=n[2]/100*(1-r)+.5*r,c=0;return s>0&&s<.5?c=r/(2*s):s>=.5&&s<1&&(c=r/(2*(1-s))),[n[0],c*100,s*100]};gy.hcg.hwb=function(n){let r=n[1]/100,i=n[2]/100,s=r+i*(1-r);return[n[0],(s-r)*100,(1-s)*100]};gy.hwb.hcg=function(n){let r=n[1]/100,s=1-n[2]/100,c=s-r,p=0;return c<1&&(p=(s-c)/(1-c)),[n[0],c*100,p*100]};gy.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};gy.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};gy.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};gy.gray.hsl=function(n){return[0,0,n[0]]};gy.gray.hsv=gy.gray.hsl;gy.gray.hwb=function(n){return[0,100,n[0]]};gy.gray.cmyk=function(n){return[0,0,0,n[0]]};gy.gray.lab=function(n){return[n[0],0,0]};gy.gray.hex=function(n){let r=Math.round(n[0]/100*255)&255,s=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".substring(s.length)+s};gy.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var e3n=Qr((AZa,ZSn)=>{var KBt=CNr();function kGi(){let n={},r=Object.keys(KBt);for(let i=r.length,s=0;s<i;s++)n[r[s]]={distance:-1,parent:null};return n}e(kGi,"buildGraph");function IGi(n){let r=kGi(),i=[n];for(r[n].distance=0;i.length;){let s=i.pop(),c=Object.keys(KBt[s]);for(let p=c.length,_=0;_<p;_++){let v=c[_],E=r[v];E.distance===-1&&(E.distance=r[s].distance+1,E.parent=s,i.unshift(v))}}return r}e(IGi,"deriveBFS");function FGi(n,r){return function(i){return r(n(i))}}e(FGi,"link");function PGi(n,r){let i=[r[n].parent,n],s=KBt[r[n].parent][n],c=r[n].parent;for(;r[c].parent;)i.unshift(r[c].parent),s=FGi(KBt[r[c].parent][c],s),c=r[c].parent;return s.conversion=i,s}e(PGi,"wrapConversion");ZSn.exports=function(n){let r=IGi(n),i={},s=Object.keys(r);for(let c=s.length,p=0;p<c;p++){let _=s[p];r[_].parent!==null&&(i[_]=PGi(_,r))}return i}});var r3n=Qr((bZa,t3n)=>{var DNr=CNr(),NGi=e3n(),LQe={},BGi=Object.keys(DNr);function OGi(n){let r=e(function(...i){let s=i[0];return s==null?s:(s.length>1&&(i=s),n(i))},"wrappedFn");return"conversion"in n&&(r.conversion=n.conversion),r}e(OGi,"wrapRaw");function RGi(n){let r=e(function(...i){let s=i[0];if(s==null)return s;s.length>1&&(i=s);let c=n(i);if(typeof c=="object")for(let p=c.length,_=0;_<p;_++)c[_]=Math.round(c[_]);return c},"wrappedFn");return"conversion"in n&&(r.conversion=n.conversion),r}e(RGi,"wrapRounded");BGi.forEach(n=>{LQe[n]={},Object.defineProperty(LQe[n],"channels",{value:DNr[n].channels}),Object.defineProperty(LQe[n],"labels",{value:DNr[n].labels});let r=NGi(n);Object.keys(r).forEach(s=>{let c=r[s];LQe[n][s]=RGi(c),LQe[n][s].raw=OGi(c)})});t3n.exports=LQe});var c3n=Qr((CZa,o3n)=>{"use strict";var n3n=e((n,r)=>(...i)=>`\x1B[${n(...i)+r}m`,"wrapAnsi16"),i3n=e((n,r)=>(...i)=>{let s=n(...i);return`\x1B[${38+r};5;${s}m`},"wrapAnsi256"),a3n=e((n,r)=>(...i)=>{let s=n(...i);return`\x1B[${38+r};2;${s[0]};${s[1]};${s[2]}m`},"wrapAnsi16m"),YBt=e(n=>n,"ansi2ansi"),s3n=e((n,r,i)=>[n,r,i],"rgb2rgb"),MQe=e((n,r,i)=>{Object.defineProperty(n,r,{get:e(()=>{let s=i();return Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0}),s},"get"),enumerable:!0,configurable:!0})},"setLazyProperty"),SNr,jQe=e((n,r,i,s)=>{SNr===void 0&&(SNr=r3n());let c=s?10:0,p={};for(let[_,v]of Object.entries(SNr)){let E=_==="ansi16"?"ansi":_;_===r?p[E]=n(i,c):typeof v=="object"&&(p[E]=n(v[r],c))}return p},"makeDynamicStyles");function LGi(){let n=new Map,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright,r.bgColor.bgGray=r.bgColor.bgBlackBright,r.color.grey=r.color.blackBright,r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(let[i,s]of Object.entries(r)){for(let[c,p]of Object.entries(s))r[c]={open:`\x1B[${p[0]}m`,close:`\x1B[${p[1]}m`},s[c]=r[c],n.set(p[0],p[1]);Object.defineProperty(r,i,{value:s,enumerable:!1})}return Object.defineProperty(r,"codes",{value:n,enumerable:!1}),r.color.close="\x1B[39m",r.bgColor.close="\x1B[49m",MQe(r.color,"ansi",()=>jQe(n3n,"ansi16",YBt,!1)),MQe(r.color,"ansi256",()=>jQe(i3n,"ansi256",YBt,!1)),MQe(r.color,"ansi16m",()=>jQe(a3n,"rgb",s3n,!1)),MQe(r.bgColor,"ansi",()=>jQe(n3n,"ansi16",YBt,!0)),MQe(r.bgColor,"ansi256",()=>jQe(i3n,"ansi256",YBt,!0)),MQe(r.bgColor,"ansi16m",()=>jQe(a3n,"rgb",s3n,!0)),r}e(LGi,"assembleStyles");Object.defineProperty(o3n,"exports",{enumerable:!0,get:LGi})});var p3n=Qr((SZa,l3n)=>{"use strict";var zct=WSn(),MGi=GBt(),jGi=c3n(),TNr=new Set(["\x1B","\x9B"]),UGi=39,u3n=e(n=>`${TNr.values().next().value}[${n}m`,"wrapAnsi"),QGi=e(n=>n.split(" ").map(r=>zct(r)),"wordLengths"),wNr=e((n,r,i)=>{let s=[...r],c=!1,p=zct(MGi(n[n.length-1]));for(let[_,v]of s.entries()){let E=zct(v);if(p+E<=i?n[n.length-1]+=v:(n.push(v),p=0),TNr.has(v))c=!0;else if(c&&v==="m"){c=!1;continue}c||(p+=E,p===i&&_<s.length-1&&(n.push(""),p=0))}!p&&n[n.length-1].length>0&&n.length>1&&(n[n.length-2]+=n.pop())},"wrapWord"),qGi=e(n=>{let r=n.split(" "),i=r.length;for(;i>0&&!(zct(r[i-1])>0);)i--;return i===r.length?n:r.slice(0,i).join(" ")+r.slice(i).join("")},"stringVisibleTrimSpacesRight"),$Gi=e((n,r,i={})=>{if(i.trim!==!1&&n.trim()==="")return"";let s="",c="",p,_=QGi(n),v=[""];for(let[E,D]of n.split(" ").entries()){i.trim!==!1&&(v[v.length-1]=v[v.length-1].trimLeft());let w=zct(v[v.length-1]);if(E!==0&&(w>=r&&(i.wordWrap===!1||i.trim===!1)&&(v.push(""),w=0),(w>0||i.trim===!1)&&(v[v.length-1]+=" ",w++)),i.hard&&_[E]>r){let B=r-w,N=1+Math.floor((_[E]-B-1)/r);Math.floor((_[E]-1)/r)<N&&v.push(""),wNr(v,D,r);continue}if(w+_[E]>r&&w>0&&_[E]>0){if(i.wordWrap===!1&&w<r){wNr(v,D,r);continue}v.push("")}if(w+_[E]>r&&i.wordWrap===!1){wNr(v,D,r);continue}v[v.length-1]+=D}i.trim!==!1&&(v=v.map(qGi)),s=v.join(`
743
743
  `);for(let[E,D]of[...s].entries()){if(c+=D,TNr.has(D)){let B=parseFloat(/\d[^m]*/.exec(s.slice(E,E+4)));p=B===UGi?null:B}let w=jGi.codes.get(Number(p));p&&w&&(s[E+1]===`
744
744
  `?c+=u3n(w):D===`
745
745
  `&&(c+=u3n(p)))}return c},"exec");l3n.exports=(n,r,i)=>String(n).normalize().replace(/\r\n/g,`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksum-ai/runtime",
3
- "version": "3.0.2",
3
+ "version": "3.0.3-alpha.1",
4
4
  "description": "Checksum.ai test runtime",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -750,7 +750,7 @@ ${c}`;return{success:!0,pages:s,message:p}}async switchPageHandler(i){if(!i.page
750
750
  ${r}`)}get createChecksumStep(){return r=>this.checksumPage.createChecksumStep(r)}get step(){return this.checksumPage.step.bind(this.checksumPage)}get runConditionallyWithinStep(){return(r,i,s)=>this.checksumPage.runConditionallyWithinStep(r,i,s)}async getScreenshotForElement(r){var i;try{let s=await this.getSelectionDataForChecksumId(r);if(!s)throw new Error(`Locator not found for checksumId: ${r}`);let c=((i=this.arConfig.modelConfig)==null?void 0:i.provider)==="anthropic"?"jpeg":"png";return(await this.page.locator(s.selector).screenshot({type:c})).toString("base64")}catch{throw new Error(`Failed to get screenshot for element: ${r}`)}}get analytics(){return this._analytics}get pageInteractor(){return this._pageInteractor}};e(K5e,"AutoRecoveryRuntimeIteratorUtils"),K5e.currentChecksumId="0";ZBt=K5e});var fye,dye,v8n=Ws(()=>{"use strict";t0e();kst();d8n();y8n();Kwe();fye=class fye extends w0e{constructor(r,i,s,c,p,_,v){super(r,i,s,c,p,_,v),this.runtimePageContext=_}init(r){var i;return this.initializationData=r,(i=this.initializationData.fallbackConfig).arMode??(i.arMode="fast"),this}canResolve(r){return!0}get failingThought(){return this.initializationData.thoughts.failing}getRecoveryAttemptTitle(){switch(this.initializationData.type){case"action":return`Checksum Auto-Recovery: trying to achieve action "${this.failingThought}"...`;case"assertion":return`Checksum Auto-Recovery: trying to verify assertion "${this.failingThought}"...`}}static async registerSession(r){let i=r.config.apiURL,s=r.config.apiKey;return await(await fetch(`${i}${fye.API_BASE_ROUTE}/register-auto-recovery-session`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:s},body:JSON.stringify({appName:r.testIdentification.testFileName,fallbackData:r})})).json()}async prepareSession(r){let i=await fye.registerSession(this.initializationData);this.utils=new ZBt({page:this.page,evaluateWithChecksum:this.evaluateWithChecksum,checksumPage:this.checksumPage,pageInteractor:this.pageInteractor,arConfig:i.arConfig,sessionId:i.sessionId,runtimeFallbackData:this.initializationData,fallbackData:r,variableStore:this.variables,runtimePage:this.runtimePageContext,context:this.context});try{this.agent=await KBt.build(this.utils)}catch(s){let c=s instanceof Error?s.message:String(s),p=s instanceof Error?s.stack:void 0;throw new Error(`Failed to prepare ARFallback: ${c}`)}}async resolve(r){let i=null,s=new Promise((p,_)=>{i=setTimeout(()=>{i=null,this.utils.analytics.ARError({error:`Auto-recovery timed out after ${fye.TIMEOUT_MS/1e3} seconds`});let v="Auto-Recovery attempt finished unsuccessfully";this.utils.createChecksumStep({title:v,withError:!0}),this.utils.addAutoRecoveryErrorToReport(v,!1),_(new Error(v))},fye.TIMEOUT_MS)}),c=Date.now();await this.prepareSession(r),this.utils.analytics.ARStart();try{let p=await Promise.race([this.agent.init(),s]);return i!==null&&(clearTimeout(i),i=null),this.utils.analytics.ARFinish({duration:Date.now()-c}),{fbResult:p.result,thought:p.finalThought,stepsThoughts:p.stepsThoughts,steps:[]}}catch(p){throw i!==null&&(clearTimeout(i),i=null),this.utils.analytics.ARFinish({duration:Date.now()-c}),p}}};e(fye,"ARFallback"),fye.API_BASE_ROUTE="/auto-recovery",fye.TIMEOUT_MS=12e4;dye=fye});var A8n,x8n=Ws(()=>{"use strict";A8n=e(n=>{let r=n.info();return r.annotations.some(i=>i.type==="bug")||r.tags.some(i=>i==="@bug")},"isKnownBugTest")});var b8n={};rY(b8n,{VtgUserStoryService:()=>Jct});var iBr,Jct,aBr=Ws(()=>{"use strict";cT();yre();_6();iBr=class iBr{constructor(r,i){this.apiService=r;this.config=i}getStory(){return this.story}getTestGenerationData(){return this.userStoryTestGeneration}hasTestGenerationData(){return!!this.userStoryTestGeneration}async fetchStory(r){if(I_.vtg.useFakeStory){this.story={...I_.vtg.fakeStory,id:"fake-story",environment:{name:void 0,userRole:void 0},internalTestId:"fake-internal-test-id"},af.info("Using fake flow data",this.story);return}if(!r)throw new Error("no story id provided");try{let s=await(await this.apiService.post(`test-generation/info/${r}`)).json();if(!(s!=null&&s.id))throw new Error(`Story ${r} not found`);let{id:c,title:p,steps:_,startUrl:v,userRole:E,environment:D,internalTestId:w,version:B,collectionName:P}=s;this.story={id:c,goal:p,instructions:_,url:v,internalTestId:w,environment:{userRole:E,name:D},version:B,collectionName:P}}catch(i){throw af.error(`Error fetching story by id ${r}:`,i),new Error(`Couldn't fetch story by id ${r}. Make sure the server is running and the story id is correct. Original error: ${JSON.stringify(i)}`)}}getEnvInfo(){return sBr(this.config,{role:this.story.environment.userRole,environment:this.story.environment.name})}async createTestGeneration(){if(!this.story.id)return;let r=await this.apiService.post(`test-generation/create/${this.story.id}`,{internalTestId:this.story.internalTestId}),{testGenerationId:i}=await r.json();return this.userStoryTestGeneration={testGenerationId:i},this.userStoryTestGeneration}setTestGenerationData(r){this.userStoryTestGeneration=r}};e(iBr,"VtgUserStoryService");Jct=iBr});var oBr,eOt,E8n=Ws(()=>{"use strict";oBr=class oBr{constructor(r,i){this.config=r;this.baseURL=r.apiURL+i}getBaseURL(){return this.baseURL}get(r){let i=`${this.baseURL}/${r}`;return fetch(i,{method:"GET",headers:{ChecksumAppCode:this.config.apiKey}})}put(r,i){return fetch(`${this.baseURL}/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",ChecksumAppCode:this.config.apiKey},body:i?JSON.stringify(i):void 0})}post(r,i){return fetch(`${this.baseURL}/${r}`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:this.config.apiKey},body:i?JSON.stringify(i):void 0})}delete(r){return fetch(`${this.baseURL}/${r}`,{method:"DELETE",headers:{ChecksumAppCode:this.config.apiKey}})}putFile(r,i){return fetch(r,{method:"PUT",headers:{"Content-Type":i.type},body:i})}};e(oBr,"RuntimeAPIService");eOt=oBr});var C8n={};rY(C8n,{VtgCloudAPIService:()=>zct});var cBr,zct,uBr=Ws(()=>{"use strict";E8n();cBr=class cBr extends eOt{constructor(i){super(i,"/client-api/runtime");this.config=i}};e(cBr,"VtgCloudAPIService");zct=cBr});var E$,S8n,jY,lBr,_ye,D8n,w8n=Ws(()=>{"use strict";WS();P_n();fre();Kwe();yCe();OTt();t0e();K4r();E$=require("fs"),S8n=nd(USr()),jY=nd(require("path"));Zgn();zSr();cT();Jyn();zyn();Hyn();Wyn();Gyn();e2n();yre();Q3r();v8n();wNr();x8n();lBr=1e3*30,_ye=class _ye extends jje{constructor(i,s="normal",c,p,_,v,E,D,w,B,P,L,j){var ue,le,de;super(i,c,P,()=>this.pageInteractor,void 0);this.page=i;this.runMode=s;this.testRunAnalytics=p;this.monitorBridge=_;this.testInfo=v;this.checksumTestId=E;this.test=D;this.options=w;this.isReplMode=B;this.config=P;this.pageInteractorAPI=L;this.lastInteractionTime=Date.now();this.hasRuntimeStartedTrace=!1;this.unzippedHarData=[];this.fallbacks=[];this.hasUsedAutoRecovery=!1;this.hasSuccessfulAutoRecovery=!1;this.arSummaries=[];this.arStepIds=[];this.arResults=[];this.failedSteps=[];this.thoughtsCounter=0;this.highLevelThoughts=[];this.framesMsgBroker=new XMe;this.previousSteps=[];this.scriptLoadWrapper=e(async(i,s)=>(!this.isTimeMachineFrame(s)&&this.navigationPromise&&await this.navigationPromise,this.wrapInternalSteps(i,s.page())),"scriptLoadWrapper");this.scriptLoadCheck=e(async i=>i.evaluate(()=>!!window.checksum),"scriptLoadCheck");this.scriptLoadCallback=e(async i=>{await i.evaluate(async({appSpecificRules:s,esraTimeout:c,sessionRecorder:p,showFrontendLogs:_,showTMSeeker:v,filesObserver:E,nativeDialogObserver:D,assertionsObserver:w,actionsObserver:B,recordOptions:P})=>{var L;(L=window.checksum)==null||L.testGenerator.init(s,{esraTimeout:c,showFrontendLogs:_,skipElementHighlighting:!0,recordOptions:P},{assertionGenerator:!1,sessionRecorder:p,filesObserver:E,nativeDialogObserver:D,assertionsObserver:w,actionsObserver:B});try{v&&window.checksum.timeMachine.openSeekbar()}catch{}},{appSpecificRules:this.appSpecificRules,esraTimeout:lBr,sessionRecorder:!!(!this.isTimeMachineFrame(i)&&(this.timeMachine||this.isVTG)),showFrontendLogs:I_.isDevMode,showTMSeeker:this.isTimeMachineFrame(i)&&process.env.CHECKSUM_SHOW_TIME_MACHINE==="true",filesObserver:this.isVTG&&!this.isTimeMachineFrame(i),nativeDialogObserver:this.isVTG&&!this.isTimeMachineFrame(i),assertionsObserver:this.isVTG&&!this.isTimeMachineFrame(i),actionsObserver:this.isVTG&&!this.isTimeMachineFrame(i),recordOptions:this.isVTG?this.getVTGRecordOptions():void 0}),KA(`[init] init script loaded for ${i.page().url()}`)},"scriptLoadCallback");T8n(w.printLogs),this.isVTG&&(this.options={...this.options,useChecksumAI:{actions:!1,assertions:!1,arVersion:1,visualComparison:!1},useMockData:!1,useChecksumSelectors:!1,autoHealPRs:!1},rOt(this.page)),A8n(D)&&this.config.options.useChecksumAI.skipTestsWithKnownBugs&&(console.log("Auto recovery will not run for this test as it is marked as a known bug"),this.config.options.useChecksumAI.actions=!1,this.config.options.useChecksumAI.assertions=!1,this.config.options.useChecksumAI.visualComparison=!1),this.injectedScriptManager.setScriptLoadWrapper(this.scriptLoadWrapper).setScriptLoadCallback(this.scriptLoadCallback).setScriptLoadCheck(this.scriptLoadCheck);let V=tOt({config:this.config,throwIfAuthFailed:!0}),ee=this.getPlaywrightProjectConfig();if(this.pageInteractor=new uge(this.evaluateWithChecksum.bind(this),()=>this.page.mainFrame(),()=>this.timeMachine,{log:KA,logError:KA},{navigationTimeout:(ue=ee.use)==null?void 0:ue.navigationTimeout,actionTimeout:(le=ee.use)==null?void 0:le.actionTimeout,testAssetsDir:Wit(Kte()),waitActionDelay:1e3},this.pageInteractorAPI,V),this.checkForActiveTracing(),this.resetFallbacks(),j&&(this.highLevelThoughts=j.highLevelThoughts??[],this.timeMachineBrowserContext=j.timeMachineBrowserContext,this.variableStore=j.variableStore),I_.testRun.timeMachine.active){let xe=this.shouldRecordRRwebEvents()?{recordRRwebEventsToFile:!0,recordRRwebEventsToFilePath:fon(this.checksumTestId,this.testInfo.retry)}:{};this.isVTG||(this.timeMachine=new QIt(this.framesMsgBroker,this.injectedScriptManager,{...xe,headless:process.env.CHECKSUM_SHOW_TIME_MACHINE==="true"?!1:I_.testRun.timeMachine.headless,webProxy:(de=v.project.use)==null?void 0:de.proxy}),this.timeMachineBrowserContext&&this.timeMachine.setTimeMachineBrowserContext(this.timeMachineBrowserContext))}}previousThoughtsAndTimestamps(){return this.previousSteps}static async init(i,s,c,p,_,v,E,D,w,B=!1){let P=!1;E||(E=await _ye.fetchVtgInternalTestId(w),E||(E=m8t(5),P=!0,console.warn(`Checksum test id was not defined for test "${v.title}" and was auto-generated. Please replace - "${v.title}" with -
751
751
  test(defineChecksumTest("${v.title}", "${E}"), async ({ page }) => {...`))),p.addTestInfo(E,v.testId,P),w.options.useChecksumAI!==void 0&&typeof w.options.useChecksumAI=="boolean"&&(w.options.useChecksumAI={actions:w.options.useChecksumAI,assertions:!1,visualComparison:!1});let L=new Sje(w),j=new _ye(i,w.runMode,s,c,p,v,E,D,{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1},newAssertionsEnabled:w.runMode!=="normal",useMockData:!1,printLogs:!1,...w.options},B,w,L,{variableStore:_});return s.pages().length===0&&(D._checksum.expect.setPage(j),D._checksum.checksumAI.page=j,_.clearAll(),j.testRunAnalytics.testRunStart()),await j.asyncInit(),j.proxy}static async fetchVtgInternalTestId(i){try{let s=process.env.CHECKSUM_VTG_TEST_FILE_RUN_CONFIG;if(!s)return;let c=JSON.parse(s);if(c.mode!=="start"||!c.storyId)return;let{VtgUserStoryService:p}=await Promise.resolve().then(()=>(aBr(),b8n)),{VtgCloudAPIService:_}=await Promise.resolve().then(()=>(uBr(),C8n)),v=new _(i),E=new p(v,i);await E.fetchStory(c.storyId);let D=E.getStory();return D==null?void 0:D.internalTestId}catch(s){console.warn("Failed to fetch VTG internalTestId from story:",s);return}}async asyncInit(i=!1){await this.loadAppSpecificRules(),await this.wrapInternalSteps(async()=>{await this.page.addInitScript(()=>{window.sessionStorage.setItem("checksumai:disable","true")})}),this.timeMachine&&(await this.timeMachine.prepare(this.page.mainFrame()),this.timeMachineBrowserContext=this.timeMachine.getTimeMachineBrowserContext()),this.pageInteractor.init(),i||await this.prepareForTestArtifacts();let s=jY.resolve(__dirname,"mock-auto-heal-agent.js");await this.page.addInitScript({path:s})}async makePage(i){let s=new _ye(i,this.runMode,this._context,this.testRunAnalytics,this.monitorBridge,this.testInfo,this.checksumTestId,this.test,this.options,this.isReplMode,this.config,this.pageInteractorAPI,{highLevelThoughts:this.highLevelThoughts,timeMachineBrowserContext:this.timeMachineBrowserContext,variableStore:this.variableStore});return await s.asyncInit(!0),s.proxy}getTimeMachinePage(){var i;return(i=this.timeMachine)==null?void 0:i.getPage()}getFramesMessageBroker(){return this.framesMsgBroker}isTimeMachineFrame(i){var s;return i===((s=this.timeMachine)==null?void 0:s.getFrame())}shouldRecordRRwebEvents(){return I_.testRun.timeMachine.recordRRwebEventsToFile&&this.config.options.hostReports}recordInteraction(){let i=this.getPageGuid(this.page);_ye.recentlyInteracted.set(i,Date.now()),this.lastInteractionTime=Date.now()}static getMostRecentPage(i){let s=i.pages(),c=s[0],p=0;for(let _ of s){let v=_._guid,E=_ye.recentlyInteracted.get(v)||0;E>p&&(p=E,c=_)}return c}async goto(i,s){return this.recordInteraction(),this.page.goto(i,s)}async reload(i){return this.recordInteraction(),this.page.reload(i)}async goBack(i){return this.recordInteraction(),this.page.goBack(i)}async goForward(i){return this.recordInteraction(),this.page.goForward(i)}async click(i,s){return this.recordInteraction(),this.page.click(i,s)}async dblclick(i,s){return this.recordInteraction(),this.page.dblclick(i,s)}async fill(i,s,c){return this.recordInteraction(),this.page.fill(i,s,c)}async press(i,s,c){return this.recordInteraction(),this.page.press(i,s,c)}async check(i,s){return this.recordInteraction(),this.page.check(i,s)}async uncheck(i,s){return this.recordInteraction(),this.page.uncheck(i,s)}async selectOption(i,s,c){return this.recordInteraction(),this.page.selectOption(i,s,c)}async hover(i,s){return this.recordInteraction(),this.page.hover(i,s)}async type(i,s,c){return this.recordInteraction(),this.page.type(i,s,c)}async setInputFiles(i,s,c){return this.recordInteraction(),this.page.setInputFiles(i,s,c)}async tap(i,s){return this.recordInteraction(),this.page.tap(i,s)}async dragAndDrop(i,s,c){return this.recordInteraction(),this.page.dragAndDrop(i,s,c)}getPlaywrightProjectConfig(){return this.testInfo.project}checkForActiveTracing(){var c;let s=(c=this.getPlaywrightProjectConfig().use)==null?void 0:c.trace;this.traceMode=typeof s=="string"?s:s==null?void 0:s.mode}registerPageEvents(){super.registerPageEvents(),this.injectedScriptManager.addTrackedFrame(this.page),this.page.on("framenavigated",async i=>{this.injectedScriptManager.onFrameNavigated(i)})}checksumSelector(i){return this.checksumStepId=i,this.options.useChecksumSelectors&&this.setSelectorFallback(i),this.proxy}checksumAI(i,s,c){let p=this.addNewThought(i,"action",!!s);this.previousSteps.push({thought:p.thought,timestamp:Date.now()});let _=this.getPageGuid(this.page);return uge.setLastAction(_,i),s&&typeof s=="function"?this.test.step(i,async v=>{var E;try{return c!=null&&c.withDialog&&this.pageInteractor.listenToDialog(),await s()}catch(D){if(p.children=[],!this.options.useChecksumAI.actions||c!=null&&c.withDialog||c!=null&&c.skipAutoRecovery)throw D;this.setAIFallback(i,"action");try{return await this.initiateFallbackSequence({type:"action",error:D,method:void 0,args:[],testInfo:this.testInfo,step:v},{fallbackTypes:[Fge,dye]})}catch(w){throw this.testRunAnalytics.testRunError({failedThought:i,error:(w==null?void 0:w.message)||"Unknown error"}),w}}finally{this.pageInteractor.removeListener("dialog"),this.currentThought=(E=this.currentThought)==null?void 0:E.parent}}):(this.options.useChecksumAI.actions&&!(c!=null&&c.skipAutoRecovery)&&this.setAIFallback(i,"action"),this.proxy)}resolveAssetsFolder(i){return i.map(s=>jY.join(Wit(Kte()),s))}getRuntimeOptions(){return this.options}addPwAnnotation(i){this.testInfo.annotations.push({type:i.type,description:`
752
752
  ${i.description}`})}async onTestComplete(i){this.testRunAnalytics.testRunEnd({success:i,autoRecoveryTriggered:this.hasUsedAutoRecovery,summaries:this.arSummaries}),this.monitorBridge.addChecksumTestMetadata({checksumTestId:this.checksumTestId,pwTestId:this.testInfo.testId,retry:this.testInfo.retry,type:"autoRecoveryMetadata",data:{autoRecoveryTriggered:this.hasUsedAutoRecovery,autoRecovered:this.hasSuccessfulAutoRecovery&&i}}),this.monitorBridge.addChecksumTestMetadata({checksumTestId:this.checksumTestId,pwTestId:this.testInfo.testId,retry:this.testInfo.retry,type:"autoRecoverySummaries",data:this.arSummaries}),this.cleanupMockData()}async wrapInternalSteps(i,s=this.page){try{return s.mainFrame()._checksumInternal=!0,s._checksumInternal=!0,await i()}finally{s.mainFrame()._checksumInternal=!1,s._checksumInternal=!1}}async conditionallyWrapInternalSteps(i,s){return i?this.wrapInternalSteps(s):s()}async wrapNoLocationSteps(i){try{return this.testInfo._checksumNoLocation=!0,await i()}finally{this.testInfo._checksumNoLocation=!1}}findAllStepsRecursively(i,s,c=[]){for(let p of i){(p._stepId===s||p.stepId===s)&&c.push(p);let _=[p.steps,p._testInfoSteps,p._steps].filter(Boolean);for(let v of _)this.findAllStepsRecursively(v,s,c)}return c}makeChecksumStepFunction(i){return s=>{if(!i)return;let c=s._stepId||s.stepId;this.findAllStepsRecursively(s._testInfo._steps,c).forEach(_=>{_.error={message:"ChecksumStepError",stack:"Fallback Failed",cause:void 0}})}}async createChecksumStep(i){let s,c={box:!0,noLocation:!0,obtainStep:e(p=>{s=p},"obtainStep")};return await this.step(i.title,this.makeChecksumStepFunction(i.withError),!1,c),s!=null&&s.stepId&&this.arStepIds.push(s.stepId),s}async step(i,s,c=!0,{obtainStep:p=void 0,box:_=!1,noLocation:v=void 0}={}){let E=this.testInfo._checksumNoLocation;try{this.testInfo._checksumInternal=c===!0,v!==void 0&&(this.testInfo._checksumNoLocation=v),await this.test.step(i,s||(()=>{}),{obtainStep:p,box:_})}finally{this.testInfo._checksumInternal=!1,this.testInfo._checksumNoLocation=E}}addErrorMessage(i,s){this.testInfo.addError(i,s)}async evaluateWithChecksum(i,s,c=!0){return this.navigationPromise&&await this.navigationPromise,this.conditionallyWrapInternalSteps(c,()=>this.page.evaluate(i,s))}getChecksumTestId(){return this.checksumTestId}addNewThought(i,s,c=!1){let p={id:void 0,thought:i,type:s,children:c?[]:void 0,parent:void 0};if(!this.currentThought)this.highLevelThoughts.push(p);else if(this.currentThought.children)this.currentThought.children.push(p),p.parent=this.currentThought;else{let _=this.currentThought.parent;_?(_.children.push(p),p.parent=_):this.highLevelThoughts.push(p)}return p.parent?p.id=`${p.parent.id}.${p.parent.children.length}`:p.id=`${++this.thoughtsCounter}`,this.currentThought=p,p}buildThoughtsChainForFallback(i=this.highLevelThoughts){let s=[];return i.forEach(c=>{s.push(c.thought),c.children&&s.push(...this.buildThoughtsChainForFallback(c.children))}),s}getVTGRecordOptions(){return{recordCanvas:!0,recordCrossOriginIframes:this.isVTG,sampling:{mousemove:!1},slimDOMOptions:"all"}}compoundSelection(...i){let s=super.compoundSelection(...i);return s.setAnalytics(()=>this.testRunAnalytics),this.checksumStepId&&this.options.useChecksumSelectors&&this.setCompoundSelectorFallback(this.checksumStepId),s}setSelectorFallback(i){let s={checksumId:i,fileName:this.testInfo.file,testId:this.checksumTestId,apiKey:this.config.apiKey,apiURL:this.config.apiURL,timeout:lBr};this.pushFallback(this.constructFallback(Pst).init(s)),this.pushFallback(this.constructFallback(Fst).init(s))}setCompoundSelectorFallback(i){this.pushFallback(this.constructFallback(Nst).init({checksumId:i,fileName:this.testInfo.file,testId:this.checksumTestId,apiKey:this.config.apiKey,apiURL:this.config.apiURL,timeout:lBr}))}setAIFallback(i,s){var v;let c=((v=this.options.useChecksumAI)==null?void 0:v.arVersion)===1,p=e(()=>{var L,j;let E=this.buildThoughtsChainForFallback(),D={title:this.testInfo.title},w={testFileName:this.testInfo.file,testId:this.testInfo.testId,testSuiteId:process.env.CHECKSUM_TEST_SUITE_ID||""},B={previous:E.slice(0,-1),failing:i,next:E.slice(1)},P={storyInfo:D,testIdentification:w,fallbackConfig:{arMode:(L=this.options.useChecksumAI)==null?void 0:L.arMode,overrideOptions:(j=this.options.useChecksumAI)==null?void 0:j.overrideOptions},thoughts:B,config:{apiURL:this.config.apiURL,apiKey:this.config.apiKey},type:s};return this.constructFallback(dye).init(P)},"createArFallback"),_=e(()=>{var E,D;return this.constructFallback(Fge).init({goal:this.testInfo.title,testFile:this.testInfo.file,apiKey:this.config.apiKey,apiURL:this.config.apiURL,testId:this.checksumTestId,thoughts:this.buildThoughtsChainForFallback(),benchmark:I_.benchmark,arMode:(E=this.options.useChecksumAI)==null?void 0:E.arMode,overrideOptions:(D=this.options.useChecksumAI)==null?void 0:D.overrideOptions,fallbackType:s})},"createAIFallback");return c?this.pushFallback(_()):this.pushFallback(p()),this.proxy}pushFallback(i){this.fallbacks.push(i),this.sortFallbacks()}handleAIFallback(i,s,c,p){let _=i.fallbackAnalyticsPayload.iterationSteps,v=_.length>0?p/_.length:0;this.testRunAnalytics.testRunFallbackExecution({result:c.fbResult,failedThought:i.getFailedThought(),summary:c.summary,stepsPayload:i.fallbackAnalyticsPayload,type:i.fallbackType??s.type,benchmark:I_.benchmark.toString(),duration:p,avgDuration:v,success:["finish","soft_assertion"].includes(c.fbResult)}),this.arResults.push({failedThought:i.getFailedThought(),result:c.fbResult,thought:c.thought})}handleAutoRecovery(i,s,c,p){let _=c.stepsThoughts.length>0?p/c.stepsThoughts.length:0;this.testRunAnalytics.testRunAutoRecovery({failingThought:i.failingThought,type:s.type,finalThought:c.thought,result:c.fbResult,duration:p,avgStepDuration:_,stepsThoughts:c.stepsThoughts,version:"v1"})}async runFallback(i,s){let c=Date.now(),p=i.resolve(s),_=await HS(p,i.timeout),v=Date.now()-c;i instanceof Fge&&(this.hasUsedAutoRecovery=!0,this.handleAIFallback(i,s,_,v)),i instanceof dye&&(this.hasUsedAutoRecovery=!0,this.handleAutoRecovery(i,s,_,v));let E=_.thought?`: ${_.thought}`:"";if(!_||_.fbResult==="failed")throw this.hasSuccessfulAutoRecovery=!1,this.createChecksumStep({title:`Recovery Failed${E}`,withError:!0}),new Error("Fallback failed");if(_.fbResult==="hard_assertion")throw this.hasSuccessfulAutoRecovery=!1,this.createChecksumStep({title:`Recovery Failed${E}`,withError:!0}),new bst(_.fbResult);if(this.hasUsedAutoRecovery&&(this.hasSuccessfulAutoRecovery=!0),i instanceof Fge&&_.summary&&this.arSummaries.push(_.summary),i instanceof dye&&_.thought&&this.arSummaries.push(_.thought),this.createChecksumStep({title:`Recovery Complete${E}`}),_.steps.length===1){let D=_.steps[0];D.thought&&(this.currentThought.thought=D.thought)}else this.currentThought.children=_.steps.map((D,w)=>({id:`${this.currentThought.id}.${w+1}`,thought:D.thought,type:D.type,children:void 0,parent:this.currentThought}))}async runConditionallyWithinStep(i,s,c){return i?await this.step(s,c):await c()}async onExecutionError(i){try{return await this.initiateFallbackSequence({type:"action",...i})}catch(s){if(!this.currentThought){let{locator:c,method:p}=i;this.testRunAnalytics.testRunActionExecutionFailure({locator:c.toString(),selector:c._selector,method:p,checksumStepId:this.checksumStepId,error:s.toString()})}throw s}}async initiateFallbackSequence(i,{fallbackTypes:s=void 0}={}){KA(`[initiateFallbackSequence] with type: ${i.type}...`);let c=this.fallbacks.find(v=>v instanceof Fge);if(c){let v=c.getFailedThought(),E=this.variableStore.getActiveVariables();this.fallbacks.forEach(D=>{D.setThought(v),D.setVariables(E)})}let p=this.fallbacks.find(v=>v instanceof dye);if(p){let v=p.failingThought;this.fallbacks.forEach(E=>{E instanceof dye&&E.setVariables(this.variableStore.getActiveVariables()),E.setThought(v)})}let _=this.fallbacks;s&&(_=_.filter(v=>s.reduce((E,D)=>E||v instanceof D,!1))),_=_.filter(v=>v.canResolve(i));try{for(let v of _){let E=v==null?void 0:v.toString();E&&console.log(`Using ${E}`);let D;try{let w=await this.runConditionallyWithinStep(i.type!=="assertion"||!i.withChecksumAI,v.getRecoveryAttemptTitle(i),async()=>await this.runFallback(v,i));D=!0}catch(w){if(D=!1,i.withChecksumAI&&w.message==="fetch failed")throw new Error(Oje);w instanceof bst&&w.fallbackResult==="hard_assertion"&&(i.error.fallbackResult="hard_assertion"),E&&console.log(`Failed to use ${E}`),v.cancel();continue}return!0}throw i.error}finally{this.resetFallbacks()}}resetFallbacks(){this.fallbacks=[this.constructFallback(Bst).init()]}async shutdown(){if(this.shouldRecordRRwebEvents()){try{await this.timeMachine.flushRRwebEventsToFile();let i=this.timeMachine.getRRwebFilePath();this.monitorBridge.addAsset({type:"rrweb-recording",path:i,testId:this.checksumTestId,fileName:jY.basename(i)})}catch(i){KA("Error shutting down RRweb events recording",i)}if(this.testRunAnalytics)return KA("Flushing analytics events......"),this.testRunAnalytics.close()}}sortFallbacks(){let i=[Bst,Nst,Pst,Fst,Fge];this.fallbacks.sort((s,c)=>i.indexOf(s.constructor)-i.indexOf(c.constructor))}constructFallback(i){return new i(this.page,this.evaluateWithChecksum.bind(this),this,this.pageInteractor,{generateSelectionData:this.runMode!=="normal"},this,this._context)}async prepareForTestArtifacts(){if((this.options.useMockData||this.runMode==="refactor")&&await this.prepareAPIMock(),this.traceMode&&this.traceMode!=="off"){let s=await this.getTraceFilePath();s&&this.monitorBridge.addAsset({type:"trace",path:s,testId:this.checksumTestId,project:this.testInfo.project.name})}if(!1){let s=pon(BTt(this.testInfo.file),this.checksumTestId);this.monitorBridge.addAsset({type:"har",path:s,testId:this.checksumTestId})}}async getTraceFilePath(){try{return this.hasRuntimeStartedTrace?don(BTt(this.testInfo.file),this.checksumTestId).replace(".zip",".original.zip"):this.testInfo.outputPath("trace.zip")}catch{return}}async prepareMockData(){let i=kxr(BTt(this.testInfo.file)),s=jY.join(i,`${this.checksumTestId}.har.zip`);if(!(0,E$.existsSync)(s))throw new Error("Could not find har file or zip file");let c=jY.join(i,"tmp");(0,E$.existsSync)(c)||(0,E$.mkdirSync)(c);let p=(0,E$.readFileSync)(s),_=await(0,S8n.loadAsync)(p);for(let E of Object.keys(_.files)){let D=await _.file(E).async("string"),w=jY.join(c,E);(0,E$.writeFileSync)(w,D),this.unzippedHarData.push(w)}let v=jY.join(c,"test.har");if(!(0,E$.existsSync)(v))throw this.cleanupMockData(),new Error(`Could not find har file ${v} after unzipping ${s}`);return v}cleanupMockData(){this.unzippedHarData.forEach(i=>{(0,E$.rmSync)(i)}),this.unzippedHarData.length>0&&(0,E$.rmSync)(jY.dirname(this.unzippedHarData[0]),{recursive:!0,force:!0})}async prepareAPIMock(){let i={GET:0,POST:0,PUT:0,DELETE:0};try{let s=await this.prepareMockData();await this.page.routeFromHAR(s,{url:"*/**",notFound:"fallback",update:!1});let c=this.page._routes[0].handler;await this.page.route("**/*",p=>{let _=p.request().headers(),v=p.request().method();_["Checksum-Id"]=(++i[v]).toString(),p.request()._applyFallbackOverrides({headers:_}),c(p)})}catch(s){KA("Error setting up mock data",s.message)}}async loadAppSpecificRules(){this.appSpecificRules={};let i=jY.join(Gwe(Kte()),"settings.asr");if(!(0,E$.existsSync)(i)){KA("Could not find ASR file");return}let{ungzip:s}=Txr();try{let c=await s((0,E$.readFileSync)(i));this.appSpecificRules=JSON.parse(c)||{}}catch(c){KA("Could not read ASR file",c.message)}}addAutoRecoveryStepId(i){this.arStepIds.push(i)}};e(_ye,"RuntimePage"),_ye.recentlyInteracted=new Map;D8n=_ye});function RGi(n,r){return r}function LGi(n,r){return n.filter(i=>i!==void 0)}function I8n(n){return typeof n!="object"||n===null?0:Array.isArray(n)?2:UGi(n)?1:n instanceof Set?3:n instanceof Map?4:5}function MGi(n){let r=new Set;for(let i of n)for(let s of[...Object.keys(i),...Object.getOwnPropertySymbols(i)])r.add(s);return r}function jGi(n,r){return typeof n=="object"&&Object.prototype.propertyIsEnumerable.call(n,r)}function N8n(n){var s;let r=0,i=(s=n[0])==null?void 0:s[Symbol.iterator]();return{[Symbol.iterator](){return{next(){var c;do{if(i===void 0)return{done:!0,value:void 0};let p=i.next();if(p.done===!0){r+=1,i=(c=n[r])==null?void 0:c[Symbol.iterator]();continue}return{done:!1,value:p.value}}while(!0)}}}}}function UGi(n){if(!F8n.includes(Object.prototype.toString.call(n)))return!1;let{constructor:r}=n;if(r===void 0)return!0;let i=r.prototype;return!(i===null||typeof i!="object"||!F8n.includes(Object.prototype.toString.call(i))||!i.hasOwnProperty("isPrototypeOf"))}function QGi(n,r,i){let s={};for(let c of MGi(n)){let p=[];for(let E of n)jGi(E,c)&&p.push(E[c]);if(p.length===0)continue;let _=r.metaDataUpdater(i,{key:c,parents:n}),v=P8n(p,r,_);v!==N6e.skip&&(c==="__proto__"?Object.defineProperty(s,c,{value:v,configurable:!0,enumerable:!0,writable:!0}):s[c]=v)}return s}function qGi(n){return n.flat()}function $Gi(n){return new Set(N8n(n))}function VGi(n){return new Map(N8n(n))}function JGi(n){return n.at(-1)}function iOt(...n){return zGi({})(...n)}function zGi(n,r){let i=HGi(n,s);function s(...c){return P8n(c,i,r)}return e(s,"customizedDeepmerge"),s}function HGi(n,r){return{defaultMergeFunctions:nOt,mergeFunctions:{...nOt,...Object.fromEntries(Object.entries(n).filter(([i,s])=>Object.hasOwn(nOt,i)).map(([i,s])=>s===!1?[i,nOt.mergeOthers]:[i,s]))},metaDataUpdater:n.metaDataUpdater??RGi,deepmerge:r,useImplicitDefaultMerging:n.enableImplicitDefaultMerging??!1,filterValues:n.filterValues===!1?void 0:n.filterValues??LGi,actions:N6e}}function P8n(n,r,i){var p;let s=((p=r.filterValues)==null?void 0:p.call(r,n,i))??n;if(s.length===0)return;if(s.length===1)return pBr(s,r,i);let c=I8n(s[0]);if(c!==0&&c!==5){for(let _=1;_<s.length;_++)if(I8n(s[_])!==c)return pBr(s,r,i)}switch(c){case 1:return WGi(s,r,i);case 2:return GGi(s,r,i);case 3:return KGi(s,r,i);case 4:return YGi(s,r,i);default:return pBr(s,r,i)}}function WGi(n,r,i){let s=r.mergeFunctions.mergeRecords(n,r,i);return s===N6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeRecords!==r.defaultMergeFunctions.mergeRecords?r.defaultMergeFunctions.mergeRecords(n,r,i):s}function GGi(n,r,i){let s=r.mergeFunctions.mergeArrays(n,r,i);return s===N6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeArrays!==r.defaultMergeFunctions.mergeArrays?r.defaultMergeFunctions.mergeArrays(n):s}function KGi(n,r,i){let s=r.mergeFunctions.mergeSets(n,r,i);return s===N6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeSets!==r.defaultMergeFunctions.mergeSets?r.defaultMergeFunctions.mergeSets(n):s}function YGi(n,r,i){let s=r.mergeFunctions.mergeMaps(n,r,i);return s===N6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeMaps!==r.defaultMergeFunctions.mergeMaps?r.defaultMergeFunctions.mergeMaps(n):s}function pBr(n,r,i){let s=r.mergeFunctions.mergeOthers(n,r,i);return s===N6e.defaultMerge||r.useImplicitDefaultMerging&&s===void 0&&r.mergeFunctions.mergeOthers!==r.defaultMergeFunctions.mergeOthers?r.defaultMergeFunctions.mergeOthers(n):s}var N6e,ves,k8n,F8n,nOt,fBr=Ws(()=>{N6e={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},ves={defaultMerge:N6e.defaultMerge};e(RGi,"defaultMetaDataUpdater");e(LGi,"defaultFilterValues");(function(n){n[n.NOT=0]="NOT",n[n.RECORD=1]="RECORD",n[n.ARRAY=2]="ARRAY",n[n.SET=3]="SET",n[n.MAP=4]="MAP",n[n.OTHER=5]="OTHER"})(k8n||(k8n={}));e(I8n,"getObjectType");e(MGi,"getKeys");e(jGi,"objectHasProperty");e(N8n,"getIterableOfIterables");F8n=["[object Object]","[object Module]"];e(UGi,"isRecord");e(QGi,"mergeRecords$1");e(qGi,"mergeArrays$1");e($Gi,"mergeSets$1");e(VGi,"mergeMaps$1");e(JGi,"mergeOthers$1");nOt={mergeRecords:QGi,mergeArrays:qGi,mergeSets:$Gi,mergeMaps:VGi,mergeOthers:JGi};e(iOt,"deepmerge");e(zGi,"deepmergeCustom");e(HGi,"getUtils");e(P8n,"mergeUnknowns");e(WGi,"mergeRecords");e(GGi,"mergeArrays");e(KGi,"mergeSets");e(YGi,"mergeMaps");e(pBr,"mergeOthers")});function T8n(n){O8n=n}function KA(...n){O8n&&console.log(...n)}async function jyn(n,r,i,s=6e4){if(!(r in n))return n;let c=e(()=>n[r](...i),"executor");return s===null?c():HS(c(),s,"Execution timeout")}function sBr(n,{role:r,environment:i}={},s=!1){var v,E;let c;if(i&&(c=(v=n.environments)==null?void 0:v.find(({name:D})=>i===D)),c||(c=(E=n.environments)==null?void 0:E.find(({default:D})=>D)),!c)throw new Error("Environment not found. Please make sure your environments are properly defined in the checksum.config.ts file.");let p=c.users,_;if(p&&(r!==void 0&&(_=p.find(D=>D.role===r)),_||(_=p.find(D=>D.default))),!_)throw new Error(`User not found. Please make sure the users array for the "${c.name}" environment is properly defined in the checksum.config.ts file.`);if(i&&c.name!==i){if(s)throw new Error(`Could not find environment with name "${i}" in config file`);console.warn(`Could not find environment with name "${i}" in config file, trying to use default environment`)}if(r&&_.role!==r){if(s)throw new Error(`Could not find user with role "${r}" for environment "${i}" in config file`);console.warn(`Could not find user with role "${r}" for environment "${i}" in config file, trying to login with environment's default user`)}return{environment:c,user:_}}function XGi(n){let r=`${n??Kte()}/login.ts`;if(!(0,aOt.existsSync)(r))throw console.warn(`Could not locate the login.ts file. Please make sure your login file exists at ${r}`),new Error("Could not find login.ts file");try{return require(r).default}catch(i){throw console.warn("Error loading login.ts file",i),i}}async function ZGi(n,r,{environment:i,user:s,config:c}){try{let p=e(()=>r(n,{environment:i,user:s,config:c}),"performLogin");"checksumAI"in n?await n.checksumAI(`Log in${s!=null&&s.role?` using ${s.role} role`:""}${i!=null&&i.name?` in ${i.name} environment`:""}`,p,{skipAutoRecovery:!0}):await p()}catch(p){throw console.warn(`The login method threw an exception, please check the login.ts file for the following error:
753
- `,p),p}}function tOt(n){let{config:r,folder:i,throwIfAuthFailed:s}=n,c=XGi(i);return async(p,{role:_,environment:v}={})=>{let{environment:E,user:D}=sBr(r,{role:_,environment:v},n.throwIfEnvInfoInvalid);if(s&&!D)throw new Error("Could not find user credentials matching the provided role and/or environment");await ZGi(p,c,{environment:E,user:D,config:r})}}function o2n(){if(qQe)return qQe;try{let n=(0,aOt.existsSync)(`${Kte()}/checksum.config.ts`)?"checksum.config.ts":(0,aOt.existsSync)(`${Kte()}/checksum.config.tmp.ts`)?"checksum.config.tmp.ts":void 0;if(n)return B8n(require(`${Kte()}/${n}`).default)}catch{console.warn("Could not find checksum config file, will run with defaults")}return B8n()}function B8n(n={}){var i,s,c,p;let r={apiKey:void 0,runMode:"normal",apiURL:"https://api.checksum.ai",options:{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1,skipTestsWithKnownBugs:!0},newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,consecutiveActionDelay:100,hideReports:process.env.AUTHORIZE_REPORTS==="true"}};return((s=(i=n.options)==null?void 0:i.useChecksumAI)==null?void 0:s.visualComparison)===void 0&&((p=(c=n.options)==null?void 0:c.useChecksumAI)!=null&&p.assertions)&&(n.options.useChecksumAI.visualComparison=!0),qQe=iOt(r,n),I_.testRun.disableAutoRecovery&&(qQe.options.useChecksumAI={actions:!1,assertions:!1,visualComparison:!1}),I_.testRun.disableHostReports&&(qQe.options.hostReports=!1),qQe}function rOt(n){let r=e(i=>{i.on("dialog",s=>{})},"makeDialogHandler");n.context().pages().forEach(r),n.context().on("page",i=>{r(i)})}var aOt,O8n,qQe,Oje,yre=Ws(()=>{"use strict";w8n();WS();yCe();aOt=require("fs");cT();fBr();O8n=!1;e(T8n,"setLogToConsole");e(KA,"log");e(jyn,"executePlaywrightMethodWithTimeout");e(sBr,"resolveEnvironment");e(XGi,"requireLogin");e(ZGi,"proceedWithLogin");e(tOt,"makeUnboundLogin");e(o2n,"loadChecksumConfig");e(B8n,"getChecksumConfig");e(rOt,"preventDialogAutoDismissal");Oje="Checksum failed connecting to the server"});var NBr=$r((oO,TBr)=>{"use strict";Object.defineProperty(oO,"__esModule",{value:!0});function lKi(n){return n&&typeof n=="object"&&"default"in n?n.default:n}e(lKi,"_interopDefault");var DBr=lKi(F6e()),kBr=class kBr{constructor(r,i){this.moduleName=r,this.packageNames=i}lazyloadExportOrDie(r){let i=this,s=Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(c=>[c,function(p,..._){let E=i.loadModuleOrDie()[r];return Reflect[c](E||p,..._)}]));return new Proxy({},s)}loadModule(){return EBr(this.packageNames)}loadModuleOrDie(){let r=EBr(this.packageNames);if(r)return r;throw this.requireError}get requireError(){let r=this.moduleName.charAt(0).toUpperCase()+this.moduleName.slice(1);return new Error(`
753
+ `,p),p}}function tOt(n){let{config:r,folder:i,throwIfAuthFailed:s}=n,c=XGi(i);return async(p,{role:_,environment:v}={})=>{let E=process.env.CHECKSUM_RUNTIME_ENV_OVERRIDE_NAME??v,D=process.env.CHECKSUM_RUNTIME_ENV_OVERRIDE_ROLE??_,{environment:w,user:B}=sBr(r,{role:D,environment:E},n.throwIfEnvInfoInvalid);if(s&&!B)throw new Error("Could not find user credentials matching the provided role and/or environment");await ZGi(p,c,{environment:w,user:B,config:r})}}function o2n(){if(qQe)return qQe;try{let n=(0,aOt.existsSync)(`${Kte()}/checksum.config.ts`)?"checksum.config.ts":(0,aOt.existsSync)(`${Kte()}/checksum.config.tmp.ts`)?"checksum.config.tmp.ts":void 0;if(n)return B8n(require(`${Kte()}/${n}`).default)}catch{console.warn("Could not find checksum config file, will run with defaults")}return B8n()}function B8n(n={}){var i,s,c,p;let r={apiKey:void 0,runMode:"normal",apiURL:"https://api.checksum.ai",options:{useChecksumSelectors:!0,useChecksumAI:{actions:!0,assertions:!1,skipTestsWithKnownBugs:!0},newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,consecutiveActionDelay:100,hideReports:process.env.AUTHORIZE_REPORTS==="true"}};return((s=(i=n.options)==null?void 0:i.useChecksumAI)==null?void 0:s.visualComparison)===void 0&&((p=(c=n.options)==null?void 0:c.useChecksumAI)!=null&&p.assertions)&&(n.options.useChecksumAI.visualComparison=!0),qQe=iOt(r,n),I_.testRun.disableAutoRecovery&&(qQe.options.useChecksumAI={actions:!1,assertions:!1,visualComparison:!1}),I_.testRun.disableHostReports&&(qQe.options.hostReports=!1),qQe}function rOt(n){let r=e(i=>{i.on("dialog",s=>{})},"makeDialogHandler");n.context().pages().forEach(r),n.context().on("page",i=>{r(i)})}var aOt,O8n,qQe,Oje,yre=Ws(()=>{"use strict";w8n();WS();yCe();aOt=require("fs");cT();fBr();O8n=!1;e(T8n,"setLogToConsole");e(KA,"log");e(jyn,"executePlaywrightMethodWithTimeout");e(sBr,"resolveEnvironment");e(XGi,"requireLogin");e(ZGi,"proceedWithLogin");e(tOt,"makeUnboundLogin");e(o2n,"loadChecksumConfig");e(B8n,"getChecksumConfig");e(rOt,"preventDialogAutoDismissal");Oje="Checksum failed connecting to the server"});var NBr=$r((oO,TBr)=>{"use strict";Object.defineProperty(oO,"__esModule",{value:!0});function lKi(n){return n&&typeof n=="object"&&"default"in n?n.default:n}e(lKi,"_interopDefault");var DBr=lKi(F6e()),kBr=class kBr{constructor(r,i){this.moduleName=r,this.packageNames=i}lazyloadExportOrDie(r){let i=this,s=Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(c=>[c,function(p,..._){let E=i.loadModuleOrDie()[r];return Reflect[c](E||p,..._)}]));return new Proxy({},s)}loadModule(){return EBr(this.packageNames)}loadModuleOrDie(){let r=EBr(this.packageNames);if(r)return r;throw this.requireError}get requireError(){let r=this.moduleName.charAt(0).toUpperCase()+this.moduleName.slice(1);return new Error(`
754
754
  ${r} is missing. :-)
755
755
 
756
756
  I've tried loading ${this.packageNames.map(i=>`"${i}"`).join(", ")} - no luck.