"use client";
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
const require_use_drawer_stack_store = require("./use-drawer-stack-store.cjs");
const require_use_drawer_stack_context = require("./use-drawer-stack-context.cjs");
let _zag_js_drawer = require("@zag-js/drawer");
_zag_js_drawer = require_runtime.__toESM(_zag_js_drawer, 1);
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/drawer/drawer-stack.tsx
var DrawerStack = (props) => {
	const { children } = props;
	const [stack] = (0, react.useState)(() => _zag_js_drawer.createStack());
	const snapshot = (0, react.useSyncExternalStore)(stack.subscribe, stack.getSnapshot, stack.getSnapshot);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_drawer_stack_store.DrawerStackStoreProvider, {
		value: stack,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_drawer_stack_context.DrawerStackProvider, {
			value: (0, react.useMemo)(() => _zag_js_drawer.connectStack(snapshot, _zag_js_react.normalizeProps), [snapshot]),
			children
		})
	});
};
//#endregion
exports.DrawerStack = DrawerStack;
