import * as i from "react";
import { forwardRef as d, useContext as E } from "react";
import g from "../../../../../@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js";
import { getRegisteredStyles as h, registerStyles as C, insertStyles as S } from "../../../../../@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js";
import { serializeStyles as P } from "../../../../../@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js";
import { useInsertionEffectAlwaysWithSyncFallback as w } from "../../../../../@emotion_use-insertion-effect-with-fallbacks@1.2.0_react@18.3.0-canary-3d9b20132-20240124/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js";
var u = /* @__PURE__ */ i.createContext(
  // we're doing this to avoid preconstruct's dead code elimination in this one case
  // because this module is primarily intended for the browser and node
  // but it's also required in react native and similar environments sometimes
  // and we could have a special build just for that
  // but this is much easier and the native packages
  // might use a different theme context in the future anyway
  typeof HTMLElement < "u" ? /* @__PURE__ */ g({
    key: "css"
  }) : null
);
u.Provider;
var y = function(t) {
  return /* @__PURE__ */ d(function(a, e) {
    var n = E(u);
    return t(a, n, e);
  });
}, N = /* @__PURE__ */ i.createContext({}), v = {}.hasOwnProperty, c = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", A = function(t, a) {
  var e = {};
  for (var n in a)
    v.call(a, n) && (e[n] = a[n]);
  return e[c] = t, e;
}, T = function(t) {
  var a = t.cache, e = t.serialized, n = t.isStringTag;
  return C(a, e, n), w(function() {
    return S(a, e, n);
  }), null;
}, x = /* @__PURE__ */ y(function(r, t, a) {
  var e = r.css;
  typeof e == "string" && t.registered[e] !== void 0 && (e = t.registered[e]);
  var n = r[c], m = [e], o = "";
  typeof r.className == "string" ? o = h(t.registered, m, r.className) : r.className != null && (o = r.className + " ");
  var f = P(m, void 0, i.useContext(N));
  o += t.key + "-" + f.name;
  var l = {};
  for (var s in r)
    v.call(r, s) && s !== "css" && s !== c && (l[s] = r[s]);
  return l.className = o, a && (l.ref = a), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(T, {
    cache: t,
    serialized: f,
    isStringTag: typeof n == "string"
  }), /* @__PURE__ */ i.createElement(n, l));
}), F = x;
export {
  F as E,
  N as T,
  A as c,
  v as h,
  y as w
};
//# sourceMappingURL=emotion-element-f0de968e.browser.esm.js.map
