"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var find_dom_node_exports = {};
__export(find_dom_node_exports, {
  FindDomNode: () => FindDomNode
});
module.exports = __toCommonJS(find_dom_node_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = require("react");
var import_react_dom = require("./lib/react-dom");
function suppressWarningAndFindDomNode(instance) {
  const error = console.error;
  console.error = (...args) => {
    if (typeof args[0] === "string" && args[0].includes("%s is deprecated in StrictMode."))
      return;
    if (typeof args[0] === "string" && args[0].includes("findDOMNode is deprecated"))
      return;
    return error.apply(console, args);
  };
  const foundDomNode = (0, import_react_dom.findDOMNode)(instance);
  console.error = error;
  return foundDomNode;
}
class FindDomNodeClassComponent extends import_react.Component {
  constructor(props) {
    super(props);
    this.props.innerRef.current = () => suppressWarningAndFindDomNode(this);
  }
  render() {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: this.props.children });
  }
}
const FindDomNode = (0, import_react.forwardRef)(
  function FindDomNode2(props, ref) {
    const findDomNodeRef = (0, import_react.useRef)(null);
    (0, import_react.useImperativeHandle)(ref, () => () => findDomNodeRef.current?.() ?? null, []);
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FindDomNodeClassComponent, { ...props, innerRef: findDomNodeRef });
  }
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FindDomNode
});
//# sourceMappingURL=find-dom-node.js.map