varmapperTab=function(){"use strict";vare="undefined"!=typeofglobalThis?globalThis:"undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:{};functiont(e){if(e.__esModule)returne;vart=e.default;if("function"==typeoft){vara=functione(){returnthisinstanceofe?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}elsea={};returnObject.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){varr=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){returne[t]}})})),a}vara={},r={},n={},s={};varo=Object.freeze({__proto__:null,default:function(e){return{all:e=e||newMap,on:function(t,a){varr=e.get(t);r?r.push(a):e.set(t,[a])},off:function(t,a){varr=e.get(t);r&&(a?r.splice(r.indexOf(a)>>>0,1):e.set(t,[]))},emit:function(t,a){varr=e.get(t);r&&r.slice().map((function(e){e(a)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,a)}))}}}}),i=t(o),c=e&&e.__importDefault||function(e){returne&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.EventEmitter=void0;constd=c(i);s.EventEmitter=class{#e=(0,d.default)();on(e,t){returnthis.#e.on(e,t),this}once(e,t){consta=r=>{t(r),this.off(e,a)};returnthis.on(e,a)}off(e,t){returnthis.#e.off(e,t),this}emit(e,t){this.#e.emit(e,t)}removeAllListeners(e){returne?this.#e.all.delete(e):this.#e.all.clear(),this}};varu,l={};Object.defineProperty(l,"__esModule",{value:!0}),l.LogType=void0,function(e){e.bidi="bidi",e.cdp="cdp",e.debug="debug",e.debugError="debug:error",e.debugInfo="debug:info"}(u||(l.LogType=u={}));varh={};Object.defineProperty(h,"__esModule",{value:!0}),h.ProcessingQueue=void0;constp=l;classm{staticLOGGER_PREFIX=`${p.LogType.debug}:queue`;#t;#a;#r=[];#n=!1;constructor(e,t){this.#a=e,this.#t=t}add(e,t){this.#r.push([e,t]),this.#s()}async#s(){if(!this.#n){for(this.#n=!0;this.#r.length>0;){conste=this.#r.shift();if(!e)continue;const[t,a]=e;this.#t?.(m.LOGGER_PREFIX,"Processing event:",a),awaitt.then((e=>{if("error"!==e.kind)returnthis.#a(e.value);this.#t?.(p.LogType.debugError,"Event threw before sending:",e.error.message,e.error.stack)})).catch((e=>{this.#t?.(p.LogType.debugError,"Event was not processed:",e?.message)}))}this.#n=!1}}}h.ProcessingQueue=m;varf={},g={},y={};Object.defineProperty(y,"__esModule",{value:!0});varS,v,w,C,b,x={};Object.defineProperty(x,"__esModule",{value:!0}),x.EVENT_NAMES=x.Network=x.BrowsingContext=x.Log=x.Script=x.BiDiModule=void0,function(e){e.Browser="browser",e.BrowsingContext="browsingContext",e.Cdp="cdp",e.Input="input",e.Log="log",e.Network="network",e.Script="script",e.Session="session"}(S||(x.BiDiModule=S={})),function(e){vart;(t=e.EventNames||(e.EventNames={})).Message="script.message",t.RealmCreated="script.realmCreated",t.RealmDestroyed="script.realmDestroyed"}(v||(x.Script=v={})),function(e){(e.EventNames||(e.EventNames={})).LogEntryAdded="log.entryAdded"}(w||(x.Log=w={})),function(e){vart;(t=e.EventNames||(e.EventNames={})).ContextCreated="browsingContext.contextCreated",t.ContextDestroyed="browsingContext.contextDestroyed",t.DomContentLoaded="browsingContext.domContentLoaded",t.DownloadWillBegin="browsingContext.downloadWillBegin",t.FragmentNavigated="browsingContext.fragmentNavigated",t.Load="browsingContext.load",t.NavigationAborted="browsingContext.navigationAborted",t.NavigationFailed="browsingContext.navigationFailed",t.NavigationStarted="browsingContext.navigationStarted",t.UserPromptClosed="browsingContext.userPromptClosed",t.UserPromptOpened="browsingContext.userPromptOpened"}(C||(x.BrowsingContext=C={})),function(e){vart;(t=e.EventNames||(e.EventNames={})).AuthRequired="network.authRequired",t.BeforeRequestSent="network.beforeRequestSent",t.FetchError="network.fetchError",t.ResponseCompleted="network.responseCompleted",t.ResponseStarted="network.responseStarted"}(b||(x.Network=b={})),x.EVENT_NAMES=newSet([...Object.values(S),...Object.values(C.EventNames),...Object.values(w.EventNames),...Object.values(b.EventNames),
Object.defineProperty(a,"__esModule",{value:!0});constcs=r,ds=en,us=l,ls=dn,hs=es,ps=ns;(0,hs.generatePage)();constms=newps.WindowBidiTransport,fs=newps.WindowCdpTransport,gs=newds.MapperCdpConnection(fs,hs.log);returnwindow.runMapperInstance=async(e,t)=>{awaitasyncfunction(e,t){console.log("Launching Mapper instance with selfTargetId:",e);consta=awaitcs.BidiServer.createAndStart(ms,gs,awaitgs.createBrowserSession(),e,t,newls.BidiParser,hs.log);return(0,hs.log)(us.LogType.debugInfo,"Mapper instance has been launched"),a}(e,t)},a}();