var lr = Object.defineProperty;
var c = (e, t) => lr(e, "name", { value: t, configurable: !0 });

// src/instrumenter/instrumenter.ts
import { once as qs } from "storybook/internal/client-logger";
import {
  FORCE_REMOUNT as ir,
  SET_CURRENT_STORY as Ks,
  STORY_RENDER_PHASE_CHANGED as Gs
} from "storybook/internal/core-events";
import { global as Z } from "@storybook/global";

// ../node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
var fr = {
  reset: [0, 0],
  bold: [1, 22, "\x1B[22m\x1B[1m"],
  dim: [2, 22, "\x1B[22m\x1B[2m"],
  italic: [3, 23],
  underline: [4, 24],
  inverse: [7, 27],
  hidden: [8, 28],
  strikethrough: [9, 29],
  black: [30, 39],
  red: [31, 39],
  green: [32, 39],
  yellow: [33, 39],
  blue: [34, 39],
  magenta: [35, 39],
  cyan: [36, 39],
  white: [37, 39],
  gray: [90, 39],
  bgBlack: [40, 49],
  bgRed: [41, 49],
  bgGreen: [42, 49],
  bgYellow: [43, 49],
  bgBlue: [44, 49],
  bgMagenta: [45, 49],
  bgCyan: [46, 49],
  bgWhite: [47, 49],
  blackBright: [90, 39],
  redBright: [91, 39],
  greenBright: [92, 39],
  yellowBright: [93, 39],
  blueBright: [94, 39],
  magentaBright: [95, 39],
  cyanBright: [96, 39],
  whiteBright: [97, 39],
  bgBlackBright: [100, 49],
  bgRedBright: [101, 49],
  bgGreenBright: [102, 49],
  bgYellowBright: [103, 49],
  bgBlueBright: [104, 49],
  bgMagentaBright: [105, 49],
  bgCyanBright: [106, 49],
  bgWhiteBright: [107, 49]
}, mr = Object.entries(fr);
function Ge(e) {
  return String(e);
}
c(Ge, "a");
Ge.open = "";
Ge.close = "";
function Ft(e = !1) {
  let t = typeof process < "u" ? process : void 0, n = t?.env || {}, r = t?.argv || [];
  return !("NO_COLOR" in n || r.includes("--no-color")) && ("FORCE_COLOR" in n || r.includes("--color") || t?.platform === "win32" || e && n.
  TERM !== "dumb" || "CI" in n) || typeof window < "u" && !!window.chrome;
}
c(Ft, "C");
function jt(e = !1) {
  let t = Ft(e), n = /* @__PURE__ */ c((i, l, u, m) => {
    let a = "", p = 0;
    do
      a += i.substring(p, m) + u, p = m + l.length, m = i.indexOf(l, p);
    while (~m);
    return a + i.substring(p);
  }, "i"), r = /* @__PURE__ */ c((i, l, u = i) => {
    let m = /* @__PURE__ */ c((a) => {
      let p = String(a), b = p.indexOf(l, i.length);
      return ~b ? i + n(p, l, u, b) + l : i + p + l;
    }, "o");
    return m.open = i, m.close = l, m;
  }, "g"), o = {
    isColorSupported: t
  }, s = /* @__PURE__ */ c((i) => `\x1B[${i}m`, "d");
  for (let [i, l] of mr)
    o[i] = t ? r(
      s(l[0]),
      s(l[1]),
      l[2]
    ) : Ge;
  return o;
}
c(jt, "p");

// ../node_modules/tinyrainbow/dist/browser.js
var v = jt();

// ../node_modules/@vitest/pretty-format/dist/index.js
function Xt(e, t) {
  return t.forEach(function(n) {
    n && typeof n != "string" && !Array.isArray(n) && Object.keys(n).forEach(function(r) {
      if (r !== "default" && !(r in e)) {
        var o = Object.getOwnPropertyDescriptor(n, r);
        Object.defineProperty(e, r, o.get ? o : {
          enumerable: !0,
          get: /* @__PURE__ */ c(function() {
            return n[r];
          }, "get")
        });
      }
    });
  }), Object.freeze(e);
}
c(Xt, "_mergeNamespaces");
function pr(e, t) {
  let n = Object.keys(e), r = t === null ? n : n.sort(t);
  if (Object.getOwnPropertySymbols)
    for (let o of Object.getOwnPropertySymbols(e))
      Object.getOwnPropertyDescriptor(e, o).enumerable && r.push(o);
  return r;
}
c(pr, "getKeysOfEnumerableProperties");
function Ee(e, t, n, r, o, s, i = ": ") {
  let l = "", u = 0, m = e.next();
  if (!m.done) {
    l += t.spacingOuter;
    let a = n + t.indent;
    for (; !m.done; ) {
      if (l += a, u++ === t.maxWidth) {
        l += "\u2026";
        break;
      }
      let p = s(m.value[0], t, a, r, o), b = s(m.value[1], t, a, r, o);
      l += p + i + b, m = e.next(), m.done ? t.min || (l += ",") : l += `,${t.spacingInner}`;
    }
    l += t.spacingOuter + n;
  }
  return l;
}
c(Ee, "printIteratorEntries");
function Qe(e, t, n, r, o, s) {
  let i = "", l = 0, u = e.next();
  if (!u.done) {
    i += t.spacingOuter;
    let m = n + t.indent;
    for (; !u.done; ) {
      if (i += m, l++ === t.maxWidth) {
        i += "\u2026";
        break;
      }
      i += s(u.value, t, m, r, o), u = e.next(), u.done ? t.min || (i += ",") : i += `,${t.spacingInner}`;
    }
    i += t.spacingOuter + n;
  }
  return i;
}
c(Qe, "printIteratorValues");
function Re(e, t, n, r, o, s) {
  let i = "";
  e = e instanceof ArrayBuffer ? new DataView(e) : e;
  let l = /* @__PURE__ */ c((m) => m instanceof DataView, "isDataView"), u = l(e) ? e.byteLength : e.length;
  if (u > 0) {
    i += t.spacingOuter;
    let m = n + t.indent;
    for (let a = 0; a < u; a++) {
      if (i += m, a === t.maxWidth) {
        i += "\u2026";
        break;
      }
      (l(e) || a in e) && (i += s(l(e) ? e.getInt8(a) : e[a], t, m, r, o)), a < u - 1 ? i += `,${t.spacingInner}` : t.min || (i += ",");
    }
    i += t.spacingOuter + n;
  }
  return i;
}
c(Re, "printListItems");
function ve(e, t, n, r, o, s) {
  let i = "", l = pr(e, t.compareKeys);
  if (l.length > 0) {
    i += t.spacingOuter;
    let u = n + t.indent;
    for (let m = 0; m < l.length; m++) {
      let a = l[m], p = s(a, t, u, r, o), b = s(e[a], t, u, r, o);
      i += `${u + p}: ${b}`, m < l.length - 1 ? i += `,${t.spacingInner}` : t.min || (i += ",");
    }
    i += t.spacingOuter + n;
  }
  return i;
}
c(ve, "printObjectProperties");
var gr = typeof Symbol == "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621, we = " ", hr = /* @__PURE__ */ c((e, t, n, r, o, s) => {
  let i = e.toString();
  if (i === "ArrayContaining" || i === "ArrayNotContaining")
    return ++r > t.maxDepth ? `[${i}]` : `${i + we}[${Re(e.sample, t, n, r, o, s)}]`;
  if (i === "ObjectContaining" || i === "ObjectNotContaining")
    return ++r > t.maxDepth ? `[${i}]` : `${i + we}{${ve(e.sample, t, n, r, o, s)}}`;
  if (i === "StringMatching" || i === "StringNotMatching" || i === "StringContaining" || i === "StringNotContaining")
    return i + we + s(e.sample, t, n, r, o);
  if (typeof e.toAsymmetricMatcher != "function")
    throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);
  return e.toAsymmetricMatcher();
}, "serialize$5"), dr = /* @__PURE__ */ c((e) => e && e.$$typeof === gr, "test$5"), yr = {
  serialize: hr,
  test: dr
}, br = " ", Zt = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]), Sr = /^(?:HTML\w*Collection|NodeList)$/;
function Er(e) {
  return Zt.has(e) || Sr.test(e);
}
c(Er, "testName");
var _r = /* @__PURE__ */ c((e) => e && e.constructor && !!e.constructor.name && Er(e.constructor.name), "test$4");
function Tr(e) {
  return e.constructor.name === "NamedNodeMap";
}
c(Tr, "isNamedNodeMap");
var Cr = /* @__PURE__ */ c((e, t, n, r, o, s) => {
  let i = e.constructor.name;
  return ++r > t.maxDepth ? `[${i}]` : (t.min ? "" : i + br) + (Zt.has(i) ? `{${ve(Tr(e) ? [...e].reduce((l, u) => (l[u.name] = u.value, l),
  {}) : { ...e }, t, n, r, o, s)}}` : `[${Re([...e], t, n, r, o, s)}]`);
}, "serialize$4"), Or = {
  serialize: Cr,
  test: _r
};
function Qt(e) {
  return e.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
}
c(Qt, "escapeHTML");
function et(e, t, n, r, o, s, i) {
  let l = r + n.indent, u = n.colors;
  return e.map((m) => {
    let a = t[m], p = i(a, n, l, o, s);
    return typeof a != "string" && (p.includes(`
`) && (p = n.spacingOuter + l + p + n.spacingOuter + r), p = `{${p}}`), `${n.spacingInner + r + u.prop.open + m + u.prop.close}=${u.value.open}${p}${u.
    value.close}`;
  }).join("");
}
c(et, "printProps");
function tt(e, t, n, r, o, s) {
  return e.map((i) => t.spacingOuter + n + (typeof i == "string" ? vt(i, t) : s(i, t, n, r, o))).join("");
}
c(tt, "printChildren");
function vt(e, t) {
  let n = t.colors.content;
  return n.open + Qt(e) + n.close;
}
c(vt, "printText");
function $r(e, t) {
  let n = t.colors.comment;
  return `${n.open}<!--${Qt(e)}-->${n.close}`;
}
c($r, "printComment");
function nt(e, t, n, r, o) {
  let s = r.colors.tag;
  return `${s.open}<${e}${t && s.close + t + r.spacingOuter + o + s.open}${n ? `>${s.close}${n}${r.spacingOuter}${o}${s.open}</${e}` : `${t &&
  !r.min ? "" : " "}/`}>${s.close}`;
}
c(nt, "printElement");
function rt(e, t) {
  let n = t.colors.tag;
  return `${n.open}<${e}${n.close} \u2026${n.open} />${n.close}`;
}
c(rt, "printElementAsLeaf");
var wr = 1, en = 3, tn = 8, nn = 11, Ar = /^(?:(?:HTML|SVG)\w*)?Element$/;
function Rr(e) {
  try {
    return typeof e.hasAttribute == "function" && e.hasAttribute("is");
  } catch {
    return !1;
  }
}
c(Rr, "testHasAttribute");
function Nr(e) {
  let t = e.constructor.name, { nodeType: n, tagName: r } = e, o = typeof r == "string" && r.includes("-") || Rr(e);
  return n === wr && (Ar.test(t) || o) || n === en && t === "Text" || n === tn && t === "Comment" || n === nn && t === "DocumentFragment";
}
c(Nr, "testNode");
var Pr = /* @__PURE__ */ c((e) => {
  var t;
  return (e == null || (t = e.constructor) === null || t === void 0 ? void 0 : t.name) && Nr(e);
}, "test$3");
function Ir(e) {
  return e.nodeType === en;
}
c(Ir, "nodeIsText");
function Mr(e) {
  return e.nodeType === tn;
}
c(Mr, "nodeIsComment");
function He(e) {
  return e.nodeType === nn;
}
c(He, "nodeIsFragment");
var Lr = /* @__PURE__ */ c((e, t, n, r, o, s) => {
  if (Ir(e))
    return vt(e.data, t);
  if (Mr(e))
    return $r(e.data, t);
  let i = He(e) ? "DocumentFragment" : e.tagName.toLowerCase();
  return ++r > t.maxDepth ? rt(i, t) : nt(i, et(He(e) ? [] : Array.from(e.attributes, (l) => l.name).sort(), He(e) ? {} : [...e.attributes].
  reduce((l, u) => (l[u.name] = u.value, l), {}), t, n + t.indent, r, o, s), tt(Array.prototype.slice.call(e.childNodes || e.children), t, n +
  t.indent, r, o, s), t, n);
}, "serialize$3"), xr = {
  serialize: Lr,
  test: Pr
}, Dr = "@@__IMMUTABLE_ITERABLE__@@", Fr = "@@__IMMUTABLE_LIST__@@", jr = "@@__IMMUTABLE_KEYED__@@", kr = "@@__IMMUTABLE_MAP__@@", kt = "@@_\
_IMMUTABLE_ORDERED__@@", Br = "@@__IMMUTABLE_RECORD__@@", zr = "@@__IMMUTABLE_SEQ__@@", Yr = "@@__IMMUTABLE_SET__@@", Ur = "@@__IMMUTABLE_ST\
ACK__@@", de = /* @__PURE__ */ c((e) => `Immutable.${e}`, "getImmutableName"), Pe = /* @__PURE__ */ c((e) => `[${e}]`, "printAsLeaf"), Se = "\
 ", Bt = "\u2026";
