import { r as reactExports, j as jsxRuntimeExports, __tla as __tla_0 } from "../index.js";
import { R as RepoContext } from "./index-BSpyO9eA.js";
import "../__vite_rsc_assets_manifest.js";
import "node:async_hooks";
let export_125820ecd802;
let __tla = Promise.all([
  (() => {
    try {
      return __tla_0;
    } catch {
    }
  })()
]).then(async () => {
  function Providers({ children }) {
    const [repo, setRepo] = reactExports.useState(null);
    reactExports.useEffect(() => {
      let cleanup;
      let handleBeforeUnload;
      import("./repo-zy9lifAg.js").then(({ getRepo, cleanupRepo }) => {
        const r = getRepo();
        setRepo(r);
        cleanup = cleanupRepo;
        handleBeforeUnload = () => {
          r.networkSubsystem.adapters.forEach((adapter) => adapter.disconnect());
        };
        window.addEventListener("beforeunload", handleBeforeUnload);
      });
      return () => {
        if (handleBeforeUnload) {
          window.removeEventListener("beforeunload", handleBeforeUnload);
        }
        cleanup == null ? void 0 : cleanup();
      };
    }, []);
    if (!repo) {
      return jsxRuntimeExports.jsx("div", {
        className: "flex min-h-screen items-center justify-center text-gray-400",
        children: "Loading..."
      });
    }
    return jsxRuntimeExports.jsx(RepoContext.Provider, {
      value: repo,
      children
    });
  }
  export_125820ecd802 = {
    default: Providers
  };
});
export {
  __tla,
  export_125820ecd802
};
