"use strict";var u=require("node:module"),p=require("node:worker_threads"),c=typeof document<"u"?document.currentScript:null;const f=s=>{const{sourceMapsEnabled:i}=process;process.setSourceMapsEnabled(!0);const{port1:e,port2:n}=new p.MessageChannel;u.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:c&&c.src||new URL("register-DUq1clC8.cjs",document.baseURI).href,data:{namespace:s?.namespace,port:n},transferList:[n]});const a=s?.onImport,r=a&&(t=>{t.type==="load"&&a(t.url)});return r&&(e.on("message",r),e.unref()),()=>(i===!1&&process.setSourceMapsEnabled(!1),r&&e.off("message",r),e.postMessage("deactivate"),new Promise(t=>{const o=d=>{d.type==="deactivated"&&(t(),e.off("message",o))};e.on("message",o)}))};exports.register=f;
