import * as React from "react";
import * as ReactDOM from "react-dom";
import { createSlot } from "../../../../../@radix-ui_react-slot@1.2.3_@types_react@19.1.13_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.js";
import { j as jsxRuntimeExports } from "../../../../../../../_virtual/jsx-runtime.js";
var NODES = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "select",
  "span",
  "svg",
  "ul"
];
var Primitive = NODES.reduce((primitive, node) => {
  const Slot = createSlot(`Primitive.${node}`);
  const Node = React.forwardRef((props, forwardedRef) => {
    const { asChild, ...primitiveProps } = props;
    const Comp = asChild ? Slot : node;
    if (typeof window !== "undefined") {
      window[Symbol.for("radix-ui")] = true;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
  });
  Node.displayName = `Primitive.${node}`;
  return { ...primitive, [node]: Node };
}, {});
function dispatchDiscreteCustomEvent(target, event) {
  if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
}
export {
  Primitive,
  dispatchDiscreteCustomEvent
};
//# sourceMappingURL=index.js.map
