import*as RootModule from"../root/root.js";self.Runtime=self.Runtime||{},Runtime=Runtime||{},Root.allDescriptors=Root.allDescriptors||[],Root.applicationDescriptor=Root.applicationDescriptor||void 0;export async function startApplication(t){console.timeStamp("Root.Runtime.startApplication");const o={};for(let s=0;s<Root.allDescriptors.length;++s){const t=Root.allDescriptors[s];o[t.name]=t}const e=Root.applicationDescriptor.modules,n=[],i=[];for(let s=0;s<e.length;++s){const t=e[s],r=t.name;n.push(o[r]),"autostart"===t.type&&i.push(r)}for(let s=0;s<n.length;++s)n[s].name=e[s].name,n[s].condition=e[s].condition;const r=RootModule.Runtime.Runtime.instance({forceNew:!0,moduleDescriptors:n});self.runtime=r,i&&await r.loadAutoStartModules(i),RootModule.Runtime.appStartedPromiseCallback()}export async function startWorker(t){return startApplication(t).then((function(){self.postMessage("workerReady")}))}