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

// src/instrumenter/instrumenter.ts
import { once as zs } from "storybook/internal/client-logger";
import {
  FORCE_REMOUNT as tr,
  SET_CURRENT_STORY as Ys,
  STORY_RENDER_PHASE_CHANGED as Us
} from "storybook/internal/core-events";
import { global as Z } from "@storybook/global";

// ../node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
var ir = {
  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]
}, cr = Object.entries(ir);
function Ge(e) {
  return String(e);
}
i(Ge, "a");
Ge.open = "";
Ge.close = "";
function It(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;
}
i(It, "C");
function Mt(e = !1) {
  let t = It(e), n = /* @__PURE__ */ i((c, a, u, m) => {
    let p = "", l = 0;
    do
      p += c.substring(l, m) + u, l = m + a.length, m = c.indexOf(a, l);
    while (~m);
    return p + c.substring(l);
  }, "i"), r = /* @__PURE__ */ i((c, a, u = c) => {
    let m = /* @__PURE__ */ i((p) => {
      let l = String(p), S = l.indexOf(a, c.length);
      return ~S ? c + n(l, a, u, S) + a : c + l + a;
    }, "o");
    return m.open = c, m.close = a, m;
  }, "g"), o = {
    isColorSupported: t
  }, s = /* @__PURE__ */ i((c) => `\x1B[${c}m`, "d");
  for (let [c, a] of cr)
    o[c] = t ? r(
      s(a[0]),
      s(a[1]),
      a[2]
    ) : Ge;
  return o;
}
i(Mt, "p");

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

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

// ../node_modules/loupe/lib/helpers.js
var mn = {
  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"]
}, Oo = {
  special: "cyan",
  number: "yellow",
  bigint: "yellow",
  boolean: "yellow",
  undefined: "grey",
  null: "bold",
  string: "green",
  symbol: "green",
  date: "magenta",
  regexp: "red"
}, ie = "\u2026";
function $o(e, t) {
  let n = mn[Oo[t]] || mn[t] || "";
  return n ? `\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m` : String(e);
}
i($o, "colorise");
function pn({
  showHidden: e = !1,
  depth: t = 2,
  colors: n = !1,
  customInspect: r = !0,
  showProxy: o = !1,
  maxArrayLength: s = 1 / 0,
  breakLength: c = 1 / 0,
  seen: a = [],
  // eslint-disable-next-line no-shadow
  truncate: u = 1 / 0,
  stylize: m = String
} = {}, p) {
  let l = {
    showHidden: !!e,
    depth: Number(t),
    colors: !!n,
    customInspect: !!r,
    showProxy: !!o,
    maxArrayLength: Number(s),
    breakLength: Number(c),
    truncate: Number(u),
    seen: a,
    inspect: p,
    stylize: m
  };
  return l.colors && (l.stylize = $o), l;
}
i(pn, "normaliseOptions");
function wo(e) {
  return e >= "\uD800" && e <= "\uDBFF";
}
i(wo, "isHighSurrogate");
function k(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 && wo(e[s - 1]) && (s = s - 1), `${e.slice(0, s)}${n}`;
  }
  return e;
}
i(k, "truncate");
function D(e, t, n, r = ", ") {
  n = n || t.inspect;
  let o = e.length;
  if (o === 0)
    return "";
  let s = t.truncate, c = "", a = "", u = "";
  for (let m = 0; m < o; m += 1) {
    let p = m + 1 === e.length, l = m + 2 === e.length;
    u = `${ie}(${e.length - m})`;
    let S = e[m];
    t.truncate = s - c.length - (p ? 0 : r.length);
    let g = a || n(S, t) + (p ? "" : r), h = c.length + g.length, f = h + u.length;
    if (p && h > s && c.length + u.length <= s || !p && !l && f > s || (a = p ? "" : n(e[m + 1], t) + (l ? "" : r), !p && l && f > s && h + a.length > s))
      break;
    if (c += g, !p && !l && h + a.length >= s) {
      u = `${ie}(${e.length - m - 1})`;
      break;
    }
    u = "";
  }
  return `${c}${u}`;
}
i(D, "inspectList");
function Ao(e) {
  return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? e : JSON.stringify(e).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
}
i(Ao, "quoteComplexKey");
function ce([e, t], n) {
  return n.truncate -= 2, typeof e == "string" ? e = Ao(e) : typeof e != "number" && (e = `[${n.inspect(e, n)}]`), n.truncate -= e.length, t = n.inspect(t, n), `${e}: ${t}`;
}
i(ce, "inspectProperty");

// ../node_modules/loupe/lib/array.js
function st(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}` : ""} ]`;
}
i(st, "inspectArray");

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

// ../node_modules/loupe/lib/date.js
function it(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${k(r[1], t.truncate - o.length - 1)}`, "date");
}
i(it, "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} ${k(r, t.truncate - 11)}]`, "special") : t.stylize(`[${n}]`, "special");
}
i(Ie, "inspectFunction");

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

// ../node_modules/loupe/lib/number.js
var Io = Number.isNaN || ((e) => e !== e);
function Me(e, t) {
  return Io(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(k(String(e), t.truncate), "number");
}
i(Me, "inspectNumber");

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

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

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

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

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

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

// ../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((a) => [a, e[a]]), t, ce), s = D(r.map((a) => [a, e[a]]), t, ce);
  t.seen.pop();
  let c = "";
  return o && s && (c = ", "), `{ ${o}${c}${s} }`;
}
i(me, "inspectObject");

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

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

// ../node_modules/loupe/lib/error.js
var jo = [
  "stack",
  "line",
  "column",
  "name",
  "message",
  "fileName",
  "lineNumber",
  "columnNumber",
  "number",
  "description",
  "cause"
];
function pt(e, t) {
  let n = Object.getOwnPropertyNames(e).filter((c) => jo.indexOf(c) === -1), r = e.name;
  t.truncate -= r.length;
  let o = "";
  if (typeof e.message == "string" ? o = k(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((c) => [c, e[c]]), t, ce);
  return `${r}${o}${s ? ` { ${s} }` : ""}`;
}
i(pt, "inspectObject");

// ../node_modules/loupe/lib/html.js
function Bo([e, t], n) {
  return n.truncate -= 3, t ? `${n.stylize(String(e), "yellow")}=${n.stylize(`"${t}"`, "string")}` : `${n.stylize(String(e), "yellow")}`;
}
i(Bo, "inspectAttribute");
function Fe(e, t) {
  return D(e, t, ko, `
`);
}
i(Fe, "inspectNodeCollection");
function ko(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);
  }
}
i(ko, "inspectNode");
function je(e, t) {
  let n = e.getAttributeNames(), r = e.tagName.toLowerCase(), o = t.stylize(`<${r}`, "special"), s = t.stylize(">", "special"), c = t.stylize(`</${r}>`, "special");
  t.truncate -= r.length * 2 + 5;
  let a = "";
  n.length > 0 && (a += " ", a += D(n.map((p) => [p, e.getAttribute(p)]), t, Bo, " ")), t.truncate -= a.length;
  let u = t.truncate, m = Fe(e.children, t);
  return m && m.length > u && (m = `${ie}(${e.children.length})`), `${o}${a}${s}${m}${c}`;
}
i(je, "inspectHTML");

