import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  logout
} from "./chunk-YHFCDWGT.js";
import "./chunk-IVQPYJ5M.js";
import "./chunk-MDUBZZTI.js";
import "./chunk-RPTAJN5Y.js";
import {
  Box_default,
  ConfirmInput,
  Spinner,
  Text,
  useAsyncCallback
} from "./chunk-QK47PIWK.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-LU3R3EBR.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-AYCGCYN3.js";
import "./chunk-SDLCFZRL.js";
import {
  require_lib
} from "./chunk-WGV2XQSB.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// src/components/LogoutCommand/index.ts
init_esm_shims();

// src/components/LogoutCommand/LogoutCommand.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
var import_variant = __toESM(require_lib(), 1);
var LogoutCommand = ({ userInfo }) => {
  const logoutAction = useAsyncCallback(logout);
  if (userInfo == null) {
    return /* @__PURE__ */ import_react.default.createElement(Text, null, "Wix CLI is already logged out");
  }
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react.default.createElement(Text, null, "When you're logged out you can't use Wix CLI commands.")), /* @__PURE__ */ import_react.default.createElement(
    ConfirmInput,
    {
      label: "Continue with logout?",
      initialValue: true,
      onSubmit: (confirmed) => {
        if (confirmed) {
          void logoutAction.execute();
        }
      }
    }
  ), (0, import_variant.match)(logoutAction.status, {
    NotRequested: () => null,
    Error: () => null,
    Loading: () => /* @__PURE__ */ import_react.default.createElement(Spinner, null),
    Success: () => /* @__PURE__ */ import_react.default.createElement(Text, null, "Wix CLI is logged out")
  }));
};
export {
  LogoutCommand
};
//# sourceMappingURL=LogoutCommand-6GLIUDHZ.js.map