// src/runtime/lazy/register.ts
function exportedComponent(mod) {
  return Object.hasOwnProperty.call(mod, "default") ? mod.default : mod;
}
function register(chunkManager, chunk, lazyImport, mod) {
  const component = exportedComponent(mod);
  const lazyComponentState = {
    state: "loaded",
    component
  };
  if (process.env.NOSTALGIE_BUILD_TARGET === "server") {
    if (chunk) {
      chunkManager.chunks.push({chunk, lazyImport});
    }
  }
  chunkManager.lazyComponentState.set(lazyImport, lazyComponentState);
  return lazyComponentState;
}

export {
  register
};