function Wr(e, t, n, r, o, s, i) {
  return ++r > t.maxDepth ? Pe(de(i)) : `${de(i) + Se}{${Ee(e.entries(), t, n, r, o, s)}}`;
}
c(Wr, "printImmutableEntries");
function Vr(e) {
  let t = 0;
  return { next() {
    if (t < e._keys.length) {
      let n = e._keys[t++];
      return {
        done: !1,
        value: [n, e.get(n)]
      };
    }
    return {
      done: !0,
      value: void 0
    };
  } };
}
c(Vr, "getRecordEntries");
function qr(e, t, n, r, o, s) {
  let i = de(e._name || "Record");
  return ++r > t.maxDepth ? Pe(i) : `${i + Se}{${Ee(Vr(e), t, n, r, o, s)}}`;
}
c(qr, "printImmutableRecord");
function Kr(e, t, n, r, o, s) {
  let i = de("Seq");
  return ++r > t.maxDepth ? Pe(i) : e[jr] ? `${i + Se}{${e._iter || e._object ? Ee(e.entries(), t, n, r, o, s) : Bt}}` : `${i + Se}[${e._iter ||
  e._array || e._collection || e._iterable ? Qe(e.values(), t, n, r, o, s) : Bt}]`;
}
c(Kr, "printImmutableSeq");
function Je(e, t, n, r, o, s, i) {
  return ++r > t.maxDepth ? Pe(de(i)) : `${de(i) + Se}[${Qe(e.values(), t, n, r, o, s)}]`;
}
c(Je, "printImmutableValues");
var Gr = /* @__PURE__ */ c((e, t, n, r, o, s) => e[kr] ? Wr(e, t, n, r, o, s, e[kt] ? "OrderedMap" : "Map") : e[Fr] ? Je(e, t, n, r, o, s, "\
List") : e[Yr] ? Je(e, t, n, r, o, s, e[kt] ? "OrderedSet" : "Set") : e[Ur] ? Je(e, t, n, r, o, s, "Stack") : e[zr] ? Kr(e, t, n, r, o, s) :
qr(e, t, n, r, o, s), "serialize$2"), Hr = /* @__PURE__ */ c((e) => e && (e[Dr] === !0 || e[Br] === !0), "test$2"), Jr = {
  serialize: Gr,
  test: Hr
};
function rn(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
c(rn, "getDefaultExportFromCjs");
var Xe = { exports: {} };
var R = {};
var zt;
function Xr() {
  return zt || (zt = 1, function() {
    function e(f) {
      if (typeof f == "object" && f !== null) {
        var d = f.$$typeof;
        switch (d) {
          case t:
            switch (f = f.type, f) {
              case r:
              case s:
              case o:
              case m:
              case a:
              case g:
                return f;
              default:
                switch (f = f && f.$$typeof, f) {
                  case l:
                  case u:
                  case b:
                  case p:
                    return f;
                  case i:
                    return f;
                  default:
                    return d;
                }
            }
          case n:
            return d;
        }
      }
    }
    c(e, "typeOf");
    var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("reac\
t.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.consumer"), l = Symbol.for("react.context"), u = Symbol.for("react.\
forward_ref"), m = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), b = Symbol.for("react.\
lazy"), g = Symbol.for("react.view_transition"), h = Symbol.for("react.client.reference");
    R.ContextConsumer = i, R.ContextProvider = l, R.Element = t, R.ForwardRef = u, R.Fragment = r, R.Lazy = b, R.Memo = p, R.Portal = n, R.Profiler =
    s, R.StrictMode = o, R.Suspense = m, R.SuspenseList = a, R.isContextConsumer = function(f) {
      return e(f) === i;
    }, R.isContextProvider = function(f) {
      return e(f) === l;
    }, R.isElement = function(f) {
      return typeof f == "object" && f !== null && f.$$typeof === t;
    }, R.isForwardRef = function(f) {
      return e(f) === u;
    }, R.isFragment = function(f) {
      return e(f) === r;
    }, R.isLazy = function(f) {
      return e(f) === b;
    }, R.isMemo = function(f) {
      return e(f) === p;
    }, R.isPortal = function(f) {
      return e(f) === n;
    }, R.isProfiler = function(f) {
      return e(f) === s;
    }, R.isStrictMode = function(f) {
      return e(f) === o;
    }, R.isSuspense = function(f) {
      return e(f) === m;
    }, R.isSuspenseList = function(f) {
      return e(f) === a;
    }, R.isValidElementType = function(f) {
      return typeof f == "string" || typeof f == "function" || f === r || f === s || f === o || f === m || f === a || typeof f == "object" &&
      f !== null && (f.$$typeof === b || f.$$typeof === p || f.$$typeof === l || f.$$typeof === i || f.$$typeof === u || f.$$typeof === h ||
      f.getModuleId !== void 0);
    }, R.typeOf = e;
  }()), R;
}
c(Xr, "requireReactIs_development$1");
var Yt;
function Zr() {
  return Yt || (Yt = 1, Xe.exports = Xr()), Xe.exports;
}
c(Zr, "requireReactIs$1");
var on = Zr(), Qr = /* @__PURE__ */ rn(on), vr = /* @__PURE__ */ Xt({
  __proto__: null,
  default: Qr
}, [on]), Ze = { exports: {} };
var w = {};
var Ut;
function eo() {
  return Ut || (Ut = 1, function() {
    var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"),
    o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), i = Symbol.for("react.context"), l = Symbol.for("react.server_contex\
t"), u = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), p = Symbol.for("react.mem\
o"), b = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), h = !1, f = !1, d = !1, S = !1, _ = !1, C;
    C = Symbol.for("react.module.reference");
    function y(O) {
      return !!(typeof O == "string" || typeof O == "function" || O === n || O === o || _ || O === r || O === m || O === a || S || O === g ||
      h || f || d || typeof O == "object" && O !== null && (O.$$typeof === b || O.$$typeof === p || O.$$typeof === s || O.$$typeof === i || O.
      $$typeof === u || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      O.$$typeof === C || O.getModuleId !== void 0));
    }
    c(y, "isValidElementType");
    function E(O) {
      if (typeof O == "object" && O !== null) {
        var Ke = O.$$typeof;
        switch (Ke) {
          case e:
            var $e = O.type;
            switch ($e) {
              case n:
              case o:
              case r:
              case m:
              case a:
                return $e;
              default:
                var Dt = $e && $e.$$typeof;
                switch (Dt) {
                  case l:
                  case i:
                  case u:
                  case b:
                  case p:
                  case s:
                    return Dt;
                  default:
                    return Ke;
                }
            }
          case t:
            return Ke;
        }
      }
    }
    c(E, "typeOf");
    var $ = i, T = s, A = e, K = u, Q = n, I = b, k = p, G = t, Y = o, P = r, L = m, x = a, H = !1, F = !1;
    function W(O) {
      return H || (H = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
    }
    c(W, "isAsyncMode");
    function re(O) {
      return F || (F = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
    }
    c(re, "isConcurrentMode");
    function V(O) {
      return E(O) === i;
    }
    c(V, "isContextConsumer");
    function q(O) {
      return E(O) === s;
    }
    c(q, "isContextProvider");
    function se(O) {
      return typeof O == "object" && O !== null && O.$$typeof === e;
    }
    c(se, "isElement");
    function J(O) {
      return E(O) === u;
    }
    c(J, "isForwardRef");
    function U(O) {
      return E(O) === n;
    }
    c(U, "isFragment");
    function oe(O) {
      return E(O) === b;
    }
    c(oe, "isLazy");
    function he(O) {
      return E(O) === p;
    }
    c(he, "isMemo");
    function ue(O) {
      return E(O) === t;
    }
    c(ue, "isPortal");
    function be(O) {
      return E(O) === o;
    }
    c(be, "isProfiler");
    function Ce(O) {
      return E(O) === r;
    }
    c(Ce, "isStrictMode");
    function Oe(O) {
      return E(O) === m;
    }
    c(Oe, "isSuspense");
    function ar(O) {
      return E(O) === a;
    }
    c(ar, "isSuspenseList"), w.ContextConsumer = $, w.ContextProvider = T, w.Element = A, w.ForwardRef = K, w.Fragment = Q, w.Lazy = I, w.Memo =
    k, w.Portal = G, w.Profiler = Y, w.StrictMode = P, w.Suspense = L, w.SuspenseList = x, w.isAsyncMode = W, w.isConcurrentMode = re, w.isContextConsumer =
    V, w.isContextProvider = q, w.isElement = se, w.isForwardRef = J, w.isFragment = U, w.isLazy = oe, w.isMemo = he, w.isPortal = ue, w.isProfiler =
    be, w.isStrictMode = Ce, w.isSuspense = Oe, w.isSuspenseList = ar, w.isValidElementType = y, w.typeOf = E;
  }()), w;
}
c(eo, "requireReactIs_development");
var Wt;
function to() {
  return Wt || (Wt = 1, Ze.exports = eo()), Ze.exports;
}
c(to, "requireReactIs");
var sn = to(), no = /* @__PURE__ */ rn(sn), ro = /* @__PURE__ */ Xt({
  __proto__: null,
  default: no
}, [sn]), oo = [
  "isAsyncMode",
  "isConcurrentMode",
  "isContextConsumer",
  "isContextProvider",
  "isElement",
  "isForwardRef",
  "isFragment",
  "isLazy",
  "isMemo",
  "isPortal",
  "isProfiler",
  "isStrictMode",
  "isSuspense",
  "isSuspenseList",
  "isValidElementType"
], fe = Object.fromEntries(oo.map((e) => [e, (t) => ro[e](t) || vr[e](t)]));
function cn(e, t = []) {
  if (Array.isArray(e))
    for (let n of e)
      cn(n, t);
  else e != null && e !== !1 && e !== "" && t.push(e);
  return t;
}
c(cn, "getChildren");
function Vt(e) {
  let t = e.type;
  if (typeof t == "string")
    return t;
  if (typeof t == "function")
    return t.displayName || t.name || "Unknown";
  if (fe.isFragment(e))
    return "React.Fragment";
  if (fe.isSuspense(e))
    return "React.Suspense";
  if (typeof t == "object" && t !== null) {
    if (fe.isContextProvider(e))
      return "Context.Provider";
    if (fe.isContextConsumer(e))
      return "Context.Consumer";
    if (fe.isForwardRef(e)) {
      if (t.displayName)
        return t.displayName;
      let n = t.render.displayName || t.render.name || "";
      return n === "" ? "ForwardRef" : `ForwardRef(${n})`;
    }
    if (fe.isMemo(e)) {
      let n = t.displayName || t.type.displayName || t.type.name || "";
      return n === "" ? "Memo" : `Memo(${n})`;
    }
  }
  return "UNDEFINED";
}
c(Vt, "getType");
function so(e) {
  let { props: t } = e;
  return Object.keys(t).filter((n) => n !== "children" && t[n] !== void 0).sort();
}
c(so, "getPropKeys$1");
var io = /* @__PURE__ */ c((e, t, n, r, o, s) => ++r > t.maxDepth ? rt(Vt(e), t) : nt(Vt(e), et(so(e), e.props, t, n + t.indent, r, o, s), tt(
cn(e.props.children), t, n + t.indent, r, o, s), t, n), "serialize$1"), co = /* @__PURE__ */ c((e) => e != null && fe.isElement(e), "test$1"),
uo = {
  serialize: io,
  test: co
}, ao = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
function lo(e) {
  let { props: t } = e;
  return t ? Object.keys(t).filter((n) => t[n] !== void 0).sort() : [];
}
c(lo, "getPropKeys");
var fo = /* @__PURE__ */ c((e, t, n, r, o, s) => ++r > t.maxDepth ? rt(e.type, t) : nt(e.type, e.props ? et(lo(e), e.props, t, n + t.indent,
r, o, s) : "", e.children ? tt(e.children, t, n + t.indent, r, o, s) : "", t, n), "serialize"), mo = /* @__PURE__ */ c((e) => e && e.$$typeof ===
ao, "test"), po = {
  serialize: fo,
  test: mo
}, un = Object.prototype.toString, go = Date.prototype.toISOString, ho = Error.prototype.toString, qt = RegExp.prototype.toString;
function Ae(e) {
  return typeof e.constructor == "function" && e.constructor.name || "Object";
}
c(Ae, "getConstructorName");
function yo(e) {
  return typeof window < "u" && e === window;
}
c(yo, "isWindow");
var bo = /^Symbol\((.*)\)(.*)$/, So = /\n/g, st = class st extends Error {
  constructor(t, n) {
    super(t), this.stack = n, this.name = this.constructor.name;
  }
};
c(st, "PrettyFormatPluginError");
var Ne = st;
function Eo(e) {
  return e === "[object Array]" || e === "[object ArrayBuffer]" || e === "[object DataView]" || e === "[object Float32Array]" || e === "[obj\
ect Float64Array]" || e === "[object Int8Array]" || e === "[object Int16Array]" || e === "[object Int32Array]" || e === "[object Uint8Array]" ||
  e === "[object Uint8ClampedArray]" || e === "[object Uint16Array]" || e === "[object Uint32Array]";
}
c(Eo, "isToStringedArrayType");
function _o(e) {
  return Object.is(e, -0) ? "-0" : String(e);
}
c(_o, "printNumber");
function To(e) {
  return `${e}n`;
}
c(To, "printBigInt");
function Kt(e, t) {
  return t ? `[Function ${e.name || "anonymous"}]` : "[Function]";
}
c(Kt, "printFunction");
function Gt(e) {
  return String(e).replace(bo, "Symbol($1)");
}
c(Gt, "printSymbol");
function Ht(e) {
  return `[${ho.call(e)}]`;
}
c(Ht, "printError");
function an(e, t, n, r) {
  if (e === !0 || e === !1)
    return `${e}`;
  if (e === void 0)
    return "undefined";
  if (e === null)
    return "null";
  let o = typeof e;
  if (o === "number")
    return _o(e);
  if (o === "bigint")
    return To(e);
  if (o === "string")
    return r ? `"${e.replaceAll(/"|\\/g, "\\$&")}"` : `"${e}"`;
  if (o === "function")
    return Kt(e, t);
  if (o === "symbol")
    return Gt(e);
  let s = un.call(e);
  return s === "[object WeakMap]" ? "WeakMap {}" : s === "[object WeakSet]" ? "WeakSet {}" : s === "[object Function]" || s === "[object Gen\
eratorFunction]" ? Kt(e, t) : s === "[object Symbol]" ? Gt(e) : s === "[object Date]" ? Number.isNaN(+e) ? "Date { NaN }" : go.call(e) : s ===
  "[object Error]" ? Ht(e) : s === "[object RegExp]" ? n ? qt.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&") : qt.call(e) : e instanceof Error ?
  Ht(e) : null;
}
c(an, "printBasicValue");
function ln(e, t, n, r, o, s) {
  if (o.includes(e))
    return "[Circular]";
  o = [...o], o.push(e);
  let i = ++r > t.maxDepth, l = t.min;
  if (t.callToJSON && !i && e.toJSON && typeof e.toJSON == "function" && !s)
    return ae(e.toJSON(), t, n, r, o, !0);
  let u = un.call(e);
  return u === "[object Arguments]" ? i ? "[Arguments]" : `${l ? "" : "Arguments "}[${Re(e, t, n, r, o, ae)}]` : Eo(u) ? i ? `[${e.constructor.
  name}]` : `${l || !t.printBasicPrototype && e.constructor.name === "Array" ? "" : `${e.constructor.name} `}[${Re(e, t, n, r, o, ae)}]` : u ===
  "[object Map]" ? i ? "[Map]" : `Map {${Ee(e.entries(), t, n, r, o, ae, " => ")}}` : u === "[object Set]" ? i ? "[Set]" : `Set {${Qe(e.values(),
  t, n, r, o, ae)}}` : i || yo(e) ? `[${Ae(e)}]` : `${l || !t.printBasicPrototype && Ae(e) === "Object" ? "" : `${Ae(e)} `}{${ve(e, t, n, r,
  o, ae)}}`;
}
c(ln, "printComplexValue");
var Co = {
  test: /* @__PURE__ */ c((e) => e && e instanceof Error, "test"),
  serialize(e, t, n, r, o, s) {
    if (o.includes(e))
      return "[Circular]";
    o = [...o, e];
    let i = ++r > t.maxDepth, { message: l, cause: u, ...m } = e, a = {
      message: l,
      ...typeof u < "u" ? { cause: u } : {},
      ...e instanceof AggregateError ? { errors: e.errors } : {},
      ...m
    }, p = e.name !== "Error" ? e.name : Ae(e);
    return i ? `[${p}]` : `${p} {${Ee(Object.entries(a).values(), t, n, r, o, s)}}`;
  }
};
function Oo(e) {
  return e.serialize != null;
}
c(Oo, "isNewPlugin");
function fn(e, t, n, r, o, s) {
  let i;
  try {
    i = Oo(e) ? e.serialize(t, n, r, o, s, ae) : e.print(t, (l) => ae(l, n, r, o, s), (l) => {
      let u = r + n.indent;
      return u + l.replaceAll(So, `
${u}`);
    }, {
      edgeSpacing: n.spacingOuter,
      min: n.min,
      spacing: n.spacingInner
    }, n.colors);
  } catch (l) {
    throw new Ne(l.message, l.stack);
  }
  if (typeof i != "string")
    throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof i}".`);
  return i;
}
c(fn, "printPlugin");
function mn(e, t) {
  for (let n of e)
    try {
      if (n.test(t))
        return n;
    } catch (r) {
      throw new Ne(r.message, r.stack);
    }
  return null;
}
c(mn, "findPlugin");
function ae(e, t, n, r, o, s) {
  let i = mn(t.plugins, e);
  if (i !== null)
    return fn(i, e, t, n, r, o);
  let l = an(e, t.printFunctionName, t.escapeRegex, t.escapeString);
  return l !== null ? l : ln(e, t, n, r, o, s);
}
c(ae, "printer");
var ot = {
  comment: "gray",
  content: "reset",
  prop: "yellow",
  tag: "cyan",
  value: "green"
}, pn = Object.keys(ot), ee = {
  callToJSON: !0,
  compareKeys: void 0,
  escapeRegex: !1,
  escapeString: !0,
  highlight: !1,
  indent: 2,
  maxDepth: Number.POSITIVE_INFINITY,
  maxWidth: Number.POSITIVE_INFINITY,
  min: !1,
  plugins: [],
  printBasicPrototype: !0,
  printFunctionName: !0,
  theme: ot
};
function $o(e) {
  for (let t of Object.keys(e))
    if (!Object.prototype.hasOwnProperty.call(ee, t))
      throw new Error(`pretty-format: Unknown option "${t}".`);
  if (e.min && e.indent !== void 0 && e.indent !== 0)
    throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
}
c($o, "validateOptions");
function wo() {
  return pn.reduce((e, t) => {
    let n = ot[t], r = n && v[n];
    if (r && typeof r.close == "string" && typeof r.open == "string")
      e[t] = r;
    else
      throw new Error(`pretty-format: Option "theme" has a key "${t}" whose value "${n}" is undefined in ansi-styles.`);
    return e;
  }, /* @__PURE__ */ Object.create(null));
}
c(wo, "getColorsHighlight");
function Ao() {
  return pn.reduce((e, t) => (e[t] = {
    close: "",
    open: ""
  }, e), /* @__PURE__ */ Object.create(null));
}
c(Ao, "getColorsEmpty");
function gn(e) {
  return e?.printFunctionName ?? ee.printFunctionName;
}
c(gn, "getPrintFunctionName");
function hn(e) {
  return e?.escapeRegex ?? ee.escapeRegex;
}
c(hn, "getEscapeRegex");
function dn(e) {
  return e?.escapeString ?? ee.escapeString;
}
c(dn, "getEscapeString");
function Jt(e) {
  return {
    callToJSON: e?.callToJSON ?? ee.callToJSON,
    colors: e?.highlight ? wo() : Ao(),
    compareKeys: typeof e?.compareKeys == "function" || e?.compareKeys === null ? e.compareKeys : ee.compareKeys,
    escapeRegex: hn(e),
    escapeString: dn(e),
    indent: e?.min ? "" : Ro(e?.indent ?? ee.indent),
    maxDepth: e?.maxDepth ?? ee.maxDepth,
    maxWidth: e?.maxWidth ?? ee.maxWidth,
    min: e?.min ?? ee.min,
    plugins: e?.plugins ?? ee.plugins,
    printBasicPrototype: e?.printBasicPrototype ?? !0,
    printFunctionName: gn(e),
    spacingInner: e?.min ? " " : `
`,
    spacingOuter: e?.min ? "" : `
`
  };
}
c(Jt, "getConfig");
function Ro(e) {
  return Array.from({ length: e + 1 }).join(" ");
}
c(Ro, "createIndent");
function X(e, t) {
  if (t && ($o(t), t.plugins)) {
    let r = mn(t.plugins, e);
    if (r !== null)
      return fn(r, e, Jt(t), "", 0, []);
  }
  let n = an(e, gn(t), hn(t), dn(t));
  return n !== null ? n : ln(e, Jt(t), "", 0, []);
}
c(X, "format");
var _e = {
  AsymmetricMatcher: yr,
  DOMCollection: Or,
  DOMElement: xr,
  Immutable: Jr,
  ReactElement: uo,
  ReactTestComponent: po,
  Error: Co
};

