import { j as jsxRuntimeExports } from "./doenetml-BPsLSRHD.js";
import React__default from "react";
import { u as useDoenetRenderer } from "./useDoenetRenderer-BDC0Rur_.js";
import { a as addCommasForCompositeRanges } from "./composites-BvS-pDok.js";
import { c as calculateValidationState, u as useSubmitActionWithDelay, a as createCheckWorkComponent } from "./useSubmitActionWithDelay-bJj16Fl0.js";
const containerInline = React__default.memo(function ContainerInline(props) {
  let { id, SVs, children, actions, callAction } = useDoenetRenderer(props);
  if (SVs.hidden) {
    return null;
  }
  let checkWorkComponent = null;
  const validationState = calculateValidationState(SVs);
  const { isPending, submitActionWithPending } = useSubmitActionWithDelay({
    actionKey: "submitAllAnswers",
    actions,
    callAction,
    validationState,
    justSubmitted: SVs.justSubmitted
  });
  if (actions.submitAllAnswers) {
    checkWorkComponent = createCheckWorkComponent(
      SVs,
      id,
      validationState,
      submitActionWithPending,
      true,
      isPending
    );
  }
  if (SVs._compositeReplacementActiveRange) {
    children = addCommasForCompositeRanges({
      children,
      compositeReplacementActiveRange: SVs._compositeReplacementActiveRange,
      startInd: 0,
      endInd: children.length - 1
    });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { id, children: [
    children,
    checkWorkComponent
  ] });
});
export {
  containerInline as default
};
