"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { FileUploadProvider } from "./use-file-upload-context.js";
import { useFileUpload } from "./use-file-upload.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/file-upload/file-upload-root.tsx
var splitRootProps = createSplitProps();
var FileUploadRoot = forwardRef((props, ref) => {
	const [useFileUploadProps, localProps] = splitRootProps(props, [
		"accept",
		"acceptedFiles",
		"allowDrop",
		"capture",
		"defaultAcceptedFiles",
		"directory",
		"disabled",
		"id",
		"ids",
		"invalid",
		"locale",
		"maxFiles",
		"maxFileSize",
		"minFileSize",
		"name",
		"onFileAccept",
		"onFileChange",
		"onFileReject",
		"preventDocumentDrop",
		"readOnly",
		"required",
		"translations",
		"transformFiles",
		"validate"
	]);
	const fileUpload = useFileUpload(useFileUploadProps);
	const mergedProps = mergeProps(fileUpload.getRootProps(), localProps);
	return /* @__PURE__ */ jsx(FileUploadProvider, {
		value: fileUpload,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
FileUploadRoot.displayName = "FileUploadRoot";
//#endregion
export { FileUploadRoot };