// ../node_modules/loupe/lib/helpers.js
var yn = {
  bold: ["1", "22"],
  dim: ["2", "22"],
  italic: ["3", "23"],
  underline: ["4", "24"],
  // 5 & 6 are blinking
  inverse: ["7", "27"],
  hidden: ["8", "28"],
  strike: ["9", "29"],
  // 10-20 are fonts
  // 21-29 are resets for 1-9
  black: ["30", "39"],
  red: ["31", "39"],
  green: ["32", "39"],
  yellow: ["33", "39"],
  blue: ["34", "39"],
  magenta: ["35", "39"],
  cyan: ["36", "39"],
  white: ["37", "39"],
  brightblack: ["30;1", "39"],
  brightred: ["31;1", "39"],
  brightgreen: ["32;1", "39"],
  brightyellow: ["33;1", "39"],
  brightblue: ["34;1", "39"],
  brightmagenta: ["35;1", "39"],
  brightcyan: ["36;1", "39"],
  brightwhite: ["37;1", "39"],
  grey: ["90", "39"]
}, No = {
  special: "cyan",
  number: "yellow",
  bigint: "yellow",
  boolean: "yellow",
  undefined: "grey",
  null: "bold",
  string: "green",
  symbol: "green",
  date: "magenta",
  regexp: "red"
}, ie = "\u2026";
function Po(e, t) {
  let n = yn[No[t]] || yn[t] || "";
  return n ? `\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m` : String(e);
}
c(Po, "colorise");
function bn({
  showHidden: e = !1,
  depth: t = 2,
  colors: n = !1,
  customInspect: r = !0,
  showProxy: o = !1,
  maxArrayLength: s = 1 / 0,
  breakLength: i = 1 / 0,
  seen: l = [],
  // eslint-disable-next-line no-shadow
  truncate: u = 1 / 0,
  stylize: m = String
} = {}, a) {
  let p = {
    showHidden: !!e,
    depth: Number(t),
    colors: !!n,
    customInspect: !!r,
    showProxy: !!o,
    maxArrayLength: Number(s),
    breakLength: Number(i),
    truncate: Number(u),
    seen: l,
    inspect: a,
    stylize: m
  };
  return p.colors && (p.stylize = Po), p;
}
c(bn, "normaliseOptions");
function Io(e) {
  return e >= "\uD800" && e <= "\uDBFF";
}
c(Io, "isHighSurrogate");
function B(e, t, n = ie) {
  e = String(e);
  let r = n.length, o = e.length;
  if (r > t && o > r)
    return n;
  if (o > t && o > r) {
    let s = t - r;
    return s > 0 && Io(e[s - 1]) && (s = s - 1), `${e.slice(0, s)}${n}`;
  }
  return e;
}
c(B, "truncate");
function D(e, t, n, r = ", ") {
  n = n || t.inspect;
  let o = e.length;
  if (o === 0)
    return "";
  let s = t.truncate, i = "", l = "", u = "";
  for (let m = 0; m < o; m += 1) {
    let a = m + 1 === e.length, p = m + 2 === e.length;
    u = `${ie}(${e.length - m})`;
    let b = e[m];
    t.truncate = s - i.length - (a ? 0 : r.length);
    let g = l || n(b, t) + (a ? "" : r), h = i.length + g.length, f = h + u.length;
    if (a && h > s && i.length + u.length <= s || !a && !p && f > s || (l = a ? "" : n(e[m + 1], t) + (p ? "" : r), !a && p && f > s && h + l.
    length > s))
      break;
    if (i += g, !a && !p && h + l.length >= s) {
      u = `${ie}(${e.length - m - 1})`;
      break;
    }
    u = "";
  }
  return `${i}${u}`;
}
c(D, "inspectList");
function Mo(e) {
  return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? e : JSON.stringify(e).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
}
c(Mo, "quoteComplexKey");
function ce([e, t], n) {
  return n.truncate -= 2, typeof e == "string" ? e = Mo(e) : typeof e != "number" && (e = `[${n.inspect(e, n)}]`), n.truncate -= e.length, t =
  n.inspect(t, n), `${e}: ${t}`;
}
c(ce, "inspectProperty");

// ../node_modules/loupe/lib/array.js
function it(e, t) {
  let n = Object.keys(e).slice(e.length);
  if (!e.length && !n.length)
    return "[]";
  t.truncate -= 4;
  let r = D(e, t);
  t.truncate -= r.length;
  let o = "";
  return n.length && (o = D(n.map((s) => [s, e[s]]), t, ce)), `[ ${r}${o ? `, ${o}` : ""} ]`;
}
c(it, "inspectArray");

// ../node_modules/loupe/lib/typedarray.js
var Lo = /* @__PURE__ */ c((e) => typeof Buffer == "function" && e instanceof Buffer ? "Buffer" : e[Symbol.toStringTag] ? e[Symbol.toStringTag] :
e.constructor.name, "getArrayName");
function te(e, t) {
  let n = Lo(e);
  t.truncate -= n.length + 4;
  let r = Object.keys(e).slice(e.length);
  if (!e.length && !r.length)
    return `${n}[]`;
  let o = "";
  for (let i = 0; i < e.length; i++) {
    let l = `${t.stylize(B(e[i], t.truncate), "number")}${i === e.length - 1 ? "" : ", "}`;
    if (t.truncate -= l.length, e[i] !== e.length && t.truncate <= 3) {
      o += `${ie}(${e.length - e[i] + 1})`;
      break;
    }
    o += l;
  }
  let s = "";
  return r.length && (s = D(r.map((i) => [i, e[i]]), t, ce)), `${n}[ ${o}${s ? `, ${s}` : ""} ]`;
}
c(te, "inspectTypedArray");

// ../node_modules/loupe/lib/date.js
function ct(e, t) {
  let n = e.toJSON();
  if (n === null)
    return "Invalid Date";
  let r = n.split("T"), o = r[0];
  return t.stylize(`${o}T${B(r[1], t.truncate - o.length - 1)}`, "date");
}
c(ct, "inspectDate");

// ../node_modules/loupe/lib/function.js
function Ie(e, t) {
  let n = e[Symbol.toStringTag] || "Function", r = e.name;
  return r ? t.stylize(`[${n} ${B(r, t.truncate - 11)}]`, "special") : t.stylize(`[${n}]`, "special");
}
c(Ie, "inspectFunction");

// ../node_modules/loupe/lib/map.js
function xo([e, t], n) {
  return n.truncate -= 4, e = n.inspect(e, n), n.truncate -= e.length, t = n.inspect(t, n), `${e} => ${t}`;
}
c(xo, "inspectMapEntry");
function Do(e) {
  let t = [];
  return e.forEach((n, r) => {
    t.push([r, n]);
  }), t;
}
c(Do, "mapToEntries");
function ut(e, t) {
  return e.size === 0 ? "Map{}" : (t.truncate -= 7, `Map{ ${D(Do(e), t, xo)} }`);
}
c(ut, "inspectMap");

// ../node_modules/loupe/lib/number.js
var Fo = Number.isNaN || ((e) => e !== e);
function Me(e, t) {
  return Fo(e) ? t.stylize("NaN", "number") : e === 1 / 0 ? t.stylize("Infinity", "number") : e === -1 / 0 ? t.stylize("-Infinity", "number") :
  e === 0 ? t.stylize(1 / e === 1 / 0 ? "+0" : "-0", "number") : t.stylize(B(String(e), t.truncate), "number");
}
c(Me, "inspectNumber");

// ../node_modules/loupe/lib/bigint.js
function Le(e, t) {
  let n = B(e.toString(), t.truncate - 1);
  return n !== ie && (n += "n"), t.stylize(n, "bigint");
}
c(Le, "inspectBigInt");

// ../node_modules/loupe/lib/regexp.js
function at(e, t) {
  let n = e.toString().split("/")[2], r = t.truncate - (2 + n.length), o = e.source;
  return t.stylize(`/${B(o, r)}/${n}`, "regexp");
}
c(at, "inspectRegExp");

// ../node_modules/loupe/lib/set.js
function jo(e) {
  let t = [];
  return e.forEach((n) => {
    t.push(n);
  }), t;
}
c(jo, "arrayFromSet");
function lt(e, t) {
  return e.size === 0 ? "Set{}" : (t.truncate -= 7, `Set{ ${D(jo(e), t)} }`);
}
c(lt, "inspectSet");

// ../node_modules/loupe/lib/string.js
var Sn = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\u\
ffff]", "g"), ko = {
  "\b": "\\b",
  "	": "\\t",
  "\n": "\\n",
  "\f": "\\f",
  "\r": "\\r",
  "'": "\\'",
  "\\": "\\\\"
}, Bo = 16, zo = 4;
function Yo(e) {
  return ko[e] || `\\u${`0000${e.charCodeAt(0).toString(Bo)}`.slice(-zo)}`;
}
c(Yo, "escape");
function xe(e, t) {
  return Sn.test(e) && (e = e.replace(Sn, Yo)), t.stylize(`'${B(e, t.truncate - 2)}'`, "string");
}
c(xe, "inspectString");

// ../node_modules/loupe/lib/symbol.js
function De(e) {
  return "description" in Symbol.prototype ? e.description ? `Symbol(${e.description})` : "Symbol()" : e.toString();
}
c(De, "inspectSymbol");

// ../node_modules/loupe/lib/promise.js
var En = /* @__PURE__ */ c(() => "Promise{\u2026}", "getPromiseValue");
try {
  let { getPromiseDetails: e, kPending: t, kRejected: n } = process.binding("util");
  Array.isArray(e(Promise.resolve())) && (En = /* @__PURE__ */ c((r, o) => {
    let [s, i] = e(r);
    return s === t ? "Promise{<pending>}" : `Promise${s === n ? "!" : ""}{${o.inspect(i, o)}}`;
  }, "getPromiseValue"));
} catch {
}
var _n = En;

