import i, { useContext as c, useMemo as s, useState as u, useLayoutEffect as d } from "react";
const n = {
  prefix: String(Math.round(Math.random() * 1e10)),
  current: 0
}, r = /* @__PURE__ */ i.createContext(n);
let f = Boolean(typeof window < "u" && window.document && window.document.createElement);
function $(t) {
  let e = c(r);
  return e === n && !f && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."), s(
    () => t || `react-aria${e.prefix}-${++e.current}`,
    [
      t
    ]
  );
}
function l() {
  let e = c(r) !== n, [o, a] = u(e);
  return typeof window < "u" && e && d(() => {
    a(!1);
  }, []), o;
}
export {
  l as useIsSSR,
  $ as useSSRSafeId
};
//# sourceMappingURL=module.es.js.map
