var React = (typeof window !== 'undefined' ? window.React : undefined) || (typeof global !== 'undefined' ? global.React : undefined);
var ReactDOM = (typeof window !== 'undefined' ? window.ReactDOM : undefined) || (typeof global !== 'undefined' ? global.ReactDOM : undefined);
var ze = Object.defineProperty, Le = Object.defineProperties;
var He = Object.getOwnPropertyDescriptors;
var ce = Object.getOwnPropertySymbols;
var We = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
var le = (e, t, n) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, _ = (e, t) => {
  for (var n in t || (t = {}))
    We.call(t, n) && le(e, n, t[n]);
  if (ce)
    for (var n of ce(t))
      Ve.call(t, n) && le(e, n, t[n]);
  return e;
}, V = (e, t) => Le(e, He(t));
import { R as y, g as D, a as z, b as T, c as Ee, s as je, o as Be, d as Ue, e as M, f as Ye, h as ue, i as de, j as Ke, n as Xe, k as Je, l as Ge, r as qe } from "./main-BFQbKPhU.js";
function Y(e, t = 0, n = 6) {
  var r, s;
  if (e === null)
    return { type: "null", value: "null" };
  if (e === void 0)
    return { type: "undefined", value: "undefined" };
  const o = typeof e;
  if (o === "string")
    return { type: "string", value: `"${e.length > 100 ? `${e.slice(0, 100)}...` : e}"` };
  if (o === "number")
    return { type: "number", value: String(e) };
  if (o === "boolean")
    return { type: "boolean", value: String(e) };
  if (o === "function")
    return { type: "function", value: `ƒ ${e.name || "anonymous"}()` };
  if (o === "symbol")
    return { type: "symbol", value: e.toString() };
  if (t > n)
    return Array.isArray(e) ? { type: "array", value: `Array(${e.length})` } : { type: "object", value: "Object" };
  if (Array.isArray(e)) {
    const i = {};
    return e.forEach((a, l) => {
      i[String(l)] = Y(a, t + 1, n);
    }), {
      type: "array",
      value: `Array(${e.length})`,
      children: Object.keys(i).length > 0 ? i : void 0
    };
  }
  if (o === "object") {
    if (e.$$typeof)
      return { type: "element", value: `<${((r = e.type) == null ? void 0 : r.displayName) || ((s = e.type) == null ? void 0 : s.name) || e.type || "Unknown"} />` };
    const i = Object.keys(e), a = {};
    for (const l of i)
      try {
        a[l] = Y(e[l], t + 1, n);
      } catch (p) {
        a[l] = { type: "unknown", value: "[Error]" };
      }
    return {
      type: "object",
      value: "Object",
      preview: i.length > 0 ? `{${i.slice(0, 3).join(", ")}${i.length > 3 ? ", ..." : ""}}` : "{}",
      children: Object.keys(a).length > 0 ? a : void 0
    };
  }
  return { type: "unknown", value: String(e) };
}
function Qe(e) {
  var o, r, s;
  const t = ((o = e.type) == null ? void 0 : o._context) || e.type;
  if (!t)
    return "Unknown Context";
  if (t.displayName)
    return t.displayName;
  if ((r = t.Provider) != null && r.displayName)
    return t.Provider.displayName.replace(".Provider", "");
  if ((s = t.Consumer) != null && s.displayName)
    return t.Consumer.displayName.replace(".Consumer", "");
  const n = z(e);
  return n && n !== "Anonymous" ? n.replace(".Provider", "").replace(".Consumer", "") : "Context";
}
function Ze(e) {
  if (e.memoizedProps && "value" in e.memoizedProps)
    return e.memoizedProps.value;
}
function K(e) {
  return e.tag === y.ContextProvider;
}
function X(e, t, n, o) {
  var r;
  if (!(!e || o.has(e))) {
    if (o.add(e), e.tag === y.ContextConsumer && (((r = e.type) == null ? void 0 : r._context) || e.type) === t && n.push({
      id: D(e),
      name: z(e),
      fiberId: D(e)
    }), e.tag === y.FunctionComponent || e.tag === y.ForwardRef || e.tag === y.MemoComponent || e.tag === y.SimpleMemoComponent) {
      let s = e.memoizedState;
      for (; s; ) {
        if (s.memoizedState !== void 0) {
          const i = e.dependencies;
          if (i != null && i.firstContext) {
            let a = i.firstContext;
            for (; a; ) {
              if (a.context === t) {
                n.push({
                  id: D(e),
                  name: z(e),
                  fiberId: D(e)
                });
                break;
              }
              a = a.next;
            }
          }
        }
        s = s.next;
      }
    }
    e.child && X(e.child, t, n, o), e.sibling && X(e.sibling, t, n, o);
  }
}
function ve(e, t) {
  var a;
  if (!K(e))
    return null;
  const n = (a = e.type) == null ? void 0 : a._context, o = [];
  e.child && X(e.child, n, o, /* @__PURE__ */ new WeakSet());
  const r = o.filter(
    (l, p, d) => p === d.findIndex((g) => g.id === l.id)
  ), s = {
    id: D(e),
    name: Qe(e),
    value: Y(Ze(e)),
    fiberId: D(e),
    consumerCount: r.length,
    consumers: r,
    children: [],
    source: e._debugSource ? {
      fileName: e._debugSource.fileName,
      lineNumber: e._debugSource.lineNumber,
      columnNumber: e._debugSource.columnNumber
    } : void 0
  }, i = (l) => {
    var p;
    if (!(!l || t.has(l)))
      if (t.add(l), K(l) && ((p = l.type) == null ? void 0 : p._context) === n) {
        const d = ve(l, t);
        d && s.children.push(d);
      } else
        l.child && i(l.child), l.sibling && i(l.sibling);
  };
  return e.child && i(e.child), s;
}
function J(e, t, n, o) {
  var r;
  if (!(!e || n.has(e))) {
    if (n.add(e), K(e)) {
      const s = (r = e.type) == null ? void 0 : r._context;
      if (s && !o.has(s)) {
        const i = ve(e, new WeakSet([e]));
        i && (t.push(i), o.add(s));
      }
    }
    e.child && J(e.child, t, n, o), e.sibling && J(e.sibling, t, n, o);
  }
}
function be(e) {
  var i;
  const t = [], n = /* @__PURE__ */ new WeakSet(), o = /* @__PURE__ */ new Set();
  (i = e == null ? void 0 : e.current) != null && i.child && J(e.current.child, t, n, o);
  let r = 0;
  const s = (a) => {
    for (const l of a)
      r += l.consumerCount, l.children.length > 0 && s(l.children);
  };
  return s(t), {
    providers: t,
    totalProviders: t.length,
    totalConsumers: r
  };
}
function et(e, t) {
  const n = be(e), o = (r) => {
    for (const s of r) {
      if (s.fiberId === t)
        return s;
      const i = o(s.children);
      if (i)
        return i;
    }
    return null;
  };
  return o(n.providers);
}
function tt(e) {
  return be(e);
}
function I(e, t = 0, n = 8) {
  var r, s;
  if (e === null)
    return { type: "null", value: "null" };
  if (e === void 0)
    return { type: "undefined", value: "undefined" };
  const o = typeof e;
  if (o === "string")
    return { type: "string", value: `"${e.length > 100 ? `${e.slice(0, 100)}...` : e}"` };
  if (o === "number")
    return { type: "number", value: String(e) };
  if (o === "boolean")
    return { type: "boolean", value: String(e) };
  if (o === "function")
    return { type: "function", value: `ƒ ${e.name || "anonymous"}()` };
  if (o === "symbol")
    return { type: "symbol", value: e.toString() };
  if (t > n)
    return Array.isArray(e) ? { type: "array", value: `Array(${e.length})` } : { type: "object", value: "Object" };
  if (Array.isArray(e)) {
    const i = {};
    return e.forEach((a, l) => {
      i[String(l)] = I(a, t + 1, n);
    }), {
      type: "array",
      value: `Array(${e.length})`,
      children: Object.keys(i).length > 0 ? i : void 0
    };
  }
  if (o === "object") {
    if (e.$$typeof)
      return { type: "element", value: `<${((r = e.type) == null ? void 0 : r.displayName) || ((s = e.type) == null ? void 0 : s.name) || e.type || "Unknown"} />` };
    const i = Object.keys(e), a = {};
    for (const l of i)
      try {
        a[l] = I(e[l], t + 1, n);
      } catch (p) {
        a[l] = { type: "unknown", value: "[Error]" };
      }
    return {
      type: "object",
      value: "Object",
      preview: i.length > 0 ? `{${i.slice(0, 3).join(", ")}${i.length > 3 ? ", ..." : ""}}` : "{}",
      children: Object.keys(a).length > 0 ? a : void 0
    };
  }
  return { type: "unknown", value: String(e) };
}
function nt(e) {
  var o, r;
  const t = {}, n = e.memoizedProps;
  if (!n || typeof n != "object")
    return t;
  for (const [s, i] of Object.entries(n)) {
    if (s === "children") {
      if (i)
        if (Array.isArray(i))
          t[s] = { type: "array", value: `[${i.length} children]` };
        else if (typeof i == "object" && i.$$typeof) {
          const a = ((o = i.type) == null ? void 0 : o.displayName) || ((r = i.type) == null ? void 0 : r.name) || i.type || "Element";
          t[s] = { type: "element", value: `<${a} />` };
        } else typeof i == "string" ? t[s] = { type: "string", value: `"${i.slice(0, 50)}${i.length > 50 ? "..." : ""}"` } : t[s] = I(i);
      continue;
    }
    t[s] = I(i);
  }
  return t;
}
const fe = {
  0: "useState",
  1: "useReducer",
  2: "useContext",
  3: "useRef",
  4: "useEffect",
  5: "useInsertionEffect",
  6: "useLayoutEffect",
  7: "useCallback",
  8: "useMemo",
  9: "useImperativeHandle",
  10: "useDebugValue",
  11: "useDeferredValue",
  12: "useTransition",
  13: "useMutableSource",
  14: "useSyncExternalStore",
  15: "useId",
  16: "useCacheRefresh"
};
function ot(e) {
  var s;
  const t = [];
  if (e.tag !== y.FunctionComponent && e.tag !== y.ForwardRef && e.tag !== y.SimpleMemoComponent && e.tag !== y.MemoComponent)
    return t;
  const n = e._debugHookTypes;
  let o = e.memoizedState, r = 0;
  for (; o; ) {
    let i = "Hook";
    n && n[r] ? i = n[r] : o.tag !== void 0 && fe[o.tag] ? i = fe[o.tag] : o.queue !== void 0 && o.baseState !== void 0 ? i = "useState" : o.memoizedState !== void 0 && o.deps !== void 0 ? i = "useMemo/useCallback" : o.current !== void 0 && (i = "useRef");
    let a;
    if (i === "useState" || i === "useReducer")
      a = I(o.memoizedState);
    else if (i === "useRef")
      a = I((s = o.memoizedState) == null ? void 0 : s.current);
    else if (i === "useContext")
      a = I(o.memoizedState);
    else if (i === "useMemo" || i === "useCallback" || i === "useMemo/useCallback") {
      const l = o.memoizedState;
      Array.isArray(l) && l.length >= 1 ? a = I(l[0]) : a = I(l);
    } else
      a = { type: "unknown", value: "..." };
    t.push({
      name: i,
      value: a
    }), o = o.next, r++;
  }
  return t;
}
function rt(e) {
  const t = [];
  let n = e.return, o = 0;
  const r = 10;
  for (; n && o < r; ) {
    if (n.tag === y.FunctionComponent || n.tag === y.ClassComponent || n.tag === y.ForwardRef || n.tag === y.MemoComponent || n.tag === y.SimpleMemoComponent || n.tag === y.ContextProvider) {
      const s = z(n);
      s && s !== "Anonymous" && t.push({
        id: D(n),
        name: s,
        tag: n.tag
      });
    }
    n = n.return, o++;
  }
  return t;
}
function it(e) {
  if (e._debugSource)
    return {
      fileName: e._debugSource.fileName,
      lineNumber: e._debugSource.lineNumber,
      columnNumber: e._debugSource.columnNumber
    };
}
function st(e) {
  return {
    id: D(e),
    name: z(e),
    tag: e.tag,
    props: nt(e),
    hooks: ot(e),
    renderedBy: rt(e),
    source: it(e),
    key: e.key
  };
}
const Re = "__react-devtools-component-inspector__", Ce = "__react-devtools-component-inspector__card__", Ne = "__react-devtools-component-inspector__name__", Se = "__react-devtools-component-inspector__indicator__", G = "__react-devtools-component-inspector__source-file__", at = "__react-devtools-component-inspector__source-hint__";
let q;
const ct = {
  display: "block",
  zIndex: "2147483640",
  position: "fixed",
  backgroundColor: "color-mix(in srgb, var(--color-primary-500, #61dafb), transparent 85%)",
  border: "1px solid color-mix(in srgb, var(--color-primary-500, #61dafb), transparent 50%)",
  borderRadius: "5px",
  transition: "all 0.1s ease-in",
  pointerEvents: "none"
}, xe = {
  fontFamily: "Arial, Helvetica, sans-serif",
  padding: "5px 8px",
  borderRadius: "4px",
  textAlign: "left",
  position: "absolute",
  left: "0",
  color: "#fff",
  fontSize: "14px",
  fontWeight: "600",
  lineHeight: "24px",
  backgroundColor: "var(--color-primary-500, #61dafb)",
  boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
  whiteSpace: "nowrap"
}, lt = _({}, xe), ut = V(_({}, xe), {
  fontFamily: 'Menlo, Monaco, Consolas, "Courier New", monospace',
  padding: "6px 10px",
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
  display: "flex",
  flexDirection: "column",
  gap: "2px"
}), dt = {
  display: "inline-block",
  fontWeight: "400",
  fontStyle: "normal",
  fontSize: "12px",
  opacity: "0.7",
  marginLeft: "6px"
}, ft = {
  fontSize: "12px",
  fontWeight: "500"
}, mt = {
  fontSize: "10px",
  opacity: "0.8",
  fontWeight: "normal"
};
function ne() {
  return document.getElementById(Re);
}
function _e(e, t, n) {
  const o = document.createElement("div");
  o.id = Re, Object.assign(o.style, ct);
  const r = document.createElement("div");
  if (r.id = Ce, n) {
    Object.assign(r.style, ut);
    const s = document.createElement("div");
    s.id = G, Object.assign(s.style, ft), r.appendChild(s);
    const i = document.createElement("div");
    i.id = at, Object.assign(i.style, mt), i.textContent = "Click to go to the file", r.appendChild(i);
  } else {
    Object.assign(r.style, lt);
    const s = document.createElement("span");
    s.id = Ne, r.appendChild(s);
    const i = document.createElement("i");
    i.id = Se, Object.assign(i.style, dt), r.appendChild(i);
  }
  return o.appendChild(r), document.body.appendChild(o), Te(e, t, n), o;
}
function Te(e, t, n) {
  let o = ne();
  const r = document.getElementById(Ce), s = document.getElementById(G);
  if (o && (n && !s || !n && s) && (o.remove(), o = null), !o) {
    _e(e, t, n);
    return;
  }
  if (Object.assign(o.style, {
    left: `${Math.round(e.left * 100) / 100}px`,
    top: `${Math.round(e.top * 100) / 100}px`,
    width: `${Math.round(e.width * 100) / 100}px`,
    height: `${Math.round(e.height * 100) / 100}px`,
    display: "block",
    opacity: "1",
    backgroundColor: "color-mix(in srgb, var(--color-primary-500, #61dafb), transparent 85%)",
    border: "1px solid color-mix(in srgb, var(--color-primary-500, #61dafb), transparent 50%)"
  }), r && Object.assign(r.style, {
    top: e.top < 45 ? "100%" : "auto",
    bottom: e.top < 45 ? "auto" : "100%",
    marginTop: e.top < 45 ? "4px" : "0",
    marginBottom: e.top < 45 ? "0" : "4px"
  }), n) {
    const i = document.getElementById(G);
    if (i) {
      let a = n.fileName;
      const l = a.split("/"), p = l.findIndex((d) => d === "src");
      p > 0 ? a = l.slice(p).join("/") : l.length > 1 && !a.startsWith("/") && (a = l.slice(1).join("/")), i.textContent = `${a}:${n.lineNumber}:${n.columnNumber}`;
    }
  } else {
    const i = document.getElementById(Ne);
    i && (i.textContent = t === "Element" ? "Element" : `<${t}>`);
    const a = document.getElementById(Se);
    a && (a.textContent = `${Math.round(e.width * 100) / 100} x ${Math.round(e.height * 100) / 100}`);
  }
}
function k() {
  const e = ne();
  e && (window.clearTimeout(q), e.style.opacity = "0", q = window.setTimeout(() => {
    e.style.display = "none";
  }, 150));
}
function me(e, t, n) {
  const o = ne();
  window.clearTimeout(q), o ? Te(e, t, n) : _e(e, t, n);
}
function pt(e) {
  if (!e.length)
    return null;
  let t = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
  return e.forEach((s) => {
    t = Math.min(t, s.top), n = Math.min(n, s.left), o = Math.max(o, s.right), r = Math.max(r, s.bottom);
  }), new DOMRect(n, t, Math.max(0, o - n), Math.max(0, r - t));
}
function j(e) {
  var n;
  if (!e)
    return !1;
  const t = document.getElementById("react-devtools-overlay");
  return (n = t == null ? void 0 : t.contains(e)) != null ? n : !1;
}
function oe(e, t, n = /* @__PURE__ */ new WeakSet()) {
  var r;
  if (!e || n.has(e) || (n.add(e), e.stateNode && j(e.stateNode)))
    return;
  if (e.tag === y.HostComponent && e.stateNode instanceof Element) {
    j(e.stateNode) || t.add(e.stateNode);
    return;
  }
  if (e.tag === y.HostText) {
    const s = (r = e.stateNode) == null ? void 0 : r.parentElement;
    s && !j(s) && t.add(s);
    return;
  }
  let o = e.child;
  for (; o; )
    oe(o, t, n), o = o.sibling;
}
function O(e, t) {
  if (!e) {
    k();
    return;
  }
  if (e.tag === y.HostComponent && e.stateNode instanceof Element) {
    const i = e.stateNode, a = i.getBoundingClientRect();
    if (a.width > 0 || a.height > 0) {
      const l = e.type || i.tagName.toLowerCase();
      me(a, l, t);
      return;
    }
  }
  const n = /* @__PURE__ */ new Set();
  if (oe(e, n), n.size === 0) {
    k();
    return;
  }
  const o = Array.from(n).map((i) => i.getBoundingClientRect()).filter((i) => i.width > 0 || i.height > 0), r = pt(o);
  if (!r || r.width === 0 && r.height === 0) {
    k();
    return;
  }
  const s = z(e);
  me(r, s, t);
}
function ht(e) {
  if (!e)
    return;
  if (e.tag === y.HostComponent && e.stateNode instanceof Element) {
    e.stateNode.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
    return;
  }
  const t = /* @__PURE__ */ new Set();
  if (oe(e, t), t.size === 0)
    return;
  const n = Array.from(t)[0];
  n && n.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
}
const B = /* @__PURE__ */ new Map(), gt = /* @__PURE__ */ new Map();
function ke() {
  const e = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (!(e != null && e.renderers))
    return null;
  for (const t of e.renderers.values())
    if (t != null && t.overrideProps)
      return t;
  for (const t of e.renderers.values())
    if (t)
      return t;
  return null;
}
function re(e, t) {
  if (t === "null" || t === "undefined")
    return e === "null" ? null : e === "undefined" ? void 0 : yt(e);
  switch (t) {
    case "number":
      return Number(e);
    case "boolean":
      return e === "true";
    case "object":
    case "array":
      try {
        return JSON.parse(e);
      } catch (n) {
        return e;
      }
    case "string":
    default:
      return e.startsWith('"') && e.endsWith('"') || e.startsWith("'") && e.endsWith("'") ? e.slice(1, -1) : e;
  }
}
function yt(e) {
  const t = e.trim();
  if (t === "true")
    return !0;
  if (t === "false")
    return !1;
  if (t === "null")
    return null;
  if (t === "undefined")
    return;
  const n = Number(t);
  if (!Number.isNaN(n) && t !== "")
    return n;
  if (t.startsWith("{") && t.endsWith("}") || t.startsWith("[") && t.endsWith("]"))
    try {
      return JSON.parse(t);
    } catch (o) {
    }
  return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
}
function Pe(e, t, n) {
  if (t.length === 0)
    return n;
  const o = Array.isArray(e) ? [...e] : _({}, e);
  let r = o;
  for (let s = 0; s < t.length - 1; s++) {
    const i = t[s], a = t[s + 1], l = !Number.isNaN(Number(a));
    r[i] = r[i] ? Array.isArray(r[i]) ? [...r[i]] : _({}, r[i]) : l ? [] : {}, r = r[i];
  }
  return r[t[t.length - 1]] = n, o;
}
function Ie(e) {
  if (e.stateNode && typeof e.stateNode.forceUpdate == "function")
    try {
      return e.stateNode.forceUpdate(), !0;
    } catch (o) {
    }
  let t = e, n = 0;
  for (; t && n < 50; ) {
    if (t.stateNode && typeof t.stateNode.forceUpdate == "function")
      try {
        return t.stateNode.forceUpdate(), !0;
      } catch (o) {
      }
    if (t.memoizedState !== null && typeof t.memoizedState == "object" && De(t.memoizedState))
      return !0;
    t = t.return, n++;
  }
  return !1;
}
function De(e) {
  for (; e; ) {
    const t = e.queue, n = e.memoizedState;
    if (t != null && t.dispatch)
      try {
        const o = t.dispatch;
        if (n !== null && typeof n == "object") {
          const r = Array.isArray(n) ? [...n] : _({}, n);
          return o(r), !0;
        } else {
          if (typeof n == "boolean")
            return o(!n), setTimeout(() => o(n), 0), !0;
          if (typeof n == "number")
            return o(n + 1e-7), setTimeout(() => o(n), 0), !0;
        }
      } catch (o) {
      }
    e = e.next;
  }
  return !1;
}
function $e() {
  var e;
  try {
    const t = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!(t != null && t.renderers))
      return !1;
    for (const [n] of t.renderers.entries()) {
      const o = (e = t.getFiberRoots) == null ? void 0 : e.call(t, n);
      if (o) {
        for (const r of o)
          if (r.current && Q(r.current))
            return !0;
      }
    }
  } catch (t) {
  }
  return !1;
}
function Q(e, t = 0) {
  if (!e || t > 100)
    return !1;
  if (e.stateNode && typeof e.stateNode.forceUpdate == "function")
    try {
      return e.stateNode.forceUpdate(), !0;
    } catch (n) {
    }
  return !!(e.memoizedState !== null && typeof e.memoizedState == "object" && De(e.memoizedState) || e.child && Q(e.child, t + 1) || e.sibling && Q(e.sibling, t + 1));
}
function wt(e, t, n, o) {
  const r = T(e);
  if (!r)
    return console.warn(`[React DevTools] Fiber not found: ${e}`), !1;
  const s = re(n, o), i = t.split(".");
  try {
    B.has(e) || B.set(e, /* @__PURE__ */ new Map()), B.get(e).set(t, s);
    const a = ke();
    if (a != null && a.overrideProps)
      try {
        return a.overrideProps(r, i, s), !0;
      } catch (d) {
        const g = Number.parseInt(e.replace("react-fiber-", ""), 10);
        if (!Number.isNaN(g))
          try {
            return a.overrideProps(g, i, s), !0;
          } catch (c) {
          }
      }
    const l = r.memoizedProps || {}, p = Pe(l, i, s);
    return r.memoizedProps = p, r.pendingProps = p, r.alternate && (r.alternate.memoizedProps = p, r.alternate.pendingProps = p), Ie(r) || $e(), !0;
  } catch (a) {
    return console.warn("[React DevTools] Failed to set prop:", a), !1;
  }
}
function Et(e, t) {
  return !(["children", "key", "ref", "$$typeof"].includes(e) || ["element", "function", "symbol"].includes(t));
}
function vt(e, t, n) {
  const o = T(e);
  if (!o)
    return console.warn(`[React DevTools] Fiber not found: ${e}`), !1;
  if (o.tag !== y.ContextProvider)
    return console.warn("[React DevTools] Fiber is not a Context Provider"), !1;
  try {
    const r = re(t, n);
    return ie(o, r, e);
  } catch (r) {
    return console.warn("[React DevTools] Failed to set context value:", r), !1;
  }
}
function bt(e, t) {
  const n = T(e);
  if (!n)
    return console.warn(`[React DevTools] Fiber not found: ${e}`), !1;
  if (n.tag !== y.ContextProvider)
    return console.warn("[React DevTools] Fiber is not a Context Provider"), !1;
  try {
    const o = JSON.parse(t);
    return ie(n, o, e);
  } catch (o) {
    return console.warn("[React DevTools] Failed to set context value from JSON:", o), !1;
  }
}
function Rt(e, t, n, o) {
  var s;
  const r = T(e);
  if (!r)
    return console.warn(`[React DevTools] Fiber not found: ${e}`), !1;
  if (r.tag !== y.ContextProvider)
    return console.warn("[React DevTools] Fiber is not a Context Provider"), !1;
  try {
    const i = re(n, o), a = t.split("."), l = (s = r.memoizedProps) == null ? void 0 : s.value, p = Pe(l, a, i);
    return ie(r, p, e);
  } catch (i) {
    return console.warn("[React DevTools] Failed to set context value at path:", i), !1;
  }
}
function ie(e, t, n) {
  var i;
  gt.set(n, t);
  const o = ke();
  if (o != null && o.overrideProps)
    try {
      return o.overrideProps(e, ["value"], t), !0;
    } catch (a) {
      const l = Number.parseInt(n.replace("react-fiber-", ""), 10);
      if (!Number.isNaN(l))
        try {
          return o.overrideProps(l, ["value"], t), !0;
        } catch (p) {
        }
    }
  const r = V(_({}, e.memoizedProps || {}), { value: t });
  e.memoizedProps = r, e.pendingProps = r, e.alternate && (e.alternate.memoizedProps = r, e.alternate.pendingProps = r);
  const s = (i = e.type) == null ? void 0 : i._context;
  return s && (s._currentValue = t, "_currentValue2" in s && (s._currentValue2 = t)), Ie(e) || $e(), !0;
}
function Ct(e) {
  var i;
  const t = T(e);
  if (!t)
    return [];
  if (t.tag !== y.FunctionComponent && t.tag !== y.ForwardRef && t.tag !== y.SimpleMemoComponent && t.tag !== y.MemoComponent)
    return [];
  const n = [], o = t._debugHookTypes;
  let r = t.memoizedState, s = 0;
  for (; r; ) {
    if ((i = r.queue) != null && i.dispatch) {
      const a = (o == null ? void 0 : o[s]) || "State", l = r.memoizedState, p = xt(l);
      n.push({
        index: s,
        name: a,
        value: kt(l),
        type: p,
        canEdit: _t(p)
      });
    }
    r = r.next, s++;
  }
  return n;
}
function Nt(e, t, n, o) {
  var p;
  const r = T(e);
  if (!r)
    return console.warn(`[React DevTools] Fiber not found: ${e}`), !1;
  let s = r.memoizedState, i = 0, a = null;
  for (; s; ) {
    if ((p = s.queue) != null && p.dispatch) {
      if (i === t) {
        a = s;
        break;
      }
      i++;
    }
    s = s.next;
  }
  if (!a)
    return console.warn(`[React DevTools] Hook at index ${t} not found`), !1;
  const l = a.queue.dispatch;
  if (!l)
    return console.warn("[React DevTools] Hook has no dispatch function"), !1;
  try {
    const d = Tt(n, o);
    return l(d), !0;
  } catch (d) {
    return console.warn("[React DevTools] Failed to set hook state:", d), !1;
  }
}
function St(e, t, n) {
  var o;
  try {
    const r = JSON.parse(n), s = T(e);
    if (!s)
      return !1;
    let i = s.memoizedState, a = 0;
    for (; i; ) {
      if ((o = i.queue) != null && o.dispatch) {
        if (a === t)
          return i.queue.dispatch(r), !0;
        a++;
      }
      i = i.next;
    }
    return !1;
  } catch (r) {
    return console.warn("[React DevTools] Failed to set hook state from JSON:", r), !1;
  }
}
function xt(e) {
  return e === null ? "null" : e === void 0 ? "undefined" : Array.isArray(e) ? "array" : typeof e;
}
function _t(e) {
  return ["string", "number", "boolean", "null", "undefined", "object", "array"].includes(e);
}
function Tt(e, t) {
  switch (t) {
    case "number":
      return Number(e);
    case "boolean":
      return e === "true";
    case "null":
      return null;
    case "undefined":
      return;
    case "object":
    case "array":
      try {
        return JSON.parse(e);
      } catch (n) {
        return e;
      }
    case "string":
    default:
      return e.startsWith('"') && e.endsWith('"') || e.startsWith("'") && e.endsWith("'") ? e.slice(1, -1) : e;
  }
}
function kt(e) {
  if (e === null)
    return null;
  if (e !== void 0)
    return typeof e == "function" ? `ƒ ${e.name || "anonymous"}()` : typeof e == "symbol" ? e.toString() : e;
}
let se = !1, H = "select-component";
const Z = /* @__PURE__ */ new Set(), ee = /* @__PURE__ */ new Set();
function Pt(e) {
  return Z.add(e), () => Z.delete(e);
}
function It(e) {
  return ee.add(e), () => ee.delete(e);
}
function Dt(e) {
  Z.forEach((t) => t(e));
}
function pe(e, t, n) {
  ee.forEach((o) => o(e, t, n));
}
function Fe(e) {
  let t = e;
  for (; t; ) {
    if (je(t, !1))
      return t;
    t = t.return;
  }
  return null;
}
function Me(e) {
  let t = e;
  for (; t; ) {
    if (t._debugSource)
      return t;
    t = t.return;
  }
  return null;
}
function $t(e) {
  const t = e.lastIndexOf(":");
  if (t === -1)
    return null;
  const n = e.lastIndexOf(":", t - 1);
  if (n === -1)
    return null;
  const o = e.substring(0, n), r = Number.parseInt(e.substring(n + 1, t), 10), s = Number.parseInt(e.substring(t + 1), 10);
  return Number.isNaN(r) || Number.isNaN(s) ? null : { fileName: o, lineNumber: r, columnNumber: s };
}
function Oe(e) {
  if (!e)
    return null;
  let t = e;
  for (; t && t !== document.body; ) {
    const n = t.getAttribute("data-source-path");
    if (n)
      return $t(n);
    t = t.parentElement;
  }
  return null;
}
function he(e) {
  if (!se)
    return;
  const t = e.target, n = Ee(t);
  if (H === "select-component") {
    const o = Fe(n);
    o ? O(o) : k();
  } else if (H === "open-in-editor") {
    const o = Oe(t);
    if (o && n)
      O(n, o);
    else {
      const r = Me(n);
      if (r) {
        const s = r._debugSource ? {
          fileName: r._debugSource.fileName,
          lineNumber: r._debugSource.lineNumber,
          columnNumber: r._debugSource.columnNumber
        } : void 0;
        O(n || r, s);
      } else
        k();
    }
  }
}
function ge(e) {
  if (!se)
    return;
  e.preventDefault(), e.stopPropagation();
  const t = e.target, n = Ee(t);
  if (H === "select-component") {
    const o = Fe(n);
    if (o) {
      const r = D(o);
      Dt(r), A(!1), k();
    }
  } else if (H === "open-in-editor") {
    const o = Oe(t);
    if (o) {
      const { fileName: r, lineNumber: s, columnNumber: i } = o;
      pe(r, s, i), A(!1), k();
    } else {
      const r = Me(n);
      if (r && r._debugSource) {
        const { fileName: s, lineNumber: i, columnNumber: a } = r._debugSource;
        pe(s, i, a), A(!1), k();
      }
    }
  }
}
function A(e, t = {}) {
  se = e, t.mode && (H = t.mode), e ? (window.addEventListener("mouseover", he, !0), window.addEventListener("click", ge, !0), document.body.style.cursor = "default") : (window.removeEventListener("mouseover", he, !0), window.removeEventListener("click", ge, !0), document.body.style.cursor = "", k());
}
function U(e, t, n) {
  try {
    const r = `${localStorage.getItem("react_devtools_editor") || "vscode"}://file/${e}:${t}:${n}`, s = document.createElement("a");
    return s.href = r, s.click(), s.remove(), !0;
  } catch (o) {
    return console.warn("[React DevTools] Failed to open with URL protocol:", o), !1;
  }
}
function ye(e, t, n) {
  try {
    const o = `/__open-in-editor?file=${encodeURIComponent(`${e}:${t}:${n}`)}`;
    fetch(o).then((r) => {
      r.ok || (console.warn("[React DevTools] Server endpoint failed, trying URL protocol fallback"), U(e, t, n));
    }).catch(() => {
      console.warn("[React DevTools] Fetch failed, trying URL protocol fallback"), U(e, t, n);
    });
  } catch (o) {
    console.error("[React DevTools] Failed to open in editor:", o), U(e, t, n);
  }
}
let F = {
  recordingState: !1,
  mouseEventEnabled: !0,
  keyboardEventEnabled: !0,
  componentEventEnabled: !0,
  performanceEventEnabled: !0,
  selected: "mouse"
}, ae = 0;
const Ft = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set();
function Mt(e) {
  return te.add(e), () => {
    te.delete(e);
  };
}
function Ae(e, t) {
  te.forEach((n) => {
    try {
      n(e, t);
    } catch (o) {
    }
  });
}
function Ot() {
  return _({}, F);
}
function At(e) {
  F = _(_({}, F), e);
}
function zt() {
  ae = 0, Ft.clear();
}
function Lt(e, t, n) {
  if (!F.recordingState || !F.mouseEventEnabled)
    return;
  const o = {
    id: ++ae,
    time: Date.now(),
    data: {
      type: e,
      x: t,
      y: n
    },
    title: e
  };
  Ae("mouse", o);
}
function Ht(e, t, n) {
  if (!F.recordingState || !F.keyboardEventEnabled)
    return;
  const o = {
    id: ++ae,
    time: Date.now(),
    data: _({
      type: e,
      key: t
    }, n),
    title: t,
    subtitle: e
  };
  Ae("keyboard", o);
}
let we = !1;
function Wt() {
  if (typeof window == "undefined" || we)
    return;
  we = !0, ["mousedown", "mouseup", "click", "dblclick"].forEach((n) => {
    window.addEventListener(n, (o) => {
      Lt(n, o.clientX, o.clientY);
    }, { capture: !0, passive: !0 });
  }), ["keyup", "keydown", "keypress"].forEach((n) => {
    window.addEventListener(n, (o) => {
      Ht(n, o.key, {
        ctrlKey: o.ctrlKey,
        shiftKey: o.shiftKey,
        altKey: o.altKey,
        metaKey: o.metaKey
      });
    }, { capture: !0, passive: !0 });
  });
}
function Vt({
  isHidden: e,
  isAtBottom: t,
  isDragging: n,
  panelVisible: o,
  rotation: r,
  onPointerDown: s,
  onInspectorClick: i,
  children: a
}) {
  return /* @__PURE__ */ React.createElement(
    "div",
    {
      className: `react-devtools-button-group ${e ? "react-devtools-button--hidden" : ""}  ${o ? "react-devtools-button--active" : ""}`,
      style: {
        cursor: n ? "grabbing" : "default",
        transform: e ? `translate(-50%, -50%) rotate(${r}deg) translateY(24px) scale(0.9)` : `translate(-50%, -50%) rotate(${r}deg)`
      },
      onPointerDown: s
    },
    /* @__PURE__ */ React.createElement("div", { className: "react-devtools-button", title: "Toggle React DevTools" }, /* @__PURE__ */ React.createElement("div", { className: "react-devtools-button-icon", style: { transform: `rotate(${-r}deg)` } }, a || /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 128 128", width: "24", height: "24" }, /* @__PURE__ */ React.createElement("circle", { fill: "var(--color-primary-500, #00D8FF)", cx: "64", cy: "64", r: "14" }), /* @__PURE__ */ React.createElement("ellipse", { fill: "none", stroke: "var(--color-primary-500, #00D8FF)", strokeWidth: "4", cx: "64", cy: "64", rx: "22", ry: "54", transform: "rotate(30 64 64)" }), /* @__PURE__ */ React.createElement("ellipse", { fill: "none", stroke: "var(--color-primary-500, #00D8FF)", strokeWidth: "4", cx: "64", cy: "64", rx: "22", ry: "54", transform: "rotate(-30 64 64)" }), /* @__PURE__ */ React.createElement("ellipse", { fill: "none", stroke: "var(--color-primary-500, #00D8FF)", strokeWidth: "4", cx: "64", cy: "64", rx: "22", ry: "54", transform: "rotate(90 64 64)" })))),
    /* @__PURE__ */ React.createElement("div", { className: `react-devtools-expandable ${e ? "react-devtools-expandable--hidden" : ""}` }, /* @__PURE__ */ React.createElement("div", { className: "react-devtools-divider" }), /* @__PURE__ */ React.createElement(
      "div",
      {
        className: "react-devtools-button react-devtools-inspector-button",
        title: "Inspector (Select DOM element)",
        onClick: (l) => {
          l.stopPropagation(), i(l);
        },
        onPointerDown: (l) => l.stopPropagation()
      },
      /* @__PURE__ */ React.createElement("div", { className: "react-devtools-button-icon", style: { transform: `rotate(${-r}deg)` } }, /* @__PURE__ */ React.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { color: "var(--color-primary-500, #00D8FF)" } }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "7" }), /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ React.createElement("path", { d: "M12 2v3" }), /* @__PURE__ */ React.createElement("path", { d: "M12 19v3" }), /* @__PURE__ */ React.createElement("path", { d: "M2 12h3" }), /* @__PURE__ */ React.createElement("path", { d: "M19 12h3" })))
    ))
  );
}
function jt({ iframeRef: e, visible: t, width: n, height: o, onResize: r, enableDragResize: s }) {
  const i = React.useRef(null), [a, l] = React.useState(!1);
  React.useEffect(() => {
    const d = i.current, g = e.current;
    d && g && !d.contains(g) && d.appendChild(g);
  }, [e, t]), React.useEffect(() => {
    const d = e.current;
    d && (d.style.pointerEvents = a ? "none" : "auto");
  }, [a, e]);
  const p = (d, g) => {
    d.preventDefault(), d.stopPropagation(), l(!0);
    const c = d.clientX, u = d.clientY, f = n, m = o, w = (E) => {
      const N = E.clientX - c, b = E.clientY - u;
      let v = f, h = m;
      g === "top" ? h = Math.max(200, m - b) : g === "left" ? v = Math.max(300, f - N * 2) : g === "right" && (v = Math.max(300, f + N * 2)), v = Math.min(v, window.innerWidth - 40), h = Math.min(h, window.innerHeight - 40), r({ width: v, height: h });
    }, C = () => {
      l(!1), window.removeEventListener("pointermove", w), window.removeEventListener("pointerup", C);
    };
    window.addEventListener("pointermove", w), window.addEventListener("pointerup", C);
  };
  return /* @__PURE__ */ React.createElement(
    "div",
    {
      ref: i,
      className: `react-devtools-iframe-container ${t ? "" : "react-devtools-iframe-container--hidden"}`,
      style: { width: n, height: o }
    },
    s && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
      "div",
      {
        className: "resize-handle resize-handle-top",
        onPointerDown: (d) => p(d, "top")
      }
    ), /* @__PURE__ */ React.createElement(
      "div",
      {
        className: "resize-handle resize-handle-left",
        onPointerDown: (d) => p(d, "left")
      }
    ), /* @__PURE__ */ React.createElement(
      "div",
      {
        className: "resize-handle resize-handle-right",
        onPointerDown: (d) => p(d, "right")
      }
    ))
  );
}
function Bt() {
  const e = window.__REACT_DEVTOOLS_CONFIG__;
  if (e != null && e.clientUrl) {
    const r = Date.now();
    return `${e.clientUrl.endsWith("/") ? e.clientUrl : `${e.clientUrl}/`}?t=${r}`;
  }
  const t = window.location.origin, n = "/__react_devtools__/", o = Date.now();
  return `${t}${n}?t=${o}`;
}
function Ut(e, t = 1e4) {
  return new Promise((n) => {
    var r;
    (r = e == null ? void 0 : e.contentWindow) == null || r.postMessage("__REACT_DEVTOOLS_CREATE_CLIENT__", "*");
    const o = (s) => {
      s.data === "__REACT_DEVTOOLS_CLIENT_READY__" && (window.removeEventListener("message", o), n());
    };
    window.addEventListener("message", o), setTimeout(() => {
      window.removeEventListener("message", o), n();
    }, t);
  });
}
function Yt(e, t, n, o) {
  const r = React.useRef(null), s = React.useRef(!1), i = React.useRef(null), a = React.useRef(t), l = React.useRef(e), p = React.useRef(o);
  return React.useEffect(() => {
    a.current = t, l.current = e, p.current = o;
  }, [t, e, o]), React.useEffect(() => {
    const d = Be((f) => {
      const m = M();
      if (m && m.broadcast && s.current)
        try {
          const w = m.broadcast.updateTree(f);
          w && typeof w.then == "function" && w.catch(() => {
          }), i.current = null;
        } catch (w) {
        }
      else
        i.current = f;
    }), g = Pt((f) => {
      const m = M();
      m && m.broadcast && s.current && m.broadcast.selectNode(f).catch(() => {
      }), l.current || a.current(!0);
    }), c = It((f, m, w) => {
      ye(f, m, w);
      const C = M();
      C && C.broadcast && s.current && C.broadcast.openInEditor({ fileName: f, line: m, column: w }).catch(() => {
      });
    });
    Wt();
    const u = Mt((f, m) => {
      const w = M();
      w && w.broadcast && s.current && w.broadcast.onPluginEvent("timeline", "event", { layerId: f, event: m }).catch(() => {
      });
    });
    return () => {
      d(), g(), c(), u();
    };
  }, []), React.useEffect(() => {
    if (r.current)
      return;
    const d = Bt(), g = document.createElement("iframe");
    return g.id = "react-devtools-client-iframe", g.src = d, g.className = "react-devtools-iframe", r.current = g, g.onload = async () => {
      if (Ye(g), await Ut(g), Ue({
        syncTheme(c) {
          p.current && p.current(c);
          const u = document.getElementById("react-devtools-overlay");
          if (u) {
            const w = u.querySelector(".react-devtools-anchor");
            w && (c.mode === "dark" ? w.classList.add("dark") : w.classList.remove("dark"), c.primaryColor && w.style.setProperty("--color-primary-500", c.primaryColor));
          }
          const f = document.getElementById("__react-devtools-component-inspector__");
          f && c.primaryColor && f.style.setProperty("--color-primary-500", c.primaryColor);
          let m = document.getElementById("react-devtools-global-styles");
          m || (m = document.createElement("style"), m.id = "react-devtools-global-styles", document.head.appendChild(m)), c.primaryColor && (m.textContent = `
              #__react-devtools-component-inspector__ {
                --color-primary-500: ${c.primaryColor};
              }
            `);
        },
        toggleDragResize(c) {
          n == null || n(c);
        },
        togglePanel(c) {
          a.current(c != null ? c : !l.current);
        },
        highlightNode(c) {
          const u = T(c);
          u && O(u);
        },
        hideHighlight() {
          k();
        },
        scrollToComponent(c) {
          const u = T(c);
          u && (ht(u), O(u));
        },
        rebuildTree(c) {
          qe(c);
        },
        toggleInspector(c) {
          A(c), c && a.current(!1);
        },
        toggleInspectorMode(c) {
          A(!0, { mode: c }), a.current(!1);
        },
        openInEditor(c) {
          ye(c.fileName, c.line, c.column);
        },
        getReactVersion() {
          return Ge();
        },
        getComponentDetails(c) {
          const u = T(c);
          return u ? st(u) : null;
        },
        getRouterInfo() {
          return Je();
        },
        navigateTo(c) {
          return Xe(c);
        },
        clearNavigationHistory() {
          return Ke();
        },
        setComponentProp(c, u, f, m) {
          return wt(c, u, f, m);
        },
        isEditableProp(c, u) {
          return Et(c, u);
        },
        getContextTree() {
          const c = de();
          return c ? tt(c) : null;
        },
        getContextProviderDetails(c) {
          const u = de();
          return u ? et(u, c) : null;
        },
        setContextValue(c, u, f) {
          return vt(c, u, f);
        },
        setContextValueFromJson(c, u) {
          return bt(c, u);
        },
        setContextValueAtPath(c, u, f, m) {
          return Rt(c, u, f, m);
        },
        getComponentHookStates(c) {
          return Ct(c);
        },
        setHookState(c, u, f, m) {
          return Nt(c, u, f, m);
        },
        setHookStateFromJson(c, u, f) {
          return St(c, u, f);
        },
        // Timeline RPC methods
        getTimelineState() {
          return Ot();
        },
        updateTimelineState(c) {
          At(c);
        },
        clearTimeline() {
          zt();
        },
        async callPluginRPC(c, u, ...f) {
          try {
            const m = `${c}.${u}`;
            return await ue.callRPC(m, ...f);
          } catch (m) {
            throw console.error(`[React DevTools] Failed to call plugin RPC ${c}.${u}:`, m), m;
          }
        },
        subscribeToPluginEvent(c, u) {
          try {
            if (c === "timeline")
              return () => {
              };
            const f = ue.get(c);
            return f ? typeof f.subscribe == "function" ? f.subscribe(u, (w) => {
              const C = M();
              C && C.broadcast && C.broadcast.onPluginEvent(c, u, w).catch(() => {
              });
            }) : (console.error(`[React DevTools] Plugin "${c}" does not support event subscriptions`), () => {
            }) : (console.error(`[React DevTools] Plugin "${c}" not found`), () => {
            });
          } catch (f) {
            return console.error(`[React DevTools] Failed to subscribe to plugin event ${c}.${u}:`, f), () => {
            };
          }
        }
      }, {
        preset: "iframe"
      }), s.current = !0, i.current) {
        const c = M();
        if (c && c.broadcast)
          try {
            const u = c.broadcast.updateTree(i.current);
            u && typeof u.then == "function" && u.catch(() => {
            }), i.current = null;
          } catch (u) {
          }
      }
    }, () => {
      r.current && (r.current.remove(), r.current = null);
    };
  }, []), { iframeRef: r };
}
function Kt() {
  const [e, t] = React.useState(!1);
  return {
    panelVisible: e,
    setPanelVisible: t,
    togglePanel: () => {
      t((o) => !o);
    }
  };
}
function Xt(e) {
  const [t, n] = React.useState(!1), [o, r] = React.useState(!0), [s, i] = React.useState({ x: window.innerWidth / 2, y: window.innerHeight - 25 }), a = React.useRef(null), l = React.useRef({ width: window.innerWidth, height: window.innerHeight });
  React.useEffect(() => {
    const E = setTimeout(() => {
      e || r(!1);
    }, 2e3);
    return () => clearTimeout(E);
  }, [e]), React.useEffect(() => {
    l.current = { width: window.innerWidth, height: window.innerHeight };
    const E = () => {
      if (t)
        return;
      const N = l.current.width, b = l.current.height, v = window.innerWidth, h = window.innerHeight;
      N === v && b === h || (i((R) => {
        let x = R.x, S = R.y;
        const W = N / 2, L = Math.abs(R.x - W) < 50, $ = R.y > b - 50;
        if (L)
          x = v / 2;
        else if (R.x > N / 2) {
          const P = N - R.x;
          x = v - P;
        }
        if ($)
          S = h - 25;
        else if (R.y > b / 2) {
          const P = b - R.y;
          S = h - P;
        }
        return x = Math.max(25, Math.min(v - 25, x)), S = Math.max(25, Math.min(h - 25, S)), { x, y: S };
      }), l.current = { width: v, height: h });
    };
    return window.addEventListener("resize", E), () => window.removeEventListener("resize", E);
  }, [t]), React.useEffect(() => {
    const E = () => {
      n(!1);
    };
    return window.addEventListener("pointerup", E), () => {
      window.removeEventListener("pointerup", E);
    };
  }, []);
  const p = () => {
    r(!0), a.current && clearTimeout(a.current), a.current = setTimeout(() => {
      !e && !t && r(!1);
    }, 2e3);
  }, d = (E, N) => {
    const { innerWidth: b, innerHeight: v } = window, h = 25, R = E, x = b - E, S = N, W = v - N, L = Math.min(R, x, S, W);
    let $ = E, P = N;
    return L === R ? $ = h : L === x ? $ = b - h : L === S ? P = h : P = v - h, $ = Math.max(h, Math.min(b - h, $)), P = Math.max(h, Math.min(v - h, P)), { x: $, y: P };
  }, g = (E, N) => {
    if (E.preventDefault(), E.stopPropagation(), E.target !== E.currentTarget && E.target.closest("iframe"))
      return;
    const b = { x: E.clientX, y: E.clientY, isDragging: !1 }, v = (R) => {
      const x = Math.abs(R.clientX - b.x), S = Math.abs(R.clientY - b.y);
      (x > 5 || S > 5) && (b.isDragging || (b.isDragging = !0, n(!0)), i({
        x: R.clientX,
        y: R.clientY
      }));
    }, h = (R) => {
      const x = b.isDragging;
      n(!1), b.isDragging = !1, window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", h), x ? i((S) => d(S.x, S.y)) : N();
    };
    window.addEventListener("pointermove", v), window.addEventListener("pointerup", h);
  }, c = !e && !o && !t, u = s.y > window.innerHeight - 100, f = s.x < 50 || s.x > window.innerWidth - 50, m = s.x > window.innerWidth - 50, w = s.y > window.innerHeight - 50;
  let C = 0;
  return f ? C = m ? -90 : 90 : C = w ? 0 : 180, {
    position: s,
    isDragging: t,
    isHovering: o,
    isHidden: c,
    isAtBottom: u,
    rotation: C,
    bringUp: p,
    handleButtonPointerDown: g
  };
}
const Jt = {
  react: "#00D8FF",
  // Use our brighter cyan for overlay to match styles.css default, or use #61dafb if strictly matching client
  // user previously used #00D8FF for 'react' case, keeping it or switching?
  // The client PRESET_COLORS says #61dafb.
  // But styles.css fallback is #00D8FF.
  // Let's use the one from PRESET_COLORS to match client, but maybe #00D8FF is better for visibility on white?
  // Let's stick to the list from colors.ts for consistency across preset names.
  // EXCEPTION: 'react' in overlay seems to use #00D8FF in styles.css. I'll allow #00D8FF as a special override or just use the standard one.
  // Let's use the standard ones for the named colors.
  blue: "#3b82f6",
  green: "#10b981",
  purple: "#8b5cf6",
  pink: "#ec4899",
  orange: "#f97316",
  red: "#ef4444",
  yellow: "#f59e0b",
  teal: "#14b8a6",
  indigo: "#6366f1"
};
function Gt() {
  const [e, t] = React.useState(!1);
  return React.useEffect(() => {
    (() => {
      try {
        const o = window.__REACT_DEVTOOLS_CONFIG__, r = o == null ? void 0 : o.theme;
        if (!r)
          return;
        const s = (r == null ? void 0 : r.mode) === "dark" || (r == null ? void 0 : r.mode) === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches;
        t(!!s);
        const a = (r == null ? void 0 : r.primaryColor) || "#00D8FF", l = a.toLowerCase().trim(), d = Jt[l] || (a === "react" ? "#00D8FF" : a);
        if (document.documentElement.style.setProperty("--color-primary-500", d), d.startsWith("#")) {
          const g = Number.parseInt(d.slice(1, 3), 16), c = Number.parseInt(d.slice(3, 5), 16), u = Number.parseInt(d.slice(5, 7), 16);
          document.documentElement.style.setProperty("--color-primary-500-rgb", `${g}, ${c}, ${u}`);
        }
      } catch (o) {
      }
    })();
  }, []), [e, t];
}
function Zt() {
  const e = React.useRef(null), { panelVisible: t, setPanelVisible: n, togglePanel: o } = Kt(), [r, s] = Gt(), [i, a] = React.useState(!1), l = React.useCallback((h) => {
    const R = h.mode === "dark";
    s(R);
  }, []), { iframeRef: p } = Yt(t, n, a, l), {
    position: d,
    isDragging: g,
    isHidden: c,
    isAtBottom: u,
    rotation: f,
    bringUp: m,
    handleButtonPointerDown: w
  } = Xt(t), [C, E] = React.useState({
    width: Math.min(window.innerWidth * 0.8, 1e3),
    height: Math.min(window.innerHeight * 0.6, 800)
  }), N = React.useCallback(() => {
    const h = !t;
    o(), h && m();
  }, [t, o, m]);
  React.useEffect(() => {
    const h = () => {
      N();
    };
    return window.addEventListener("react-devtools:toggle-panel", h), () => {
      window.removeEventListener("react-devtools:toggle-panel", h);
    };
  }, [N]);
  const b = (h) => {
    A(!0, { mode: "open-in-editor" }), n(!1);
  }, v = f === 0 ? "bottom" : f === 180 ? "top" : f === 90 ? "left" : "right";
  return /* @__PURE__ */ React.createElement(
    "div",
    {
      ref: e,
      className: `react-devtools-anchor ${t ? "react-devtools-anchor--active" : ""}  ${r ? "dark" : ""}`,
      "data-position": v,
      style: {
        left: `${d.x}px`,
        top: `${d.y}px`,
        transition: g ? "none" : "left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)"
      },
      onMouseMove: m
    },
    /* @__PURE__ */ React.createElement(
      Vt,
      {
        isHidden: c,
        isAtBottom: u,
        isDragging: g,
        panelVisible: t,
        rotation: f,
        onPointerDown: (h) => w(h, N),
        onInspectorClick: b
      }
    ),
    /* @__PURE__ */ React.createElement(
      jt,
      {
        iframeRef: p,
        visible: t,
        width: C.width,
        height: C.height,
        onResize: E,
        enableDragResize: i
      }
    )
  );
}
export {
  Zt as App
};
