import { r as e, t } from "../chunks/flex-C7njxZ74.js";
import { t as n } from "../chunks/grid-dI94AAbi.js";
import { Children as r } from "react";
import { childrenCount as i } from "@ryuzaki13/react-foundation-lib/utils";
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
//#region src/toolbar/Toolbar.tsx
var c = ({ children: e }) => /* @__PURE__ */ o(a, { children: e });
c.displayName = "Toolbar.Start";
var l = ({ children: e }) => /* @__PURE__ */ o(a, { children: e });
l.displayName = "Toolbar.End";
function u({ children: a, className: u }) {
	let d = null, f = null, p = r.toArray(a);
	for (let e of p) switch (e.type.displayName) {
		case c.displayName:
			if (d) throw Error("Toolbar: duplicate <ToolbarStart> found");
			d = e.props.children;
			break;
		case l.displayName:
			if (f) throw Error("Toolbar: duplicate <ToolbarEnd> found");
			f = e.props.children;
	}
	return /* @__PURE__ */ s(e.Container, {
		wrap: !0,
		align: "center",
		gap: "md",
		className: u,
		children: [
			d && /* @__PURE__ */ o(e.Item, {
				flex0: !0,
				children: /* @__PURE__ */ o(n.Container, {
					templateColumns: `repeat(${i(d)}, calc(15em + var(--width-add)))`,
					align: "end",
					gap: "sm",
					children: d
				})
			}),
			/* @__PURE__ */ o(t, {}),
			f && /* @__PURE__ */ o(e.Item, {
				flex0: !0,
				children: /* @__PURE__ */ o(n.Container, {
					templateColumns: `repeat(${i(f)}, calc(15em + var(--width-add)))`,
					align: "end",
					gap: "sm",
					children: f
				})
			})
		]
	});
}
//#endregion
export { u as Toolbar, l as ToolbarEnd, c as ToolbarStart };

//# sourceMappingURL=index.js.map