// ../node_modules/loupe/lib/object.js
function me(e, t) {
  let n = Object.getOwnPropertyNames(e), r = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : [];
  if (n.length === 0 && r.length === 0)
    return "{}";
  if (t.truncate -= 4, t.seen = t.seen || [], t.seen.includes(e))
    return "[Circular]";
  t.seen.push(e);
  let o = D(n.map((l) => [l, e[l]]), t, ce), s = D(r.map((l) => [l, e[l]]), t, ce);
  t.seen.pop();
  let i = "";
  return o && s && (i = ", "), `{ ${o}${i}${s} }`;
}
c(me, "inspectObject");

// ../node_modules/loupe/lib/class.js
var ft = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
function mt(e, t) {
  let n = "";
  return ft && ft in e && (n = e[ft]), n = n || e.constructor.name, (!n || n === "_class") && (n = "<Anonymous Class>"), t.truncate -= n.length,
  `${n}${me(e, t)}`;
}
c(mt, "inspectClass");

// ../node_modules/loupe/lib/arguments.js
function pt(e, t) {
  return e.length === 0 ? "Arguments[]" : (t.truncate -= 13, `Arguments[ ${D(e, t)} ]`);
}
c(pt, "inspectArguments");

// ../node_modules/loupe/lib/error.js
var Uo = [
  "stack",
  "line",
  "column",
  "name",
  "message",
  "fileName",
  "lineNumber",
  "columnNumber",
  "number",
  "description",
  "cause"
];
function gt(e, t) {
  let n = Object.getOwnPropertyNames(e).filter((i) => Uo.indexOf(i) === -1), r = e.name;
  t.truncate -= r.length;
  let o = "";
  if (typeof e.message == "string" ? o = B(e.message, t.truncate) : n.unshift("message"), o = o ? `: ${o}` : "", t.truncate -= o.length + 5,
  t.seen = t.seen || [], t.seen.includes(e))
    return "[Circular]";
  t.seen.push(e);
  let s = D(n.map((i) => [i, e[i]]), t, ce);
  return `${r}${o}${s ? ` { ${s} }` : ""}`;
}
c(gt, "inspectObject");

// ../node_modules/loupe/lib/html.js
function Wo([e, t], n) {
  return n.truncate -= 3, t ? `${n.stylize(String(e), "yellow")}=${n.stylize(`"${t}"`, "string")}` : `${n.stylize(String(e), "yellow")}`;
}
c(Wo, "inspectAttribute");
function Fe(e, t) {
  return D(e, t, Vo, `
`);
}
c(Fe, "inspectNodeCollection");
function Vo(e, t) {
  switch (e.nodeType) {
    case 1:
      return je(e, t);
    case 3:
      return t.inspect(e.data, t);
    default:
      return t.inspect(e, t);
  }
}
c(Vo, "inspectNode");
function je(e, t) {
  let n = e.getAttributeNames(), r = e.tagName.toLowerCase(), o = t.stylize(`<${r}`, "special"), s = t.stylize(">", "special"), i = t.stylize(
  `</${r}>`, "special");
  t.truncate -= r.length * 2 + 5;
  let l = "";
  n.length > 0 && (l += " ", l += D(n.map((a) => [a, e.getAttribute(a)]), t, Wo, " ")), t.truncate -= l.length;
  let u = t.truncate, m = Fe(e.children, t);
  return m && m.length > u && (m = `${ie}(${e.children.length})`), `${o}${l}${s}${m}${i}`;
}
c(je, "inspectHTML");