// ../node_modules/loupe/lib/index.js
var zo = typeof Symbol == "function" && typeof Symbol.for == "function", gt = zo ? Symbol.for("chai/inspect") : "@@chai/inspect", ht = Symbol.for("nodejs.util.inspect.custom"), yn = /* @__PURE__ */ new WeakMap(), bn = {}, Sn = {
  undefined: /* @__PURE__ */ i((e, t) => t.stylize("undefined", "undefined"), "undefined"),
  null: /* @__PURE__ */ i((e, t) => t.stylize("null", "null"), "null"),
  boolean: /* @__PURE__ */ i((e, t) => t.stylize(String(e), "boolean"), "boolean"),
  Boolean: /* @__PURE__ */ i((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: st,
  Date: it,
  Map: ct,
  Set: at,
  RegExp: ut,
  Promise: dn,
  // WeakSet, WeakMap are totally opaque to us
  WeakSet: /* @__PURE__ */ i((e, t) => t.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
  WeakMap: /* @__PURE__ */ i((e, t) => t.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
  Arguments: mt,
  Int8Array: te,
  Uint8Array: te,
  Uint8ClampedArray: te,
  Int16Array: te,
  Uint16Array: te,
  Int32Array: te,
  Uint32Array: te,
  Float32Array: te,
  Float64Array: te,
  Generator: /* @__PURE__ */ i(() => "", "Generator"),
  DataView: /* @__PURE__ */ i(() => "", "DataView"),
  ArrayBuffer: /* @__PURE__ */ i(() => "", "ArrayBuffer"),
  Error: pt,
  HTMLCollection: Fe,
  NodeList: Fe
}, Yo = /* @__PURE__ */ i((e, t, n) => gt in e && typeof e[gt] == "function" ? e[gt](t) : ht in e && typeof e[ht] == "function" ? e[ht](t.depth, t) : "inspect" in e && typeof e.inspect == "function" ? e.inspect(t.depth, t) : "constructor" in e && yn.has(e.constructor) ? yn.get(e.constructor)(e, t) : bn[n] ? bn[n](e, t) : "", "inspectCustom"), Uo = Object.prototype.toString;
function Be(e, t = {}) {
  let n = pn(t, Be), { customInspect: r } = n, o = e === null ? "null" : typeof e;
  if (o === "object" && (o = Uo.call(e).slice(8, -1)), o in Sn)
    return Sn[o](e, n);
  if (r && e) {
    let c = Yo(e, n, o);
    if (c)
      return typeof c == "string" ? c : Be(c, 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) : "constructor" in e ? e.constructor !== Object ? ft(e, n) : me(e, n) : e === Object(e) ? me(e, n) : n.stylize(String(e), o);
}
i(Be, "inspect");

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

// ../node_modules/@vitest/utils/dist/helpers.js
function Zo(e) {
  return e === Object.prototype || e === Function.prototype || e === RegExp.prototype;
}
i(Zo, "isFinalObj");
function ke(e) {
  return Object.prototype.toString.apply(e).slice(8, -1);
}
i(ke, "getType");
function Qo(e, t) {
  let n = typeof t == "function" ? t : (r) => t.add(r);
  Object.getOwnPropertyNames(e).forEach(n), Object.getOwnPropertySymbols(e).forEach(n);
}
i(Qo, "collectOwnProperties");
function yt(e) {
  let t = /* @__PURE__ */ new Set();
  return Zo(e) ? [] : (Qo(e, t), Array.from(t));
}
i(yt, "getOwnProperties");
var Tn = { forceWritable: !1 };
function bt(e, t = Tn) {
  return dt(e, /* @__PURE__ */ new WeakMap(), t);
}
i(bt, "deepClone");
function dt(e, t, n = Tn) {
  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] = dt(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 = yt(e);
    for (let c of s) {
      let a = Object.getOwnPropertyDescriptor(e, c);
      if (!a)
        continue;
      let u = dt(e[c], t, n);
      n.forceWritable ? Object.defineProperty(o, c, {
        enumerable: a.enumerable,
        configurable: !0,
        writable: !0,
        value: u
      }) : "get" in a ? Object.defineProperty(o, c, {
        ...a,
        get() {
          return u;
        }
      }) : Object.defineProperty(o, c, {
        ...a,
        value: u
      });
    }
    return o;
  }
  return e;
}
i(dt, "clone");

// ../node_modules/@vitest/utils/dist/diff.js
var z = -1, j = 1, M = 0, N = class {
  static {
    i(this, "Diff");
  }
  0;
  1;
  constructor(t, n) {
    this[0] = t, this[1] = n;
  }
};
function vo(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;
}
i(vo, "diff_commonPrefix");
function kn(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;
}
i(kn, "diff_commonSuffix");
function On(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, c = 1;
  for (; ; ) {
    let a = e.substring(o - c), u = t.indexOf(a);
    if (u === -1)
      return s;
    c += u, (u === 0 || e.substring(o - c) === t.substring(0, c)) && (s = c, c++);
  }
}
i(On, "diff_commonOverlap_");
function es(e) {
  let t = !1, n = [], r = 0, o = null, s = 0, c = 0, a = 0, u = 0, m = 0;
  for (; s < e.length; )
    e[s][0] === M ? (n[r++] = s, c = u, a = 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(c, a) && 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, c = 0, a = 0, u = 0, m = 0, o = null, t = !0)), s++;
  for (t && zn(e), rs(e), s = 1; s < e.length; ) {
    if (e[s - 1][0] === z && e[s][0] === j) {
      let p = e[s - 1][1], l = e[s][1], S = On(p, l), g = On(l, p);
      S >= g ? (S >= p.length / 2 || S >= l.length / 2) && (e.splice(s, 0, new N(M, l.substring(0, S))), e[s - 1][1] = p.substring(0, p.length - S), e[s + 1][1] = l.substring(S), s++) : (g >= p.length / 2 || g >= l.length / 2) && (e.splice(s, 0, new N(M, p.substring(0, g))), e[s - 1][0] = j, e[s - 1][1] = l.substring(0, l.length - g), e[s + 1][0] = z, e[s + 1][1] = p.substring(g), s++), s++;
    }
    s++;
  }
}
i(es, "diff_cleanupSemantic");
var $n = /[^a-z0-9]/i, wn = /\s/, An = /[\r\n]/, ts = /\n\r?\n$/, ns = /^\r?\n\r?\n/;
function rs(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 = kn(n, r);
      if (s) {
        let p = r.substring(r.length - s);
        n = n.substring(0, n.length - s), r = p + r.substring(0, r.length - s), o = p + o;
      }
      let c = n, a = 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 p = ze(n, r) + ze(r, o);
        p >= m && (m = p, c = n, a = r, u = o);
      }
      e[t - 1][1] !== c && (c ? e[t - 1][1] = c : (e.splice(t - 1, 1), t--), e[t][1] = a, u ? e[t + 1][1] = u : (e.splice(t + 1, 1), t--));
    }
    t++;
  }
}
i(rs, "diff_cleanupSemanticLossless");
function zn(e) {
  e.push(new N(M, ""));
  let t = 0, n = 0, r = 0, o = "", s = "", c;
  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 && (c = vo(s, o), c !== 0 && (t - n - r > 0 && e[t - n - r - 1][0] === M ? e[t - n - r - 1][1] += s.substring(0, c) : (e.splice(0, 0, new N(M, s.substring(0, c))), t++), s = s.substring(c), o = o.substring(c)), c = kn(s, o), c !== 0 && (e[t][1] = s.substring(s.length - c) + e[t][1], s = s.substring(0, s.length - c), o = o.substring(0, o.length - c))), 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 a = !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), a = !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), a = !0)), t++;
  a && zn(e);
}
i(zn, "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($n), s = r.match($n), c = o && n.match(wn), a = s && r.match(wn), u = c && n.match(An), m = a && r.match(An), p = u && e.match(ts), l = m && t.match(ns);
  return p || l ? 5 : u || m ? 4 : o && !c && a ? 3 : c || a ? 2 : o || s ? 1 : 0;
}
i(ze, "diff_cleanupSemanticScore_");
var Yn = "Compared values have no visual difference.", os = "Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.", Ye = {}, Rn;
function ss() {
  if (Rn) return Ye;
  Rn = 1, Object.defineProperty(Ye, "__esModule", {
    value: !0
  }), Ye.default = S;
  let e = "diff-sequences", t = 0, n = /* @__PURE__ */ i((g, h, f, d, b) => {
    let _ = 0;
    for (; g < h && f < d && b(g, f); )
      g += 1, f += 1, _ += 1;
    return _;
  }, "countCommonItemsF"), r = /* @__PURE__ */ i((g, h, f, d, b) => {
    let _ = 0;
    for (; g <= h && f <= d && b(h, d); )
      h -= 1, d -= 1, _ += 1;
    return _;
  }, "countCommonItemsR"), o = /* @__PURE__ */ i((g, h, f, d, b, _, O) => {
    let y = 0, E = -g, $ = _[y], C = $;
    _[y] += n(
      $ + 1,
      h,
      d + $ - E + 1,
      f,
      b
    );
    let A = g < O ? g : O;
    for (y += 1, E += 2; y <= A; y += 1, E += 2) {
      if (y !== g && C < _[y])
        $ = _[y];
      else if ($ = C + 1, h <= $)
        return y - 1;
      C = _[y], _[y] = $ + n($ + 1, h, d + $ - E + 1, f, b);
    }
    return O;
  }, "extendPathsF"), s = /* @__PURE__ */ i((g, h, f, d, b, _, O) => {
    let y = 0, E = g, $ = _[y], C = $;
    _[y] -= r(
      h,
      $ - 1,
      f,
      d + $ - E - 1,
      b
    );
    let A = g < O ? g : O;
    for (y += 1, E -= 2; y <= A; y += 1, E -= 2) {
      if (y !== g && _[y] < C)
        $ = _[y];
      else if ($ = C - 1, $ < h)
        return y - 1;
      C = _[y], _[y] = $ - r(
        h,
        $ - 1,
        f,
        d + $ - E - 1,
        b
      );
    }
    return O;
  }, "extendPathsR"), c = /* @__PURE__ */ i((g, h, f, d, b, _, O, y, E, $, C) => {
    let A = d - h, K = f - h, I = b - d - K, B = -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 < O[L], F = H ? O[L] : Y, W = H ? F : F + 1, re = A + W - x, V = n(
        W + 1,
        f,
        re + 1,
        b,
        _
      ), q = W + V;
      if (Y = O[L], O[L] = q, B <= 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;
          C.nChangePreceding = g - 1, g - 1 === ue + be - h - d ? (C.aEndPreceding = h, C.bEndPreceding = d) : (C.aEndPreceding = ue, C.bEndPreceding = be), C.nCommonPreceding = U, U !== 0 && (C.aCommonPreceding = ue, C.bCommonPreceding = be), C.nCommonFollowing = V, V !== 0 && (C.aCommonFollowing = W + 1, C.bCommonFollowing = re + 1);
          let Te = q + 1, Oe = re + V + 1;
          return C.nChangeFollowing = g - 1, g - 1 === f + b - Te - Oe ? (C.aStartFollowing = f, C.bStartFollowing = b) : (C.aStartFollowing = Te, C.bStartFollowing = Oe), !0;
        }
      }
    }
    return !1;
  }, "extendOverlappablePathsF"), a = /* @__PURE__ */ i((g, h, f, d, b, _, O, y, E, $, C) => {
    let A = b - f, K = f - h, I = b - d - K, B = 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, B <= x && x <= G) {
        let se = (g + (x - I)) / 2;
        if (se <= y && q - 1 <= O[se]) {
          let J = re - V;
          if (C.nChangePreceding = g, g === q + J - h - d ? (C.aEndPreceding = h, C.bEndPreceding = d) : (C.aEndPreceding = q, C.bEndPreceding = J), C.nCommonPreceding = V, V !== 0 && (C.aCommonPreceding = q, C.bCommonPreceding = J), C.nChangeFollowing = g - 1, g === 1)
            C.nCommonFollowing = 0, C.aStartFollowing = f, C.bStartFollowing = b;
          else {
            let U = A + F - (H ? x - 1 : x + 1), oe = n(
              F,
              f,
              U,
              b,
              _
            );
            C.nCommonFollowing = oe, oe !== 0 && (C.aCommonFollowing = F, C.bCommonFollowing = U);
            let he = F + oe, ue = U + oe;
            g - 1 === f + b - he - ue ? (C.aStartFollowing = f, C.bStartFollowing = b) : (C.aStartFollowing = he, C.bStartFollowing = ue);
          }
          return !0;
        }
      }
    }
    return !1;
  }, "extendOverlappablePathsR"), u = /* @__PURE__ */ i((g, h, f, d, b, _, O, y, E) => {
    let $ = d - h, C = b - f, A = f - h, K = b - d, Q = K - A, I = A, B = A;
    if (O[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, b, $, _, O, I), P < G)
          B = s(P, h, d, C, _, y, B);
        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.
          a(
            P,
            h,
            f,
            d,
            b,
            _,
            O,
            I,
            y,
            B,
            E
          )
        )
          return;
    } else {
      let G = ((g || Q) + 1) / 2, Y = (A + K + 1) / 2, P = 1;
      for (I = o(P, f, b, $, _, O, I), P += 1; P <= Y; P += 1)
        if (B = s(
          P - 1,
          h,
          d,
          C,
          _,
          y,
          B
        ), P < G)
          I = o(P, f, b, $, _, O, 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.
          c(
            P,
            h,
            f,
            d,
            b,
            _,
            O,
            I,
            y,
            B,
            E
          )
        )
          return;
    }
    throw new Error(
      `${e}: no overlap aStart=${h} aEnd=${f} bStart=${d} bEnd=${b}`
    );
  }, "divide"), m = /* @__PURE__ */ i((g, h, f, d, b, _, O, y, E, $) => {
    if (b - d < f - h) {
      if (_ = !_, _ && O.length === 1) {
        let { foundSubsequence: q, isCommon: se } = O[0];
        O[1] = {
          foundSubsequence: /* @__PURE__ */ i((J, U, oe) => {
            q(J, oe, U);
          }, "foundSubsequence"),
          isCommon: /* @__PURE__ */ i((J, U) => se(U, J), "isCommon")
        };
      }
      let re = h, V = f;
      h = d, f = b, d = re, b = V;
    }
    let { foundSubsequence: C, isCommon: A } = O[_ ? 1 : 0];
    u(
      g,
      h,
      f,
      d,
      b,
      A,
      y,
      E,
      $
    );
    let {
      nChangePreceding: K,
      aEndPreceding: Q,
      bEndPreceding: I,
      nCommonPreceding: B,
      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,
      _,
      O,
      y,
      E,
      $
    ), B !== 0 && C(B, G, Y), P !== 0 && C(P, L, x), F < f && W < b && m(
      H,
      F,
      f,
      W,
      b,
      _,
      O,
      y,
      E,
      $
    );
  }, "findSubsequences"), p = /* @__PURE__ */ i((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"), l = /* @__PURE__ */ i((g, h) => {
    let f = typeof h;
    if (f !== "function")
      throw new TypeError(`${e}: ${g} typeof ${f} is not a function`);
  }, "validateCallback");
  function S(g, h, f, d) {
    p("aLength", g), p("bLength", h), l("isCommon", f), l("foundSubsequence", d);
    let b = n(0, g, 0, h, f);
    if (b !== 0 && d(b, 0, 0), g !== b || h !== b) {
      let _ = b, O = b, y = r(
        _,
        g - 1,
        O,
        h - 1,
        f
      ), E = g - y, $ = h - y, C = b + y;
      g !== C && h !== C && m(
        0,
        _,
        E,
        O,
        $,
        !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 i(S, "diffSequence"), Ye;
}
i(ss, "requireBuild");
var is = ss(), Un = /* @__PURE__ */ Cn(is);
function cs(e, t) {
  return e.replace(/\s+$/, (n) => t(n));
}
i(cs, "formatTrailingSpaces");
function $t(e, t, n, r, o, s) {
  return e.length !== 0 ? n(`${r} ${cs(e, o)}`) : r !== " " ? n(r) : t && s.length !== 0 ? n(`${r} ${s}`) : "";
}
i($t, "printDiffLine");
function Wn(e, t, { aColor: n, aIndicator: r, changeLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return $t(e, t, n, r, o, s);
}
i(Wn, "printDeleteLine");
function Vn(e, t, { bColor: n, bIndicator: r, changeLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return $t(e, t, n, r, o, s);
}
i(Vn, "printInsertLine");
function qn(e, t, { commonColor: n, commonIndicator: r, commonLineTrailingSpaceColor: o, emptyFirstOrLastLinePlaceholder: s }) {
  return $t(e, t, n, r, o, s);
}
i(qn, "printCommonLine");
function Nn(e, t, n, r, { patchColor: o }) {
  return o(`@@ -${e + 1},${t - e} +${n + 1},${r - n} @@`);
}
i(Nn, "createPatchMark");
function us(e, t) {
  let n = e.length, r = t.contextLines, o = r + r, s = n, c = !1, a = 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, c = !0);
      else if (u === n) {
        let E = u - y;
        E > r && (s -= E - r, c = !0);
      } else {
        let E = u - y;
        E > o && (s -= E - o, a += 1);
      }
    for (; u !== n && e[u][0] !== M; )
      u += 1;
  }
  let m = a !== 0 || c;
  a !== 0 ? s += a + 1 : c && (s += 1);
  let p = s - 1, l = [], S = 0;
  m && l.push("");
  let g = 0, h = 0, f = 0, d = 0, b = /* @__PURE__ */ i((y) => {
    let E = l.length;
    l.push(qn(y, E === 0 || E === p, t)), f += 1, d += 1;
  }, "pushCommonLine"), _ = /* @__PURE__ */ i((y) => {
    let E = l.length;
    l.push(Wn(y, E === 0 || E === p, t)), f += 1;
  }, "pushDeleteLine"), O = /* @__PURE__ */ i((y) => {
    let E = l.length;
    l.push(Vn(y, E === 0 || E === p, 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)
          b(e[E][1]);
      } else if (u === n) {
        let E = u - y > r ? y + r : u;
        for (let $ = y; $ !== E; $ += 1)
          b(e[$][1]);
      } else {
        let E = u - y;
        if (E > o) {
          let $ = y + r;
          for (let A = y; A !== $; A += 1)
            b(e[A][1]);
          l[S] = Nn(g, f, h, d, t), S = l.length, l.push("");
          let C = E - o;
          g = f + C, h = d + C, f = g, d = h;
          for (let A = u - r; A !== u; A += 1)
            b(e[A][1]);
        } else
          for (let $ = y; $ !== u; $ += 1)
            b(e[$][1]);
      }
    for (; u !== n && e[u][0] === z; )
      _(e[u][1]), u += 1;
    for (; u !== n && e[u][0] === j; )
      O(e[u][1]), u += 1;
  }
  return m && (l[S] = Nn(g, f, h, d, t)), l.join(`
`);
}
i(us, "joinAlignedDiffsNoExpand");
function as(e, t) {
  return e.map((n, r, o) => {
    let s = n[1], c = r === 0 || r === o.length - 1;
    switch (n[0]) {
      case z:
        return Wn(s, c, t);
      case j:
        return Vn(s, c, t);
      default:
        return qn(s, c, t);
    }
  }).join(`
`);
}
i(as, "joinAlignedDiffsExpand");
var St = /* @__PURE__ */ i((e) => e, "noColor"), Kn = 5, ls = 0;
function fs() {
  return {
    aAnnotation: "Expected",
    aColor: v.green,
    aIndicator: "-",
    bAnnotation: "Received",
    bColor: v.red,
    bIndicator: "+",
    changeColor: v.inverse,
    changeLineTrailingSpaceColor: St,
    commonColor: v.dim,
    commonIndicator: " ",
    commonLineTrailingSpaceColor: St,
    compareKeys: void 0,
    contextLines: Kn,
    emptyFirstOrLastLinePlaceholder: "",
    expand: !1,
    includeChangeCounts: !1,
    omitAnnotationLines: !1,
    patchColor: v.yellow,
    printBasicPrototype: !1,
    truncateThreshold: ls,
    truncateAnnotation: "... Diff result is truncated",
    truncateAnnotationColor: St
  };
}
i(fs, "getDefaultOptions");
function ms(e) {
  return e && typeof e == "function" ? e : void 0;
}
i(ms, "getCompareKeys");
function ps(e) {
  return typeof e == "number" && Number.isSafeInteger(e) && e >= 0 ? e : Kn;
}
i(ps, "getContextLines");
function ge(e = {}) {
  return {
    ...fs(),
    ...e,
    compareKeys: ms(e.compareKeys),
    contextLines: ps(e.contextLines)
  };
}
i(ge, "normalizeDiffOptions");
function ye(e) {
  return e.length === 1 && e[0].length === 0;
}
i(ye, "isEmptyString");
function gs(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
  };
}
i(gs, "countChanges");
function hs({ aAnnotation: e, aColor: t, aIndicator: n, bAnnotation: r, bColor: o, bIndicator: s, includeChangeCounts: c, omitAnnotationLines: a }, u) {
  if (a)
    return "";
  let m = "", p = "";
  if (c) {
    let g = String(u.a), h = String(u.b), f = r.length - e.length, d = " ".repeat(Math.max(0, f)), b = " ".repeat(Math.max(0, -f)), _ = h.length - g.length, O = " ".repeat(Math.max(0, _)), y = " ".repeat(Math.max(0, -_));
    m = `${d}  ${n} ${O}${g}`, p = `${b}  ${s} ${y}${h}`;
  }
  let l = `${n} ${e}${m}`, S = `${s} ${r}${p}`;
  return `${t(l)}
${o(S)}

`;
}
i(hs, "printAnnotation");
function wt(e, t, n) {
  return hs(n, gs(e)) + (n.expand ? as(e, n) : us(e, n)) + (t ? n.truncateAnnotationColor(`
${n.truncateAnnotation}`) : "");
}
i(wt, "printDiffLines");
function We(e, t, n) {
  let r = ge(n), [o, s] = Gn(ye(e) ? [] : e, ye(t) ? [] : t, r);
  return wt(o, s, r);
}
i(We, "diffLinesUnified");
function ds(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, c] = Gn(n, r, o), a = 0, u = 0;
  return s.forEach((m) => {
    switch (m[0]) {
      case z:
        m[1] = e[a], a += 1;
        break;
      case j:
        m[1] = t[u], u += 1;
        break;
      default:
        m[1] = t[u], a += 1, u += 1;
    }
  }), wt(s, c, ge(o));
}
i(ds, "diffLinesUnified2");
function Gn(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, c = r ? Math.min(t.length, o) : t.length, a = s !== e.length || c !== t.length, u = /* @__PURE__ */ i((g, h) => e[g] === t[h], "isCommon"), m = [], p = 0, l = 0;
  for (Un(s, c, u, /* @__PURE__ */ i((g, h, f) => {
    for (; p !== h; p += 1)
      m.push(new N(z, e[p]));
    for (; l !== f; l += 1)
      m.push(new N(j, t[l]));
    for (; g !== 0; g -= 1, p += 1, l += 1)
      m.push(new N(M, t[l]));
  }, "foundSubsequence")); p !== s; p += 1)
    m.push(new N(z, e[p]));
  for (; l !== c; l += 1)
    m.push(new N(j, t[l]));
  return [m, a];
}
i(Gn, "diffLinesRaw");
function Pn(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}`);
}
i(Pn, "getType");
function In(e) {
  return e.includes(`\r
`) ? `\r
` : `
`;
}
i(In, "getNewLineSymbol");
function ys(e, t, n) {
  let r = n?.truncateThreshold ?? !1, o = Math.max(Math.floor(n?.truncateThreshold ?? 0), 0), s = e.length, c = t.length;
  if (r) {
    let g = e.includes(`
`), h = t.includes(`
`), f = In(e), d = In(t), b = g ? `${e.split(f, o).join(f)}
` : e, _ = h ? `${t.split(d, o).join(d)}
` : t;
    s = b.length, c = _.length;
  }
  let a = s !== e.length || c !== t.length, u = /* @__PURE__ */ i((g, h) => e[g] === t[h], "isCommon"), m = 0, p = 0, l = [];
  return Un(s, c, u, /* @__PURE__ */ i((g, h, f) => {
    m !== h && l.push(new N(z, e.slice(m, h))), p !== f && l.push(new N(j, t.slice(p, f))), m = h + g, p = f + g, l.push(new N(M, t.slice(f, p)));
  }, "foundSubsequence")), m !== s && l.push(new N(z, e.slice(m))), p !== c && l.push(new N(j, t.slice(p))), [l, a];
}
i(ys, "diffStrings");
function bs(e, t, n) {
  return t.reduce((r, o) => r + (o[0] === M ? o[1] : o[0] === e && o[1].length !== 0 ? n(o[1]) : ""), "");
}
i(bs, "concatenateRelevantDiffs");
var Ue = class {
  static {
    i(this, "ChangeBuffer");
  }
  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, bs(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, c) => {
        c < 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;
  }
}, _t = class {
  static {
    i(this, "CommonBuffer");
  }
  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((c, a) => {
        if (a === 0) {
          let u = new N(n, c);
          this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty() ? (this.flushChangeLines(), this.pushDiffCommonLine(u)) : (this.pushDiffChangeLines(u), this.flushChangeLines());
        } else a < s ? this.pushDiffCommonLine(new N(n, c)) : c.length !== 0 && this.pushDiffChangeLines(new N(n, c));
      });
    } else
      this.pushDiffChangeLines(t);
  }
  // Output from buffer.
  getLines() {
    return this.flushChangeLines(), this.lines;
  }
};
function Ss(e, t) {
  let n = new Ue(z, t), r = new Ue(j, t), o = new _t(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();
}
i(Ss, "getAlignedDiffs");
function Es(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);
}
i(Es, "hasCommonDiff");
function _s(e, t, n) {
  if (e !== t && e.length !== 0 && t.length !== 0) {
    let r = e.includes(`
`) || t.includes(`
`), [o, s] = Hn(r ? `${e}
` : e, r ? `${t}
` : t, !0, n);
    if (Es(o, r)) {
      let c = ge(n), a = Ss(o, c.changeColor);
      return wt(a, s, c);
    }
  }
  return We(e.split(`
`), t.split(`
`), n);
}
i(_s, "diffStringsUnified");
function Hn(e, t, n, r) {
  let [o, s] = ys(e, t, r);
  return n && es(o), [o, s];
}
i(Hn, "diffStringsRaw");
function Ct(e, t) {
  let { commonColor: n } = ge(t);
  return n(e);
}
i(Ct, "getCommonMessage");
var { AsymmetricMatcher: Cs, DOMCollection: Ts, DOMElement: Os, Immutable: $s, ReactElement: ws, ReactTestComponent: As } = _e, Jn = [
  As,
  ws,
  Os,
  Ts,
  $s,
  Cs,
  _e.Error
], Tt = {
  maxDepth: 20,
  plugins: Jn
}, Xn = {
  callToJSON: !1,
  maxDepth: 8,
  plugins: Jn
};
function Rs(e, t, n) {
  if (Object.is(e, t))
    return "";
  let r = Pn(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 !== Pn(t)) {
    let d = function(O) {
      return O.length <= f ? O : `${O.slice(0, f)}...`;
    };
    i(d, "truncate");
    let { aAnnotation: c, aColor: a, aIndicator: u, bAnnotation: m, bColor: p, bIndicator: l } = ge(n), S = Ot(Xn, n), g = X(e, S), h = X(t, S), f = 1e5;
    g = d(g), h = d(h);
    let b = `${a(`${u} ${c}:`)} 
${g}`, _ = `${p(`${l} ${m}:`)} 
${h}`;
    return `${b}

${_}`;
  }
  if (!s)
    switch (r) {
      case "string":
        return We(e.split(`
`), t.split(`
`), n);
      case "boolean":
      case "number":
        return Ns(e, t, n);
      case "map":
        return Et(Mn(e), Mn(t), n);
      case "set":
        return Et(Ln(e), Ln(t), n);
      default:
        return Et(e, t, n);
    }
}
i(Rs, "diff");
function Ns(e, t, n) {
  let r = X(e, Tt), o = X(t, Tt);
  return r === o ? "" : We(r.split(`
`), o.split(`
`), n);
}
i(Ns, "comparePrimitive");
function Mn(e) {
  return new Map(Array.from(e.entries()).sort());
}
i(Mn, "sortMap");
function Ln(e) {
  return new Set(Array.from(e.values()).sort());
}
i(Ln, "sortSet");
function Et(e, t, n) {
  let r, o = !1;
  try {
    let c = Ot(Tt, n);
    r = xn(e, t, c, n);
  } catch {
    o = !0;
  }
  let s = Ct(Yn, n);
  if (r === void 0 || r === s) {
    let c = Ot(Xn, n);
    r = xn(e, t, c, n), r !== s && !o && (r = `${Ct(os, n)}

${r}`);
  }
  return r;
}
i(Et, "compareObjects");
function Ot(e, t) {
  let { compareKeys: n, printBasicPrototype: r, maxDepth: o } = ge(t);
  return {
    ...e,
    compareKeys: n,
    printBasicPrototype: r,
    maxDepth: o ?? e.maxDepth
  };
}
i(Ot, "getFormatOptions");
function xn(e, t, n, r) {
  let o = {
    ...n,
    indent: 0
  }, s = X(e, o), c = X(t, o);
  if (s === c)
    return Ct(Yn, r);
  {
    let a = X(e, n), u = X(t, n);
    return ds(a.split(`
`), u.split(`
`), s.split(`
`), c.split(`
`), r);
  }
}
i(xn, "getObjectsDifference");
var Dn = 2e4;
function Fn(e) {
  return ke(e) === "Object" && typeof e.asymmetricMatch == "function";
}
i(Fn, "isAsymmetricMatcher");
function jn(e, t) {
  let n = ke(e), r = ke(t);
  return n === r && (n === "Object" || n === "Array");
}
i(jn, "isReplaceable");
function Zn(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 <= Dn && e.length <= Dn && t !== e) {
    if (t.includes(`
`) || e.includes(`
`))
      return _s(t, e, n);
    let [p] = Hn(t, e, !0), l = p.some((f) => f[0] === M), S = Ps(r, o), g = S(r) + Ls(Bn(p, z, l)), h = S(o) + Ms(Bn(p, j, l));
    return `${g}
${h}`;
  }
  let s = bt(t, { forceWritable: !0 }), c = bt(e, { forceWritable: !0 }), { replacedExpected: a, replacedActual: u } = Qn(c, s);
  return Rs(a, u, n);
}
i(Zn, "printDiffOrStringify");
function Qn(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
  }) : jn(e, t) ? n.has(e) || r.has(t) ? {
    replacedActual: e,
    replacedExpected: t
  } : (n.add(e), r.add(t), yt(t).forEach((o) => {
    let s = t[o], c = e[o];
    if (Fn(s))
      s.asymmetricMatch(c) && (e[o] = s);
    else if (Fn(c))
      c.asymmetricMatch(s) && (t[o] = c);
    else if (jn(c, s)) {
      let a = Qn(c, s, n, r);
      e[o] = a.replacedActual, t[o] = a.replacedExpected;
    }
  }), {
    replacedActual: e,
    replacedExpected: t
  }) : {
    replacedActual: e,
    replacedExpected: t
  };
}
i(Qn, "replaceAsymmetricMatcher");
function Ps(...e) {
  let t = e.reduce((n, r) => r.length > n ? r.length : n, 0);
  return (n) => `${n}: ${" ".repeat(t - n.length)}`;
}
i(Ps, "getLabelPrinter");
var Is = "\xB7";
function vn(e) {
  return e.replace(/\s+$/gm, (t) => Is.repeat(t.length));
}
i(vn, "replaceTrailingSpaces");
function Ms(e) {
  return v.red(vn(pe(e)));
}
i(Ms, "printReceived");
function Ls(e) {
  return v.green(vn(pe(e)));
}
i(Ls, "printExpected");
function Bn(e, t, n) {
  return e.reduce((r, o) => r + (o[0] === M ? o[1] : o[0] === t ? n ? v.inverse(o[1]) : o[1] : ""), "");
}
i(Bn, "getCommonAndChangedSubstrings");

// ../node_modules/@vitest/utils/dist/error.js
var xs = "@@__IMMUTABLE_RECORD__@@", Ds = "@@__IMMUTABLE_ITERABLE__@@";
function Fs(e) {
  return e && (e[Ds] || e[xs]);
}
i(Fs, "isImmutable");
var js = Object.getPrototypeOf({});
function er(e) {
  return e instanceof Error ? `<unserializable>: ${e.message}` : typeof e == "string" ? `<unserializable>: ${e}` : "<unserializable>";
}
i(er, "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 (Fs(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()} ${_n(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] = er(s);
      }
    }), n;
  } else {
    let n = /* @__PURE__ */ Object.create(null);
    t.set(e, n);
    let r = e;
    for (; r && r !== js; )
      Object.getOwnPropertyNames(r).forEach((o) => {
        if (!(o in n))
          try {
            n[o] = le(e[o], t);
          } catch (s) {
            delete n[o], n[o] = er(s);
          }
      }), r = Object.getPrototypeOf(r);
    return n;
  }
}
i(le, "serializeValue");
function Ve(e) {
  try {
    return e();
  } catch {
  }
}
i(Ve, "safe");
function Bs(e) {
  return e.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "");
}
i(Bs, "normalizeErrorMessage");
function At(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 = Zn(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 = Bs(r.message));
  } catch {
  }
  try {
    !n.has(r) && typeof r.cause == "object" && (n.add(r), r.cause = At(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}`));
  }
}
i(At, "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 ks = /* @__PURE__ */ ((o) => (o.DONE = "done", o.ERROR = "error", o.ACTIVE = "active", o.WAITING = "waiting", o))(ks || {});

// src/instrumenter/instrumenter.ts
var Ws = new Error(
  "This function ran after the play function completed. Did you forget to `await` it?"
), nr = /* @__PURE__ */ i((e) => Object.prototype.toString.call(e) === "[object Object]", "isObject"), Vs = /* @__PURE__ */ i((e) => Object.prototype.toString.call(e) === "[object Module]", "isModule"), qs = /* @__PURE__ */ i((e) => {
  if (!nr(e) && !Vs(e))
    return !1;
  if (e.constructor === void 0)
    return !0;
  let t = e.constructor.prototype;
  return !!nr(t);
}, "isInstrumentable"), Ks = /* @__PURE__ */ i((e) => {
  try {
    return new e.constructor();
  } catch {
    return {};
  }
}, "construct"), Rt = /* @__PURE__ */ i(() => ({
  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"), rr = /* @__PURE__ */ i((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"), Nt = class {
  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__ */ i(() => {
      try {
        this.state = Z.window?.parent?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ || {};
      } catch {
        this.detached = !0;
      }
    }, "loadParentWindowState");
    this.updateParentWindowState = /* @__PURE__ */ i(() => {
      try {
        Z.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__ = this.state;
      } catch {
        this.detached = !0;
      }
    }, "updateParentWindowState");
    this.loadParentWindowState();
    let t = /* @__PURE__ */ i(({
      storyId: u,
      isPlaying: m = !0,
      isDebugging: p = !1
    }) => {
      let l = this.getState(u);
      this.setState(u, {
        ...Rt(),
        ...rr(l, p),
        shadowCalls: p ? l.shadowCalls : [],
        chainedCallIds: p ? l.chainedCallIds : /* @__PURE__ */ new Set(),
        playUntil: p ? l.playUntil : void 0,
        isPlaying: m,
        isDebugging: p
      }), this.sync(u);
    }, "resetState"), n = /* @__PURE__ */ i((u) => ({ storyId: m, playUntil: p }) => {
      this.getState(m).isDebugging || this.setState(m, ({ calls: S }) => ({
        calls: [],
        shadowCalls: S.map((g) => ({ ...g, status: "waiting" })),
        isDebugging: !0
      }));
      let l = this.getLog(m);
      this.setState(m, ({ shadowCalls: S }) => {
        if (p || !l.length)
          return { playUntil: p };
        let g = S.findIndex((h) => h.id === l[0].callId);
        return {
          playUntil: S.slice(0, g).filter((h) => h.interceptable && !h.ancestors?.length).slice(-1)[0]?.id
        };
      }), u.emit(tr, { storyId: m, isDebugging: !0 });
    }, "start"), r = /* @__PURE__ */ i((u) => ({ storyId: m }) => {
      let p = this.getLog(m).filter((S) => !S.ancestors?.length), l = p.reduceRight((S, g, h) => S >= 0 || g.status === "waiting" ? S : h, -1);
      n(u)({ storyId: m, playUntil: p[l - 1]?.callId });
    }, "back"), o = /* @__PURE__ */ i((u) => ({ storyId: m, callId: p }) => {
      let { calls: l, shadowCalls: S, resolvers: g } = this.getState(m), h = l.find(({ id: d }) => d === p), f = S.find(({ id: d }) => d === p);
      if (!h && f && Object.values(g).length > 0) {
        let d = this.getLog(m).find((b) => b.status === "waiting")?.callId;
        f.id !== d && this.setState(m, { playUntil: f.id }), Object.values(g).forEach((b) => b());
      } else
        n(u)({ storyId: m, playUntil: p });
    }, "goto"), s = /* @__PURE__ */ i((u) => ({ storyId: m }) => {
      let { resolvers: p } = this.getState(m);
      if (Object.values(p).length > 0)
        Object.values(p).forEach((l) => l());
      else {
        let l = this.getLog(m).find((S) => S.status === "waiting")?.callId;
        l ? n(u)({ storyId: m, playUntil: l }) : c({ storyId: m });
      }
    }, "next"), c = /* @__PURE__ */ i(({ storyId: u }) => {
      this.setState(u, { playUntil: void 0, isDebugging: !1 }), Object.values(this.getState(u).resolvers).forEach((m) => m());
    }, "end"), a = /* @__PURE__ */ i(({ storyId: u, newPhase: m }) => {
      let { isDebugging: p } = this.getState(u);
      this.setState(u, { renderPhase: m }), m === "preparing" && p && t({ storyId: u }), m === "playing" && t({ storyId: u, isDebugging: p }), 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(tr, t), this.channel.on(Us, a), this.channel.on(Ys, () => {
        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, c);
    });
  }
  static {
    i(this, "Instrumenter");
  }
  getState(t) {
    return this.state[t] || Rt();
  }
  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 c = rr(s);
        return c && (r[o] = Object.assign(Rt(), c)), 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((c, a) => {
      o[a] = c;
    });
    let s = /* @__PURE__ */ new Set();
    return o.reduceRight((c, a) => (a.args.forEach((u) => {
      u?.__callId__ && s.add(u.__callId__);
    }), a.path.forEach((u) => {
      u.__callId__ && s.add(u.__callId__);
    }), (a.interceptable || a.exception) && !s.has(a.id) && (c.unshift({ callId: a.id, status: a.status, ancestors: a.ancestors }), s.add(a.id)), c), []);
  }
  // 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 (!qs(t))
      return t;
    let { mutate: o = !1, path: s = [] } = n, c = n.getKeys ? n.getKeys(t, r) : Object.keys(t);
    return r += 1, c.reduce(
      (a, u) => {
        let m = Hs(t, u);
        if (typeof m?.get == "function") {
          if (m.configurable) {
            let l = /* @__PURE__ */ i(() => m?.get?.bind(t)?.(), "getter");
            Object.defineProperty(a, u, {
              get: /* @__PURE__ */ i(() => this.instrument(l(), { ...n, path: s.concat(u) }, r), "get")
            });
          }
          return a;
        }
        let p = t[u];
        return typeof p != "function" ? (a[u] = this.instrument(p, { ...n, path: s.concat(u) }, r), a) : "__originalFn__" in p && typeof p.__originalFn__ == "function" ? (a[u] = p, a) : (a[u] = (...l) => this.track(u, p, t, l, n), a[u].__originalFn__ = p, Object.defineProperty(a[u], "name", { value: u, writable: !1 }), Object.keys(p).length > 0 && Object.assign(
          a[u],
          this.instrument({ ...p }, { ...n, path: s.concat(u) }, r)
        ), a);
      },
      o ? t : Ks(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 c = o?.[0]?.__storyId__ || Z.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId, { cursor: a, ancestors: u } = this.getState(c);
    this.setState(c, { cursor: a + 1 });
    let m = `${u.slice(-1)[0] || c} [${a}] ${t}`, { path: p = [], intercept: l = !1, retain: S = !1 } = s, g = typeof l == "function" ? l(t, p) : l, h = { id: m, cursor: a, storyId: c, ancestors: u, path: p, method: t, args: o, interceptable: g, retain: S }, 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: c, playUntil: a } = this.getState(r.storyId), u = s.has(r.id);
    return !c || u || a ? (a === r.id && this.setState(r.storyId, { playUntil: void 0 }), this.invoke(t, n, r, o)) : new Promise((m) => {
      this.setState(r.storyId, ({ resolvers: p }) => ({
        isLocked: !1,
        resolvers: { ...p, [r.id]: m }
      }));
    }).then(() => (this.setState(r.storyId, (m) => {
      let { [r.id]: p, ...l } = m.resolvers;
      return { isLocked: !0, resolvers: l };
    }), this.invoke(t, n, r, o)));
  }
  invoke(t, n, r, o) {
    let { callRefsByResult: s, renderPhase: c } = this.getState(r.storyId), a = 25, u = /* @__PURE__ */ i((l, S, g) => {
      if (g.includes(l))
        return "[Circular]";
      if (g = [...g, l], S > a)
        return "...";
      if (s.has(l))
        return s.get(l);
      if (l instanceof Array)
        return l.map((h) => u(h, ++S, g));
      if (l instanceof Date)
        return { __date__: { value: l.toISOString() } };
      if (l instanceof Error) {
        let { name: h, message: f, stack: d } = l;
        return { __error__: { name: h, message: f, stack: d } };
      }
      if (l instanceof RegExp) {
        let { flags: h, source: f } = l;
        return { __regexp__: { flags: h, source: f } };
      }
      if (l instanceof Z.window?.HTMLElement) {
        let { prefix: h, localName: f, id: d, classList: b, innerText: _ } = l, O = Array.from(b);
        return { __element__: { prefix: h, localName: f, id: d, classNames: O, innerText: _ } };
      }
      return typeof l == "function" ? {
        __function__: { name: "getMockName" in l ? l.getMockName() : l.name }
      } : typeof l == "symbol" ? { __symbol__: { description: l.description } } : typeof l == "object" && l?.constructor?.name && l?.constructor?.name !== "Object" ? { __class__: { name: l.constructor.name } } : Object.prototype.toString.call(l) === "[object Object]" ? Object.fromEntries(
        Object.entries(l).map(([h, f]) => [h, u(f, ++S, g)])
      ) : l;
    }, "serializeValues"), m = {
      ...r,
      args: r.args.map((l) => u(l, 0, []))
    };
    r.path.forEach((l) => {
      l?.__callId__ && this.setState(r.storyId, ({ chainedCallIds: S }) => ({
        chainedCallIds: new Set(Array.from(S).concat(l.__callId__))
      }));
    });
    let p = /* @__PURE__ */ i((l) => {
      if (l instanceof Error) {
        let { name: S, message: g, stack: h, callId: f = r.id } = l, {
          showDiff: d = void 0,
          diff: b = void 0,
          actual: _ = void 0,
          expected: O = void 0
        } = l.name === "AssertionError" ? At(l) : l, y = { name: S, message: g, stack: h, callId: f, showDiff: d, diff: b, actual: _, expected: O };
        if (this.update({ ...m, status: "error", exception: y }), this.setState(r.storyId, (E) => ({
          callRefsByResult: new Map([
            ...Array.from(E.callRefsByResult.entries()),
            [l, { __callId__: r.id, retain: r.retain }]
          ])
        })), r.ancestors?.length)
          throw Object.prototype.hasOwnProperty.call(l, "callId") || Object.defineProperty(l, "callId", { value: r.id }), l;
      }
      throw l;
    }, "handleException");
    try {
      if (c === "played" && !r.retain)
        throw Ws;
      let S = (o.getArgs ? o.getArgs(r, this.getState(r.storyId)) : r.args).map((h) => typeof h != "function" || Js(h) || Object.keys(h).length ? h : (...f) => {
        let { cursor: d, ancestors: b } = this.getState(r.storyId);
        this.setState(r.storyId, { cursor: 0, ancestors: [...b, r.id] });
        let _ = /* @__PURE__ */ i(() => this.setState(r.storyId, { cursor: d, ancestors: b }), "restore"), O = !1;
        try {
          let y = h(...f);
          return y instanceof Promise ? (O = !0, y.finally(_)) : y;
        } finally {
          O || _();
        }
      }), g = t.apply(n, S);
      return g && ["object", "function", "symbol"].includes(typeof g) && this.setState(r.storyId, (h) => ({
        callRefsByResult: new Map([
          ...Array.from(h.callRefsByResult.entries()),
          [g, { __callId__: r.id, retain: r.retain }]
        ])
      })), this.update({
        ...m,
        status: g instanceof Promise ? "active" : "done"
      }), g instanceof Promise ? g.then((h) => (this.update({ ...m, status: "done" }), h), p) : g;
    } catch (l) {
      return p(l);
    }
  }
  // Sends the call info to the manager and synchronizes the log.
  update(t) {
    this.channel?.emit(ne.CALL, t), this.setState(t.storyId, ({ calls: n }) => {
      let r = n.concat(t).reduce((o, s) => Object.assign(o, { [s.id]: s }), {});
      return {
        // Calls are sorted to ensure parent calls always come before calls in their callback.
        calls: Object.values(r).sort(
          (o, s) => o.id.localeCompare(s.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__ */ i(() => {
      let { isLocked: r, isPlaying: o } = this.getState(t), s = this.getLog(t), c = s.filter(({ ancestors: l }) => !l.length).find((l) => l.status === "waiting")?.callId, a = s.some((l) => l.status === "active");
      if (this.detached || r || a || s.length === 0) {
        let S = { controlStates: {
          detached: this.detached,
          start: !1,
          back: !1,
          goto: !1,
          next: !1,
          end: !1
        }, logItems: s };
        this.channel?.emit(ne.SYNC, S);
        return;
      }
      let u = s.some(
        (l) => l.status === "done" || l.status === "error"
      ), p = { controlStates: {
        detached: this.detached,
        start: u,
        back: u,
        goto: !0,
        next: o,
        end: o
      }, logItems: s, pausedAt: c };
      this.channel?.emit(ne.SYNC, p);
    }, "synchronize");
    this.setState(t, ({ syncTimeout: r }) => (clearTimeout(r), { syncTimeout: setTimeout(n, 0) }));
  }
};
function Gs(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 Nt()), (Z.window?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).instrument(e, t));
  } catch (n) {
    return zs.warn(n), e;
  }
}
i(Gs, "instrument");
function Hs(e, t) {
  let n = e;
  for (; n != null; ) {
    let r = Object.getOwnPropertyDescriptor(n, t);
    if (r)
      return r;
    n = Object.getPrototypeOf(n);
  }
}
i(Hs, "getPropertyDescriptor");
function Js(e) {
  if (typeof e != "function")
    return !1;
  let t = Object.getOwnPropertyDescriptor(e, "prototype");
  return t ? !t.writable : !1;
}
i(Js, "isClass");
export {
  ks as CallStates,
  ne as EVENTS,
  Gs as instrument
};
/*! Bundled license information:

@vitest/pretty-format/dist/index.js:
  (**
   * @license React
   * react-is.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

@vitest/pretty-format/dist/index.js:
  (**
   * @license React
   * react-is.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

@vitest/pretty-format/dist/index.js:
  (**
   * @license React
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

@vitest/pretty-format/dist/index.js:
  (**
   * @license React
   * react-is.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)
*/
