import{ObjectWrapper}from'../common/common.js';import{TargetDetachedDialog}from'../components/components.js';import{NetworkPanelIndicator}from'../mobile_throttling/mobile_throttling.js';import{Connections,SDKModel,ChildTargetManager,DebuggerModel}from'../sdk/sdk.js';class WorkerMainImpl extends ObjectWrapper.ObjectWrapper{run(){Connections.initMainConnection(()=>{SDKModel.TargetManager.instance().createTarget('main',ls`Main`,SDKModel.Type.ServiceWorker,null);},TargetDetachedDialog.TargetDetachedDialog.webSocketConnectionLost);new NetworkPanelIndicator.NetworkPanelIndicator();}}
ChildTargetManager.ChildTargetManager.install(async({target,waitingForDebugger})=>{if(target.parentTarget()||target.type()!==SDKModel.Type.ServiceWorker||!waitingForDebugger){return;}
const debuggerModel=target.model(DebuggerModel.DebuggerModel);if(!debuggerModel){return;}
if(!debuggerModel.isReadyToPause()){await debuggerModel.once(DebuggerModel.Events.DebuggerIsReadyToPause);}
debuggerModel.pause();});var WorkerMain=Object.freeze({__proto__:null,WorkerMainImpl:WorkerMainImpl});export{WorkerMain};