// ../node_modules/loupe/lib/index.js
var qo = typeof Symbol == "function" && typeof Symbol.for == "function", ht = qo ? Symbol.for("chai/inspect") : "@@chai/inspect", dt = Symbol.
for("nodejs.util.inspect.custom"), Tn = /* @__PURE__ */ new WeakMap(), Cn = {}, On = {
  undefined: /* @__PURE__ */ c((e, t) => t.stylize("undefined", "undefined"), "undefined"),
  null: /* @__PURE__ */ c((e, t) => t.stylize("null", "null"), "null"),
  boolean: /* @__PURE__ */ c((e, t) => t.stylize(String(e), "boolean"), "boolean"),
  Boolean: /* @__PURE__ */ c((e, t) => t.stylize(String(e), "boolean"), "Boolean"),
  number: Me,
  Number: Me,
  bigint: Le,
  BigInt: Le,
  string: xe,
  String: xe,
  function: Ie,
  Function: Ie,
  symbol: De,
  // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
  Symbol: De,
  Array: it,
  Date: ct,
  Map: ut,
  Set: lt,
  RegExp: at,
  Promise: _n,
  // WeakSet, WeakMap are totally opaque to us
  WeakSet: /* @__PURE__ */ c((e, t) => t.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
  WeakMap: /* @__PURE__ */ c((e, t) => t.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
  Arguments: pt,
  Int8Array: te,
  Uint8Array: te,
  Uint8ClampedArray: te,
  Int16Array: te,
  Uint16Array: te,
  Int32Array: te,
  Uint32Array: te,
  Float32Array: te,
  Float64Array: te,
  Generator: /* @__PURE__ */ c(() => "", "Generator"),
  DataView: /* @__PURE__ */ c(() => "", "DataView"),
  ArrayBuffer: /* @__PURE__ */ c(() => "", "ArrayBuffer"),
  Error: gt,
  HTMLCollection: Fe,
  NodeList: Fe
}, Ko = /* @__PURE__ */ c((e, t, n) => ht in e && typeof e[ht] == "function" ? e[ht](t) : dt in e && typeof e[dt] == "function" ? e[dt](t.depth,
t) : "inspect" in e && typeof e.inspect == "function" ? e.inspect(t.depth, t) : "constructor" in e && Tn.has(e.constructor) ? Tn.get(e.constructor)(
e, t) : Cn[n] ? Cn[n](e, t) : "", "inspectCustom"), Go = Object.prototype.toString;
function ke(e, t = {}) {
  let n = bn(t, ke), { customInspect: r } = n, o = e === null ? "null" : typeof e;
  if (o === "object" && (o = Go.call(e).slice(8, -1)), o in On)
    return On[o](e, n);
  if (r && e) {
    let i = Ko(e, n, o);
    if (i)
      return typeof i == "string" ? i : ke(i, n);
  }
  let s = e ? Object.getPrototypeOf(e) : !1;
  return s === Object.prototype || s === null ? me(e, n) : e && typeof HTMLElement == "function" && e instanceof HTMLElement ? je(e, n) : "c\
onstructor" in e ? e.constructor !== Object ? mt(e, n) : me(e, n) : e === Object(e) ? me(e, n) : n.stylize(String(e), o);
}
c(ke, "inspect");

// ../node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
var { AsymmetricMatcher: Jo, DOMCollection: Xo, DOMElement: Zo, Immutable: Qo, ReactElement: vo, ReactTestComponent: es } = _e, $n = [
  es,
  vo,
  Zo,
  Xo,
  Qo,
  Jo
];
function pe(e, t = 10, { maxLength: n, ...r } = {}) {
  let o = n ?? 1e4, s;
  try {
    s = X(e, {
      maxDepth: t,
      escapeString: !1,
      plugins: $n,
      ...r
    });
  } catch {
    s = X(e, {
      callToJSON: !1,
      maxDepth: t,
      escapeString: !1,
      plugins: $n,
      ...r
    });
  }
  return s.length >= o && t > 1 ? pe(e, Math.floor(Math.min(t, Number.MAX_SAFE_INTEGER) / 2), {
    maxLength: n,
    ...r
  }) : s;
}
c(pe, "stringify");
var ts = /%[sdjifoOc%]/g;
function wn(...e) {
  if (typeof e[0] != "string") {
    let s = [];
    for (let i = 0; i < e.length; i++)
      s.push(Te(e[i], {
        depth: 0,
        colors: !1
      }));
    return s.join(" ");
  }
  let t = e.length, n = 1, r = e[0], o = String(r).replace(ts, (s) => {
    if (s === "%%")
      return "%";
    if (n >= t)
      return s;
    switch (s) {
      case "%s": {
        let i = e[n++];
        return typeof i == "bigint" ? `${i.toString()}n` : typeof i == "number" && i === 0 && 1 / i < 0 ? "-0" : typeof i == "object" && i !==
        null ? typeof i.toString == "function" && i.toString !== Object.prototype.toString ? i.toString() : Te(i, {
          depth: 0,
          colors: !1
        }) : String(i);
      }
      case "%d": {
        let i = e[n++];
        return typeof i == "bigint" ? `${i.toString()}n` : Number(i).toString();
      }
      case "%i": {
        let i = e[n++];
        return typeof i == "bigint" ? `${i.toString()}n` : Number.parseInt(String(i)).toString();
      }
      case "%f":
        return Number.parseFloat(String(e[n++])).toString();
      case "%o":
        return Te(e[n++], {
          showHidden: !0,
          showProxy: !0
        });
      case "%O":
        return Te(e[n++]);
      case "%c":
        return n++, "";
      case "%j":
        try {
          return JSON.stringify(e[n++]);
        } catch (i) {
          let l = i.message;
          if (l.includes("circular structure") || l.includes("cyclic structures") || l.includes("cyclic object"))
            return "[Circular]";
          throw i;
        }
      default:
        return s;
    }
  });
  for (let s = e[n]; n < t; s = e[++n])
    s === null || typeof s != "object" ? o += ` ${s}` : o += ` ${Te(s)}`;
  return o;
}
c(wn, "format");
function Te(e, t = {}) {
  return t.truncate === 0 && (t.truncate = Number.POSITIVE_INFINITY), ke(e, t);
}
c(Te, "inspect");
function An(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
c(An, "getDefaultExportFromCjs");

// ../node_modules/@vitest/utils/dist/helpers.js
function ns(e) {
  return e === Object.prototype || e === Function.prototype || e === RegExp.prototype;
}
c(ns, "isFinalObj");
function Be(e) {
  return Object.prototype.toString.apply(e).slice(8, -1);
}
c(Be, "getType");
function rs(e, t) {
  let n = typeof t == "function" ? t : (r) => t.add(r);
  Object.getOwnPropertyNames(e).forEach(n), Object.getOwnPropertySymbols(e).forEach(n);
}
c(rs, "collectOwnProperties");
function bt(e) {
  let t = /* @__PURE__ */ new Set();
  return ns(e) ? [] : (rs(e, t), Array.from(t));
}
c(bt, "getOwnProperties");
var Rn = { forceWritable: !1 };
function St(e, t = Rn) {
  return yt(e, /* @__PURE__ */ new WeakMap(), t);
}
c(St, "deepClone");
function yt(e, t, n = Rn) {
  let r, o;
  if (t.has(e))
    return t.get(e);
  if (Array.isArray(e)) {
    for (o = Array.from({ length: r = e.length }), t.set(e, o); r--; )
      o[r] = yt(e[r], t, n);
    return o;
  }
  if (Object.prototype.toString.call(e) === "[object Object]") {
    o = Object.create(Object.getPrototypeOf(e)), t.set(e, o);
    let s = bt(e);
    for (let i of s) {
      let l = Object.getOwnPropertyDescriptor(e, i);
      if (!l)
        continue;
      let u = yt(e[i], t, n);
      n.forceWritable ? Object.defineProperty(o, i, {
        enumerable: l.enumerable,
        configurable: !0,
        writable: !0,
        value: u
      }) : "get" in l ? Object.defineProperty(o, i, {
        ...l,
        get() {
          return u;
        }
      }) : Object.defineProperty(o, i, {
        ...l,
        value: u
      });
    }
    return o;
  }
  return e;
}
c(yt, "clone");

// ../node_modules/@vitest/utils/dist/diff.js
var z = -1, j = 1, M = 0, Rt = class Rt {
  0;
  1;
  constructor(t, n) {
    this[0] = t, this[1] = n;
  }
};
c(Rt, "Diff");
var N = Rt;
function os(e, t) {
  if (!e || !t || e.charAt(0) !== t.charAt(0))
    return 0;
  let n = 0, r = Math.min(e.length, t.length), o = r, s = 0;
  for (; n < o; )
    e.substring(s, o) === t.substring(s, o) ? (n = o, s = n) : r = o, o = Math.floor((r - n) / 2 + n);
  return o;
}
c(os, "diff_commonPrefix");
function Vn(e, t) {
  if (!e || !t || e.charAt(e.length - 1) !== t.charAt(t.length - 1))
    return 0;
  let n = 0, r = Math.min(e.length, t.length), o = r, s = 0;
  for (; n < o; )
    e.substring(e.length - o, e.length - s) === t.substring(t.length - o, t.length - s) ? (n = o, s = n) : r = o, o = Math.floor((r - n) / 2 +
    n);
  return o;
}
c(Vn, "diff_commonSuffix");
function Nn(e, t) {
  let n = e.length, r = t.length;
  if (n === 0 || r === 0)
    return 0;
  n > r ? e = e.substring(n - r) : n < r && (t = t.substring(0, n));
  let o = Math.min(n, r);
  if (e === t)
    return o;
  let s = 0, i = 1;
  for (; ; ) {
    let l = e.substring(o - i), u = t.indexOf(l);
    if (u === -1)
      return s;
    i += u, (u === 0 || e.substring(o - i) === t.substring(0, i)) && (s = i, i++);
  }
}
c(Nn, "diff_commonOverlap_");
function ss(e) {
  let t = !1, n = [], r = 0, o = null, s = 0, i = 0, l = 0, u = 0, m = 0;
  for (; s < e.length; )
    e[s][0] === M ? (n[r++] = s, i = u, l = m, u = 0, m = 0, o = e[s][1]) : (e[s][0] === j ? u += e[s][1].length : m += e[s][1].length, o &&
    o.length <= Math.max(i, l) && o.length <= Math.max(u, m) && (e.splice(n[r - 1], 0, new N(z, o)), e[n[r - 1] + 1][0] = j, r--, r--, s = r >
    0 ? n[r - 1] : -1, i = 0, l = 0, u = 0, m = 0, o = null, t = !0)), s++;
  for (t && qn(e), us(e), s = 1; s < e.length; ) {
    if (e[s - 1][0] === z && e[s][0] === j) {
      let a = e[s - 1][1], p = e[s][1], b = Nn(a, p), g = Nn(p, a);
      b >= g ? (b >= a.length / 2 || b >= p.length / 2) && (e.splice(s, 0, new N(M, p.substring(0, b))), e[s - 1][1] = a.substring(0, a.length -
      b), e[s + 1][1] = p.substring(b), s++) : (g >= a.length / 2 || g >= p.length / 2) && (e.splice(s, 0, new N(M, a.substring(0, g))), e[s -
      1][0] = j, e[s - 1][1] = p.substring(0, p.length - g), e[s + 1][0] = z, e[s + 1][1] = a.substring(g), s++), s++;
    }
    s++;
  }
}
c(ss, "diff_cleanupSemantic");
var Pn = /[^a-z0-9]/i, In = /\s/, Mn = /[\r\n]/, is = /\n\r?\n$/, cs = /^\r?\n\r?\n/;
function us(e) {
  let t = 1;
  for (; t < e.length - 1; ) {
    if (e[t - 1][0] === M && e[t + 1][0] === M) {
      let n = e[t - 1][1], r = e[t][1], o = e[t + 1][1], s = Vn(n, r);
      if (s) {
        let a = r.substring(r.length - s);
        n = n.substring(0, n.length - s), r = a + r.substring(0, r.length - s), o = a + o;
      }
      let i = n, l = r, u = o, m = ze(n, r) + ze(r, o);
      for (; r.charAt(0) === o.charAt(0); ) {
        n += r.charAt(0), r = r.substring(1) + o.charAt(0), o = o.substring(1);
        let a = ze(n, r) + ze(r, o);
        a >= m && (m = a, i = n, l = r, u = o);
      }
      e[t - 1][1] !== i && (i ? e[t - 1][1] = i : (e.splice(t - 1, 1), t--), e[t][1] = l, u ? e[t + 1][1] = u : (e.splice(t + 1, 1), t--));
    }
    t++;
  }
}
c(us, "diff_cleanupSemanticLossless");
function qn(e) {
  e.push(new N(M, ""));
  let t = 0, n = 0, r = 0, o = "", s = "", i;
  for (; t < e.length; )
    switch (e[t][0]) {
      case j:
        r++, s += e[t][1], t++;
        break;
      case z:
        n++, o += e[t][1], t++;
        break;
      case M:
        n + r > 1 ? (n !== 0 && r !== 0 && (i = os(s, o), i !== 0 && (t - n - r > 0 && e[t - n - r - 1][0] === M ? e[t - n - r - 1][1] += s.
        substring(0, i) : (e.splice(0, 0, new N(M, s.substring(0, i))), t++), s = s.substring(i), o = o.substring(i)), i = Vn(s, o), i !== 0 &&
        (e[t][1] = s.substring(s.length - i) + e[t][1], s = s.substring(0, s.length - i), o = o.substring(0, o.length - i))), t -= n + r, e.
        splice(t, n + r), o.length && (e.splice(t, 0, new N(z, o)), t++), s.length && (e.splice(t, 0, new N(j, s)), t++), t++) : t !== 0 && e[t -
        1][0] === M ? (e[t - 1][1] += e[t][1], e.splice(t, 1)) : t++, r = 0, n = 0, o = "", s = "";
        break;
    }
  e[e.length - 1][1] === "" && e.pop();
  let l = !1;
  for (t = 1; t < e.length - 1; )
    e[t - 1][0] === M && e[t + 1][0] === M && (e[t][1].substring(e[t][1].length - e[t - 1][1].length) === e[t - 1][1] ? (e[t][1] = e[t - 1][1] +
    e[t][1].substring(0, e[t][1].length - e[t - 1][1].length), e[t + 1][1] = e[t - 1][1] + e[t + 1][1], e.splice(t - 1, 1), l = !0) : e[t][1].
    substring(0, e[t + 1][1].length) === e[t + 1][1] && (e[t - 1][1] += e[t + 1][1], e[t][1] = e[t][1].substring(e[t + 1][1].length) + e[t +
    1][1], e.splice(t + 1, 1), l = !0)), t++;
  l && qn(e);
}
c(qn, "diff_cleanupMerge");
function ze(e, t) {
  if (!e || !t)
    return 6;
  let n = e.charAt(e.length - 1), r = t.charAt(0), o = n.match(Pn), s = r.match(Pn), i = o && n.match(In), l = s && r.match(In), u = i && n.
  match(Mn), m = l && r.match(Mn), a = u && e.match(is), p = m && t.match(cs);
  return a || p ? 5 : u || m ? 4 : o && !i && l ? 3 : i || l ? 2 : o || s ? 1 : 0;
}
c(ze, "diff_cleanupSemanticScore_");
var Kn = "Compared values have no visual difference.", as = "Compared values serialize to the same structure.\nPrinting internal object struc\
ture without calling `toJSON` instead.", Ye = {}, Ln;
function ls() {
  if (Ln) return Ye;
  Ln = 1, Object.defineProperty(Ye, "__esModule", {
    value: !0
  }), Ye.default = b;
  let e = "diff-sequences", t = 0, n = /* @__PURE__ */ c((g, h, f, d, S) => {
    let _ = 0;
    for (; g < h && f < d && S(g, f); )
      g += 1, f += 1, _ += 1;
    return _;
  }, "countCommonItemsF"), r = /* @__PURE__ */ c((g, h, f, d, S) => {
    let _ = 0;
    for (; g <= h && f <= d && S(h, d); )
      h -= 1, d -= 1, _ += 1;
    return _;
  }, "countCommonItemsR"), o = /* @__PURE__ */ c((g, h, f, d, S, _, C) => {
    let y = 0, E = -g, $ = _[y], T = $;
    _[y] += n(
      $ + 1,
      h,
      d + $ - E + 1,
      f,
      S
    );
    let A = g < C ? g : C;
    for (y += 1, E += 2; y <= A; y += 1, E += 2) {
      if (y !== g && T < _[y])
        $ = _[y];
      else if ($ = T + 1, h <= $)
        return y - 1;
      T = _[y], _[y] = $ + n($ + 1, h, d + $ - E + 1, f, S);
    }
    return C;
  }, "extendPathsF"), s = /* @__PURE__ */ c((g, h, f, d, S, _, C) => {
    let y = 0, E = g, $ = _[y], T = $;
    _[y] -= r(
      h,
      $ - 1,
      f,
      d + $ - E - 1,
      S
    );
    let A = g < C ? g : C;
    for (y += 1, E -= 2; y <= A; y += 1, E -= 2) {
      if (y !== g && _[y] < T)
        $ = _[y];
      else if ($ = T - 1, $ < h)
        return y - 1;
      T = _[y], _[y] = $ - r(
        h,
        $ - 1,
        f,
        d + $ - E - 1,
        S
      );
    }
    return C;
  }, "extendPathsR"), i = /* @__PURE__ */ c((g, h, f, d, S, _, C, y, E, $, T) => {
    let A = d - h, K = f - h, I = S - d - K, k = -I - (g - 1), G = -I + (g - 1), Y = t, P = g < y ? g : y;
    for (let L = 0, x = -g; L <= P; L += 1, x += 2) {
      let H = L === 0 || L !== g && Y < C[L], F = H ? C[L] : Y, W = H ? F : F + 1, re = A + W - x, V = n(
        W + 1,
        f,
        re + 1,
        S,
        _
      ), q = W + V;
      if (Y = C[L], C[L] = q, k <= x && x <= G) {
        let se = (g - 1 - (x + I)) / 2;
        if (se <= $ && E[se] - 1 <= q) {
          let J = A + F - (H ? x + 1 : x - 1), U = r(
            h,
            F,
            d,
            J,
            _
          ), oe = F - U, he = J - U, ue = oe + 1, be = he + 1;
          T.nChangePreceding = g - 1, g - 1 === ue + be - h - d ? (T.aEndPreceding = h, T.bEndPreceding = d) : (T.aEndPreceding = ue, T.bEndPreceding =
          be), T.nCommonPreceding = U, U !== 0 && (T.aCommonPreceding = ue, T.bCommonPreceding = be), T.nCommonFollowing = V, V !== 0 && (T.
          aCommonFollowing = W + 1, T.bCommonFollowing = re + 1);
          let Ce = q + 1, Oe = re + V + 1;
          return T.nChangeFollowing = g - 1, g - 1 === f + S - Ce - Oe ? (T.aStartFollowing = f, T.bStartFollowing = S) : (T.aStartFollowing =
          Ce, T.bStartFollowing = Oe), !0;
        }
      }
    }
    return !1;
  }, "extendOverlappablePathsF"), l = /* @__PURE__ */ c((g, h, f, d, S, _, C, y, E, $, T) => {
    let A = S - f, K = f - h, I = S - d - K, k = I - g, G = I + g, Y = t, P = g < $ ? g : $;
    for (let L = 0, x = g; L <= P; L += 1, x -= 2) {
      let H = L === 0 || L !== g && E[L] < Y, F = H ? E[L] : Y, W = H ? F : F - 1, re = A + W - x, V = r(
        h,
        W - 1,
        d,
        re - 1,
        _
      ), q = W - V;
      if (Y = E[L], E[L] = q, k <= x && x <= G) {
        let se = (g + (x - I)) / 2;
        if (se <= y && q - 1 <= C[se]) {
          let J = re - V;
          if (T.nChangePreceding = g, g === q + J - h - d ? (T.aEndPreceding = h, T.bEndPreceding = d) : (T.aEndPreceding = q, T.bEndPreceding =
          J), T.nCommonPreceding = V, V !== 0 && (T.aCommonPreceding = q, T.bCommonPreceding = J), T.nChangeFollowing = g - 1, g === 1)
            T.nCommonFollowing = 0, T.aStartFollowing = f, T.bStartFollowing = S;
          else {
            let U = A + F - (H ? x - 1 : x + 1), oe = n(
              F,
              f,
              U,
              S,
              _
            );
            T.nCommonFollowing = oe, oe !== 0 && (T.aCommonFollowing = F, T.bCommonFollowing = U);
            let he = F + oe, ue = U + oe;
            g - 1 === f + S - he - ue ? (T.aStartFollowing = f, T.bStartFollowing = S) : (T.aStartFollowing = he, T.bStartFollowing = ue);
          }
          return !0;
        }
      }
    }
    return !1;
  }, "extendOverlappablePathsR"), u = /* @__PURE__ */ c((g, h, f, d, S, _, C, y, E) => {
    let $ = d - h, T = S - f, A = f - h, K = S - d, Q = K - A, I = A, k = A;
    if (C[0] = h - 1, y[0] = f, Q % 2 === 0) {
      let G = (g || Q) / 2, Y = (A + K) / 2;
      for (let P = 1; P <= Y; P += 1)
        if (I = o(P, f, S, $, _, C, I), P < G)
          k = s(P, h, d, T, _, y, k);
        else if (
          // If a reverse path overlaps a forward path in the same diagonal,
          // return a division of the index intervals at the middle change.
          l(
            P,
            h,
            f,
            d,
            S,
            _,
            C,
            I,
            y,
            k,
            E
          )
        )
          return;
    } else {
      let G = ((g || Q) + 1) / 2, Y = (A + K + 1) / 2, P = 1;
      for (I = o(P, f, S, $, _, C, I), P += 1; P <= Y; P += 1)
        if (k = s(
          P - 1,
          h,
          d,
          T,
          _,
          y,
          k
        ), P < G)
          I = o(P, f, S, $, _, C, I);
        else if (
          // If a forward path overlaps a reverse path in the same diagonal,
          // return a division of the index intervals at the middle change.
          i(
            P,
            h,
            f,
            d,
            S,
            _,
            C,
            I,
            y,
            k,
            E
          )
        )
          return;
    }
    throw new Error(
      `${e}: no overlap aStart=${h} aEnd=${f} bStart=${d} bEnd=${S}`
    );
  }, "divide"), m = /* @__PURE__ */ c((g, h, f, d, S, _, C, y, E, $) => {
    if (S - d < f - h) {
      if (_ = !_, _ && C.length === 1) {
        let { foundSubsequence: q, isCommon: se } = C[0];
        C[1] = {
          foundSubsequence: /* @__PURE__ */ c((J, U, oe) => {
            q(J, oe, U);
          }, "foundSubsequence"),
          isCommon: /* @__PURE__ */ c((J, U) => se(U, J), "isCommon")
        };
      }
      let re = h, V = f;
      h = d, f = S, d = re, S = V;
    }
    let { foundSubsequence: T, isCommon: A } = C[_ ? 1 : 0];
    u(
      g,
      h,
      f,
      d,
      S,
      A,
      y,
      E,
      $
    );
    let {
      nChangePreceding: K,
      aEndPreceding: Q,
      bEndPreceding: I,
      nCommonPreceding: k,
      aCommonPreceding: G,
      bCommonPreceding: Y,
      nCommonFollowing: P,
      aCommonFollowing: L,
      bCommonFollowing: x,
      nChangeFollowing: H,
      aStartFollowing: F,
      bStartFollowing: W
    } = $;
    h < Q && d < I && m(
      K,
      h,
      Q,
      d,
      I,
      _,
      C,
      y,
      E,
      $
    ), k !== 0 && T(k, G, Y), P !== 0 && T(P, L, x), F < f && W < S && m(
      H,
      F,
      f,
      W,
      S,
      _,
      C,
      y,
      E,
      $
    );
  }, "findSubsequences"), a = /* @__PURE__ */ c((g, h) => {
    if (typeof h != "number")
      throw new TypeError(`${e}: ${g} typeof ${typeof h} is not a number`);
    if (!Number.isSafeInteger(h))
      throw new RangeError(`${e}: ${g} value ${h} is not a safe integer`);
    if (h < 0)
      throw new RangeError(`${e}: ${g} value ${h} is a negative integer`);
  }, "validateLength"), p = /* @__PURE__ */ c((g, h) => {
    let f = typeof h;
    if (f !== "function")
      throw new TypeError(`${e}: ${g} typeof ${f} is not a function`);
  }, "validateCallback");
  function b(g, h, f, d) {
    a("aLength", g), a("bLength", h), p("isCommon", f), p("foundSubsequence", d);
    let S = n(0, g, 0, h, f);
    if (S !== 0 && d(S, 0, 0), g !== S || h !== S) {
      let _ = S, C = S, y = r(
        _,
        g - 1,
        C,
        h - 1,
        f
      ), E = g - y, $ = h - y, T = S + y;
      g !== T && h !== T && m(
        0,
        _,
        E,
        C,
        $,
        !1,
        [
          {
            foundSubsequence: d,
            isCommon: f
          }
        ],
        [t],
        [t],
        {
          aCommonFollowing: t,
          aCommonPreceding: t,
          aEndPreceding: t,
          aStartFollowing: t,
          bCommonFollowing: t,
          bCommonPreceding: t,
          bEndPreceding: t,
          bStartFollowing: t,
          nChangeFollowing: t,
          nChangePreceding: t,
          nCommonFollowing: t,
          nCommonPreceding: t
        }
      ), y !== 0 && d(y, E, $);
    }
  }
  return c(b, "diffSequence"), Ye;
}
c(ls, "requireBuild");
var fs = ls(), Gn = /* @__PURE__ */ An(fs);
function ms(e, t) {
  return e.replace(/\s+$/, (n) => t(n));
}
c(ms, "formatTrailingSpaces");
function wt(e, t, n, r, o, s) {
  return e.length !== 0 ? n(`${r} ${ms(e, o)}`) : r !== " " ? n(r) : t && s.length !== 0 ? n(`${r} ${s}`) : "";
}
c(wt, "printDiffLine");
function Hn(e, t, { aColor: n, aIndicator: r, changeLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return wt(e, t, n, r, o, s);
}
c(Hn, "printDeleteLine");
function Jn(e, t, { bColor: n, bIndicator: r, changeLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return wt(e, t, n, r, o, s);
}
c(Jn, "printInsertLine");
function Xn(e, t, { commonColor: n, commonIndicator: r, commonLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return wt(e, t, n, r, o, s);
}
c(Xn, "printCommonLine");
function xn(e, t, n, r, { patchColor: o }) {
  return o(`@@ -${e + 1},${t - e} +${n + 1},${r - n} @@`);
}
c(xn, "createPatchMark");
function ps(e, t) {
  let n = e.length, r = t.contextLines, o = r + r, s = n, i = !1, l = 0, u = 0;
  for (; u !== n; ) {
    let y = u;
    for (; u !== n && e[u][0] === M; )
      u += 1;
    if (y !== u)
      if (y === 0)
        u > r && (s -= u - r, i = !0);
      else if (u === n) {
        let E = u - y;
        E > r && (s -= E - r, i = !0);
      } else {
        let E = u - y;
        E > o && (s -= E - o, l += 1);
      }
    for (; u !== n && e[u][0] !== M; )
      u += 1;
  }
  let m = l !== 0 || i;
  l !== 0 ? s += l + 1 : i && (s += 1);
  let a = s - 1, p = [], b = 0;
  m && p.push("");
  let g = 0, h = 0, f = 0, d = 0, S = /* @__PURE__ */ c((y) => {
    let E = p.length;
    p.push(Xn(y, E === 0 || E === a, t)), f += 1, d += 1;
  }, "pushCommonLine"), _ = /* @__PURE__ */ c((y) => {
    let E = p.length;
    p.push(Hn(y, E === 0 || E === a, t)), f += 1;
  }, "pushDeleteLine"), C = /* @__PURE__ */ c((y) => {
    let E = p.length;
    p.push(Jn(y, E === 0 || E === a, t)), d += 1;
  }, "pushInsertLine");
  for (u = 0; u !== n; ) {
    let y = u;
    for (; u !== n && e[u][0] === M; )
      u += 1;
    if (y !== u)
      if (y === 0) {
        u > r && (y = u - r, g = y, h = y, f = g, d = h);
        for (let E = y; E !== u; E += 1)
          S(e[E][1]);
      } else if (u === n) {
        let E = u - y > r ? y + r : u;
        for (let $ = y; $ !== E; $ += 1)
          S(e[$][1]);
      } else {
        let E = u - y;
        if (E > o) {
          let $ = y + r;
          for (let A = y; A !== $; A += 1)
            S(e[A][1]);
          p[b] = xn(g, f, h, d, t), b = p.length, p.push("");
          let T = E - o;
          g = f + T, h = d + T, f = g, d = h;
          for (let A = u - r; A !== u; A += 1)
            S(e[A][1]);
        } else
          for (let $ = y; $ !== u; $ += 1)
            S(e[$][1]);
      }
    for (; u !== n && e[u][0] === z; )
      _(e[u][1]), u += 1;
    for (; u !== n && e[u][0] === j; )
      C(e[u][1]), u += 1;
  }
  return m && (p[b] = xn(g, f, h, d, t)), p.join(`
`);
}
c(ps, "joinAlignedDiffsNoExpand");
function gs(e, t) {
  return e.map((n, r, o) => {
    let s = n[1], i = r === 0 || r === o.length - 1;
    switch (n[0]) {
      case z:
        return Hn(s, i, t);
      case j:
        return Jn(s, i, t);
      default:
        return Xn(s, i, t);
    }
  }).join(`
`);
}
c(gs, "joinAlignedDiffsExpand");
var Et = /* @__PURE__ */ c((e) => e, "noColor"), Zn = 5, hs = 0;
function ds() {
  return {
    aAnnotation: "Expected",
    aColor: v.green,
    aIndicator: "-",
    bAnnotation: "Received",
    bColor: v.red,
    bIndicator: "+",
    changeColor: v.inverse,
    changeLineTrailingSpaceColor: Et,
    commonColor: v.dim,
    commonIndicator: " ",
    commonLineTrailingSpaceColor: Et,
    compareKeys: void 0,
    contextLines: Zn,
    emptyFirstOrLastLinePlaceholder: "",
    expand: !1,
    includeChangeCounts: !1,
    omitAnnotationLines: !1,
    patchColor: v.yellow,
    printBasicPrototype: !1,
    truncateThreshold: hs,
    truncateAnnotation: "... Diff result is truncated",
    truncateAnnotationColor: Et
  };
}
c(ds, "getDefaultOptions");
function ys(e) {
  return e && typeof e == "function" ? e : void 0;
}
c(ys, "getCompareKeys");
function bs(e) {
  return typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : Zn;
}
c(bs, "getContextLines");
function ge(e = {}) {
  return {
    ...ds(),
    ...e,
    compareKeys: ys(e.compareKeys),
    contextLines: bs(e.contextLines)
  };
}
c(ge, "normalizeDiffOptions");
function ye(e) {
  return e.length === 1 && e[0].length === 0;
}
c(ye, "isEmptyString");
function Ss(e) {
  let t = 0, n = 0;
  return e.forEach((r) => {
    switch (r[0]) {
      case z:
        t += 1;
        break;
      case j:
        n += 1;
        break;
    }
  }), {
    a: t,
    b: n
  };
}
c(Ss, "countChanges");
function Es({ aAnnotation: e, aColor: t, aIndicator: n, bAnnotation: r, bColor: o, bIndicator: s, includeChangeCounts: i, omitAnnotationLines: l }, u) {
  if (l)
    return "";
  let m = "", a = "";
  if (i) {
    let g = String(u.a), h = String(u.b), f = r.length - e.length, d = " ".repeat(Math.max(0, f)), S = " ".repeat(Math.max(0, -f)), _ = h.length -
    g.length, C = " ".repeat(Math.max(0, _)), y = " ".repeat(Math.max(0, -_));
    m = `${d}  ${n} ${C}${g}`, a = `${S}  ${s} ${y}${h}`;
  }
  let p = `${n} ${e}${m}`, b = `${s} ${r}${a}`;
  return `${t(p)}
${o(b)}

`;
}
c(Es, "printAnnotation");
function At(e, t, n) {
  return Es(n, Ss(e)) + (n.expand ? gs(e, n) : ps(e, n)) + (t ? n.truncateAnnotationColor(`
${n.truncateAnnotation}`) : "");
}
c(At, "printDiffLines");
function We(e, t, n) {
  let r = ge(n), [o, s] = Qn(ye(e) ? [] : e, ye(t) ? [] : t, r);
  return At(o, s, r);
}
c(We, "diffLinesUnified");
function _s(e, t, n, r, o) {
  if (ye(e) && ye(n) && (e = [], n = []), ye(t) && ye(r) && (t = [], r = []), e.length !== n.length || t.length !== r.length)
    return We(e, t, o);
  let [s, i] = Qn(n, r, o), l = 0, u = 0;
  return s.forEach((m) => {
    switch (m[0]) {
      case z:
        m[1] = e[l], l += 1;
        break;
      case j:
        m[1] = t[u], u += 1;
        break;
      default:
        m[1] = t[u], l += 1, u += 1;
    }
  }), At(s, i, ge(o));
}
c(_s, "diffLinesUnified2");
function Qn(e, t, n) {
  let r = n?.truncateThreshold ?? !1, o = Math.max(Math.floor(n?.truncateThreshold ?? 0), 0), s = r ? Math.min(e.length, o) : e.length, i = r ?
  Math.min(t.length, o) : t.length, l = s !== e.length || i !== t.length, u = /* @__PURE__ */ c((g, h) => e[g] === t[h], "isCommon"), m = [],
  a = 0, p = 0;
  for (Gn(s, i, u, /* @__PURE__ */ c((g, h, f) => {
    for (; a !== h; a += 1)
      m.push(new N(z, e[a]));
    for (; p !== f; p += 1)
      m.push(new N(j, t[p]));
    for (; g !== 0; g -= 1, a += 1, p += 1)
      m.push(new N(M, t[p]));
  }, "foundSubsequence")); a !== s; a += 1)
    m.push(new N(z, e[a]));
  for (; p !== i; p += 1)
    m.push(new N(j, t[p]));
  return [m, l];
}
c(Qn, "diffLinesRaw");
function Dn(e) {
  if (e === void 0)
    return "undefined";
  if (e === null)
    return "null";
  if (Array.isArray(e))
    return "array";
  if (typeof e == "boolean")
    return "boolean";
  if (typeof e == "function")
    return "function";
  if (typeof e == "number")
    return "number";
  if (typeof e == "string")
    return "string";
  if (typeof e == "bigint")
    return "bigint";
  if (typeof e == "object") {
    if (e != null) {
      if (e.constructor === RegExp)
        return "regexp";
      if (e.constructor === Map)
        return "map";
      if (e.constructor === Set)
        return "set";
      if (e.constructor === Date)
        return "date";
    }
    return "object";
  } else if (typeof e == "symbol")
    return "symbol";
  throw new Error(`value of unknown type: ${e}`);
}
c(Dn, "getType");
function Fn(e) {
  return e.includes(`\r
`) ? `\r
` : `
`;
}
c(Fn, "getNewLineSymbol");
function Ts(e, t, n) {
  let r = n?.truncateThreshold ?? !1, o = Math.max(Math.floor(n?.truncateThreshold ?? 0), 0), s = e.length, i = t.length;
  if (r) {
    let g = e.includes(`
`), h = t.includes(`
`), f = Fn(e), d = Fn(t), S = g ? `${e.split(f, o).join(f)}
` : e, _ = h ? `${t.split(d, o).join(d)}
` : t;
    s = S.length, i = _.length;
  }
  let l = s !== e.length || i !== t.length, u = /* @__PURE__ */ c((g, h) => e[g] === t[h], "isCommon"), m = 0, a = 0, p = [];
  return Gn(s, i, u, /* @__PURE__ */ c((g, h, f) => {
    m !== h && p.push(new N(z, e.slice(m, h))), a !== f && p.push(new N(j, t.slice(a, f))), m = h + g, a = f + g, p.push(new N(M, t.slice(f,
    a)));
  }, "foundSubsequence")), m !== s && p.push(new N(z, e.slice(m))), a !== i && p.push(new N(j, t.slice(a))), [p, l];
}
c(Ts, "diffStrings");
function Cs(e, t, n) {
  return t.reduce((r, o) => r + (o[0] === M ? o[1] : o[0] === e && o[1].length !== 0 ? n(o[1]) : ""), "");
}
c(Cs, "concatenateRelevantDiffs");
var Nt = class Nt {
  op;
  line;
  lines;
  changeColor;
  constructor(t, n) {
    this.op = t, this.line = [], this.lines = [], this.changeColor = n;
  }
  pushSubstring(t) {
    this.pushDiff(new N(this.op, t));
  }
  pushLine() {
    this.lines.push(this.line.length !== 1 ? new N(this.op, Cs(this.op, this.line, this.changeColor)) : this.line[0][0] === this.op ? this.line[0] :
    new N(this.op, this.line[0][1])), this.line.length = 0;
  }
  isLineEmpty() {
    return this.line.length === 0;
  }
  // Minor input to buffer.
  pushDiff(t) {
    this.line.push(t);
  }
  // Main input to buffer.
  align(t) {
    let n = t[1];
    if (n.includes(`
`)) {
      let r = n.split(`
`), o = r.length - 1;
      r.forEach((s, i) => {
        i < o ? (this.pushSubstring(s), this.pushLine()) : s.length !== 0 && this.pushSubstring(s);
      });
    } else
      this.pushDiff(t);
  }
  // Output from buffer.
  moveLinesTo(t) {
    this.isLineEmpty() || this.pushLine(), t.push(...this.lines), this.lines.length = 0;
  }
};
c(Nt, "ChangeBuffer");
var Ue = Nt, Pt = class Pt {
  deleteBuffer;
  insertBuffer;
  lines;
  constructor(t, n) {
    this.deleteBuffer = t, this.insertBuffer = n, this.lines = [];
  }
  pushDiffCommonLine(t) {
    this.lines.push(t);
  }
  pushDiffChangeLines(t) {
    let n = t[1].length === 0;
    (!n || this.deleteBuffer.isLineEmpty()) && this.deleteBuffer.pushDiff(t), (!n || this.insertBuffer.isLineEmpty()) && this.insertBuffer.pushDiff(
    t);
  }
  flushChangeLines() {
    this.deleteBuffer.moveLinesTo(this.lines), this.insertBuffer.moveLinesTo(this.lines);
  }
  // Input to buffer.
  align(t) {
    let n = t[0], r = t[1];
    if (r.includes(`
`)) {
      let o = r.split(`
`), s = o.length - 1;
      o.forEach((i, l) => {
        if (l === 0) {
          let u = new N(n, i);
          this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty() ? (this.flushChangeLines(), this.pushDiffCommonLine(u)) : (this.
          pushDiffChangeLines(u), this.flushChangeLines());
        } else l < s ? this.pushDiffCommonLine(new N(n, i)) : i.length !== 0 && this.pushDiffChangeLines(new N(n, i));
      });
    } else
      this.pushDiffChangeLines(t);
  }
  // Output from buffer.
  getLines() {
    return this.flushChangeLines(), this.lines;
  }
};
c(Pt, "CommonBuffer");
var Tt = Pt;
function Os(e, t) {
  let n = new Ue(z, t), r = new Ue(j, t), o = new Tt(n, r);
  return e.forEach((s) => {
    switch (s[0]) {
      case z:
        n.align(s);
        break;
      case j:
        r.align(s);
        break;
      default:
        o.align(s);
    }
  }), o.getLines();
}
c(Os, "getAlignedDiffs");
function $s(e, t) {
  if (t) {
    let n = e.length - 1;
    return e.some((r, o) => r[0] === M && (o !== n || r[1] !== `
`));
  }
  return e.some((n) => n[0] === M);
}
c($s, "hasCommonDiff");
function ws(e, t, n) {
  if (e !== t && e.length !== 0 && t.length !== 0) {
    let r = e.includes(`
`) || t.includes(`
`), [o, s] = vn(r ? `${e}
` : e, r ? `${t}
` : t, !0, n);
    if ($s(o, r)) {
      let i = ge(n), l = Os(o, i.changeColor);
      return At(l, s, i);
    }
  }
  return We(e.split(`
`), t.split(`
`), n);
}
c(ws, "diffStringsUnified");
function vn(e, t, n, r) {
  let [o, s] = Ts(e, t, r);
  return n && ss(o), [o, s];
}
c(vn, "diffStringsRaw");
function Ct(e, t) {
  let { commonColor: n } = ge(t);
  return n(e);
}
c(Ct, "getCommonMessage");
var { AsymmetricMatcher: As, DOMCollection: Rs, DOMElement: Ns, Immutable: Ps, ReactElement: Is, ReactTestComponent: Ms } = _e, er = [
  Ms,
  Is,
  Ns,
  Rs,
  Ps,
  As,
  _e.Error
], Ot = {
  maxDepth: 20,
  plugins: er
}, tr = {
  callToJSON: !1,
  maxDepth: 8,
  plugins: er
};
function Ls(e, t, n) {
  if (Object.is(e, t))
    return "";
  let r = Dn(e), o = r, s = !1;
  if (r === "object" && typeof e.asymmetricMatch == "function") {
    if (e.$$typeof !== Symbol.for("jest.asymmetricMatcher") || typeof e.getExpectedType != "function")
      return;
    o = e.getExpectedType(), s = o === "string";
  }
  if (o !== Dn(t)) {
    let d = function(C) {
      return C.length <= f ? C : `${C.slice(0, f)}...`;
    };
    c(d, "truncate");
    let { aAnnotation: i, aColor: l, aIndicator: u, bAnnotation: m, bColor: a, bIndicator: p } = ge(n), b = $t(tr, n), g = X(e, b), h = X(t,
    b), f = 1e5;
    g = d(g), h = d(h);
    let S = `${l(`${u} ${i}:`)} 
${g}`, _ = `${a(`${p} ${m}:`)} 
${h}`;
    return `${S}

${_}`;
  }
  if (!s)
    switch (r) {
      case "string":
        return We(e.split(`
`), t.split(`
`), n);
      case "boolean":
      case "number":
        return xs(e, t, n);
      case "map":
        return _t(jn(e), jn(t), n);
      case "set":
        return _t(kn(e), kn(t), n);
      default:
        return _t(e, t, n);
    }
}
c(Ls, "diff");
function xs(e, t, n) {
  let r = X(e, Ot), o = X(t, Ot);
  return r === o ? "" : We(r.split(`
`), o.split(`
`), n);
}
c(xs, "comparePrimitive");
function jn(e) {
  return new Map(Array.from(e.entries()).sort());
}
c(jn, "sortMap");
function kn(e) {
  return new Set(Array.from(e.values()).sort());
}
c(kn, "sortSet");
function _t(e, t, n) {
  let r, o = !1;
  try {
    let i = $t(Ot, n);
    r = Bn(e, t, i, n);
  } catch {
    o = !0;
  }
  let s = Ct(Kn, n);
  if (r === void 0 || r === s) {
    let i = $t(tr, n);
    r = Bn(e, t, i, n), r !== s && !o && (r = `${Ct(as, n)}

${r}`);
  }
  return r;
}
c(_t, "compareObjects");
function $t(e, t) {
  let { compareKeys: n, printBasicPrototype: r, maxDepth: o } = ge(t);
  return {
    ...e,
    compareKeys: n,
    printBasicPrototype: r,
    maxDepth: o ?? e.maxDepth
  };
}
c($t, "getFormatOptions");
function Bn(e, t, n, r) {
  let o = {
    ...n,
    indent: 0
  }, s = X(e, o), i = X(t, o);
  if (s === i)
    return Ct(Kn, r);
  {
    let l = X(e, n), u = X(t, n);
    return _s(l.split(`
`), u.split(`
`), s.split(`
`), i.split(`
`), r);
  }
}
c(Bn, "getObjectsDifference");
var zn = 2e4;
function Yn(e) {
  return Be(e) === "Object" && typeof e.asymmetricMatch == "function";
}
c(Yn, "isAsymmetricMatcher");
function Un(e, t) {
  let n = Be(e), r = Be(t);
  return n === r && (n === "Object" || n === "Array");
}
c(Un, "isReplaceable");
function nr(e, t, n) {
  let { aAnnotation: r, bAnnotation: o } = ge(n);
  if (typeof t == "string" && typeof e == "string" && t.length > 0 && e.length > 0 && t.length <= zn && e.length <= zn && t !== e) {
    if (t.includes(`
`) || e.includes(`
`))
      return ws(t, e, n);
    let [a] = vn(t, e, !0), p = a.some((f) => f[0] === M), b = Ds(r, o), g = b(r) + ks(Wn(a, z, p)), h = b(o) + js(Wn(a, j, p));
    return `${g}
${h}`;
  }
  let s = St(t, { forceWritable: !0 }), i = St(e, { forceWritable: !0 }), { replacedExpected: l, replacedActual: u } = rr(i, s);
  return Ls(l, u, n);
}
c(nr, "printDiffOrStringify");
function rr(e, t, n = /* @__PURE__ */ new WeakSet(), r = /* @__PURE__ */ new WeakSet()) {
  return e instanceof Error && t instanceof Error && typeof e.cause < "u" && typeof t.cause > "u" ? (delete e.cause, {
    replacedActual: e,
    replacedExpected: t
  }) : Un(e, t) ? n.has(e) || r.has(t) ? {
    replacedActual: e,
    replacedExpected: t
  } : (n.add(e), r.add(t), bt(t).forEach((o) => {
    let s = t[o], i = e[o];
    if (Yn(s))
      s.asymmetricMatch(i) && (e[o] = s);
    else if (Yn(i))
      i.asymmetricMatch(s) && (t[o] = i);
    else if (Un(i, s)) {
      let l = rr(i, s, n, r);
      e[o] = l.replacedActual, t[o] = l.replacedExpected;
    }
  }), {
    replacedActual: e,
    replacedExpected: t
  }) : {
    replacedActual: e,
    replacedExpected: t
  };
}
c(rr, "replaceAsymmetricMatcher");
function Ds(...e) {
  let t = e.reduce((n, r) => r.length > n ? r.length : n, 0);
  return (n) => `${n}: ${" ".repeat(t - n.length)}`;
}
c(Ds, "getLabelPrinter");
var Fs = "\xB7";
function or(e) {
  return e.replace(/\s+$/gm, (t) => Fs.repeat(t.length));
}
c(or, "replaceTrailingSpaces");
function js(e) {
  return v.red(or(pe(e)));
}
c(js, "printReceived");
function ks(e) {
  return v.green(or(pe(e)));
}
c(ks, "printExpected");
function Wn(e, t, n) {
  return e.reduce((r, o) => r + (o[0] === M ? o[1] : o[0] === t ? n ? v.inverse(o[1]) : o[1] : ""), "");
}
c(Wn, "getCommonAndChangedSubstrings");

// ../node_modules/@vitest/utils/dist/error.js
var Bs = "@@__IMMUTABLE_RECORD__@@", zs = "@@__IMMUTABLE_ITERABLE__@@";
function Ys(e) {
  return e && (e[zs] || e[Bs]);
}
c(Ys, "isImmutable");
var Us = Object.getPrototypeOf({});
function sr(e) {
  return e instanceof Error ? `<unserializable>: ${e.message}` : typeof e == "string" ? `<unserializable>: ${e}` : "<unserializable>";
}
c(sr, "getUnserializableMessage");
function le(e, t = /* @__PURE__ */ new WeakMap()) {
  if (!e || typeof e == "string")
    return e;
  if (e instanceof Error && "toJSON" in e && typeof e.toJSON == "function") {
    let n = e.toJSON();
    return n && n !== e && typeof n == "object" && (typeof e.message == "string" && Ve(() => n.message ?? (n.message = e.message)), typeof e.
    stack == "string" && Ve(() => n.stack ?? (n.stack = e.stack)), typeof e.name == "string" && Ve(() => n.name ?? (n.name = e.name)), e.cause !=
    null && Ve(() => n.cause ?? (n.cause = le(e.cause, t)))), le(n, t);
  }
  if (typeof e == "function")
    return `Function<${e.name || "anonymous"}>`;
  if (typeof e == "symbol")
    return e.toString();
  if (typeof e != "object")
    return e;
  if (typeof Buffer < "u" && e instanceof Buffer)
    return `<Buffer(${e.length}) ...>`;
  if (typeof Uint8Array < "u" && e instanceof Uint8Array)
    return `<Uint8Array(${e.length}) ...>`;
  if (Ys(e))
    return le(e.toJSON(), t);
  if (e instanceof Promise || e.constructor && e.constructor.prototype === "AsyncFunction")
    return "Promise";
  if (typeof Element < "u" && e instanceof Element)
    return e.tagName;
  if (typeof e.asymmetricMatch == "function")
    return `${e.toString()} ${wn(e.sample)}`;
  if (typeof e.toJSON == "function")
    return le(e.toJSON(), t);
  if (t.has(e))
    return t.get(e);
  if (Array.isArray(e)) {
    let n = new Array(e.length);
    return t.set(e, n), e.forEach((r, o) => {
      try {
        n[o] = le(r, t);
      } catch (s) {
        n[o] = sr(s);
      }
    }), n;
  } else {
    let n = /* @__PURE__ */ Object.create(null);
    t.set(e, n);
    let r = e;
    for (; r && r !== Us; )
      Object.getOwnPropertyNames(r).forEach((o) => {
        if (!(o in n))
          try {
            n[o] = le(e[o], t);
          } catch (s) {
            delete n[o], n[o] = sr(s);
          }
      }), r = Object.getPrototypeOf(r);
    return n;
  }
}
c(le, "serializeValue");
function Ve(e) {
  try {
    return e();
  } catch {
  }
}
c(Ve, "safe");
function Ws(e) {
  return e.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
}
c(Ws, "normalizeErrorMessage");
function It(e, t, n = /* @__PURE__ */ new WeakSet()) {
  if (!e || typeof e != "object")
    return { message: String(e) };
  let r = e;
  (r.showDiff || r.showDiff === void 0 && r.expected !== void 0 && r.actual !== void 0) && (r.diff = nr(r.actual, r.expected, {
    ...t,
    ...r.diffOptions
  })), "expected" in r && typeof r.expected != "string" && (r.expected = pe(r.expected, 10)), "actual" in r && typeof r.actual != "string" &&
  (r.actual = pe(r.actual, 10));
  try {
    typeof r.message == "string" && (r.message = Ws(r.message));
  } catch {
  }
  try {
    !n.has(r) && typeof r.cause == "object" && (n.add(r), r.cause = It(r.cause, t, n));
  } catch {
  }
  try {
    return le(r);
  } catch (o) {
    return le(new Error(`Failed to fully serialize error: ${o?.message}
Inner error message: ${r?.message}`));
  }
}
c(It, "processError");

// src/instrumenter/EVENTS.ts
var ne = {
  CALL: "storybook/instrumenter/call",
  SYNC: "storybook/instrumenter/sync",
  START: "storybook/instrumenter/start",
  BACK: "storybook/instrumenter/back",
  GOTO: "storybook/instrumenter/goto",
  NEXT: "storybook/instrumenter/next",
  END: "storybook/instrumenter/end"
};

// src/instrumenter/preview-api.ts
var qe = globalThis.__STORYBOOK_ADDONS_PREVIEW;

// src/instrumenter/types.ts
var Vs = /* @__PURE__ */ ((o) => (o.DONE = "done", o.ERROR = "error", o.ACTIVE = "active", o.WAITING = "waiting", o))(Vs || {});

// src/instrumenter/instrumenter.ts
var Hs = Symbol("[Circular]"), Js = new Error(
  "This function ran after the play function completed. Did you forget to `await` it?"
), cr = /* @__PURE__ */ c((e) => Object.prototype.toString.call(e) === "[object Object]", "isObject"), Xs = /* @__PURE__ */ c((e) => Object.
prototype.toString.call(e) === "[object Module]", "isModule"), Zs = /* @__PURE__ */ c((e) => {
  if (!cr(e) && !Xs(e))
    return !1;
  if (e.constructor === void 0)
    return !0;
  let t = e.constructor.prototype;
  return !!cr(t);
}, "isInstrumentable"), Qs = /* @__PURE__ */ c((e) => {
  try {
    return new e.constructor();
  } catch {
    return {};
  }
}, "construct"), Mt = /* @__PURE__ */ c(() => ({
  renderPhase: void 0,
  isDebugging: !1,
  isPlaying: !1,
  isLocked: !1,
  cursor: 0,
  calls: [],
  shadowCalls: [],
  callRefsByResult: /* @__PURE__ */ new Map(),
  chainedCallIds: /* @__PURE__ */ new Set(),
  ancestors: [],
  playUntil: void 0,
  resolvers: {},
  syncTimeout: void 0
}), "getInitialState"), ur = /* @__PURE__ */ c((e, t = !1) => {
  let n = (t ? e.shadowCalls : e.calls).filter((o) => o.retain);
  if (!n.length)
    return;
  let r = new Map(
    Array.from(e.callRefsByResult.entries()).filter(([, o]) => o.retain)
  );
  return { cursor: n.length, calls: n, callRefsByResult: r };
}, "getRetainedState"), xt = class xt {
  constructor() {
    this.detached = !1;
    this.initialized = !1;
    // State is tracked per story to deal with multiple stories on the same canvas (i.e. docs mode)
    this.state = {};
    this.loadParentWindowState = /* @__PURE__ */ c(() => {
      try {
        this.state = Z.window?.parent?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ || {};
      } catch {
        this.detached = !0;
      }
    }, "loadParentWindowState");
    this.updateParentWindowState = /* @__PURE__ */ c(() => {
      try {
        Z.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ = this.state;
      } catch {
        this.detached = !0;
      }
    }, "updateParentWindowState");
    this.loadParentWindowState();
    let t = /* @__PURE__ */ c(({
      storyId: u,
      isPlaying: m = !0,
      isDebugging: a = !1
    }) => {
      let p = this.getState(u);
      this.setState(u, {
        ...Mt(),
        ...ur(p, a),
        shadowCalls: a ? p.shadowCalls : [],
        chainedCallIds: a ? p.chainedCallIds : /* @__PURE__ */ new Set(),
        playUntil: a ? p.playUntil : void 0,
        isPlaying: m,
        isDebugging: a
      }), this.sync(u);
    }, "resetState"), n = /* @__PURE__ */ c((u) => ({ storyId: m, playUntil: a }) => {
      this.getState(m).isDebugging || this.setState(m, ({ calls: b }) => ({
        calls: [],
        shadowCalls: b.map((g) => ({ ...g, status: "waiting" })),
        isDebugging: !0
      }));
      let p = this.getLog(m);
      this.setState(m, ({ shadowCalls: b }) => {
        if (a || !p.length)
          return { playUntil: a };
        let g = b.findIndex((h) => h.id === p[0].callId);
        return {
          playUntil: b.slice(0, g).filter((h) => h.interceptable && !h.ancestors?.length).slice(-1)[0]?.id
        };
      }), u.emit(ir, { storyId: m, isDebugging: !0 });
    }, "start"), r = /* @__PURE__ */ c((u) => ({ storyId: m }) => {
      let a = this.getLog(m).filter((b) => !b.ancestors?.length), p = a.reduceRight((b, g, h) => b >= 0 || g.status === "waiting" ? b : h, -1);
      n(u)({ storyId: m, playUntil: a[p - 1]?.callId });
    }, "back"), o = /* @__PURE__ */ c((u) => ({ storyId: m, callId: a }) => {
      let { calls: p, shadowCalls: b, resolvers: g } = this.getState(m), h = p.find(({ id: d }) => d === a), f = b.find(({ id: d }) => d ===
      a);
      if (!h && f && Object.values(g).length > 0) {
        let d = this.getLog(m).find((S) => S.status === "waiting")?.callId;
        f.id !== d && this.setState(m, { playUntil: f.id }), Object.values(g).forEach((S) => S());
      } else
        n(u)({ storyId: m, playUntil: a });
    }, "goto"), s = /* @__PURE__ */ c((u) => ({ storyId: m }) => {
      let { resolvers: a } = this.getState(m);
      if (Object.values(a).length > 0)
        Object.values(a).forEach((p) => p());
      else {
        let p = this.getLog(m).find((b) => b.status === "waiting")?.callId;
        p ? n(u)({ storyId: m, playUntil: p }) : i({ storyId: m });
      }
    }, "next"), i = /* @__PURE__ */ c(({ storyId: u }) => {
      this.setState(u, { playUntil: void 0, isDebugging: !1 }), Object.values(this.getState(u).resolvers).forEach((m) => m());
    }, "end"), l = /* @__PURE__ */ c(({ storyId: u, newPhase: m }) => {
      let { isDebugging: a } = this.getState(u);
      this.setState(u, { renderPhase: m }), m === "preparing" && a && t({ storyId: u }), m === "playing" && t({ storyId: u, isDebugging: a }),
      m === "played" && this.setState(u, {
        isLocked: !1,
        isPlaying: !1,
        isDebugging: !1
      }), m === "errored" && this.setState(u, {
        isLocked: !1,
        isPlaying: !1
      });
    }, "renderPhaseChanged");
    qe && qe.ready().then(() => {
      this.channel = qe.getChannel(), this.channel.on(ir, t), this.channel.on(Gs, l), this.channel.on(Ks, () => {
        this.initialized ? this.cleanup() : this.initialized = !0;
      }), this.channel.on(ne.START, n(this.channel)), this.channel.on(ne.BACK, r(this.channel)), this.channel.on(ne.GOTO, o(this.channel)), this.
      channel.on(ne.NEXT, s(this.channel)), this.channel.on(ne.END, i);
    });
  }
  getState(t) {
    return this.state[t] || Mt();
  }
  setState(t, n) {
    let r = this.getState(t), o = typeof n == "function" ? n(r) : n;
    this.state = { ...this.state, [t]: { ...r, ...o } }, this.updateParentWindowState();
  }
  cleanup() {
    this.state = Object.entries(this.state).reduce(
      (r, [o, s]) => {
        let i = ur(s);
        return i && (r[o] = Object.assign(Mt(), i)), r;
      },
      {}
    );
    let n = { controlStates: {
      detached: this.detached,
      start: !1,
      back: !1,
      goto: !1,
      next: !1,
      end: !1
    }, logItems: [] };
    this.channel?.emit(ne.SYNC, n), this.updateParentWindowState();
  }
  getLog(t) {
    let { calls: n, shadowCalls: r } = this.getState(t), o = [...r];
    n.forEach((i, l) => {
      o[l] = i;
    });
    let s = /* @__PURE__ */ new Set();
    return o.reduceRight((i, l) => (l.args.forEach((u) => {
      u?.__callId__ && s.add(u.__callId__);
    }), l.path.forEach((u) => {
      u.__callId__ && s.add(u.__callId__);
    }), (l.interceptable || l.exception) && !s.has(l.id) && (i.unshift({ callId: l.id, status: l.status, ancestors: l.ancestors }), s.add(l.
    id)), i), []);
  }
  // Traverses the object structure to recursively patch all function properties.
  // Returns the original object, or a new object with the same constructor,
  // depending on whether it should mutate.
  instrument(t, n, r = 0) {
    if (!Zs(t))
      return t;
    let { mutate: o = !1, path: s = [] } = n, i = n.getKeys ? n.getKeys(t, r) : Object.keys(t);
    return r += 1, i.reduce(
      (l, u) => {
        let m = ei(t, u);
        if (typeof m?.get == "function") {
          if (m.configurable) {
            let p = /* @__PURE__ */ c(() => m?.get?.bind(t)?.(), "getter");
            Object.defineProperty(l, u, {
              get: /* @__PURE__ */ c(() => this.instrument(p(), { ...n, path: s.concat(u) }, r), "get")
            });
          }
          return l;
        }
        let a = t[u];
        return typeof a != "function" ? (l[u] = this.instrument(a, { ...n, path: s.concat(u) }, r), l) : "__originalFn__" in a && typeof a.__originalFn__ ==
        "function" ? (l[u] = a, l) : (l[u] = (...p) => this.track(u, a, t, p, n), l[u].__originalFn__ = a, Object.defineProperty(l[u], "name",
        { value: u, writable: !1 }), Object.keys(a).length > 0 && Object.assign(
          l[u],
          this.instrument({ ...a }, { ...n, path: s.concat(u) }, r)
        ), l);
      },
      o ? t : Qs(t)
    );
  }
  // Monkey patch an object method to record calls.
  // Returns a function that invokes the original function, records the invocation ("call") and
  // returns the original result.
  track(t, n, r, o, s) {
    let i = o?.[0]?.__storyId__ || Z.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId, { cursor: l, ancestors: u } = this.getState(
    i);
    this.setState(i, { cursor: l + 1 });
    let m = `${u.slice(-1)[0] || i} [${l}] ${t}`, { path: a = [], intercept: p = !1, retain: b = !1 } = s, g = typeof p == "function" ? p(t,
    a) : p, h = { id: m, cursor: l, storyId: i, ancestors: u, path: a, method: t, args: o, interceptable: g, retain: b }, d = (g && !u.length ?
    this.intercept : this.invoke).call(this, n, r, h, s);
    return this.instrument(d, { ...s, mutate: !0, path: [{ __callId__: h.id }] });
  }
  intercept(t, n, r, o) {
    let { chainedCallIds: s, isDebugging: i, playUntil: l } = this.getState(r.storyId), u = s.has(r.id);
    return !i || u || l ? (l === r.id && this.setState(r.storyId, { playUntil: void 0 }), this.invoke(t, n, r, o)) : new Promise((m) => {
      this.setState(r.storyId, ({ resolvers: a }) => ({
        isLocked: !1,
        resolvers: { ...a, [r.id]: m }
      }));
    }).then(() => (this.setState(r.storyId, (m) => {
      let { [r.id]: a, ...p } = m.resolvers;
      return { isLocked: !0, resolvers: p };
    }), this.invoke(t, n, r, o)));
  }
  invoke(t, n, r, o) {
    let { callRefsByResult: s, renderPhase: i } = this.getState(r.storyId), l = /* @__PURE__ */ c((a, p, b) => {
      if (a === null || !["object", "function", "symbol"].includes(typeof a))
        return a;
      if (b.includes(a))
        return Hs;
      if (b = [...b, a], p > 25)
        return "...";
      let g = s.get(a) || {};
      if (a instanceof Array)
        return { ...g, __array__: a.map((h) => l(h, ++p, b)) };
      if (a instanceof Date)
        return { ...g, __date__: { value: a.toISOString() } };
      if (a instanceof Error) {
        let { name: h, message: f, stack: d } = a;
        return { ...g, __error__: { name: h, message: f, stack: d } };
      }
      if (a instanceof RegExp) {
        let { flags: h, source: f } = a;
        return { ...g, __regexp__: { flags: h, source: f } };
      }
      if (a instanceof Z.window?.HTMLElement) {
        let { prefix: h, localName: f, id: d, classList: S, innerText: _ } = a, C = Array.from(S), y = a.getAttribute("data-testid");
        return {
          ...g,
          __element__: { prefix: h, localName: f, id: d, classNames: C, innerText: _, testId: y }
        };
      }
      return typeof a == "function" ? {
        ...g,
        __function__: {
          name: "getMockName" in a && typeof a.getMockName == "function" ? a.getMockName() : a.name
        }
      } : typeof a == "symbol" ? { ...g, __symbol__: { description: a.description } } : typeof a == "object" && a?.constructor?.name && a?.constructor?.
      name !== "Object" ? { ...g, __class__: { name: a.constructor.name } } : typeof a == "object" && Object.prototype.toString.call(a) === "\
[object Object]" ? {
        ...g,
        __object__: Object.fromEntries(
          Object.entries(a).map(([h, f]) => [h, l(f, ++p, b)])
        )
      } : s.has(a) ? g : a;
    }, "serializeValues"), u = {
      ...r,
      args: r.args.map((a) => l(a, 0, []))
    };
    r.path.forEach((a) => {
      a?.__callId__ && this.setState(r.storyId, ({ chainedCallIds: p }) => ({
        chainedCallIds: new Set(Array.from(p).concat(a.__callId__))
      }));
    });
    let m = /* @__PURE__ */ c((a) => {
      if (a instanceof Error) {
        let { name: p, message: b, stack: g, callId: h = r.id } = a, {
          showDiff: f = void 0,
          diff: d = void 0,
          actual: S = void 0,
          expected: _ = void 0
        } = a.name === "AssertionError" ? It(a) : a, C = { name: p, message: b, stack: g, callId: h, showDiff: f, diff: d, actual: S, expected: _ };
        if (this.update({ ...u, status: "error", exception: C }), this.setState(r.storyId, (y) => ({
          callRefsByResult: new Map([
            ...Array.from(y.callRefsByResult.entries()),
            [a, { __callId__: r.id, retain: r.retain }]
          ])
        })), r.ancestors?.length)
          throw Object.prototype.hasOwnProperty.call(a, "callId") || Object.defineProperty(a, "callId", { value: r.id }), a;
      }
      throw a;
    }, "handleException");
    try {
      if (i === "played" && !r.retain)
        throw Js;
      let a = o.getArgs ? o.getArgs(r, this.getState(r.storyId)) : r.args, p = a.map((g) => typeof g != "function" || ti(g) || Object.keys(g).
      length ? g : (...h) => {
        let { cursor: f, ancestors: d } = this.getState(r.storyId);
        this.setState(r.storyId, { cursor: 0, ancestors: [...d, r.id] });
        let S = /* @__PURE__ */ c(() => this.setState(r.storyId, { cursor: f, ancestors: d }), "restore"), _ = !1;
        try {
          let C = g(...h);
          return C instanceof Promise ? (_ = !0, C.finally(S)) : C;
        } finally {
          _ || S();
        }
      }), b = t.apply(n, p);
      return this.trackResult(b, r), this.update({
        ...u,
        actualArgs: a,
        status: b instanceof Promise ? "active" : "done"
      }), b instanceof Promise ? b.then((g) => (this.trackResult(g, r, b), this.update({ ...u, actualArgs: a, status: "done" }), g), m) : b;
    } catch (a) {
      return m(a);
    }
  }
  // Sends the call info to the manager and synchronizes the log.
  update(t) {
    let { actualArgs: n, ...r } = t;
    this.channel?.emit(ne.CALL, r), this.setState(t.storyId, ({ calls: o }) => {
      let s = o.concat(t).reduce((i, l) => Object.assign(i, { [l.id]: l }), {});
      return {
        // Calls are sorted to ensure parent calls always come before calls in their callback.
        calls: Object.values(s).sort(
          (i, l) => i.id.localeCompare(l.id, void 0, { numeric: !0 })
        )
      };
    }), this.sync(t.storyId);
  }
  // Builds a log of interceptable calls and control states and sends it to the manager.
  // Uses a 0ms debounce because this might get called many times in one tick.
  sync(t) {
    let n = /* @__PURE__ */ c(() => {
      let { isLocked: r, isPlaying: o } = this.getState(t), s = this.getLog(t), i = s.filter(({ ancestors: p }) => !p.length).find((p) => p.
      status === "waiting")?.callId, l = s.some((p) => p.status === "active");
      if (this.detached || r || l || s.length === 0) {
        let b = { controlStates: {
          detached: this.detached,
          start: !1,
          back: !1,
          goto: !1,
          next: !1,
          end: !1
        }, logItems: s };
        this.channel?.emit(ne.SYNC, b);
        return;
      }
      let u = s.some(
        (p) => p.status === "done" || p.status === "error"
      ), a = { controlStates: {
        detached: this.detached,
        start: u,
        back: u,
        goto: !0,
        next: o,
        end: o
      }, logItems: s, pausedAt: i };
      this.channel?.emit(ne.SYNC, a);
    }, "synchronize");
    this.setState(t, ({ syncTimeout: r }) => (clearTimeout(r), { syncTimeout: setTimeout(n, 0) }));
  }
  // Tracks the result so we can trace later uses of it back to the originating call.
  // Primitive results (undefined, null, boolean, string, number, BigInt) are ignored.
  // If the result was awaited, we reference the original (tracked) promise.
  trackResult(t, n, r) {
    t && ["object", "function", "symbol"].includes(typeof t) && this.setState(n.storyId, (o) => ({
      callRefsByResult: new Map([
        ...Array.from(o.callRefsByResult.entries()),
        [t, { __callId__: n.id, retain: n.retain, promise: r }]
      ])
    }));
  }
};
c(xt, "Instrumenter");
var Lt = xt;
function vs(e, t = {}) {
  try {
    let n = !1, r = !1;
    return Z.window?.location?.search?.includes("instrument=true") ? n = !0 : Z.window?.location?.search?.includes("instrument=false") && (r =
    !0), Z.window?.parent === Z.window && !n || r ? e : (Z.window && !Z.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ && (Z.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__ =
    new Lt()), (Z.window?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).instrument(e, t));
  } catch (n) {
    return qs.warn(n), e;
  }
}
c(vs, "instrument");
function ei(e, t) {
  let n = e;
  for (; n != null; ) {
    let r = Object.getOwnPropertyDescriptor(n, t);
    if (r)
      return r;
    n = Object.getPrototypeOf(n);
  }
}
c(ei, "getPropertyDescriptor");
function ti(e) {
  if (typeof e != "function")
    return !1;
  let t = Object.getOwnPropertyDescriptor(e, "prototype");
  return t ? !t.writable : !1;
}
c(ti, "isClass");
export {
  Vs as CallStates,
  ne as EVENTS,
  vs as instrument
};
