import {
  icons,
  theme
} from "../../chunk-kbtqrkwh.js";
import"../../chunk-3sfn889r.js";
import {
  exports_external
} from "../../chunk-c6ge431q.js";
import {
  __require
} from "../../chunk-9wyra8hs.js";

// src/commands/screens/spec.ts
var ScreensOptionsSchema = exports_external.object({
  project: exports_external.string()
});

// src/commands/screens/command.ts
var command = {
  name: "screens",
  description: "Explore all screens in a project",
  requiredOptions: [
    { flags: "-p, --project <id>", description: "Project ID" }
  ],
  action: async (_args, options) => {
    try {
      const parsedOptions = ScreensOptionsSchema.parse(options);
      const { ScreensHandler } = await import("../../chunk-mbt1wx7n.js");
      const { ScreensView } = await import("../../chunk-7egq85x5.js");
      const { stitch } = await import("../../chunk-ezs0qz0b.js");
      const { render } = await import("../../chunk-t092ehvp.js");
      const React = await import("../../chunk-edp6faw2.js");
      const handler = new ScreensHandler(stitch);
      const result = await handler.execute(parsedOptions.project);
      if (!result.success) {
        console.error(theme.red(`
${icons.error} Failed: ${result.error}`));
        process.exit(1);
      }
      const createElement = React.createElement || React.default.createElement;
      const instance = render(createElement(ScreensView, {
        projectId: result.projectId,
        projectTitle: result.projectTitle,
        screens: result.screens
      }));
      await instance.waitUntilExit();
      process.exit(0);
    } catch (error) {
      console.error(theme.red(`
${icons.error} Unexpected error:`), error);
      process.exit(1);
    }
  }
};
export {
  command
};

//# debugId=0A4B8195BA49A89164756E2164756E21
