"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const tv = require("./tv.cjs");
const promptInputContext = require("../../context/prompt-input-context.cjs");
const proxy = require("../../../../_vendor/framer-motion/dist-es-render-components-motion-proxy.cjs");
const usePlanUpdates = require("../prompt-plan-todo-list/hooks/use-plan-updates.cjs");
const PromptStateBar = React.memo(function PromptStateBar2(props) {
  const { children } = props;
  const { hasPendingMessages } = promptInputContext.usePromptInputContext();
  const { currentPlan } = usePlanUpdates.usePlanUpdates();
  const isOpen = React.useMemo(() => {
    return hasPendingMessages || currentPlan && currentPlan.length > 0;
  }, [hasPendingMessages, currentPlan]);
  const tv$1 = tv.StateBarTv();
  const stateVariants = {
    initial: { y: 40, opacity: 0 },
    animate: {
      y: isOpen ? 0 : 40,
      opacity: isOpen ? 1 : 0
    },
    exit: { y: 40, opacity: 0 }
  };
  if (!isOpen) return null;
  return /* @__PURE__ */ jsxRuntime.jsx(
    proxy.motion.div,
    {
      variants: stateVariants,
      initial: "initial",
      animate: "animate",
      exit: "exit",
      transition: { duration: 0.2, ease: "easeInOut", delay: 0.2 },
      className: tv$1.root(),
      children
    }
  );
});
exports.PromptStateBar = PromptStateBar;
//# sourceMappingURL=prompt-state-bar.cjs.map
