"use strict";
const jsxRuntime = require("react/jsx-runtime");
const assert = require("assert");
const styles_lib_components_Box_Box_cjs = require("../Box/Box.cjs");
const styles_lib_css_negativeMargin_negativeMargin_cjs = require("../../css/negativeMargin/negativeMargin.cjs");
const styles_lib_utils_collapsibleAlignmentProps_cjs = require("../../utils/collapsibleAlignmentProps.cjs");
const styles_lib_css_atoms_sprinkles_css_cjs = require("../../css/atoms/sprinkles.css.cjs");
const styles_lib_components_Accordion_Accordion_cjs = require("../Accordion/Accordion.cjs");
const styles_lib_components_Column_Column_cjs = require("../Column/Column.cjs");
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
const Columns = ({
  children,
  collapseBelow,
  reverse = false,
  space = "none",
  align,
  alignY,
  component = "div",
  data,
  ...restProps
}) => {
  assert__default.default(
    styles_lib_components_Column_Column_cjs.validColumnsComponents.includes(component),
    `Invalid Columns component: '${component}'. Should be one of [${styles_lib_components_Column_Column_cjs.validColumnsComponents.map((c) => `'${c}'`).join(", ")}]`
  );
  const normalizedSpace = styles_lib_css_atoms_sprinkles_css_cjs.normalizeResponsiveValue(space);
  const {
    mobile: mobileSpace = "none",
    tablet: tabletSpace = mobileSpace,
    desktop: desktopSpace = tabletSpace,
    wide: wideSpace = desktopSpace
  } = normalizedSpace;
  const {
    collapsibleAlignmentProps,
    collapsibleAlignmentChildProps,
    collapseMobile,
    collapseTablet,
    collapseDesktop,
    orderChildren
  } = styles_lib_utils_collapsibleAlignmentProps_cjs.resolveCollapsibleAlignmentProps({
    collapseBelow,
    align,
    alignY,
    reverse
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    styles_lib_components_Box_Box_cjs.Box,
    {
      component,
      ...collapsibleAlignmentProps,
      className: styles_lib_css_negativeMargin_negativeMargin_cjs.negativeMargin("left", {
        mobile: collapseMobile ? "none" : mobileSpace,
        tablet: collapseTablet ? "none" : tabletSpace,
        desktop: collapseDesktop ? "none" : desktopSpace,
        wide: wideSpace
      }),
      ...styles_lib_components_Accordion_Accordion_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
      children: /* @__PURE__ */ jsxRuntime.jsx(
        styles_lib_components_Column_Column_cjs.ColumnsContext.Provider,
        {
          value: {
            collapseMobile,
            collapseTablet,
            collapseDesktop,
            mobileSpace,
            tabletSpace,
            desktopSpace,
            wideSpace,
            collapsibleAlignmentChildProps,
            component
          },
          children: orderChildren(children)
        }
      )
    }
  );
};
exports.Columns = Columns;
