import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  runCommand
} from "./chunk-TOLFJFE7.js";
import {
  ProjectModelProvider
} from "./chunk-V2MRR3XI.js";
import {
  messages_default
} from "./chunk-HEANTKSX.js";
import "./chunk-SCQFHY4A.js";
import {
  HttpClientProvider,
  buildHttpClientHeaders
} from "./chunk-JJWBWHWO.js";
import {
  PanoramaProvider
} from "./chunk-YTGCPERW.js";
import {
  addUserFields
} from "./chunk-V2542KTT.js";
import {
  BiProvider,
  ErrorReporterProvider,
  SiteAuthProvider
} from "./chunk-VZ3FZHJK.js";
import "./chunk-OWRWPLVG.js";
import {
  I18nProvider
} from "./chunk-CIOBCAOI.js";
import "./chunk-RPTAJN5Y.js";
import {
  render
} from "./chunk-2DKXIL7C.js";
import {
  require_react
} from "./chunk-7ZOEVDW3.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-LFX6WS3B.js";
import "./chunk-XTVDTH5G.js";
import "./chunk-TMZBOD2B.js";
import "./chunk-DR2IE2NL.js";
import "./chunk-JWVFFICN.js";
import "./chunk-YRSNPU5L.js";
import "./chunk-PIOT47FJ.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-site-old/src/commands/render-command.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
async function renderCommand(command, services, cliVersion, component) {
  await runCommand(command, services, cliVersion, async (model) => {
    const { biLogger, errorReporter, panorama } = services;
    const handleLogin = (userInfo) => {
      errorReporter.setUser({ id: userInfo.userId });
      addUserFields(biLogger, userInfo.userId);
    };
    const headers = buildHttpClientHeaders({
      flow: "Sites",
      command: command.name(),
      cliVersion
    });
    await render(
      /* @__PURE__ */ import_react.default.createElement(BiProvider, { value: biLogger }, /* @__PURE__ */ import_react.default.createElement(ErrorReporterProvider, { value: errorReporter }, /* @__PURE__ */ import_react.default.createElement(PanoramaProvider, { value: panorama }, /* @__PURE__ */ import_react.default.createElement(SiteAuthProvider, { siteId: model.metaSiteId, onLogin: handleLogin }, /* @__PURE__ */ import_react.default.createElement(HttpClientProvider, { headers }, /* @__PURE__ */ import_react.default.createElement(I18nProvider, { messages: messages_default }, /* @__PURE__ */ import_react.default.createElement(ProjectModelProvider, { value: model }, component)))))))
    );
  });
}
export {
  renderCommand
};
//# sourceMappingURL=render-command-WODH5K2G.js.map