function $3(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Pf = { exports: {} }, Ai = {};
var V2;
function Lg() {
  if (V2) return Ai;
  V2 = 1;
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
  function r(l, s, u) {
    var c = null;
    if (u !== void 0 && (c = "" + u), s.key !== void 0 && (c = "" + s.key), "key" in s) {
      u = {};
      for (var h in s)
        h !== "key" && (u[h] = s[h]);
    } else u = s;
    return s = u.ref, {
      $$typeof: e,
      type: l,
      key: c,
      ref: s !== void 0 ? s : null,
      props: u
    };
  }
  return Ai.Fragment = n, Ai.jsx = r, Ai.jsxs = r, Ai;
}
var Y2;
function qg() {
  return Y2 || (Y2 = 1, Pf.exports = Lg()), Pf.exports;
}
var O = qg(), e1 = { exports: {} }, Ye = {};
var G2;
function Ug() {
  if (G2) return Ye;
  G2 = 1;
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), r = /* @__PURE__ */ Symbol.for("react.fragment"), l = /* @__PURE__ */ Symbol.for("react.strict_mode"), s = /* @__PURE__ */ Symbol.for("react.profiler"), u = /* @__PURE__ */ Symbol.for("react.consumer"), c = /* @__PURE__ */ Symbol.for("react.context"), h = /* @__PURE__ */ Symbol.for("react.forward_ref"), d = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.memo"), g = /* @__PURE__ */ Symbol.for("react.lazy"), y = /* @__PURE__ */ Symbol.for("react.activity"), x = Symbol.iterator;
  function w(k) {
    return k === null || typeof k != "object" ? null : (k = x && k[x] || k["@@iterator"], typeof k == "function" ? k : null);
  }
  var z = {
    isMounted: function() {
      return !1;
    },
    enqueueForceUpdate: function() {
    },
    enqueueReplaceState: function() {
    },
    enqueueSetState: function() {
    }
  }, M = Object.assign, A = {};
  function T(k, G, ae) {
    this.props = k, this.context = G, this.refs = A, this.updater = ae || z;
  }
  T.prototype.isReactComponent = {}, T.prototype.setState = function(k, G) {
    if (typeof k != "object" && typeof k != "function" && k != null)
      throw Error(
        "takes an object of state variables to update or a function which returns an object of state variables."
      );
    this.updater.enqueueSetState(this, k, G, "setState");
  }, T.prototype.forceUpdate = function(k) {
    this.updater.enqueueForceUpdate(this, k, "forceUpdate");
  };
  function R() {
  }
  R.prototype = T.prototype;
  function q(k, G, ae) {
    this.props = k, this.context = G, this.refs = A, this.updater = ae || z;
  }
  var H = q.prototype = new R();
  H.constructor = q, M(H, T.prototype), H.isPureReactComponent = !0;
  var $ = Array.isArray;
  function V() {
  }
  var Q = { H: null, A: null, T: null, S: null }, re = Object.prototype.hasOwnProperty;
  function te(k, G, ae) {
    var se = ae.ref;
    return {
      $$typeof: e,
      type: k,
      key: G,
      ref: se !== void 0 ? se : null,
      props: ae
    };
  }
  function ie(k, G) {
    return te(k.type, G, k.props);
  }
  function ue(k) {
    return typeof k == "object" && k !== null && k.$$typeof === e;
  }
  function de(k) {
    var G = { "=": "=0", ":": "=2" };
    return "$" + k.replace(/[=:]/g, function(ae) {
      return G[ae];
    });
  }
  var ge = /\/+/g;
  function _(k, G) {
    return typeof k == "object" && k !== null && k.key != null ? de("" + k.key) : G.toString(36);
  }
  function J(k) {
    switch (k.status) {
      case "fulfilled":
        return k.value;
      case "rejected":
        throw k.reason;
      default:
        switch (typeof k.status == "string" ? k.then(V, V) : (k.status = "pending", k.then(
          function(G) {
            k.status === "pending" && (k.status = "fulfilled", k.value = G);
          },
          function(G) {
            k.status === "pending" && (k.status = "rejected", k.reason = G);
          }
        )), k.status) {
          case "fulfilled":
            return k.value;
          case "rejected":
            throw k.reason;
        }
    }
    throw k;
  }
  function D(k, G, ae, se, xe) {
    var Te = typeof k;
    (Te === "undefined" || Te === "boolean") && (k = null);
    var Ae = !1;
    if (k === null) Ae = !0;
    else
      switch (Te) {
        case "bigint":
        case "string":
        case "number":
          Ae = !0;
          break;
        case "object":
          switch (k.$$typeof) {
            case e:
            case n:
              Ae = !0;
              break;
            case g:
              return Ae = k._init, D(
                Ae(k._payload),
                G,
                ae,
                se,
                xe
              );
          }
      }
    if (Ae)
      return xe = xe(k), Ae = se === "" ? "." + _(k, 0) : se, $(xe) ? (ae = "", Ae != null && (ae = Ae.replace(ge, "$&/") + "/"), D(xe, G, ae, "", function(Xe) {
        return Xe;
      })) : xe != null && (ue(xe) && (xe = ie(
        xe,
        ae + (xe.key == null || k && k.key === xe.key ? "" : ("" + xe.key).replace(
          ge,
          "$&/"
        ) + "/") + Ae
      )), G.push(xe)), 1;
    Ae = 0;
    var Re = se === "" ? "." : se + ":";
    if ($(k))
      for (var Be = 0; Be < k.length; Be++)
        se = k[Be], Te = Re + _(se, Be), Ae += D(
          se,
          G,
          ae,
          Te,
          xe
        );
    else if (Be = w(k), typeof Be == "function")
      for (k = Be.call(k), Be = 0; !(se = k.next()).done; )
        se = se.value, Te = Re + _(se, Be++), Ae += D(
          se,
          G,
          ae,
          Te,
          xe
        );
    else if (Te === "object") {
      if (typeof k.then == "function")
        return D(
          J(k),
          G,
          ae,
          se,
          xe
        );
      throw G = String(k), Error(
        "Objects are not valid as a React child (found: " + (G === "[object Object]" ? "object with keys {" + Object.keys(k).join(", ") + "}" : G) + "). If you meant to render a collection of children, use an array instead."
      );
    }
    return Ae;
  }
  function Y(k, G, ae) {
    if (k == null) return k;
    var se = [], xe = 0;
    return D(k, se, "", "", function(Te) {
      return G.call(ae, Te, xe++);
    }), se;
  }
  function I(k) {
    if (k._status === -1) {
      var G = k._result;
      G = G(), G.then(
        function(ae) {
          (k._status === 0 || k._status === -1) && (k._status = 1, k._result = ae);
        },
        function(ae) {
          (k._status === 0 || k._status === -1) && (k._status = 2, k._result = ae);
        }
      ), k._status === -1 && (k._status = 0, k._result = G);
    }
    if (k._status === 1) return k._result.default;
    throw k._result;
  }
  var F = typeof reportError == "function" ? reportError : function(k) {
    if (typeof window == "object" && typeof window.ErrorEvent == "function") {
      var G = new window.ErrorEvent("error", {
        bubbles: !0,
        cancelable: !0,
        message: typeof k == "object" && k !== null && typeof k.message == "string" ? String(k.message) : String(k),
        error: k
      });
      if (!window.dispatchEvent(G)) return;
    } else if (typeof process == "object" && typeof process.emit == "function") {
      process.emit("uncaughtException", k);
      return;
    }
    console.error(k);
  }, le = {
    map: Y,
    forEach: function(k, G, ae) {
      Y(
        k,
        function() {
          G.apply(this, arguments);
        },
        ae
      );
    },
    count: function(k) {
      var G = 0;
      return Y(k, function() {
        G++;
      }), G;
    },
    toArray: function(k) {
      return Y(k, function(G) {
        return G;
      }) || [];
    },
    only: function(k) {
      if (!ue(k))
        throw Error(
          "React.Children.only expected to receive a single React element child."
        );
      return k;
    }
  };
  return Ye.Activity = y, Ye.Children = le, Ye.Component = T, Ye.Fragment = r, Ye.Profiler = s, Ye.PureComponent = q, Ye.StrictMode = l, Ye.Suspense = d, Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Q, Ye.__COMPILER_RUNTIME = {
    __proto__: null,
    c: function(k) {
      return Q.H.useMemoCache(k);
    }
  }, Ye.cache = function(k) {
    return function() {
      return k.apply(null, arguments);
    };
  }, Ye.cacheSignal = function() {
    return null;
  }, Ye.cloneElement = function(k, G, ae) {
    if (k == null)
      throw Error(
        "The argument must be a React element, but you passed " + k + "."
      );
    var se = M({}, k.props), xe = k.key;
    if (G != null)
      for (Te in G.key !== void 0 && (xe = "" + G.key), G)
        !re.call(G, Te) || Te === "key" || Te === "__self" || Te === "__source" || Te === "ref" && G.ref === void 0 || (se[Te] = G[Te]);
    var Te = arguments.length - 2;
    if (Te === 1) se.children = ae;
    else if (1 < Te) {
      for (var Ae = Array(Te), Re = 0; Re < Te; Re++)
        Ae[Re] = arguments[Re + 2];
      se.children = Ae;
    }
    return te(k.type, xe, se);
  }, Ye.createContext = function(k) {
    return k = {
      $$typeof: c,
      _currentValue: k,
      _currentValue2: k,
      _threadCount: 0,
      Provider: null,
      Consumer: null
    }, k.Provider = k, k.Consumer = {
      $$typeof: u,
      _context: k
    }, k;
  }, Ye.createElement = function(k, G, ae) {
    var se, xe = {}, Te = null;
    if (G != null)
      for (se in G.key !== void 0 && (Te = "" + G.key), G)
        re.call(G, se) && se !== "key" && se !== "__self" && se !== "__source" && (xe[se] = G[se]);
    var Ae = arguments.length - 2;
    if (Ae === 1) xe.children = ae;
    else if (1 < Ae) {
      for (var Re = Array(Ae), Be = 0; Be < Ae; Be++)
        Re[Be] = arguments[Be + 2];
      xe.children = Re;
    }
    if (k && k.defaultProps)
      for (se in Ae = k.defaultProps, Ae)
        xe[se] === void 0 && (xe[se] = Ae[se]);
    return te(k, Te, xe);
  }, Ye.createRef = function() {
    return { current: null };
  }, Ye.forwardRef = function(k) {
    return { $$typeof: h, render: k };
  }, Ye.isValidElement = ue, Ye.lazy = function(k) {
    return {
      $$typeof: g,
      _payload: { _status: -1, _result: k },
      _init: I
    };
  }, Ye.memo = function(k, G) {
    return {
      $$typeof: p,
      type: k,
      compare: G === void 0 ? null : G
    };
  }, Ye.startTransition = function(k) {
    var G = Q.T, ae = {};
    Q.T = ae;
    try {
      var se = k(), xe = Q.S;
      xe !== null && xe(ae, se), typeof se == "object" && se !== null && typeof se.then == "function" && se.then(V, F);
    } catch (Te) {
      F(Te);
    } finally {
      G !== null && ae.types !== null && (G.types = ae.types), Q.T = G;
    }
  }, Ye.unstable_useCacheRefresh = function() {
    return Q.H.useCacheRefresh();
  }, Ye.use = function(k) {
    return Q.H.use(k);
  }, Ye.useActionState = function(k, G, ae) {
    return Q.H.useActionState(k, G, ae);
  }, Ye.useCallback = function(k, G) {
    return Q.H.useCallback(k, G);
  }, Ye.useContext = function(k) {
    return Q.H.useContext(k);
  }, Ye.useDebugValue = function() {
  }, Ye.useDeferredValue = function(k, G) {
    return Q.H.useDeferredValue(k, G);
  }, Ye.useEffect = function(k, G) {
    return Q.H.useEffect(k, G);
  }, Ye.useEffectEvent = function(k) {
    return Q.H.useEffectEvent(k);
  }, Ye.useId = function() {
    return Q.H.useId();
  }, Ye.useImperativeHandle = function(k, G, ae) {
    return Q.H.useImperativeHandle(k, G, ae);
  }, Ye.useInsertionEffect = function(k, G) {
    return Q.H.useInsertionEffect(k, G);
  }, Ye.useLayoutEffect = function(k, G) {
    return Q.H.useLayoutEffect(k, G);
  }, Ye.useMemo = function(k, G) {
    return Q.H.useMemo(k, G);
  }, Ye.useOptimistic = function(k, G) {
    return Q.H.useOptimistic(k, G);
  }, Ye.useReducer = function(k, G, ae) {
    return Q.H.useReducer(k, G, ae);
  }, Ye.useRef = function(k) {
    return Q.H.useRef(k);
  }, Ye.useState = function(k) {
    return Q.H.useState(k);
  }, Ye.useSyncExternalStore = function(k, G, ae) {
    return Q.H.useSyncExternalStore(
      k,
      G,
      ae
    );
  }, Ye.useTransition = function() {
    return Q.H.useTransition();
  }, Ye.version = "19.2.3", Ye;
}
var X2;
function Ki() {
  return X2 || (X2 = 1, e1.exports = Ug()), e1.exports;
}
var B = Ki();
const ce = /* @__PURE__ */ $3(B);
var t1 = { exports: {} }, Ci = {}, n1 = { exports: {} }, a1 = {};
var $2;
function jg() {
  return $2 || ($2 = 1, (function(e) {
    function n(D, Y) {
      var I = D.length;
      D.push(Y);
      e: for (; 0 < I; ) {
        var F = I - 1 >>> 1, le = D[F];
        if (0 < s(le, Y))
          D[F] = Y, D[I] = le, I = F;
        else break e;
      }
    }
    function r(D) {
      return D.length === 0 ? null : D[0];
    }
    function l(D) {
      if (D.length === 0) return null;
      var Y = D[0], I = D.pop();
      if (I !== Y) {
        D[0] = I;
        e: for (var F = 0, le = D.length, k = le >>> 1; F < k; ) {
          var G = 2 * (F + 1) - 1, ae = D[G], se = G + 1, xe = D[se];
          if (0 > s(ae, I))
            se < le && 0 > s(xe, ae) ? (D[F] = xe, D[se] = I, F = se) : (D[F] = ae, D[G] = I, F = G);
          else if (se < le && 0 > s(xe, I))
            D[F] = xe, D[se] = I, F = se;
          else break e;
        }
      }
      return Y;
    }
    function s(D, Y) {
      var I = D.sortIndex - Y.sortIndex;
      return I !== 0 ? I : D.id - Y.id;
    }
    if (e.unstable_now = void 0, typeof performance == "object" && typeof performance.now == "function") {
      var u = performance;
      e.unstable_now = function() {
        return u.now();
      };
    } else {
      var c = Date, h = c.now();
      e.unstable_now = function() {
        return c.now() - h;
      };
    }
    var d = [], p = [], g = 1, y = null, x = 3, w = !1, z = !1, M = !1, A = !1, T = typeof setTimeout == "function" ? setTimeout : null, R = typeof clearTimeout == "function" ? clearTimeout : null, q = typeof setImmediate < "u" ? setImmediate : null;
    function H(D) {
      for (var Y = r(p); Y !== null; ) {
        if (Y.callback === null) l(p);
        else if (Y.startTime <= D)
          l(p), Y.sortIndex = Y.expirationTime, n(d, Y);
        else break;
        Y = r(p);
      }
    }
    function $(D) {
      if (M = !1, H(D), !z)
        if (r(d) !== null)
          z = !0, V || (V = !0, de());
        else {
          var Y = r(p);
          Y !== null && J($, Y.startTime - D);
        }
    }
    var V = !1, Q = -1, re = 5, te = -1;
    function ie() {
      return A ? !0 : !(e.unstable_now() - te < re);
    }
    function ue() {
      if (A = !1, V) {
        var D = e.unstable_now();
        te = D;
        var Y = !0;
        try {
          e: {
            z = !1, M && (M = !1, R(Q), Q = -1), w = !0;
            var I = x;
            try {
              t: {
                for (H(D), y = r(d); y !== null && !(y.expirationTime > D && ie()); ) {
                  var F = y.callback;
                  if (typeof F == "function") {
                    y.callback = null, x = y.priorityLevel;
                    var le = F(
                      y.expirationTime <= D
                    );
                    if (D = e.unstable_now(), typeof le == "function") {
                      y.callback = le, H(D), Y = !0;
                      break t;
                    }
                    y === r(d) && l(d), H(D);
                  } else l(d);
                  y = r(d);
                }
                if (y !== null) Y = !0;
                else {
                  var k = r(p);
                  k !== null && J(
                    $,
                    k.startTime - D
                  ), Y = !1;
                }
              }
              break e;
            } finally {
              y = null, x = I, w = !1;
            }
            Y = void 0;
          }
        } finally {
          Y ? de() : V = !1;
        }
      }
    }
    var de;
    if (typeof q == "function")
      de = function() {
        q(ue);
      };
    else if (typeof MessageChannel < "u") {
      var ge = new MessageChannel(), _ = ge.port2;
      ge.port1.onmessage = ue, de = function() {
        _.postMessage(null);
      };
    } else
      de = function() {
        T(ue, 0);
      };
    function J(D, Y) {
      Q = T(function() {
        D(e.unstable_now());
      }, Y);
    }
    e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(D) {
      D.callback = null;
    }, e.unstable_forceFrameRate = function(D) {
      0 > D || 125 < D ? console.error(
        "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
      ) : re = 0 < D ? Math.floor(1e3 / D) : 5;
    }, e.unstable_getCurrentPriorityLevel = function() {
      return x;
    }, e.unstable_next = function(D) {
      switch (x) {
        case 1:
        case 2:
        case 3:
          var Y = 3;
          break;
        default:
          Y = x;
      }
      var I = x;
      x = Y;
      try {
        return D();
      } finally {
        x = I;
      }
    }, e.unstable_requestPaint = function() {
      A = !0;
    }, e.unstable_runWithPriority = function(D, Y) {
      switch (D) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          D = 3;
      }
      var I = x;
      x = D;
      try {
        return Y();
      } finally {
        x = I;
      }
    }, e.unstable_scheduleCallback = function(D, Y, I) {
      var F = e.unstable_now();
      switch (typeof I == "object" && I !== null ? (I = I.delay, I = typeof I == "number" && 0 < I ? F + I : F) : I = F, D) {
        case 1:
          var le = -1;
          break;
        case 2:
          le = 250;
          break;
        case 5:
          le = 1073741823;
          break;
        case 4:
          le = 1e4;
          break;
        default:
          le = 5e3;
      }
      return le = I + le, D = {
        id: g++,
        callback: Y,
        priorityLevel: D,
        startTime: I,
        expirationTime: le,
        sortIndex: -1
      }, I > F ? (D.sortIndex = I, n(p, D), r(d) === null && D === r(p) && (M ? (R(Q), Q = -1) : M = !0, J($, I - F))) : (D.sortIndex = le, n(d, D), z || w || (z = !0, V || (V = !0, de()))), D;
    }, e.unstable_shouldYield = ie, e.unstable_wrapCallback = function(D) {
      var Y = x;
      return function() {
        var I = x;
        x = Y;
        try {
          return D.apply(this, arguments);
        } finally {
          x = I;
        }
      };
    };
  })(a1)), a1;
}
var Z2;
function Vg() {
  return Z2 || (Z2 = 1, n1.exports = jg()), n1.exports;
}
var r1 = { exports: {} }, an = {};
var F2;
function Yg() {
  if (F2) return an;
  F2 = 1;
  var e = Ki();
  function n(d) {
    var p = "https://react.dev/errors/" + d;
    if (1 < arguments.length) {
      p += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var g = 2; g < arguments.length; g++)
        p += "&args[]=" + encodeURIComponent(arguments[g]);
    }
    return "Minified React error #" + d + "; visit " + p + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  function r() {
  }
  var l = {
    d: {
      f: r,
      r: function() {
        throw Error(n(522));
      },
      D: r,
      C: r,
      L: r,
      m: r,
      X: r,
      S: r,
      M: r
    },
    p: 0,
    findDOMNode: null
  }, s = /* @__PURE__ */ Symbol.for("react.portal");
  function u(d, p, g) {
    var y = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return {
      $$typeof: s,
      key: y == null ? null : "" + y,
      children: d,
      containerInfo: p,
      implementation: g
    };
  }
  var c = e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
  function h(d, p) {
    if (d === "font") return "";
    if (typeof p == "string")
      return p === "use-credentials" ? p : "";
  }
  return an.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = l, an.createPortal = function(d, p) {
    var g = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!p || p.nodeType !== 1 && p.nodeType !== 9 && p.nodeType !== 11)
      throw Error(n(299));
    return u(d, p, null, g);
  }, an.flushSync = function(d) {
    var p = c.T, g = l.p;
    try {
      if (c.T = null, l.p = 2, d) return d();
    } finally {
      c.T = p, l.p = g, l.d.f();
    }
  }, an.preconnect = function(d, p) {
    typeof d == "string" && (p ? (p = p.crossOrigin, p = typeof p == "string" ? p === "use-credentials" ? p : "" : void 0) : p = null, l.d.C(d, p));
  }, an.prefetchDNS = function(d) {
    typeof d == "string" && l.d.D(d);
  }, an.preinit = function(d, p) {
    if (typeof d == "string" && p && typeof p.as == "string") {
      var g = p.as, y = h(g, p.crossOrigin), x = typeof p.integrity == "string" ? p.integrity : void 0, w = typeof p.fetchPriority == "string" ? p.fetchPriority : void 0;
      g === "style" ? l.d.S(
        d,
        typeof p.precedence == "string" ? p.precedence : void 0,
        {
          crossOrigin: y,
          integrity: x,
          fetchPriority: w
        }
      ) : g === "script" && l.d.X(d, {
        crossOrigin: y,
        integrity: x,
        fetchPriority: w,
        nonce: typeof p.nonce == "string" ? p.nonce : void 0
      });
    }
  }, an.preinitModule = function(d, p) {
    if (typeof d == "string")
      if (typeof p == "object" && p !== null) {
        if (p.as == null || p.as === "script") {
          var g = h(
            p.as,
            p.crossOrigin
          );
          l.d.M(d, {
            crossOrigin: g,
            integrity: typeof p.integrity == "string" ? p.integrity : void 0,
            nonce: typeof p.nonce == "string" ? p.nonce : void 0
          });
        }
      } else p == null && l.d.M(d);
  }, an.preload = function(d, p) {
    if (typeof d == "string" && typeof p == "object" && p !== null && typeof p.as == "string") {
      var g = p.as, y = h(g, p.crossOrigin);
      l.d.L(d, g, {
        crossOrigin: y,
        integrity: typeof p.integrity == "string" ? p.integrity : void 0,
        nonce: typeof p.nonce == "string" ? p.nonce : void 0,
        type: typeof p.type == "string" ? p.type : void 0,
        fetchPriority: typeof p.fetchPriority == "string" ? p.fetchPriority : void 0,
        referrerPolicy: typeof p.referrerPolicy == "string" ? p.referrerPolicy : void 0,
        imageSrcSet: typeof p.imageSrcSet == "string" ? p.imageSrcSet : void 0,
        imageSizes: typeof p.imageSizes == "string" ? p.imageSizes : void 0,
        media: typeof p.media == "string" ? p.media : void 0
      });
    }
  }, an.preloadModule = function(d, p) {
    if (typeof d == "string")
      if (p) {
        var g = h(p.as, p.crossOrigin);
        l.d.m(d, {
          as: typeof p.as == "string" && p.as !== "script" ? p.as : void 0,
          crossOrigin: g,
          integrity: typeof p.integrity == "string" ? p.integrity : void 0
        });
      } else l.d.m(d);
  }, an.requestFormReset = function(d) {
    l.d.r(d);
  }, an.unstable_batchedUpdates = function(d, p) {
    return d(p);
  }, an.useFormState = function(d, p, g) {
    return c.H.useFormState(d, p, g);
  }, an.useFormStatus = function() {
    return c.H.useHostTransitionStatus();
  }, an.version = "19.2.3", an;
}
var I2;
function Z3() {
  if (I2) return r1.exports;
  I2 = 1;
  function e() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"))
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (n) {
        console.error(n);
      }
  }
  return e(), r1.exports = Yg(), r1.exports;
}
var K2;
function Gg() {
  if (K2) return Ci;
  K2 = 1;
  var e = Vg(), n = Ki(), r = Z3();
  function l(t) {
    var a = "https://react.dev/errors/" + t;
    if (1 < arguments.length) {
      a += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var i = 2; i < arguments.length; i++)
        a += "&args[]=" + encodeURIComponent(arguments[i]);
    }
    return "Minified React error #" + t + "; visit " + a + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  function s(t) {
    return !(!t || t.nodeType !== 1 && t.nodeType !== 9 && t.nodeType !== 11);
  }
  function u(t) {
    var a = t, i = t;
    if (t.alternate) for (; a.return; ) a = a.return;
    else {
      t = a;
      do
        a = t, (a.flags & 4098) !== 0 && (i = a.return), t = a.return;
      while (t);
    }
    return a.tag === 3 ? i : null;
  }
  function c(t) {
    if (t.tag === 13) {
      var a = t.memoizedState;
      if (a === null && (t = t.alternate, t !== null && (a = t.memoizedState)), a !== null) return a.dehydrated;
    }
    return null;
  }
  function h(t) {
    if (t.tag === 31) {
      var a = t.memoizedState;
      if (a === null && (t = t.alternate, t !== null && (a = t.memoizedState)), a !== null) return a.dehydrated;
    }
    return null;
  }
  function d(t) {
    if (u(t) !== t)
      throw Error(l(188));
  }
  function p(t) {
    var a = t.alternate;
    if (!a) {
      if (a = u(t), a === null) throw Error(l(188));
      return a !== t ? null : t;
    }
    for (var i = t, o = a; ; ) {
      var f = i.return;
      if (f === null) break;
      var m = f.alternate;
      if (m === null) {
        if (o = f.return, o !== null) {
          i = o;
          continue;
        }
        break;
      }
      if (f.child === m.child) {
        for (m = f.child; m; ) {
          if (m === i) return d(f), t;
          if (m === o) return d(f), a;
          m = m.sibling;
        }
        throw Error(l(188));
      }
      if (i.return !== o.return) i = f, o = m;
      else {
        for (var S = !1, C = f.child; C; ) {
          if (C === i) {
            S = !0, i = f, o = m;
            break;
          }
          if (C === o) {
            S = !0, o = f, i = m;
            break;
          }
          C = C.sibling;
        }
        if (!S) {
          for (C = m.child; C; ) {
            if (C === i) {
              S = !0, i = m, o = f;
              break;
            }
            if (C === o) {
              S = !0, o = m, i = f;
              break;
            }
            C = C.sibling;
          }
          if (!S) throw Error(l(189));
        }
      }
      if (i.alternate !== o) throw Error(l(190));
    }
    if (i.tag !== 3) throw Error(l(188));
    return i.stateNode.current === i ? t : a;
  }
  function g(t) {
    var a = t.tag;
    if (a === 5 || a === 26 || a === 27 || a === 6) return t;
    for (t = t.child; t !== null; ) {
      if (a = g(t), a !== null) return a;
      t = t.sibling;
    }
    return null;
  }
  var y = Object.assign, x = /* @__PURE__ */ Symbol.for("react.element"), w = /* @__PURE__ */ Symbol.for("react.transitional.element"), z = /* @__PURE__ */ Symbol.for("react.portal"), M = /* @__PURE__ */ Symbol.for("react.fragment"), A = /* @__PURE__ */ Symbol.for("react.strict_mode"), T = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), q = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), $ = /* @__PURE__ */ Symbol.for("react.suspense"), V = /* @__PURE__ */ Symbol.for("react.suspense_list"), Q = /* @__PURE__ */ Symbol.for("react.memo"), re = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), ie = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel"), ue = Symbol.iterator;
  function de(t) {
    return t === null || typeof t != "object" ? null : (t = ue && t[ue] || t["@@iterator"], typeof t == "function" ? t : null);
  }
  var ge = /* @__PURE__ */ Symbol.for("react.client.reference");
  function _(t) {
    if (t == null) return null;
    if (typeof t == "function")
      return t.$$typeof === ge ? null : t.displayName || t.name || null;
    if (typeof t == "string") return t;
    switch (t) {
      case M:
        return "Fragment";
      case T:
        return "Profiler";
      case A:
        return "StrictMode";
      case $:
        return "Suspense";
      case V:
        return "SuspenseList";
      case te:
        return "Activity";
    }
    if (typeof t == "object")
      switch (t.$$typeof) {
        case z:
          return "Portal";
        case q:
          return t.displayName || "Context";
        case R:
          return (t._context.displayName || "Context") + ".Consumer";
        case H:
          var a = t.render;
          return t = t.displayName, t || (t = a.displayName || a.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
        case Q:
          return a = t.displayName || null, a !== null ? a : _(t.type) || "Memo";
        case re:
          a = t._payload, t = t._init;
          try {
            return _(t(a));
          } catch {
          }
      }
    return null;
  }
  var J = Array.isArray, D = n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = {
    pending: !1,
    data: null,
    method: null,
    action: null
  }, F = [], le = -1;
  function k(t) {
    return { current: t };
  }
  function G(t) {
    0 > le || (t.current = F[le], F[le] = null, le--);
  }
  function ae(t, a) {
    le++, F[le] = t.current, t.current = a;
  }
  var se = k(null), xe = k(null), Te = k(null), Ae = k(null);
  function Re(t, a) {
    switch (ae(Te, a), ae(xe, t), ae(se, null), a.nodeType) {
      case 9:
      case 11:
        t = (t = a.documentElement) && (t = t.namespaceURI) ? c2(t) : 0;
        break;
      default:
        if (t = a.tagName, a = a.namespaceURI)
          a = c2(a), t = f2(a, t);
        else
          switch (t) {
            case "svg":
              t = 1;
              break;
            case "math":
              t = 2;
              break;
            default:
              t = 0;
          }
    }
    G(se), ae(se, t);
  }
  function Be() {
    G(se), G(xe), G(Te);
  }
  function Xe(t) {
    t.memoizedState !== null && ae(Ae, t);
    var a = se.current, i = f2(a, t.type);
    a !== i && (ae(xe, t), ae(se, i));
  }
  function lt(t) {
    xe.current === t && (G(se), G(xe)), Ae.current === t && (G(Ae), Ei._currentValue = I);
  }
  var St, be;
  function ye(t) {
    if (St === void 0)
      try {
        throw Error();
      } catch (i) {
        var a = i.stack.trim().match(/\n( *(at )?)/);
        St = a && a[1] || "", be = -1 < i.stack.indexOf(`
    at`) ? " (<anonymous>)" : -1 < i.stack.indexOf("@") ? "@unknown:0:0" : "";
      }
    return `
` + St + t + be;
  }
  var ze = !1;
  function _e(t, a) {
    if (!t || ze) return "";
    ze = !0;
    var i = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      var o = {
        DetermineComponentFrameRoot: function() {
          try {
            if (a) {
              var pe = function() {
                throw Error();
              };
              if (Object.defineProperty(pe.prototype, "props", {
                set: function() {
                  throw Error();
                }
              }), typeof Reflect == "object" && Reflect.construct) {
                try {
                  Reflect.construct(pe, []);
                } catch (oe) {
                  var ne = oe;
                }
                Reflect.construct(t, [], pe);
              } else {
                try {
                  pe.call();
                } catch (oe) {
                  ne = oe;
                }
                t.call(pe.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (oe) {
                ne = oe;
              }
              (pe = t()) && typeof pe.catch == "function" && pe.catch(function() {
              });
            }
          } catch (oe) {
            if (oe && ne && typeof oe.stack == "string")
              return [oe.stack, ne.stack];
          }
          return [null, null];
        }
      };
      o.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
      var f = Object.getOwnPropertyDescriptor(
        o.DetermineComponentFrameRoot,
        "name"
      );
      f && f.configurable && Object.defineProperty(
        o.DetermineComponentFrameRoot,
        "name",
        { value: "DetermineComponentFrameRoot" }
      );
      var m = o.DetermineComponentFrameRoot(), S = m[0], C = m[1];
      if (S && C) {
        var j = S.split(`
`), ee = C.split(`
`);
        for (f = o = 0; o < j.length && !j[o].includes("DetermineComponentFrameRoot"); )
          o++;
        for (; f < ee.length && !ee[f].includes(
          "DetermineComponentFrameRoot"
        ); )
          f++;
        if (o === j.length || f === ee.length)
          for (o = j.length - 1, f = ee.length - 1; 1 <= o && 0 <= f && j[o] !== ee[f]; )
            f--;
        for (; 1 <= o && 0 <= f; o--, f--)
          if (j[o] !== ee[f]) {
            if (o !== 1 || f !== 1)
              do
                if (o--, f--, 0 > f || j[o] !== ee[f]) {
                  var fe = `
` + j[o].replace(" at new ", " at ");
                  return t.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", t.displayName)), fe;
                }
              while (1 <= o && 0 <= f);
            break;
          }
      }
    } finally {
      ze = !1, Error.prepareStackTrace = i;
    }
    return (i = t ? t.displayName || t.name : "") ? ye(i) : "";
  }
  function je(t, a) {
    switch (t.tag) {
      case 26:
      case 27:
      case 5:
        return ye(t.type);
      case 16:
        return ye("Lazy");
      case 13:
        return t.child !== a && a !== null ? ye("Suspense Fallback") : ye("Suspense");
      case 19:
        return ye("SuspenseList");
      case 0:
      case 15:
        return _e(t.type, !1);
      case 11:
        return _e(t.type.render, !1);
      case 1:
        return _e(t.type, !0);
      case 31:
        return ye("Activity");
      default:
        return "";
    }
  }
  function Ee(t) {
    try {
      var a = "", i = null;
      do
        a += je(t, i), i = t, t = t.return;
      while (t);
      return a;
    } catch (o) {
      return `
Error generating stack: ` + o.message + `
` + o.stack;
    }
  }
  var Oe = Object.prototype.hasOwnProperty, ot = e.unstable_scheduleCallback, wt = e.unstable_cancelCallback, Vt = e.unstable_shouldYield, mn = e.unstable_requestPaint, We = e.unstable_now, Yt = e.unstable_getCurrentPriorityLevel, Zt = e.unstable_ImmediatePriority, tn = e.unstable_UserBlockingPriority, nn = e.unstable_NormalPriority, jn = e.unstable_LowPriority, o0 = e.unstable_IdlePriority, Ft = e.log, Vn = e.unstable_setDisableYieldValue, An = null, kt = null;
  function sn(t) {
    if (typeof Ft == "function" && Vn(t), kt && typeof kt.setStrictMode == "function")
      try {
        kt.setStrictMode(An, t);
      } catch {
      }
  }
  var vt = Math.clz32 ? Math.clz32 : Rl, Ca = Math.log, _l = Math.LN2;
  function Rl(t) {
    return t >>>= 0, t === 0 ? 32 : 31 - (Ca(t) / _l | 0) | 0;
  }
  var fa = 256, u0 = 262144, P0 = 4194304;
  function on(t) {
    var a = t & 42;
    if (a !== 0) return a;
    switch (t & -t) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
        return 64;
      case 128:
        return 128;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
        return t & 261888;
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return t & 3932160;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return t & 62914560;
      case 67108864:
        return 67108864;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 0;
      default:
        return t;
    }
  }
  function kr(t, a, i) {
    var o = t.pendingLanes;
    if (o === 0) return 0;
    var f = 0, m = t.suspendedLanes, S = t.pingedLanes;
    t = t.warmLanes;
    var C = o & 134217727;
    return C !== 0 ? (o = C & ~m, o !== 0 ? f = on(o) : (S &= C, S !== 0 ? f = on(S) : i || (i = C & ~t, i !== 0 && (f = on(i))))) : (C = o & ~m, C !== 0 ? f = on(C) : S !== 0 ? f = on(S) : i || (i = o & ~t, i !== 0 && (f = on(i)))), f === 0 ? 0 : a !== 0 && a !== f && (a & m) === 0 && (m = f & -f, i = a & -a, m >= i || m === 32 && (i & 4194048) !== 0) ? a : f;
  }
  function er(t, a) {
    return (t.pendingLanes & ~(t.suspendedLanes & ~t.pingedLanes) & a) === 0;
  }
  function ju(t, a) {
    switch (t) {
      case 1:
      case 2:
      case 4:
      case 8:
      case 64:
        return a + 250;
      case 16:
      case 32:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return a + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return -1;
      case 67108864:
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function ss() {
    var t = P0;
    return P0 <<= 1, (P0 & 62914560) === 0 && (P0 = 4194304), t;
  }
  function Bl(t) {
    for (var a = [], i = 0; 31 > i; i++) a.push(t);
    return a;
  }
  function tr(t, a) {
    t.pendingLanes |= a, a !== 268435456 && (t.suspendedLanes = 0, t.pingedLanes = 0, t.warmLanes = 0);
  }
  function Vu(t, a, i, o, f, m) {
    var S = t.pendingLanes;
    t.pendingLanes = i, t.suspendedLanes = 0, t.pingedLanes = 0, t.warmLanes = 0, t.expiredLanes &= i, t.entangledLanes &= i, t.errorRecoveryDisabledLanes &= i, t.shellSuspendCounter = 0;
    var C = t.entanglements, j = t.expirationTimes, ee = t.hiddenUpdates;
    for (i = S & ~i; 0 < i; ) {
      var fe = 31 - vt(i), pe = 1 << fe;
      C[fe] = 0, j[fe] = -1;
      var ne = ee[fe];
      if (ne !== null)
        for (ee[fe] = null, fe = 0; fe < ne.length; fe++) {
          var oe = ne[fe];
          oe !== null && (oe.lane &= -536870913);
        }
      i &= ~pe;
    }
    o !== 0 && os(t, o, 0), m !== 0 && f === 0 && t.tag !== 0 && (t.suspendedLanes |= m & ~(S & ~a));
  }
  function os(t, a, i) {
    t.pendingLanes |= a, t.suspendedLanes &= ~a;
    var o = 31 - vt(a);
    t.entangledLanes |= a, t.entanglements[o] = t.entanglements[o] | 1073741824 | i & 261930;
  }
  function us(t, a) {
    var i = t.entangledLanes |= a;
    for (t = t.entanglements; i; ) {
      var o = 31 - vt(i), f = 1 << o;
      f & a | t[o] & a && (t[o] |= a), i &= ~f;
    }
  }
  function cs(t, a) {
    var i = a & -a;
    return i = (i & 42) !== 0 ? 1 : Ol(i), (i & (t.suspendedLanes | a)) !== 0 ? 0 : i;
  }
  function Ol(t) {
    switch (t) {
      case 2:
        t = 1;
        break;
      case 8:
        t = 4;
        break;
      case 32:
        t = 16;
        break;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        t = 128;
        break;
      case 268435456:
        t = 134217728;
        break;
      default:
        t = 0;
    }
    return t;
  }
  function Hl(t) {
    return t &= -t, 2 < t ? 8 < t ? (t & 134217727) !== 0 ? 32 : 268435456 : 8 : 2;
  }
  function fs() {
    var t = Y.p;
    return t !== 0 ? t : (t = window.event, t === void 0 ? 32 : B2(t.type));
  }
  function hs(t, a) {
    var i = Y.p;
    try {
      return Y.p = t, a();
    } finally {
      Y.p = i;
    }
  }
  var ha = Math.random().toString(36).slice(2), Gt = "__reactFiber$" + ha, Qt = "__reactProps$" + ha, c0 = "__reactContainer$" + ha, Ll = "__reactEvents$" + ha, Yu = "__reactListeners$" + ha, Gu = "__reactHandles$" + ha, ds = "__reactResources$" + ha, nr = "__reactMarker$" + ha;
  function ql(t) {
    delete t[Gt], delete t[Qt], delete t[Ll], delete t[Yu], delete t[Gu];
  }
  function f0(t) {
    var a = t[Gt];
    if (a) return a;
    for (var i = t.parentNode; i; ) {
      if (a = i[c0] || i[Gt]) {
        if (i = a.alternate, a.child !== null || i !== null && i.child !== null)
          for (t = v2(t); t !== null; ) {
            if (i = t[Gt]) return i;
            t = v2(t);
          }
        return a;
      }
      t = i, i = t.parentNode;
    }
    return null;
  }
  function Na(t) {
    if (t = t[Gt] || t[c0]) {
      var a = t.tag;
      if (a === 5 || a === 6 || a === 13 || a === 31 || a === 26 || a === 27 || a === 3)
        return t;
    }
    return null;
  }
  function ar(t) {
    var a = t.tag;
    if (a === 5 || a === 26 || a === 27 || a === 6) return t.stateNode;
    throw Error(l(33));
  }
  function h0(t) {
    var a = t[ds];
    return a || (a = t[ds] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }), a;
  }
  function Bt(t) {
    t[nr] = !0;
  }
  var ms = /* @__PURE__ */ new Set(), ps = {};
  function ka(t, a) {
    Da(t, a), Da(t + "Capture", a);
  }
  function Da(t, a) {
    for (ps[t] = a, t = 0; t < a.length; t++)
      ms.add(a[t]);
  }
  var Xu = RegExp(
    "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
  ), gs = {}, ys = {};
  function Ul(t) {
    return Oe.call(ys, t) ? !0 : Oe.call(gs, t) ? !1 : Xu.test(t) ? ys[t] = !0 : (gs[t] = !0, !1);
  }
  function vs(t, a, i) {
    if (Ul(a))
      if (i === null) t.removeAttribute(a);
      else {
        switch (typeof i) {
          case "undefined":
          case "function":
          case "symbol":
            t.removeAttribute(a);
            return;
          case "boolean":
            var o = a.toLowerCase().slice(0, 5);
            if (o !== "data-" && o !== "aria-") {
              t.removeAttribute(a);
              return;
            }
        }
        t.setAttribute(a, "" + i);
      }
  }
  function xs(t, a, i) {
    if (i === null) t.removeAttribute(a);
    else {
      switch (typeof i) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          t.removeAttribute(a);
          return;
      }
      t.setAttribute(a, "" + i);
    }
  }
  function _a(t, a, i, o) {
    if (o === null) t.removeAttribute(i);
    else {
      switch (typeof o) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          t.removeAttribute(i);
          return;
      }
      t.setAttributeNS(a, i, "" + o);
    }
  }
  function Yn(t) {
    switch (typeof t) {
      case "bigint":
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return t;
      case "object":
        return t;
      default:
        return "";
    }
  }
  function nd(t) {
    var a = t.type;
    return (t = t.nodeName) && t.toLowerCase() === "input" && (a === "checkbox" || a === "radio");
  }
  function k7(t, a, i) {
    var o = Object.getOwnPropertyDescriptor(
      t.constructor.prototype,
      a
    );
    if (!t.hasOwnProperty(a) && typeof o < "u" && typeof o.get == "function" && typeof o.set == "function") {
      var f = o.get, m = o.set;
      return Object.defineProperty(t, a, {
        configurable: !0,
        get: function() {
          return f.call(this);
        },
        set: function(S) {
          i = "" + S, m.call(this, S);
        }
      }), Object.defineProperty(t, a, {
        enumerable: o.enumerable
      }), {
        getValue: function() {
          return i;
        },
        setValue: function(S) {
          i = "" + S;
        },
        stopTracking: function() {
          t._valueTracker = null, delete t[a];
        }
      };
    }
  }
  function $u(t) {
    if (!t._valueTracker) {
      var a = nd(t) ? "checked" : "value";
      t._valueTracker = k7(
        t,
        a,
        "" + t[a]
      );
    }
  }
  function ad(t) {
    if (!t) return !1;
    var a = t._valueTracker;
    if (!a) return !0;
    var i = a.getValue(), o = "";
    return t && (o = nd(t) ? t.checked ? "true" : "false" : t.value), t = o, t !== i ? (a.setValue(t), !0) : !1;
  }
  function bs(t) {
    if (t = t || (typeof document < "u" ? document : void 0), typeof t > "u") return null;
    try {
      return t.activeElement || t.body;
    } catch {
      return t.body;
    }
  }
  var D7 = /[\n"\\]/g;
  function Gn(t) {
    return t.replace(
      D7,
      function(a) {
        return "\\" + a.charCodeAt(0).toString(16) + " ";
      }
    );
  }
  function Zu(t, a, i, o, f, m, S, C) {
    t.name = "", S != null && typeof S != "function" && typeof S != "symbol" && typeof S != "boolean" ? t.type = S : t.removeAttribute("type"), a != null ? S === "number" ? (a === 0 && t.value === "" || t.value != a) && (t.value = "" + Yn(a)) : t.value !== "" + Yn(a) && (t.value = "" + Yn(a)) : S !== "submit" && S !== "reset" || t.removeAttribute("value"), a != null ? Fu(t, S, Yn(a)) : i != null ? Fu(t, S, Yn(i)) : o != null && t.removeAttribute("value"), f == null && m != null && (t.defaultChecked = !!m), f != null && (t.checked = f && typeof f != "function" && typeof f != "symbol"), C != null && typeof C != "function" && typeof C != "symbol" && typeof C != "boolean" ? t.name = "" + Yn(C) : t.removeAttribute("name");
  }
  function rd(t, a, i, o, f, m, S, C) {
    if (m != null && typeof m != "function" && typeof m != "symbol" && typeof m != "boolean" && (t.type = m), a != null || i != null) {
      if (!(m !== "submit" && m !== "reset" || a != null)) {
        $u(t);
        return;
      }
      i = i != null ? "" + Yn(i) : "", a = a != null ? "" + Yn(a) : i, C || a === t.value || (t.value = a), t.defaultValue = a;
    }
    o = o ?? f, o = typeof o != "function" && typeof o != "symbol" && !!o, t.checked = C ? t.checked : !!o, t.defaultChecked = !!o, S != null && typeof S != "function" && typeof S != "symbol" && typeof S != "boolean" && (t.name = S), $u(t);
  }
  function Fu(t, a, i) {
    a === "number" && bs(t.ownerDocument) === t || t.defaultValue === "" + i || (t.defaultValue = "" + i);
  }
  function Dr(t, a, i, o) {
    if (t = t.options, a) {
      a = {};
      for (var f = 0; f < i.length; f++)
        a["$" + i[f]] = !0;
      for (i = 0; i < t.length; i++)
        f = a.hasOwnProperty("$" + t[i].value), t[i].selected !== f && (t[i].selected = f), f && o && (t[i].defaultSelected = !0);
    } else {
      for (i = "" + Yn(i), a = null, f = 0; f < t.length; f++) {
        if (t[f].value === i) {
          t[f].selected = !0, o && (t[f].defaultSelected = !0);
          return;
        }
        a !== null || t[f].disabled || (a = t[f]);
      }
      a !== null && (a.selected = !0);
    }
  }
  function ld(t, a, i) {
    if (a != null && (a = "" + Yn(a), a !== t.value && (t.value = a), i == null)) {
      t.defaultValue !== a && (t.defaultValue = a);
      return;
    }
    t.defaultValue = i != null ? "" + Yn(i) : "";
  }
  function id(t, a, i, o) {
    if (a == null) {
      if (o != null) {
        if (i != null) throw Error(l(92));
        if (J(o)) {
          if (1 < o.length) throw Error(l(93));
          o = o[0];
        }
        i = o;
      }
      i == null && (i = ""), a = i;
    }
    i = Yn(a), t.defaultValue = i, o = t.textContent, o === i && o !== "" && o !== null && (t.value = o), $u(t);
  }
  function _r(t, a) {
    if (a) {
      var i = t.firstChild;
      if (i && i === t.lastChild && i.nodeType === 3) {
        i.nodeValue = a;
        return;
      }
    }
    t.textContent = a;
  }
  var _7 = new Set(
    "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
      " "
    )
  );
  function sd(t, a, i) {
    var o = a.indexOf("--") === 0;
    i == null || typeof i == "boolean" || i === "" ? o ? t.setProperty(a, "") : a === "float" ? t.cssFloat = "" : t[a] = "" : o ? t.setProperty(a, i) : typeof i != "number" || i === 0 || _7.has(a) ? a === "float" ? t.cssFloat = i : t[a] = ("" + i).trim() : t[a] = i + "px";
  }
  function od(t, a, i) {
    if (a != null && typeof a != "object")
      throw Error(l(62));
    if (t = t.style, i != null) {
      for (var o in i)
        !i.hasOwnProperty(o) || a != null && a.hasOwnProperty(o) || (o.indexOf("--") === 0 ? t.setProperty(o, "") : o === "float" ? t.cssFloat = "" : t[o] = "");
      for (var f in a)
        o = a[f], a.hasOwnProperty(f) && i[f] !== o && sd(t, f, o);
    } else
      for (var m in a)
        a.hasOwnProperty(m) && sd(t, m, a[m]);
  }
  function Iu(t) {
    if (t.indexOf("-") === -1) return !1;
    switch (t) {
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return !1;
      default:
        return !0;
    }
  }
  var R7 = /* @__PURE__ */ new Map([
    ["acceptCharset", "accept-charset"],
    ["htmlFor", "for"],
    ["httpEquiv", "http-equiv"],
    ["crossOrigin", "crossorigin"],
    ["accentHeight", "accent-height"],
    ["alignmentBaseline", "alignment-baseline"],
    ["arabicForm", "arabic-form"],
    ["baselineShift", "baseline-shift"],
    ["capHeight", "cap-height"],
    ["clipPath", "clip-path"],
    ["clipRule", "clip-rule"],
    ["colorInterpolation", "color-interpolation"],
    ["colorInterpolationFilters", "color-interpolation-filters"],
    ["colorProfile", "color-profile"],
    ["colorRendering", "color-rendering"],
    ["dominantBaseline", "dominant-baseline"],
    ["enableBackground", "enable-background"],
    ["fillOpacity", "fill-opacity"],
    ["fillRule", "fill-rule"],
    ["floodColor", "flood-color"],
    ["floodOpacity", "flood-opacity"],
    ["fontFamily", "font-family"],
    ["fontSize", "font-size"],
    ["fontSizeAdjust", "font-size-adjust"],
    ["fontStretch", "font-stretch"],
    ["fontStyle", "font-style"],
    ["fontVariant", "font-variant"],
    ["fontWeight", "font-weight"],
    ["glyphName", "glyph-name"],
    ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
    ["glyphOrientationVertical", "glyph-orientation-vertical"],
    ["horizAdvX", "horiz-adv-x"],
    ["horizOriginX", "horiz-origin-x"],
    ["imageRendering", "image-rendering"],
    ["letterSpacing", "letter-spacing"],
    ["lightingColor", "lighting-color"],
    ["markerEnd", "marker-end"],
    ["markerMid", "marker-mid"],
    ["markerStart", "marker-start"],
    ["overlinePosition", "overline-position"],
    ["overlineThickness", "overline-thickness"],
    ["paintOrder", "paint-order"],
    ["panose-1", "panose-1"],
    ["pointerEvents", "pointer-events"],
    ["renderingIntent", "rendering-intent"],
    ["shapeRendering", "shape-rendering"],
    ["stopColor", "stop-color"],
    ["stopOpacity", "stop-opacity"],
    ["strikethroughPosition", "strikethrough-position"],
    ["strikethroughThickness", "strikethrough-thickness"],
    ["strokeDasharray", "stroke-dasharray"],
    ["strokeDashoffset", "stroke-dashoffset"],
    ["strokeLinecap", "stroke-linecap"],
    ["strokeLinejoin", "stroke-linejoin"],
    ["strokeMiterlimit", "stroke-miterlimit"],
    ["strokeOpacity", "stroke-opacity"],
    ["strokeWidth", "stroke-width"],
    ["textAnchor", "text-anchor"],
    ["textDecoration", "text-decoration"],
    ["textRendering", "text-rendering"],
    ["transformOrigin", "transform-origin"],
    ["underlinePosition", "underline-position"],
    ["underlineThickness", "underline-thickness"],
    ["unicodeBidi", "unicode-bidi"],
    ["unicodeRange", "unicode-range"],
    ["unitsPerEm", "units-per-em"],
    ["vAlphabetic", "v-alphabetic"],
    ["vHanging", "v-hanging"],
    ["vIdeographic", "v-ideographic"],
    ["vMathematical", "v-mathematical"],
    ["vectorEffect", "vector-effect"],
    ["vertAdvY", "vert-adv-y"],
    ["vertOriginX", "vert-origin-x"],
    ["vertOriginY", "vert-origin-y"],
    ["wordSpacing", "word-spacing"],
    ["writingMode", "writing-mode"],
    ["xmlnsXlink", "xmlns:xlink"],
    ["xHeight", "x-height"]
  ]), B7 = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
  function Ss(t) {
    return B7.test("" + t) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : t;
  }
  function Ra() {
  }
  var Ku = null;
  function Qu(t) {
    return t = t.target || t.srcElement || window, t.correspondingUseElement && (t = t.correspondingUseElement), t.nodeType === 3 ? t.parentNode : t;
  }
  var Rr = null, Br = null;
  function ud(t) {
    var a = Na(t);
    if (a && (t = a.stateNode)) {
      var i = t[Qt] || null;
      e: switch (t = a.stateNode, a.type) {
        case "input":
          if (Zu(
            t,
            i.value,
            i.defaultValue,
            i.defaultValue,
            i.checked,
            i.defaultChecked,
            i.type,
            i.name
          ), a = i.name, i.type === "radio" && a != null) {
            for (i = t; i.parentNode; ) i = i.parentNode;
            for (i = i.querySelectorAll(
              'input[name="' + Gn(
                "" + a
              ) + '"][type="radio"]'
            ), a = 0; a < i.length; a++) {
              var o = i[a];
              if (o !== t && o.form === t.form) {
                var f = o[Qt] || null;
                if (!f) throw Error(l(90));
                Zu(
                  o,
                  f.value,
                  f.defaultValue,
                  f.defaultValue,
                  f.checked,
                  f.defaultChecked,
                  f.type,
                  f.name
                );
              }
            }
            for (a = 0; a < i.length; a++)
              o = i[a], o.form === t.form && ad(o);
          }
          break e;
        case "textarea":
          ld(t, i.value, i.defaultValue);
          break e;
        case "select":
          a = i.value, a != null && Dr(t, !!i.multiple, a, !1);
      }
    }
  }
  var Ju = !1;
  function cd(t, a, i) {
    if (Ju) return t(a, i);
    Ju = !0;
    try {
      var o = t(a);
      return o;
    } finally {
      if (Ju = !1, (Rr !== null || Br !== null) && (oo(), Rr && (a = Rr, t = Br, Br = Rr = null, ud(a), t)))
        for (a = 0; a < t.length; a++) ud(t[a]);
    }
  }
  function jl(t, a) {
    var i = t.stateNode;
    if (i === null) return null;
    var o = i[Qt] || null;
    if (o === null) return null;
    i = o[a];
    e: switch (a) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (o = !o.disabled) || (t = t.type, o = !(t === "button" || t === "input" || t === "select" || t === "textarea")), t = !o;
        break e;
      default:
        t = !1;
    }
    if (t) return null;
    if (i && typeof i != "function")
      throw Error(
        l(231, a, typeof i)
      );
    return i;
  }
  var Ba = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), Wu = !1;
  if (Ba)
    try {
      var Vl = {};
      Object.defineProperty(Vl, "passive", {
        get: function() {
          Wu = !0;
        }
      }), window.addEventListener("test", Vl, Vl), window.removeEventListener("test", Vl, Vl);
    } catch {
      Wu = !1;
    }
  var d0 = null, Pu = null, ws = null;
  function fd() {
    if (ws) return ws;
    var t, a = Pu, i = a.length, o, f = "value" in d0 ? d0.value : d0.textContent, m = f.length;
    for (t = 0; t < i && a[t] === f[t]; t++) ;
    var S = i - t;
    for (o = 1; o <= S && a[i - o] === f[m - o]; o++) ;
    return ws = f.slice(t, 1 < o ? 1 - o : void 0);
  }
  function Es(t) {
    var a = t.keyCode;
    return "charCode" in t ? (t = t.charCode, t === 0 && a === 13 && (t = 13)) : t = a, t === 10 && (t = 13), 32 <= t || t === 13 ? t : 0;
  }
  function Ms() {
    return !0;
  }
  function hd() {
    return !1;
  }
  function pn(t) {
    function a(i, o, f, m, S) {
      this._reactName = i, this._targetInst = f, this.type = o, this.nativeEvent = m, this.target = S, this.currentTarget = null;
      for (var C in t)
        t.hasOwnProperty(C) && (i = t[C], this[C] = i ? i(m) : m[C]);
      return this.isDefaultPrevented = (m.defaultPrevented != null ? m.defaultPrevented : m.returnValue === !1) ? Ms : hd, this.isPropagationStopped = hd, this;
    }
    return y(a.prototype, {
      preventDefault: function() {
        this.defaultPrevented = !0;
        var i = this.nativeEvent;
        i && (i.preventDefault ? i.preventDefault() : typeof i.returnValue != "unknown" && (i.returnValue = !1), this.isDefaultPrevented = Ms);
      },
      stopPropagation: function() {
        var i = this.nativeEvent;
        i && (i.stopPropagation ? i.stopPropagation() : typeof i.cancelBubble != "unknown" && (i.cancelBubble = !0), this.isPropagationStopped = Ms);
      },
      persist: function() {
      },
      isPersistent: Ms
    }), a;
  }
  var rr = {
    eventPhase: 0,
    bubbles: 0,
    cancelable: 0,
    timeStamp: function(t) {
      return t.timeStamp || Date.now();
    },
    defaultPrevented: 0,
    isTrusted: 0
  }, Ts = pn(rr), Yl = y({}, rr, { view: 0, detail: 0 }), O7 = pn(Yl), ec, tc, Gl, zs = y({}, Yl, {
    screenX: 0,
    screenY: 0,
    clientX: 0,
    clientY: 0,
    pageX: 0,
    pageY: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    getModifierState: ac,
    button: 0,
    buttons: 0,
    relatedTarget: function(t) {
      return t.relatedTarget === void 0 ? t.fromElement === t.srcElement ? t.toElement : t.fromElement : t.relatedTarget;
    },
    movementX: function(t) {
      return "movementX" in t ? t.movementX : (t !== Gl && (Gl && t.type === "mousemove" ? (ec = t.screenX - Gl.screenX, tc = t.screenY - Gl.screenY) : tc = ec = 0, Gl = t), ec);
    },
    movementY: function(t) {
      return "movementY" in t ? t.movementY : tc;
    }
  }), dd = pn(zs), H7 = y({}, zs, { dataTransfer: 0 }), L7 = pn(H7), q7 = y({}, Yl, { relatedTarget: 0 }), nc = pn(q7), U7 = y({}, rr, {
    animationName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), j7 = pn(U7), V7 = y({}, rr, {
    clipboardData: function(t) {
      return "clipboardData" in t ? t.clipboardData : window.clipboardData;
    }
  }), Y7 = pn(V7), G7 = y({}, rr, { data: 0 }), md = pn(G7), X7 = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, $7 = {
    8: "Backspace",
    9: "Tab",
    12: "Clear",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    45: "Insert",
    46: "Delete",
    112: "F1",
    113: "F2",
    114: "F3",
    115: "F4",
    116: "F5",
    117: "F6",
    118: "F7",
    119: "F8",
    120: "F9",
    121: "F10",
    122: "F11",
    123: "F12",
    144: "NumLock",
    145: "ScrollLock",
    224: "Meta"
  }, Z7 = {
    Alt: "altKey",
    Control: "ctrlKey",
    Meta: "metaKey",
    Shift: "shiftKey"
  };
  function F7(t) {
    var a = this.nativeEvent;
    return a.getModifierState ? a.getModifierState(t) : (t = Z7[t]) ? !!a[t] : !1;
  }
  function ac() {
    return F7;
  }
  var I7 = y({}, Yl, {
    key: function(t) {
      if (t.key) {
        var a = X7[t.key] || t.key;
        if (a !== "Unidentified") return a;
      }
      return t.type === "keypress" ? (t = Es(t), t === 13 ? "Enter" : String.fromCharCode(t)) : t.type === "keydown" || t.type === "keyup" ? $7[t.keyCode] || "Unidentified" : "";
    },
    code: 0,
    location: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    repeat: 0,
    locale: 0,
    getModifierState: ac,
    charCode: function(t) {
      return t.type === "keypress" ? Es(t) : 0;
    },
    keyCode: function(t) {
      return t.type === "keydown" || t.type === "keyup" ? t.keyCode : 0;
    },
    which: function(t) {
      return t.type === "keypress" ? Es(t) : t.type === "keydown" || t.type === "keyup" ? t.keyCode : 0;
    }
  }), K7 = pn(I7), Q7 = y({}, zs, {
    pointerId: 0,
    width: 0,
    height: 0,
    pressure: 0,
    tangentialPressure: 0,
    tiltX: 0,
    tiltY: 0,
    twist: 0,
    pointerType: 0,
    isPrimary: 0
  }), pd = pn(Q7), J7 = y({}, Yl, {
    touches: 0,
    targetTouches: 0,
    changedTouches: 0,
    altKey: 0,
    metaKey: 0,
    ctrlKey: 0,
    shiftKey: 0,
    getModifierState: ac
  }), W7 = pn(J7), P7 = y({}, rr, {
    propertyName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), e8 = pn(P7), t8 = y({}, zs, {
    deltaX: function(t) {
      return "deltaX" in t ? t.deltaX : "wheelDeltaX" in t ? -t.wheelDeltaX : 0;
    },
    deltaY: function(t) {
      return "deltaY" in t ? t.deltaY : "wheelDeltaY" in t ? -t.wheelDeltaY : "wheelDelta" in t ? -t.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), n8 = pn(t8), a8 = y({}, rr, {
    newState: 0,
    oldState: 0
  }), r8 = pn(a8), l8 = [9, 13, 27, 32], rc = Ba && "CompositionEvent" in window, Xl = null;
  Ba && "documentMode" in document && (Xl = document.documentMode);
  var i8 = Ba && "TextEvent" in window && !Xl, gd = Ba && (!rc || Xl && 8 < Xl && 11 >= Xl), yd = " ", vd = !1;
  function xd(t, a) {
    switch (t) {
      case "keyup":
        return l8.indexOf(a.keyCode) !== -1;
      case "keydown":
        return a.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function bd(t) {
    return t = t.detail, typeof t == "object" && "data" in t ? t.data : null;
  }
  var Or = !1;
  function s8(t, a) {
    switch (t) {
      case "compositionend":
        return bd(a);
      case "keypress":
        return a.which !== 32 ? null : (vd = !0, yd);
      case "textInput":
        return t = a.data, t === yd && vd ? null : t;
      default:
        return null;
    }
  }
  function o8(t, a) {
    if (Or)
      return t === "compositionend" || !rc && xd(t, a) ? (t = fd(), ws = Pu = d0 = null, Or = !1, t) : null;
    switch (t) {
      case "paste":
        return null;
      case "keypress":
        if (!(a.ctrlKey || a.altKey || a.metaKey) || a.ctrlKey && a.altKey) {
          if (a.char && 1 < a.char.length)
            return a.char;
          if (a.which) return String.fromCharCode(a.which);
        }
        return null;
      case "compositionend":
        return gd && a.locale !== "ko" ? null : a.data;
      default:
        return null;
    }
  }
  var u8 = {
    color: !0,
    date: !0,
    datetime: !0,
    "datetime-local": !0,
    email: !0,
    month: !0,
    number: !0,
    password: !0,
    range: !0,
    search: !0,
    tel: !0,
    text: !0,
    time: !0,
    url: !0,
    week: !0
  };
  function Sd(t) {
    var a = t && t.nodeName && t.nodeName.toLowerCase();
    return a === "input" ? !!u8[t.type] : a === "textarea";
  }
  function wd(t, a, i, o) {
    Rr ? Br ? Br.push(o) : Br = [o] : Rr = o, a = go(a, "onChange"), 0 < a.length && (i = new Ts(
      "onChange",
      "change",
      null,
      i,
      o
    ), t.push({ event: i, listeners: a }));
  }
  var $l = null, Zl = null;
  function c8(t) {
    r2(t, 0);
  }
  function As(t) {
    var a = ar(t);
    if (ad(a)) return t;
  }
  function Ed(t, a) {
    if (t === "change") return a;
  }
  var Md = !1;
  if (Ba) {
    var lc;
    if (Ba) {
      var ic = "oninput" in document;
      if (!ic) {
        var Td = document.createElement("div");
        Td.setAttribute("oninput", "return;"), ic = typeof Td.oninput == "function";
      }
      lc = ic;
    } else lc = !1;
    Md = lc && (!document.documentMode || 9 < document.documentMode);
  }
  function zd() {
    $l && ($l.detachEvent("onpropertychange", Ad), Zl = $l = null);
  }
  function Ad(t) {
    if (t.propertyName === "value" && As(Zl)) {
      var a = [];
      wd(
        a,
        Zl,
        t,
        Qu(t)
      ), cd(c8, a);
    }
  }
  function f8(t, a, i) {
    t === "focusin" ? (zd(), $l = a, Zl = i, $l.attachEvent("onpropertychange", Ad)) : t === "focusout" && zd();
  }
  function h8(t) {
    if (t === "selectionchange" || t === "keyup" || t === "keydown")
      return As(Zl);
  }
  function d8(t, a) {
    if (t === "click") return As(a);
  }
  function m8(t, a) {
    if (t === "input" || t === "change")
      return As(a);
  }
  function p8(t, a) {
    return t === a && (t !== 0 || 1 / t === 1 / a) || t !== t && a !== a;
  }
  var Cn = typeof Object.is == "function" ? Object.is : p8;
  function Fl(t, a) {
    if (Cn(t, a)) return !0;
    if (typeof t != "object" || t === null || typeof a != "object" || a === null)
      return !1;
    var i = Object.keys(t), o = Object.keys(a);
    if (i.length !== o.length) return !1;
    for (o = 0; o < i.length; o++) {
      var f = i[o];
      if (!Oe.call(a, f) || !Cn(t[f], a[f]))
        return !1;
    }
    return !0;
  }
  function Cd(t) {
    for (; t && t.firstChild; ) t = t.firstChild;
    return t;
  }
  function Nd(t, a) {
    var i = Cd(t);
    t = 0;
    for (var o; i; ) {
      if (i.nodeType === 3) {
        if (o = t + i.textContent.length, t <= a && o >= a)
          return { node: i, offset: a - t };
        t = o;
      }
      e: {
        for (; i; ) {
          if (i.nextSibling) {
            i = i.nextSibling;
            break e;
          }
          i = i.parentNode;
        }
        i = void 0;
      }
      i = Cd(i);
    }
  }
  function kd(t, a) {
    return t && a ? t === a ? !0 : t && t.nodeType === 3 ? !1 : a && a.nodeType === 3 ? kd(t, a.parentNode) : "contains" in t ? t.contains(a) : t.compareDocumentPosition ? !!(t.compareDocumentPosition(a) & 16) : !1 : !1;
  }
  function Dd(t) {
    t = t != null && t.ownerDocument != null && t.ownerDocument.defaultView != null ? t.ownerDocument.defaultView : window;
    for (var a = bs(t.document); a instanceof t.HTMLIFrameElement; ) {
      try {
        var i = typeof a.contentWindow.location.href == "string";
      } catch {
        i = !1;
      }
      if (i) t = a.contentWindow;
      else break;
      a = bs(t.document);
    }
    return a;
  }
  function sc(t) {
    var a = t && t.nodeName && t.nodeName.toLowerCase();
    return a && (a === "input" && (t.type === "text" || t.type === "search" || t.type === "tel" || t.type === "url" || t.type === "password") || a === "textarea" || t.contentEditable === "true");
  }
  var g8 = Ba && "documentMode" in document && 11 >= document.documentMode, Hr = null, oc = null, Il = null, uc = !1;
  function _d(t, a, i) {
    var o = i.window === i ? i.document : i.nodeType === 9 ? i : i.ownerDocument;
    uc || Hr == null || Hr !== bs(o) || (o = Hr, "selectionStart" in o && sc(o) ? o = { start: o.selectionStart, end: o.selectionEnd } : (o = (o.ownerDocument && o.ownerDocument.defaultView || window).getSelection(), o = {
      anchorNode: o.anchorNode,
      anchorOffset: o.anchorOffset,
      focusNode: o.focusNode,
      focusOffset: o.focusOffset
    }), Il && Fl(Il, o) || (Il = o, o = go(oc, "onSelect"), 0 < o.length && (a = new Ts(
      "onSelect",
      "select",
      null,
      a,
      i
    ), t.push({ event: a, listeners: o }), a.target = Hr)));
  }
  function lr(t, a) {
    var i = {};
    return i[t.toLowerCase()] = a.toLowerCase(), i["Webkit" + t] = "webkit" + a, i["Moz" + t] = "moz" + a, i;
  }
  var Lr = {
    animationend: lr("Animation", "AnimationEnd"),
    animationiteration: lr("Animation", "AnimationIteration"),
    animationstart: lr("Animation", "AnimationStart"),
    transitionrun: lr("Transition", "TransitionRun"),
    transitionstart: lr("Transition", "TransitionStart"),
    transitioncancel: lr("Transition", "TransitionCancel"),
    transitionend: lr("Transition", "TransitionEnd")
  }, cc = {}, Rd = {};
  Ba && (Rd = document.createElement("div").style, "AnimationEvent" in window || (delete Lr.animationend.animation, delete Lr.animationiteration.animation, delete Lr.animationstart.animation), "TransitionEvent" in window || delete Lr.transitionend.transition);
  function ir(t) {
    if (cc[t]) return cc[t];
    if (!Lr[t]) return t;
    var a = Lr[t], i;
    for (i in a)
      if (a.hasOwnProperty(i) && i in Rd)
        return cc[t] = a[i];
    return t;
  }
  var Bd = ir("animationend"), Od = ir("animationiteration"), Hd = ir("animationstart"), y8 = ir("transitionrun"), v8 = ir("transitionstart"), x8 = ir("transitioncancel"), Ld = ir("transitionend"), qd = /* @__PURE__ */ new Map(), fc = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
    " "
  );
  fc.push("scrollEnd");
  function aa(t, a) {
    qd.set(t, a), ka(a, [t]);
  }
  var Cs = typeof reportError == "function" ? reportError : function(t) {
    if (typeof window == "object" && typeof window.ErrorEvent == "function") {
      var a = new window.ErrorEvent("error", {
        bubbles: !0,
        cancelable: !0,
        message: typeof t == "object" && t !== null && typeof t.message == "string" ? String(t.message) : String(t),
        error: t
      });
      if (!window.dispatchEvent(a)) return;
    } else if (typeof process == "object" && typeof process.emit == "function") {
      process.emit("uncaughtException", t);
      return;
    }
    console.error(t);
  }, Xn = [], qr = 0, hc = 0;
  function Ns() {
    for (var t = qr, a = hc = qr = 0; a < t; ) {
      var i = Xn[a];
      Xn[a++] = null;
      var o = Xn[a];
      Xn[a++] = null;
      var f = Xn[a];
      Xn[a++] = null;
      var m = Xn[a];
      if (Xn[a++] = null, o !== null && f !== null) {
        var S = o.pending;
        S === null ? f.next = f : (f.next = S.next, S.next = f), o.pending = f;
      }
      m !== 0 && Ud(i, f, m);
    }
  }
  function ks(t, a, i, o) {
    Xn[qr++] = t, Xn[qr++] = a, Xn[qr++] = i, Xn[qr++] = o, hc |= o, t.lanes |= o, t = t.alternate, t !== null && (t.lanes |= o);
  }
  function dc(t, a, i, o) {
    return ks(t, a, i, o), Ds(t);
  }
  function sr(t, a) {
    return ks(t, null, null, a), Ds(t);
  }
  function Ud(t, a, i) {
    t.lanes |= i;
    var o = t.alternate;
    o !== null && (o.lanes |= i);
    for (var f = !1, m = t.return; m !== null; )
      m.childLanes |= i, o = m.alternate, o !== null && (o.childLanes |= i), m.tag === 22 && (t = m.stateNode, t === null || t._visibility & 1 || (f = !0)), t = m, m = m.return;
    return t.tag === 3 ? (m = t.stateNode, f && a !== null && (f = 31 - vt(i), t = m.hiddenUpdates, o = t[f], o === null ? t[f] = [a] : o.push(a), a.lane = i | 536870912), m) : null;
  }
  function Ds(t) {
    if (50 < gi)
      throw gi = 0, Ef = null, Error(l(185));
    for (var a = t.return; a !== null; )
      t = a, a = t.return;
    return t.tag === 3 ? t.stateNode : null;
  }
  var Ur = {};
  function b8(t, a, i, o) {
    this.tag = t, this.key = i, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.refCleanup = this.ref = null, this.pendingProps = a, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = o, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function Nn(t, a, i, o) {
    return new b8(t, a, i, o);
  }
  function mc(t) {
    return t = t.prototype, !(!t || !t.isReactComponent);
  }
  function Oa(t, a) {
    var i = t.alternate;
    return i === null ? (i = Nn(
      t.tag,
      a,
      t.key,
      t.mode
    ), i.elementType = t.elementType, i.type = t.type, i.stateNode = t.stateNode, i.alternate = t, t.alternate = i) : (i.pendingProps = a, i.type = t.type, i.flags = 0, i.subtreeFlags = 0, i.deletions = null), i.flags = t.flags & 65011712, i.childLanes = t.childLanes, i.lanes = t.lanes, i.child = t.child, i.memoizedProps = t.memoizedProps, i.memoizedState = t.memoizedState, i.updateQueue = t.updateQueue, a = t.dependencies, i.dependencies = a === null ? null : { lanes: a.lanes, firstContext: a.firstContext }, i.sibling = t.sibling, i.index = t.index, i.ref = t.ref, i.refCleanup = t.refCleanup, i;
  }
  function jd(t, a) {
    t.flags &= 65011714;
    var i = t.alternate;
    return i === null ? (t.childLanes = 0, t.lanes = a, t.child = null, t.subtreeFlags = 0, t.memoizedProps = null, t.memoizedState = null, t.updateQueue = null, t.dependencies = null, t.stateNode = null) : (t.childLanes = i.childLanes, t.lanes = i.lanes, t.child = i.child, t.subtreeFlags = 0, t.deletions = null, t.memoizedProps = i.memoizedProps, t.memoizedState = i.memoizedState, t.updateQueue = i.updateQueue, t.type = i.type, a = i.dependencies, t.dependencies = a === null ? null : {
      lanes: a.lanes,
      firstContext: a.firstContext
    }), t;
  }
  function _s(t, a, i, o, f, m) {
    var S = 0;
    if (o = t, typeof t == "function") mc(t) && (S = 1);
    else if (typeof t == "string")
      S = Tg(
        t,
        i,
        se.current
      ) ? 26 : t === "html" || t === "head" || t === "body" ? 27 : 5;
    else
      e: switch (t) {
        case te:
          return t = Nn(31, i, a, f), t.elementType = te, t.lanes = m, t;
        case M:
          return or(i.children, f, m, a);
        case A:
          S = 8, f |= 24;
          break;
        case T:
          return t = Nn(12, i, a, f | 2), t.elementType = T, t.lanes = m, t;
        case $:
          return t = Nn(13, i, a, f), t.elementType = $, t.lanes = m, t;
        case V:
          return t = Nn(19, i, a, f), t.elementType = V, t.lanes = m, t;
        default:
          if (typeof t == "object" && t !== null)
            switch (t.$$typeof) {
              case q:
                S = 10;
                break e;
              case R:
                S = 9;
                break e;
              case H:
                S = 11;
                break e;
              case Q:
                S = 14;
                break e;
              case re:
                S = 16, o = null;
                break e;
            }
          S = 29, i = Error(
            l(130, t === null ? "null" : typeof t, "")
          ), o = null;
      }
    return a = Nn(S, i, a, f), a.elementType = t, a.type = o, a.lanes = m, a;
  }
  function or(t, a, i, o) {
    return t = Nn(7, t, o, a), t.lanes = i, t;
  }
  function pc(t, a, i) {
    return t = Nn(6, t, null, a), t.lanes = i, t;
  }
  function Vd(t) {
    var a = Nn(18, null, null, 0);
    return a.stateNode = t, a;
  }
  function gc(t, a, i) {
    return a = Nn(
      4,
      t.children !== null ? t.children : [],
      t.key,
      a
    ), a.lanes = i, a.stateNode = {
      containerInfo: t.containerInfo,
      pendingChildren: null,
      implementation: t.implementation
    }, a;
  }
  var Yd = /* @__PURE__ */ new WeakMap();
  function $n(t, a) {
    if (typeof t == "object" && t !== null) {
      var i = Yd.get(t);
      return i !== void 0 ? i : (a = {
        value: t,
        source: a,
        stack: Ee(a)
      }, Yd.set(t, a), a);
    }
    return {
      value: t,
      source: a,
      stack: Ee(a)
    };
  }
  var jr = [], Vr = 0, Rs = null, Kl = 0, Zn = [], Fn = 0, m0 = null, da = 1, ma = "";
  function Ha(t, a) {
    jr[Vr++] = Kl, jr[Vr++] = Rs, Rs = t, Kl = a;
  }
  function Gd(t, a, i) {
    Zn[Fn++] = da, Zn[Fn++] = ma, Zn[Fn++] = m0, m0 = t;
    var o = da;
    t = ma;
    var f = 32 - vt(o) - 1;
    o &= ~(1 << f), i += 1;
    var m = 32 - vt(a) + f;
    if (30 < m) {
      var S = f - f % 5;
      m = (o & (1 << S) - 1).toString(32), o >>= S, f -= S, da = 1 << 32 - vt(a) + f | i << f | o, ma = m + t;
    } else
      da = 1 << m | i << f | o, ma = t;
  }
  function yc(t) {
    t.return !== null && (Ha(t, 1), Gd(t, 1, 0));
  }
  function vc(t) {
    for (; t === Rs; )
      Rs = jr[--Vr], jr[Vr] = null, Kl = jr[--Vr], jr[Vr] = null;
    for (; t === m0; )
      m0 = Zn[--Fn], Zn[Fn] = null, ma = Zn[--Fn], Zn[Fn] = null, da = Zn[--Fn], Zn[Fn] = null;
  }
  function Xd(t, a) {
    Zn[Fn++] = da, Zn[Fn++] = ma, Zn[Fn++] = m0, da = a.id, ma = a.overflow, m0 = t;
  }
  var Jt = null, gt = null, Pe = !1, p0 = null, In = !1, xc = Error(l(519));
  function g0(t) {
    var a = Error(
      l(
        418,
        1 < arguments.length && arguments[1] !== void 0 && arguments[1] ? "text" : "HTML",
        ""
      )
    );
    throw Ql($n(a, t)), xc;
  }
  function $d(t) {
    var a = t.stateNode, i = t.type, o = t.memoizedProps;
    switch (a[Gt] = t, a[Qt] = o, i) {
      case "dialog":
        Ke("cancel", a), Ke("close", a);
        break;
      case "iframe":
      case "object":
      case "embed":
        Ke("load", a);
        break;
      case "video":
      case "audio":
        for (i = 0; i < vi.length; i++)
          Ke(vi[i], a);
        break;
      case "source":
        Ke("error", a);
        break;
      case "img":
      case "image":
      case "link":
        Ke("error", a), Ke("load", a);
        break;
      case "details":
        Ke("toggle", a);
        break;
      case "input":
        Ke("invalid", a), rd(
          a,
          o.value,
          o.defaultValue,
          o.checked,
          o.defaultChecked,
          o.type,
          o.name,
          !0
        );
        break;
      case "select":
        Ke("invalid", a);
        break;
      case "textarea":
        Ke("invalid", a), id(a, o.value, o.defaultValue, o.children);
    }
    i = o.children, typeof i != "string" && typeof i != "number" && typeof i != "bigint" || a.textContent === "" + i || o.suppressHydrationWarning === !0 || o2(a.textContent, i) ? (o.popover != null && (Ke("beforetoggle", a), Ke("toggle", a)), o.onScroll != null && Ke("scroll", a), o.onScrollEnd != null && Ke("scrollend", a), o.onClick != null && (a.onclick = Ra), a = !0) : a = !1, a || g0(t, !0);
  }
  function Zd(t) {
    for (Jt = t.return; Jt; )
      switch (Jt.tag) {
        case 5:
        case 31:
        case 13:
          In = !1;
          return;
        case 27:
        case 3:
          In = !0;
          return;
        default:
          Jt = Jt.return;
      }
  }
  function Yr(t) {
    if (t !== Jt) return !1;
    if (!Pe) return Zd(t), Pe = !0, !1;
    var a = t.tag, i;
    if ((i = a !== 3 && a !== 27) && ((i = a === 5) && (i = t.type, i = !(i !== "form" && i !== "button") || qf(t.type, t.memoizedProps)), i = !i), i && gt && g0(t), Zd(t), a === 13) {
      if (t = t.memoizedState, t = t !== null ? t.dehydrated : null, !t) throw Error(l(317));
      gt = y2(t);
    } else if (a === 31) {
      if (t = t.memoizedState, t = t !== null ? t.dehydrated : null, !t) throw Error(l(317));
      gt = y2(t);
    } else
      a === 27 ? (a = gt, k0(t.type) ? (t = Gf, Gf = null, gt = t) : gt = a) : gt = Jt ? Qn(t.stateNode.nextSibling) : null;
    return !0;
  }
  function ur() {
    gt = Jt = null, Pe = !1;
  }
  function bc() {
    var t = p0;
    return t !== null && (xn === null ? xn = t : xn.push.apply(
      xn,
      t
    ), p0 = null), t;
  }
  function Ql(t) {
    p0 === null ? p0 = [t] : p0.push(t);
  }
  var Sc = k(null), cr = null, La = null;
  function y0(t, a, i) {
    ae(Sc, a._currentValue), a._currentValue = i;
  }
  function qa(t) {
    t._currentValue = Sc.current, G(Sc);
  }
  function wc(t, a, i) {
    for (; t !== null; ) {
      var o = t.alternate;
      if ((t.childLanes & a) !== a ? (t.childLanes |= a, o !== null && (o.childLanes |= a)) : o !== null && (o.childLanes & a) !== a && (o.childLanes |= a), t === i) break;
      t = t.return;
    }
  }
  function Ec(t, a, i, o) {
    var f = t.child;
    for (f !== null && (f.return = t); f !== null; ) {
      var m = f.dependencies;
      if (m !== null) {
        var S = f.child;
        m = m.firstContext;
        e: for (; m !== null; ) {
          var C = m;
          m = f;
          for (var j = 0; j < a.length; j++)
            if (C.context === a[j]) {
              m.lanes |= i, C = m.alternate, C !== null && (C.lanes |= i), wc(
                m.return,
                i,
                t
              ), o || (S = null);
              break e;
            }
          m = C.next;
        }
      } else if (f.tag === 18) {
        if (S = f.return, S === null) throw Error(l(341));
        S.lanes |= i, m = S.alternate, m !== null && (m.lanes |= i), wc(S, i, t), S = null;
      } else S = f.child;
      if (S !== null) S.return = f;
      else
        for (S = f; S !== null; ) {
          if (S === t) {
            S = null;
            break;
          }
          if (f = S.sibling, f !== null) {
            f.return = S.return, S = f;
            break;
          }
          S = S.return;
        }
      f = S;
    }
  }
  function Gr(t, a, i, o) {
    t = null;
    for (var f = a, m = !1; f !== null; ) {
      if (!m) {
        if ((f.flags & 524288) !== 0) m = !0;
        else if ((f.flags & 262144) !== 0) break;
      }
      if (f.tag === 10) {
        var S = f.alternate;
        if (S === null) throw Error(l(387));
        if (S = S.memoizedProps, S !== null) {
          var C = f.type;
          Cn(f.pendingProps.value, S.value) || (t !== null ? t.push(C) : t = [C]);
        }
      } else if (f === Ae.current) {
        if (S = f.alternate, S === null) throw Error(l(387));
        S.memoizedState.memoizedState !== f.memoizedState.memoizedState && (t !== null ? t.push(Ei) : t = [Ei]);
      }
      f = f.return;
    }
    t !== null && Ec(
      a,
      t,
      i,
      o
    ), a.flags |= 262144;
  }
  function Bs(t) {
    for (t = t.firstContext; t !== null; ) {
      if (!Cn(
        t.context._currentValue,
        t.memoizedValue
      ))
        return !0;
      t = t.next;
    }
    return !1;
  }
  function fr(t) {
    cr = t, La = null, t = t.dependencies, t !== null && (t.firstContext = null);
  }
  function Wt(t) {
    return Fd(cr, t);
  }
  function Os(t, a) {
    return cr === null && fr(t), Fd(t, a);
  }
  function Fd(t, a) {
    var i = a._currentValue;
    if (a = { context: a, memoizedValue: i, next: null }, La === null) {
      if (t === null) throw Error(l(308));
      La = a, t.dependencies = { lanes: 0, firstContext: a }, t.flags |= 524288;
    } else La = La.next = a;
    return i;
  }
  var S8 = typeof AbortController < "u" ? AbortController : function() {
    var t = [], a = this.signal = {
      aborted: !1,
      addEventListener: function(i, o) {
        t.push(o);
      }
    };
    this.abort = function() {
      a.aborted = !0, t.forEach(function(i) {
        return i();
      });
    };
  }, w8 = e.unstable_scheduleCallback, E8 = e.unstable_NormalPriority, Ot = {
    $$typeof: q,
    Consumer: null,
    Provider: null,
    _currentValue: null,
    _currentValue2: null,
    _threadCount: 0
  };
  function Mc() {
    return {
      controller: new S8(),
      data: /* @__PURE__ */ new Map(),
      refCount: 0
    };
  }
  function Jl(t) {
    t.refCount--, t.refCount === 0 && w8(E8, function() {
      t.controller.abort();
    });
  }
  var Wl = null, Tc = 0, Xr = 0, $r = null;
  function M8(t, a) {
    if (Wl === null) {
      var i = Wl = [];
      Tc = 0, Xr = Nf(), $r = {
        status: "pending",
        value: void 0,
        then: function(o) {
          i.push(o);
        }
      };
    }
    return Tc++, a.then(Id, Id), a;
  }
  function Id() {
    if (--Tc === 0 && Wl !== null) {
      $r !== null && ($r.status = "fulfilled");
      var t = Wl;
      Wl = null, Xr = 0, $r = null;
      for (var a = 0; a < t.length; a++) (0, t[a])();
    }
  }
  function T8(t, a) {
    var i = [], o = {
      status: "pending",
      value: null,
      reason: null,
      then: function(f) {
        i.push(f);
      }
    };
    return t.then(
      function() {
        o.status = "fulfilled", o.value = a;
        for (var f = 0; f < i.length; f++) (0, i[f])(a);
      },
      function(f) {
        for (o.status = "rejected", o.reason = f, f = 0; f < i.length; f++)
          (0, i[f])(void 0);
      }
    ), o;
  }
  var Kd = D.S;
  D.S = function(t, a) {
    _4 = We(), typeof a == "object" && a !== null && typeof a.then == "function" && M8(t, a), Kd !== null && Kd(t, a);
  };
  var hr = k(null);
  function zc() {
    var t = hr.current;
    return t !== null ? t : ht.pooledCache;
  }
  function Hs(t, a) {
    a === null ? ae(hr, hr.current) : ae(hr, a.pool);
  }
  function Qd() {
    var t = zc();
    return t === null ? null : { parent: Ot._currentValue, pool: t };
  }
  var Zr = Error(l(460)), Ac = Error(l(474)), Ls = Error(l(542)), qs = { then: function() {
  } };
  function Jd(t) {
    return t = t.status, t === "fulfilled" || t === "rejected";
  }
  function Wd(t, a, i) {
    switch (i = t[i], i === void 0 ? t.push(a) : i !== a && (a.then(Ra, Ra), a = i), a.status) {
      case "fulfilled":
        return a.value;
      case "rejected":
        throw t = a.reason, em(t), t;
      default:
        if (typeof a.status == "string") a.then(Ra, Ra);
        else {
          if (t = ht, t !== null && 100 < t.shellSuspendCounter)
            throw Error(l(482));
          t = a, t.status = "pending", t.then(
            function(o) {
              if (a.status === "pending") {
                var f = a;
                f.status = "fulfilled", f.value = o;
              }
            },
            function(o) {
              if (a.status === "pending") {
                var f = a;
                f.status = "rejected", f.reason = o;
              }
            }
          );
        }
        switch (a.status) {
          case "fulfilled":
            return a.value;
          case "rejected":
            throw t = a.reason, em(t), t;
        }
        throw mr = a, Zr;
    }
  }
  function dr(t) {
    try {
      var a = t._init;
      return a(t._payload);
    } catch (i) {
      throw i !== null && typeof i == "object" && typeof i.then == "function" ? (mr = i, Zr) : i;
    }
  }
  var mr = null;
  function Pd() {
    if (mr === null) throw Error(l(459));
    var t = mr;
    return mr = null, t;
  }
  function em(t) {
    if (t === Zr || t === Ls)
      throw Error(l(483));
  }
  var Fr = null, Pl = 0;
  function Us(t) {
    var a = Pl;
    return Pl += 1, Fr === null && (Fr = []), Wd(Fr, t, a);
  }
  function ei(t, a) {
    a = a.props.ref, t.ref = a !== void 0 ? a : null;
  }
  function js(t, a) {
    throw a.$$typeof === x ? Error(l(525)) : (t = Object.prototype.toString.call(a), Error(
      l(
        31,
        t === "[object Object]" ? "object with keys {" + Object.keys(a).join(", ") + "}" : t
      )
    ));
  }
  function tm(t) {
    function a(K, X) {
      if (t) {
        var W = K.deletions;
        W === null ? (K.deletions = [X], K.flags |= 16) : W.push(X);
      }
    }
    function i(K, X) {
      if (!t) return null;
      for (; X !== null; )
        a(K, X), X = X.sibling;
      return null;
    }
    function o(K) {
      for (var X = /* @__PURE__ */ new Map(); K !== null; )
        K.key !== null ? X.set(K.key, K) : X.set(K.index, K), K = K.sibling;
      return X;
    }
    function f(K, X) {
      return K = Oa(K, X), K.index = 0, K.sibling = null, K;
    }
    function m(K, X, W) {
      return K.index = W, t ? (W = K.alternate, W !== null ? (W = W.index, W < X ? (K.flags |= 67108866, X) : W) : (K.flags |= 67108866, X)) : (K.flags |= 1048576, X);
    }
    function S(K) {
      return t && K.alternate === null && (K.flags |= 67108866), K;
    }
    function C(K, X, W, me) {
      return X === null || X.tag !== 6 ? (X = pc(W, K.mode, me), X.return = K, X) : (X = f(X, W), X.return = K, X);
    }
    function j(K, X, W, me) {
      var He = W.type;
      return He === M ? fe(
        K,
        X,
        W.props.children,
        me,
        W.key
      ) : X !== null && (X.elementType === He || typeof He == "object" && He !== null && He.$$typeof === re && dr(He) === X.type) ? (X = f(X, W.props), ei(X, W), X.return = K, X) : (X = _s(
        W.type,
        W.key,
        W.props,
        null,
        K.mode,
        me
      ), ei(X, W), X.return = K, X);
    }
    function ee(K, X, W, me) {
      return X === null || X.tag !== 4 || X.stateNode.containerInfo !== W.containerInfo || X.stateNode.implementation !== W.implementation ? (X = gc(W, K.mode, me), X.return = K, X) : (X = f(X, W.children || []), X.return = K, X);
    }
    function fe(K, X, W, me, He) {
      return X === null || X.tag !== 7 ? (X = or(
        W,
        K.mode,
        me,
        He
      ), X.return = K, X) : (X = f(X, W), X.return = K, X);
    }
    function pe(K, X, W) {
      if (typeof X == "string" && X !== "" || typeof X == "number" || typeof X == "bigint")
        return X = pc(
          "" + X,
          K.mode,
          W
        ), X.return = K, X;
      if (typeof X == "object" && X !== null) {
        switch (X.$$typeof) {
          case w:
            return W = _s(
              X.type,
              X.key,
              X.props,
              null,
              K.mode,
              W
            ), ei(W, X), W.return = K, W;
          case z:
            return X = gc(
              X,
              K.mode,
              W
            ), X.return = K, X;
          case re:
            return X = dr(X), pe(K, X, W);
        }
        if (J(X) || de(X))
          return X = or(
            X,
            K.mode,
            W,
            null
          ), X.return = K, X;
        if (typeof X.then == "function")
          return pe(K, Us(X), W);
        if (X.$$typeof === q)
          return pe(
            K,
            Os(K, X),
            W
          );
        js(K, X);
      }
      return null;
    }
    function ne(K, X, W, me) {
      var He = X !== null ? X.key : null;
      if (typeof W == "string" && W !== "" || typeof W == "number" || typeof W == "bigint")
        return He !== null ? null : C(K, X, "" + W, me);
      if (typeof W == "object" && W !== null) {
        switch (W.$$typeof) {
          case w:
            return W.key === He ? j(K, X, W, me) : null;
          case z:
            return W.key === He ? ee(K, X, W, me) : null;
          case re:
            return W = dr(W), ne(K, X, W, me);
        }
        if (J(W) || de(W))
          return He !== null ? null : fe(K, X, W, me, null);
        if (typeof W.then == "function")
          return ne(
            K,
            X,
            Us(W),
            me
          );
        if (W.$$typeof === q)
          return ne(
            K,
            X,
            Os(K, W),
            me
          );
        js(K, W);
      }
      return null;
    }
    function oe(K, X, W, me, He) {
      if (typeof me == "string" && me !== "" || typeof me == "number" || typeof me == "bigint")
        return K = K.get(W) || null, C(X, K, "" + me, He);
      if (typeof me == "object" && me !== null) {
        switch (me.$$typeof) {
          case w:
            return K = K.get(
              me.key === null ? W : me.key
            ) || null, j(X, K, me, He);
          case z:
            return K = K.get(
              me.key === null ? W : me.key
            ) || null, ee(X, K, me, He);
          case re:
            return me = dr(me), oe(
              K,
              X,
              W,
              me,
              He
            );
        }
        if (J(me) || de(me))
          return K = K.get(W) || null, fe(X, K, me, He, null);
        if (typeof me.then == "function")
          return oe(
            K,
            X,
            W,
            Us(me),
            He
          );
        if (me.$$typeof === q)
          return oe(
            K,
            X,
            W,
            Os(X, me),
            He
          );
        js(X, me);
      }
      return null;
    }
    function ke(K, X, W, me) {
      for (var He = null, tt = null, De = X, $e = X = 0, Je = null; De !== null && $e < W.length; $e++) {
        De.index > $e ? (Je = De, De = null) : Je = De.sibling;
        var nt = ne(
          K,
          De,
          W[$e],
          me
        );
        if (nt === null) {
          De === null && (De = Je);
          break;
        }
        t && De && nt.alternate === null && a(K, De), X = m(nt, X, $e), tt === null ? He = nt : tt.sibling = nt, tt = nt, De = Je;
      }
      if ($e === W.length)
        return i(K, De), Pe && Ha(K, $e), He;
      if (De === null) {
        for (; $e < W.length; $e++)
          De = pe(K, W[$e], me), De !== null && (X = m(
            De,
            X,
            $e
          ), tt === null ? He = De : tt.sibling = De, tt = De);
        return Pe && Ha(K, $e), He;
      }
      for (De = o(De); $e < W.length; $e++)
        Je = oe(
          De,
          K,
          $e,
          W[$e],
          me
        ), Je !== null && (t && Je.alternate !== null && De.delete(
          Je.key === null ? $e : Je.key
        ), X = m(
          Je,
          X,
          $e
        ), tt === null ? He = Je : tt.sibling = Je, tt = Je);
      return t && De.forEach(function(O0) {
        return a(K, O0);
      }), Pe && Ha(K, $e), He;
    }
    function Ue(K, X, W, me) {
      if (W == null) throw Error(l(151));
      for (var He = null, tt = null, De = X, $e = X = 0, Je = null, nt = W.next(); De !== null && !nt.done; $e++, nt = W.next()) {
        De.index > $e ? (Je = De, De = null) : Je = De.sibling;
        var O0 = ne(K, De, nt.value, me);
        if (O0 === null) {
          De === null && (De = Je);
          break;
        }
        t && De && O0.alternate === null && a(K, De), X = m(O0, X, $e), tt === null ? He = O0 : tt.sibling = O0, tt = O0, De = Je;
      }
      if (nt.done)
        return i(K, De), Pe && Ha(K, $e), He;
      if (De === null) {
        for (; !nt.done; $e++, nt = W.next())
          nt = pe(K, nt.value, me), nt !== null && (X = m(nt, X, $e), tt === null ? He = nt : tt.sibling = nt, tt = nt);
        return Pe && Ha(K, $e), He;
      }
      for (De = o(De); !nt.done; $e++, nt = W.next())
        nt = oe(De, K, $e, nt.value, me), nt !== null && (t && nt.alternate !== null && De.delete(nt.key === null ? $e : nt.key), X = m(nt, X, $e), tt === null ? He = nt : tt.sibling = nt, tt = nt);
      return t && De.forEach(function(Hg) {
        return a(K, Hg);
      }), Pe && Ha(K, $e), He;
    }
    function ft(K, X, W, me) {
      if (typeof W == "object" && W !== null && W.type === M && W.key === null && (W = W.props.children), typeof W == "object" && W !== null) {
        switch (W.$$typeof) {
          case w:
            e: {
              for (var He = W.key; X !== null; ) {
                if (X.key === He) {
                  if (He = W.type, He === M) {
                    if (X.tag === 7) {
                      i(
                        K,
                        X.sibling
                      ), me = f(
                        X,
                        W.props.children
                      ), me.return = K, K = me;
                      break e;
                    }
                  } else if (X.elementType === He || typeof He == "object" && He !== null && He.$$typeof === re && dr(He) === X.type) {
                    i(
                      K,
                      X.sibling
                    ), me = f(X, W.props), ei(me, W), me.return = K, K = me;
                    break e;
                  }
                  i(K, X);
                  break;
                } else a(K, X);
                X = X.sibling;
              }
              W.type === M ? (me = or(
                W.props.children,
                K.mode,
                me,
                W.key
              ), me.return = K, K = me) : (me = _s(
                W.type,
                W.key,
                W.props,
                null,
                K.mode,
                me
              ), ei(me, W), me.return = K, K = me);
            }
            return S(K);
          case z:
            e: {
              for (He = W.key; X !== null; ) {
                if (X.key === He)
                  if (X.tag === 4 && X.stateNode.containerInfo === W.containerInfo && X.stateNode.implementation === W.implementation) {
                    i(
                      K,
                      X.sibling
                    ), me = f(X, W.children || []), me.return = K, K = me;
                    break e;
                  } else {
                    i(K, X);
                    break;
                  }
                else a(K, X);
                X = X.sibling;
              }
              me = gc(W, K.mode, me), me.return = K, K = me;
            }
            return S(K);
          case re:
            return W = dr(W), ft(
              K,
              X,
              W,
              me
            );
        }
        if (J(W))
          return ke(
            K,
            X,
            W,
            me
          );
        if (de(W)) {
          if (He = de(W), typeof He != "function") throw Error(l(150));
          return W = He.call(W), Ue(
            K,
            X,
            W,
            me
          );
        }
        if (typeof W.then == "function")
          return ft(
            K,
            X,
            Us(W),
            me
          );
        if (W.$$typeof === q)
          return ft(
            K,
            X,
            Os(K, W),
            me
          );
        js(K, W);
      }
      return typeof W == "string" && W !== "" || typeof W == "number" || typeof W == "bigint" ? (W = "" + W, X !== null && X.tag === 6 ? (i(K, X.sibling), me = f(X, W), me.return = K, K = me) : (i(K, X), me = pc(W, K.mode, me), me.return = K, K = me), S(K)) : i(K, X);
    }
    return function(K, X, W, me) {
      try {
        Pl = 0;
        var He = ft(
          K,
          X,
          W,
          me
        );
        return Fr = null, He;
      } catch (De) {
        if (De === Zr || De === Ls) throw De;
        var tt = Nn(29, De, null, K.mode);
        return tt.lanes = me, tt.return = K, tt;
      }
    };
  }
  var pr = tm(!0), nm = tm(!1), v0 = !1;
  function Cc(t) {
    t.updateQueue = {
      baseState: t.memoizedState,
      firstBaseUpdate: null,
      lastBaseUpdate: null,
      shared: { pending: null, lanes: 0, hiddenCallbacks: null },
      callbacks: null
    };
  }
  function Nc(t, a) {
    t = t.updateQueue, a.updateQueue === t && (a.updateQueue = {
      baseState: t.baseState,
      firstBaseUpdate: t.firstBaseUpdate,
      lastBaseUpdate: t.lastBaseUpdate,
      shared: t.shared,
      callbacks: null
    });
  }
  function x0(t) {
    return { lane: t, tag: 0, payload: null, callback: null, next: null };
  }
  function b0(t, a, i) {
    var o = t.updateQueue;
    if (o === null) return null;
    if (o = o.shared, (rt & 2) !== 0) {
      var f = o.pending;
      return f === null ? a.next = a : (a.next = f.next, f.next = a), o.pending = a, a = Ds(t), Ud(t, null, i), a;
    }
    return ks(t, o, a, i), Ds(t);
  }
  function ti(t, a, i) {
    if (a = a.updateQueue, a !== null && (a = a.shared, (i & 4194048) !== 0)) {
      var o = a.lanes;
      o &= t.pendingLanes, i |= o, a.lanes = i, us(t, i);
    }
  }
  function kc(t, a) {
    var i = t.updateQueue, o = t.alternate;
    if (o !== null && (o = o.updateQueue, i === o)) {
      var f = null, m = null;
      if (i = i.firstBaseUpdate, i !== null) {
        do {
          var S = {
            lane: i.lane,
            tag: i.tag,
            payload: i.payload,
            callback: null,
            next: null
          };
          m === null ? f = m = S : m = m.next = S, i = i.next;
        } while (i !== null);
        m === null ? f = m = a : m = m.next = a;
      } else f = m = a;
      i = {
        baseState: o.baseState,
        firstBaseUpdate: f,
        lastBaseUpdate: m,
        shared: o.shared,
        callbacks: o.callbacks
      }, t.updateQueue = i;
      return;
    }
    t = i.lastBaseUpdate, t === null ? i.firstBaseUpdate = a : t.next = a, i.lastBaseUpdate = a;
  }
  var Dc = !1;
  function ni() {
    if (Dc) {
      var t = $r;
      if (t !== null) throw t;
    }
  }
  function ai(t, a, i, o) {
    Dc = !1;
    var f = t.updateQueue;
    v0 = !1;
    var m = f.firstBaseUpdate, S = f.lastBaseUpdate, C = f.shared.pending;
    if (C !== null) {
      f.shared.pending = null;
      var j = C, ee = j.next;
      j.next = null, S === null ? m = ee : S.next = ee, S = j;
      var fe = t.alternate;
      fe !== null && (fe = fe.updateQueue, C = fe.lastBaseUpdate, C !== S && (C === null ? fe.firstBaseUpdate = ee : C.next = ee, fe.lastBaseUpdate = j));
    }
    if (m !== null) {
      var pe = f.baseState;
      S = 0, fe = ee = j = null, C = m;
      do {
        var ne = C.lane & -536870913, oe = ne !== C.lane;
        if (oe ? (Qe & ne) === ne : (o & ne) === ne) {
          ne !== 0 && ne === Xr && (Dc = !0), fe !== null && (fe = fe.next = {
            lane: 0,
            tag: C.tag,
            payload: C.payload,
            callback: null,
            next: null
          });
          e: {
            var ke = t, Ue = C;
            ne = a;
            var ft = i;
            switch (Ue.tag) {
              case 1:
                if (ke = Ue.payload, typeof ke == "function") {
                  pe = ke.call(ft, pe, ne);
                  break e;
                }
                pe = ke;
                break e;
              case 3:
                ke.flags = ke.flags & -65537 | 128;
              case 0:
                if (ke = Ue.payload, ne = typeof ke == "function" ? ke.call(ft, pe, ne) : ke, ne == null) break e;
                pe = y({}, pe, ne);
                break e;
              case 2:
                v0 = !0;
            }
          }
          ne = C.callback, ne !== null && (t.flags |= 64, oe && (t.flags |= 8192), oe = f.callbacks, oe === null ? f.callbacks = [ne] : oe.push(ne));
        } else
          oe = {
            lane: ne,
            tag: C.tag,
            payload: C.payload,
            callback: C.callback,
            next: null
          }, fe === null ? (ee = fe = oe, j = pe) : fe = fe.next = oe, S |= ne;
        if (C = C.next, C === null) {
          if (C = f.shared.pending, C === null)
            break;
          oe = C, C = oe.next, oe.next = null, f.lastBaseUpdate = oe, f.shared.pending = null;
        }
      } while (!0);
      fe === null && (j = pe), f.baseState = j, f.firstBaseUpdate = ee, f.lastBaseUpdate = fe, m === null && (f.shared.lanes = 0), T0 |= S, t.lanes = S, t.memoizedState = pe;
    }
  }
  function am(t, a) {
    if (typeof t != "function")
      throw Error(l(191, t));
    t.call(a);
  }
  function rm(t, a) {
    var i = t.callbacks;
    if (i !== null)
      for (t.callbacks = null, t = 0; t < i.length; t++)
        am(i[t], a);
  }
  var Ir = k(null), Vs = k(0);
  function lm(t, a) {
    t = Fa, ae(Vs, t), ae(Ir, a), Fa = t | a.baseLanes;
  }
  function _c() {
    ae(Vs, Fa), ae(Ir, Ir.current);
  }
  function Rc() {
    Fa = Vs.current, G(Ir), G(Vs);
  }
  var kn = k(null), Kn = null;
  function S0(t) {
    var a = t.alternate;
    ae(Dt, Dt.current & 1), ae(kn, t), Kn === null && (a === null || Ir.current !== null || a.memoizedState !== null) && (Kn = t);
  }
  function Bc(t) {
    ae(Dt, Dt.current), ae(kn, t), Kn === null && (Kn = t);
  }
  function im(t) {
    t.tag === 22 ? (ae(Dt, Dt.current), ae(kn, t), Kn === null && (Kn = t)) : w0();
  }
  function w0() {
    ae(Dt, Dt.current), ae(kn, kn.current);
  }
  function Dn(t) {
    G(kn), Kn === t && (Kn = null), G(Dt);
  }
  var Dt = k(0);
  function Ys(t) {
    for (var a = t; a !== null; ) {
      if (a.tag === 13) {
        var i = a.memoizedState;
        if (i !== null && (i = i.dehydrated, i === null || Vf(i) || Yf(i)))
          return a;
      } else if (a.tag === 19 && (a.memoizedProps.revealOrder === "forwards" || a.memoizedProps.revealOrder === "backwards" || a.memoizedProps.revealOrder === "unstable_legacy-backwards" || a.memoizedProps.revealOrder === "together")) {
        if ((a.flags & 128) !== 0) return a;
      } else if (a.child !== null) {
        a.child.return = a, a = a.child;
        continue;
      }
      if (a === t) break;
      for (; a.sibling === null; ) {
        if (a.return === null || a.return === t) return null;
        a = a.return;
      }
      a.sibling.return = a.return, a = a.sibling;
    }
    return null;
  }
  var Ua = 0, Ge = null, ut = null, Ht = null, Gs = !1, Kr = !1, gr = !1, Xs = 0, ri = 0, Qr = null, z8 = 0;
  function zt() {
    throw Error(l(321));
  }
  function Oc(t, a) {
    if (a === null) return !1;
    for (var i = 0; i < a.length && i < t.length; i++)
      if (!Cn(t[i], a[i])) return !1;
    return !0;
  }
  function Hc(t, a, i, o, f, m) {
    return Ua = m, Ge = a, a.memoizedState = null, a.updateQueue = null, a.lanes = 0, D.H = t === null || t.memoizedState === null ? Gm : Jc, gr = !1, m = i(o, f), gr = !1, Kr && (m = om(
      a,
      i,
      o,
      f
    )), sm(t), m;
  }
  function sm(t) {
    D.H = si;
    var a = ut !== null && ut.next !== null;
    if (Ua = 0, Ht = ut = Ge = null, Gs = !1, ri = 0, Qr = null, a) throw Error(l(300));
    t === null || Lt || (t = t.dependencies, t !== null && Bs(t) && (Lt = !0));
  }
  function om(t, a, i, o) {
    Ge = t;
    var f = 0;
    do {
      if (Kr && (Qr = null), ri = 0, Kr = !1, 25 <= f) throw Error(l(301));
      if (f += 1, Ht = ut = null, t.updateQueue != null) {
        var m = t.updateQueue;
        m.lastEffect = null, m.events = null, m.stores = null, m.memoCache != null && (m.memoCache.index = 0);
      }
      D.H = Xm, m = a(i, o);
    } while (Kr);
    return m;
  }
  function A8() {
    var t = D.H, a = t.useState()[0];
    return a = typeof a.then == "function" ? li(a) : a, t = t.useState()[0], (ut !== null ? ut.memoizedState : null) !== t && (Ge.flags |= 1024), a;
  }
  function Lc() {
    var t = Xs !== 0;
    return Xs = 0, t;
  }
  function qc(t, a, i) {
    a.updateQueue = t.updateQueue, a.flags &= -2053, t.lanes &= ~i;
  }
  function Uc(t) {
    if (Gs) {
      for (t = t.memoizedState; t !== null; ) {
        var a = t.queue;
        a !== null && (a.pending = null), t = t.next;
      }
      Gs = !1;
    }
    Ua = 0, Ht = ut = Ge = null, Kr = !1, ri = Xs = 0, Qr = null;
  }
  function un() {
    var t = {
      memoizedState: null,
      baseState: null,
      baseQueue: null,
      queue: null,
      next: null
    };
    return Ht === null ? Ge.memoizedState = Ht = t : Ht = Ht.next = t, Ht;
  }
  function _t() {
    if (ut === null) {
      var t = Ge.alternate;
      t = t !== null ? t.memoizedState : null;
    } else t = ut.next;
    var a = Ht === null ? Ge.memoizedState : Ht.next;
    if (a !== null)
      Ht = a, ut = t;
    else {
      if (t === null)
        throw Ge.alternate === null ? Error(l(467)) : Error(l(310));
      ut = t, t = {
        memoizedState: ut.memoizedState,
        baseState: ut.baseState,
        baseQueue: ut.baseQueue,
        queue: ut.queue,
        next: null
      }, Ht === null ? Ge.memoizedState = Ht = t : Ht = Ht.next = t;
    }
    return Ht;
  }
  function $s() {
    return { lastEffect: null, events: null, stores: null, memoCache: null };
  }
  function li(t) {
    var a = ri;
    return ri += 1, Qr === null && (Qr = []), t = Wd(Qr, t, a), a = Ge, (Ht === null ? a.memoizedState : Ht.next) === null && (a = a.alternate, D.H = a === null || a.memoizedState === null ? Gm : Jc), t;
  }
  function Zs(t) {
    if (t !== null && typeof t == "object") {
      if (typeof t.then == "function") return li(t);
      if (t.$$typeof === q) return Wt(t);
    }
    throw Error(l(438, String(t)));
  }
  function jc(t) {
    var a = null, i = Ge.updateQueue;
    if (i !== null && (a = i.memoCache), a == null) {
      var o = Ge.alternate;
      o !== null && (o = o.updateQueue, o !== null && (o = o.memoCache, o != null && (a = {
        data: o.data.map(function(f) {
          return f.slice();
        }),
        index: 0
      })));
    }
    if (a == null && (a = { data: [], index: 0 }), i === null && (i = $s(), Ge.updateQueue = i), i.memoCache = a, i = a.data[a.index], i === void 0)
      for (i = a.data[a.index] = Array(t), o = 0; o < t; o++)
        i[o] = ie;
    return a.index++, i;
  }
  function ja(t, a) {
    return typeof a == "function" ? a(t) : a;
  }
  function Fs(t) {
    var a = _t();
    return Vc(a, ut, t);
  }
  function Vc(t, a, i) {
    var o = t.queue;
    if (o === null) throw Error(l(311));
    o.lastRenderedReducer = i;
    var f = t.baseQueue, m = o.pending;
    if (m !== null) {
      if (f !== null) {
        var S = f.next;
        f.next = m.next, m.next = S;
      }
      a.baseQueue = f = m, o.pending = null;
    }
    if (m = t.baseState, f === null) t.memoizedState = m;
    else {
      a = f.next;
      var C = S = null, j = null, ee = a, fe = !1;
      do {
        var pe = ee.lane & -536870913;
        if (pe !== ee.lane ? (Qe & pe) === pe : (Ua & pe) === pe) {
          var ne = ee.revertLane;
          if (ne === 0)
            j !== null && (j = j.next = {
              lane: 0,
              revertLane: 0,
              gesture: null,
              action: ee.action,
              hasEagerState: ee.hasEagerState,
              eagerState: ee.eagerState,
              next: null
            }), pe === Xr && (fe = !0);
          else if ((Ua & ne) === ne) {
            ee = ee.next, ne === Xr && (fe = !0);
            continue;
          } else
            pe = {
              lane: 0,
              revertLane: ee.revertLane,
              gesture: null,
              action: ee.action,
              hasEagerState: ee.hasEagerState,
              eagerState: ee.eagerState,
              next: null
            }, j === null ? (C = j = pe, S = m) : j = j.next = pe, Ge.lanes |= ne, T0 |= ne;
          pe = ee.action, gr && i(m, pe), m = ee.hasEagerState ? ee.eagerState : i(m, pe);
        } else
          ne = {
            lane: pe,
            revertLane: ee.revertLane,
            gesture: ee.gesture,
            action: ee.action,
            hasEagerState: ee.hasEagerState,
            eagerState: ee.eagerState,
            next: null
          }, j === null ? (C = j = ne, S = m) : j = j.next = ne, Ge.lanes |= pe, T0 |= pe;
        ee = ee.next;
      } while (ee !== null && ee !== a);
      if (j === null ? S = m : j.next = C, !Cn(m, t.memoizedState) && (Lt = !0, fe && (i = $r, i !== null)))
        throw i;
      t.memoizedState = m, t.baseState = S, t.baseQueue = j, o.lastRenderedState = m;
    }
    return f === null && (o.lanes = 0), [t.memoizedState, o.dispatch];
  }
  function Yc(t) {
    var a = _t(), i = a.queue;
    if (i === null) throw Error(l(311));
    i.lastRenderedReducer = t;
    var o = i.dispatch, f = i.pending, m = a.memoizedState;
    if (f !== null) {
      i.pending = null;
      var S = f = f.next;
      do
        m = t(m, S.action), S = S.next;
      while (S !== f);
      Cn(m, a.memoizedState) || (Lt = !0), a.memoizedState = m, a.baseQueue === null && (a.baseState = m), i.lastRenderedState = m;
    }
    return [m, o];
  }
  function um(t, a, i) {
    var o = Ge, f = _t(), m = Pe;
    if (m) {
      if (i === void 0) throw Error(l(407));
      i = i();
    } else i = a();
    var S = !Cn(
      (ut || f).memoizedState,
      i
    );
    if (S && (f.memoizedState = i, Lt = !0), f = f.queue, $c(hm.bind(null, o, f, t), [
      t
    ]), f.getSnapshot !== a || S || Ht !== null && Ht.memoizedState.tag & 1) {
      if (o.flags |= 2048, Jr(
        9,
        { destroy: void 0 },
        fm.bind(
          null,
          o,
          f,
          i,
          a
        ),
        null
      ), ht === null) throw Error(l(349));
      m || (Ua & 127) !== 0 || cm(o, a, i);
    }
    return i;
  }
  function cm(t, a, i) {
    t.flags |= 16384, t = { getSnapshot: a, value: i }, a = Ge.updateQueue, a === null ? (a = $s(), Ge.updateQueue = a, a.stores = [t]) : (i = a.stores, i === null ? a.stores = [t] : i.push(t));
  }
  function fm(t, a, i, o) {
    a.value = i, a.getSnapshot = o, dm(a) && mm(t);
  }
  function hm(t, a, i) {
    return i(function() {
      dm(a) && mm(t);
    });
  }
  function dm(t) {
    var a = t.getSnapshot;
    t = t.value;
    try {
      var i = a();
      return !Cn(t, i);
    } catch {
      return !0;
    }
  }
  function mm(t) {
    var a = sr(t, 2);
    a !== null && bn(a, t, 2);
  }
  function Gc(t) {
    var a = un();
    if (typeof t == "function") {
      var i = t;
      if (t = i(), gr) {
        sn(!0);
        try {
          i();
        } finally {
          sn(!1);
        }
      }
    }
    return a.memoizedState = a.baseState = t, a.queue = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: ja,
      lastRenderedState: t
    }, a;
  }
  function pm(t, a, i, o) {
    return t.baseState = i, Vc(
      t,
      ut,
      typeof o == "function" ? o : ja
    );
  }
  function C8(t, a, i, o, f) {
    if (Qs(t)) throw Error(l(485));
    if (t = a.action, t !== null) {
      var m = {
        payload: f,
        action: t,
        next: null,
        isTransition: !0,
        status: "pending",
        value: null,
        reason: null,
        listeners: [],
        then: function(S) {
          m.listeners.push(S);
        }
      };
      D.T !== null ? i(!0) : m.isTransition = !1, o(m), i = a.pending, i === null ? (m.next = a.pending = m, gm(a, m)) : (m.next = i.next, a.pending = i.next = m);
    }
  }
  function gm(t, a) {
    var i = a.action, o = a.payload, f = t.state;
    if (a.isTransition) {
      var m = D.T, S = {};
      D.T = S;
      try {
        var C = i(f, o), j = D.S;
        j !== null && j(S, C), ym(t, a, C);
      } catch (ee) {
        Xc(t, a, ee);
      } finally {
        m !== null && S.types !== null && (m.types = S.types), D.T = m;
      }
    } else
      try {
        m = i(f, o), ym(t, a, m);
      } catch (ee) {
        Xc(t, a, ee);
      }
  }
  function ym(t, a, i) {
    i !== null && typeof i == "object" && typeof i.then == "function" ? i.then(
      function(o) {
        vm(t, a, o);
      },
      function(o) {
        return Xc(t, a, o);
      }
    ) : vm(t, a, i);
  }
  function vm(t, a, i) {
    a.status = "fulfilled", a.value = i, xm(a), t.state = i, a = t.pending, a !== null && (i = a.next, i === a ? t.pending = null : (i = i.next, a.next = i, gm(t, i)));
  }
  function Xc(t, a, i) {
    var o = t.pending;
    if (t.pending = null, o !== null) {
      o = o.next;
      do
        a.status = "rejected", a.reason = i, xm(a), a = a.next;
      while (a !== o);
    }
    t.action = null;
  }
  function xm(t) {
    t = t.listeners;
    for (var a = 0; a < t.length; a++) (0, t[a])();
  }
  function bm(t, a) {
    return a;
  }
  function Sm(t, a) {
    if (Pe) {
      var i = ht.formState;
      if (i !== null) {
        e: {
          var o = Ge;
          if (Pe) {
            if (gt) {
              t: {
                for (var f = gt, m = In; f.nodeType !== 8; ) {
                  if (!m) {
                    f = null;
                    break t;
                  }
                  if (f = Qn(
                    f.nextSibling
                  ), f === null) {
                    f = null;
                    break t;
                  }
                }
                m = f.data, f = m === "F!" || m === "F" ? f : null;
              }
              if (f) {
                gt = Qn(
                  f.nextSibling
                ), o = f.data === "F!";
                break e;
              }
            }
            g0(o);
          }
          o = !1;
        }
        o && (a = i[0]);
      }
    }
    return i = un(), i.memoizedState = i.baseState = a, o = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: bm,
      lastRenderedState: a
    }, i.queue = o, i = jm.bind(
      null,
      Ge,
      o
    ), o.dispatch = i, o = Gc(!1), m = Qc.bind(
      null,
      Ge,
      !1,
      o.queue
    ), o = un(), f = {
      state: a,
      dispatch: null,
      action: t,
      pending: null
    }, o.queue = f, i = C8.bind(
      null,
      Ge,
      f,
      m,
      i
    ), f.dispatch = i, o.memoizedState = t, [a, i, !1];
  }
  function wm(t) {
    var a = _t();
    return Em(a, ut, t);
  }
  function Em(t, a, i) {
    if (a = Vc(
      t,
      a,
      bm
    )[0], t = Fs(ja)[0], typeof a == "object" && a !== null && typeof a.then == "function")
      try {
        var o = li(a);
      } catch (S) {
        throw S === Zr ? Ls : S;
      }
    else o = a;
    a = _t();
    var f = a.queue, m = f.dispatch;
    return i !== a.memoizedState && (Ge.flags |= 2048, Jr(
      9,
      { destroy: void 0 },
      N8.bind(null, f, i),
      null
    )), [o, m, t];
  }
  function N8(t, a) {
    t.action = a;
  }
  function Mm(t) {
    var a = _t(), i = ut;
    if (i !== null)
      return Em(a, i, t);
    _t(), a = a.memoizedState, i = _t();
    var o = i.queue.dispatch;
    return i.memoizedState = t, [a, o, !1];
  }
  function Jr(t, a, i, o) {
    return t = { tag: t, create: i, deps: o, inst: a, next: null }, a = Ge.updateQueue, a === null && (a = $s(), Ge.updateQueue = a), i = a.lastEffect, i === null ? a.lastEffect = t.next = t : (o = i.next, i.next = t, t.next = o, a.lastEffect = t), t;
  }
  function Tm() {
    return _t().memoizedState;
  }
  function Is(t, a, i, o) {
    var f = un();
    Ge.flags |= t, f.memoizedState = Jr(
      1 | a,
      { destroy: void 0 },
      i,
      o === void 0 ? null : o
    );
  }
  function Ks(t, a, i, o) {
    var f = _t();
    o = o === void 0 ? null : o;
    var m = f.memoizedState.inst;
    ut !== null && o !== null && Oc(o, ut.memoizedState.deps) ? f.memoizedState = Jr(a, m, i, o) : (Ge.flags |= t, f.memoizedState = Jr(
      1 | a,
      m,
      i,
      o
    ));
  }
  function zm(t, a) {
    Is(8390656, 8, t, a);
  }
  function $c(t, a) {
    Ks(2048, 8, t, a);
  }
  function k8(t) {
    Ge.flags |= 4;
    var a = Ge.updateQueue;
    if (a === null)
      a = $s(), Ge.updateQueue = a, a.events = [t];
    else {
      var i = a.events;
      i === null ? a.events = [t] : i.push(t);
    }
  }
  function Am(t) {
    var a = _t().memoizedState;
    return k8({ ref: a, nextImpl: t }), function() {
      if ((rt & 2) !== 0) throw Error(l(440));
      return a.impl.apply(void 0, arguments);
    };
  }
  function Cm(t, a) {
    return Ks(4, 2, t, a);
  }
  function Nm(t, a) {
    return Ks(4, 4, t, a);
  }
  function km(t, a) {
    if (typeof a == "function") {
      t = t();
      var i = a(t);
      return function() {
        typeof i == "function" ? i() : a(null);
      };
    }
    if (a != null)
      return t = t(), a.current = t, function() {
        a.current = null;
      };
  }
  function Dm(t, a, i) {
    i = i != null ? i.concat([t]) : null, Ks(4, 4, km.bind(null, a, t), i);
  }
  function Zc() {
  }
  function _m(t, a) {
    var i = _t();
    a = a === void 0 ? null : a;
    var o = i.memoizedState;
    return a !== null && Oc(a, o[1]) ? o[0] : (i.memoizedState = [t, a], t);
  }
  function Rm(t, a) {
    var i = _t();
    a = a === void 0 ? null : a;
    var o = i.memoizedState;
    if (a !== null && Oc(a, o[1]))
      return o[0];
    if (o = t(), gr) {
      sn(!0);
      try {
        t();
      } finally {
        sn(!1);
      }
    }
    return i.memoizedState = [o, a], o;
  }
  function Fc(t, a, i) {
    return i === void 0 || (Ua & 1073741824) !== 0 && (Qe & 261930) === 0 ? t.memoizedState = a : (t.memoizedState = i, t = B4(), Ge.lanes |= t, T0 |= t, i);
  }
  function Bm(t, a, i, o) {
    return Cn(i, a) ? i : Ir.current !== null ? (t = Fc(t, i, o), Cn(t, a) || (Lt = !0), t) : (Ua & 42) === 0 || (Ua & 1073741824) !== 0 && (Qe & 261930) === 0 ? (Lt = !0, t.memoizedState = i) : (t = B4(), Ge.lanes |= t, T0 |= t, a);
  }
  function Om(t, a, i, o, f) {
    var m = Y.p;
    Y.p = m !== 0 && 8 > m ? m : 8;
    var S = D.T, C = {};
    D.T = C, Qc(t, !1, a, i);
    try {
      var j = f(), ee = D.S;
      if (ee !== null && ee(C, j), j !== null && typeof j == "object" && typeof j.then == "function") {
        var fe = T8(
          j,
          o
        );
        ii(
          t,
          a,
          fe,
          Bn(t)
        );
      } else
        ii(
          t,
          a,
          o,
          Bn(t)
        );
    } catch (pe) {
      ii(
        t,
        a,
        { then: function() {
        }, status: "rejected", reason: pe },
        Bn()
      );
    } finally {
      Y.p = m, S !== null && C.types !== null && (S.types = C.types), D.T = S;
    }
  }
  function D8() {
  }
  function Ic(t, a, i, o) {
    if (t.tag !== 5) throw Error(l(476));
    var f = Hm(t).queue;
    Om(
      t,
      f,
      a,
      I,
      i === null ? D8 : function() {
        return Lm(t), i(o);
      }
    );
  }
  function Hm(t) {
    var a = t.memoizedState;
    if (a !== null) return a;
    a = {
      memoizedState: I,
      baseState: I,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: ja,
        lastRenderedState: I
      },
      next: null
    };
    var i = {};
    return a.next = {
      memoizedState: i,
      baseState: i,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: ja,
        lastRenderedState: i
      },
      next: null
    }, t.memoizedState = a, t = t.alternate, t !== null && (t.memoizedState = a), a;
  }
  function Lm(t) {
    var a = Hm(t);
    a.next === null && (a = t.alternate.memoizedState), ii(
      t,
      a.next.queue,
      {},
      Bn()
    );
  }
  function Kc() {
    return Wt(Ei);
  }
  function qm() {
    return _t().memoizedState;
  }
  function Um() {
    return _t().memoizedState;
  }
  function _8(t) {
    for (var a = t.return; a !== null; ) {
      switch (a.tag) {
        case 24:
        case 3:
          var i = Bn();
          t = x0(i);
          var o = b0(a, t, i);
          o !== null && (bn(o, a, i), ti(o, a, i)), a = { cache: Mc() }, t.payload = a;
          return;
      }
      a = a.return;
    }
  }
  function R8(t, a, i) {
    var o = Bn();
    i = {
      lane: o,
      revertLane: 0,
      gesture: null,
      action: i,
      hasEagerState: !1,
      eagerState: null,
      next: null
    }, Qs(t) ? Vm(a, i) : (i = dc(t, a, i, o), i !== null && (bn(i, t, o), Ym(i, a, o)));
  }
  function jm(t, a, i) {
    var o = Bn();
    ii(t, a, i, o);
  }
  function ii(t, a, i, o) {
    var f = {
      lane: o,
      revertLane: 0,
      gesture: null,
      action: i,
      hasEagerState: !1,
      eagerState: null,
      next: null
    };
    if (Qs(t)) Vm(a, f);
    else {
      var m = t.alternate;
      if (t.lanes === 0 && (m === null || m.lanes === 0) && (m = a.lastRenderedReducer, m !== null))
        try {
          var S = a.lastRenderedState, C = m(S, i);
          if (f.hasEagerState = !0, f.eagerState = C, Cn(C, S))
            return ks(t, a, f, 0), ht === null && Ns(), !1;
        } catch {
        }
      if (i = dc(t, a, f, o), i !== null)
        return bn(i, t, o), Ym(i, a, o), !0;
    }
    return !1;
  }
  function Qc(t, a, i, o) {
    if (o = {
      lane: 2,
      revertLane: Nf(),
      gesture: null,
      action: o,
      hasEagerState: !1,
      eagerState: null,
      next: null
    }, Qs(t)) {
      if (a) throw Error(l(479));
    } else
      a = dc(
        t,
        i,
        o,
        2
      ), a !== null && bn(a, t, 2);
  }
  function Qs(t) {
    var a = t.alternate;
    return t === Ge || a !== null && a === Ge;
  }
  function Vm(t, a) {
    Kr = Gs = !0;
    var i = t.pending;
    i === null ? a.next = a : (a.next = i.next, i.next = a), t.pending = a;
  }
  function Ym(t, a, i) {
    if ((i & 4194048) !== 0) {
      var o = a.lanes;
      o &= t.pendingLanes, i |= o, a.lanes = i, us(t, i);
    }
  }
  var si = {
    readContext: Wt,
    use: Zs,
    useCallback: zt,
    useContext: zt,
    useEffect: zt,
    useImperativeHandle: zt,
    useLayoutEffect: zt,
    useInsertionEffect: zt,
    useMemo: zt,
    useReducer: zt,
    useRef: zt,
    useState: zt,
    useDebugValue: zt,
    useDeferredValue: zt,
    useTransition: zt,
    useSyncExternalStore: zt,
    useId: zt,
    useHostTransitionStatus: zt,
    useFormState: zt,
    useActionState: zt,
    useOptimistic: zt,
    useMemoCache: zt,
    useCacheRefresh: zt
  };
  si.useEffectEvent = zt;
  var Gm = {
    readContext: Wt,
    use: Zs,
    useCallback: function(t, a) {
      return un().memoizedState = [
        t,
        a === void 0 ? null : a
      ], t;
    },
    useContext: Wt,
    useEffect: zm,
    useImperativeHandle: function(t, a, i) {
      i = i != null ? i.concat([t]) : null, Is(
        4194308,
        4,
        km.bind(null, a, t),
        i
      );
    },
    useLayoutEffect: function(t, a) {
      return Is(4194308, 4, t, a);
    },
    useInsertionEffect: function(t, a) {
      Is(4, 2, t, a);
    },
    useMemo: function(t, a) {
      var i = un();
      a = a === void 0 ? null : a;
      var o = t();
      if (gr) {
        sn(!0);
        try {
          t();
        } finally {
          sn(!1);
        }
      }
      return i.memoizedState = [o, a], o;
    },
    useReducer: function(t, a, i) {
      var o = un();
      if (i !== void 0) {
        var f = i(a);
        if (gr) {
          sn(!0);
          try {
            i(a);
          } finally {
            sn(!1);
          }
        }
      } else f = a;
      return o.memoizedState = o.baseState = f, t = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: t,
        lastRenderedState: f
      }, o.queue = t, t = t.dispatch = R8.bind(
        null,
        Ge,
        t
      ), [o.memoizedState, t];
    },
    useRef: function(t) {
      var a = un();
      return t = { current: t }, a.memoizedState = t;
    },
    useState: function(t) {
      t = Gc(t);
      var a = t.queue, i = jm.bind(null, Ge, a);
      return a.dispatch = i, [t.memoizedState, i];
    },
    useDebugValue: Zc,
    useDeferredValue: function(t, a) {
      var i = un();
      return Fc(i, t, a);
    },
    useTransition: function() {
      var t = Gc(!1);
      return t = Om.bind(
        null,
        Ge,
        t.queue,
        !0,
        !1
      ), un().memoizedState = t, [!1, t];
    },
    useSyncExternalStore: function(t, a, i) {
      var o = Ge, f = un();
      if (Pe) {
        if (i === void 0)
          throw Error(l(407));
        i = i();
      } else {
        if (i = a(), ht === null)
          throw Error(l(349));
        (Qe & 127) !== 0 || cm(o, a, i);
      }
      f.memoizedState = i;
      var m = { value: i, getSnapshot: a };
      return f.queue = m, zm(hm.bind(null, o, m, t), [
        t
      ]), o.flags |= 2048, Jr(
        9,
        { destroy: void 0 },
        fm.bind(
          null,
          o,
          m,
          i,
          a
        ),
        null
      ), i;
    },
    useId: function() {
      var t = un(), a = ht.identifierPrefix;
      if (Pe) {
        var i = ma, o = da;
        i = (o & ~(1 << 32 - vt(o) - 1)).toString(32) + i, a = "_" + a + "R_" + i, i = Xs++, 0 < i && (a += "H" + i.toString(32)), a += "_";
      } else
        i = z8++, a = "_" + a + "r_" + i.toString(32) + "_";
      return t.memoizedState = a;
    },
    useHostTransitionStatus: Kc,
    useFormState: Sm,
    useActionState: Sm,
    useOptimistic: function(t) {
      var a = un();
      a.memoizedState = a.baseState = t;
      var i = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: null,
        lastRenderedState: null
      };
      return a.queue = i, a = Qc.bind(
        null,
        Ge,
        !0,
        i
      ), i.dispatch = a, [t, a];
    },
    useMemoCache: jc,
    useCacheRefresh: function() {
      return un().memoizedState = _8.bind(
        null,
        Ge
      );
    },
    useEffectEvent: function(t) {
      var a = un(), i = { impl: t };
      return a.memoizedState = i, function() {
        if ((rt & 2) !== 0)
          throw Error(l(440));
        return i.impl.apply(void 0, arguments);
      };
    }
  }, Jc = {
    readContext: Wt,
    use: Zs,
    useCallback: _m,
    useContext: Wt,
    useEffect: $c,
    useImperativeHandle: Dm,
    useInsertionEffect: Cm,
    useLayoutEffect: Nm,
    useMemo: Rm,
    useReducer: Fs,
    useRef: Tm,
    useState: function() {
      return Fs(ja);
    },
    useDebugValue: Zc,
    useDeferredValue: function(t, a) {
      var i = _t();
      return Bm(
        i,
        ut.memoizedState,
        t,
        a
      );
    },
    useTransition: function() {
      var t = Fs(ja)[0], a = _t().memoizedState;
      return [
        typeof t == "boolean" ? t : li(t),
        a
      ];
    },
    useSyncExternalStore: um,
    useId: qm,
    useHostTransitionStatus: Kc,
    useFormState: wm,
    useActionState: wm,
    useOptimistic: function(t, a) {
      var i = _t();
      return pm(i, ut, t, a);
    },
    useMemoCache: jc,
    useCacheRefresh: Um
  };
  Jc.useEffectEvent = Am;
  var Xm = {
    readContext: Wt,
    use: Zs,
    useCallback: _m,
    useContext: Wt,
    useEffect: $c,
    useImperativeHandle: Dm,
    useInsertionEffect: Cm,
    useLayoutEffect: Nm,
    useMemo: Rm,
    useReducer: Yc,
    useRef: Tm,
    useState: function() {
      return Yc(ja);
    },
    useDebugValue: Zc,
    useDeferredValue: function(t, a) {
      var i = _t();
      return ut === null ? Fc(i, t, a) : Bm(
        i,
        ut.memoizedState,
        t,
        a
      );
    },
    useTransition: function() {
      var t = Yc(ja)[0], a = _t().memoizedState;
      return [
        typeof t == "boolean" ? t : li(t),
        a
      ];
    },
    useSyncExternalStore: um,
    useId: qm,
    useHostTransitionStatus: Kc,
    useFormState: Mm,
    useActionState: Mm,
    useOptimistic: function(t, a) {
      var i = _t();
      return ut !== null ? pm(i, ut, t, a) : (i.baseState = t, [t, i.queue.dispatch]);
    },
    useMemoCache: jc,
    useCacheRefresh: Um
  };
  Xm.useEffectEvent = Am;
  function Wc(t, a, i, o) {
    a = t.memoizedState, i = i(o, a), i = i == null ? a : y({}, a, i), t.memoizedState = i, t.lanes === 0 && (t.updateQueue.baseState = i);
  }
  var Pc = {
    enqueueSetState: function(t, a, i) {
      t = t._reactInternals;
      var o = Bn(), f = x0(o);
      f.payload = a, i != null && (f.callback = i), a = b0(t, f, o), a !== null && (bn(a, t, o), ti(a, t, o));
    },
    enqueueReplaceState: function(t, a, i) {
      t = t._reactInternals;
      var o = Bn(), f = x0(o);
      f.tag = 1, f.payload = a, i != null && (f.callback = i), a = b0(t, f, o), a !== null && (bn(a, t, o), ti(a, t, o));
    },
    enqueueForceUpdate: function(t, a) {
      t = t._reactInternals;
      var i = Bn(), o = x0(i);
      o.tag = 2, a != null && (o.callback = a), a = b0(t, o, i), a !== null && (bn(a, t, i), ti(a, t, i));
    }
  };
  function $m(t, a, i, o, f, m, S) {
    return t = t.stateNode, typeof t.shouldComponentUpdate == "function" ? t.shouldComponentUpdate(o, m, S) : a.prototype && a.prototype.isPureReactComponent ? !Fl(i, o) || !Fl(f, m) : !0;
  }
  function Zm(t, a, i, o) {
    t = a.state, typeof a.componentWillReceiveProps == "function" && a.componentWillReceiveProps(i, o), typeof a.UNSAFE_componentWillReceiveProps == "function" && a.UNSAFE_componentWillReceiveProps(i, o), a.state !== t && Pc.enqueueReplaceState(a, a.state, null);
  }
  function yr(t, a) {
    var i = a;
    if ("ref" in a) {
      i = {};
      for (var o in a)
        o !== "ref" && (i[o] = a[o]);
    }
    if (t = t.defaultProps) {
      i === a && (i = y({}, i));
      for (var f in t)
        i[f] === void 0 && (i[f] = t[f]);
    }
    return i;
  }
  function Fm(t) {
    Cs(t);
  }
  function Im(t) {
    console.error(t);
  }
  function Km(t) {
    Cs(t);
  }
  function Js(t, a) {
    try {
      var i = t.onUncaughtError;
      i(a.value, { componentStack: a.stack });
    } catch (o) {
      setTimeout(function() {
        throw o;
      });
    }
  }
  function Qm(t, a, i) {
    try {
      var o = t.onCaughtError;
      o(i.value, {
        componentStack: i.stack,
        errorBoundary: a.tag === 1 ? a.stateNode : null
      });
    } catch (f) {
      setTimeout(function() {
        throw f;
      });
    }
  }
  function ef(t, a, i) {
    return i = x0(i), i.tag = 3, i.payload = { element: null }, i.callback = function() {
      Js(t, a);
    }, i;
  }
  function Jm(t) {
    return t = x0(t), t.tag = 3, t;
  }
  function Wm(t, a, i, o) {
    var f = i.type.getDerivedStateFromError;
    if (typeof f == "function") {
      var m = o.value;
      t.payload = function() {
        return f(m);
      }, t.callback = function() {
        Qm(a, i, o);
      };
    }
    var S = i.stateNode;
    S !== null && typeof S.componentDidCatch == "function" && (t.callback = function() {
      Qm(a, i, o), typeof f != "function" && (z0 === null ? z0 = /* @__PURE__ */ new Set([this]) : z0.add(this));
      var C = o.stack;
      this.componentDidCatch(o.value, {
        componentStack: C !== null ? C : ""
      });
    });
  }
  function B8(t, a, i, o, f) {
    if (i.flags |= 32768, o !== null && typeof o == "object" && typeof o.then == "function") {
      if (a = i.alternate, a !== null && Gr(
        a,
        i,
        f,
        !0
      ), i = kn.current, i !== null) {
        switch (i.tag) {
          case 31:
          case 13:
            return Kn === null ? uo() : i.alternate === null && At === 0 && (At = 3), i.flags &= -257, i.flags |= 65536, i.lanes = f, o === qs ? i.flags |= 16384 : (a = i.updateQueue, a === null ? i.updateQueue = /* @__PURE__ */ new Set([o]) : a.add(o), zf(t, o, f)), !1;
          case 22:
            return i.flags |= 65536, o === qs ? i.flags |= 16384 : (a = i.updateQueue, a === null ? (a = {
              transitions: null,
              markerInstances: null,
              retryQueue: /* @__PURE__ */ new Set([o])
            }, i.updateQueue = a) : (i = a.retryQueue, i === null ? a.retryQueue = /* @__PURE__ */ new Set([o]) : i.add(o)), zf(t, o, f)), !1;
        }
        throw Error(l(435, i.tag));
      }
      return zf(t, o, f), uo(), !1;
    }
    if (Pe)
      return a = kn.current, a !== null ? ((a.flags & 65536) === 0 && (a.flags |= 256), a.flags |= 65536, a.lanes = f, o !== xc && (t = Error(l(422), { cause: o }), Ql($n(t, i)))) : (o !== xc && (a = Error(l(423), {
        cause: o
      }), Ql(
        $n(a, i)
      )), t = t.current.alternate, t.flags |= 65536, f &= -f, t.lanes |= f, o = $n(o, i), f = ef(
        t.stateNode,
        o,
        f
      ), kc(t, f), At !== 4 && (At = 2)), !1;
    var m = Error(l(520), { cause: o });
    if (m = $n(m, i), pi === null ? pi = [m] : pi.push(m), At !== 4 && (At = 2), a === null) return !0;
    o = $n(o, i), i = a;
    do {
      switch (i.tag) {
        case 3:
          return i.flags |= 65536, t = f & -f, i.lanes |= t, t = ef(i.stateNode, o, t), kc(i, t), !1;
        case 1:
          if (a = i.type, m = i.stateNode, (i.flags & 128) === 0 && (typeof a.getDerivedStateFromError == "function" || m !== null && typeof m.componentDidCatch == "function" && (z0 === null || !z0.has(m))))
            return i.flags |= 65536, f &= -f, i.lanes |= f, f = Jm(f), Wm(
              f,
              t,
              i,
              o
            ), kc(i, f), !1;
      }
      i = i.return;
    } while (i !== null);
    return !1;
  }
  var tf = Error(l(461)), Lt = !1;
  function Pt(t, a, i, o) {
    a.child = t === null ? nm(a, null, i, o) : pr(
      a,
      t.child,
      i,
      o
    );
  }
  function Pm(t, a, i, o, f) {
    i = i.render;
    var m = a.ref;
    if ("ref" in o) {
      var S = {};
      for (var C in o)
        C !== "ref" && (S[C] = o[C]);
    } else S = o;
    return fr(a), o = Hc(
      t,
      a,
      i,
      S,
      m,
      f
    ), C = Lc(), t !== null && !Lt ? (qc(t, a, f), Va(t, a, f)) : (Pe && C && yc(a), a.flags |= 1, Pt(t, a, o, f), a.child);
  }
  function e4(t, a, i, o, f) {
    if (t === null) {
      var m = i.type;
      return typeof m == "function" && !mc(m) && m.defaultProps === void 0 && i.compare === null ? (a.tag = 15, a.type = m, t4(
        t,
        a,
        m,
        o,
        f
      )) : (t = _s(
        i.type,
        null,
        o,
        a,
        a.mode,
        f
      ), t.ref = a.ref, t.return = a, a.child = t);
    }
    if (m = t.child, !cf(t, f)) {
      var S = m.memoizedProps;
      if (i = i.compare, i = i !== null ? i : Fl, i(S, o) && t.ref === a.ref)
        return Va(t, a, f);
    }
    return a.flags |= 1, t = Oa(m, o), t.ref = a.ref, t.return = a, a.child = t;
  }
  function t4(t, a, i, o, f) {
    if (t !== null) {
      var m = t.memoizedProps;
      if (Fl(m, o) && t.ref === a.ref)
        if (Lt = !1, a.pendingProps = o = m, cf(t, f))
          (t.flags & 131072) !== 0 && (Lt = !0);
        else
          return a.lanes = t.lanes, Va(t, a, f);
    }
    return nf(
      t,
      a,
      i,
      o,
      f
    );
  }
  function n4(t, a, i, o) {
    var f = o.children, m = t !== null ? t.memoizedState : null;
    if (t === null && a.stateNode === null && (a.stateNode = {
      _visibility: 1,
      _pendingMarkers: null,
      _retryCache: null,
      _transitions: null
    }), o.mode === "hidden") {
      if ((a.flags & 128) !== 0) {
        if (m = m !== null ? m.baseLanes | i : i, t !== null) {
          for (o = a.child = t.child, f = 0; o !== null; )
            f = f | o.lanes | o.childLanes, o = o.sibling;
          o = f & ~m;
        } else o = 0, a.child = null;
        return a4(
          t,
          a,
          m,
          i,
          o
        );
      }
      if ((i & 536870912) !== 0)
        a.memoizedState = { baseLanes: 0, cachePool: null }, t !== null && Hs(
          a,
          m !== null ? m.cachePool : null
        ), m !== null ? lm(a, m) : _c(), im(a);
      else
        return o = a.lanes = 536870912, a4(
          t,
          a,
          m !== null ? m.baseLanes | i : i,
          i,
          o
        );
    } else
      m !== null ? (Hs(a, m.cachePool), lm(a, m), w0(), a.memoizedState = null) : (t !== null && Hs(a, null), _c(), w0());
    return Pt(t, a, f, i), a.child;
  }
  function oi(t, a) {
    return t !== null && t.tag === 22 || a.stateNode !== null || (a.stateNode = {
      _visibility: 1,
      _pendingMarkers: null,
      _retryCache: null,
      _transitions: null
    }), a.sibling;
  }
  function a4(t, a, i, o, f) {
    var m = zc();
    return m = m === null ? null : { parent: Ot._currentValue, pool: m }, a.memoizedState = {
      baseLanes: i,
      cachePool: m
    }, t !== null && Hs(a, null), _c(), im(a), t !== null && Gr(t, a, o, !0), a.childLanes = f, null;
  }
  function Ws(t, a) {
    return a = eo(
      { mode: a.mode, children: a.children },
      t.mode
    ), a.ref = t.ref, t.child = a, a.return = t, a;
  }
  function r4(t, a, i) {
    return pr(a, t.child, null, i), t = Ws(a, a.pendingProps), t.flags |= 2, Dn(a), a.memoizedState = null, t;
  }
  function O8(t, a, i) {
    var o = a.pendingProps, f = (a.flags & 128) !== 0;
    if (a.flags &= -129, t === null) {
      if (Pe) {
        if (o.mode === "hidden")
          return t = Ws(a, o), a.lanes = 536870912, oi(null, t);
        if (Bc(a), (t = gt) ? (t = g2(
          t,
          In
        ), t = t !== null && t.data === "&" ? t : null, t !== null && (a.memoizedState = {
          dehydrated: t,
          treeContext: m0 !== null ? { id: da, overflow: ma } : null,
          retryLane: 536870912,
          hydrationErrors: null
        }, i = Vd(t), i.return = a, a.child = i, Jt = a, gt = null)) : t = null, t === null) throw g0(a);
        return a.lanes = 536870912, null;
      }
      return Ws(a, o);
    }
    var m = t.memoizedState;
    if (m !== null) {
      var S = m.dehydrated;
      if (Bc(a), f)
        if (a.flags & 256)
          a.flags &= -257, a = r4(
            t,
            a,
            i
          );
        else if (a.memoizedState !== null)
          a.child = t.child, a.flags |= 128, a = null;
        else throw Error(l(558));
      else if (Lt || Gr(t, a, i, !1), f = (i & t.childLanes) !== 0, Lt || f) {
        if (o = ht, o !== null && (S = cs(o, i), S !== 0 && S !== m.retryLane))
          throw m.retryLane = S, sr(t, S), bn(o, t, S), tf;
        uo(), a = r4(
          t,
          a,
          i
        );
      } else
        t = m.treeContext, gt = Qn(S.nextSibling), Jt = a, Pe = !0, p0 = null, In = !1, t !== null && Xd(a, t), a = Ws(a, o), a.flags |= 4096;
      return a;
    }
    return t = Oa(t.child, {
      mode: o.mode,
      children: o.children
    }), t.ref = a.ref, a.child = t, t.return = a, t;
  }
  function Ps(t, a) {
    var i = a.ref;
    if (i === null)
      t !== null && t.ref !== null && (a.flags |= 4194816);
    else {
      if (typeof i != "function" && typeof i != "object")
        throw Error(l(284));
      (t === null || t.ref !== i) && (a.flags |= 4194816);
    }
  }
  function nf(t, a, i, o, f) {
    return fr(a), i = Hc(
      t,
      a,
      i,
      o,
      void 0,
      f
    ), o = Lc(), t !== null && !Lt ? (qc(t, a, f), Va(t, a, f)) : (Pe && o && yc(a), a.flags |= 1, Pt(t, a, i, f), a.child);
  }
  function l4(t, a, i, o, f, m) {
    return fr(a), a.updateQueue = null, i = om(
      a,
      o,
      i,
      f
    ), sm(t), o = Lc(), t !== null && !Lt ? (qc(t, a, m), Va(t, a, m)) : (Pe && o && yc(a), a.flags |= 1, Pt(t, a, i, m), a.child);
  }
  function i4(t, a, i, o, f) {
    if (fr(a), a.stateNode === null) {
      var m = Ur, S = i.contextType;
      typeof S == "object" && S !== null && (m = Wt(S)), m = new i(o, m), a.memoizedState = m.state !== null && m.state !== void 0 ? m.state : null, m.updater = Pc, a.stateNode = m, m._reactInternals = a, m = a.stateNode, m.props = o, m.state = a.memoizedState, m.refs = {}, Cc(a), S = i.contextType, m.context = typeof S == "object" && S !== null ? Wt(S) : Ur, m.state = a.memoizedState, S = i.getDerivedStateFromProps, typeof S == "function" && (Wc(
        a,
        i,
        S,
        o
      ), m.state = a.memoizedState), typeof i.getDerivedStateFromProps == "function" || typeof m.getSnapshotBeforeUpdate == "function" || typeof m.UNSAFE_componentWillMount != "function" && typeof m.componentWillMount != "function" || (S = m.state, typeof m.componentWillMount == "function" && m.componentWillMount(), typeof m.UNSAFE_componentWillMount == "function" && m.UNSAFE_componentWillMount(), S !== m.state && Pc.enqueueReplaceState(m, m.state, null), ai(a, o, m, f), ni(), m.state = a.memoizedState), typeof m.componentDidMount == "function" && (a.flags |= 4194308), o = !0;
    } else if (t === null) {
      m = a.stateNode;
      var C = a.memoizedProps, j = yr(i, C);
      m.props = j;
      var ee = m.context, fe = i.contextType;
      S = Ur, typeof fe == "object" && fe !== null && (S = Wt(fe));
      var pe = i.getDerivedStateFromProps;
      fe = typeof pe == "function" || typeof m.getSnapshotBeforeUpdate == "function", C = a.pendingProps !== C, fe || typeof m.UNSAFE_componentWillReceiveProps != "function" && typeof m.componentWillReceiveProps != "function" || (C || ee !== S) && Zm(
        a,
        m,
        o,
        S
      ), v0 = !1;
      var ne = a.memoizedState;
      m.state = ne, ai(a, o, m, f), ni(), ee = a.memoizedState, C || ne !== ee || v0 ? (typeof pe == "function" && (Wc(
        a,
        i,
        pe,
        o
      ), ee = a.memoizedState), (j = v0 || $m(
        a,
        i,
        j,
        o,
        ne,
        ee,
        S
      )) ? (fe || typeof m.UNSAFE_componentWillMount != "function" && typeof m.componentWillMount != "function" || (typeof m.componentWillMount == "function" && m.componentWillMount(), typeof m.UNSAFE_componentWillMount == "function" && m.UNSAFE_componentWillMount()), typeof m.componentDidMount == "function" && (a.flags |= 4194308)) : (typeof m.componentDidMount == "function" && (a.flags |= 4194308), a.memoizedProps = o, a.memoizedState = ee), m.props = o, m.state = ee, m.context = S, o = j) : (typeof m.componentDidMount == "function" && (a.flags |= 4194308), o = !1);
    } else {
      m = a.stateNode, Nc(t, a), S = a.memoizedProps, fe = yr(i, S), m.props = fe, pe = a.pendingProps, ne = m.context, ee = i.contextType, j = Ur, typeof ee == "object" && ee !== null && (j = Wt(ee)), C = i.getDerivedStateFromProps, (ee = typeof C == "function" || typeof m.getSnapshotBeforeUpdate == "function") || typeof m.UNSAFE_componentWillReceiveProps != "function" && typeof m.componentWillReceiveProps != "function" || (S !== pe || ne !== j) && Zm(
        a,
        m,
        o,
        j
      ), v0 = !1, ne = a.memoizedState, m.state = ne, ai(a, o, m, f), ni();
      var oe = a.memoizedState;
      S !== pe || ne !== oe || v0 || t !== null && t.dependencies !== null && Bs(t.dependencies) ? (typeof C == "function" && (Wc(
        a,
        i,
        C,
        o
      ), oe = a.memoizedState), (fe = v0 || $m(
        a,
        i,
        fe,
        o,
        ne,
        oe,
        j
      ) || t !== null && t.dependencies !== null && Bs(t.dependencies)) ? (ee || typeof m.UNSAFE_componentWillUpdate != "function" && typeof m.componentWillUpdate != "function" || (typeof m.componentWillUpdate == "function" && m.componentWillUpdate(o, oe, j), typeof m.UNSAFE_componentWillUpdate == "function" && m.UNSAFE_componentWillUpdate(
        o,
        oe,
        j
      )), typeof m.componentDidUpdate == "function" && (a.flags |= 4), typeof m.getSnapshotBeforeUpdate == "function" && (a.flags |= 1024)) : (typeof m.componentDidUpdate != "function" || S === t.memoizedProps && ne === t.memoizedState || (a.flags |= 4), typeof m.getSnapshotBeforeUpdate != "function" || S === t.memoizedProps && ne === t.memoizedState || (a.flags |= 1024), a.memoizedProps = o, a.memoizedState = oe), m.props = o, m.state = oe, m.context = j, o = fe) : (typeof m.componentDidUpdate != "function" || S === t.memoizedProps && ne === t.memoizedState || (a.flags |= 4), typeof m.getSnapshotBeforeUpdate != "function" || S === t.memoizedProps && ne === t.memoizedState || (a.flags |= 1024), o = !1);
    }
    return m = o, Ps(t, a), o = (a.flags & 128) !== 0, m || o ? (m = a.stateNode, i = o && typeof i.getDerivedStateFromError != "function" ? null : m.render(), a.flags |= 1, t !== null && o ? (a.child = pr(
      a,
      t.child,
      null,
      f
    ), a.child = pr(
      a,
      null,
      i,
      f
    )) : Pt(t, a, i, f), a.memoizedState = m.state, t = a.child) : t = Va(
      t,
      a,
      f
    ), t;
  }
  function s4(t, a, i, o) {
    return ur(), a.flags |= 256, Pt(t, a, i, o), a.child;
  }
  var af = {
    dehydrated: null,
    treeContext: null,
    retryLane: 0,
    hydrationErrors: null
  };
  function rf(t) {
    return { baseLanes: t, cachePool: Qd() };
  }
  function lf(t, a, i) {
    return t = t !== null ? t.childLanes & ~i : 0, a && (t |= Rn), t;
  }
  function o4(t, a, i) {
    var o = a.pendingProps, f = !1, m = (a.flags & 128) !== 0, S;
    if ((S = m) || (S = t !== null && t.memoizedState === null ? !1 : (Dt.current & 2) !== 0), S && (f = !0, a.flags &= -129), S = (a.flags & 32) !== 0, a.flags &= -33, t === null) {
      if (Pe) {
        if (f ? S0(a) : w0(), (t = gt) ? (t = g2(
          t,
          In
        ), t = t !== null && t.data !== "&" ? t : null, t !== null && (a.memoizedState = {
          dehydrated: t,
          treeContext: m0 !== null ? { id: da, overflow: ma } : null,
          retryLane: 536870912,
          hydrationErrors: null
        }, i = Vd(t), i.return = a, a.child = i, Jt = a, gt = null)) : t = null, t === null) throw g0(a);
        return Yf(t) ? a.lanes = 32 : a.lanes = 536870912, null;
      }
      var C = o.children;
      return o = o.fallback, f ? (w0(), f = a.mode, C = eo(
        { mode: "hidden", children: C },
        f
      ), o = or(
        o,
        f,
        i,
        null
      ), C.return = a, o.return = a, C.sibling = o, a.child = C, o = a.child, o.memoizedState = rf(i), o.childLanes = lf(
        t,
        S,
        i
      ), a.memoizedState = af, oi(null, o)) : (S0(a), sf(a, C));
    }
    var j = t.memoizedState;
    if (j !== null && (C = j.dehydrated, C !== null)) {
      if (m)
        a.flags & 256 ? (S0(a), a.flags &= -257, a = of(
          t,
          a,
          i
        )) : a.memoizedState !== null ? (w0(), a.child = t.child, a.flags |= 128, a = null) : (w0(), C = o.fallback, f = a.mode, o = eo(
          { mode: "visible", children: o.children },
          f
        ), C = or(
          C,
          f,
          i,
          null
        ), C.flags |= 2, o.return = a, C.return = a, o.sibling = C, a.child = o, pr(
          a,
          t.child,
          null,
          i
        ), o = a.child, o.memoizedState = rf(i), o.childLanes = lf(
          t,
          S,
          i
        ), a.memoizedState = af, a = oi(null, o));
      else if (S0(a), Yf(C)) {
        if (S = C.nextSibling && C.nextSibling.dataset, S) var ee = S.dgst;
        S = ee, o = Error(l(419)), o.stack = "", o.digest = S, Ql({ value: o, source: null, stack: null }), a = of(
          t,
          a,
          i
        );
      } else if (Lt || Gr(t, a, i, !1), S = (i & t.childLanes) !== 0, Lt || S) {
        if (S = ht, S !== null && (o = cs(S, i), o !== 0 && o !== j.retryLane))
          throw j.retryLane = o, sr(t, o), bn(S, t, o), tf;
        Vf(C) || uo(), a = of(
          t,
          a,
          i
        );
      } else
        Vf(C) ? (a.flags |= 192, a.child = t.child, a = null) : (t = j.treeContext, gt = Qn(
          C.nextSibling
        ), Jt = a, Pe = !0, p0 = null, In = !1, t !== null && Xd(a, t), a = sf(
          a,
          o.children
        ), a.flags |= 4096);
      return a;
    }
    return f ? (w0(), C = o.fallback, f = a.mode, j = t.child, ee = j.sibling, o = Oa(j, {
      mode: "hidden",
      children: o.children
    }), o.subtreeFlags = j.subtreeFlags & 65011712, ee !== null ? C = Oa(
      ee,
      C
    ) : (C = or(
      C,
      f,
      i,
      null
    ), C.flags |= 2), C.return = a, o.return = a, o.sibling = C, a.child = o, oi(null, o), o = a.child, C = t.child.memoizedState, C === null ? C = rf(i) : (f = C.cachePool, f !== null ? (j = Ot._currentValue, f = f.parent !== j ? { parent: j, pool: j } : f) : f = Qd(), C = {
      baseLanes: C.baseLanes | i,
      cachePool: f
    }), o.memoizedState = C, o.childLanes = lf(
      t,
      S,
      i
    ), a.memoizedState = af, oi(t.child, o)) : (S0(a), i = t.child, t = i.sibling, i = Oa(i, {
      mode: "visible",
      children: o.children
    }), i.return = a, i.sibling = null, t !== null && (S = a.deletions, S === null ? (a.deletions = [t], a.flags |= 16) : S.push(t)), a.child = i, a.memoizedState = null, i);
  }
  function sf(t, a) {
    return a = eo(
      { mode: "visible", children: a },
      t.mode
    ), a.return = t, t.child = a;
  }
  function eo(t, a) {
    return t = Nn(22, t, null, a), t.lanes = 0, t;
  }
  function of(t, a, i) {
    return pr(a, t.child, null, i), t = sf(
      a,
      a.pendingProps.children
    ), t.flags |= 2, a.memoizedState = null, t;
  }
  function u4(t, a, i) {
    t.lanes |= a;
    var o = t.alternate;
    o !== null && (o.lanes |= a), wc(t.return, a, i);
  }
  function uf(t, a, i, o, f, m) {
    var S = t.memoizedState;
    S === null ? t.memoizedState = {
      isBackwards: a,
      rendering: null,
      renderingStartTime: 0,
      last: o,
      tail: i,
      tailMode: f,
      treeForkCount: m
    } : (S.isBackwards = a, S.rendering = null, S.renderingStartTime = 0, S.last = o, S.tail = i, S.tailMode = f, S.treeForkCount = m);
  }
  function c4(t, a, i) {
    var o = a.pendingProps, f = o.revealOrder, m = o.tail;
    o = o.children;
    var S = Dt.current, C = (S & 2) !== 0;
    if (C ? (S = S & 1 | 2, a.flags |= 128) : S &= 1, ae(Dt, S), Pt(t, a, o, i), o = Pe ? Kl : 0, !C && t !== null && (t.flags & 128) !== 0)
      e: for (t = a.child; t !== null; ) {
        if (t.tag === 13)
          t.memoizedState !== null && u4(t, i, a);
        else if (t.tag === 19)
          u4(t, i, a);
        else if (t.child !== null) {
          t.child.return = t, t = t.child;
          continue;
        }
        if (t === a) break e;
        for (; t.sibling === null; ) {
          if (t.return === null || t.return === a)
            break e;
          t = t.return;
        }
        t.sibling.return = t.return, t = t.sibling;
      }
    switch (f) {
      case "forwards":
        for (i = a.child, f = null; i !== null; )
          t = i.alternate, t !== null && Ys(t) === null && (f = i), i = i.sibling;
        i = f, i === null ? (f = a.child, a.child = null) : (f = i.sibling, i.sibling = null), uf(
          a,
          !1,
          f,
          i,
          m,
          o
        );
        break;
      case "backwards":
      case "unstable_legacy-backwards":
        for (i = null, f = a.child, a.child = null; f !== null; ) {
          if (t = f.alternate, t !== null && Ys(t) === null) {
            a.child = f;
            break;
          }
          t = f.sibling, f.sibling = i, i = f, f = t;
        }
        uf(
          a,
          !0,
          i,
          null,
          m,
          o
        );
        break;
      case "together":
        uf(
          a,
          !1,
          null,
          null,
          void 0,
          o
        );
        break;
      default:
        a.memoizedState = null;
    }
    return a.child;
  }
  function Va(t, a, i) {
    if (t !== null && (a.dependencies = t.dependencies), T0 |= a.lanes, (i & a.childLanes) === 0)
      if (t !== null) {
        if (Gr(
          t,
          a,
          i,
          !1
        ), (i & a.childLanes) === 0)
          return null;
      } else return null;
    if (t !== null && a.child !== t.child)
      throw Error(l(153));
    if (a.child !== null) {
      for (t = a.child, i = Oa(t, t.pendingProps), a.child = i, i.return = a; t.sibling !== null; )
        t = t.sibling, i = i.sibling = Oa(t, t.pendingProps), i.return = a;
      i.sibling = null;
    }
    return a.child;
  }
  function cf(t, a) {
    return (t.lanes & a) !== 0 ? !0 : (t = t.dependencies, !!(t !== null && Bs(t)));
  }
  function H8(t, a, i) {
    switch (a.tag) {
      case 3:
        Re(a, a.stateNode.containerInfo), y0(a, Ot, t.memoizedState.cache), ur();
        break;
      case 27:
      case 5:
        Xe(a);
        break;
      case 4:
        Re(a, a.stateNode.containerInfo);
        break;
      case 10:
        y0(
          a,
          a.type,
          a.memoizedProps.value
        );
        break;
      case 31:
        if (a.memoizedState !== null)
          return a.flags |= 128, Bc(a), null;
        break;
      case 13:
        var o = a.memoizedState;
        if (o !== null)
          return o.dehydrated !== null ? (S0(a), a.flags |= 128, null) : (i & a.child.childLanes) !== 0 ? o4(t, a, i) : (S0(a), t = Va(
            t,
            a,
            i
          ), t !== null ? t.sibling : null);
        S0(a);
        break;
      case 19:
        var f = (t.flags & 128) !== 0;
        if (o = (i & a.childLanes) !== 0, o || (Gr(
          t,
          a,
          i,
          !1
        ), o = (i & a.childLanes) !== 0), f) {
          if (o)
            return c4(
              t,
              a,
              i
            );
          a.flags |= 128;
        }
        if (f = a.memoizedState, f !== null && (f.rendering = null, f.tail = null, f.lastEffect = null), ae(Dt, Dt.current), o) break;
        return null;
      case 22:
        return a.lanes = 0, n4(
          t,
          a,
          i,
          a.pendingProps
        );
      case 24:
        y0(a, Ot, t.memoizedState.cache);
    }
    return Va(t, a, i);
  }
  function f4(t, a, i) {
    if (t !== null)
      if (t.memoizedProps !== a.pendingProps)
        Lt = !0;
      else {
        if (!cf(t, i) && (a.flags & 128) === 0)
          return Lt = !1, H8(
            t,
            a,
            i
          );
        Lt = (t.flags & 131072) !== 0;
      }
    else
      Lt = !1, Pe && (a.flags & 1048576) !== 0 && Gd(a, Kl, a.index);
    switch (a.lanes = 0, a.tag) {
      case 16:
        e: {
          var o = a.pendingProps;
          if (t = dr(a.elementType), a.type = t, typeof t == "function")
            mc(t) ? (o = yr(t, o), a.tag = 1, a = i4(
              null,
              a,
              t,
              o,
              i
            )) : (a.tag = 0, a = nf(
              null,
              a,
              t,
              o,
              i
            ));
          else {
            if (t != null) {
              var f = t.$$typeof;
              if (f === H) {
                a.tag = 11, a = Pm(
                  null,
                  a,
                  t,
                  o,
                  i
                );
                break e;
              } else if (f === Q) {
                a.tag = 14, a = e4(
                  null,
                  a,
                  t,
                  o,
                  i
                );
                break e;
              }
            }
            throw a = _(t) || t, Error(l(306, a, ""));
          }
        }
        return a;
      case 0:
        return nf(
          t,
          a,
          a.type,
          a.pendingProps,
          i
        );
      case 1:
        return o = a.type, f = yr(
          o,
          a.pendingProps
        ), i4(
          t,
          a,
          o,
          f,
          i
        );
      case 3:
        e: {
          if (Re(
            a,
            a.stateNode.containerInfo
          ), t === null) throw Error(l(387));
          o = a.pendingProps;
          var m = a.memoizedState;
          f = m.element, Nc(t, a), ai(a, o, null, i);
          var S = a.memoizedState;
          if (o = S.cache, y0(a, Ot, o), o !== m.cache && Ec(
            a,
            [Ot],
            i,
            !0
          ), ni(), o = S.element, m.isDehydrated)
            if (m = {
              element: o,
              isDehydrated: !1,
              cache: S.cache
            }, a.updateQueue.baseState = m, a.memoizedState = m, a.flags & 256) {
              a = s4(
                t,
                a,
                o,
                i
              );
              break e;
            } else if (o !== f) {
              f = $n(
                Error(l(424)),
                a
              ), Ql(f), a = s4(
                t,
                a,
                o,
                i
              );
              break e;
            } else
              for (t = a.stateNode.containerInfo, t.nodeType === 9 ? t = t.body : t = t.nodeName === "HTML" ? t.ownerDocument.body : t, gt = Qn(t.firstChild), Jt = a, Pe = !0, p0 = null, In = !0, i = nm(
                a,
                null,
                o,
                i
              ), a.child = i; i; )
                i.flags = i.flags & -3 | 4096, i = i.sibling;
          else {
            if (ur(), o === f) {
              a = Va(
                t,
                a,
                i
              );
              break e;
            }
            Pt(t, a, o, i);
          }
          a = a.child;
        }
        return a;
      case 26:
        return Ps(t, a), t === null ? (i = w2(
          a.type,
          null,
          a.pendingProps,
          null
        )) ? a.memoizedState = i : Pe || (i = a.type, t = a.pendingProps, o = yo(
          Te.current
        ).createElement(i), o[Gt] = a, o[Qt] = t, en(o, i, t), Bt(o), a.stateNode = o) : a.memoizedState = w2(
          a.type,
          t.memoizedProps,
          a.pendingProps,
          t.memoizedState
        ), null;
      case 27:
        return Xe(a), t === null && Pe && (o = a.stateNode = x2(
          a.type,
          a.pendingProps,
          Te.current
        ), Jt = a, In = !0, f = gt, k0(a.type) ? (Gf = f, gt = Qn(o.firstChild)) : gt = f), Pt(
          t,
          a,
          a.pendingProps.children,
          i
        ), Ps(t, a), t === null && (a.flags |= 4194304), a.child;
      case 5:
        return t === null && Pe && ((f = o = gt) && (o = hg(
          o,
          a.type,
          a.pendingProps,
          In
        ), o !== null ? (a.stateNode = o, Jt = a, gt = Qn(o.firstChild), In = !1, f = !0) : f = !1), f || g0(a)), Xe(a), f = a.type, m = a.pendingProps, S = t !== null ? t.memoizedProps : null, o = m.children, qf(f, m) ? o = null : S !== null && qf(f, S) && (a.flags |= 32), a.memoizedState !== null && (f = Hc(
          t,
          a,
          A8,
          null,
          null,
          i
        ), Ei._currentValue = f), Ps(t, a), Pt(t, a, o, i), a.child;
      case 6:
        return t === null && Pe && ((t = i = gt) && (i = dg(
          i,
          a.pendingProps,
          In
        ), i !== null ? (a.stateNode = i, Jt = a, gt = null, t = !0) : t = !1), t || g0(a)), null;
      case 13:
        return o4(t, a, i);
      case 4:
        return Re(
          a,
          a.stateNode.containerInfo
        ), o = a.pendingProps, t === null ? a.child = pr(
          a,
          null,
          o,
          i
        ) : Pt(t, a, o, i), a.child;
      case 11:
        return Pm(
          t,
          a,
          a.type,
          a.pendingProps,
          i
        );
      case 7:
        return Pt(
          t,
          a,
          a.pendingProps,
          i
        ), a.child;
      case 8:
        return Pt(
          t,
          a,
          a.pendingProps.children,
          i
        ), a.child;
      case 12:
        return Pt(
          t,
          a,
          a.pendingProps.children,
          i
        ), a.child;
      case 10:
        return o = a.pendingProps, y0(a, a.type, o.value), Pt(t, a, o.children, i), a.child;
      case 9:
        return f = a.type._context, o = a.pendingProps.children, fr(a), f = Wt(f), o = o(f), a.flags |= 1, Pt(t, a, o, i), a.child;
      case 14:
        return e4(
          t,
          a,
          a.type,
          a.pendingProps,
          i
        );
      case 15:
        return t4(
          t,
          a,
          a.type,
          a.pendingProps,
          i
        );
      case 19:
        return c4(t, a, i);
      case 31:
        return O8(t, a, i);
      case 22:
        return n4(
          t,
          a,
          i,
          a.pendingProps
        );
      case 24:
        return fr(a), o = Wt(Ot), t === null ? (f = zc(), f === null && (f = ht, m = Mc(), f.pooledCache = m, m.refCount++, m !== null && (f.pooledCacheLanes |= i), f = m), a.memoizedState = { parent: o, cache: f }, Cc(a), y0(a, Ot, f)) : ((t.lanes & i) !== 0 && (Nc(t, a), ai(a, null, null, i), ni()), f = t.memoizedState, m = a.memoizedState, f.parent !== o ? (f = { parent: o, cache: o }, a.memoizedState = f, a.lanes === 0 && (a.memoizedState = a.updateQueue.baseState = f), y0(a, Ot, o)) : (o = m.cache, y0(a, Ot, o), o !== f.cache && Ec(
          a,
          [Ot],
          i,
          !0
        ))), Pt(
          t,
          a,
          a.pendingProps.children,
          i
        ), a.child;
      case 29:
        throw a.pendingProps;
    }
    throw Error(l(156, a.tag));
  }
  function Ya(t) {
    t.flags |= 4;
  }
  function ff(t, a, i, o, f) {
    if ((a = (t.mode & 32) !== 0) && (a = !1), a) {
      if (t.flags |= 16777216, (f & 335544128) === f)
        if (t.stateNode.complete) t.flags |= 8192;
        else if (q4()) t.flags |= 8192;
        else
          throw mr = qs, Ac;
    } else t.flags &= -16777217;
  }
  function h4(t, a) {
    if (a.type !== "stylesheet" || (a.state.loading & 4) !== 0)
      t.flags &= -16777217;
    else if (t.flags |= 16777216, !A2(a))
      if (q4()) t.flags |= 8192;
      else
        throw mr = qs, Ac;
  }
  function to(t, a) {
    a !== null && (t.flags |= 4), t.flags & 16384 && (a = t.tag !== 22 ? ss() : 536870912, t.lanes |= a, tl |= a);
  }
  function ui(t, a) {
    if (!Pe)
      switch (t.tailMode) {
        case "hidden":
          a = t.tail;
          for (var i = null; a !== null; )
            a.alternate !== null && (i = a), a = a.sibling;
          i === null ? t.tail = null : i.sibling = null;
          break;
        case "collapsed":
          i = t.tail;
          for (var o = null; i !== null; )
            i.alternate !== null && (o = i), i = i.sibling;
          o === null ? a || t.tail === null ? t.tail = null : t.tail.sibling = null : o.sibling = null;
      }
  }
  function yt(t) {
    var a = t.alternate !== null && t.alternate.child === t.child, i = 0, o = 0;
    if (a)
      for (var f = t.child; f !== null; )
        i |= f.lanes | f.childLanes, o |= f.subtreeFlags & 65011712, o |= f.flags & 65011712, f.return = t, f = f.sibling;
    else
      for (f = t.child; f !== null; )
        i |= f.lanes | f.childLanes, o |= f.subtreeFlags, o |= f.flags, f.return = t, f = f.sibling;
    return t.subtreeFlags |= o, t.childLanes = i, a;
  }
  function L8(t, a, i) {
    var o = a.pendingProps;
    switch (vc(a), a.tag) {
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return yt(a), null;
      case 1:
        return yt(a), null;
      case 3:
        return i = a.stateNode, o = null, t !== null && (o = t.memoizedState.cache), a.memoizedState.cache !== o && (a.flags |= 2048), qa(Ot), Be(), i.pendingContext && (i.context = i.pendingContext, i.pendingContext = null), (t === null || t.child === null) && (Yr(a) ? Ya(a) : t === null || t.memoizedState.isDehydrated && (a.flags & 256) === 0 || (a.flags |= 1024, bc())), yt(a), null;
      case 26:
        var f = a.type, m = a.memoizedState;
        return t === null ? (Ya(a), m !== null ? (yt(a), h4(a, m)) : (yt(a), ff(
          a,
          f,
          null,
          o,
          i
        ))) : m ? m !== t.memoizedState ? (Ya(a), yt(a), h4(a, m)) : (yt(a), a.flags &= -16777217) : (t = t.memoizedProps, t !== o && Ya(a), yt(a), ff(
          a,
          f,
          t,
          o,
          i
        )), null;
      case 27:
        if (lt(a), i = Te.current, f = a.type, t !== null && a.stateNode != null)
          t.memoizedProps !== o && Ya(a);
        else {
          if (!o) {
            if (a.stateNode === null)
              throw Error(l(166));
            return yt(a), null;
          }
          t = se.current, Yr(a) ? $d(a) : (t = x2(f, o, i), a.stateNode = t, Ya(a));
        }
        return yt(a), null;
      case 5:
        if (lt(a), f = a.type, t !== null && a.stateNode != null)
          t.memoizedProps !== o && Ya(a);
        else {
          if (!o) {
            if (a.stateNode === null)
              throw Error(l(166));
            return yt(a), null;
          }
          if (m = se.current, Yr(a))
            $d(a);
          else {
            var S = yo(
              Te.current
            );
            switch (m) {
              case 1:
                m = S.createElementNS(
                  "http://www.w3.org/2000/svg",
                  f
                );
                break;
              case 2:
                m = S.createElementNS(
                  "http://www.w3.org/1998/Math/MathML",
                  f
                );
                break;
              default:
                switch (f) {
                  case "svg":
                    m = S.createElementNS(
                      "http://www.w3.org/2000/svg",
                      f
                    );
                    break;
                  case "math":
                    m = S.createElementNS(
                      "http://www.w3.org/1998/Math/MathML",
                      f
                    );
                    break;
                  case "script":
                    m = S.createElement("div"), m.innerHTML = "<script><\/script>", m = m.removeChild(
                      m.firstChild
                    );
                    break;
                  case "select":
                    m = typeof o.is == "string" ? S.createElement("select", {
                      is: o.is
                    }) : S.createElement("select"), o.multiple ? m.multiple = !0 : o.size && (m.size = o.size);
                    break;
                  default:
                    m = typeof o.is == "string" ? S.createElement(f, { is: o.is }) : S.createElement(f);
                }
            }
            m[Gt] = a, m[Qt] = o;
            e: for (S = a.child; S !== null; ) {
              if (S.tag === 5 || S.tag === 6)
                m.appendChild(S.stateNode);
              else if (S.tag !== 4 && S.tag !== 27 && S.child !== null) {
                S.child.return = S, S = S.child;
                continue;
              }
              if (S === a) break e;
              for (; S.sibling === null; ) {
                if (S.return === null || S.return === a)
                  break e;
                S = S.return;
              }
              S.sibling.return = S.return, S = S.sibling;
            }
            a.stateNode = m;
            e: switch (en(m, f, o), f) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                o = !!o.autoFocus;
                break e;
              case "img":
                o = !0;
                break e;
              default:
                o = !1;
            }
            o && Ya(a);
          }
        }
        return yt(a), ff(
          a,
          a.type,
          t === null ? null : t.memoizedProps,
          a.pendingProps,
          i
        ), null;
      case 6:
        if (t && a.stateNode != null)
          t.memoizedProps !== o && Ya(a);
        else {
          if (typeof o != "string" && a.stateNode === null)
            throw Error(l(166));
          if (t = Te.current, Yr(a)) {
            if (t = a.stateNode, i = a.memoizedProps, o = null, f = Jt, f !== null)
              switch (f.tag) {
                case 27:
                case 5:
                  o = f.memoizedProps;
              }
            t[Gt] = a, t = !!(t.nodeValue === i || o !== null && o.suppressHydrationWarning === !0 || o2(t.nodeValue, i)), t || g0(a, !0);
          } else
            t = yo(t).createTextNode(
              o
            ), t[Gt] = a, a.stateNode = t;
        }
        return yt(a), null;
      case 31:
        if (i = a.memoizedState, t === null || t.memoizedState !== null) {
          if (o = Yr(a), i !== null) {
            if (t === null) {
              if (!o) throw Error(l(318));
              if (t = a.memoizedState, t = t !== null ? t.dehydrated : null, !t) throw Error(l(557));
              t[Gt] = a;
            } else
              ur(), (a.flags & 128) === 0 && (a.memoizedState = null), a.flags |= 4;
            yt(a), t = !1;
          } else
            i = bc(), t !== null && t.memoizedState !== null && (t.memoizedState.hydrationErrors = i), t = !0;
          if (!t)
            return a.flags & 256 ? (Dn(a), a) : (Dn(a), null);
          if ((a.flags & 128) !== 0)
            throw Error(l(558));
        }
        return yt(a), null;
      case 13:
        if (o = a.memoizedState, t === null || t.memoizedState !== null && t.memoizedState.dehydrated !== null) {
          if (f = Yr(a), o !== null && o.dehydrated !== null) {
            if (t === null) {
              if (!f) throw Error(l(318));
              if (f = a.memoizedState, f = f !== null ? f.dehydrated : null, !f) throw Error(l(317));
              f[Gt] = a;
            } else
              ur(), (a.flags & 128) === 0 && (a.memoizedState = null), a.flags |= 4;
            yt(a), f = !1;
          } else
            f = bc(), t !== null && t.memoizedState !== null && (t.memoizedState.hydrationErrors = f), f = !0;
          if (!f)
            return a.flags & 256 ? (Dn(a), a) : (Dn(a), null);
        }
        return Dn(a), (a.flags & 128) !== 0 ? (a.lanes = i, a) : (i = o !== null, t = t !== null && t.memoizedState !== null, i && (o = a.child, f = null, o.alternate !== null && o.alternate.memoizedState !== null && o.alternate.memoizedState.cachePool !== null && (f = o.alternate.memoizedState.cachePool.pool), m = null, o.memoizedState !== null && o.memoizedState.cachePool !== null && (m = o.memoizedState.cachePool.pool), m !== f && (o.flags |= 2048)), i !== t && i && (a.child.flags |= 8192), to(a, a.updateQueue), yt(a), null);
      case 4:
        return Be(), t === null && Rf(a.stateNode.containerInfo), yt(a), null;
      case 10:
        return qa(a.type), yt(a), null;
      case 19:
        if (G(Dt), o = a.memoizedState, o === null) return yt(a), null;
        if (f = (a.flags & 128) !== 0, m = o.rendering, m === null)
          if (f) ui(o, !1);
          else {
            if (At !== 0 || t !== null && (t.flags & 128) !== 0)
              for (t = a.child; t !== null; ) {
                if (m = Ys(t), m !== null) {
                  for (a.flags |= 128, ui(o, !1), t = m.updateQueue, a.updateQueue = t, to(a, t), a.subtreeFlags = 0, t = i, i = a.child; i !== null; )
                    jd(i, t), i = i.sibling;
                  return ae(
                    Dt,
                    Dt.current & 1 | 2
                  ), Pe && Ha(a, o.treeForkCount), a.child;
                }
                t = t.sibling;
              }
            o.tail !== null && We() > io && (a.flags |= 128, f = !0, ui(o, !1), a.lanes = 4194304);
          }
        else {
          if (!f)
            if (t = Ys(m), t !== null) {
              if (a.flags |= 128, f = !0, t = t.updateQueue, a.updateQueue = t, to(a, t), ui(o, !0), o.tail === null && o.tailMode === "hidden" && !m.alternate && !Pe)
                return yt(a), null;
            } else
              2 * We() - o.renderingStartTime > io && i !== 536870912 && (a.flags |= 128, f = !0, ui(o, !1), a.lanes = 4194304);
          o.isBackwards ? (m.sibling = a.child, a.child = m) : (t = o.last, t !== null ? t.sibling = m : a.child = m, o.last = m);
        }
        return o.tail !== null ? (t = o.tail, o.rendering = t, o.tail = t.sibling, o.renderingStartTime = We(), t.sibling = null, i = Dt.current, ae(
          Dt,
          f ? i & 1 | 2 : i & 1
        ), Pe && Ha(a, o.treeForkCount), t) : (yt(a), null);
      case 22:
      case 23:
        return Dn(a), Rc(), o = a.memoizedState !== null, t !== null ? t.memoizedState !== null !== o && (a.flags |= 8192) : o && (a.flags |= 8192), o ? (i & 536870912) !== 0 && (a.flags & 128) === 0 && (yt(a), a.subtreeFlags & 6 && (a.flags |= 8192)) : yt(a), i = a.updateQueue, i !== null && to(a, i.retryQueue), i = null, t !== null && t.memoizedState !== null && t.memoizedState.cachePool !== null && (i = t.memoizedState.cachePool.pool), o = null, a.memoizedState !== null && a.memoizedState.cachePool !== null && (o = a.memoizedState.cachePool.pool), o !== i && (a.flags |= 2048), t !== null && G(hr), null;
      case 24:
        return i = null, t !== null && (i = t.memoizedState.cache), a.memoizedState.cache !== i && (a.flags |= 2048), qa(Ot), yt(a), null;
      case 25:
        return null;
      case 30:
        return null;
    }
    throw Error(l(156, a.tag));
  }
  function q8(t, a) {
    switch (vc(a), a.tag) {
      case 1:
        return t = a.flags, t & 65536 ? (a.flags = t & -65537 | 128, a) : null;
      case 3:
        return qa(Ot), Be(), t = a.flags, (t & 65536) !== 0 && (t & 128) === 0 ? (a.flags = t & -65537 | 128, a) : null;
      case 26:
      case 27:
      case 5:
        return lt(a), null;
      case 31:
        if (a.memoizedState !== null) {
          if (Dn(a), a.alternate === null)
            throw Error(l(340));
          ur();
        }
        return t = a.flags, t & 65536 ? (a.flags = t & -65537 | 128, a) : null;
      case 13:
        if (Dn(a), t = a.memoizedState, t !== null && t.dehydrated !== null) {
          if (a.alternate === null)
            throw Error(l(340));
          ur();
        }
        return t = a.flags, t & 65536 ? (a.flags = t & -65537 | 128, a) : null;
      case 19:
        return G(Dt), null;
      case 4:
        return Be(), null;
      case 10:
        return qa(a.type), null;
      case 22:
      case 23:
        return Dn(a), Rc(), t !== null && G(hr), t = a.flags, t & 65536 ? (a.flags = t & -65537 | 128, a) : null;
      case 24:
        return qa(Ot), null;
      case 25:
        return null;
      default:
        return null;
    }
  }
  function d4(t, a) {
    switch (vc(a), a.tag) {
      case 3:
        qa(Ot), Be();
        break;
      case 26:
      case 27:
      case 5:
        lt(a);
        break;
      case 4:
        Be();
        break;
      case 31:
        a.memoizedState !== null && Dn(a);
        break;
      case 13:
        Dn(a);
        break;
      case 19:
        G(Dt);
        break;
      case 10:
        qa(a.type);
        break;
      case 22:
      case 23:
        Dn(a), Rc(), t !== null && G(hr);
        break;
      case 24:
        qa(Ot);
    }
  }
  function ci(t, a) {
    try {
      var i = a.updateQueue, o = i !== null ? i.lastEffect : null;
      if (o !== null) {
        var f = o.next;
        i = f;
        do {
          if ((i.tag & t) === t) {
            o = void 0;
            var m = i.create, S = i.inst;
            o = m(), S.destroy = o;
          }
          i = i.next;
        } while (i !== f);
      }
    } catch (C) {
      st(a, a.return, C);
    }
  }
  function E0(t, a, i) {
    try {
      var o = a.updateQueue, f = o !== null ? o.lastEffect : null;
      if (f !== null) {
        var m = f.next;
        o = m;
        do {
          if ((o.tag & t) === t) {
            var S = o.inst, C = S.destroy;
            if (C !== void 0) {
              S.destroy = void 0, f = a;
              var j = i, ee = C;
              try {
                ee();
              } catch (fe) {
                st(
                  f,
                  j,
                  fe
                );
              }
            }
          }
          o = o.next;
        } while (o !== m);
      }
    } catch (fe) {
      st(a, a.return, fe);
    }
  }
  function m4(t) {
    var a = t.updateQueue;
    if (a !== null) {
      var i = t.stateNode;
      try {
        rm(a, i);
      } catch (o) {
        st(t, t.return, o);
      }
    }
  }
  function p4(t, a, i) {
    i.props = yr(
      t.type,
      t.memoizedProps
    ), i.state = t.memoizedState;
    try {
      i.componentWillUnmount();
    } catch (o) {
      st(t, a, o);
    }
  }
  function fi(t, a) {
    try {
      var i = t.ref;
      if (i !== null) {
        switch (t.tag) {
          case 26:
          case 27:
          case 5:
            var o = t.stateNode;
            break;
          case 30:
            o = t.stateNode;
            break;
          default:
            o = t.stateNode;
        }
        typeof i == "function" ? t.refCleanup = i(o) : i.current = o;
      }
    } catch (f) {
      st(t, a, f);
    }
  }
  function pa(t, a) {
    var i = t.ref, o = t.refCleanup;
    if (i !== null)
      if (typeof o == "function")
        try {
          o();
        } catch (f) {
          st(t, a, f);
        } finally {
          t.refCleanup = null, t = t.alternate, t != null && (t.refCleanup = null);
        }
      else if (typeof i == "function")
        try {
          i(null);
        } catch (f) {
          st(t, a, f);
        }
      else i.current = null;
  }
  function g4(t) {
    var a = t.type, i = t.memoizedProps, o = t.stateNode;
    try {
      e: switch (a) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          i.autoFocus && o.focus();
          break e;
        case "img":
          i.src ? o.src = i.src : i.srcSet && (o.srcset = i.srcSet);
      }
    } catch (f) {
      st(t, t.return, f);
    }
  }
  function hf(t, a, i) {
    try {
      var o = t.stateNode;
      ig(o, t.type, i, a), o[Qt] = a;
    } catch (f) {
      st(t, t.return, f);
    }
  }
  function y4(t) {
    return t.tag === 5 || t.tag === 3 || t.tag === 26 || t.tag === 27 && k0(t.type) || t.tag === 4;
  }
  function df(t) {
    e: for (; ; ) {
      for (; t.sibling === null; ) {
        if (t.return === null || y4(t.return)) return null;
        t = t.return;
      }
      for (t.sibling.return = t.return, t = t.sibling; t.tag !== 5 && t.tag !== 6 && t.tag !== 18; ) {
        if (t.tag === 27 && k0(t.type) || t.flags & 2 || t.child === null || t.tag === 4) continue e;
        t.child.return = t, t = t.child;
      }
      if (!(t.flags & 2)) return t.stateNode;
    }
  }
  function mf(t, a, i) {
    var o = t.tag;
    if (o === 5 || o === 6)
      t = t.stateNode, a ? (i.nodeType === 9 ? i.body : i.nodeName === "HTML" ? i.ownerDocument.body : i).insertBefore(t, a) : (a = i.nodeType === 9 ? i.body : i.nodeName === "HTML" ? i.ownerDocument.body : i, a.appendChild(t), i = i._reactRootContainer, i != null || a.onclick !== null || (a.onclick = Ra));
    else if (o !== 4 && (o === 27 && k0(t.type) && (i = t.stateNode, a = null), t = t.child, t !== null))
      for (mf(t, a, i), t = t.sibling; t !== null; )
        mf(t, a, i), t = t.sibling;
  }
  function no(t, a, i) {
    var o = t.tag;
    if (o === 5 || o === 6)
      t = t.stateNode, a ? i.insertBefore(t, a) : i.appendChild(t);
    else if (o !== 4 && (o === 27 && k0(t.type) && (i = t.stateNode), t = t.child, t !== null))
      for (no(t, a, i), t = t.sibling; t !== null; )
        no(t, a, i), t = t.sibling;
  }
  function v4(t) {
    var a = t.stateNode, i = t.memoizedProps;
    try {
      for (var o = t.type, f = a.attributes; f.length; )
        a.removeAttributeNode(f[0]);
      en(a, o, i), a[Gt] = t, a[Qt] = i;
    } catch (m) {
      st(t, t.return, m);
    }
  }
  var Ga = !1, qt = !1, pf = !1, x4 = typeof WeakSet == "function" ? WeakSet : Set, It = null;
  function U8(t, a) {
    if (t = t.containerInfo, Hf = Mo, t = Dd(t), sc(t)) {
      if ("selectionStart" in t)
        var i = {
          start: t.selectionStart,
          end: t.selectionEnd
        };
      else
        e: {
          i = (i = t.ownerDocument) && i.defaultView || window;
          var o = i.getSelection && i.getSelection();
          if (o && o.rangeCount !== 0) {
            i = o.anchorNode;
            var f = o.anchorOffset, m = o.focusNode;
            o = o.focusOffset;
            try {
              i.nodeType, m.nodeType;
            } catch {
              i = null;
              break e;
            }
            var S = 0, C = -1, j = -1, ee = 0, fe = 0, pe = t, ne = null;
            t: for (; ; ) {
              for (var oe; pe !== i || f !== 0 && pe.nodeType !== 3 || (C = S + f), pe !== m || o !== 0 && pe.nodeType !== 3 || (j = S + o), pe.nodeType === 3 && (S += pe.nodeValue.length), (oe = pe.firstChild) !== null; )
                ne = pe, pe = oe;
              for (; ; ) {
                if (pe === t) break t;
                if (ne === i && ++ee === f && (C = S), ne === m && ++fe === o && (j = S), (oe = pe.nextSibling) !== null) break;
                pe = ne, ne = pe.parentNode;
              }
              pe = oe;
            }
            i = C === -1 || j === -1 ? null : { start: C, end: j };
          } else i = null;
        }
      i = i || { start: 0, end: 0 };
    } else i = null;
    for (Lf = { focusedElem: t, selectionRange: i }, Mo = !1, It = a; It !== null; )
      if (a = It, t = a.child, (a.subtreeFlags & 1028) !== 0 && t !== null)
        t.return = a, It = t;
      else
        for (; It !== null; ) {
          switch (a = It, m = a.alternate, t = a.flags, a.tag) {
            case 0:
              if ((t & 4) !== 0 && (t = a.updateQueue, t = t !== null ? t.events : null, t !== null))
                for (i = 0; i < t.length; i++)
                  f = t[i], f.ref.impl = f.nextImpl;
              break;
            case 11:
            case 15:
              break;
            case 1:
              if ((t & 1024) !== 0 && m !== null) {
                t = void 0, i = a, f = m.memoizedProps, m = m.memoizedState, o = i.stateNode;
                try {
                  var ke = yr(
                    i.type,
                    f
                  );
                  t = o.getSnapshotBeforeUpdate(
                    ke,
                    m
                  ), o.__reactInternalSnapshotBeforeUpdate = t;
                } catch (Ue) {
                  st(
                    i,
                    i.return,
                    Ue
                  );
                }
              }
              break;
            case 3:
              if ((t & 1024) !== 0) {
                if (t = a.stateNode.containerInfo, i = t.nodeType, i === 9)
                  jf(t);
                else if (i === 1)
                  switch (t.nodeName) {
                    case "HEAD":
                    case "HTML":
                    case "BODY":
                      jf(t);
                      break;
                    default:
                      t.textContent = "";
                  }
              }
              break;
            case 5:
            case 26:
            case 27:
            case 6:
            case 4:
            case 17:
              break;
            default:
              if ((t & 1024) !== 0) throw Error(l(163));
          }
          if (t = a.sibling, t !== null) {
            t.return = a.return, It = t;
            break;
          }
          It = a.return;
        }
  }
  function b4(t, a, i) {
    var o = i.flags;
    switch (i.tag) {
      case 0:
      case 11:
      case 15:
        $a(t, i), o & 4 && ci(5, i);
        break;
      case 1:
        if ($a(t, i), o & 4)
          if (t = i.stateNode, a === null)
            try {
              t.componentDidMount();
            } catch (S) {
              st(i, i.return, S);
            }
          else {
            var f = yr(
              i.type,
              a.memoizedProps
            );
            a = a.memoizedState;
            try {
              t.componentDidUpdate(
                f,
                a,
                t.__reactInternalSnapshotBeforeUpdate
              );
            } catch (S) {
              st(
                i,
                i.return,
                S
              );
            }
          }
        o & 64 && m4(i), o & 512 && fi(i, i.return);
        break;
      case 3:
        if ($a(t, i), o & 64 && (t = i.updateQueue, t !== null)) {
          if (a = null, i.child !== null)
            switch (i.child.tag) {
              case 27:
              case 5:
                a = i.child.stateNode;
                break;
              case 1:
                a = i.child.stateNode;
            }
          try {
            rm(t, a);
          } catch (S) {
            st(i, i.return, S);
          }
        }
        break;
      case 27:
        a === null && o & 4 && v4(i);
      case 26:
      case 5:
        $a(t, i), a === null && o & 4 && g4(i), o & 512 && fi(i, i.return);
        break;
      case 12:
        $a(t, i);
        break;
      case 31:
        $a(t, i), o & 4 && E4(t, i);
        break;
      case 13:
        $a(t, i), o & 4 && M4(t, i), o & 64 && (t = i.memoizedState, t !== null && (t = t.dehydrated, t !== null && (i = I8.bind(
          null,
          i
        ), mg(t, i))));
        break;
      case 22:
        if (o = i.memoizedState !== null || Ga, !o) {
          a = a !== null && a.memoizedState !== null || qt, f = Ga;
          var m = qt;
          Ga = o, (qt = a) && !m ? Za(
            t,
            i,
            (i.subtreeFlags & 8772) !== 0
          ) : $a(t, i), Ga = f, qt = m;
        }
        break;
      case 30:
        break;
      default:
        $a(t, i);
    }
  }
  function S4(t) {
    var a = t.alternate;
    a !== null && (t.alternate = null, S4(a)), t.child = null, t.deletions = null, t.sibling = null, t.tag === 5 && (a = t.stateNode, a !== null && ql(a)), t.stateNode = null, t.return = null, t.dependencies = null, t.memoizedProps = null, t.memoizedState = null, t.pendingProps = null, t.stateNode = null, t.updateQueue = null;
  }
  var xt = null, gn = !1;
  function Xa(t, a, i) {
    for (i = i.child; i !== null; )
      w4(t, a, i), i = i.sibling;
  }
  function w4(t, a, i) {
    if (kt && typeof kt.onCommitFiberUnmount == "function")
      try {
        kt.onCommitFiberUnmount(An, i);
      } catch {
      }
    switch (i.tag) {
      case 26:
        qt || pa(i, a), Xa(
          t,
          a,
          i
        ), i.memoizedState ? i.memoizedState.count-- : i.stateNode && (i = i.stateNode, i.parentNode.removeChild(i));
        break;
      case 27:
        qt || pa(i, a);
        var o = xt, f = gn;
        k0(i.type) && (xt = i.stateNode, gn = !1), Xa(
          t,
          a,
          i
        ), bi(i.stateNode), xt = o, gn = f;
        break;
      case 5:
        qt || pa(i, a);
      case 6:
        if (o = xt, f = gn, xt = null, Xa(
          t,
          a,
          i
        ), xt = o, gn = f, xt !== null)
          if (gn)
            try {
              (xt.nodeType === 9 ? xt.body : xt.nodeName === "HTML" ? xt.ownerDocument.body : xt).removeChild(i.stateNode);
            } catch (m) {
              st(
                i,
                a,
                m
              );
            }
          else
            try {
              xt.removeChild(i.stateNode);
            } catch (m) {
              st(
                i,
                a,
                m
              );
            }
        break;
      case 18:
        xt !== null && (gn ? (t = xt, m2(
          t.nodeType === 9 ? t.body : t.nodeName === "HTML" ? t.ownerDocument.body : t,
          i.stateNode
        ), ul(t)) : m2(xt, i.stateNode));
        break;
      case 4:
        o = xt, f = gn, xt = i.stateNode.containerInfo, gn = !0, Xa(
          t,
          a,
          i
        ), xt = o, gn = f;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        E0(2, i, a), qt || E0(4, i, a), Xa(
          t,
          a,
          i
        );
        break;
      case 1:
        qt || (pa(i, a), o = i.stateNode, typeof o.componentWillUnmount == "function" && p4(
          i,
          a,
          o
        )), Xa(
          t,
          a,
          i
        );
        break;
      case 21:
        Xa(
          t,
          a,
          i
        );
        break;
      case 22:
        qt = (o = qt) || i.memoizedState !== null, Xa(
          t,
          a,
          i
        ), qt = o;
        break;
      default:
        Xa(
          t,
          a,
          i
        );
    }
  }
  function E4(t, a) {
    if (a.memoizedState === null && (t = a.alternate, t !== null && (t = t.memoizedState, t !== null))) {
      t = t.dehydrated;
      try {
        ul(t);
      } catch (i) {
        st(a, a.return, i);
      }
    }
  }
  function M4(t, a) {
    if (a.memoizedState === null && (t = a.alternate, t !== null && (t = t.memoizedState, t !== null && (t = t.dehydrated, t !== null))))
      try {
        ul(t);
      } catch (i) {
        st(a, a.return, i);
      }
  }
  function j8(t) {
    switch (t.tag) {
      case 31:
      case 13:
      case 19:
        var a = t.stateNode;
        return a === null && (a = t.stateNode = new x4()), a;
      case 22:
        return t = t.stateNode, a = t._retryCache, a === null && (a = t._retryCache = new x4()), a;
      default:
        throw Error(l(435, t.tag));
    }
  }
  function ao(t, a) {
    var i = j8(t);
    a.forEach(function(o) {
      if (!i.has(o)) {
        i.add(o);
        var f = K8.bind(null, t, o);
        o.then(f, f);
      }
    });
  }
  function yn(t, a) {
    var i = a.deletions;
    if (i !== null)
      for (var o = 0; o < i.length; o++) {
        var f = i[o], m = t, S = a, C = S;
        e: for (; C !== null; ) {
          switch (C.tag) {
            case 27:
              if (k0(C.type)) {
                xt = C.stateNode, gn = !1;
                break e;
              }
              break;
            case 5:
              xt = C.stateNode, gn = !1;
              break e;
            case 3:
            case 4:
              xt = C.stateNode.containerInfo, gn = !0;
              break e;
          }
          C = C.return;
        }
        if (xt === null) throw Error(l(160));
        w4(m, S, f), xt = null, gn = !1, m = f.alternate, m !== null && (m.return = null), f.return = null;
      }
    if (a.subtreeFlags & 13886)
      for (a = a.child; a !== null; )
        T4(a, t), a = a.sibling;
  }
  var ra = null;
  function T4(t, a) {
    var i = t.alternate, o = t.flags;
    switch (t.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        yn(a, t), vn(t), o & 4 && (E0(3, t, t.return), ci(3, t), E0(5, t, t.return));
        break;
      case 1:
        yn(a, t), vn(t), o & 512 && (qt || i === null || pa(i, i.return)), o & 64 && Ga && (t = t.updateQueue, t !== null && (o = t.callbacks, o !== null && (i = t.shared.hiddenCallbacks, t.shared.hiddenCallbacks = i === null ? o : i.concat(o))));
        break;
      case 26:
        var f = ra;
        if (yn(a, t), vn(t), o & 512 && (qt || i === null || pa(i, i.return)), o & 4) {
          var m = i !== null ? i.memoizedState : null;
          if (o = t.memoizedState, i === null)
            if (o === null)
              if (t.stateNode === null) {
                e: {
                  o = t.type, i = t.memoizedProps, f = f.ownerDocument || f;
                  t: switch (o) {
                    case "title":
                      m = f.getElementsByTagName("title")[0], (!m || m[nr] || m[Gt] || m.namespaceURI === "http://www.w3.org/2000/svg" || m.hasAttribute("itemprop")) && (m = f.createElement(o), f.head.insertBefore(
                        m,
                        f.querySelector("head > title")
                      )), en(m, o, i), m[Gt] = t, Bt(m), o = m;
                      break e;
                    case "link":
                      var S = T2(
                        "link",
                        "href",
                        f
                      ).get(o + (i.href || ""));
                      if (S) {
                        for (var C = 0; C < S.length; C++)
                          if (m = S[C], m.getAttribute("href") === (i.href == null || i.href === "" ? null : i.href) && m.getAttribute("rel") === (i.rel == null ? null : i.rel) && m.getAttribute("title") === (i.title == null ? null : i.title) && m.getAttribute("crossorigin") === (i.crossOrigin == null ? null : i.crossOrigin)) {
                            S.splice(C, 1);
                            break t;
                          }
                      }
                      m = f.createElement(o), en(m, o, i), f.head.appendChild(m);
                      break;
                    case "meta":
                      if (S = T2(
                        "meta",
                        "content",
                        f
                      ).get(o + (i.content || ""))) {
                        for (C = 0; C < S.length; C++)
                          if (m = S[C], m.getAttribute("content") === (i.content == null ? null : "" + i.content) && m.getAttribute("name") === (i.name == null ? null : i.name) && m.getAttribute("property") === (i.property == null ? null : i.property) && m.getAttribute("http-equiv") === (i.httpEquiv == null ? null : i.httpEquiv) && m.getAttribute("charset") === (i.charSet == null ? null : i.charSet)) {
                            S.splice(C, 1);
                            break t;
                          }
                      }
                      m = f.createElement(o), en(m, o, i), f.head.appendChild(m);
                      break;
                    default:
                      throw Error(l(468, o));
                  }
                  m[Gt] = t, Bt(m), o = m;
                }
                t.stateNode = o;
              } else
                z2(
                  f,
                  t.type,
                  t.stateNode
                );
            else
              t.stateNode = M2(
                f,
                o,
                t.memoizedProps
              );
          else
            m !== o ? (m === null ? i.stateNode !== null && (i = i.stateNode, i.parentNode.removeChild(i)) : m.count--, o === null ? z2(
              f,
              t.type,
              t.stateNode
            ) : M2(
              f,
              o,
              t.memoizedProps
            )) : o === null && t.stateNode !== null && hf(
              t,
              t.memoizedProps,
              i.memoizedProps
            );
        }
        break;
      case 27:
        yn(a, t), vn(t), o & 512 && (qt || i === null || pa(i, i.return)), i !== null && o & 4 && hf(
          t,
          t.memoizedProps,
          i.memoizedProps
        );
        break;
      case 5:
        if (yn(a, t), vn(t), o & 512 && (qt || i === null || pa(i, i.return)), t.flags & 32) {
          f = t.stateNode;
          try {
            _r(f, "");
          } catch (ke) {
            st(t, t.return, ke);
          }
        }
        o & 4 && t.stateNode != null && (f = t.memoizedProps, hf(
          t,
          f,
          i !== null ? i.memoizedProps : f
        )), o & 1024 && (pf = !0);
        break;
      case 6:
        if (yn(a, t), vn(t), o & 4) {
          if (t.stateNode === null)
            throw Error(l(162));
          o = t.memoizedProps, i = t.stateNode;
          try {
            i.nodeValue = o;
          } catch (ke) {
            st(t, t.return, ke);
          }
        }
        break;
      case 3:
        if (bo = null, f = ra, ra = vo(a.containerInfo), yn(a, t), ra = f, vn(t), o & 4 && i !== null && i.memoizedState.isDehydrated)
          try {
            ul(a.containerInfo);
          } catch (ke) {
            st(t, t.return, ke);
          }
        pf && (pf = !1, z4(t));
        break;
      case 4:
        o = ra, ra = vo(
          t.stateNode.containerInfo
        ), yn(a, t), vn(t), ra = o;
        break;
      case 12:
        yn(a, t), vn(t);
        break;
      case 31:
        yn(a, t), vn(t), o & 4 && (o = t.updateQueue, o !== null && (t.updateQueue = null, ao(t, o)));
        break;
      case 13:
        yn(a, t), vn(t), t.child.flags & 8192 && t.memoizedState !== null != (i !== null && i.memoizedState !== null) && (lo = We()), o & 4 && (o = t.updateQueue, o !== null && (t.updateQueue = null, ao(t, o)));
        break;
      case 22:
        f = t.memoizedState !== null;
        var j = i !== null && i.memoizedState !== null, ee = Ga, fe = qt;
        if (Ga = ee || f, qt = fe || j, yn(a, t), qt = fe, Ga = ee, vn(t), o & 8192)
          e: for (a = t.stateNode, a._visibility = f ? a._visibility & -2 : a._visibility | 1, f && (i === null || j || Ga || qt || vr(t)), i = null, a = t; ; ) {
            if (a.tag === 5 || a.tag === 26) {
              if (i === null) {
                j = i = a;
                try {
                  if (m = j.stateNode, f)
                    S = m.style, typeof S.setProperty == "function" ? S.setProperty("display", "none", "important") : S.display = "none";
                  else {
                    C = j.stateNode;
                    var pe = j.memoizedProps.style, ne = pe != null && pe.hasOwnProperty("display") ? pe.display : null;
                    C.style.display = ne == null || typeof ne == "boolean" ? "" : ("" + ne).trim();
                  }
                } catch (ke) {
                  st(j, j.return, ke);
                }
              }
            } else if (a.tag === 6) {
              if (i === null) {
                j = a;
                try {
                  j.stateNode.nodeValue = f ? "" : j.memoizedProps;
                } catch (ke) {
                  st(j, j.return, ke);
                }
              }
            } else if (a.tag === 18) {
              if (i === null) {
                j = a;
                try {
                  var oe = j.stateNode;
                  f ? p2(oe, !0) : p2(j.stateNode, !1);
                } catch (ke) {
                  st(j, j.return, ke);
                }
              }
            } else if ((a.tag !== 22 && a.tag !== 23 || a.memoizedState === null || a === t) && a.child !== null) {
              a.child.return = a, a = a.child;
              continue;
            }
            if (a === t) break e;
            for (; a.sibling === null; ) {
              if (a.return === null || a.return === t) break e;
              i === a && (i = null), a = a.return;
            }
            i === a && (i = null), a.sibling.return = a.return, a = a.sibling;
          }
        o & 4 && (o = t.updateQueue, o !== null && (i = o.retryQueue, i !== null && (o.retryQueue = null, ao(t, i))));
        break;
      case 19:
        yn(a, t), vn(t), o & 4 && (o = t.updateQueue, o !== null && (t.updateQueue = null, ao(t, o)));
        break;
      case 30:
        break;
      case 21:
        break;
      default:
        yn(a, t), vn(t);
    }
  }
  function vn(t) {
    var a = t.flags;
    if (a & 2) {
      try {
        for (var i, o = t.return; o !== null; ) {
          if (y4(o)) {
            i = o;
            break;
          }
          o = o.return;
        }
        if (i == null) throw Error(l(160));
        switch (i.tag) {
          case 27:
            var f = i.stateNode, m = df(t);
            no(t, m, f);
            break;
          case 5:
            var S = i.stateNode;
            i.flags & 32 && (_r(S, ""), i.flags &= -33);
            var C = df(t);
            no(t, C, S);
            break;
          case 3:
          case 4:
            var j = i.stateNode.containerInfo, ee = df(t);
            mf(
              t,
              ee,
              j
            );
            break;
          default:
            throw Error(l(161));
        }
      } catch (fe) {
        st(t, t.return, fe);
      }
      t.flags &= -3;
    }
    a & 4096 && (t.flags &= -4097);
  }
  function z4(t) {
    if (t.subtreeFlags & 1024)
      for (t = t.child; t !== null; ) {
        var a = t;
        z4(a), a.tag === 5 && a.flags & 1024 && a.stateNode.reset(), t = t.sibling;
      }
  }
  function $a(t, a) {
    if (a.subtreeFlags & 8772)
      for (a = a.child; a !== null; )
        b4(t, a.alternate, a), a = a.sibling;
  }
  function vr(t) {
    for (t = t.child; t !== null; ) {
      var a = t;
      switch (a.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          E0(4, a, a.return), vr(a);
          break;
        case 1:
          pa(a, a.return);
          var i = a.stateNode;
          typeof i.componentWillUnmount == "function" && p4(
            a,
            a.return,
            i
          ), vr(a);
          break;
        case 27:
          bi(a.stateNode);
        case 26:
        case 5:
          pa(a, a.return), vr(a);
          break;
        case 22:
          a.memoizedState === null && vr(a);
          break;
        case 30:
          vr(a);
          break;
        default:
          vr(a);
      }
      t = t.sibling;
    }
  }
  function Za(t, a, i) {
    for (i = i && (a.subtreeFlags & 8772) !== 0, a = a.child; a !== null; ) {
      var o = a.alternate, f = t, m = a, S = m.flags;
      switch (m.tag) {
        case 0:
        case 11:
        case 15:
          Za(
            f,
            m,
            i
          ), ci(4, m);
          break;
        case 1:
          if (Za(
            f,
            m,
            i
          ), o = m, f = o.stateNode, typeof f.componentDidMount == "function")
            try {
              f.componentDidMount();
            } catch (ee) {
              st(o, o.return, ee);
            }
          if (o = m, f = o.updateQueue, f !== null) {
            var C = o.stateNode;
            try {
              var j = f.shared.hiddenCallbacks;
              if (j !== null)
                for (f.shared.hiddenCallbacks = null, f = 0; f < j.length; f++)
                  am(j[f], C);
            } catch (ee) {
              st(o, o.return, ee);
            }
          }
          i && S & 64 && m4(m), fi(m, m.return);
          break;
        case 27:
          v4(m);
        case 26:
        case 5:
          Za(
            f,
            m,
            i
          ), i && o === null && S & 4 && g4(m), fi(m, m.return);
          break;
        case 12:
          Za(
            f,
            m,
            i
          );
          break;
        case 31:
          Za(
            f,
            m,
            i
          ), i && S & 4 && E4(f, m);
          break;
        case 13:
          Za(
            f,
            m,
            i
          ), i && S & 4 && M4(f, m);
          break;
        case 22:
          m.memoizedState === null && Za(
            f,
            m,
            i
          ), fi(m, m.return);
          break;
        case 30:
          break;
        default:
          Za(
            f,
            m,
            i
          );
      }
      a = a.sibling;
    }
  }
  function gf(t, a) {
    var i = null;
    t !== null && t.memoizedState !== null && t.memoizedState.cachePool !== null && (i = t.memoizedState.cachePool.pool), t = null, a.memoizedState !== null && a.memoizedState.cachePool !== null && (t = a.memoizedState.cachePool.pool), t !== i && (t != null && t.refCount++, i != null && Jl(i));
  }
  function yf(t, a) {
    t = null, a.alternate !== null && (t = a.alternate.memoizedState.cache), a = a.memoizedState.cache, a !== t && (a.refCount++, t != null && Jl(t));
  }
  function la(t, a, i, o) {
    if (a.subtreeFlags & 10256)
      for (a = a.child; a !== null; )
        A4(
          t,
          a,
          i,
          o
        ), a = a.sibling;
  }
  function A4(t, a, i, o) {
    var f = a.flags;
    switch (a.tag) {
      case 0:
      case 11:
      case 15:
        la(
          t,
          a,
          i,
          o
        ), f & 2048 && ci(9, a);
        break;
      case 1:
        la(
          t,
          a,
          i,
          o
        );
        break;
      case 3:
        la(
          t,
          a,
          i,
          o
        ), f & 2048 && (t = null, a.alternate !== null && (t = a.alternate.memoizedState.cache), a = a.memoizedState.cache, a !== t && (a.refCount++, t != null && Jl(t)));
        break;
      case 12:
        if (f & 2048) {
          la(
            t,
            a,
            i,
            o
          ), t = a.stateNode;
          try {
            var m = a.memoizedProps, S = m.id, C = m.onPostCommit;
            typeof C == "function" && C(
              S,
              a.alternate === null ? "mount" : "update",
              t.passiveEffectDuration,
              -0
            );
          } catch (j) {
            st(a, a.return, j);
          }
        } else
          la(
            t,
            a,
            i,
            o
          );
        break;
      case 31:
        la(
          t,
          a,
          i,
          o
        );
        break;
      case 13:
        la(
          t,
          a,
          i,
          o
        );
        break;
      case 23:
        break;
      case 22:
        m = a.stateNode, S = a.alternate, a.memoizedState !== null ? m._visibility & 2 ? la(
          t,
          a,
          i,
          o
        ) : hi(t, a) : m._visibility & 2 ? la(
          t,
          a,
          i,
          o
        ) : (m._visibility |= 2, Wr(
          t,
          a,
          i,
          o,
          (a.subtreeFlags & 10256) !== 0 || !1
        )), f & 2048 && gf(S, a);
        break;
      case 24:
        la(
          t,
          a,
          i,
          o
        ), f & 2048 && yf(a.alternate, a);
        break;
      default:
        la(
          t,
          a,
          i,
          o
        );
    }
  }
  function Wr(t, a, i, o, f) {
    for (f = f && ((a.subtreeFlags & 10256) !== 0 || !1), a = a.child; a !== null; ) {
      var m = t, S = a, C = i, j = o, ee = S.flags;
      switch (S.tag) {
        case 0:
        case 11:
        case 15:
          Wr(
            m,
            S,
            C,
            j,
            f
          ), ci(8, S);
          break;
        case 23:
          break;
        case 22:
          var fe = S.stateNode;
          S.memoizedState !== null ? fe._visibility & 2 ? Wr(
            m,
            S,
            C,
            j,
            f
          ) : hi(
            m,
            S
          ) : (fe._visibility |= 2, Wr(
            m,
            S,
            C,
            j,
            f
          )), f && ee & 2048 && gf(
            S.alternate,
            S
          );
          break;
        case 24:
          Wr(
            m,
            S,
            C,
            j,
            f
          ), f && ee & 2048 && yf(S.alternate, S);
          break;
        default:
          Wr(
            m,
            S,
            C,
            j,
            f
          );
      }
      a = a.sibling;
    }
  }
  function hi(t, a) {
    if (a.subtreeFlags & 10256)
      for (a = a.child; a !== null; ) {
        var i = t, o = a, f = o.flags;
        switch (o.tag) {
          case 22:
            hi(i, o), f & 2048 && gf(
              o.alternate,
              o
            );
            break;
          case 24:
            hi(i, o), f & 2048 && yf(o.alternate, o);
            break;
          default:
            hi(i, o);
        }
        a = a.sibling;
      }
  }
  var di = 8192;
  function Pr(t, a, i) {
    if (t.subtreeFlags & di)
      for (t = t.child; t !== null; )
        C4(
          t,
          a,
          i
        ), t = t.sibling;
  }
  function C4(t, a, i) {
    switch (t.tag) {
      case 26:
        Pr(
          t,
          a,
          i
        ), t.flags & di && t.memoizedState !== null && zg(
          i,
          ra,
          t.memoizedState,
          t.memoizedProps
        );
        break;
      case 5:
        Pr(
          t,
          a,
          i
        );
        break;
      case 3:
      case 4:
        var o = ra;
        ra = vo(t.stateNode.containerInfo), Pr(
          t,
          a,
          i
        ), ra = o;
        break;
      case 22:
        t.memoizedState === null && (o = t.alternate, o !== null && o.memoizedState !== null ? (o = di, di = 16777216, Pr(
          t,
          a,
          i
        ), di = o) : Pr(
          t,
          a,
          i
        ));
        break;
      default:
        Pr(
          t,
          a,
          i
        );
    }
  }
  function N4(t) {
    var a = t.alternate;
    if (a !== null && (t = a.child, t !== null)) {
      a.child = null;
      do
        a = t.sibling, t.sibling = null, t = a;
      while (t !== null);
    }
  }
  function mi(t) {
    var a = t.deletions;
    if ((t.flags & 16) !== 0) {
      if (a !== null)
        for (var i = 0; i < a.length; i++) {
          var o = a[i];
          It = o, D4(
            o,
            t
          );
        }
      N4(t);
    }
    if (t.subtreeFlags & 10256)
      for (t = t.child; t !== null; )
        k4(t), t = t.sibling;
  }
  function k4(t) {
    switch (t.tag) {
      case 0:
      case 11:
      case 15:
        mi(t), t.flags & 2048 && E0(9, t, t.return);
        break;
      case 3:
        mi(t);
        break;
      case 12:
        mi(t);
        break;
      case 22:
        var a = t.stateNode;
        t.memoizedState !== null && a._visibility & 2 && (t.return === null || t.return.tag !== 13) ? (a._visibility &= -3, ro(t)) : mi(t);
        break;
      default:
        mi(t);
    }
  }
  function ro(t) {
    var a = t.deletions;
    if ((t.flags & 16) !== 0) {
      if (a !== null)
        for (var i = 0; i < a.length; i++) {
          var o = a[i];
          It = o, D4(
            o,
            t
          );
        }
      N4(t);
    }
    for (t = t.child; t !== null; ) {
      switch (a = t, a.tag) {
        case 0:
        case 11:
        case 15:
          E0(8, a, a.return), ro(a);
          break;
        case 22:
          i = a.stateNode, i._visibility & 2 && (i._visibility &= -3, ro(a));
          break;
        default:
          ro(a);
      }
      t = t.sibling;
    }
  }
  function D4(t, a) {
    for (; It !== null; ) {
      var i = It;
      switch (i.tag) {
        case 0:
        case 11:
        case 15:
          E0(8, i, a);
          break;
        case 23:
        case 22:
          if (i.memoizedState !== null && i.memoizedState.cachePool !== null) {
            var o = i.memoizedState.cachePool.pool;
            o != null && o.refCount++;
          }
          break;
        case 24:
          Jl(i.memoizedState.cache);
      }
      if (o = i.child, o !== null) o.return = i, It = o;
      else
        e: for (i = t; It !== null; ) {
          o = It;
          var f = o.sibling, m = o.return;
          if (S4(o), o === i) {
            It = null;
            break e;
          }
          if (f !== null) {
            f.return = m, It = f;
            break e;
          }
          It = m;
        }
    }
  }
  var V8 = {
    getCacheForType: function(t) {
      var a = Wt(Ot), i = a.data.get(t);
      return i === void 0 && (i = t(), a.data.set(t, i)), i;
    },
    cacheSignal: function() {
      return Wt(Ot).controller.signal;
    }
  }, Y8 = typeof WeakMap == "function" ? WeakMap : Map, rt = 0, ht = null, Ie = null, Qe = 0, it = 0, _n = null, M0 = !1, el = !1, vf = !1, Fa = 0, At = 0, T0 = 0, xr = 0, xf = 0, Rn = 0, tl = 0, pi = null, xn = null, bf = !1, lo = 0, _4 = 0, io = 1 / 0, so = null, z0 = null, Xt = 0, A0 = null, nl = null, Ia = 0, Sf = 0, wf = null, R4 = null, gi = 0, Ef = null;
  function Bn() {
    return (rt & 2) !== 0 && Qe !== 0 ? Qe & -Qe : D.T !== null ? Nf() : fs();
  }
  function B4() {
    if (Rn === 0)
      if ((Qe & 536870912) === 0 || Pe) {
        var t = u0;
        u0 <<= 1, (u0 & 3932160) === 0 && (u0 = 262144), Rn = t;
      } else Rn = 536870912;
    return t = kn.current, t !== null && (t.flags |= 32), Rn;
  }
  function bn(t, a, i) {
    (t === ht && (it === 2 || it === 9) || t.cancelPendingCommit !== null) && (al(t, 0), C0(
      t,
      Qe,
      Rn,
      !1
    )), tr(t, i), ((rt & 2) === 0 || t !== ht) && (t === ht && ((rt & 2) === 0 && (xr |= i), At === 4 && C0(
      t,
      Qe,
      Rn,
      !1
    )), ga(t));
  }
  function O4(t, a, i) {
    if ((rt & 6) !== 0) throw Error(l(327));
    var o = !i && (a & 127) === 0 && (a & t.expiredLanes) === 0 || er(t, a), f = o ? $8(t, a) : Tf(t, a, !0), m = o;
    do {
      if (f === 0) {
        el && !o && C0(t, a, 0, !1);
        break;
      } else {
        if (i = t.current.alternate, m && !G8(i)) {
          f = Tf(t, a, !1), m = !1;
          continue;
        }
        if (f === 2) {
          if (m = a, t.errorRecoveryDisabledLanes & m)
            var S = 0;
          else
            S = t.pendingLanes & -536870913, S = S !== 0 ? S : S & 536870912 ? 536870912 : 0;
          if (S !== 0) {
            a = S;
            e: {
              var C = t;
              f = pi;
              var j = C.current.memoizedState.isDehydrated;
              if (j && (al(C, S).flags |= 256), S = Tf(
                C,
                S,
                !1
              ), S !== 2) {
                if (vf && !j) {
                  C.errorRecoveryDisabledLanes |= m, xr |= m, f = 4;
                  break e;
                }
                m = xn, xn = f, m !== null && (xn === null ? xn = m : xn.push.apply(
                  xn,
                  m
                ));
              }
              f = S;
            }
            if (m = !1, f !== 2) continue;
          }
        }
        if (f === 1) {
          al(t, 0), C0(t, a, 0, !0);
          break;
        }
        e: {
          switch (o = t, m = f, m) {
            case 0:
            case 1:
              throw Error(l(345));
            case 4:
              if ((a & 4194048) !== a) break;
            case 6:
              C0(
                o,
                a,
                Rn,
                !M0
              );
              break e;
            case 2:
              xn = null;
              break;
            case 3:
            case 5:
              break;
            default:
              throw Error(l(329));
          }
          if ((a & 62914560) === a && (f = lo + 300 - We(), 10 < f)) {
            if (C0(
              o,
              a,
              Rn,
              !M0
            ), kr(o, 0, !0) !== 0) break e;
            Ia = a, o.timeoutHandle = h2(
              H4.bind(
                null,
                o,
                i,
                xn,
                so,
                bf,
                a,
                Rn,
                xr,
                tl,
                M0,
                m,
                "Throttled",
                -0,
                0
              ),
              f
            );
            break e;
          }
          H4(
            o,
            i,
            xn,
            so,
            bf,
            a,
            Rn,
            xr,
            tl,
            M0,
            m,
            null,
            -0,
            0
          );
        }
      }
      break;
    } while (!0);
    ga(t);
  }
  function H4(t, a, i, o, f, m, S, C, j, ee, fe, pe, ne, oe) {
    if (t.timeoutHandle = -1, pe = a.subtreeFlags, pe & 8192 || (pe & 16785408) === 16785408) {
      pe = {
        stylesheets: null,
        count: 0,
        imgCount: 0,
        imgBytes: 0,
        suspenseyImages: [],
        waitingForImages: !0,
        waitingForViewTransition: !1,
        unsuspend: Ra
      }, C4(
        a,
        m,
        pe
      );
      var ke = (m & 62914560) === m ? lo - We() : (m & 4194048) === m ? _4 - We() : 0;
      if (ke = Ag(
        pe,
        ke
      ), ke !== null) {
        Ia = m, t.cancelPendingCommit = ke(
          X4.bind(
            null,
            t,
            a,
            m,
            i,
            o,
            f,
            S,
            C,
            j,
            fe,
            pe,
            null,
            ne,
            oe
          )
        ), C0(t, m, S, !ee);
        return;
      }
    }
    X4(
      t,
      a,
      m,
      i,
      o,
      f,
      S,
      C,
      j
    );
  }
  function G8(t) {
    for (var a = t; ; ) {
      var i = a.tag;
      if ((i === 0 || i === 11 || i === 15) && a.flags & 16384 && (i = a.updateQueue, i !== null && (i = i.stores, i !== null)))
        for (var o = 0; o < i.length; o++) {
          var f = i[o], m = f.getSnapshot;
          f = f.value;
          try {
            if (!Cn(m(), f)) return !1;
          } catch {
            return !1;
          }
        }
      if (i = a.child, a.subtreeFlags & 16384 && i !== null)
        i.return = a, a = i;
      else {
        if (a === t) break;
        for (; a.sibling === null; ) {
          if (a.return === null || a.return === t) return !0;
          a = a.return;
        }
        a.sibling.return = a.return, a = a.sibling;
      }
    }
    return !0;
  }
  function C0(t, a, i, o) {
    a &= ~xf, a &= ~xr, t.suspendedLanes |= a, t.pingedLanes &= ~a, o && (t.warmLanes |= a), o = t.expirationTimes;
    for (var f = a; 0 < f; ) {
      var m = 31 - vt(f), S = 1 << m;
      o[m] = -1, f &= ~S;
    }
    i !== 0 && os(t, i, a);
  }
  function oo() {
    return (rt & 6) === 0 ? (yi(0), !1) : !0;
  }
  function Mf() {
    if (Ie !== null) {
      if (it === 0)
        var t = Ie.return;
      else
        t = Ie, La = cr = null, Uc(t), Fr = null, Pl = 0, t = Ie;
      for (; t !== null; )
        d4(t.alternate, t), t = t.return;
      Ie = null;
    }
  }
  function al(t, a) {
    var i = t.timeoutHandle;
    i !== -1 && (t.timeoutHandle = -1, ug(i)), i = t.cancelPendingCommit, i !== null && (t.cancelPendingCommit = null, i()), Ia = 0, Mf(), ht = t, Ie = i = Oa(t.current, null), Qe = a, it = 0, _n = null, M0 = !1, el = er(t, a), vf = !1, tl = Rn = xf = xr = T0 = At = 0, xn = pi = null, bf = !1, (a & 8) !== 0 && (a |= a & 32);
    var o = t.entangledLanes;
    if (o !== 0)
      for (t = t.entanglements, o &= a; 0 < o; ) {
        var f = 31 - vt(o), m = 1 << f;
        a |= t[f], o &= ~m;
      }
    return Fa = a, Ns(), i;
  }
  function L4(t, a) {
    Ge = null, D.H = si, a === Zr || a === Ls ? (a = Pd(), it = 3) : a === Ac ? (a = Pd(), it = 4) : it = a === tf ? 8 : a !== null && typeof a == "object" && typeof a.then == "function" ? 6 : 1, _n = a, Ie === null && (At = 1, Js(
      t,
      $n(a, t.current)
    ));
  }
  function q4() {
    var t = kn.current;
    return t === null ? !0 : (Qe & 4194048) === Qe ? Kn === null : (Qe & 62914560) === Qe || (Qe & 536870912) !== 0 ? t === Kn : !1;
  }
  function U4() {
    var t = D.H;
    return D.H = si, t === null ? si : t;
  }
  function j4() {
    var t = D.A;
    return D.A = V8, t;
  }
  function uo() {
    At = 4, M0 || (Qe & 4194048) !== Qe && kn.current !== null || (el = !0), (T0 & 134217727) === 0 && (xr & 134217727) === 0 || ht === null || C0(
      ht,
      Qe,
      Rn,
      !1
    );
  }
  function Tf(t, a, i) {
    var o = rt;
    rt |= 2;
    var f = U4(), m = j4();
    (ht !== t || Qe !== a) && (so = null, al(t, a)), a = !1;
    var S = At;
    e: do
      try {
        if (it !== 0 && Ie !== null) {
          var C = Ie, j = _n;
          switch (it) {
            case 8:
              Mf(), S = 6;
              break e;
            case 3:
            case 2:
            case 9:
            case 6:
              kn.current === null && (a = !0);
              var ee = it;
              if (it = 0, _n = null, rl(t, C, j, ee), i && el) {
                S = 0;
                break e;
              }
              break;
            default:
              ee = it, it = 0, _n = null, rl(t, C, j, ee);
          }
        }
        X8(), S = At;
        break;
      } catch (fe) {
        L4(t, fe);
      }
    while (!0);
    return a && t.shellSuspendCounter++, La = cr = null, rt = o, D.H = f, D.A = m, Ie === null && (ht = null, Qe = 0, Ns()), S;
  }
  function X8() {
    for (; Ie !== null; ) V4(Ie);
  }
  function $8(t, a) {
    var i = rt;
    rt |= 2;
    var o = U4(), f = j4();
    ht !== t || Qe !== a ? (so = null, io = We() + 500, al(t, a)) : el = er(
      t,
      a
    );
    e: do
      try {
        if (it !== 0 && Ie !== null) {
          a = Ie;
          var m = _n;
          t: switch (it) {
            case 1:
              it = 0, _n = null, rl(t, a, m, 1);
              break;
            case 2:
            case 9:
              if (Jd(m)) {
                it = 0, _n = null, Y4(a);
                break;
              }
              a = function() {
                it !== 2 && it !== 9 || ht !== t || (it = 7), ga(t);
              }, m.then(a, a);
              break e;
            case 3:
              it = 7;
              break e;
            case 4:
              it = 5;
              break e;
            case 7:
              Jd(m) ? (it = 0, _n = null, Y4(a)) : (it = 0, _n = null, rl(t, a, m, 7));
              break;
            case 5:
              var S = null;
              switch (Ie.tag) {
                case 26:
                  S = Ie.memoizedState;
                case 5:
                case 27:
                  var C = Ie;
                  if (S ? A2(S) : C.stateNode.complete) {
                    it = 0, _n = null;
                    var j = C.sibling;
                    if (j !== null) Ie = j;
                    else {
                      var ee = C.return;
                      ee !== null ? (Ie = ee, co(ee)) : Ie = null;
                    }
                    break t;
                  }
              }
              it = 0, _n = null, rl(t, a, m, 5);
              break;
            case 6:
              it = 0, _n = null, rl(t, a, m, 6);
              break;
            case 8:
              Mf(), At = 6;
              break e;
            default:
              throw Error(l(462));
          }
        }
        Z8();
        break;
      } catch (fe) {
        L4(t, fe);
      }
    while (!0);
    return La = cr = null, D.H = o, D.A = f, rt = i, Ie !== null ? 0 : (ht = null, Qe = 0, Ns(), At);
  }
  function Z8() {
    for (; Ie !== null && !Vt(); )
      V4(Ie);
  }
  function V4(t) {
    var a = f4(t.alternate, t, Fa);
    t.memoizedProps = t.pendingProps, a === null ? co(t) : Ie = a;
  }
  function Y4(t) {
    var a = t, i = a.alternate;
    switch (a.tag) {
      case 15:
      case 0:
        a = l4(
          i,
          a,
          a.pendingProps,
          a.type,
          void 0,
          Qe
        );
        break;
      case 11:
        a = l4(
          i,
          a,
          a.pendingProps,
          a.type.render,
          a.ref,
          Qe
        );
        break;
      case 5:
        Uc(a);
      default:
        d4(i, a), a = Ie = jd(a, Fa), a = f4(i, a, Fa);
    }
    t.memoizedProps = t.pendingProps, a === null ? co(t) : Ie = a;
  }
  function rl(t, a, i, o) {
    La = cr = null, Uc(a), Fr = null, Pl = 0;
    var f = a.return;
    try {
      if (B8(
        t,
        f,
        a,
        i,
        Qe
      )) {
        At = 1, Js(
          t,
          $n(i, t.current)
        ), Ie = null;
        return;
      }
    } catch (m) {
      if (f !== null) throw Ie = f, m;
      At = 1, Js(
        t,
        $n(i, t.current)
      ), Ie = null;
      return;
    }
    a.flags & 32768 ? (Pe || o === 1 ? t = !0 : el || (Qe & 536870912) !== 0 ? t = !1 : (M0 = t = !0, (o === 2 || o === 9 || o === 3 || o === 6) && (o = kn.current, o !== null && o.tag === 13 && (o.flags |= 16384))), G4(a, t)) : co(a);
  }
  function co(t) {
    var a = t;
    do {
      if ((a.flags & 32768) !== 0) {
        G4(
          a,
          M0
        );
        return;
      }
      t = a.return;
      var i = L8(
        a.alternate,
        a,
        Fa
      );
      if (i !== null) {
        Ie = i;
        return;
      }
      if (a = a.sibling, a !== null) {
        Ie = a;
        return;
      }
      Ie = a = t;
    } while (a !== null);
    At === 0 && (At = 5);
  }
  function G4(t, a) {
    do {
      var i = q8(t.alternate, t);
      if (i !== null) {
        i.flags &= 32767, Ie = i;
        return;
      }
      if (i = t.return, i !== null && (i.flags |= 32768, i.subtreeFlags = 0, i.deletions = null), !a && (t = t.sibling, t !== null)) {
        Ie = t;
        return;
      }
      Ie = t = i;
    } while (t !== null);
    At = 6, Ie = null;
  }
  function X4(t, a, i, o, f, m, S, C, j) {
    t.cancelPendingCommit = null;
    do
      fo();
    while (Xt !== 0);
    if ((rt & 6) !== 0) throw Error(l(327));
    if (a !== null) {
      if (a === t.current) throw Error(l(177));
      if (m = a.lanes | a.childLanes, m |= hc, Vu(
        t,
        i,
        m,
        S,
        C,
        j
      ), t === ht && (Ie = ht = null, Qe = 0), nl = a, A0 = t, Ia = i, Sf = m, wf = f, R4 = o, (a.subtreeFlags & 10256) !== 0 || (a.flags & 10256) !== 0 ? (t.callbackNode = null, t.callbackPriority = 0, Q8(nn, function() {
        return K4(), null;
      })) : (t.callbackNode = null, t.callbackPriority = 0), o = (a.flags & 13878) !== 0, (a.subtreeFlags & 13878) !== 0 || o) {
        o = D.T, D.T = null, f = Y.p, Y.p = 2, S = rt, rt |= 4;
        try {
          U8(t, a, i);
        } finally {
          rt = S, Y.p = f, D.T = o;
        }
      }
      Xt = 1, $4(), Z4(), F4();
    }
  }
  function $4() {
    if (Xt === 1) {
      Xt = 0;
      var t = A0, a = nl, i = (a.flags & 13878) !== 0;
      if ((a.subtreeFlags & 13878) !== 0 || i) {
        i = D.T, D.T = null;
        var o = Y.p;
        Y.p = 2;
        var f = rt;
        rt |= 4;
        try {
          T4(a, t);
          var m = Lf, S = Dd(t.containerInfo), C = m.focusedElem, j = m.selectionRange;
          if (S !== C && C && C.ownerDocument && kd(
            C.ownerDocument.documentElement,
            C
          )) {
            if (j !== null && sc(C)) {
              var ee = j.start, fe = j.end;
              if (fe === void 0 && (fe = ee), "selectionStart" in C)
                C.selectionStart = ee, C.selectionEnd = Math.min(
                  fe,
                  C.value.length
                );
              else {
                var pe = C.ownerDocument || document, ne = pe && pe.defaultView || window;
                if (ne.getSelection) {
                  var oe = ne.getSelection(), ke = C.textContent.length, Ue = Math.min(j.start, ke), ft = j.end === void 0 ? Ue : Math.min(j.end, ke);
                  !oe.extend && Ue > ft && (S = ft, ft = Ue, Ue = S);
                  var K = Nd(
                    C,
                    Ue
                  ), X = Nd(
                    C,
                    ft
                  );
                  if (K && X && (oe.rangeCount !== 1 || oe.anchorNode !== K.node || oe.anchorOffset !== K.offset || oe.focusNode !== X.node || oe.focusOffset !== X.offset)) {
                    var W = pe.createRange();
                    W.setStart(K.node, K.offset), oe.removeAllRanges(), Ue > ft ? (oe.addRange(W), oe.extend(X.node, X.offset)) : (W.setEnd(X.node, X.offset), oe.addRange(W));
                  }
                }
              }
            }
            for (pe = [], oe = C; oe = oe.parentNode; )
              oe.nodeType === 1 && pe.push({
                element: oe,
                left: oe.scrollLeft,
                top: oe.scrollTop
              });
            for (typeof C.focus == "function" && C.focus(), C = 0; C < pe.length; C++) {
              var me = pe[C];
              me.element.scrollLeft = me.left, me.element.scrollTop = me.top;
            }
          }
          Mo = !!Hf, Lf = Hf = null;
        } finally {
          rt = f, Y.p = o, D.T = i;
        }
      }
      t.current = a, Xt = 2;
    }
  }
  function Z4() {
    if (Xt === 2) {
      Xt = 0;
      var t = A0, a = nl, i = (a.flags & 8772) !== 0;
      if ((a.subtreeFlags & 8772) !== 0 || i) {
        i = D.T, D.T = null;
        var o = Y.p;
        Y.p = 2;
        var f = rt;
        rt |= 4;
        try {
          b4(t, a.alternate, a);
        } finally {
          rt = f, Y.p = o, D.T = i;
        }
      }
      Xt = 3;
    }
  }
  function F4() {
    if (Xt === 4 || Xt === 3) {
      Xt = 0, mn();
      var t = A0, a = nl, i = Ia, o = R4;
      (a.subtreeFlags & 10256) !== 0 || (a.flags & 10256) !== 0 ? Xt = 5 : (Xt = 0, nl = A0 = null, I4(t, t.pendingLanes));
      var f = t.pendingLanes;
      if (f === 0 && (z0 = null), Hl(i), a = a.stateNode, kt && typeof kt.onCommitFiberRoot == "function")
        try {
          kt.onCommitFiberRoot(
            An,
            a,
            void 0,
            (a.current.flags & 128) === 128
          );
        } catch {
        }
      if (o !== null) {
        a = D.T, f = Y.p, Y.p = 2, D.T = null;
        try {
          for (var m = t.onRecoverableError, S = 0; S < o.length; S++) {
            var C = o[S];
            m(C.value, {
              componentStack: C.stack
            });
          }
        } finally {
          D.T = a, Y.p = f;
        }
      }
      (Ia & 3) !== 0 && fo(), ga(t), f = t.pendingLanes, (i & 261930) !== 0 && (f & 42) !== 0 ? t === Ef ? gi++ : (gi = 0, Ef = t) : gi = 0, yi(0);
    }
  }
  function I4(t, a) {
    (t.pooledCacheLanes &= a) === 0 && (a = t.pooledCache, a != null && (t.pooledCache = null, Jl(a)));
  }
  function fo() {
    return $4(), Z4(), F4(), K4();
  }
  function K4() {
    if (Xt !== 5) return !1;
    var t = A0, a = Sf;
    Sf = 0;
    var i = Hl(Ia), o = D.T, f = Y.p;
    try {
      Y.p = 32 > i ? 32 : i, D.T = null, i = wf, wf = null;
      var m = A0, S = Ia;
      if (Xt = 0, nl = A0 = null, Ia = 0, (rt & 6) !== 0) throw Error(l(331));
      var C = rt;
      if (rt |= 4, k4(m.current), A4(
        m,
        m.current,
        S,
        i
      ), rt = C, yi(0, !1), kt && typeof kt.onPostCommitFiberRoot == "function")
        try {
          kt.onPostCommitFiberRoot(An, m);
        } catch {
        }
      return !0;
    } finally {
      Y.p = f, D.T = o, I4(t, a);
    }
  }
  function Q4(t, a, i) {
    a = $n(i, a), a = ef(t.stateNode, a, 2), t = b0(t, a, 2), t !== null && (tr(t, 2), ga(t));
  }
  function st(t, a, i) {
    if (t.tag === 3)
      Q4(t, t, i);
    else
      for (; a !== null; ) {
        if (a.tag === 3) {
          Q4(
            a,
            t,
            i
          );
          break;
        } else if (a.tag === 1) {
          var o = a.stateNode;
          if (typeof a.type.getDerivedStateFromError == "function" || typeof o.componentDidCatch == "function" && (z0 === null || !z0.has(o))) {
            t = $n(i, t), i = Jm(2), o = b0(a, i, 2), o !== null && (Wm(
              i,
              o,
              a,
              t
            ), tr(o, 2), ga(o));
            break;
          }
        }
        a = a.return;
      }
  }
  function zf(t, a, i) {
    var o = t.pingCache;
    if (o === null) {
      o = t.pingCache = new Y8();
      var f = /* @__PURE__ */ new Set();
      o.set(a, f);
    } else
      f = o.get(a), f === void 0 && (f = /* @__PURE__ */ new Set(), o.set(a, f));
    f.has(i) || (vf = !0, f.add(i), t = F8.bind(null, t, a, i), a.then(t, t));
  }
  function F8(t, a, i) {
    var o = t.pingCache;
    o !== null && o.delete(a), t.pingedLanes |= t.suspendedLanes & i, t.warmLanes &= ~i, ht === t && (Qe & i) === i && (At === 4 || At === 3 && (Qe & 62914560) === Qe && 300 > We() - lo ? (rt & 2) === 0 && al(t, 0) : xf |= i, tl === Qe && (tl = 0)), ga(t);
  }
  function J4(t, a) {
    a === 0 && (a = ss()), t = sr(t, a), t !== null && (tr(t, a), ga(t));
  }
  function I8(t) {
    var a = t.memoizedState, i = 0;
    a !== null && (i = a.retryLane), J4(t, i);
  }
  function K8(t, a) {
    var i = 0;
    switch (t.tag) {
      case 31:
      case 13:
        var o = t.stateNode, f = t.memoizedState;
        f !== null && (i = f.retryLane);
        break;
      case 19:
        o = t.stateNode;
        break;
      case 22:
        o = t.stateNode._retryCache;
        break;
      default:
        throw Error(l(314));
    }
    o !== null && o.delete(a), J4(t, i);
  }
  function Q8(t, a) {
    return ot(t, a);
  }
  var ho = null, ll = null, Af = !1, mo = !1, Cf = !1, N0 = 0;
  function ga(t) {
    t !== ll && t.next === null && (ll === null ? ho = ll = t : ll = ll.next = t), mo = !0, Af || (Af = !0, W8());
  }
  function yi(t, a) {
    if (!Cf && mo) {
      Cf = !0;
      do
        for (var i = !1, o = ho; o !== null; ) {
          if (t !== 0) {
            var f = o.pendingLanes;
            if (f === 0) var m = 0;
            else {
              var S = o.suspendedLanes, C = o.pingedLanes;
              m = (1 << 31 - vt(42 | t) + 1) - 1, m &= f & ~(S & ~C), m = m & 201326741 ? m & 201326741 | 1 : m ? m | 2 : 0;
            }
            m !== 0 && (i = !0, t2(o, m));
          } else
            m = Qe, m = kr(
              o,
              o === ht ? m : 0,
              o.cancelPendingCommit !== null || o.timeoutHandle !== -1
            ), (m & 3) === 0 || er(o, m) || (i = !0, t2(o, m));
          o = o.next;
        }
      while (i);
      Cf = !1;
    }
  }
  function J8() {
    W4();
  }
  function W4() {
    mo = Af = !1;
    var t = 0;
    N0 !== 0 && og() && (t = N0);
    for (var a = We(), i = null, o = ho; o !== null; ) {
      var f = o.next, m = P4(o, a);
      m === 0 ? (o.next = null, i === null ? ho = f : i.next = f, f === null && (ll = i)) : (i = o, (t !== 0 || (m & 3) !== 0) && (mo = !0)), o = f;
    }
    Xt !== 0 && Xt !== 5 || yi(t), N0 !== 0 && (N0 = 0);
  }
  function P4(t, a) {
    for (var i = t.suspendedLanes, o = t.pingedLanes, f = t.expirationTimes, m = t.pendingLanes & -62914561; 0 < m; ) {
      var S = 31 - vt(m), C = 1 << S, j = f[S];
      j === -1 ? ((C & i) === 0 || (C & o) !== 0) && (f[S] = ju(C, a)) : j <= a && (t.expiredLanes |= C), m &= ~C;
    }
    if (a = ht, i = Qe, i = kr(
      t,
      t === a ? i : 0,
      t.cancelPendingCommit !== null || t.timeoutHandle !== -1
    ), o = t.callbackNode, i === 0 || t === a && (it === 2 || it === 9) || t.cancelPendingCommit !== null)
      return o !== null && o !== null && wt(o), t.callbackNode = null, t.callbackPriority = 0;
    if ((i & 3) === 0 || er(t, i)) {
      if (a = i & -i, a === t.callbackPriority) return a;
      switch (o !== null && wt(o), Hl(i)) {
        case 2:
        case 8:
          i = tn;
          break;
        case 32:
          i = nn;
          break;
        case 268435456:
          i = o0;
          break;
        default:
          i = nn;
      }
      return o = e2.bind(null, t), i = ot(i, o), t.callbackPriority = a, t.callbackNode = i, a;
    }
    return o !== null && o !== null && wt(o), t.callbackPriority = 2, t.callbackNode = null, 2;
  }
  function e2(t, a) {
    if (Xt !== 0 && Xt !== 5)
      return t.callbackNode = null, t.callbackPriority = 0, null;
    var i = t.callbackNode;
    if (fo() && t.callbackNode !== i)
      return null;
    var o = Qe;
    return o = kr(
      t,
      t === ht ? o : 0,
      t.cancelPendingCommit !== null || t.timeoutHandle !== -1
    ), o === 0 ? null : (O4(t, o, a), P4(t, We()), t.callbackNode != null && t.callbackNode === i ? e2.bind(null, t) : null);
  }
  function t2(t, a) {
    if (fo()) return null;
    O4(t, a, !0);
  }
  function W8() {
    cg(function() {
      (rt & 6) !== 0 ? ot(
        Zt,
        J8
      ) : W4();
    });
  }
  function Nf() {
    if (N0 === 0) {
      var t = Xr;
      t === 0 && (t = fa, fa <<= 1, (fa & 261888) === 0 && (fa = 256)), N0 = t;
    }
    return N0;
  }
  function n2(t) {
    return t == null || typeof t == "symbol" || typeof t == "boolean" ? null : typeof t == "function" ? t : Ss("" + t);
  }
  function a2(t, a) {
    var i = a.ownerDocument.createElement("input");
    return i.name = a.name, i.value = a.value, t.id && i.setAttribute("form", t.id), a.parentNode.insertBefore(i, a), t = new FormData(t), i.parentNode.removeChild(i), t;
  }
  function P8(t, a, i, o, f) {
    if (a === "submit" && i && i.stateNode === f) {
      var m = n2(
        (f[Qt] || null).action
      ), S = o.submitter;
      S && (a = (a = S[Qt] || null) ? n2(a.formAction) : S.getAttribute("formAction"), a !== null && (m = a, S = null));
      var C = new Ts(
        "action",
        "action",
        null,
        o,
        f
      );
      t.push({
        event: C,
        listeners: [
          {
            instance: null,
            listener: function() {
              if (o.defaultPrevented) {
                if (N0 !== 0) {
                  var j = S ? a2(f, S) : new FormData(f);
                  Ic(
                    i,
                    {
                      pending: !0,
                      data: j,
                      method: f.method,
                      action: m
                    },
                    null,
                    j
                  );
                }
              } else
                typeof m == "function" && (C.preventDefault(), j = S ? a2(f, S) : new FormData(f), Ic(
                  i,
                  {
                    pending: !0,
                    data: j,
                    method: f.method,
                    action: m
                  },
                  m,
                  j
                ));
            },
            currentTarget: f
          }
        ]
      });
    }
  }
  for (var kf = 0; kf < fc.length; kf++) {
    var Df = fc[kf], eg = Df.toLowerCase(), tg = Df[0].toUpperCase() + Df.slice(1);
    aa(
      eg,
      "on" + tg
    );
  }
  aa(Bd, "onAnimationEnd"), aa(Od, "onAnimationIteration"), aa(Hd, "onAnimationStart"), aa("dblclick", "onDoubleClick"), aa("focusin", "onFocus"), aa("focusout", "onBlur"), aa(y8, "onTransitionRun"), aa(v8, "onTransitionStart"), aa(x8, "onTransitionCancel"), aa(Ld, "onTransitionEnd"), Da("onMouseEnter", ["mouseout", "mouseover"]), Da("onMouseLeave", ["mouseout", "mouseover"]), Da("onPointerEnter", ["pointerout", "pointerover"]), Da("onPointerLeave", ["pointerout", "pointerover"]), ka(
    "onChange",
    "change click focusin focusout input keydown keyup selectionchange".split(" ")
  ), ka(
    "onSelect",
    "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
      " "
    )
  ), ka("onBeforeInput", [
    "compositionend",
    "keypress",
    "textInput",
    "paste"
  ]), ka(
    "onCompositionEnd",
    "compositionend focusout keydown keypress keyup mousedown".split(" ")
  ), ka(
    "onCompositionStart",
    "compositionstart focusout keydown keypress keyup mousedown".split(" ")
  ), ka(
    "onCompositionUpdate",
    "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
  );
  var vi = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(
    " "
  ), ng = new Set(
    "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vi)
  );
  function r2(t, a) {
    a = (a & 4) !== 0;
    for (var i = 0; i < t.length; i++) {
      var o = t[i], f = o.event;
      o = o.listeners;
      e: {
        var m = void 0;
        if (a)
          for (var S = o.length - 1; 0 <= S; S--) {
            var C = o[S], j = C.instance, ee = C.currentTarget;
            if (C = C.listener, j !== m && f.isPropagationStopped())
              break e;
            m = C, f.currentTarget = ee;
            try {
              m(f);
            } catch (fe) {
              Cs(fe);
            }
            f.currentTarget = null, m = j;
          }
        else
          for (S = 0; S < o.length; S++) {
            if (C = o[S], j = C.instance, ee = C.currentTarget, C = C.listener, j !== m && f.isPropagationStopped())
              break e;
            m = C, f.currentTarget = ee;
            try {
              m(f);
            } catch (fe) {
              Cs(fe);
            }
            f.currentTarget = null, m = j;
          }
      }
    }
  }
  function Ke(t, a) {
    var i = a[Ll];
    i === void 0 && (i = a[Ll] = /* @__PURE__ */ new Set());
    var o = t + "__bubble";
    i.has(o) || (l2(a, t, 2, !1), i.add(o));
  }
  function _f(t, a, i) {
    var o = 0;
    a && (o |= 4), l2(
      i,
      t,
      o,
      a
    );
  }
  var po = "_reactListening" + Math.random().toString(36).slice(2);
  function Rf(t) {
    if (!t[po]) {
      t[po] = !0, ms.forEach(function(i) {
        i !== "selectionchange" && (ng.has(i) || _f(i, !1, t), _f(i, !0, t));
      });
      var a = t.nodeType === 9 ? t : t.ownerDocument;
      a === null || a[po] || (a[po] = !0, _f("selectionchange", !1, a));
    }
  }
  function l2(t, a, i, o) {
    switch (B2(a)) {
      case 2:
        var f = kg;
        break;
      case 8:
        f = Dg;
        break;
      default:
        f = If;
    }
    i = f.bind(
      null,
      a,
      i,
      t
    ), f = void 0, !Wu || a !== "touchstart" && a !== "touchmove" && a !== "wheel" || (f = !0), o ? f !== void 0 ? t.addEventListener(a, i, {
      capture: !0,
      passive: f
    }) : t.addEventListener(a, i, !0) : f !== void 0 ? t.addEventListener(a, i, {
      passive: f
    }) : t.addEventListener(a, i, !1);
  }
  function Bf(t, a, i, o, f) {
    var m = o;
    if ((a & 1) === 0 && (a & 2) === 0 && o !== null)
      e: for (; ; ) {
        if (o === null) return;
        var S = o.tag;
        if (S === 3 || S === 4) {
          var C = o.stateNode.containerInfo;
          if (C === f) break;
          if (S === 4)
            for (S = o.return; S !== null; ) {
              var j = S.tag;
              if ((j === 3 || j === 4) && S.stateNode.containerInfo === f)
                return;
              S = S.return;
            }
          for (; C !== null; ) {
            if (S = f0(C), S === null) return;
            if (j = S.tag, j === 5 || j === 6 || j === 26 || j === 27) {
              o = m = S;
              continue e;
            }
            C = C.parentNode;
          }
        }
        o = o.return;
      }
    cd(function() {
      var ee = m, fe = Qu(i), pe = [];
      e: {
        var ne = qd.get(t);
        if (ne !== void 0) {
          var oe = Ts, ke = t;
          switch (t) {
            case "keypress":
              if (Es(i) === 0) break e;
            case "keydown":
            case "keyup":
              oe = K7;
              break;
            case "focusin":
              ke = "focus", oe = nc;
              break;
            case "focusout":
              ke = "blur", oe = nc;
              break;
            case "beforeblur":
            case "afterblur":
              oe = nc;
              break;
            case "click":
              if (i.button === 2) break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              oe = dd;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              oe = L7;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              oe = W7;
              break;
            case Bd:
            case Od:
            case Hd:
              oe = j7;
              break;
            case Ld:
              oe = e8;
              break;
            case "scroll":
            case "scrollend":
              oe = O7;
              break;
            case "wheel":
              oe = n8;
              break;
            case "copy":
            case "cut":
            case "paste":
              oe = Y7;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              oe = pd;
              break;
            case "toggle":
            case "beforetoggle":
              oe = r8;
          }
          var Ue = (a & 4) !== 0, ft = !Ue && (t === "scroll" || t === "scrollend"), K = Ue ? ne !== null ? ne + "Capture" : null : ne;
          Ue = [];
          for (var X = ee, W; X !== null; ) {
            var me = X;
            if (W = me.stateNode, me = me.tag, me !== 5 && me !== 26 && me !== 27 || W === null || K === null || (me = jl(X, K), me != null && Ue.push(
              xi(X, me, W)
            )), ft) break;
            X = X.return;
          }
          0 < Ue.length && (ne = new oe(
            ne,
            ke,
            null,
            i,
            fe
          ), pe.push({ event: ne, listeners: Ue }));
        }
      }
      if ((a & 7) === 0) {
        e: {
          if (ne = t === "mouseover" || t === "pointerover", oe = t === "mouseout" || t === "pointerout", ne && i !== Ku && (ke = i.relatedTarget || i.fromElement) && (f0(ke) || ke[c0]))
            break e;
          if ((oe || ne) && (ne = fe.window === fe ? fe : (ne = fe.ownerDocument) ? ne.defaultView || ne.parentWindow : window, oe ? (ke = i.relatedTarget || i.toElement, oe = ee, ke = ke ? f0(ke) : null, ke !== null && (ft = u(ke), Ue = ke.tag, ke !== ft || Ue !== 5 && Ue !== 27 && Ue !== 6) && (ke = null)) : (oe = null, ke = ee), oe !== ke)) {
            if (Ue = dd, me = "onMouseLeave", K = "onMouseEnter", X = "mouse", (t === "pointerout" || t === "pointerover") && (Ue = pd, me = "onPointerLeave", K = "onPointerEnter", X = "pointer"), ft = oe == null ? ne : ar(oe), W = ke == null ? ne : ar(ke), ne = new Ue(
              me,
              X + "leave",
              oe,
              i,
              fe
            ), ne.target = ft, ne.relatedTarget = W, me = null, f0(fe) === ee && (Ue = new Ue(
              K,
              X + "enter",
              ke,
              i,
              fe
            ), Ue.target = W, Ue.relatedTarget = ft, me = Ue), ft = me, oe && ke)
              t: {
                for (Ue = ag, K = oe, X = ke, W = 0, me = K; me; me = Ue(me))
                  W++;
                me = 0;
                for (var He = X; He; He = Ue(He))
                  me++;
                for (; 0 < W - me; )
                  K = Ue(K), W--;
                for (; 0 < me - W; )
                  X = Ue(X), me--;
                for (; W--; ) {
                  if (K === X || X !== null && K === X.alternate) {
                    Ue = K;
                    break t;
                  }
                  K = Ue(K), X = Ue(X);
                }
                Ue = null;
              }
            else Ue = null;
            oe !== null && i2(
              pe,
              ne,
              oe,
              Ue,
              !1
            ), ke !== null && ft !== null && i2(
              pe,
              ft,
              ke,
              Ue,
              !0
            );
          }
        }
        e: {
          if (ne = ee ? ar(ee) : window, oe = ne.nodeName && ne.nodeName.toLowerCase(), oe === "select" || oe === "input" && ne.type === "file")
            var tt = Ed;
          else if (Sd(ne))
            if (Md)
              tt = m8;
            else {
              tt = h8;
              var De = f8;
            }
          else
            oe = ne.nodeName, !oe || oe.toLowerCase() !== "input" || ne.type !== "checkbox" && ne.type !== "radio" ? ee && Iu(ee.elementType) && (tt = Ed) : tt = d8;
          if (tt && (tt = tt(t, ee))) {
            wd(
              pe,
              tt,
              i,
              fe
            );
            break e;
          }
          De && De(t, ne, ee), t === "focusout" && ee && ne.type === "number" && ee.memoizedProps.value != null && Fu(ne, "number", ne.value);
        }
        switch (De = ee ? ar(ee) : window, t) {
          case "focusin":
            (Sd(De) || De.contentEditable === "true") && (Hr = De, oc = ee, Il = null);
            break;
          case "focusout":
            Il = oc = Hr = null;
            break;
          case "mousedown":
            uc = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            uc = !1, _d(pe, i, fe);
            break;
          case "selectionchange":
            if (g8) break;
          case "keydown":
          case "keyup":
            _d(pe, i, fe);
        }
        var $e;
        if (rc)
          e: {
            switch (t) {
              case "compositionstart":
                var Je = "onCompositionStart";
                break e;
              case "compositionend":
                Je = "onCompositionEnd";
                break e;
              case "compositionupdate":
                Je = "onCompositionUpdate";
                break e;
            }
            Je = void 0;
          }
        else
          Or ? xd(t, i) && (Je = "onCompositionEnd") : t === "keydown" && i.keyCode === 229 && (Je = "onCompositionStart");
        Je && (gd && i.locale !== "ko" && (Or || Je !== "onCompositionStart" ? Je === "onCompositionEnd" && Or && ($e = fd()) : (d0 = fe, Pu = "value" in d0 ? d0.value : d0.textContent, Or = !0)), De = go(ee, Je), 0 < De.length && (Je = new md(
          Je,
          t,
          null,
          i,
          fe
        ), pe.push({ event: Je, listeners: De }), $e ? Je.data = $e : ($e = bd(i), $e !== null && (Je.data = $e)))), ($e = i8 ? s8(t, i) : o8(t, i)) && (Je = go(ee, "onBeforeInput"), 0 < Je.length && (De = new md(
          "onBeforeInput",
          "beforeinput",
          null,
          i,
          fe
        ), pe.push({
          event: De,
          listeners: Je
        }), De.data = $e)), P8(
          pe,
          t,
          ee,
          i,
          fe
        );
      }
      r2(pe, a);
    });
  }
  function xi(t, a, i) {
    return {
      instance: t,
      listener: a,
      currentTarget: i
    };
  }
  function go(t, a) {
    for (var i = a + "Capture", o = []; t !== null; ) {
      var f = t, m = f.stateNode;
      if (f = f.tag, f !== 5 && f !== 26 && f !== 27 || m === null || (f = jl(t, i), f != null && o.unshift(
        xi(t, f, m)
      ), f = jl(t, a), f != null && o.push(
        xi(t, f, m)
      )), t.tag === 3) return o;
      t = t.return;
    }
    return [];
  }
  function ag(t) {
    if (t === null) return null;
    do
      t = t.return;
    while (t && t.tag !== 5 && t.tag !== 27);
    return t || null;
  }
  function i2(t, a, i, o, f) {
    for (var m = a._reactName, S = []; i !== null && i !== o; ) {
      var C = i, j = C.alternate, ee = C.stateNode;
      if (C = C.tag, j !== null && j === o) break;
      C !== 5 && C !== 26 && C !== 27 || ee === null || (j = ee, f ? (ee = jl(i, m), ee != null && S.unshift(
        xi(i, ee, j)
      )) : f || (ee = jl(i, m), ee != null && S.push(
        xi(i, ee, j)
      ))), i = i.return;
    }
    S.length !== 0 && t.push({ event: a, listeners: S });
  }
  var rg = /\r\n?/g, lg = /\u0000|\uFFFD/g;
  function s2(t) {
    return (typeof t == "string" ? t : "" + t).replace(rg, `
`).replace(lg, "");
  }
  function o2(t, a) {
    return a = s2(a), s2(t) === a;
  }
  function ct(t, a, i, o, f, m) {
    switch (i) {
      case "children":
        typeof o == "string" ? a === "body" || a === "textarea" && o === "" || _r(t, o) : (typeof o == "number" || typeof o == "bigint") && a !== "body" && _r(t, "" + o);
        break;
      case "className":
        xs(t, "class", o);
        break;
      case "tabIndex":
        xs(t, "tabindex", o);
        break;
      case "dir":
      case "role":
      case "viewBox":
      case "width":
      case "height":
        xs(t, i, o);
        break;
      case "style":
        od(t, o, m);
        break;
      case "data":
        if (a !== "object") {
          xs(t, "data", o);
          break;
        }
      case "src":
      case "href":
        if (o === "" && (a !== "a" || i !== "href")) {
          t.removeAttribute(i);
          break;
        }
        if (o == null || typeof o == "function" || typeof o == "symbol" || typeof o == "boolean") {
          t.removeAttribute(i);
          break;
        }
        o = Ss("" + o), t.setAttribute(i, o);
        break;
      case "action":
      case "formAction":
        if (typeof o == "function") {
          t.setAttribute(
            i,
            "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
          );
          break;
        } else
          typeof m == "function" && (i === "formAction" ? (a !== "input" && ct(t, a, "name", f.name, f, null), ct(
            t,
            a,
            "formEncType",
            f.formEncType,
            f,
            null
          ), ct(
            t,
            a,
            "formMethod",
            f.formMethod,
            f,
            null
          ), ct(
            t,
            a,
            "formTarget",
            f.formTarget,
            f,
            null
          )) : (ct(t, a, "encType", f.encType, f, null), ct(t, a, "method", f.method, f, null), ct(t, a, "target", f.target, f, null)));
        if (o == null || typeof o == "symbol" || typeof o == "boolean") {
          t.removeAttribute(i);
          break;
        }
        o = Ss("" + o), t.setAttribute(i, o);
        break;
      case "onClick":
        o != null && (t.onclick = Ra);
        break;
      case "onScroll":
        o != null && Ke("scroll", t);
        break;
      case "onScrollEnd":
        o != null && Ke("scrollend", t);
        break;
      case "dangerouslySetInnerHTML":
        if (o != null) {
          if (typeof o != "object" || !("__html" in o))
            throw Error(l(61));
          if (i = o.__html, i != null) {
            if (f.children != null) throw Error(l(60));
            t.innerHTML = i;
          }
        }
        break;
      case "multiple":
        t.multiple = o && typeof o != "function" && typeof o != "symbol";
        break;
      case "muted":
        t.muted = o && typeof o != "function" && typeof o != "symbol";
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "ref":
        break;
      case "autoFocus":
        break;
      case "xlinkHref":
        if (o == null || typeof o == "function" || typeof o == "boolean" || typeof o == "symbol") {
          t.removeAttribute("xlink:href");
          break;
        }
        i = Ss("" + o), t.setAttributeNS(
          "http://www.w3.org/1999/xlink",
          "xlink:href",
          i
        );
        break;
      case "contentEditable":
      case "spellCheck":
      case "draggable":
      case "value":
      case "autoReverse":
      case "externalResourcesRequired":
      case "focusable":
      case "preserveAlpha":
        o != null && typeof o != "function" && typeof o != "symbol" ? t.setAttribute(i, "" + o) : t.removeAttribute(i);
        break;
      case "inert":
      case "allowFullScreen":
      case "async":
      case "autoPlay":
      case "controls":
      case "default":
      case "defer":
      case "disabled":
      case "disablePictureInPicture":
      case "disableRemotePlayback":
      case "formNoValidate":
      case "hidden":
      case "loop":
      case "noModule":
      case "noValidate":
      case "open":
      case "playsInline":
      case "readOnly":
      case "required":
      case "reversed":
      case "scoped":
      case "seamless":
      case "itemScope":
        o && typeof o != "function" && typeof o != "symbol" ? t.setAttribute(i, "") : t.removeAttribute(i);
        break;
      case "capture":
      case "download":
        o === !0 ? t.setAttribute(i, "") : o !== !1 && o != null && typeof o != "function" && typeof o != "symbol" ? t.setAttribute(i, o) : t.removeAttribute(i);
        break;
      case "cols":
      case "rows":
      case "size":
      case "span":
        o != null && typeof o != "function" && typeof o != "symbol" && !isNaN(o) && 1 <= o ? t.setAttribute(i, o) : t.removeAttribute(i);
        break;
      case "rowSpan":
      case "start":
        o == null || typeof o == "function" || typeof o == "symbol" || isNaN(o) ? t.removeAttribute(i) : t.setAttribute(i, o);
        break;
      case "popover":
        Ke("beforetoggle", t), Ke("toggle", t), vs(t, "popover", o);
        break;
      case "xlinkActuate":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:actuate",
          o
        );
        break;
      case "xlinkArcrole":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:arcrole",
          o
        );
        break;
      case "xlinkRole":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:role",
          o
        );
        break;
      case "xlinkShow":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:show",
          o
        );
        break;
      case "xlinkTitle":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:title",
          o
        );
        break;
      case "xlinkType":
        _a(
          t,
          "http://www.w3.org/1999/xlink",
          "xlink:type",
          o
        );
        break;
      case "xmlBase":
        _a(
          t,
          "http://www.w3.org/XML/1998/namespace",
          "xml:base",
          o
        );
        break;
      case "xmlLang":
        _a(
          t,
          "http://www.w3.org/XML/1998/namespace",
          "xml:lang",
          o
        );
        break;
      case "xmlSpace":
        _a(
          t,
          "http://www.w3.org/XML/1998/namespace",
          "xml:space",
          o
        );
        break;
      case "is":
        vs(t, "is", o);
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        (!(2 < i.length) || i[0] !== "o" && i[0] !== "O" || i[1] !== "n" && i[1] !== "N") && (i = R7.get(i) || i, vs(t, i, o));
    }
  }
  function Of(t, a, i, o, f, m) {
    switch (i) {
      case "style":
        od(t, o, m);
        break;
      case "dangerouslySetInnerHTML":
        if (o != null) {
          if (typeof o != "object" || !("__html" in o))
            throw Error(l(61));
          if (i = o.__html, i != null) {
            if (f.children != null) throw Error(l(60));
            t.innerHTML = i;
          }
        }
        break;
      case "children":
        typeof o == "string" ? _r(t, o) : (typeof o == "number" || typeof o == "bigint") && _r(t, "" + o);
        break;
      case "onScroll":
        o != null && Ke("scroll", t);
        break;
      case "onScrollEnd":
        o != null && Ke("scrollend", t);
        break;
      case "onClick":
        o != null && (t.onclick = Ra);
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "innerHTML":
      case "ref":
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        if (!ps.hasOwnProperty(i))
          e: {
            if (i[0] === "o" && i[1] === "n" && (f = i.endsWith("Capture"), a = i.slice(2, f ? i.length - 7 : void 0), m = t[Qt] || null, m = m != null ? m[i] : null, typeof m == "function" && t.removeEventListener(a, m, f), typeof o == "function")) {
              typeof m != "function" && m !== null && (i in t ? t[i] = null : t.hasAttribute(i) && t.removeAttribute(i)), t.addEventListener(a, o, f);
              break e;
            }
            i in t ? t[i] = o : o === !0 ? t.setAttribute(i, "") : vs(t, i, o);
          }
    }
  }
  function en(t, a, i) {
    switch (a) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "img":
        Ke("error", t), Ke("load", t);
        var o = !1, f = !1, m;
        for (m in i)
          if (i.hasOwnProperty(m)) {
            var S = i[m];
            if (S != null)
              switch (m) {
                case "src":
                  o = !0;
                  break;
                case "srcSet":
                  f = !0;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(l(137, a));
                default:
                  ct(t, a, m, S, i, null);
              }
          }
        f && ct(t, a, "srcSet", i.srcSet, i, null), o && ct(t, a, "src", i.src, i, null);
        return;
      case "input":
        Ke("invalid", t);
        var C = m = S = f = null, j = null, ee = null;
        for (o in i)
          if (i.hasOwnProperty(o)) {
            var fe = i[o];
            if (fe != null)
              switch (o) {
                case "name":
                  f = fe;
                  break;
                case "type":
                  S = fe;
                  break;
                case "checked":
                  j = fe;
                  break;
                case "defaultChecked":
                  ee = fe;
                  break;
                case "value":
                  m = fe;
                  break;
                case "defaultValue":
                  C = fe;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (fe != null)
                    throw Error(l(137, a));
                  break;
                default:
                  ct(t, a, o, fe, i, null);
              }
          }
        rd(
          t,
          m,
          C,
          j,
          ee,
          S,
          f,
          !1
        );
        return;
      case "select":
        Ke("invalid", t), o = S = m = null;
        for (f in i)
          if (i.hasOwnProperty(f) && (C = i[f], C != null))
            switch (f) {
              case "value":
                m = C;
                break;
              case "defaultValue":
                S = C;
                break;
              case "multiple":
                o = C;
              default:
                ct(t, a, f, C, i, null);
            }
        a = m, i = S, t.multiple = !!o, a != null ? Dr(t, !!o, a, !1) : i != null && Dr(t, !!o, i, !0);
        return;
      case "textarea":
        Ke("invalid", t), m = f = o = null;
        for (S in i)
          if (i.hasOwnProperty(S) && (C = i[S], C != null))
            switch (S) {
              case "value":
                o = C;
                break;
              case "defaultValue":
                f = C;
                break;
              case "children":
                m = C;
                break;
              case "dangerouslySetInnerHTML":
                if (C != null) throw Error(l(91));
                break;
              default:
                ct(t, a, S, C, i, null);
            }
        id(t, o, f, m);
        return;
      case "option":
        for (j in i)
          i.hasOwnProperty(j) && (o = i[j], o != null) && (j === "selected" ? t.selected = o && typeof o != "function" && typeof o != "symbol" : ct(t, a, j, o, i, null));
        return;
      case "dialog":
        Ke("beforetoggle", t), Ke("toggle", t), Ke("cancel", t), Ke("close", t);
        break;
      case "iframe":
      case "object":
        Ke("load", t);
        break;
      case "video":
      case "audio":
        for (o = 0; o < vi.length; o++)
          Ke(vi[o], t);
        break;
      case "image":
        Ke("error", t), Ke("load", t);
        break;
      case "details":
        Ke("toggle", t);
        break;
      case "embed":
      case "source":
      case "link":
        Ke("error", t), Ke("load", t);
      case "area":
      case "base":
      case "br":
      case "col":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "track":
      case "wbr":
      case "menuitem":
        for (ee in i)
          if (i.hasOwnProperty(ee) && (o = i[ee], o != null))
            switch (ee) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(l(137, a));
              default:
                ct(t, a, ee, o, i, null);
            }
        return;
      default:
        if (Iu(a)) {
          for (fe in i)
            i.hasOwnProperty(fe) && (o = i[fe], o !== void 0 && Of(
              t,
              a,
              fe,
              o,
              i,
              void 0
            ));
          return;
        }
    }
    for (C in i)
      i.hasOwnProperty(C) && (o = i[C], o != null && ct(t, a, C, o, i, null));
  }
  function ig(t, a, i, o) {
    switch (a) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "input":
        var f = null, m = null, S = null, C = null, j = null, ee = null, fe = null;
        for (oe in i) {
          var pe = i[oe];
          if (i.hasOwnProperty(oe) && pe != null)
            switch (oe) {
              case "checked":
                break;
              case "value":
                break;
              case "defaultValue":
                j = pe;
              default:
                o.hasOwnProperty(oe) || ct(t, a, oe, null, o, pe);
            }
        }
        for (var ne in o) {
          var oe = o[ne];
          if (pe = i[ne], o.hasOwnProperty(ne) && (oe != null || pe != null))
            switch (ne) {
              case "type":
                m = oe;
                break;
              case "name":
                f = oe;
                break;
              case "checked":
                ee = oe;
                break;
              case "defaultChecked":
                fe = oe;
                break;
              case "value":
                S = oe;
                break;
              case "defaultValue":
                C = oe;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                if (oe != null)
                  throw Error(l(137, a));
                break;
              default:
                oe !== pe && ct(
                  t,
                  a,
                  ne,
                  oe,
                  o,
                  pe
                );
            }
        }
        Zu(
          t,
          S,
          C,
          j,
          ee,
          fe,
          m,
          f
        );
        return;
      case "select":
        oe = S = C = ne = null;
        for (m in i)
          if (j = i[m], i.hasOwnProperty(m) && j != null)
            switch (m) {
              case "value":
                break;
              case "multiple":
                oe = j;
              default:
                o.hasOwnProperty(m) || ct(
                  t,
                  a,
                  m,
                  null,
                  o,
                  j
                );
            }
        for (f in o)
          if (m = o[f], j = i[f], o.hasOwnProperty(f) && (m != null || j != null))
            switch (f) {
              case "value":
                ne = m;
                break;
              case "defaultValue":
                C = m;
                break;
              case "multiple":
                S = m;
              default:
                m !== j && ct(
                  t,
                  a,
                  f,
                  m,
                  o,
                  j
                );
            }
        a = C, i = S, o = oe, ne != null ? Dr(t, !!i, ne, !1) : !!o != !!i && (a != null ? Dr(t, !!i, a, !0) : Dr(t, !!i, i ? [] : "", !1));
        return;
      case "textarea":
        oe = ne = null;
        for (C in i)
          if (f = i[C], i.hasOwnProperty(C) && f != null && !o.hasOwnProperty(C))
            switch (C) {
              case "value":
                break;
              case "children":
                break;
              default:
                ct(t, a, C, null, o, f);
            }
        for (S in o)
          if (f = o[S], m = i[S], o.hasOwnProperty(S) && (f != null || m != null))
            switch (S) {
              case "value":
                ne = f;
                break;
              case "defaultValue":
                oe = f;
                break;
              case "children":
                break;
              case "dangerouslySetInnerHTML":
                if (f != null) throw Error(l(91));
                break;
              default:
                f !== m && ct(t, a, S, f, o, m);
            }
        ld(t, ne, oe);
        return;
      case "option":
        for (var ke in i)
          ne = i[ke], i.hasOwnProperty(ke) && ne != null && !o.hasOwnProperty(ke) && (ke === "selected" ? t.selected = !1 : ct(
            t,
            a,
            ke,
            null,
            o,
            ne
          ));
        for (j in o)
          ne = o[j], oe = i[j], o.hasOwnProperty(j) && ne !== oe && (ne != null || oe != null) && (j === "selected" ? t.selected = ne && typeof ne != "function" && typeof ne != "symbol" : ct(
            t,
            a,
            j,
            ne,
            o,
            oe
          ));
        return;
      case "img":
      case "link":
      case "area":
      case "base":
      case "br":
      case "col":
      case "embed":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "source":
      case "track":
      case "wbr":
      case "menuitem":
        for (var Ue in i)
          ne = i[Ue], i.hasOwnProperty(Ue) && ne != null && !o.hasOwnProperty(Ue) && ct(t, a, Ue, null, o, ne);
        for (ee in o)
          if (ne = o[ee], oe = i[ee], o.hasOwnProperty(ee) && ne !== oe && (ne != null || oe != null))
            switch (ee) {
              case "children":
              case "dangerouslySetInnerHTML":
                if (ne != null)
                  throw Error(l(137, a));
                break;
              default:
                ct(
                  t,
                  a,
                  ee,
                  ne,
                  o,
                  oe
                );
            }
        return;
      default:
        if (Iu(a)) {
          for (var ft in i)
            ne = i[ft], i.hasOwnProperty(ft) && ne !== void 0 && !o.hasOwnProperty(ft) && Of(
              t,
              a,
              ft,
              void 0,
              o,
              ne
            );
          for (fe in o)
            ne = o[fe], oe = i[fe], !o.hasOwnProperty(fe) || ne === oe || ne === void 0 && oe === void 0 || Of(
              t,
              a,
              fe,
              ne,
              o,
              oe
            );
          return;
        }
    }
    for (var K in i)
      ne = i[K], i.hasOwnProperty(K) && ne != null && !o.hasOwnProperty(K) && ct(t, a, K, null, o, ne);
    for (pe in o)
      ne = o[pe], oe = i[pe], !o.hasOwnProperty(pe) || ne === oe || ne == null && oe == null || ct(t, a, pe, ne, o, oe);
  }
  function u2(t) {
    switch (t) {
      case "css":
      case "script":
      case "font":
      case "img":
      case "image":
      case "input":
      case "link":
        return !0;
      default:
        return !1;
    }
  }
  function sg() {
    if (typeof performance.getEntriesByType == "function") {
      for (var t = 0, a = 0, i = performance.getEntriesByType("resource"), o = 0; o < i.length; o++) {
        var f = i[o], m = f.transferSize, S = f.initiatorType, C = f.duration;
        if (m && C && u2(S)) {
          for (S = 0, C = f.responseEnd, o += 1; o < i.length; o++) {
            var j = i[o], ee = j.startTime;
            if (ee > C) break;
            var fe = j.transferSize, pe = j.initiatorType;
            fe && u2(pe) && (j = j.responseEnd, S += fe * (j < C ? 1 : (C - ee) / (j - ee)));
          }
          if (--o, a += 8 * (m + S) / (f.duration / 1e3), t++, 10 < t) break;
        }
      }
      if (0 < t) return a / t / 1e6;
    }
    return navigator.connection && (t = navigator.connection.downlink, typeof t == "number") ? t : 5;
  }
  var Hf = null, Lf = null;
  function yo(t) {
    return t.nodeType === 9 ? t : t.ownerDocument;
  }
  function c2(t) {
    switch (t) {
      case "http://www.w3.org/2000/svg":
        return 1;
      case "http://www.w3.org/1998/Math/MathML":
        return 2;
      default:
        return 0;
    }
  }
  function f2(t, a) {
    if (t === 0)
      switch (a) {
        case "svg":
          return 1;
        case "math":
          return 2;
        default:
          return 0;
      }
    return t === 1 && a === "foreignObject" ? 0 : t;
  }
  function qf(t, a) {
    return t === "textarea" || t === "noscript" || typeof a.children == "string" || typeof a.children == "number" || typeof a.children == "bigint" || typeof a.dangerouslySetInnerHTML == "object" && a.dangerouslySetInnerHTML !== null && a.dangerouslySetInnerHTML.__html != null;
  }
  var Uf = null;
  function og() {
    var t = window.event;
    return t && t.type === "popstate" ? t === Uf ? !1 : (Uf = t, !0) : (Uf = null, !1);
  }
  var h2 = typeof setTimeout == "function" ? setTimeout : void 0, ug = typeof clearTimeout == "function" ? clearTimeout : void 0, d2 = typeof Promise == "function" ? Promise : void 0, cg = typeof queueMicrotask == "function" ? queueMicrotask : typeof d2 < "u" ? function(t) {
    return d2.resolve(null).then(t).catch(fg);
  } : h2;
  function fg(t) {
    setTimeout(function() {
      throw t;
    });
  }
  function k0(t) {
    return t === "head";
  }
  function m2(t, a) {
    var i = a, o = 0;
    do {
      var f = i.nextSibling;
      if (t.removeChild(i), f && f.nodeType === 8)
        if (i = f.data, i === "/$" || i === "/&") {
          if (o === 0) {
            t.removeChild(f), ul(a);
            return;
          }
          o--;
        } else if (i === "$" || i === "$?" || i === "$~" || i === "$!" || i === "&")
          o++;
        else if (i === "html")
          bi(t.ownerDocument.documentElement);
        else if (i === "head") {
          i = t.ownerDocument.head, bi(i);
          for (var m = i.firstChild; m; ) {
            var S = m.nextSibling, C = m.nodeName;
            m[nr] || C === "SCRIPT" || C === "STYLE" || C === "LINK" && m.rel.toLowerCase() === "stylesheet" || i.removeChild(m), m = S;
          }
        } else
          i === "body" && bi(t.ownerDocument.body);
      i = f;
    } while (i);
    ul(a);
  }
  function p2(t, a) {
    var i = t;
    t = 0;
    do {
      var o = i.nextSibling;
      if (i.nodeType === 1 ? a ? (i._stashedDisplay = i.style.display, i.style.display = "none") : (i.style.display = i._stashedDisplay || "", i.getAttribute("style") === "" && i.removeAttribute("style")) : i.nodeType === 3 && (a ? (i._stashedText = i.nodeValue, i.nodeValue = "") : i.nodeValue = i._stashedText || ""), o && o.nodeType === 8)
        if (i = o.data, i === "/$") {
          if (t === 0) break;
          t--;
        } else
          i !== "$" && i !== "$?" && i !== "$~" && i !== "$!" || t++;
      i = o;
    } while (i);
  }
  function jf(t) {
    var a = t.firstChild;
    for (a && a.nodeType === 10 && (a = a.nextSibling); a; ) {
      var i = a;
      switch (a = a.nextSibling, i.nodeName) {
        case "HTML":
        case "HEAD":
        case "BODY":
          jf(i), ql(i);
          continue;
        case "SCRIPT":
        case "STYLE":
          continue;
        case "LINK":
          if (i.rel.toLowerCase() === "stylesheet") continue;
      }
      t.removeChild(i);
    }
  }
  function hg(t, a, i, o) {
    for (; t.nodeType === 1; ) {
      var f = i;
      if (t.nodeName.toLowerCase() !== a.toLowerCase()) {
        if (!o && (t.nodeName !== "INPUT" || t.type !== "hidden"))
          break;
      } else if (o) {
        if (!t[nr])
          switch (a) {
            case "meta":
              if (!t.hasAttribute("itemprop")) break;
              return t;
            case "link":
              if (m = t.getAttribute("rel"), m === "stylesheet" && t.hasAttribute("data-precedence"))
                break;
              if (m !== f.rel || t.getAttribute("href") !== (f.href == null || f.href === "" ? null : f.href) || t.getAttribute("crossorigin") !== (f.crossOrigin == null ? null : f.crossOrigin) || t.getAttribute("title") !== (f.title == null ? null : f.title))
                break;
              return t;
            case "style":
              if (t.hasAttribute("data-precedence")) break;
              return t;
            case "script":
              if (m = t.getAttribute("src"), (m !== (f.src == null ? null : f.src) || t.getAttribute("type") !== (f.type == null ? null : f.type) || t.getAttribute("crossorigin") !== (f.crossOrigin == null ? null : f.crossOrigin)) && m && t.hasAttribute("async") && !t.hasAttribute("itemprop"))
                break;
              return t;
            default:
              return t;
          }
      } else if (a === "input" && t.type === "hidden") {
        var m = f.name == null ? null : "" + f.name;
        if (f.type === "hidden" && t.getAttribute("name") === m)
          return t;
      } else return t;
      if (t = Qn(t.nextSibling), t === null) break;
    }
    return null;
  }
  function dg(t, a, i) {
    if (a === "") return null;
    for (; t.nodeType !== 3; )
      if ((t.nodeType !== 1 || t.nodeName !== "INPUT" || t.type !== "hidden") && !i || (t = Qn(t.nextSibling), t === null)) return null;
    return t;
  }
  function g2(t, a) {
    for (; t.nodeType !== 8; )
      if ((t.nodeType !== 1 || t.nodeName !== "INPUT" || t.type !== "hidden") && !a || (t = Qn(t.nextSibling), t === null)) return null;
    return t;
  }
  function Vf(t) {
    return t.data === "$?" || t.data === "$~";
  }
  function Yf(t) {
    return t.data === "$!" || t.data === "$?" && t.ownerDocument.readyState !== "loading";
  }
  function mg(t, a) {
    var i = t.ownerDocument;
    if (t.data === "$~") t._reactRetry = a;
    else if (t.data !== "$?" || i.readyState !== "loading")
      a();
    else {
      var o = function() {
        a(), i.removeEventListener("DOMContentLoaded", o);
      };
      i.addEventListener("DOMContentLoaded", o), t._reactRetry = o;
    }
  }
  function Qn(t) {
    for (; t != null; t = t.nextSibling) {
      var a = t.nodeType;
      if (a === 1 || a === 3) break;
      if (a === 8) {
        if (a = t.data, a === "$" || a === "$!" || a === "$?" || a === "$~" || a === "&" || a === "F!" || a === "F")
          break;
        if (a === "/$" || a === "/&") return null;
      }
    }
    return t;
  }
  var Gf = null;
  function y2(t) {
    t = t.nextSibling;
    for (var a = 0; t; ) {
      if (t.nodeType === 8) {
        var i = t.data;
        if (i === "/$" || i === "/&") {
          if (a === 0)
            return Qn(t.nextSibling);
          a--;
        } else
          i !== "$" && i !== "$!" && i !== "$?" && i !== "$~" && i !== "&" || a++;
      }
      t = t.nextSibling;
    }
    return null;
  }
  function v2(t) {
    t = t.previousSibling;
    for (var a = 0; t; ) {
      if (t.nodeType === 8) {
        var i = t.data;
        if (i === "$" || i === "$!" || i === "$?" || i === "$~" || i === "&") {
          if (a === 0) return t;
          a--;
        } else i !== "/$" && i !== "/&" || a++;
      }
      t = t.previousSibling;
    }
    return null;
  }
  function x2(t, a, i) {
    switch (a = yo(i), t) {
      case "html":
        if (t = a.documentElement, !t) throw Error(l(452));
        return t;
      case "head":
        if (t = a.head, !t) throw Error(l(453));
        return t;
      case "body":
        if (t = a.body, !t) throw Error(l(454));
        return t;
      default:
        throw Error(l(451));
    }
  }
  function bi(t) {
    for (var a = t.attributes; a.length; )
      t.removeAttributeNode(a[0]);
    ql(t);
  }
  var Jn = /* @__PURE__ */ new Map(), b2 = /* @__PURE__ */ new Set();
  function vo(t) {
    return typeof t.getRootNode == "function" ? t.getRootNode() : t.nodeType === 9 ? t : t.ownerDocument;
  }
  var Ka = Y.d;
  Y.d = {
    f: pg,
    r: gg,
    D: yg,
    C: vg,
    L: xg,
    m: bg,
    X: wg,
    S: Sg,
    M: Eg
  };
  function pg() {
    var t = Ka.f(), a = oo();
    return t || a;
  }
  function gg(t) {
    var a = Na(t);
    a !== null && a.tag === 5 && a.type === "form" ? Lm(a) : Ka.r(t);
  }
  var il = typeof document > "u" ? null : document;
  function S2(t, a, i) {
    var o = il;
    if (o && typeof a == "string" && a) {
      var f = Gn(a);
      f = 'link[rel="' + t + '"][href="' + f + '"]', typeof i == "string" && (f += '[crossorigin="' + i + '"]'), b2.has(f) || (b2.add(f), t = { rel: t, crossOrigin: i, href: a }, o.querySelector(f) === null && (a = o.createElement("link"), en(a, "link", t), Bt(a), o.head.appendChild(a)));
    }
  }
  function yg(t) {
    Ka.D(t), S2("dns-prefetch", t, null);
  }
  function vg(t, a) {
    Ka.C(t, a), S2("preconnect", t, a);
  }
  function xg(t, a, i) {
    Ka.L(t, a, i);
    var o = il;
    if (o && t && a) {
      var f = 'link[rel="preload"][as="' + Gn(a) + '"]';
      a === "image" && i && i.imageSrcSet ? (f += '[imagesrcset="' + Gn(
        i.imageSrcSet
      ) + '"]', typeof i.imageSizes == "string" && (f += '[imagesizes="' + Gn(
        i.imageSizes
      ) + '"]')) : f += '[href="' + Gn(t) + '"]';
      var m = f;
      switch (a) {
        case "style":
          m = sl(t);
          break;
        case "script":
          m = ol(t);
      }
      Jn.has(m) || (t = y(
        {
          rel: "preload",
          href: a === "image" && i && i.imageSrcSet ? void 0 : t,
          as: a
        },
        i
      ), Jn.set(m, t), o.querySelector(f) !== null || a === "style" && o.querySelector(Si(m)) || a === "script" && o.querySelector(wi(m)) || (a = o.createElement("link"), en(a, "link", t), Bt(a), o.head.appendChild(a)));
    }
  }
  function bg(t, a) {
    Ka.m(t, a);
    var i = il;
    if (i && t) {
      var o = a && typeof a.as == "string" ? a.as : "script", f = 'link[rel="modulepreload"][as="' + Gn(o) + '"][href="' + Gn(t) + '"]', m = f;
      switch (o) {
        case "audioworklet":
        case "paintworklet":
        case "serviceworker":
        case "sharedworker":
        case "worker":
        case "script":
          m = ol(t);
      }
      if (!Jn.has(m) && (t = y({ rel: "modulepreload", href: t }, a), Jn.set(m, t), i.querySelector(f) === null)) {
        switch (o) {
          case "audioworklet":
          case "paintworklet":
          case "serviceworker":
          case "sharedworker":
          case "worker":
          case "script":
            if (i.querySelector(wi(m)))
              return;
        }
        o = i.createElement("link"), en(o, "link", t), Bt(o), i.head.appendChild(o);
      }
    }
  }
  function Sg(t, a, i) {
    Ka.S(t, a, i);
    var o = il;
    if (o && t) {
      var f = h0(o).hoistableStyles, m = sl(t);
      a = a || "default";
      var S = f.get(m);
      if (!S) {
        var C = { loading: 0, preload: null };
        if (S = o.querySelector(
          Si(m)
        ))
          C.loading = 5;
        else {
          t = y(
            { rel: "stylesheet", href: t, "data-precedence": a },
            i
          ), (i = Jn.get(m)) && Xf(t, i);
          var j = S = o.createElement("link");
          Bt(j), en(j, "link", t), j._p = new Promise(function(ee, fe) {
            j.onload = ee, j.onerror = fe;
          }), j.addEventListener("load", function() {
            C.loading |= 1;
          }), j.addEventListener("error", function() {
            C.loading |= 2;
          }), C.loading |= 4, xo(S, a, o);
        }
        S = {
          type: "stylesheet",
          instance: S,
          count: 1,
          state: C
        }, f.set(m, S);
      }
    }
  }
  function wg(t, a) {
    Ka.X(t, a);
    var i = il;
    if (i && t) {
      var o = h0(i).hoistableScripts, f = ol(t), m = o.get(f);
      m || (m = i.querySelector(wi(f)), m || (t = y({ src: t, async: !0 }, a), (a = Jn.get(f)) && $f(t, a), m = i.createElement("script"), Bt(m), en(m, "link", t), i.head.appendChild(m)), m = {
        type: "script",
        instance: m,
        count: 1,
        state: null
      }, o.set(f, m));
    }
  }
  function Eg(t, a) {
    Ka.M(t, a);
    var i = il;
    if (i && t) {
      var o = h0(i).hoistableScripts, f = ol(t), m = o.get(f);
      m || (m = i.querySelector(wi(f)), m || (t = y({ src: t, async: !0, type: "module" }, a), (a = Jn.get(f)) && $f(t, a), m = i.createElement("script"), Bt(m), en(m, "link", t), i.head.appendChild(m)), m = {
        type: "script",
        instance: m,
        count: 1,
        state: null
      }, o.set(f, m));
    }
  }
  function w2(t, a, i, o) {
    var f = (f = Te.current) ? vo(f) : null;
    if (!f) throw Error(l(446));
    switch (t) {
      case "meta":
      case "title":
        return null;
      case "style":
        return typeof i.precedence == "string" && typeof i.href == "string" ? (a = sl(i.href), i = h0(
          f
        ).hoistableStyles, o = i.get(a), o || (o = {
          type: "style",
          instance: null,
          count: 0,
          state: null
        }, i.set(a, o)), o) : { type: "void", instance: null, count: 0, state: null };
      case "link":
        if (i.rel === "stylesheet" && typeof i.href == "string" && typeof i.precedence == "string") {
          t = sl(i.href);
          var m = h0(
            f
          ).hoistableStyles, S = m.get(t);
          if (S || (f = f.ownerDocument || f, S = {
            type: "stylesheet",
            instance: null,
            count: 0,
            state: { loading: 0, preload: null }
          }, m.set(t, S), (m = f.querySelector(
            Si(t)
          )) && !m._p && (S.instance = m, S.state.loading = 5), Jn.has(t) || (i = {
            rel: "preload",
            as: "style",
            href: i.href,
            crossOrigin: i.crossOrigin,
            integrity: i.integrity,
            media: i.media,
            hrefLang: i.hrefLang,
            referrerPolicy: i.referrerPolicy
          }, Jn.set(t, i), m || Mg(
            f,
            t,
            i,
            S.state
          ))), a && o === null)
            throw Error(l(528, ""));
          return S;
        }
        if (a && o !== null)
          throw Error(l(529, ""));
        return null;
      case "script":
        return a = i.async, i = i.src, typeof i == "string" && a && typeof a != "function" && typeof a != "symbol" ? (a = ol(i), i = h0(
          f
        ).hoistableScripts, o = i.get(a), o || (o = {
          type: "script",
          instance: null,
          count: 0,
          state: null
        }, i.set(a, o)), o) : { type: "void", instance: null, count: 0, state: null };
      default:
        throw Error(l(444, t));
    }
  }
  function sl(t) {
    return 'href="' + Gn(t) + '"';
  }
  function Si(t) {
    return 'link[rel="stylesheet"][' + t + "]";
  }
  function E2(t) {
    return y({}, t, {
      "data-precedence": t.precedence,
      precedence: null
    });
  }
  function Mg(t, a, i, o) {
    t.querySelector('link[rel="preload"][as="style"][' + a + "]") ? o.loading = 1 : (a = t.createElement("link"), o.preload = a, a.addEventListener("load", function() {
      return o.loading |= 1;
    }), a.addEventListener("error", function() {
      return o.loading |= 2;
    }), en(a, "link", i), Bt(a), t.head.appendChild(a));
  }
  function ol(t) {
    return '[src="' + Gn(t) + '"]';
  }
  function wi(t) {
    return "script[async]" + t;
  }
  function M2(t, a, i) {
    if (a.count++, a.instance === null)
      switch (a.type) {
        case "style":
          var o = t.querySelector(
            'style[data-href~="' + Gn(i.href) + '"]'
          );
          if (o)
            return a.instance = o, Bt(o), o;
          var f = y({}, i, {
            "data-href": i.href,
            "data-precedence": i.precedence,
            href: null,
            precedence: null
          });
          return o = (t.ownerDocument || t).createElement(
            "style"
          ), Bt(o), en(o, "style", f), xo(o, i.precedence, t), a.instance = o;
        case "stylesheet":
          f = sl(i.href);
          var m = t.querySelector(
            Si(f)
          );
          if (m)
            return a.state.loading |= 4, a.instance = m, Bt(m), m;
          o = E2(i), (f = Jn.get(f)) && Xf(o, f), m = (t.ownerDocument || t).createElement("link"), Bt(m);
          var S = m;
          return S._p = new Promise(function(C, j) {
            S.onload = C, S.onerror = j;
          }), en(m, "link", o), a.state.loading |= 4, xo(m, i.precedence, t), a.instance = m;
        case "script":
          return m = ol(i.src), (f = t.querySelector(
            wi(m)
          )) ? (a.instance = f, Bt(f), f) : (o = i, (f = Jn.get(m)) && (o = y({}, i), $f(o, f)), t = t.ownerDocument || t, f = t.createElement("script"), Bt(f), en(f, "link", o), t.head.appendChild(f), a.instance = f);
        case "void":
          return null;
        default:
          throw Error(l(443, a.type));
      }
    else
      a.type === "stylesheet" && (a.state.loading & 4) === 0 && (o = a.instance, a.state.loading |= 4, xo(o, i.precedence, t));
    return a.instance;
  }
  function xo(t, a, i) {
    for (var o = i.querySelectorAll(
      'link[rel="stylesheet"][data-precedence],style[data-precedence]'
    ), f = o.length ? o[o.length - 1] : null, m = f, S = 0; S < o.length; S++) {
      var C = o[S];
      if (C.dataset.precedence === a) m = C;
      else if (m !== f) break;
    }
    m ? m.parentNode.insertBefore(t, m.nextSibling) : (a = i.nodeType === 9 ? i.head : i, a.insertBefore(t, a.firstChild));
  }
  function Xf(t, a) {
    t.crossOrigin == null && (t.crossOrigin = a.crossOrigin), t.referrerPolicy == null && (t.referrerPolicy = a.referrerPolicy), t.title == null && (t.title = a.title);
  }
  function $f(t, a) {
    t.crossOrigin == null && (t.crossOrigin = a.crossOrigin), t.referrerPolicy == null && (t.referrerPolicy = a.referrerPolicy), t.integrity == null && (t.integrity = a.integrity);
  }
  var bo = null;
  function T2(t, a, i) {
    if (bo === null) {
      var o = /* @__PURE__ */ new Map(), f = bo = /* @__PURE__ */ new Map();
      f.set(i, o);
    } else
      f = bo, o = f.get(i), o || (o = /* @__PURE__ */ new Map(), f.set(i, o));
    if (o.has(t)) return o;
    for (o.set(t, null), i = i.getElementsByTagName(t), f = 0; f < i.length; f++) {
      var m = i[f];
      if (!(m[nr] || m[Gt] || t === "link" && m.getAttribute("rel") === "stylesheet") && m.namespaceURI !== "http://www.w3.org/2000/svg") {
        var S = m.getAttribute(a) || "";
        S = t + S;
        var C = o.get(S);
        C ? C.push(m) : o.set(S, [m]);
      }
    }
    return o;
  }
  function z2(t, a, i) {
    t = t.ownerDocument || t, t.head.insertBefore(
      i,
      a === "title" ? t.querySelector("head > title") : null
    );
  }
  function Tg(t, a, i) {
    if (i === 1 || a.itemProp != null) return !1;
    switch (t) {
      case "meta":
      case "title":
        return !0;
      case "style":
        if (typeof a.precedence != "string" || typeof a.href != "string" || a.href === "")
          break;
        return !0;
      case "link":
        if (typeof a.rel != "string" || typeof a.href != "string" || a.href === "" || a.onLoad || a.onError)
          break;
        return a.rel === "stylesheet" ? (t = a.disabled, typeof a.precedence == "string" && t == null) : !0;
      case "script":
        if (a.async && typeof a.async != "function" && typeof a.async != "symbol" && !a.onLoad && !a.onError && a.src && typeof a.src == "string")
          return !0;
    }
    return !1;
  }
  function A2(t) {
    return !(t.type === "stylesheet" && (t.state.loading & 3) === 0);
  }
  function zg(t, a, i, o) {
    if (i.type === "stylesheet" && (typeof o.media != "string" || matchMedia(o.media).matches !== !1) && (i.state.loading & 4) === 0) {
      if (i.instance === null) {
        var f = sl(o.href), m = a.querySelector(
          Si(f)
        );
        if (m) {
          a = m._p, a !== null && typeof a == "object" && typeof a.then == "function" && (t.count++, t = So.bind(t), a.then(t, t)), i.state.loading |= 4, i.instance = m, Bt(m);
          return;
        }
        m = a.ownerDocument || a, o = E2(o), (f = Jn.get(f)) && Xf(o, f), m = m.createElement("link"), Bt(m);
        var S = m;
        S._p = new Promise(function(C, j) {
          S.onload = C, S.onerror = j;
        }), en(m, "link", o), i.instance = m;
      }
      t.stylesheets === null && (t.stylesheets = /* @__PURE__ */ new Map()), t.stylesheets.set(i, a), (a = i.state.preload) && (i.state.loading & 3) === 0 && (t.count++, i = So.bind(t), a.addEventListener("load", i), a.addEventListener("error", i));
    }
  }
  var Zf = 0;
  function Ag(t, a) {
    return t.stylesheets && t.count === 0 && Eo(t, t.stylesheets), 0 < t.count || 0 < t.imgCount ? function(i) {
      var o = setTimeout(function() {
        if (t.stylesheets && Eo(t, t.stylesheets), t.unsuspend) {
          var m = t.unsuspend;
          t.unsuspend = null, m();
        }
      }, 6e4 + a);
      0 < t.imgBytes && Zf === 0 && (Zf = 62500 * sg());
      var f = setTimeout(
        function() {
          if (t.waitingForImages = !1, t.count === 0 && (t.stylesheets && Eo(t, t.stylesheets), t.unsuspend)) {
            var m = t.unsuspend;
            t.unsuspend = null, m();
          }
        },
        (t.imgBytes > Zf ? 50 : 800) + a
      );
      return t.unsuspend = i, function() {
        t.unsuspend = null, clearTimeout(o), clearTimeout(f);
      };
    } : null;
  }
  function So() {
    if (this.count--, this.count === 0 && (this.imgCount === 0 || !this.waitingForImages)) {
      if (this.stylesheets) Eo(this, this.stylesheets);
      else if (this.unsuspend) {
        var t = this.unsuspend;
        this.unsuspend = null, t();
      }
    }
  }
  var wo = null;
  function Eo(t, a) {
    t.stylesheets = null, t.unsuspend !== null && (t.count++, wo = /* @__PURE__ */ new Map(), a.forEach(Cg, t), wo = null, So.call(t));
  }
  function Cg(t, a) {
    if (!(a.state.loading & 4)) {
      var i = wo.get(t);
      if (i) var o = i.get(null);
      else {
        i = /* @__PURE__ */ new Map(), wo.set(t, i);
        for (var f = t.querySelectorAll(
          "link[data-precedence],style[data-precedence]"
        ), m = 0; m < f.length; m++) {
          var S = f[m];
          (S.nodeName === "LINK" || S.getAttribute("media") !== "not all") && (i.set(S.dataset.precedence, S), o = S);
        }
        o && i.set(null, o);
      }
      f = a.instance, S = f.getAttribute("data-precedence"), m = i.get(S) || o, m === o && i.set(null, f), i.set(S, f), this.count++, o = So.bind(this), f.addEventListener("load", o), f.addEventListener("error", o), m ? m.parentNode.insertBefore(f, m.nextSibling) : (t = t.nodeType === 9 ? t.head : t, t.insertBefore(f, t.firstChild)), a.state.loading |= 4;
    }
  }
  var Ei = {
    $$typeof: q,
    Provider: null,
    Consumer: null,
    _currentValue: I,
    _currentValue2: I,
    _threadCount: 0
  };
  function Ng(t, a, i, o, f, m, S, C, j) {
    this.tag = 1, this.containerInfo = t, this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null, this.callbackPriority = 0, this.expirationTimes = Bl(-1), this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = Bl(0), this.hiddenUpdates = Bl(null), this.identifierPrefix = o, this.onUncaughtError = f, this.onCaughtError = m, this.onRecoverableError = S, this.pooledCache = null, this.pooledCacheLanes = 0, this.formState = j, this.incompleteTransitions = /* @__PURE__ */ new Map();
  }
  function C2(t, a, i, o, f, m, S, C, j, ee, fe, pe) {
    return t = new Ng(
      t,
      a,
      i,
      S,
      j,
      ee,
      fe,
      pe,
      C
    ), a = 1, m === !0 && (a |= 24), m = Nn(3, null, null, a), t.current = m, m.stateNode = t, a = Mc(), a.refCount++, t.pooledCache = a, a.refCount++, m.memoizedState = {
      element: o,
      isDehydrated: i,
      cache: a
    }, Cc(m), t;
  }
  function N2(t) {
    return t ? (t = Ur, t) : Ur;
  }
  function k2(t, a, i, o, f, m) {
    f = N2(f), o.context === null ? o.context = f : o.pendingContext = f, o = x0(a), o.payload = { element: i }, m = m === void 0 ? null : m, m !== null && (o.callback = m), i = b0(t, o, a), i !== null && (bn(i, t, a), ti(i, t, a));
  }
  function D2(t, a) {
    if (t = t.memoizedState, t !== null && t.dehydrated !== null) {
      var i = t.retryLane;
      t.retryLane = i !== 0 && i < a ? i : a;
    }
  }
  function Ff(t, a) {
    D2(t, a), (t = t.alternate) && D2(t, a);
  }
  function _2(t) {
    if (t.tag === 13 || t.tag === 31) {
      var a = sr(t, 67108864);
      a !== null && bn(a, t, 67108864), Ff(t, 67108864);
    }
  }
  function R2(t) {
    if (t.tag === 13 || t.tag === 31) {
      var a = Bn();
      a = Ol(a);
      var i = sr(t, a);
      i !== null && bn(i, t, a), Ff(t, a);
    }
  }
  var Mo = !0;
  function kg(t, a, i, o) {
    var f = D.T;
    D.T = null;
    var m = Y.p;
    try {
      Y.p = 2, If(t, a, i, o);
    } finally {
      Y.p = m, D.T = f;
    }
  }
  function Dg(t, a, i, o) {
    var f = D.T;
    D.T = null;
    var m = Y.p;
    try {
      Y.p = 8, If(t, a, i, o);
    } finally {
      Y.p = m, D.T = f;
    }
  }
  function If(t, a, i, o) {
    if (Mo) {
      var f = Kf(o);
      if (f === null)
        Bf(
          t,
          a,
          o,
          To,
          i
        ), O2(t, o);
      else if (Rg(
        f,
        t,
        a,
        i,
        o
      ))
        o.stopPropagation();
      else if (O2(t, o), a & 4 && -1 < _g.indexOf(t)) {
        for (; f !== null; ) {
          var m = Na(f);
          if (m !== null)
            switch (m.tag) {
              case 3:
                if (m = m.stateNode, m.current.memoizedState.isDehydrated) {
                  var S = on(m.pendingLanes);
                  if (S !== 0) {
                    var C = m;
                    for (C.pendingLanes |= 2, C.entangledLanes |= 2; S; ) {
                      var j = 1 << 31 - vt(S);
                      C.entanglements[1] |= j, S &= ~j;
                    }
                    ga(m), (rt & 6) === 0 && (io = We() + 500, yi(0));
                  }
                }
                break;
              case 31:
              case 13:
                C = sr(m, 2), C !== null && bn(C, m, 2), oo(), Ff(m, 2);
            }
          if (m = Kf(o), m === null && Bf(
            t,
            a,
            o,
            To,
            i
          ), m === f) break;
          f = m;
        }
        f !== null && o.stopPropagation();
      } else
        Bf(
          t,
          a,
          o,
          null,
          i
        );
    }
  }
  function Kf(t) {
    return t = Qu(t), Qf(t);
  }
  var To = null;
  function Qf(t) {
    if (To = null, t = f0(t), t !== null) {
      var a = u(t);
      if (a === null) t = null;
      else {
        var i = a.tag;
        if (i === 13) {
          if (t = c(a), t !== null) return t;
          t = null;
        } else if (i === 31) {
          if (t = h(a), t !== null) return t;
          t = null;
        } else if (i === 3) {
          if (a.stateNode.current.memoizedState.isDehydrated)
            return a.tag === 3 ? a.stateNode.containerInfo : null;
          t = null;
        } else a !== t && (t = null);
      }
    }
    return To = t, null;
  }
  function B2(t) {
    switch (t) {
      case "beforetoggle":
      case "cancel":
      case "click":
      case "close":
      case "contextmenu":
      case "copy":
      case "cut":
      case "auxclick":
      case "dblclick":
      case "dragend":
      case "dragstart":
      case "drop":
      case "focusin":
      case "focusout":
      case "input":
      case "invalid":
      case "keydown":
      case "keypress":
      case "keyup":
      case "mousedown":
      case "mouseup":
      case "paste":
      case "pause":
      case "play":
      case "pointercancel":
      case "pointerdown":
      case "pointerup":
      case "ratechange":
      case "reset":
      case "resize":
      case "seeked":
      case "submit":
      case "toggle":
      case "touchcancel":
      case "touchend":
      case "touchstart":
      case "volumechange":
      case "change":
      case "selectionchange":
      case "textInput":
      case "compositionstart":
      case "compositionend":
      case "compositionupdate":
      case "beforeblur":
      case "afterblur":
      case "beforeinput":
      case "blur":
      case "fullscreenchange":
      case "focus":
      case "hashchange":
      case "popstate":
      case "select":
      case "selectstart":
        return 2;
      case "drag":
      case "dragenter":
      case "dragexit":
      case "dragleave":
      case "dragover":
      case "mousemove":
      case "mouseout":
      case "mouseover":
      case "pointermove":
      case "pointerout":
      case "pointerover":
      case "scroll":
      case "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 8;
      case "message":
        switch (Yt()) {
          case Zt:
            return 2;
          case tn:
            return 8;
          case nn:
          case jn:
            return 32;
          case o0:
            return 268435456;
          default:
            return 32;
        }
      default:
        return 32;
    }
  }
  var Jf = !1, D0 = null, _0 = null, R0 = null, Mi = /* @__PURE__ */ new Map(), Ti = /* @__PURE__ */ new Map(), B0 = [], _g = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
    " "
  );
  function O2(t, a) {
    switch (t) {
      case "focusin":
      case "focusout":
        D0 = null;
        break;
      case "dragenter":
      case "dragleave":
        _0 = null;
        break;
      case "mouseover":
      case "mouseout":
        R0 = null;
        break;
      case "pointerover":
      case "pointerout":
        Mi.delete(a.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        Ti.delete(a.pointerId);
    }
  }
  function zi(t, a, i, o, f, m) {
    return t === null || t.nativeEvent !== m ? (t = {
      blockedOn: a,
      domEventName: i,
      eventSystemFlags: o,
      nativeEvent: m,
      targetContainers: [f]
    }, a !== null && (a = Na(a), a !== null && _2(a)), t) : (t.eventSystemFlags |= o, a = t.targetContainers, f !== null && a.indexOf(f) === -1 && a.push(f), t);
  }
  function Rg(t, a, i, o, f) {
    switch (a) {
      case "focusin":
        return D0 = zi(
          D0,
          t,
          a,
          i,
          o,
          f
        ), !0;
      case "dragenter":
        return _0 = zi(
          _0,
          t,
          a,
          i,
          o,
          f
        ), !0;
      case "mouseover":
        return R0 = zi(
          R0,
          t,
          a,
          i,
          o,
          f
        ), !0;
      case "pointerover":
        var m = f.pointerId;
        return Mi.set(
          m,
          zi(
            Mi.get(m) || null,
            t,
            a,
            i,
            o,
            f
          )
        ), !0;
      case "gotpointercapture":
        return m = f.pointerId, Ti.set(
          m,
          zi(
            Ti.get(m) || null,
            t,
            a,
            i,
            o,
            f
          )
        ), !0;
    }
    return !1;
  }
  function H2(t) {
    var a = f0(t.target);
    if (a !== null) {
      var i = u(a);
      if (i !== null) {
        if (a = i.tag, a === 13) {
          if (a = c(i), a !== null) {
            t.blockedOn = a, hs(t.priority, function() {
              R2(i);
            });
            return;
          }
        } else if (a === 31) {
          if (a = h(i), a !== null) {
            t.blockedOn = a, hs(t.priority, function() {
              R2(i);
            });
            return;
          }
        } else if (a === 3 && i.stateNode.current.memoizedState.isDehydrated) {
          t.blockedOn = i.tag === 3 ? i.stateNode.containerInfo : null;
          return;
        }
      }
    }
    t.blockedOn = null;
  }
  function zo(t) {
    if (t.blockedOn !== null) return !1;
    for (var a = t.targetContainers; 0 < a.length; ) {
      var i = Kf(t.nativeEvent);
      if (i === null) {
        i = t.nativeEvent;
        var o = new i.constructor(
          i.type,
          i
        );
        Ku = o, i.target.dispatchEvent(o), Ku = null;
      } else
        return a = Na(i), a !== null && _2(a), t.blockedOn = i, !1;
      a.shift();
    }
    return !0;
  }
  function L2(t, a, i) {
    zo(t) && i.delete(a);
  }
  function Bg() {
    Jf = !1, D0 !== null && zo(D0) && (D0 = null), _0 !== null && zo(_0) && (_0 = null), R0 !== null && zo(R0) && (R0 = null), Mi.forEach(L2), Ti.forEach(L2);
  }
  function Ao(t, a) {
    t.blockedOn === a && (t.blockedOn = null, Jf || (Jf = !0, e.unstable_scheduleCallback(
      e.unstable_NormalPriority,
      Bg
    )));
  }
  var Co = null;
  function q2(t) {
    Co !== t && (Co = t, e.unstable_scheduleCallback(
      e.unstable_NormalPriority,
      function() {
        Co === t && (Co = null);
        for (var a = 0; a < t.length; a += 3) {
          var i = t[a], o = t[a + 1], f = t[a + 2];
          if (typeof o != "function") {
            if (Qf(o || i) === null)
              continue;
            break;
          }
          var m = Na(i);
          m !== null && (t.splice(a, 3), a -= 3, Ic(
            m,
            {
              pending: !0,
              data: f,
              method: i.method,
              action: o
            },
            o,
            f
          ));
        }
      }
    ));
  }
  function ul(t) {
    function a(j) {
      return Ao(j, t);
    }
    D0 !== null && Ao(D0, t), _0 !== null && Ao(_0, t), R0 !== null && Ao(R0, t), Mi.forEach(a), Ti.forEach(a);
    for (var i = 0; i < B0.length; i++) {
      var o = B0[i];
      o.blockedOn === t && (o.blockedOn = null);
    }
    for (; 0 < B0.length && (i = B0[0], i.blockedOn === null); )
      H2(i), i.blockedOn === null && B0.shift();
    if (i = (t.ownerDocument || t).$$reactFormReplay, i != null)
      for (o = 0; o < i.length; o += 3) {
        var f = i[o], m = i[o + 1], S = f[Qt] || null;
        if (typeof m == "function")
          S || q2(i);
        else if (S) {
          var C = null;
          if (m && m.hasAttribute("formAction")) {
            if (f = m, S = m[Qt] || null)
              C = S.formAction;
            else if (Qf(f) !== null) continue;
          } else C = S.action;
          typeof C == "function" ? i[o + 1] = C : (i.splice(o, 3), o -= 3), q2(i);
        }
      }
  }
  function U2() {
    function t(m) {
      m.canIntercept && m.info === "react-transition" && m.intercept({
        handler: function() {
          return new Promise(function(S) {
            return f = S;
          });
        },
        focusReset: "manual",
        scroll: "manual"
      });
    }
    function a() {
      f !== null && (f(), f = null), o || setTimeout(i, 20);
    }
    function i() {
      if (!o && !navigation.transition) {
        var m = navigation.currentEntry;
        m && m.url != null && navigation.navigate(m.url, {
          state: m.getState(),
          info: "react-transition",
          history: "replace"
        });
      }
    }
    if (typeof navigation == "object") {
      var o = !1, f = null;
      return navigation.addEventListener("navigate", t), navigation.addEventListener("navigatesuccess", a), navigation.addEventListener("navigateerror", a), setTimeout(i, 100), function() {
        o = !0, navigation.removeEventListener("navigate", t), navigation.removeEventListener("navigatesuccess", a), navigation.removeEventListener("navigateerror", a), f !== null && (f(), f = null);
      };
    }
  }
  function Wf(t) {
    this._internalRoot = t;
  }
  No.prototype.render = Wf.prototype.render = function(t) {
    var a = this._internalRoot;
    if (a === null) throw Error(l(409));
    var i = a.current, o = Bn();
    k2(i, o, t, a, null, null);
  }, No.prototype.unmount = Wf.prototype.unmount = function() {
    var t = this._internalRoot;
    if (t !== null) {
      this._internalRoot = null;
      var a = t.containerInfo;
      k2(t.current, 2, null, t, null, null), oo(), a[c0] = null;
    }
  };
  function No(t) {
    this._internalRoot = t;
  }
  No.prototype.unstable_scheduleHydration = function(t) {
    if (t) {
      var a = fs();
      t = { blockedOn: null, target: t, priority: a };
      for (var i = 0; i < B0.length && a !== 0 && a < B0[i].priority; i++) ;
      B0.splice(i, 0, t), i === 0 && H2(t);
    }
  };
  var j2 = n.version;
  if (j2 !== "19.2.3")
    throw Error(
      l(
        527,
        j2,
        "19.2.3"
      )
    );
  Y.findDOMNode = function(t) {
    var a = t._reactInternals;
    if (a === void 0)
      throw typeof t.render == "function" ? Error(l(188)) : (t = Object.keys(t).join(","), Error(l(268, t)));
    return t = p(a), t = t !== null ? g(t) : null, t = t === null ? null : t.stateNode, t;
  };
  var Og = {
    bundleType: 0,
    version: "19.2.3",
    rendererPackageName: "react-dom",
    currentDispatcherRef: D,
    reconcilerVersion: "19.2.3"
  };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var ko = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!ko.isDisabled && ko.supportsFiber)
      try {
        An = ko.inject(
          Og
        ), kt = ko;
      } catch {
      }
  }
  return Ci.createRoot = function(t, a) {
    if (!s(t)) throw Error(l(299));
    var i = !1, o = "", f = Fm, m = Im, S = Km;
    return a != null && (a.unstable_strictMode === !0 && (i = !0), a.identifierPrefix !== void 0 && (o = a.identifierPrefix), a.onUncaughtError !== void 0 && (f = a.onUncaughtError), a.onCaughtError !== void 0 && (m = a.onCaughtError), a.onRecoverableError !== void 0 && (S = a.onRecoverableError)), a = C2(
      t,
      1,
      !1,
      null,
      null,
      i,
      o,
      null,
      f,
      m,
      S,
      U2
    ), t[c0] = a.current, Rf(t), new Wf(a);
  }, Ci.hydrateRoot = function(t, a, i) {
    if (!s(t)) throw Error(l(299));
    var o = !1, f = "", m = Fm, S = Im, C = Km, j = null;
    return i != null && (i.unstable_strictMode === !0 && (o = !0), i.identifierPrefix !== void 0 && (f = i.identifierPrefix), i.onUncaughtError !== void 0 && (m = i.onUncaughtError), i.onCaughtError !== void 0 && (S = i.onCaughtError), i.onRecoverableError !== void 0 && (C = i.onRecoverableError), i.formState !== void 0 && (j = i.formState)), a = C2(
      t,
      1,
      !0,
      a,
      i ?? null,
      o,
      f,
      j,
      m,
      S,
      C,
      U2
    ), a.context = N2(null), i = a.current, o = Bn(), o = Ol(o), f = x0(o), f.callback = null, b0(i, f, o), i = o, a.current.lanes = i, tr(a, i), ga(a), t[c0] = a.current, Rf(t), new No(a);
  }, Ci.version = "19.2.3", Ci;
}
var Q2;
function Xg() {
  if (Q2) return t1.exports;
  Q2 = 1;
  function e() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"))
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (n) {
        console.error(n);
      }
  }
  return e(), t1.exports = Gg(), t1.exports;
}
var $g = Xg();
function ln(e) {
  if (typeof e == "string" || typeof e == "number") return "" + e;
  let n = "";
  if (Array.isArray(e))
    for (let r = 0, l; r < e.length; r++)
      (l = ln(e[r])) !== "" && (n += (n && " ") + l);
  else
    for (let r in e)
      e[r] && (n += (n && " ") + r);
  return n;
}
var l1 = { exports: {} }, i1 = {}, s1 = { exports: {} }, o1 = {};
var J2;
function Zg() {
  if (J2) return o1;
  J2 = 1;
  var e = Ki();
  function n(y, x) {
    return y === x && (y !== 0 || 1 / y === 1 / x) || y !== y && x !== x;
  }
  var r = typeof Object.is == "function" ? Object.is : n, l = e.useState, s = e.useEffect, u = e.useLayoutEffect, c = e.useDebugValue;
  function h(y, x) {
    var w = x(), z = l({ inst: { value: w, getSnapshot: x } }), M = z[0].inst, A = z[1];
    return u(
      function() {
        M.value = w, M.getSnapshot = x, d(M) && A({ inst: M });
      },
      [y, w, x]
    ), s(
      function() {
        return d(M) && A({ inst: M }), y(function() {
          d(M) && A({ inst: M });
        });
      },
      [y]
    ), c(w), w;
  }
  function d(y) {
    var x = y.getSnapshot;
    y = y.value;
    try {
      var w = x();
      return !r(y, w);
    } catch {
      return !0;
    }
  }
  function p(y, x) {
    return x();
  }
  var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : h;
  return o1.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, o1;
}
var W2;
function Fg() {
  return W2 || (W2 = 1, s1.exports = Zg()), s1.exports;
}
var P2;
function Ig() {
  if (P2) return i1;
  P2 = 1;
  var e = Ki(), n = Fg();
  function r(p, g) {
    return p === g && (p !== 0 || 1 / p === 1 / g) || p !== p && g !== g;
  }
  var l = typeof Object.is == "function" ? Object.is : r, s = n.useSyncExternalStore, u = e.useRef, c = e.useEffect, h = e.useMemo, d = e.useDebugValue;
  return i1.useSyncExternalStoreWithSelector = function(p, g, y, x, w) {
    var z = u(null);
    if (z.current === null) {
      var M = { hasValue: !1, value: null };
      z.current = M;
    } else M = z.current;
    z = h(
      function() {
        function T(V) {
          if (!R) {
            if (R = !0, q = V, V = x(V), w !== void 0 && M.hasValue) {
              var Q = M.value;
              if (w(Q, V))
                return H = Q;
            }
            return H = V;
          }
          if (Q = H, l(q, V)) return Q;
          var re = x(V);
          return w !== void 0 && w(Q, re) ? (q = V, Q) : (q = V, H = re);
        }
        var R = !1, q, H, $ = y === void 0 ? null : y;
        return [
          function() {
            return T(g());
          },
          $ === null ? void 0 : function() {
            return T($());
          }
        ];
      },
      [g, y, x, w]
    );
    var A = s(p, z[0], z[1]);
    return c(
      function() {
        M.hasValue = !0, M.value = A;
      },
      [A]
    ), d(A), A;
  }, i1;
}
var e5;
function Kg() {
  return e5 || (e5 = 1, l1.exports = Ig()), l1.exports;
}
var Qg = Kg();
const Jg = /* @__PURE__ */ $3(Qg), Wg = {}, t5 = (e) => {
  let n;
  const r = /* @__PURE__ */ new Set(), l = (g, y) => {
    const x = typeof g == "function" ? g(n) : g;
    if (!Object.is(x, n)) {
      const w = n;
      n = y ?? (typeof x != "object" || x === null) ? x : Object.assign({}, n, x), r.forEach((z) => z(n, w));
    }
  }, s = () => n, d = { setState: l, getState: s, getInitialState: () => p, subscribe: (g) => (r.add(g), () => r.delete(g)), destroy: () => {
    (Wg ? "production" : void 0) !== "production" && console.warn(
      "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
    ), r.clear();
  } }, p = n = e(l, s, d);
  return d;
}, Pg = (e) => e ? t5(e) : t5, { useDebugValue: ey } = ce, { useSyncExternalStoreWithSelector: ty } = Jg, ny = (e) => e;
function F3(e, n = ny, r) {
  const l = ty(
    e.subscribe,
    e.getState,
    e.getServerState || e.getInitialState,
    n,
    r
  );
  return ey(l), l;
}
const n5 = (e, n) => {
  const r = Pg(e), l = (s, u = n) => F3(r, s, u);
  return Object.assign(l, r), l;
}, ay = (e, n) => e ? n5(e, n) : n5;
function Kt(e, n) {
  if (Object.is(e, n))
    return !0;
  if (typeof e != "object" || e === null || typeof n != "object" || n === null)
    return !1;
  if (e instanceof Map && n instanceof Map) {
    if (e.size !== n.size) return !1;
    for (const [l, s] of e)
      if (!Object.is(s, n.get(l)))
        return !1;
    return !0;
  }
  if (e instanceof Set && n instanceof Set) {
    if (e.size !== n.size) return !1;
    for (const l of e)
      if (!n.has(l))
        return !1;
    return !0;
  }
  const r = Object.keys(e);
  if (r.length !== Object.keys(n).length)
    return !1;
  for (const l of r)
    if (!Object.prototype.hasOwnProperty.call(n, l) || !Object.is(e[l], n[l]))
      return !1;
  return !0;
}
var ry = { value: () => {
} };
function Mu() {
  for (var e = 0, n = arguments.length, r = {}, l; e < n; ++e) {
    if (!(l = arguments[e] + "") || l in r || /[\s.]/.test(l)) throw new Error("illegal type: " + l);
    r[l] = [];
  }
  return new Jo(r);
}
function Jo(e) {
  this._ = e;
}
function ly(e, n) {
  return e.trim().split(/^|\s+/).map(function(r) {
    var l = "", s = r.indexOf(".");
    if (s >= 0 && (l = r.slice(s + 1), r = r.slice(0, s)), r && !n.hasOwnProperty(r)) throw new Error("unknown type: " + r);
    return { type: r, name: l };
  });
}
Jo.prototype = Mu.prototype = {
  constructor: Jo,
  on: function(e, n) {
    var r = this._, l = ly(e + "", r), s, u = -1, c = l.length;
    if (arguments.length < 2) {
      for (; ++u < c; ) if ((s = (e = l[u]).type) && (s = iy(r[s], e.name))) return s;
      return;
    }
    if (n != null && typeof n != "function") throw new Error("invalid callback: " + n);
    for (; ++u < c; )
      if (s = (e = l[u]).type) r[s] = a5(r[s], e.name, n);
      else if (n == null) for (s in r) r[s] = a5(r[s], e.name, null);
    return this;
  },
  copy: function() {
    var e = {}, n = this._;
    for (var r in n) e[r] = n[r].slice();
    return new Jo(e);
  },
  call: function(e, n) {
    if ((s = arguments.length - 2) > 0) for (var r = new Array(s), l = 0, s, u; l < s; ++l) r[l] = arguments[l + 2];
    if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e);
    for (u = this._[e], l = 0, s = u.length; l < s; ++l) u[l].value.apply(n, r);
  },
  apply: function(e, n, r) {
    if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e);
    for (var l = this._[e], s = 0, u = l.length; s < u; ++s) l[s].value.apply(n, r);
  }
};
function iy(e, n) {
  for (var r = 0, l = e.length, s; r < l; ++r)
    if ((s = e[r]).name === n)
      return s.value;
}
function a5(e, n, r) {
  for (var l = 0, s = e.length; l < s; ++l)
    if (e[l].name === n) {
      e[l] = ry, e = e.slice(0, l).concat(e.slice(l + 1));
      break;
    }
  return r != null && e.push({ name: n, value: r }), e;
}
var H1 = "http://www.w3.org/1999/xhtml";
const r5 = {
  svg: "http://www.w3.org/2000/svg",
  xhtml: H1,
  xlink: "http://www.w3.org/1999/xlink",
  xml: "http://www.w3.org/XML/1998/namespace",
  xmlns: "http://www.w3.org/2000/xmlns/"
};
function Tu(e) {
  var n = e += "", r = n.indexOf(":");
  return r >= 0 && (n = e.slice(0, r)) !== "xmlns" && (e = e.slice(r + 1)), r5.hasOwnProperty(n) ? { space: r5[n], local: e } : e;
}
function sy(e) {
  return function() {
    var n = this.ownerDocument, r = this.namespaceURI;
    return r === H1 && n.documentElement.namespaceURI === H1 ? n.createElement(e) : n.createElementNS(r, e);
  };
}
function oy(e) {
  return function() {
    return this.ownerDocument.createElementNS(e.space, e.local);
  };
}
function I3(e) {
  var n = Tu(e);
  return (n.local ? oy : sy)(n);
}
function uy() {
}
function hh(e) {
  return e == null ? uy : function() {
    return this.querySelector(e);
  };
}
function cy(e) {
  typeof e != "function" && (e = hh(e));
  for (var n = this._groups, r = n.length, l = new Array(r), s = 0; s < r; ++s)
    for (var u = n[s], c = u.length, h = l[s] = new Array(c), d, p, g = 0; g < c; ++g)
      (d = u[g]) && (p = e.call(d, d.__data__, g, u)) && ("__data__" in d && (p.__data__ = d.__data__), h[g] = p);
  return new qn(l, this._parents);
}
function fy(e) {
  return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
}
function hy() {
  return [];
}
function K3(e) {
  return e == null ? hy : function() {
    return this.querySelectorAll(e);
  };
}
function dy(e) {
  return function() {
    return fy(e.apply(this, arguments));
  };
}
function my(e) {
  typeof e == "function" ? e = dy(e) : e = K3(e);
  for (var n = this._groups, r = n.length, l = [], s = [], u = 0; u < r; ++u)
    for (var c = n[u], h = c.length, d, p = 0; p < h; ++p)
      (d = c[p]) && (l.push(e.call(d, d.__data__, p, c)), s.push(d));
  return new qn(l, s);
}
function Q3(e) {
  return function() {
    return this.matches(e);
  };
}
function J3(e) {
  return function(n) {
    return n.matches(e);
  };
}
var py = Array.prototype.find;
function gy(e) {
  return function() {
    return py.call(this.children, e);
  };
}
function yy() {
  return this.firstElementChild;
}
function vy(e) {
  return this.select(e == null ? yy : gy(typeof e == "function" ? e : J3(e)));
}
var xy = Array.prototype.filter;
function by() {
  return Array.from(this.children);
}
function Sy(e) {
  return function() {
    return xy.call(this.children, e);
  };
}
function wy(e) {
  return this.selectAll(e == null ? by : Sy(typeof e == "function" ? e : J3(e)));
}
function Ey(e) {
  typeof e != "function" && (e = Q3(e));
  for (var n = this._groups, r = n.length, l = new Array(r), s = 0; s < r; ++s)
    for (var u = n[s], c = u.length, h = l[s] = [], d, p = 0; p < c; ++p)
      (d = u[p]) && e.call(d, d.__data__, p, u) && h.push(d);
  return new qn(l, this._parents);
}
function W3(e) {
  return new Array(e.length);
}
function My() {
  return new qn(this._enter || this._groups.map(W3), this._parents);
}
function au(e, n) {
  this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = n;
}
au.prototype = {
  constructor: au,
  appendChild: function(e) {
    return this._parent.insertBefore(e, this._next);
  },
  insertBefore: function(e, n) {
    return this._parent.insertBefore(e, n);
  },
  querySelector: function(e) {
    return this._parent.querySelector(e);
  },
  querySelectorAll: function(e) {
    return this._parent.querySelectorAll(e);
  }
};
function Ty(e) {
  return function() {
    return e;
  };
}
function zy(e, n, r, l, s, u) {
  for (var c = 0, h, d = n.length, p = u.length; c < p; ++c)
    (h = n[c]) ? (h.__data__ = u[c], l[c] = h) : r[c] = new au(e, u[c]);
  for (; c < d; ++c)
    (h = n[c]) && (s[c] = h);
}
function Ay(e, n, r, l, s, u, c) {
  var h, d, p = /* @__PURE__ */ new Map(), g = n.length, y = u.length, x = new Array(g), w;
  for (h = 0; h < g; ++h)
    (d = n[h]) && (x[h] = w = c.call(d, d.__data__, h, n) + "", p.has(w) ? s[h] = d : p.set(w, d));
  for (h = 0; h < y; ++h)
    w = c.call(e, u[h], h, u) + "", (d = p.get(w)) ? (l[h] = d, d.__data__ = u[h], p.delete(w)) : r[h] = new au(e, u[h]);
  for (h = 0; h < g; ++h)
    (d = n[h]) && p.get(x[h]) === d && (s[h] = d);
}
function Cy(e) {
  return e.__data__;
}
function Ny(e, n) {
  if (!arguments.length) return Array.from(this, Cy);
  var r = n ? Ay : zy, l = this._parents, s = this._groups;
  typeof e != "function" && (e = Ty(e));
  for (var u = s.length, c = new Array(u), h = new Array(u), d = new Array(u), p = 0; p < u; ++p) {
    var g = l[p], y = s[p], x = y.length, w = ky(e.call(g, g && g.__data__, p, l)), z = w.length, M = h[p] = new Array(z), A = c[p] = new Array(z), T = d[p] = new Array(x);
    r(g, y, M, A, T, w, n);
    for (var R = 0, q = 0, H, $; R < z; ++R)
      if (H = M[R]) {
        for (R >= q && (q = R + 1); !($ = A[q]) && ++q < z; ) ;
        H._next = $ || null;
      }
  }
  return c = new qn(c, l), c._enter = h, c._exit = d, c;
}
function ky(e) {
  return typeof e == "object" && "length" in e ? e : Array.from(e);
}
function Dy() {
  return new qn(this._exit || this._groups.map(W3), this._parents);
}
function _y(e, n, r) {
  var l = this.enter(), s = this, u = this.exit();
  return typeof e == "function" ? (l = e(l), l && (l = l.selection())) : l = l.append(e + ""), n != null && (s = n(s), s && (s = s.selection())), r == null ? u.remove() : r(u), l && s ? l.merge(s).order() : s;
}
function Ry(e) {
  for (var n = e.selection ? e.selection() : e, r = this._groups, l = n._groups, s = r.length, u = l.length, c = Math.min(s, u), h = new Array(s), d = 0; d < c; ++d)
    for (var p = r[d], g = l[d], y = p.length, x = h[d] = new Array(y), w, z = 0; z < y; ++z)
      (w = p[z] || g[z]) && (x[z] = w);
  for (; d < s; ++d)
    h[d] = r[d];
  return new qn(h, this._parents);
}
function By() {
  for (var e = this._groups, n = -1, r = e.length; ++n < r; )
    for (var l = e[n], s = l.length - 1, u = l[s], c; --s >= 0; )
      (c = l[s]) && (u && c.compareDocumentPosition(u) ^ 4 && u.parentNode.insertBefore(c, u), u = c);
  return this;
}
function Oy(e) {
  e || (e = Hy);
  function n(y, x) {
    return y && x ? e(y.__data__, x.__data__) : !y - !x;
  }
  for (var r = this._groups, l = r.length, s = new Array(l), u = 0; u < l; ++u) {
    for (var c = r[u], h = c.length, d = s[u] = new Array(h), p, g = 0; g < h; ++g)
      (p = c[g]) && (d[g] = p);
    d.sort(n);
  }
  return new qn(s, this._parents).order();
}
function Hy(e, n) {
  return e < n ? -1 : e > n ? 1 : e >= n ? 0 : NaN;
}
function Ly() {
  var e = arguments[0];
  return arguments[0] = this, e.apply(null, arguments), this;
}
function qy() {
  return Array.from(this);
}
function Uy() {
  for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
    for (var l = e[n], s = 0, u = l.length; s < u; ++s) {
      var c = l[s];
      if (c) return c;
    }
  return null;
}
function jy() {
  let e = 0;
  for (const n of this) ++e;
  return e;
}
function Vy() {
  return !this.node();
}
function Yy(e) {
  for (var n = this._groups, r = 0, l = n.length; r < l; ++r)
    for (var s = n[r], u = 0, c = s.length, h; u < c; ++u)
      (h = s[u]) && e.call(h, h.__data__, u, s);
  return this;
}
function Gy(e) {
  return function() {
    this.removeAttribute(e);
  };
}
function Xy(e) {
  return function() {
    this.removeAttributeNS(e.space, e.local);
  };
}
function $y(e, n) {
  return function() {
    this.setAttribute(e, n);
  };
}
function Zy(e, n) {
  return function() {
    this.setAttributeNS(e.space, e.local, n);
  };
}
function Fy(e, n) {
  return function() {
    var r = n.apply(this, arguments);
    r == null ? this.removeAttribute(e) : this.setAttribute(e, r);
  };
}
function Iy(e, n) {
  return function() {
    var r = n.apply(this, arguments);
    r == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, r);
  };
}
function Ky(e, n) {
  var r = Tu(e);
  if (arguments.length < 2) {
    var l = this.node();
    return r.local ? l.getAttributeNS(r.space, r.local) : l.getAttribute(r);
  }
  return this.each((n == null ? r.local ? Xy : Gy : typeof n == "function" ? r.local ? Iy : Fy : r.local ? Zy : $y)(r, n));
}
function P3(e) {
  return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
}
function Qy(e) {
  return function() {
    this.style.removeProperty(e);
  };
}
function Jy(e, n, r) {
  return function() {
    this.style.setProperty(e, n, r);
  };
}
function Wy(e, n, r) {
  return function() {
    var l = n.apply(this, arguments);
    l == null ? this.style.removeProperty(e) : this.style.setProperty(e, l, r);
  };
}
function Py(e, n, r) {
  return arguments.length > 1 ? this.each((n == null ? Qy : typeof n == "function" ? Wy : Jy)(e, n, r ?? "")) : Tl(this.node(), e);
}
function Tl(e, n) {
  return e.style.getPropertyValue(n) || P3(e).getComputedStyle(e, null).getPropertyValue(n);
}
function ev(e) {
  return function() {
    delete this[e];
  };
}
function tv(e, n) {
  return function() {
    this[e] = n;
  };
}
function nv(e, n) {
  return function() {
    var r = n.apply(this, arguments);
    r == null ? delete this[e] : this[e] = r;
  };
}
function av(e, n) {
  return arguments.length > 1 ? this.each((n == null ? ev : typeof n == "function" ? nv : tv)(e, n)) : this.node()[e];
}
function e6(e) {
  return e.trim().split(/^|\s+/);
}
function dh(e) {
  return e.classList || new t6(e);
}
function t6(e) {
  this._node = e, this._names = e6(e.getAttribute("class") || "");
}
t6.prototype = {
  add: function(e) {
    var n = this._names.indexOf(e);
    n < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
  },
  remove: function(e) {
    var n = this._names.indexOf(e);
    n >= 0 && (this._names.splice(n, 1), this._node.setAttribute("class", this._names.join(" ")));
  },
  contains: function(e) {
    return this._names.indexOf(e) >= 0;
  }
};
function n6(e, n) {
  for (var r = dh(e), l = -1, s = n.length; ++l < s; ) r.add(n[l]);
}
function a6(e, n) {
  for (var r = dh(e), l = -1, s = n.length; ++l < s; ) r.remove(n[l]);
}
function rv(e) {
  return function() {
    n6(this, e);
  };
}
function lv(e) {
  return function() {
    a6(this, e);
  };
}
function iv(e, n) {
  return function() {
    (n.apply(this, arguments) ? n6 : a6)(this, e);
  };
}
function sv(e, n) {
  var r = e6(e + "");
  if (arguments.length < 2) {
    for (var l = dh(this.node()), s = -1, u = r.length; ++s < u; ) if (!l.contains(r[s])) return !1;
    return !0;
  }
  return this.each((typeof n == "function" ? iv : n ? rv : lv)(r, n));
}
function ov() {
  this.textContent = "";
}
function uv(e) {
  return function() {
    this.textContent = e;
  };
}
function cv(e) {
  return function() {
    var n = e.apply(this, arguments);
    this.textContent = n ?? "";
  };
}
function fv(e) {
  return arguments.length ? this.each(e == null ? ov : (typeof e == "function" ? cv : uv)(e)) : this.node().textContent;
}
function hv() {
  this.innerHTML = "";
}
function dv(e) {
  return function() {
    this.innerHTML = e;
  };
}
function mv(e) {
  return function() {
    var n = e.apply(this, arguments);
    this.innerHTML = n ?? "";
  };
}
function pv(e) {
  return arguments.length ? this.each(e == null ? hv : (typeof e == "function" ? mv : dv)(e)) : this.node().innerHTML;
}
function gv() {
  this.nextSibling && this.parentNode.appendChild(this);
}
function yv() {
  return this.each(gv);
}
function vv() {
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function xv() {
  return this.each(vv);
}
function bv(e) {
  var n = typeof e == "function" ? e : I3(e);
  return this.select(function() {
    return this.appendChild(n.apply(this, arguments));
  });
}
function Sv() {
  return null;
}
function wv(e, n) {
  var r = typeof e == "function" ? e : I3(e), l = n == null ? Sv : typeof n == "function" ? n : hh(n);
  return this.select(function() {
    return this.insertBefore(r.apply(this, arguments), l.apply(this, arguments) || null);
  });
}
function Ev() {
  var e = this.parentNode;
  e && e.removeChild(this);
}
function Mv() {
  return this.each(Ev);
}
function Tv() {
  var e = this.cloneNode(!1), n = this.parentNode;
  return n ? n.insertBefore(e, this.nextSibling) : e;
}
function zv() {
  var e = this.cloneNode(!0), n = this.parentNode;
  return n ? n.insertBefore(e, this.nextSibling) : e;
}
function Av(e) {
  return this.select(e ? zv : Tv);
}
function Cv(e) {
  return arguments.length ? this.property("__data__", e) : this.node().__data__;
}
function Nv(e) {
  return function(n) {
    e.call(this, n, this.__data__);
  };
}
function kv(e) {
  return e.trim().split(/^|\s+/).map(function(n) {
    var r = "", l = n.indexOf(".");
    return l >= 0 && (r = n.slice(l + 1), n = n.slice(0, l)), { type: n, name: r };
  });
}
function Dv(e) {
  return function() {
    var n = this.__on;
    if (n) {
      for (var r = 0, l = -1, s = n.length, u; r < s; ++r)
        u = n[r], (!e.type || u.type === e.type) && u.name === e.name ? this.removeEventListener(u.type, u.listener, u.options) : n[++l] = u;
      ++l ? n.length = l : delete this.__on;
    }
  };
}
function _v(e, n, r) {
  return function() {
    var l = this.__on, s, u = Nv(n);
    if (l) {
      for (var c = 0, h = l.length; c < h; ++c)
        if ((s = l[c]).type === e.type && s.name === e.name) {
          this.removeEventListener(s.type, s.listener, s.options), this.addEventListener(s.type, s.listener = u, s.options = r), s.value = n;
          return;
        }
    }
    this.addEventListener(e.type, u, r), s = { type: e.type, name: e.name, value: n, listener: u, options: r }, l ? l.push(s) : this.__on = [s];
  };
}
function Rv(e, n, r) {
  var l = kv(e + ""), s, u = l.length, c;
  if (arguments.length < 2) {
    var h = this.node().__on;
    if (h) {
      for (var d = 0, p = h.length, g; d < p; ++d)
        for (s = 0, g = h[d]; s < u; ++s)
          if ((c = l[s]).type === g.type && c.name === g.name)
            return g.value;
    }
    return;
  }
  for (h = n ? _v : Dv, s = 0; s < u; ++s) this.each(h(l[s], n, r));
  return this;
}
function r6(e, n, r) {
  var l = P3(e), s = l.CustomEvent;
  typeof s == "function" ? s = new s(n, r) : (s = l.document.createEvent("Event"), r ? (s.initEvent(n, r.bubbles, r.cancelable), s.detail = r.detail) : s.initEvent(n, !1, !1)), e.dispatchEvent(s);
}
function Bv(e, n) {
  return function() {
    return r6(this, e, n);
  };
}
function Ov(e, n) {
  return function() {
    return r6(this, e, n.apply(this, arguments));
  };
}
function Hv(e, n) {
  return this.each((typeof n == "function" ? Ov : Bv)(e, n));
}
function* Lv() {
  for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
    for (var l = e[n], s = 0, u = l.length, c; s < u; ++s)
      (c = l[s]) && (yield c);
}
var l6 = [null];
function qn(e, n) {
  this._groups = e, this._parents = n;
}
function Qi() {
  return new qn([[document.documentElement]], l6);
}
function qv() {
  return this;
}
qn.prototype = Qi.prototype = {
  constructor: qn,
  select: cy,
  selectAll: my,
  selectChild: vy,
  selectChildren: wy,
  filter: Ey,
  data: Ny,
  enter: My,
  exit: Dy,
  join: _y,
  merge: Ry,
  selection: qv,
  order: By,
  sort: Oy,
  call: Ly,
  nodes: qy,
  node: Uy,
  size: jy,
  empty: Vy,
  each: Yy,
  attr: Ky,
  style: Py,
  property: av,
  classed: sv,
  text: fv,
  html: pv,
  raise: yv,
  lower: xv,
  append: bv,
  insert: wv,
  remove: Mv,
  clone: Av,
  datum: Cv,
  on: Rv,
  dispatch: Hv,
  [Symbol.iterator]: Lv
};
function Wn(e) {
  return typeof e == "string" ? new qn([[document.querySelector(e)]], [document.documentElement]) : new qn([[e]], l6);
}
function Uv(e) {
  let n;
  for (; n = e.sourceEvent; ) e = n;
  return e;
}
function ya(e, n) {
  if (e = Uv(e), n === void 0 && (n = e.currentTarget), n) {
    var r = n.ownerSVGElement || n;
    if (r.createSVGPoint) {
      var l = r.createSVGPoint();
      return l.x = e.clientX, l.y = e.clientY, l = l.matrixTransform(n.getScreenCTM().inverse()), [l.x, l.y];
    }
    if (n.getBoundingClientRect) {
      var s = n.getBoundingClientRect();
      return [e.clientX - s.left - n.clientLeft, e.clientY - s.top - n.clientTop];
    }
  }
  return [e.pageX, e.pageY];
}
const jv = { passive: !1 }, ji = { capture: !0, passive: !1 };
function u1(e) {
  e.stopImmediatePropagation();
}
function xl(e) {
  e.preventDefault(), e.stopImmediatePropagation();
}
function i6(e) {
  var n = e.document.documentElement, r = Wn(e).on("dragstart.drag", xl, ji);
  "onselectstart" in n ? r.on("selectstart.drag", xl, ji) : (n.__noselect = n.style.MozUserSelect, n.style.MozUserSelect = "none");
}
function s6(e, n) {
  var r = e.document.documentElement, l = Wn(e).on("dragstart.drag", null);
  n && (l.on("click.drag", xl, ji), setTimeout(function() {
    l.on("click.drag", null);
  }, 0)), "onselectstart" in r ? l.on("selectstart.drag", null) : (r.style.MozUserSelect = r.__noselect, delete r.__noselect);
}
const Do = (e) => () => e;
function L1(e, {
  sourceEvent: n,
  subject: r,
  target: l,
  identifier: s,
  active: u,
  x: c,
  y: h,
  dx: d,
  dy: p,
  dispatch: g
}) {
  Object.defineProperties(this, {
    type: { value: e, enumerable: !0, configurable: !0 },
    sourceEvent: { value: n, enumerable: !0, configurable: !0 },
    subject: { value: r, enumerable: !0, configurable: !0 },
    target: { value: l, enumerable: !0, configurable: !0 },
    identifier: { value: s, enumerable: !0, configurable: !0 },
    active: { value: u, enumerable: !0, configurable: !0 },
    x: { value: c, enumerable: !0, configurable: !0 },
    y: { value: h, enumerable: !0, configurable: !0 },
    dx: { value: d, enumerable: !0, configurable: !0 },
    dy: { value: p, enumerable: !0, configurable: !0 },
    _: { value: g }
  });
}
L1.prototype.on = function() {
  var e = this._.on.apply(this._, arguments);
  return e === this._ ? this : e;
};
function Vv(e) {
  return !e.ctrlKey && !e.button;
}
function Yv() {
  return this.parentNode;
}
function Gv(e, n) {
  return n ?? { x: e.x, y: e.y };
}
function Xv() {
  return navigator.maxTouchPoints || "ontouchstart" in this;
}
function o6() {
  var e = Vv, n = Yv, r = Gv, l = Xv, s = {}, u = Mu("start", "drag", "end"), c = 0, h, d, p, g, y = 0;
  function x(H) {
    H.on("mousedown.drag", w).filter(l).on("touchstart.drag", A).on("touchmove.drag", T, jv).on("touchend.drag touchcancel.drag", R).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
  }
  function w(H, $) {
    if (!(g || !e.call(this, H, $))) {
      var V = q(this, n.call(this, H, $), H, $, "mouse");
      V && (Wn(H.view).on("mousemove.drag", z, ji).on("mouseup.drag", M, ji), i6(H.view), u1(H), p = !1, h = H.clientX, d = H.clientY, V("start", H));
    }
  }
  function z(H) {
    if (xl(H), !p) {
      var $ = H.clientX - h, V = H.clientY - d;
      p = $ * $ + V * V > y;
    }
    s.mouse("drag", H);
  }
  function M(H) {
    Wn(H.view).on("mousemove.drag mouseup.drag", null), s6(H.view, p), xl(H), s.mouse("end", H);
  }
  function A(H, $) {
    if (e.call(this, H, $)) {
      var V = H.changedTouches, Q = n.call(this, H, $), re = V.length, te, ie;
      for (te = 0; te < re; ++te)
        (ie = q(this, Q, H, $, V[te].identifier, V[te])) && (u1(H), ie("start", H, V[te]));
    }
  }
  function T(H) {
    var $ = H.changedTouches, V = $.length, Q, re;
    for (Q = 0; Q < V; ++Q)
      (re = s[$[Q].identifier]) && (xl(H), re("drag", H, $[Q]));
  }
  function R(H) {
    var $ = H.changedTouches, V = $.length, Q, re;
    for (g && clearTimeout(g), g = setTimeout(function() {
      g = null;
    }, 500), Q = 0; Q < V; ++Q)
      (re = s[$[Q].identifier]) && (u1(H), re("end", H, $[Q]));
  }
  function q(H, $, V, Q, re, te) {
    var ie = u.copy(), ue = ya(te || V, $), de, ge, _;
    if ((_ = r.call(H, new L1("beforestart", {
      sourceEvent: V,
      target: x,
      identifier: re,
      active: c,
      x: ue[0],
      y: ue[1],
      dx: 0,
      dy: 0,
      dispatch: ie
    }), Q)) != null)
      return de = _.x - ue[0] || 0, ge = _.y - ue[1] || 0, function J(D, Y, I) {
        var F = ue, le;
        switch (D) {
          case "start":
            s[re] = J, le = c++;
            break;
          case "end":
            delete s[re], --c;
          // falls through
          case "drag":
            ue = ya(I || Y, $), le = c;
            break;
        }
        ie.call(
          D,
          H,
          new L1(D, {
            sourceEvent: Y,
            subject: _,
            target: x,
            identifier: re,
            active: le,
            x: ue[0] + de,
            y: ue[1] + ge,
            dx: ue[0] - F[0],
            dy: ue[1] - F[1],
            dispatch: ie
          }),
          Q
        );
      };
  }
  return x.filter = function(H) {
    return arguments.length ? (e = typeof H == "function" ? H : Do(!!H), x) : e;
  }, x.container = function(H) {
    return arguments.length ? (n = typeof H == "function" ? H : Do(H), x) : n;
  }, x.subject = function(H) {
    return arguments.length ? (r = typeof H == "function" ? H : Do(H), x) : r;
  }, x.touchable = function(H) {
    return arguments.length ? (l = typeof H == "function" ? H : Do(!!H), x) : l;
  }, x.on = function() {
    var H = u.on.apply(u, arguments);
    return H === u ? x : H;
  }, x.clickDistance = function(H) {
    return arguments.length ? (y = (H = +H) * H, x) : Math.sqrt(y);
  }, x;
}
function mh(e, n, r) {
  e.prototype = n.prototype = r, r.constructor = e;
}
function u6(e, n) {
  var r = Object.create(e.prototype);
  for (var l in n) r[l] = n[l];
  return r;
}
function Ji() {
}
var Vi = 0.7, ru = 1 / Vi, bl = "\\s*([+-]?\\d+)\\s*", Yi = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Sa = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", $v = /^#([0-9a-f]{3,8})$/, Zv = new RegExp(`^rgb\\(${bl},${bl},${bl}\\)$`), Fv = new RegExp(`^rgb\\(${Sa},${Sa},${Sa}\\)$`), Iv = new RegExp(`^rgba\\(${bl},${bl},${bl},${Yi}\\)$`), Kv = new RegExp(`^rgba\\(${Sa},${Sa},${Sa},${Yi}\\)$`), Qv = new RegExp(`^hsl\\(${Yi},${Sa},${Sa}\\)$`), Jv = new RegExp(`^hsla\\(${Yi},${Sa},${Sa},${Yi}\\)$`), l5 = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
mh(Ji, Gi, {
  copy(e) {
    return Object.assign(new this.constructor(), this, e);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: i5,
  // Deprecated! Use color.formatHex.
  formatHex: i5,
  formatHex8: Wv,
  formatHsl: Pv,
  formatRgb: s5,
  toString: s5
});
function i5() {
  return this.rgb().formatHex();
}
function Wv() {
  return this.rgb().formatHex8();
}
function Pv() {
  return c6(this).formatHsl();
}
function s5() {
  return this.rgb().formatRgb();
}
function Gi(e) {
  var n, r;
  return e = (e + "").trim().toLowerCase(), (n = $v.exec(e)) ? (r = n[1].length, n = parseInt(n[1], 16), r === 6 ? o5(n) : r === 3 ? new En(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : r === 8 ? _o(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : r === 4 ? _o(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = Zv.exec(e)) ? new En(n[1], n[2], n[3], 1) : (n = Fv.exec(e)) ? new En(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = Iv.exec(e)) ? _o(n[1], n[2], n[3], n[4]) : (n = Kv.exec(e)) ? _o(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = Qv.exec(e)) ? f5(n[1], n[2] / 100, n[3] / 100, 1) : (n = Jv.exec(e)) ? f5(n[1], n[2] / 100, n[3] / 100, n[4]) : l5.hasOwnProperty(e) ? o5(l5[e]) : e === "transparent" ? new En(NaN, NaN, NaN, 0) : null;
}
function o5(e) {
  return new En(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
}
function _o(e, n, r, l) {
  return l <= 0 && (e = n = r = NaN), new En(e, n, r, l);
}
function e9(e) {
  return e instanceof Ji || (e = Gi(e)), e ? (e = e.rgb(), new En(e.r, e.g, e.b, e.opacity)) : new En();
}
function q1(e, n, r, l) {
  return arguments.length === 1 ? e9(e) : new En(e, n, r, l ?? 1);
}
function En(e, n, r, l) {
  this.r = +e, this.g = +n, this.b = +r, this.opacity = +l;
}
mh(En, q1, u6(Ji, {
  brighter(e) {
    return e = e == null ? ru : Math.pow(ru, e), new En(this.r * e, this.g * e, this.b * e, this.opacity);
  },
  darker(e) {
    return e = e == null ? Vi : Math.pow(Vi, e), new En(this.r * e, this.g * e, this.b * e, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new En(zr(this.r), zr(this.g), zr(this.b), lu(this.opacity));
  },
  displayable() {
    return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  },
  hex: u5,
  // Deprecated! Use color.formatHex.
  formatHex: u5,
  formatHex8: t9,
  formatRgb: c5,
  toString: c5
}));
function u5() {
  return `#${Er(this.r)}${Er(this.g)}${Er(this.b)}`;
}
function t9() {
  return `#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function c5() {
  const e = lu(this.opacity);
  return `${e === 1 ? "rgb(" : "rgba("}${zr(this.r)}, ${zr(this.g)}, ${zr(this.b)}${e === 1 ? ")" : `, ${e})`}`;
}
function lu(e) {
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
}
function zr(e) {
  return Math.max(0, Math.min(255, Math.round(e) || 0));
}
function Er(e) {
  return e = zr(e), (e < 16 ? "0" : "") + e.toString(16);
}
function f5(e, n, r, l) {
  return l <= 0 ? e = n = r = NaN : r <= 0 || r >= 1 ? e = n = NaN : n <= 0 && (e = NaN), new sa(e, n, r, l);
}
function c6(e) {
  if (e instanceof sa) return new sa(e.h, e.s, e.l, e.opacity);
  if (e instanceof Ji || (e = Gi(e)), !e) return new sa();
  if (e instanceof sa) return e;
  e = e.rgb();
  var n = e.r / 255, r = e.g / 255, l = e.b / 255, s = Math.min(n, r, l), u = Math.max(n, r, l), c = NaN, h = u - s, d = (u + s) / 2;
  return h ? (n === u ? c = (r - l) / h + (r < l) * 6 : r === u ? c = (l - n) / h + 2 : c = (n - r) / h + 4, h /= d < 0.5 ? u + s : 2 - u - s, c *= 60) : h = d > 0 && d < 1 ? 0 : c, new sa(c, h, d, e.opacity);
}
function n9(e, n, r, l) {
  return arguments.length === 1 ? c6(e) : new sa(e, n, r, l ?? 1);
}
function sa(e, n, r, l) {
  this.h = +e, this.s = +n, this.l = +r, this.opacity = +l;
}
mh(sa, n9, u6(Ji, {
  brighter(e) {
    return e = e == null ? ru : Math.pow(ru, e), new sa(this.h, this.s, this.l * e, this.opacity);
  },
  darker(e) {
    return e = e == null ? Vi : Math.pow(Vi, e), new sa(this.h, this.s, this.l * e, this.opacity);
  },
  rgb() {
    var e = this.h % 360 + (this.h < 0) * 360, n = isNaN(e) || isNaN(this.s) ? 0 : this.s, r = this.l, l = r + (r < 0.5 ? r : 1 - r) * n, s = 2 * r - l;
    return new En(
      c1(e >= 240 ? e - 240 : e + 120, s, l),
      c1(e, s, l),
      c1(e < 120 ? e + 240 : e - 120, s, l),
      this.opacity
    );
  },
  clamp() {
    return new sa(h5(this.h), Ro(this.s), Ro(this.l), lu(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  },
  formatHsl() {
    const e = lu(this.opacity);
    return `${e === 1 ? "hsl(" : "hsla("}${h5(this.h)}, ${Ro(this.s) * 100}%, ${Ro(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
  }
}));
function h5(e) {
  return e = (e || 0) % 360, e < 0 ? e + 360 : e;
}
function Ro(e) {
  return Math.max(0, Math.min(1, e || 0));
}
function c1(e, n, r) {
  return (e < 60 ? n + (r - n) * e / 60 : e < 180 ? r : e < 240 ? n + (r - n) * (240 - e) / 60 : n) * 255;
}
const f6 = (e) => () => e;
function a9(e, n) {
  return function(r) {
    return e + r * n;
  };
}
function r9(e, n, r) {
  return e = Math.pow(e, r), n = Math.pow(n, r) - e, r = 1 / r, function(l) {
    return Math.pow(e + l * n, r);
  };
}
function l9(e) {
  return (e = +e) == 1 ? h6 : function(n, r) {
    return r - n ? r9(n, r, e) : f6(isNaN(n) ? r : n);
  };
}
function h6(e, n) {
  var r = n - e;
  return r ? a9(e, r) : f6(isNaN(e) ? n : e);
}
const d5 = (function e(n) {
  var r = l9(n);
  function l(s, u) {
    var c = r((s = q1(s)).r, (u = q1(u)).r), h = r(s.g, u.g), d = r(s.b, u.b), p = h6(s.opacity, u.opacity);
    return function(g) {
      return s.r = c(g), s.g = h(g), s.b = d(g), s.opacity = p(g), s + "";
    };
  }
  return l.gamma = e, l;
})(1);
function U0(e, n) {
  return e = +e, n = +n, function(r) {
    return e * (1 - r) + n * r;
  };
}
var U1 = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, f1 = new RegExp(U1.source, "g");
function i9(e) {
  return function() {
    return e;
  };
}
function s9(e) {
  return function(n) {
    return e(n) + "";
  };
}
function o9(e, n) {
  var r = U1.lastIndex = f1.lastIndex = 0, l, s, u, c = -1, h = [], d = [];
  for (e = e + "", n = n + ""; (l = U1.exec(e)) && (s = f1.exec(n)); )
    (u = s.index) > r && (u = n.slice(r, u), h[c] ? h[c] += u : h[++c] = u), (l = l[0]) === (s = s[0]) ? h[c] ? h[c] += s : h[++c] = s : (h[++c] = null, d.push({ i: c, x: U0(l, s) })), r = f1.lastIndex;
  return r < n.length && (u = n.slice(r), h[c] ? h[c] += u : h[++c] = u), h.length < 2 ? d[0] ? s9(d[0].x) : i9(n) : (n = d.length, function(p) {
    for (var g = 0, y; g < n; ++g) h[(y = d[g]).i] = y.x(p);
    return h.join("");
  });
}
var m5 = 180 / Math.PI, j1 = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function d6(e, n, r, l, s, u) {
  var c, h, d;
  return (c = Math.sqrt(e * e + n * n)) && (e /= c, n /= c), (d = e * r + n * l) && (r -= e * d, l -= n * d), (h = Math.sqrt(r * r + l * l)) && (r /= h, l /= h, d /= h), e * l < n * r && (e = -e, n = -n, d = -d, c = -c), {
    translateX: s,
    translateY: u,
    rotate: Math.atan2(n, e) * m5,
    skewX: Math.atan(d) * m5,
    scaleX: c,
    scaleY: h
  };
}
var Bo;
function u9(e) {
  const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + "");
  return n.isIdentity ? j1 : d6(n.a, n.b, n.c, n.d, n.e, n.f);
}
function c9(e) {
  return e == null || (Bo || (Bo = document.createElementNS("http://www.w3.org/2000/svg", "g")), Bo.setAttribute("transform", e), !(e = Bo.transform.baseVal.consolidate())) ? j1 : (e = e.matrix, d6(e.a, e.b, e.c, e.d, e.e, e.f));
}
function m6(e, n, r, l) {
  function s(p) {
    return p.length ? p.pop() + " " : "";
  }
  function u(p, g, y, x, w, z) {
    if (p !== y || g !== x) {
      var M = w.push("translate(", null, n, null, r);
      z.push({ i: M - 4, x: U0(p, y) }, { i: M - 2, x: U0(g, x) });
    } else (y || x) && w.push("translate(" + y + n + x + r);
  }
  function c(p, g, y, x) {
    p !== g ? (p - g > 180 ? g += 360 : g - p > 180 && (p += 360), x.push({ i: y.push(s(y) + "rotate(", null, l) - 2, x: U0(p, g) })) : g && y.push(s(y) + "rotate(" + g + l);
  }
  function h(p, g, y, x) {
    p !== g ? x.push({ i: y.push(s(y) + "skewX(", null, l) - 2, x: U0(p, g) }) : g && y.push(s(y) + "skewX(" + g + l);
  }
  function d(p, g, y, x, w, z) {
    if (p !== y || g !== x) {
      var M = w.push(s(w) + "scale(", null, ",", null, ")");
      z.push({ i: M - 4, x: U0(p, y) }, { i: M - 2, x: U0(g, x) });
    } else (y !== 1 || x !== 1) && w.push(s(w) + "scale(" + y + "," + x + ")");
  }
  return function(p, g) {
    var y = [], x = [];
    return p = e(p), g = e(g), u(p.translateX, p.translateY, g.translateX, g.translateY, y, x), c(p.rotate, g.rotate, y, x), h(p.skewX, g.skewX, y, x), d(p.scaleX, p.scaleY, g.scaleX, g.scaleY, y, x), p = g = null, function(w) {
      for (var z = -1, M = x.length, A; ++z < M; ) y[(A = x[z]).i] = A.x(w);
      return y.join("");
    };
  };
}
var f9 = m6(u9, "px, ", "px)", "deg)"), h9 = m6(c9, ", ", ")", ")"), d9 = 1e-12;
function p5(e) {
  return ((e = Math.exp(e)) + 1 / e) / 2;
}
function m9(e) {
  return ((e = Math.exp(e)) - 1 / e) / 2;
}
function p9(e) {
  return ((e = Math.exp(2 * e)) - 1) / (e + 1);
}
const g9 = (function e(n, r, l) {
  function s(u, c) {
    var h = u[0], d = u[1], p = u[2], g = c[0], y = c[1], x = c[2], w = g - h, z = y - d, M = w * w + z * z, A, T;
    if (M < d9)
      T = Math.log(x / p) / n, A = function(Q) {
        return [
          h + Q * w,
          d + Q * z,
          p * Math.exp(n * Q * T)
        ];
      };
    else {
      var R = Math.sqrt(M), q = (x * x - p * p + l * M) / (2 * p * r * R), H = (x * x - p * p - l * M) / (2 * x * r * R), $ = Math.log(Math.sqrt(q * q + 1) - q), V = Math.log(Math.sqrt(H * H + 1) - H);
      T = (V - $) / n, A = function(Q) {
        var re = Q * T, te = p5($), ie = p / (r * R) * (te * p9(n * re + $) - m9($));
        return [
          h + ie * w,
          d + ie * z,
          p * te / p5(n * re + $)
        ];
      };
    }
    return A.duration = T * 1e3 * n / Math.SQRT2, A;
  }
  return s.rho = function(u) {
    var c = Math.max(1e-3, +u), h = c * c, d = h * h;
    return e(c, h, d);
  }, s;
})(Math.SQRT2, 2, 4);
var zl = 0, Bi = 0, Ni = 0, p6 = 1e3, iu, Oi, su = 0, Ar = 0, zu = 0, Xi = typeof performance == "object" && performance.now ? performance : Date, g6 = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
  setTimeout(e, 17);
};
function ph() {
  return Ar || (g6(y9), Ar = Xi.now() + zu);
}
function y9() {
  Ar = 0;
}
function ou() {
  this._call = this._time = this._next = null;
}
ou.prototype = y6.prototype = {
  constructor: ou,
  restart: function(e, n, r) {
    if (typeof e != "function") throw new TypeError("callback is not a function");
    r = (r == null ? ph() : +r) + (n == null ? 0 : +n), !this._next && Oi !== this && (Oi ? Oi._next = this : iu = this, Oi = this), this._call = e, this._time = r, V1();
  },
  stop: function() {
    this._call && (this._call = null, this._time = 1 / 0, V1());
  }
};
function y6(e, n, r) {
  var l = new ou();
  return l.restart(e, n, r), l;
}
function v9() {
  ph(), ++zl;
  for (var e = iu, n; e; )
    (n = Ar - e._time) >= 0 && e._call.call(void 0, n), e = e._next;
  --zl;
}
function g5() {
  Ar = (su = Xi.now()) + zu, zl = Bi = 0;
  try {
    v9();
  } finally {
    zl = 0, b9(), Ar = 0;
  }
}
function x9() {
  var e = Xi.now(), n = e - su;
  n > p6 && (zu -= n, su = e);
}
function b9() {
  for (var e, n = iu, r, l = 1 / 0; n; )
    n._call ? (l > n._time && (l = n._time), e = n, n = n._next) : (r = n._next, n._next = null, n = e ? e._next = r : iu = r);
  Oi = e, V1(l);
}
function V1(e) {
  if (!zl) {
    Bi && (Bi = clearTimeout(Bi));
    var n = e - Ar;
    n > 24 ? (e < 1 / 0 && (Bi = setTimeout(g5, e - Xi.now() - zu)), Ni && (Ni = clearInterval(Ni))) : (Ni || (su = Xi.now(), Ni = setInterval(x9, p6)), zl = 1, g6(g5));
  }
}
function y5(e, n, r) {
  var l = new ou();
  return n = n == null ? 0 : +n, l.restart((s) => {
    l.stop(), e(s + n);
  }, n, r), l;
}
var S9 = Mu("start", "end", "cancel", "interrupt"), w9 = [], v6 = 0, v5 = 1, Y1 = 2, Wo = 3, x5 = 4, G1 = 5, Po = 6;
function Au(e, n, r, l, s, u) {
  var c = e.__transition;
  if (!c) e.__transition = {};
  else if (r in c) return;
  E9(e, r, {
    name: n,
    index: l,
    // For context during callback.
    group: s,
    // For context during callback.
    on: S9,
    tween: w9,
    time: u.time,
    delay: u.delay,
    duration: u.duration,
    ease: u.ease,
    timer: null,
    state: v6
  });
}
function gh(e, n) {
  var r = ca(e, n);
  if (r.state > v6) throw new Error("too late; already scheduled");
  return r;
}
function Ma(e, n) {
  var r = ca(e, n);
  if (r.state > Wo) throw new Error("too late; already running");
  return r;
}
function ca(e, n) {
  var r = e.__transition;
  if (!r || !(r = r[n])) throw new Error("transition not found");
  return r;
}
function E9(e, n, r) {
  var l = e.__transition, s;
  l[n] = r, r.timer = y6(u, 0, r.time);
  function u(p) {
    r.state = v5, r.timer.restart(c, r.delay, r.time), r.delay <= p && c(p - r.delay);
  }
  function c(p) {
    var g, y, x, w;
    if (r.state !== v5) return d();
    for (g in l)
      if (w = l[g], w.name === r.name) {
        if (w.state === Wo) return y5(c);
        w.state === x5 ? (w.state = Po, w.timer.stop(), w.on.call("interrupt", e, e.__data__, w.index, w.group), delete l[g]) : +g < n && (w.state = Po, w.timer.stop(), w.on.call("cancel", e, e.__data__, w.index, w.group), delete l[g]);
      }
    if (y5(function() {
      r.state === Wo && (r.state = x5, r.timer.restart(h, r.delay, r.time), h(p));
    }), r.state = Y1, r.on.call("start", e, e.__data__, r.index, r.group), r.state === Y1) {
      for (r.state = Wo, s = new Array(x = r.tween.length), g = 0, y = -1; g < x; ++g)
        (w = r.tween[g].value.call(e, e.__data__, r.index, r.group)) && (s[++y] = w);
      s.length = y + 1;
    }
  }
  function h(p) {
    for (var g = p < r.duration ? r.ease.call(null, p / r.duration) : (r.timer.restart(d), r.state = G1, 1), y = -1, x = s.length; ++y < x; )
      s[y].call(e, g);
    r.state === G1 && (r.on.call("end", e, e.__data__, r.index, r.group), d());
  }
  function d() {
    r.state = Po, r.timer.stop(), delete l[n];
    for (var p in l) return;
    delete e.__transition;
  }
}
function eu(e, n) {
  var r = e.__transition, l, s, u = !0, c;
  if (r) {
    n = n == null ? null : n + "";
    for (c in r) {
      if ((l = r[c]).name !== n) {
        u = !1;
        continue;
      }
      s = l.state > Y1 && l.state < G1, l.state = Po, l.timer.stop(), l.on.call(s ? "interrupt" : "cancel", e, e.__data__, l.index, l.group), delete r[c];
    }
    u && delete e.__transition;
  }
}
function M9(e) {
  return this.each(function() {
    eu(this, e);
  });
}
function T9(e, n) {
  var r, l;
  return function() {
    var s = Ma(this, e), u = s.tween;
    if (u !== r) {
      l = r = u;
      for (var c = 0, h = l.length; c < h; ++c)
        if (l[c].name === n) {
          l = l.slice(), l.splice(c, 1);
          break;
        }
    }
    s.tween = l;
  };
}
function z9(e, n, r) {
  var l, s;
  if (typeof r != "function") throw new Error();
  return function() {
    var u = Ma(this, e), c = u.tween;
    if (c !== l) {
      s = (l = c).slice();
      for (var h = { name: n, value: r }, d = 0, p = s.length; d < p; ++d)
        if (s[d].name === n) {
          s[d] = h;
          break;
        }
      d === p && s.push(h);
    }
    u.tween = s;
  };
}
function A9(e, n) {
  var r = this._id;
  if (e += "", arguments.length < 2) {
    for (var l = ca(this.node(), r).tween, s = 0, u = l.length, c; s < u; ++s)
      if ((c = l[s]).name === e)
        return c.value;
    return null;
  }
  return this.each((n == null ? T9 : z9)(r, e, n));
}
function yh(e, n, r) {
  var l = e._id;
  return e.each(function() {
    var s = Ma(this, l);
    (s.value || (s.value = {}))[n] = r.apply(this, arguments);
  }), function(s) {
    return ca(s, l).value[n];
  };
}
function x6(e, n) {
  var r;
  return (typeof n == "number" ? U0 : n instanceof Gi ? d5 : (r = Gi(n)) ? (n = r, d5) : o9)(e, n);
}
function C9(e) {
  return function() {
    this.removeAttribute(e);
  };
}
function N9(e) {
  return function() {
    this.removeAttributeNS(e.space, e.local);
  };
}
function k9(e, n, r) {
  var l, s = r + "", u;
  return function() {
    var c = this.getAttribute(e);
    return c === s ? null : c === l ? u : u = n(l = c, r);
  };
}
function D9(e, n, r) {
  var l, s = r + "", u;
  return function() {
    var c = this.getAttributeNS(e.space, e.local);
    return c === s ? null : c === l ? u : u = n(l = c, r);
  };
}
function _9(e, n, r) {
  var l, s, u;
  return function() {
    var c, h = r(this), d;
    return h == null ? void this.removeAttribute(e) : (c = this.getAttribute(e), d = h + "", c === d ? null : c === l && d === s ? u : (s = d, u = n(l = c, h)));
  };
}
function R9(e, n, r) {
  var l, s, u;
  return function() {
    var c, h = r(this), d;
    return h == null ? void this.removeAttributeNS(e.space, e.local) : (c = this.getAttributeNS(e.space, e.local), d = h + "", c === d ? null : c === l && d === s ? u : (s = d, u = n(l = c, h)));
  };
}
function B9(e, n) {
  var r = Tu(e), l = r === "transform" ? h9 : x6;
  return this.attrTween(e, typeof n == "function" ? (r.local ? R9 : _9)(r, l, yh(this, "attr." + e, n)) : n == null ? (r.local ? N9 : C9)(r) : (r.local ? D9 : k9)(r, l, n));
}
function O9(e, n) {
  return function(r) {
    this.setAttribute(e, n.call(this, r));
  };
}
function H9(e, n) {
  return function(r) {
    this.setAttributeNS(e.space, e.local, n.call(this, r));
  };
}
function L9(e, n) {
  var r, l;
  function s() {
    var u = n.apply(this, arguments);
    return u !== l && (r = (l = u) && H9(e, u)), r;
  }
  return s._value = n, s;
}
function q9(e, n) {
  var r, l;
  function s() {
    var u = n.apply(this, arguments);
    return u !== l && (r = (l = u) && O9(e, u)), r;
  }
  return s._value = n, s;
}
function U9(e, n) {
  var r = "attr." + e;
  if (arguments.length < 2) return (r = this.tween(r)) && r._value;
  if (n == null) return this.tween(r, null);
  if (typeof n != "function") throw new Error();
  var l = Tu(e);
  return this.tween(r, (l.local ? L9 : q9)(l, n));
}
function j9(e, n) {
  return function() {
    gh(this, e).delay = +n.apply(this, arguments);
  };
}
function V9(e, n) {
  return n = +n, function() {
    gh(this, e).delay = n;
  };
}
function Y9(e) {
  var n = this._id;
  return arguments.length ? this.each((typeof e == "function" ? j9 : V9)(n, e)) : ca(this.node(), n).delay;
}
function G9(e, n) {
  return function() {
    Ma(this, e).duration = +n.apply(this, arguments);
  };
}
function X9(e, n) {
  return n = +n, function() {
    Ma(this, e).duration = n;
  };
}
function $9(e) {
  var n = this._id;
  return arguments.length ? this.each((typeof e == "function" ? G9 : X9)(n, e)) : ca(this.node(), n).duration;
}
function Z9(e, n) {
  if (typeof n != "function") throw new Error();
  return function() {
    Ma(this, e).ease = n;
  };
}
function F9(e) {
  var n = this._id;
  return arguments.length ? this.each(Z9(n, e)) : ca(this.node(), n).ease;
}
function I9(e, n) {
  return function() {
    var r = n.apply(this, arguments);
    if (typeof r != "function") throw new Error();
    Ma(this, e).ease = r;
  };
}
function K9(e) {
  if (typeof e != "function") throw new Error();
  return this.each(I9(this._id, e));
}
function Q9(e) {
  typeof e != "function" && (e = Q3(e));
  for (var n = this._groups, r = n.length, l = new Array(r), s = 0; s < r; ++s)
    for (var u = n[s], c = u.length, h = l[s] = [], d, p = 0; p < c; ++p)
      (d = u[p]) && e.call(d, d.__data__, p, u) && h.push(d);
  return new n0(l, this._parents, this._name, this._id);
}
function J9(e) {
  if (e._id !== this._id) throw new Error();
  for (var n = this._groups, r = e._groups, l = n.length, s = r.length, u = Math.min(l, s), c = new Array(l), h = 0; h < u; ++h)
    for (var d = n[h], p = r[h], g = d.length, y = c[h] = new Array(g), x, w = 0; w < g; ++w)
      (x = d[w] || p[w]) && (y[w] = x);
  for (; h < l; ++h)
    c[h] = n[h];
  return new n0(c, this._parents, this._name, this._id);
}
function W9(e) {
  return (e + "").trim().split(/^|\s+/).every(function(n) {
    var r = n.indexOf(".");
    return r >= 0 && (n = n.slice(0, r)), !n || n === "start";
  });
}
function P9(e, n, r) {
  var l, s, u = W9(n) ? gh : Ma;
  return function() {
    var c = u(this, e), h = c.on;
    h !== l && (s = (l = h).copy()).on(n, r), c.on = s;
  };
}
function ex(e, n) {
  var r = this._id;
  return arguments.length < 2 ? ca(this.node(), r).on.on(e) : this.each(P9(r, e, n));
}
function tx(e) {
  return function() {
    var n = this.parentNode;
    for (var r in this.__transition) if (+r !== e) return;
    n && n.removeChild(this);
  };
}
function nx() {
  return this.on("end.remove", tx(this._id));
}
function ax(e) {
  var n = this._name, r = this._id;
  typeof e != "function" && (e = hh(e));
  for (var l = this._groups, s = l.length, u = new Array(s), c = 0; c < s; ++c)
    for (var h = l[c], d = h.length, p = u[c] = new Array(d), g, y, x = 0; x < d; ++x)
      (g = h[x]) && (y = e.call(g, g.__data__, x, h)) && ("__data__" in g && (y.__data__ = g.__data__), p[x] = y, Au(p[x], n, r, x, p, ca(g, r)));
  return new n0(u, this._parents, n, r);
}
function rx(e) {
  var n = this._name, r = this._id;
  typeof e != "function" && (e = K3(e));
  for (var l = this._groups, s = l.length, u = [], c = [], h = 0; h < s; ++h)
    for (var d = l[h], p = d.length, g, y = 0; y < p; ++y)
      if (g = d[y]) {
        for (var x = e.call(g, g.__data__, y, d), w, z = ca(g, r), M = 0, A = x.length; M < A; ++M)
          (w = x[M]) && Au(w, n, r, M, x, z);
        u.push(x), c.push(g);
      }
  return new n0(u, c, n, r);
}
var lx = Qi.prototype.constructor;
function ix() {
  return new lx(this._groups, this._parents);
}
function sx(e, n) {
  var r, l, s;
  return function() {
    var u = Tl(this, e), c = (this.style.removeProperty(e), Tl(this, e));
    return u === c ? null : u === r && c === l ? s : s = n(r = u, l = c);
  };
}
function b6(e) {
  return function() {
    this.style.removeProperty(e);
  };
}
function ox(e, n, r) {
  var l, s = r + "", u;
  return function() {
    var c = Tl(this, e);
    return c === s ? null : c === l ? u : u = n(l = c, r);
  };
}
function ux(e, n, r) {
  var l, s, u;
  return function() {
    var c = Tl(this, e), h = r(this), d = h + "";
    return h == null && (d = h = (this.style.removeProperty(e), Tl(this, e))), c === d ? null : c === l && d === s ? u : (s = d, u = n(l = c, h));
  };
}
function cx(e, n) {
  var r, l, s, u = "style." + n, c = "end." + u, h;
  return function() {
    var d = Ma(this, e), p = d.on, g = d.value[u] == null ? h || (h = b6(n)) : void 0;
    (p !== r || s !== g) && (l = (r = p).copy()).on(c, s = g), d.on = l;
  };
}
function fx(e, n, r) {
  var l = (e += "") == "transform" ? f9 : x6;
  return n == null ? this.styleTween(e, sx(e, l)).on("end.style." + e, b6(e)) : typeof n == "function" ? this.styleTween(e, ux(e, l, yh(this, "style." + e, n))).each(cx(this._id, e)) : this.styleTween(e, ox(e, l, n), r).on("end.style." + e, null);
}
function hx(e, n, r) {
  return function(l) {
    this.style.setProperty(e, n.call(this, l), r);
  };
}
function dx(e, n, r) {
  var l, s;
  function u() {
    var c = n.apply(this, arguments);
    return c !== s && (l = (s = c) && hx(e, c, r)), l;
  }
  return u._value = n, u;
}
function mx(e, n, r) {
  var l = "style." + (e += "");
  if (arguments.length < 2) return (l = this.tween(l)) && l._value;
  if (n == null) return this.tween(l, null);
  if (typeof n != "function") throw new Error();
  return this.tween(l, dx(e, n, r ?? ""));
}
function px(e) {
  return function() {
    this.textContent = e;
  };
}
function gx(e) {
  return function() {
    var n = e(this);
    this.textContent = n ?? "";
  };
}
function yx(e) {
  return this.tween("text", typeof e == "function" ? gx(yh(this, "text", e)) : px(e == null ? "" : e + ""));
}
function vx(e) {
  return function(n) {
    this.textContent = e.call(this, n);
  };
}
function xx(e) {
  var n, r;
  function l() {
    var s = e.apply(this, arguments);
    return s !== r && (n = (r = s) && vx(s)), n;
  }
  return l._value = e, l;
}
function bx(e) {
  var n = "text";
  if (arguments.length < 1) return (n = this.tween(n)) && n._value;
  if (e == null) return this.tween(n, null);
  if (typeof e != "function") throw new Error();
  return this.tween(n, xx(e));
}
function Sx() {
  for (var e = this._name, n = this._id, r = S6(), l = this._groups, s = l.length, u = 0; u < s; ++u)
    for (var c = l[u], h = c.length, d, p = 0; p < h; ++p)
      if (d = c[p]) {
        var g = ca(d, n);
        Au(d, e, r, p, c, {
          time: g.time + g.delay + g.duration,
          delay: 0,
          duration: g.duration,
          ease: g.ease
        });
      }
  return new n0(l, this._parents, e, r);
}
function wx() {
  var e, n, r = this, l = r._id, s = r.size();
  return new Promise(function(u, c) {
    var h = { value: c }, d = { value: function() {
      --s === 0 && u();
    } };
    r.each(function() {
      var p = Ma(this, l), g = p.on;
      g !== e && (n = (e = g).copy(), n._.cancel.push(h), n._.interrupt.push(h), n._.end.push(d)), p.on = n;
    }), s === 0 && u();
  });
}
var Ex = 0;
function n0(e, n, r, l) {
  this._groups = e, this._parents = n, this._name = r, this._id = l;
}
function S6() {
  return ++Ex;
}
var Qa = Qi.prototype;
n0.prototype = {
  constructor: n0,
  select: ax,
  selectAll: rx,
  selectChild: Qa.selectChild,
  selectChildren: Qa.selectChildren,
  filter: Q9,
  merge: J9,
  selection: ix,
  transition: Sx,
  call: Qa.call,
  nodes: Qa.nodes,
  node: Qa.node,
  size: Qa.size,
  empty: Qa.empty,
  each: Qa.each,
  on: ex,
  attr: B9,
  attrTween: U9,
  style: fx,
  styleTween: mx,
  text: yx,
  textTween: bx,
  remove: nx,
  tween: A9,
  delay: Y9,
  duration: $9,
  ease: F9,
  easeVarying: K9,
  end: wx,
  [Symbol.iterator]: Qa[Symbol.iterator]
};
function Mx(e) {
  return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
}
var Tx = {
  time: null,
  // Set on use.
  delay: 0,
  duration: 250,
  ease: Mx
};
function zx(e, n) {
  for (var r; !(r = e.__transition) || !(r = r[n]); )
    if (!(e = e.parentNode))
      throw new Error(`transition ${n} not found`);
  return r;
}
function Ax(e) {
  var n, r;
  e instanceof n0 ? (n = e._id, e = e._name) : (n = S6(), (r = Tx).time = ph(), e = e == null ? null : e + "");
  for (var l = this._groups, s = l.length, u = 0; u < s; ++u)
    for (var c = l[u], h = c.length, d, p = 0; p < h; ++p)
      (d = c[p]) && Au(d, e, n, p, c, r || zx(d, n));
  return new n0(l, this._parents, e, n);
}
Qi.prototype.interrupt = M9;
Qi.prototype.transition = Ax;
const Oo = (e) => () => e;
function Cx(e, {
  sourceEvent: n,
  target: r,
  transform: l,
  dispatch: s
}) {
  Object.defineProperties(this, {
    type: { value: e, enumerable: !0, configurable: !0 },
    sourceEvent: { value: n, enumerable: !0, configurable: !0 },
    target: { value: r, enumerable: !0, configurable: !0 },
    transform: { value: l, enumerable: !0, configurable: !0 },
    _: { value: s }
  });
}
function Pa(e, n, r) {
  this.k = e, this.x = n, this.y = r;
}
Pa.prototype = {
  constructor: Pa,
  scale: function(e) {
    return e === 1 ? this : new Pa(this.k * e, this.x, this.y);
  },
  translate: function(e, n) {
    return e === 0 & n === 0 ? this : new Pa(this.k, this.x + this.k * e, this.y + this.k * n);
  },
  apply: function(e) {
    return [e[0] * this.k + this.x, e[1] * this.k + this.y];
  },
  applyX: function(e) {
    return e * this.k + this.x;
  },
  applyY: function(e) {
    return e * this.k + this.y;
  },
  invert: function(e) {
    return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k];
  },
  invertX: function(e) {
    return (e - this.x) / this.k;
  },
  invertY: function(e) {
    return (e - this.y) / this.k;
  },
  rescaleX: function(e) {
    return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e));
  },
  rescaleY: function(e) {
    return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e));
  },
  toString: function() {
    return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
  }
};
var G0 = new Pa(1, 0, 0);
Pa.prototype;
function h1(e) {
  e.stopImmediatePropagation();
}
function ki(e) {
  e.preventDefault(), e.stopImmediatePropagation();
}
function Nx(e) {
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
}
function kx() {
  var e = this;
  return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
}
function b5() {
  return this.__zoom || G0;
}
function Dx(e) {
  return -e.deltaY * (e.deltaMode === 1 ? 0.05 : e.deltaMode ? 1 : 2e-3) * (e.ctrlKey ? 10 : 1);
}
function _x() {
  return navigator.maxTouchPoints || "ontouchstart" in this;
}
function Rx(e, n, r) {
  var l = e.invertX(n[0][0]) - r[0][0], s = e.invertX(n[1][0]) - r[1][0], u = e.invertY(n[0][1]) - r[0][1], c = e.invertY(n[1][1]) - r[1][1];
  return e.translate(
    s > l ? (l + s) / 2 : Math.min(0, l) || Math.max(0, s),
    c > u ? (u + c) / 2 : Math.min(0, u) || Math.max(0, c)
  );
}
function Bx() {
  var e = Nx, n = kx, r = Rx, l = Dx, s = _x, u = [0, 1 / 0], c = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], h = 250, d = g9, p = Mu("start", "zoom", "end"), g, y, x, w = 500, z = 150, M = 0, A = 10;
  function T(_) {
    _.property("__zoom", b5).on("wheel.zoom", re, { passive: !1 }).on("mousedown.zoom", te).on("dblclick.zoom", ie).filter(s).on("touchstart.zoom", ue).on("touchmove.zoom", de).on("touchend.zoom touchcancel.zoom", ge).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
  }
  T.transform = function(_, J, D, Y) {
    var I = _.selection ? _.selection() : _;
    I.property("__zoom", b5), _ !== I ? $(_, J, D, Y) : I.interrupt().each(function() {
      V(this, arguments).event(Y).start().zoom(null, typeof J == "function" ? J.apply(this, arguments) : J).end();
    });
  }, T.scaleBy = function(_, J, D, Y) {
    T.scaleTo(_, function() {
      var I = this.__zoom.k, F = typeof J == "function" ? J.apply(this, arguments) : J;
      return I * F;
    }, D, Y);
  }, T.scaleTo = function(_, J, D, Y) {
    T.transform(_, function() {
      var I = n.apply(this, arguments), F = this.__zoom, le = D == null ? H(I) : typeof D == "function" ? D.apply(this, arguments) : D, k = F.invert(le), G = typeof J == "function" ? J.apply(this, arguments) : J;
      return r(q(R(F, G), le, k), I, c);
    }, D, Y);
  }, T.translateBy = function(_, J, D, Y) {
    T.transform(_, function() {
      return r(this.__zoom.translate(
        typeof J == "function" ? J.apply(this, arguments) : J,
        typeof D == "function" ? D.apply(this, arguments) : D
      ), n.apply(this, arguments), c);
    }, null, Y);
  }, T.translateTo = function(_, J, D, Y, I) {
    T.transform(_, function() {
      var F = n.apply(this, arguments), le = this.__zoom, k = Y == null ? H(F) : typeof Y == "function" ? Y.apply(this, arguments) : Y;
      return r(G0.translate(k[0], k[1]).scale(le.k).translate(
        typeof J == "function" ? -J.apply(this, arguments) : -J,
        typeof D == "function" ? -D.apply(this, arguments) : -D
      ), F, c);
    }, Y, I);
  };
  function R(_, J) {
    return J = Math.max(u[0], Math.min(u[1], J)), J === _.k ? _ : new Pa(J, _.x, _.y);
  }
  function q(_, J, D) {
    var Y = J[0] - D[0] * _.k, I = J[1] - D[1] * _.k;
    return Y === _.x && I === _.y ? _ : new Pa(_.k, Y, I);
  }
  function H(_) {
    return [(+_[0][0] + +_[1][0]) / 2, (+_[0][1] + +_[1][1]) / 2];
  }
  function $(_, J, D, Y) {
    _.on("start.zoom", function() {
      V(this, arguments).event(Y).start();
    }).on("interrupt.zoom end.zoom", function() {
      V(this, arguments).event(Y).end();
    }).tween("zoom", function() {
      var I = this, F = arguments, le = V(I, F).event(Y), k = n.apply(I, F), G = D == null ? H(k) : typeof D == "function" ? D.apply(I, F) : D, ae = Math.max(k[1][0] - k[0][0], k[1][1] - k[0][1]), se = I.__zoom, xe = typeof J == "function" ? J.apply(I, F) : J, Te = d(se.invert(G).concat(ae / se.k), xe.invert(G).concat(ae / xe.k));
      return function(Ae) {
        if (Ae === 1) Ae = xe;
        else {
          var Re = Te(Ae), Be = ae / Re[2];
          Ae = new Pa(Be, G[0] - Re[0] * Be, G[1] - Re[1] * Be);
        }
        le.zoom(null, Ae);
      };
    });
  }
  function V(_, J, D) {
    return !D && _.__zooming || new Q(_, J);
  }
  function Q(_, J) {
    this.that = _, this.args = J, this.active = 0, this.sourceEvent = null, this.extent = n.apply(_, J), this.taps = 0;
  }
  Q.prototype = {
    event: function(_) {
      return _ && (this.sourceEvent = _), this;
    },
    start: function() {
      return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
    },
    zoom: function(_, J) {
      return this.mouse && _ !== "mouse" && (this.mouse[1] = J.invert(this.mouse[0])), this.touch0 && _ !== "touch" && (this.touch0[1] = J.invert(this.touch0[0])), this.touch1 && _ !== "touch" && (this.touch1[1] = J.invert(this.touch1[0])), this.that.__zoom = J, this.emit("zoom"), this;
    },
    end: function() {
      return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
    },
    emit: function(_) {
      var J = Wn(this.that).datum();
      p.call(
        _,
        this.that,
        new Cx(_, {
          sourceEvent: this.sourceEvent,
          target: T,
          transform: this.that.__zoom,
          dispatch: p
        }),
        J
      );
    }
  };
  function re(_, ...J) {
    if (!e.apply(this, arguments)) return;
    var D = V(this, J).event(_), Y = this.__zoom, I = Math.max(u[0], Math.min(u[1], Y.k * Math.pow(2, l.apply(this, arguments)))), F = ya(_);
    if (D.wheel)
      (D.mouse[0][0] !== F[0] || D.mouse[0][1] !== F[1]) && (D.mouse[1] = Y.invert(D.mouse[0] = F)), clearTimeout(D.wheel);
    else {
      if (Y.k === I) return;
      D.mouse = [F, Y.invert(F)], eu(this), D.start();
    }
    ki(_), D.wheel = setTimeout(le, z), D.zoom("mouse", r(q(R(Y, I), D.mouse[0], D.mouse[1]), D.extent, c));
    function le() {
      D.wheel = null, D.end();
    }
  }
  function te(_, ...J) {
    if (x || !e.apply(this, arguments)) return;
    var D = _.currentTarget, Y = V(this, J, !0).event(_), I = Wn(_.view).on("mousemove.zoom", G, !0).on("mouseup.zoom", ae, !0), F = ya(_, D), le = _.clientX, k = _.clientY;
    i6(_.view), h1(_), Y.mouse = [F, this.__zoom.invert(F)], eu(this), Y.start();
    function G(se) {
      if (ki(se), !Y.moved) {
        var xe = se.clientX - le, Te = se.clientY - k;
        Y.moved = xe * xe + Te * Te > M;
      }
      Y.event(se).zoom("mouse", r(q(Y.that.__zoom, Y.mouse[0] = ya(se, D), Y.mouse[1]), Y.extent, c));
    }
    function ae(se) {
      I.on("mousemove.zoom mouseup.zoom", null), s6(se.view, Y.moved), ki(se), Y.event(se).end();
    }
  }
  function ie(_, ...J) {
    if (e.apply(this, arguments)) {
      var D = this.__zoom, Y = ya(_.changedTouches ? _.changedTouches[0] : _, this), I = D.invert(Y), F = D.k * (_.shiftKey ? 0.5 : 2), le = r(q(R(D, F), Y, I), n.apply(this, J), c);
      ki(_), h > 0 ? Wn(this).transition().duration(h).call($, le, Y, _) : Wn(this).call(T.transform, le, Y, _);
    }
  }
  function ue(_, ...J) {
    if (e.apply(this, arguments)) {
      var D = _.touches, Y = D.length, I = V(this, J, _.changedTouches.length === Y).event(_), F, le, k, G;
      for (h1(_), le = 0; le < Y; ++le)
        k = D[le], G = ya(k, this), G = [G, this.__zoom.invert(G), k.identifier], I.touch0 ? !I.touch1 && I.touch0[2] !== G[2] && (I.touch1 = G, I.taps = 0) : (I.touch0 = G, F = !0, I.taps = 1 + !!g);
      g && (g = clearTimeout(g)), F && (I.taps < 2 && (y = G[0], g = setTimeout(function() {
        g = null;
      }, w)), eu(this), I.start());
    }
  }
  function de(_, ...J) {
    if (this.__zooming) {
      var D = V(this, J).event(_), Y = _.changedTouches, I = Y.length, F, le, k, G;
      for (ki(_), F = 0; F < I; ++F)
        le = Y[F], k = ya(le, this), D.touch0 && D.touch0[2] === le.identifier ? D.touch0[0] = k : D.touch1 && D.touch1[2] === le.identifier && (D.touch1[0] = k);
      if (le = D.that.__zoom, D.touch1) {
        var ae = D.touch0[0], se = D.touch0[1], xe = D.touch1[0], Te = D.touch1[1], Ae = (Ae = xe[0] - ae[0]) * Ae + (Ae = xe[1] - ae[1]) * Ae, Re = (Re = Te[0] - se[0]) * Re + (Re = Te[1] - se[1]) * Re;
        le = R(le, Math.sqrt(Ae / Re)), k = [(ae[0] + xe[0]) / 2, (ae[1] + xe[1]) / 2], G = [(se[0] + Te[0]) / 2, (se[1] + Te[1]) / 2];
      } else if (D.touch0) k = D.touch0[0], G = D.touch0[1];
      else return;
      D.zoom("touch", r(q(le, k, G), D.extent, c));
    }
  }
  function ge(_, ...J) {
    if (this.__zooming) {
      var D = V(this, J).event(_), Y = _.changedTouches, I = Y.length, F, le;
      for (h1(_), x && clearTimeout(x), x = setTimeout(function() {
        x = null;
      }, w), F = 0; F < I; ++F)
        le = Y[F], D.touch0 && D.touch0[2] === le.identifier ? delete D.touch0 : D.touch1 && D.touch1[2] === le.identifier && delete D.touch1;
      if (D.touch1 && !D.touch0 && (D.touch0 = D.touch1, delete D.touch1), D.touch0) D.touch0[1] = this.__zoom.invert(D.touch0[0]);
      else if (D.end(), D.taps === 2 && (le = ya(le, this), Math.hypot(y[0] - le[0], y[1] - le[1]) < A)) {
        var k = Wn(this).on("dblclick.zoom");
        k && k.apply(this, arguments);
      }
    }
  }
  return T.wheelDelta = function(_) {
    return arguments.length ? (l = typeof _ == "function" ? _ : Oo(+_), T) : l;
  }, T.filter = function(_) {
    return arguments.length ? (e = typeof _ == "function" ? _ : Oo(!!_), T) : e;
  }, T.touchable = function(_) {
    return arguments.length ? (s = typeof _ == "function" ? _ : Oo(!!_), T) : s;
  }, T.extent = function(_) {
    return arguments.length ? (n = typeof _ == "function" ? _ : Oo([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), T) : n;
  }, T.scaleExtent = function(_) {
    return arguments.length ? (u[0] = +_[0], u[1] = +_[1], T) : [u[0], u[1]];
  }, T.translateExtent = function(_) {
    return arguments.length ? (c[0][0] = +_[0][0], c[1][0] = +_[1][0], c[0][1] = +_[0][1], c[1][1] = +_[1][1], T) : [[c[0][0], c[0][1]], [c[1][0], c[1][1]]];
  }, T.constrain = function(_) {
    return arguments.length ? (r = _, T) : r;
  }, T.duration = function(_) {
    return arguments.length ? (h = +_, T) : h;
  }, T.interpolate = function(_) {
    return arguments.length ? (d = _, T) : d;
  }, T.on = function() {
    var _ = p.on.apply(p, arguments);
    return _ === p ? T : _;
  }, T.clickDistance = function(_) {
    return arguments.length ? (M = (_ = +_) * _, T) : Math.sqrt(M);
  }, T.tapDistance = function(_) {
    return arguments.length ? (A = +_, T) : A;
  }, T;
}
var Ox = Z3();
const Cu = B.createContext(null), Hx = Cu.Provider, a0 = {
  error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",
  error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
  error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
  error004: () => "The React Flow parent container needs a width and a height to render the graph.",
  error005: () => "Only child nodes can use a parent extent.",
  error006: () => "Can't create edge. An edge needs a source and a target.",
  error007: (e) => `The old edge with id=${e} does not exist.`,
  error009: (e) => `Marker type "${e}" doesn't exist.`,
  error008: (e, n) => `Couldn't create edge for ${e ? "target" : "source"} handle id: "${e ? n.targetHandle : n.sourceHandle}", edge id: ${n.id}.`,
  error010: () => "Handle: No node id found. Make sure to only use a Handle inside a custom Node.",
  error011: (e) => `Edge type "${e}" not found. Using fallback type "default".`,
  error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`
}, w6 = a0.error001();
function pt(e, n) {
  const r = B.useContext(Cu);
  if (r === null)
    throw new Error(w6);
  return F3(r, e, n);
}
const Ut = () => {
  const e = B.useContext(Cu);
  if (e === null)
    throw new Error(w6);
  return B.useMemo(() => ({
    getState: e.getState,
    setState: e.setState,
    subscribe: e.subscribe,
    destroy: e.destroy
  }), [e]);
}, Lx = (e) => e.userSelectionActive ? "none" : "all";
function vh({ position: e, children: n, className: r, style: l, ...s }) {
  const u = pt(Lx), c = `${e}`.split("-");
  return ce.createElement("div", { className: ln(["react-flow__panel", r, ...c]), style: { ...l, pointerEvents: u }, ...s }, n);
}
function qx({ proOptions: e, position: n = "bottom-right" }) {
  return e?.hideAttribution ? null : ce.createElement(
    vh,
    { position: n, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro" },
    ce.createElement("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution" }, "React Flow")
  );
}
const Ux = ({ x: e, y: n, label: r, labelStyle: l = {}, labelShowBg: s = !0, labelBgStyle: u = {}, labelBgPadding: c = [2, 4], labelBgBorderRadius: h = 2, children: d, className: p, ...g }) => {
  const y = B.useRef(null), [x, w] = B.useState({ x: 0, y: 0, width: 0, height: 0 }), z = ln(["react-flow__edge-textwrapper", p]);
  return B.useEffect(() => {
    if (y.current) {
      const M = y.current.getBBox();
      w({
        x: M.x,
        y: M.y,
        width: M.width,
        height: M.height
      });
    }
  }, [r]), typeof r > "u" || !r ? null : ce.createElement(
    "g",
    { transform: `translate(${e - x.width / 2} ${n - x.height / 2})`, className: z, visibility: x.width ? "visible" : "hidden", ...g },
    s && ce.createElement("rect", { width: x.width + 2 * c[0], x: -c[0], y: -c[1], height: x.height + 2 * c[1], className: "react-flow__edge-textbg", style: u, rx: h, ry: h }),
    ce.createElement("text", { className: "react-flow__edge-text", y: x.height / 2, dy: "0.3em", ref: y, style: l }, r),
    d
  );
};
var jx = B.memo(Ux);
const xh = (e) => ({
  width: e.offsetWidth,
  height: e.offsetHeight
}), F0 = (e, n = 0, r = 1) => Math.min(Math.max(e, n), r), bh = (e = { x: 0, y: 0 }, n) => ({
  x: F0(e.x, n[0][0], n[1][0]),
  y: F0(e.y, n[0][1], n[1][1])
}), S5 = (e, n, r) => e < n ? F0(Math.abs(e - n), 1, 50) / 50 : e > r ? -F0(Math.abs(e - r), 1, 50) / 50 : 0, E6 = (e, n) => {
  const r = S5(e.x, 35, n.width - 35) * 20, l = S5(e.y, 35, n.height - 35) * 20;
  return [r, l];
}, M6 = (e) => e.getRootNode?.() || window?.document, Vx = (e, n) => ({
  x: Math.min(e.x, n.x),
  y: Math.min(e.y, n.y),
  x2: Math.max(e.x2, n.x2),
  y2: Math.max(e.y2, n.y2)
}), Sh = ({ x: e, y: n, width: r, height: l }) => ({
  x: e,
  y: n,
  x2: e + r,
  y2: n + l
}), Yx = ({ x: e, y: n, x2: r, y2: l }) => ({
  x: e,
  y: n,
  width: r - e,
  height: l - n
}), w5 = (e) => ({
  ...e.positionAbsolute || { x: 0, y: 0 },
  width: e.width || 0,
  height: e.height || 0
}), X1 = (e, n) => {
  const r = Math.max(0, Math.min(e.x + e.width, n.x + n.width) - Math.max(e.x, n.x)), l = Math.max(0, Math.min(e.y + e.height, n.y + n.height) - Math.max(e.y, n.y));
  return Math.ceil(r * l);
}, Gx = (e) => Pn(e.width) && Pn(e.height) && Pn(e.x) && Pn(e.y), Pn = (e) => !isNaN(e) && isFinite(e), Nt = /* @__PURE__ */ Symbol.for("internals"), T6 = ["Enter", " ", "Escape"], Xx = (e, n) => {
}, $x = (e) => "nativeEvent" in e;
function $1(e) {
  const r = ($x(e) ? e.nativeEvent : e).composedPath?.()?.[0] || e.target;
  return ["INPUT", "SELECT", "TEXTAREA"].includes(r?.nodeName) || r?.hasAttribute("contenteditable") || !!r?.closest(".nokey");
}
const z6 = (e) => "clientX" in e, X0 = (e, n) => {
  const r = z6(e), l = r ? e.clientX : e.touches?.[0].clientX, s = r ? e.clientY : e.touches?.[0].clientY;
  return {
    x: l - (n?.left ?? 0),
    y: s - (n?.top ?? 0)
  };
}, uu = () => typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Cl = ({ id: e, path: n, labelX: r, labelY: l, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p, style: g, markerEnd: y, markerStart: x, interactionWidth: w = 20 }) => ce.createElement(
  ce.Fragment,
  null,
  ce.createElement("path", { id: e, style: g, d: n, fill: "none", className: "react-flow__edge-path", markerEnd: y, markerStart: x }),
  w && ce.createElement("path", { d: n, fill: "none", strokeOpacity: 0, strokeWidth: w, className: "react-flow__edge-interaction" }),
  s && Pn(r) && Pn(l) ? ce.createElement(jx, { x: r, y: l, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p }) : null
);
Cl.displayName = "BaseEdge";
function Di(e, n, r) {
  return r === void 0 ? r : (l) => {
    const s = n().edges.find((u) => u.id === e);
    s && r(l, { ...s });
  };
}
function A6({ sourceX: e, sourceY: n, targetX: r, targetY: l }) {
  const s = Math.abs(r - e) / 2, u = r < e ? r + s : r - s, c = Math.abs(l - n) / 2, h = l < n ? l + c : l - c;
  return [u, h, s, c];
}
function C6({ sourceX: e, sourceY: n, targetX: r, targetY: l, sourceControlX: s, sourceControlY: u, targetControlX: c, targetControlY: h }) {
  const d = e * 0.125 + s * 0.375 + c * 0.375 + r * 0.125, p = n * 0.125 + u * 0.375 + h * 0.375 + l * 0.125, g = Math.abs(d - e), y = Math.abs(p - n);
  return [d, p, g, y];
}
var Cr;
(function(e) {
  e.Strict = "strict", e.Loose = "loose";
})(Cr || (Cr = {}));
var Mr;
(function(e) {
  e.Free = "free", e.Vertical = "vertical", e.Horizontal = "horizontal";
})(Mr || (Mr = {}));
var $i;
(function(e) {
  e.Partial = "partial", e.Full = "full";
})($i || ($i = {}));
var V0;
(function(e) {
  e.Bezier = "default", e.Straight = "straight", e.Step = "step", e.SmoothStep = "smoothstep", e.SimpleBezier = "simplebezier";
})(V0 || (V0 = {}));
var cu;
(function(e) {
  e.Arrow = "arrow", e.ArrowClosed = "arrowclosed";
})(cu || (cu = {}));
var he;
(function(e) {
  e.Left = "left", e.Top = "top", e.Right = "right", e.Bottom = "bottom";
})(he || (he = {}));
function E5({ pos: e, x1: n, y1: r, x2: l, y2: s }) {
  return e === he.Left || e === he.Right ? [0.5 * (n + l), r] : [n, 0.5 * (r + s)];
}
function N6({ sourceX: e, sourceY: n, sourcePosition: r = he.Bottom, targetX: l, targetY: s, targetPosition: u = he.Top }) {
  const [c, h] = E5({
    pos: r,
    x1: e,
    y1: n,
    x2: l,
    y2: s
  }), [d, p] = E5({
    pos: u,
    x1: l,
    y1: s,
    x2: e,
    y2: n
  }), [g, y, x, w] = C6({
    sourceX: e,
    sourceY: n,
    targetX: l,
    targetY: s,
    sourceControlX: c,
    sourceControlY: h,
    targetControlX: d,
    targetControlY: p
  });
  return [
    `M${e},${n} C${c},${h} ${d},${p} ${l},${s}`,
    g,
    y,
    x,
    w
  ];
}
const wh = B.memo(({ sourceX: e, sourceY: n, targetX: r, targetY: l, sourcePosition: s = he.Bottom, targetPosition: u = he.Top, label: c, labelStyle: h, labelShowBg: d, labelBgStyle: p, labelBgPadding: g, labelBgBorderRadius: y, style: x, markerEnd: w, markerStart: z, interactionWidth: M }) => {
  const [A, T, R] = N6({
    sourceX: e,
    sourceY: n,
    sourcePosition: s,
    targetX: r,
    targetY: l,
    targetPosition: u
  });
  return ce.createElement(Cl, { path: A, labelX: T, labelY: R, label: c, labelStyle: h, labelShowBg: d, labelBgStyle: p, labelBgPadding: g, labelBgBorderRadius: y, style: x, markerEnd: w, markerStart: z, interactionWidth: M });
});
wh.displayName = "SimpleBezierEdge";
const M5 = {
  [he.Left]: { x: -1, y: 0 },
  [he.Right]: { x: 1, y: 0 },
  [he.Top]: { x: 0, y: -1 },
  [he.Bottom]: { x: 0, y: 1 }
}, Zx = ({ source: e, sourcePosition: n = he.Bottom, target: r }) => n === he.Left || n === he.Right ? e.x < r.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : e.y < r.y ? { x: 0, y: 1 } : { x: 0, y: -1 }, T5 = (e, n) => Math.sqrt(Math.pow(n.x - e.x, 2) + Math.pow(n.y - e.y, 2));
function Fx({ source: e, sourcePosition: n = he.Bottom, target: r, targetPosition: l = he.Top, center: s, offset: u }) {
  const c = M5[n], h = M5[l], d = { x: e.x + c.x * u, y: e.y + c.y * u }, p = { x: r.x + h.x * u, y: r.y + h.y * u }, g = Zx({
    source: d,
    sourcePosition: n,
    target: p
  }), y = g.x !== 0 ? "x" : "y", x = g[y];
  let w = [], z, M;
  const A = { x: 0, y: 0 }, T = { x: 0, y: 0 }, [R, q, H, $] = A6({
    sourceX: e.x,
    sourceY: e.y,
    targetX: r.x,
    targetY: r.y
  });
  if (c[y] * h[y] === -1) {
    z = s.x ?? R, M = s.y ?? q;
    const Q = [
      { x: z, y: d.y },
      { x: z, y: p.y }
    ], re = [
      { x: d.x, y: M },
      { x: p.x, y: M }
    ];
    c[y] === x ? w = y === "x" ? Q : re : w = y === "x" ? re : Q;
  } else {
    const Q = [{ x: d.x, y: p.y }], re = [{ x: p.x, y: d.y }];
    if (y === "x" ? w = c.x === x ? re : Q : w = c.y === x ? Q : re, n === l) {
      const ge = Math.abs(e[y] - r[y]);
      if (ge <= u) {
        const _ = Math.min(u - 1, u - ge);
        c[y] === x ? A[y] = (d[y] > e[y] ? -1 : 1) * _ : T[y] = (p[y] > r[y] ? -1 : 1) * _;
      }
    }
    if (n !== l) {
      const ge = y === "x" ? "y" : "x", _ = c[y] === h[ge], J = d[ge] > p[ge], D = d[ge] < p[ge];
      (c[y] === 1 && (!_ && J || _ && D) || c[y] !== 1 && (!_ && D || _ && J)) && (w = y === "x" ? Q : re);
    }
    const te = { x: d.x + A.x, y: d.y + A.y }, ie = { x: p.x + T.x, y: p.y + T.y }, ue = Math.max(Math.abs(te.x - w[0].x), Math.abs(ie.x - w[0].x)), de = Math.max(Math.abs(te.y - w[0].y), Math.abs(ie.y - w[0].y));
    ue >= de ? (z = (te.x + ie.x) / 2, M = w[0].y) : (z = w[0].x, M = (te.y + ie.y) / 2);
  }
  return [[
    e,
    { x: d.x + A.x, y: d.y + A.y },
    ...w,
    { x: p.x + T.x, y: p.y + T.y },
    r
  ], z, M, H, $];
}
function Ix(e, n, r, l) {
  const s = Math.min(T5(e, n) / 2, T5(n, r) / 2, l), { x: u, y: c } = n;
  if (e.x === u && u === r.x || e.y === c && c === r.y)
    return `L${u} ${c}`;
  if (e.y === c) {
    const p = e.x < r.x ? -1 : 1, g = e.y < r.y ? 1 : -1;
    return `L ${u + s * p},${c}Q ${u},${c} ${u},${c + s * g}`;
  }
  const h = e.x < r.x ? 1 : -1, d = e.y < r.y ? -1 : 1;
  return `L ${u},${c + s * d}Q ${u},${c} ${u + s * h},${c}`;
}
function fu({ sourceX: e, sourceY: n, sourcePosition: r = he.Bottom, targetX: l, targetY: s, targetPosition: u = he.Top, borderRadius: c = 5, centerX: h, centerY: d, offset: p = 20 }) {
  const [g, y, x, w, z] = Fx({
    source: { x: e, y: n },
    sourcePosition: r,
    target: { x: l, y: s },
    targetPosition: u,
    center: { x: h, y: d },
    offset: p
  });
  return [g.reduce((A, T, R) => {
    let q = "";
    return R > 0 && R < g.length - 1 ? q = Ix(g[R - 1], T, g[R + 1], c) : q = `${R === 0 ? "M" : "L"}${T.x} ${T.y}`, A += q, A;
  }, ""), y, x, w, z];
}
const Nu = B.memo(({ sourceX: e, sourceY: n, targetX: r, targetY: l, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p, style: g, sourcePosition: y = he.Bottom, targetPosition: x = he.Top, markerEnd: w, markerStart: z, pathOptions: M, interactionWidth: A }) => {
  const [T, R, q] = fu({
    sourceX: e,
    sourceY: n,
    sourcePosition: y,
    targetX: r,
    targetY: l,
    targetPosition: x,
    borderRadius: M?.borderRadius,
    offset: M?.offset
  });
  return ce.createElement(Cl, { path: T, labelX: R, labelY: q, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p, style: g, markerEnd: w, markerStart: z, interactionWidth: A });
});
Nu.displayName = "SmoothStepEdge";
const Eh = B.memo((e) => ce.createElement(Nu, { ...e, pathOptions: B.useMemo(() => ({ borderRadius: 0, offset: e.pathOptions?.offset }), [e.pathOptions?.offset]) }));
Eh.displayName = "StepEdge";
function Kx({ sourceX: e, sourceY: n, targetX: r, targetY: l }) {
  const [s, u, c, h] = A6({
    sourceX: e,
    sourceY: n,
    targetX: r,
    targetY: l
  });
  return [`M ${e},${n}L ${r},${l}`, s, u, c, h];
}
const Mh = B.memo(({ sourceX: e, sourceY: n, targetX: r, targetY: l, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p, style: g, markerEnd: y, markerStart: x, interactionWidth: w }) => {
  const [z, M, A] = Kx({ sourceX: e, sourceY: n, targetX: r, targetY: l });
  return ce.createElement(Cl, { path: z, labelX: M, labelY: A, label: s, labelStyle: u, labelShowBg: c, labelBgStyle: h, labelBgPadding: d, labelBgBorderRadius: p, style: g, markerEnd: y, markerStart: x, interactionWidth: w });
});
Mh.displayName = "StraightEdge";
function Ho(e, n) {
  return e >= 0 ? 0.5 * e : n * 25 * Math.sqrt(-e);
}
function z5({ pos: e, x1: n, y1: r, x2: l, y2: s, c: u }) {
  switch (e) {
    case he.Left:
      return [n - Ho(n - l, u), r];
    case he.Right:
      return [n + Ho(l - n, u), r];
    case he.Top:
      return [n, r - Ho(r - s, u)];
    case he.Bottom:
      return [n, r + Ho(s - r, u)];
  }
}
function k6({ sourceX: e, sourceY: n, sourcePosition: r = he.Bottom, targetX: l, targetY: s, targetPosition: u = he.Top, curvature: c = 0.25 }) {
  const [h, d] = z5({
    pos: r,
    x1: e,
    y1: n,
    x2: l,
    y2: s,
    c
  }), [p, g] = z5({
    pos: u,
    x1: l,
    y1: s,
    x2: e,
    y2: n,
    c
  }), [y, x, w, z] = C6({
    sourceX: e,
    sourceY: n,
    targetX: l,
    targetY: s,
    sourceControlX: h,
    sourceControlY: d,
    targetControlX: p,
    targetControlY: g
  });
  return [
    `M${e},${n} C${h},${d} ${p},${g} ${l},${s}`,
    y,
    x,
    w,
    z
  ];
}
const hu = B.memo(({ sourceX: e, sourceY: n, targetX: r, targetY: l, sourcePosition: s = he.Bottom, targetPosition: u = he.Top, label: c, labelStyle: h, labelShowBg: d, labelBgStyle: p, labelBgPadding: g, labelBgBorderRadius: y, style: x, markerEnd: w, markerStart: z, pathOptions: M, interactionWidth: A }) => {
  const [T, R, q] = k6({
    sourceX: e,
    sourceY: n,
    sourcePosition: s,
    targetX: r,
    targetY: l,
    targetPosition: u,
    curvature: M?.curvature
  });
  return ce.createElement(Cl, { path: T, labelX: R, labelY: q, label: c, labelStyle: h, labelShowBg: d, labelBgStyle: p, labelBgPadding: g, labelBgBorderRadius: y, style: x, markerEnd: w, markerStart: z, interactionWidth: A });
});
hu.displayName = "BezierEdge";
const Th = B.createContext(null), Qx = Th.Provider;
Th.Consumer;
const D6 = () => B.useContext(Th), Jx = (e) => "id" in e && "source" in e && "target" in e, Wx = ({ source: e, sourceHandle: n, target: r, targetHandle: l }) => `reactflow__edge-${e}${n || ""}-${r}${l || ""}`, Z1 = (e, n) => typeof e > "u" ? "" : typeof e == "string" ? e : `${n ? `${n}__` : ""}${Object.keys(e).sort().map((l) => `${l}=${e[l]}`).join("&")}`, Px = (e, n) => n.some((r) => r.source === e.source && r.target === e.target && (r.sourceHandle === e.sourceHandle || !r.sourceHandle && !e.sourceHandle) && (r.targetHandle === e.targetHandle || !r.targetHandle && !e.targetHandle)), eb = (e, n) => {
  if (!e.source || !e.target)
    return n;
  let r;
  return Jx(e) ? r = { ...e } : r = {
    ...e,
    id: Wx(e)
  }, Px(r, n) ? n : n.concat(r);
}, F1 = ({ x: e, y: n }, [r, l, s], u, [c, h]) => {
  const d = {
    x: (e - r) / s,
    y: (n - l) / s
  };
  return u ? {
    x: c * Math.round(d.x / c),
    y: h * Math.round(d.y / h)
  } : d;
}, _6 = ({ x: e, y: n }, [r, l, s]) => ({
  x: e * s + r,
  y: n * s + l
}), Sl = (e, n = [0, 0]) => {
  if (!e)
    return {
      x: 0,
      y: 0,
      positionAbsolute: {
        x: 0,
        y: 0
      }
    };
  const r = (e.width ?? 0) * n[0], l = (e.height ?? 0) * n[1], s = {
    x: e.position.x - r,
    y: e.position.y - l
  };
  return {
    ...s,
    positionAbsolute: e.positionAbsolute ? {
      x: e.positionAbsolute.x - r,
      y: e.positionAbsolute.y - l
    } : s
  };
}, zh = (e, n = [0, 0]) => {
  if (e.length === 0)
    return { x: 0, y: 0, width: 0, height: 0 };
  const r = e.reduce((l, s) => {
    const { x: u, y: c } = Sl(s, n).positionAbsolute;
    return Vx(l, Sh({
      x: u,
      y: c,
      width: s.width || 0,
      height: s.height || 0
    }));
  }, { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 });
  return Yx(r);
}, R6 = (e, n, [r, l, s] = [0, 0, 1], u = !1, c = !1, h = [0, 0]) => {
  const d = {
    x: (n.x - r) / s,
    y: (n.y - l) / s,
    width: n.width / s,
    height: n.height / s
  }, p = [];
  return e.forEach((g) => {
    const { width: y, height: x, selectable: w = !0, hidden: z = !1 } = g;
    if (c && !w || z)
      return !1;
    const { positionAbsolute: M } = Sl(g, h), A = {
      x: M.x,
      y: M.y,
      width: y || 0,
      height: x || 0
    }, T = X1(d, A), R = typeof y > "u" || typeof x > "u" || y === null || x === null, q = u && T > 0, H = (y || 0) * (x || 0);
    (R || q || T >= H || g.dragging) && p.push(g);
  }), p;
}, B6 = (e, n) => {
  const r = e.map((l) => l.id);
  return n.filter((l) => r.includes(l.source) || r.includes(l.target));
}, O6 = (e, n, r, l, s, u = 0.1) => {
  const c = n / (e.width * (1 + u)), h = r / (e.height * (1 + u)), d = Math.min(c, h), p = F0(d, l, s), g = e.x + e.width / 2, y = e.y + e.height / 2, x = n / 2 - g * p, w = r / 2 - y * p;
  return { x, y: w, zoom: p };
}, wr = (e, n = 0) => e.transition().duration(n);
function A5(e, n, r, l) {
  return (n[r] || []).reduce((s, u) => (`${e.id}-${u.id}-${r}` !== l && s.push({
    id: u.id || null,
    type: r,
    nodeId: e.id,
    x: (e.positionAbsolute?.x ?? 0) + u.x + u.width / 2,
    y: (e.positionAbsolute?.y ?? 0) + u.y + u.height / 2
  }), s), []);
}
function tb(e, n, r, l, s, u) {
  const { x: c, y: h } = X0(e), p = n.elementsFromPoint(c, h).find((z) => z.classList.contains("react-flow__handle"));
  if (p) {
    const z = p.getAttribute("data-nodeid");
    if (z) {
      const M = Ah(void 0, p), A = p.getAttribute("data-handleid"), T = u({ nodeId: z, id: A, type: M });
      if (T) {
        const R = s.find((q) => q.nodeId === z && q.type === M && q.id === A);
        return {
          handle: {
            id: A,
            type: M,
            nodeId: z,
            x: R?.x || r.x,
            y: R?.y || r.y
          },
          validHandleResult: T
        };
      }
    }
  }
  let g = [], y = 1 / 0;
  if (s.forEach((z) => {
    const M = Math.sqrt((z.x - r.x) ** 2 + (z.y - r.y) ** 2);
    if (M <= l) {
      const A = u(z);
      M <= y && (M < y ? g = [{ handle: z, validHandleResult: A }] : M === y && g.push({
        handle: z,
        validHandleResult: A
      }), y = M);
    }
  }), !g.length)
    return { handle: null, validHandleResult: H6() };
  if (g.length === 1)
    return g[0];
  const x = g.some(({ validHandleResult: z }) => z.isValid), w = g.some(({ handle: z }) => z.type === "target");
  return g.find(({ handle: z, validHandleResult: M }) => w ? z.type === "target" : x ? M.isValid : !0) || g[0];
}
const nb = { source: null, target: null, sourceHandle: null, targetHandle: null }, H6 = () => ({
  handleDomNode: null,
  isValid: !1,
  connection: nb,
  endHandle: null
});
function L6(e, n, r, l, s, u, c) {
  const h = s === "target", d = c.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`), p = {
    ...H6(),
    handleDomNode: d
  };
  if (d) {
    const g = Ah(void 0, d), y = d.getAttribute("data-nodeid"), x = d.getAttribute("data-handleid"), w = d.classList.contains("connectable"), z = d.classList.contains("connectableend"), M = {
      source: h ? y : r,
      sourceHandle: h ? x : l,
      target: h ? r : y,
      targetHandle: h ? l : x
    };
    p.connection = M, w && z && (n === Cr.Strict ? h && g === "source" || !h && g === "target" : y !== r || x !== l) && (p.endHandle = {
      nodeId: y,
      handleId: x,
      type: g
    }, p.isValid = u(M));
  }
  return p;
}
function ab({ nodes: e, nodeId: n, handleId: r, handleType: l }) {
  return e.reduce((s, u) => {
    if (u[Nt]) {
      const { handleBounds: c } = u[Nt];
      let h = [], d = [];
      c && (h = A5(u, c, "source", `${n}-${r}-${l}`), d = A5(u, c, "target", `${n}-${r}-${l}`)), s.push(...h, ...d);
    }
    return s;
  }, []);
}
function Ah(e, n) {
  return e || (n?.classList.contains("target") ? "target" : n?.classList.contains("source") ? "source" : null);
}
function d1(e) {
  e?.classList.remove("valid", "connecting", "react-flow__handle-valid", "react-flow__handle-connecting");
}
function rb(e, n) {
  let r = null;
  return n ? r = "valid" : e && !n && (r = "invalid"), r;
}
function q6({ event: e, handleId: n, nodeId: r, onConnect: l, isTarget: s, getState: u, setState: c, isValidConnection: h, edgeUpdaterType: d, onReconnectEnd: p }) {
  const g = M6(e.target), { connectionMode: y, domNode: x, autoPanOnConnect: w, connectionRadius: z, onConnectStart: M, panBy: A, getNodes: T, cancelConnection: R } = u();
  let q = 0, H;
  const { x: $, y: V } = X0(e), Q = g?.elementFromPoint($, V), re = Ah(d, Q), te = x?.getBoundingClientRect();
  if (!te || !re)
    return;
  let ie, ue = X0(e, te), de = !1, ge = null, _ = !1, J = null;
  const D = ab({
    nodes: T(),
    nodeId: r,
    handleId: n,
    handleType: re
  }), Y = () => {
    if (!w)
      return;
    const [le, k] = E6(ue, te);
    A({ x: le, y: k }), q = requestAnimationFrame(Y);
  };
  c({
    connectionPosition: ue,
    connectionStatus: null,
    // connectionNodeId etc will be removed in the next major in favor of connectionStartHandle
    connectionNodeId: r,
    connectionHandleId: n,
    connectionHandleType: re,
    connectionStartHandle: {
      nodeId: r,
      handleId: n,
      type: re
    },
    connectionEndHandle: null
  }), M?.(e, { nodeId: r, handleId: n, handleType: re });
  function I(le) {
    const { transform: k } = u();
    ue = X0(le, te);
    const { handle: G, validHandleResult: ae } = tb(le, g, F1(ue, k, !1, [1, 1]), z, D, (se) => L6(se, y, r, n, s ? "target" : "source", h, g));
    if (H = G, de || (Y(), de = !0), J = ae.handleDomNode, ge = ae.connection, _ = ae.isValid, c({
      connectionPosition: H && _ ? _6({
        x: H.x,
        y: H.y
      }, k) : ue,
      connectionStatus: rb(!!H, _),
      connectionEndHandle: ae.endHandle
    }), !H && !_ && !J)
      return d1(ie);
    ge.source !== ge.target && J && (d1(ie), ie = J, J.classList.add("connecting", "react-flow__handle-connecting"), J.classList.toggle("valid", _), J.classList.toggle("react-flow__handle-valid", _));
  }
  function F(le) {
    (H || J) && ge && _ && l?.(ge), u().onConnectEnd?.(le), d && p?.(le), d1(ie), R(), cancelAnimationFrame(q), de = !1, _ = !1, ge = null, J = null, g.removeEventListener("mousemove", I), g.removeEventListener("mouseup", F), g.removeEventListener("touchmove", I), g.removeEventListener("touchend", F);
  }
  g.addEventListener("mousemove", I), g.addEventListener("mouseup", F), g.addEventListener("touchmove", I), g.addEventListener("touchend", F);
}
const C5 = () => !0, lb = (e) => ({
  connectionStartHandle: e.connectionStartHandle,
  connectOnClick: e.connectOnClick,
  noPanClassName: e.noPanClassName
}), ib = (e, n, r) => (l) => {
  const { connectionStartHandle: s, connectionEndHandle: u, connectionClickStartHandle: c } = l;
  return {
    connecting: s?.nodeId === e && s?.handleId === n && s?.type === r || u?.nodeId === e && u?.handleId === n && u?.type === r,
    clickConnecting: c?.nodeId === e && c?.handleId === n && c?.type === r
  };
}, U6 = B.forwardRef(({ type: e = "source", position: n = he.Top, isValidConnection: r, isConnectable: l = !0, isConnectableStart: s = !0, isConnectableEnd: u = !0, id: c, onConnect: h, children: d, className: p, onMouseDown: g, onTouchStart: y, ...x }, w) => {
  const z = c || null, M = e === "target", A = Ut(), T = D6(), { connectOnClick: R, noPanClassName: q } = pt(lb, Kt), { connecting: H, clickConnecting: $ } = pt(ib(T, z, e), Kt);
  T || A.getState().onError?.("010", a0.error010());
  const V = (te) => {
    const { defaultEdgeOptions: ie, onConnect: ue, hasDefaultEdges: de } = A.getState(), ge = {
      ...ie,
      ...te
    };
    if (de) {
      const { edges: _, setEdges: J } = A.getState();
      J(eb(ge, _));
    }
    ue?.(ge), h?.(ge);
  }, Q = (te) => {
    if (!T)
      return;
    const ie = z6(te);
    s && (ie && te.button === 0 || !ie) && q6({
      event: te,
      handleId: z,
      nodeId: T,
      onConnect: V,
      isTarget: M,
      getState: A.getState,
      setState: A.setState,
      isValidConnection: r || A.getState().isValidConnection || C5
    }), ie ? g?.(te) : y?.(te);
  }, re = (te) => {
    const { onClickConnectStart: ie, onClickConnectEnd: ue, connectionClickStartHandle: de, connectionMode: ge, isValidConnection: _ } = A.getState();
    if (!T || !de && !s)
      return;
    if (!de) {
      ie?.(te, { nodeId: T, handleId: z, handleType: e }), A.setState({ connectionClickStartHandle: { nodeId: T, type: e, handleId: z } });
      return;
    }
    const J = M6(te.target), D = r || _ || C5, { connection: Y, isValid: I } = L6({
      nodeId: T,
      id: z,
      type: e
    }, ge, de.nodeId, de.handleId || null, de.type, D, J);
    I && V(Y), ue?.(te), A.setState({ connectionClickStartHandle: null });
  };
  return ce.createElement("div", { "data-handleid": z, "data-nodeid": T, "data-handlepos": n, "data-id": `${T}-${z}-${e}`, className: ln([
    "react-flow__handle",
    `react-flow__handle-${n}`,
    "nodrag",
    q,
    p,
    {
      source: !M,
      target: M,
      connectable: l,
      connectablestart: s,
      connectableend: u,
      connecting: $,
      // this class is used to style the handle when the user is connecting
      connectionindicator: l && (s && !H || u && H)
    }
  ]), onMouseDown: Q, onTouchStart: Q, onClick: R ? re : void 0, ref: w, ...x }, d);
});
U6.displayName = "Handle";
var Tn = B.memo(U6);
const j6 = ({ data: e, isConnectable: n, targetPosition: r = he.Top, sourcePosition: l = he.Bottom }) => ce.createElement(
  ce.Fragment,
  null,
  ce.createElement(Tn, { type: "target", position: r, isConnectable: n }),
  e?.label,
  ce.createElement(Tn, { type: "source", position: l, isConnectable: n })
);
j6.displayName = "DefaultNode";
var I1 = B.memo(j6);
const V6 = ({ data: e, isConnectable: n, sourcePosition: r = he.Bottom }) => ce.createElement(
  ce.Fragment,
  null,
  e?.label,
  ce.createElement(Tn, { type: "source", position: r, isConnectable: n })
);
V6.displayName = "InputNode";
var Y6 = B.memo(V6);
const G6 = ({ data: e, isConnectable: n, targetPosition: r = he.Top }) => ce.createElement(
  ce.Fragment,
  null,
  ce.createElement(Tn, { type: "target", position: r, isConnectable: n }),
  e?.label
);
G6.displayName = "OutputNode";
var X6 = B.memo(G6);
const Ch = () => null;
Ch.displayName = "GroupNode";
const sb = (e) => ({
  selectedNodes: e.getNodes().filter((n) => n.selected),
  selectedEdges: e.edges.filter((n) => n.selected).map((n) => ({ ...n }))
}), Lo = (e) => e.id;
function ob(e, n) {
  return Kt(e.selectedNodes.map(Lo), n.selectedNodes.map(Lo)) && Kt(e.selectedEdges.map(Lo), n.selectedEdges.map(Lo));
}
const $6 = B.memo(({ onSelectionChange: e }) => {
  const n = Ut(), { selectedNodes: r, selectedEdges: l } = pt(sb, ob);
  return B.useEffect(() => {
    const s = { nodes: r, edges: l };
    e?.(s), n.getState().onSelectionChange.forEach((u) => u(s));
  }, [r, l, e]), null;
});
$6.displayName = "SelectionListener";
const ub = (e) => !!e.onSelectionChange;
function cb({ onSelectionChange: e }) {
  const n = pt(ub);
  return e || n ? ce.createElement($6, { onSelectionChange: e }) : null;
}
const fb = (e) => ({
  setNodes: e.setNodes,
  setEdges: e.setEdges,
  setDefaultNodesAndEdges: e.setDefaultNodesAndEdges,
  setMinZoom: e.setMinZoom,
  setMaxZoom: e.setMaxZoom,
  setTranslateExtent: e.setTranslateExtent,
  setNodeExtent: e.setNodeExtent,
  reset: e.reset
});
function cl(e, n) {
  B.useEffect(() => {
    typeof e < "u" && n(e);
  }, [e]);
}
function Fe(e, n, r) {
  B.useEffect(() => {
    typeof n < "u" && r({ [e]: n });
  }, [n]);
}
const hb = ({ nodes: e, edges: n, defaultNodes: r, defaultEdges: l, onConnect: s, onConnectStart: u, onConnectEnd: c, onClickConnectStart: h, onClickConnectEnd: d, nodesDraggable: p, nodesConnectable: g, nodesFocusable: y, edgesFocusable: x, edgesUpdatable: w, elevateNodesOnSelect: z, minZoom: M, maxZoom: A, nodeExtent: T, onNodesChange: R, onEdgesChange: q, elementsSelectable: H, connectionMode: $, snapGrid: V, snapToGrid: Q, translateExtent: re, connectOnClick: te, defaultEdgeOptions: ie, fitView: ue, fitViewOptions: de, onNodesDelete: ge, onEdgesDelete: _, onNodeDrag: J, onNodeDragStart: D, onNodeDragStop: Y, onSelectionDrag: I, onSelectionDragStart: F, onSelectionDragStop: le, noPanClassName: k, nodeOrigin: G, rfId: ae, autoPanOnConnect: se, autoPanOnNodeDrag: xe, onError: Te, connectionRadius: Ae, isValidConnection: Re, nodeDragThreshold: Be }) => {
  const { setNodes: Xe, setEdges: lt, setDefaultNodesAndEdges: St, setMinZoom: be, setMaxZoom: ye, setTranslateExtent: ze, setNodeExtent: _e, reset: je } = pt(fb, Kt), Ee = Ut();
  return B.useEffect(() => {
    const Oe = l?.map((ot) => ({ ...ot, ...ie }));
    return St(r, Oe), () => {
      je();
    };
  }, []), Fe("defaultEdgeOptions", ie, Ee.setState), Fe("connectionMode", $, Ee.setState), Fe("onConnect", s, Ee.setState), Fe("onConnectStart", u, Ee.setState), Fe("onConnectEnd", c, Ee.setState), Fe("onClickConnectStart", h, Ee.setState), Fe("onClickConnectEnd", d, Ee.setState), Fe("nodesDraggable", p, Ee.setState), Fe("nodesConnectable", g, Ee.setState), Fe("nodesFocusable", y, Ee.setState), Fe("edgesFocusable", x, Ee.setState), Fe("edgesUpdatable", w, Ee.setState), Fe("elementsSelectable", H, Ee.setState), Fe("elevateNodesOnSelect", z, Ee.setState), Fe("snapToGrid", Q, Ee.setState), Fe("snapGrid", V, Ee.setState), Fe("onNodesChange", R, Ee.setState), Fe("onEdgesChange", q, Ee.setState), Fe("connectOnClick", te, Ee.setState), Fe("fitViewOnInit", ue, Ee.setState), Fe("fitViewOnInitOptions", de, Ee.setState), Fe("onNodesDelete", ge, Ee.setState), Fe("onEdgesDelete", _, Ee.setState), Fe("onNodeDrag", J, Ee.setState), Fe("onNodeDragStart", D, Ee.setState), Fe("onNodeDragStop", Y, Ee.setState), Fe("onSelectionDrag", I, Ee.setState), Fe("onSelectionDragStart", F, Ee.setState), Fe("onSelectionDragStop", le, Ee.setState), Fe("noPanClassName", k, Ee.setState), Fe("nodeOrigin", G, Ee.setState), Fe("rfId", ae, Ee.setState), Fe("autoPanOnConnect", se, Ee.setState), Fe("autoPanOnNodeDrag", xe, Ee.setState), Fe("onError", Te, Ee.setState), Fe("connectionRadius", Ae, Ee.setState), Fe("isValidConnection", Re, Ee.setState), Fe("nodeDragThreshold", Be, Ee.setState), cl(e, Xe), cl(n, lt), cl(M, be), cl(A, ye), cl(re, ze), cl(T, _e), null;
}, N5 = { display: "none" }, db = {
  position: "absolute",
  width: 1,
  height: 1,
  margin: -1,
  border: 0,
  padding: 0,
  overflow: "hidden",
  clip: "rect(0px, 0px, 0px, 0px)",
  clipPath: "inset(100%)"
}, Z6 = "react-flow__node-desc", F6 = "react-flow__edge-desc", mb = "react-flow__aria-live", pb = (e) => e.ariaLiveMessage;
function gb({ rfId: e }) {
  const n = pt(pb);
  return ce.createElement("div", { id: `${mb}-${e}`, "aria-live": "assertive", "aria-atomic": "true", style: db }, n);
}
function yb({ rfId: e, disableKeyboardA11y: n }) {
  return ce.createElement(
    ce.Fragment,
    null,
    ce.createElement(
      "div",
      { id: `${Z6}-${e}`, style: N5 },
      "Press enter or space to select a node.",
      !n && "You can then use the arrow keys to move the node around.",
      " Press delete to remove it and escape to cancel.",
      " "
    ),
    ce.createElement("div", { id: `${F6}-${e}`, style: N5 }, "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),
    !n && ce.createElement(gb, { rfId: e })
  );
}
var Zi = (e = null, n = { actInsideInputWithModifier: !0 }) => {
  const [r, l] = B.useState(!1), s = B.useRef(!1), u = B.useRef(/* @__PURE__ */ new Set([])), [c, h] = B.useMemo(() => {
    if (e !== null) {
      const p = (Array.isArray(e) ? e : [e]).filter((y) => typeof y == "string").map((y) => y.split("+")), g = p.reduce((y, x) => y.concat(...x), []);
      return [p, g];
    }
    return [[], []];
  }, [e]);
  return B.useEffect(() => {
    const d = typeof document < "u" ? document : null, p = n?.target || d;
    if (e !== null) {
      const g = (w) => {
        if (s.current = w.ctrlKey || w.metaKey || w.shiftKey, (!s.current || s.current && !n.actInsideInputWithModifier) && $1(w))
          return !1;
        const M = D5(w.code, h);
        u.current.add(w[M]), k5(c, u.current, !1) && (w.preventDefault(), l(!0));
      }, y = (w) => {
        if ((!s.current || s.current && !n.actInsideInputWithModifier) && $1(w))
          return !1;
        const M = D5(w.code, h);
        k5(c, u.current, !0) ? (l(!1), u.current.clear()) : u.current.delete(w[M]), w.key === "Meta" && u.current.clear(), s.current = !1;
      }, x = () => {
        u.current.clear(), l(!1);
      };
      return p?.addEventListener("keydown", g), p?.addEventListener("keyup", y), window.addEventListener("blur", x), () => {
        p?.removeEventListener("keydown", g), p?.removeEventListener("keyup", y), window.removeEventListener("blur", x);
      };
    }
  }, [e, l]), r;
};
function k5(e, n, r) {
  return e.filter((l) => r || l.length === n.size).some((l) => l.every((s) => n.has(s)));
}
function D5(e, n) {
  return n.includes(e) ? "code" : "key";
}
function I6(e, n, r, l) {
  const s = e.parentNode || e.parentId;
  if (!s)
    return r;
  const u = n.get(s), c = Sl(u, l);
  return I6(u, n, {
    x: (r.x ?? 0) + c.x,
    y: (r.y ?? 0) + c.y,
    z: (u[Nt]?.z ?? 0) > (r.z ?? 0) ? u[Nt]?.z ?? 0 : r.z ?? 0
  }, l);
}
function K6(e, n, r) {
  e.forEach((l) => {
    const s = l.parentNode || l.parentId;
    if (s && !e.has(s))
      throw new Error(`Parent node ${s} not found`);
    if (s || r?.[l.id]) {
      const { x: u, y: c, z: h } = I6(l, e, {
        ...l.position,
        z: l[Nt]?.z ?? 0
      }, n);
      l.positionAbsolute = {
        x: u,
        y: c
      }, l[Nt].z = h, r?.[l.id] && (l[Nt].isParent = !0);
    }
  });
}
function m1(e, n, r, l) {
  const s = /* @__PURE__ */ new Map(), u = {}, c = l ? 1e3 : 0;
  return e.forEach((h) => {
    const d = (Pn(h.zIndex) ? h.zIndex : 0) + (h.selected ? c : 0), p = n.get(h.id), g = {
      ...h,
      positionAbsolute: {
        x: h.position.x,
        y: h.position.y
      }
    }, y = h.parentNode || h.parentId;
    y && (u[y] = !0);
    const x = p?.type && p?.type !== h.type;
    Object.defineProperty(g, Nt, {
      enumerable: !1,
      value: {
        handleBounds: x ? void 0 : p?.[Nt]?.handleBounds,
        z: d
      }
    }), s.set(h.id, g);
  }), K6(s, r, u), s;
}
function Q6(e, n = {}) {
  const { getNodes: r, width: l, height: s, minZoom: u, maxZoom: c, d3Zoom: h, d3Selection: d, fitViewOnInitDone: p, fitViewOnInit: g, nodeOrigin: y } = e(), x = n.initial && !p && g;
  if (h && d && (x || !n.initial)) {
    const z = r().filter((A) => {
      const T = n.includeHiddenNodes ? A.width && A.height : !A.hidden;
      return n.nodes?.length ? T && n.nodes.some((R) => R.id === A.id) : T;
    }), M = z.every((A) => A.width && A.height);
    if (z.length > 0 && M) {
      const A = zh(z, y), { x: T, y: R, zoom: q } = O6(A, l, s, n.minZoom ?? u, n.maxZoom ?? c, n.padding ?? 0.1), H = G0.translate(T, R).scale(q);
      return typeof n.duration == "number" && n.duration > 0 ? h.transform(wr(d, n.duration), H) : h.transform(d, H), !0;
    }
  }
  return !1;
}
function vb(e, n) {
  return e.forEach((r) => {
    const l = n.get(r.id);
    l && n.set(l.id, {
      ...l,
      [Nt]: l[Nt],
      selected: r.selected
    });
  }), new Map(n);
}
function xb(e, n) {
  return n.map((r) => {
    const l = e.find((s) => s.id === r.id);
    return l && (r.selected = l.selected), r;
  });
}
function qo({ changedNodes: e, changedEdges: n, get: r, set: l }) {
  const { nodeInternals: s, edges: u, onNodesChange: c, onEdgesChange: h, hasDefaultNodes: d, hasDefaultEdges: p } = r();
  e?.length && (d && l({ nodeInternals: vb(e, s) }), c?.(e)), n?.length && (p && l({ edges: xb(n, u) }), h?.(n));
}
const fl = () => {
}, bb = {
  zoomIn: fl,
  zoomOut: fl,
  zoomTo: fl,
  getZoom: () => 1,
  setViewport: fl,
  getViewport: () => ({ x: 0, y: 0, zoom: 1 }),
  fitView: () => !1,
  setCenter: fl,
  fitBounds: fl,
  project: (e) => e,
  screenToFlowPosition: (e) => e,
  flowToScreenPosition: (e) => e,
  viewportInitialized: !1
}, Sb = (e) => ({
  d3Zoom: e.d3Zoom,
  d3Selection: e.d3Selection
}), wb = () => {
  const e = Ut(), { d3Zoom: n, d3Selection: r } = pt(Sb, Kt);
  return B.useMemo(() => r && n ? {
    zoomIn: (s) => n.scaleBy(wr(r, s?.duration), 1.2),
    zoomOut: (s) => n.scaleBy(wr(r, s?.duration), 1 / 1.2),
    zoomTo: (s, u) => n.scaleTo(wr(r, u?.duration), s),
    getZoom: () => e.getState().transform[2],
    setViewport: (s, u) => {
      const [c, h, d] = e.getState().transform, p = G0.translate(s.x ?? c, s.y ?? h).scale(s.zoom ?? d);
      n.transform(wr(r, u?.duration), p);
    },
    getViewport: () => {
      const [s, u, c] = e.getState().transform;
      return { x: s, y: u, zoom: c };
    },
    fitView: (s) => Q6(e.getState, s),
    setCenter: (s, u, c) => {
      const { width: h, height: d, maxZoom: p } = e.getState(), g = typeof c?.zoom < "u" ? c.zoom : p, y = h / 2 - s * g, x = d / 2 - u * g, w = G0.translate(y, x).scale(g);
      n.transform(wr(r, c?.duration), w);
    },
    fitBounds: (s, u) => {
      const { width: c, height: h, minZoom: d, maxZoom: p } = e.getState(), { x: g, y, zoom: x } = O6(s, c, h, d, p, u?.padding ?? 0.1), w = G0.translate(g, y).scale(x);
      n.transform(wr(r, u?.duration), w);
    },
    // @deprecated Use `screenToFlowPosition`.
    project: (s) => {
      const { transform: u, snapToGrid: c, snapGrid: h } = e.getState();
      return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"), F1(s, u, c, h);
    },
    screenToFlowPosition: (s) => {
      const { transform: u, snapToGrid: c, snapGrid: h, domNode: d } = e.getState();
      if (!d)
        return s;
      const { x: p, y: g } = d.getBoundingClientRect(), y = {
        x: s.x - p,
        y: s.y - g
      };
      return F1(y, u, c, h);
    },
    flowToScreenPosition: (s) => {
      const { transform: u, domNode: c } = e.getState();
      if (!c)
        return s;
      const { x: h, y: d } = c.getBoundingClientRect(), p = _6(s, u);
      return {
        x: p.x + h,
        y: p.y + d
      };
    },
    viewportInitialized: !0
  } : bb, [n, r]);
};
function Wi() {
  const e = wb(), n = Ut(), r = B.useCallback(() => n.getState().getNodes().map((M) => ({ ...M })), []), l = B.useCallback((M) => n.getState().nodeInternals.get(M), []), s = B.useCallback(() => {
    const { edges: M = [] } = n.getState();
    return M.map((A) => ({ ...A }));
  }, []), u = B.useCallback((M) => {
    const { edges: A = [] } = n.getState();
    return A.find((T) => T.id === M);
  }, []), c = B.useCallback((M) => {
    const { getNodes: A, setNodes: T, hasDefaultNodes: R, onNodesChange: q } = n.getState(), H = A(), $ = typeof M == "function" ? M(H) : M;
    if (R)
      T($);
    else if (q) {
      const V = $.length === 0 ? H.map((Q) => ({ type: "remove", id: Q.id })) : $.map((Q) => ({ item: Q, type: "reset" }));
      q(V);
    }
  }, []), h = B.useCallback((M) => {
    const { edges: A = [], setEdges: T, hasDefaultEdges: R, onEdgesChange: q } = n.getState(), H = typeof M == "function" ? M(A) : M;
    if (R)
      T(H);
    else if (q) {
      const $ = H.length === 0 ? A.map((V) => ({ type: "remove", id: V.id })) : H.map((V) => ({ item: V, type: "reset" }));
      q($);
    }
  }, []), d = B.useCallback((M) => {
    const A = Array.isArray(M) ? M : [M], { getNodes: T, setNodes: R, hasDefaultNodes: q, onNodesChange: H } = n.getState();
    if (q) {
      const V = [...T(), ...A];
      R(V);
    } else if (H) {
      const $ = A.map((V) => ({ item: V, type: "add" }));
      H($);
    }
  }, []), p = B.useCallback((M) => {
    const A = Array.isArray(M) ? M : [M], { edges: T = [], setEdges: R, hasDefaultEdges: q, onEdgesChange: H } = n.getState();
    if (q)
      R([...T, ...A]);
    else if (H) {
      const $ = A.map((V) => ({ item: V, type: "add" }));
      H($);
    }
  }, []), g = B.useCallback(() => {
    const { getNodes: M, edges: A = [], transform: T } = n.getState(), [R, q, H] = T;
    return {
      nodes: M().map(($) => ({ ...$ })),
      edges: A.map(($) => ({ ...$ })),
      viewport: {
        x: R,
        y: q,
        zoom: H
      }
    };
  }, []), y = B.useCallback(({ nodes: M, edges: A }) => {
    const { nodeInternals: T, getNodes: R, edges: q, hasDefaultNodes: H, hasDefaultEdges: $, onNodesDelete: V, onEdgesDelete: Q, onNodesChange: re, onEdgesChange: te } = n.getState(), ie = (M || []).map((J) => J.id), ue = (A || []).map((J) => J.id), de = R().reduce((J, D) => {
      const Y = D.parentNode || D.parentId, I = !ie.includes(D.id) && Y && J.find((le) => le.id === Y);
      return (typeof D.deletable != "boolean" || D.deletable) && (ie.includes(D.id) || I) && J.push(D), J;
    }, []), ge = q.filter((J) => typeof J.deletable == "boolean" ? J.deletable : !0), _ = ge.filter((J) => ue.includes(J.id));
    if (de || _) {
      const J = B6(de, ge), D = [..._, ...J], Y = D.reduce((I, F) => (I.includes(F.id) || I.push(F.id), I), []);
      if (($ || H) && ($ && n.setState({
        edges: q.filter((I) => !Y.includes(I.id))
      }), H && (de.forEach((I) => {
        T.delete(I.id);
      }), n.setState({
        nodeInternals: new Map(T)
      }))), Y.length > 0 && (Q?.(D), te && te(Y.map((I) => ({
        id: I,
        type: "remove"
      })))), de.length > 0 && (V?.(de), re)) {
        const I = de.map((F) => ({ id: F.id, type: "remove" }));
        re(I);
      }
    }
  }, []), x = B.useCallback((M) => {
    const A = Gx(M), T = A ? null : n.getState().nodeInternals.get(M.id);
    return !A && !T ? [null, null, A] : [A ? M : w5(T), T, A];
  }, []), w = B.useCallback((M, A = !0, T) => {
    const [R, q, H] = x(M);
    return R ? (T || n.getState().getNodes()).filter(($) => {
      if (!H && ($.id === q.id || !$.positionAbsolute))
        return !1;
      const V = w5($), Q = X1(V, R);
      return A && Q > 0 || Q >= R.width * R.height;
    }) : [];
  }, []), z = B.useCallback((M, A, T = !0) => {
    const [R] = x(M);
    if (!R)
      return !1;
    const q = X1(R, A);
    return T && q > 0 || q >= R.width * R.height;
  }, []);
  return B.useMemo(() => ({
    ...e,
    getNodes: r,
    getNode: l,
    getEdges: s,
    getEdge: u,
    setNodes: c,
    setEdges: h,
    addNodes: d,
    addEdges: p,
    toObject: g,
    deleteElements: y,
    getIntersectingNodes: w,
    isNodeIntersecting: z
  }), [
    e,
    r,
    l,
    s,
    u,
    c,
    h,
    d,
    p,
    g,
    y,
    w,
    z
  ]);
}
const Eb = { actInsideInputWithModifier: !1 };
var Mb = ({ deleteKeyCode: e, multiSelectionKeyCode: n }) => {
  const r = Ut(), { deleteElements: l } = Wi(), s = Zi(e, Eb), u = Zi(n);
  B.useEffect(() => {
    if (s) {
      const { edges: c, getNodes: h } = r.getState(), d = h().filter((g) => g.selected), p = c.filter((g) => g.selected);
      l({ nodes: d, edges: p }), r.setState({ nodesSelectionActive: !1 });
    }
  }, [s]), B.useEffect(() => {
    r.setState({ multiSelectionActive: u });
  }, [u]);
};
function Tb(e) {
  const n = Ut();
  B.useEffect(() => {
    let r;
    const l = () => {
      if (!e.current)
        return;
      const s = xh(e.current);
      (s.height === 0 || s.width === 0) && n.getState().onError?.("004", a0.error004()), n.setState({ width: s.width || 500, height: s.height || 500 });
    };
    return l(), window.addEventListener("resize", l), e.current && (r = new ResizeObserver(() => l()), r.observe(e.current)), () => {
      window.removeEventListener("resize", l), r && e.current && r.unobserve(e.current);
    };
  }, []);
}
const Nh = {
  position: "absolute",
  width: "100%",
  height: "100%",
  top: 0,
  left: 0
}, zb = (e, n) => e.x !== n.x || e.y !== n.y || e.zoom !== n.k, Uo = (e) => ({
  x: e.x,
  y: e.y,
  zoom: e.k
}), hl = (e, n) => e.target.closest(`.${n}`), _5 = (e, n) => n === 2 && Array.isArray(e) && e.includes(2), R5 = (e) => {
  const n = e.ctrlKey && uu() ? 10 : 1;
  return -e.deltaY * (e.deltaMode === 1 ? 0.05 : e.deltaMode ? 1 : 2e-3) * n;
}, Ab = (e) => ({
  d3Zoom: e.d3Zoom,
  d3Selection: e.d3Selection,
  d3ZoomHandler: e.d3ZoomHandler,
  userSelectionActive: e.userSelectionActive
}), Cb = ({ onMove: e, onMoveStart: n, onMoveEnd: r, onPaneContextMenu: l, zoomOnScroll: s = !0, zoomOnPinch: u = !0, panOnScroll: c = !1, panOnScrollSpeed: h = 0.5, panOnScrollMode: d = Mr.Free, zoomOnDoubleClick: p = !0, elementsSelectable: g, panOnDrag: y = !0, defaultViewport: x, translateExtent: w, minZoom: z, maxZoom: M, zoomActivationKeyCode: A, preventScrolling: T = !0, children: R, noWheelClassName: q, noPanClassName: H }) => {
  const $ = B.useRef(), V = Ut(), Q = B.useRef(!1), re = B.useRef(!1), te = B.useRef(null), ie = B.useRef({ x: 0, y: 0, zoom: 0 }), { d3Zoom: ue, d3Selection: de, d3ZoomHandler: ge, userSelectionActive: _ } = pt(Ab, Kt), J = Zi(A), D = B.useRef(0), Y = B.useRef(!1), I = B.useRef();
  return Tb(te), B.useEffect(() => {
    if (te.current) {
      const F = te.current.getBoundingClientRect(), le = Bx().scaleExtent([z, M]).translateExtent(w), k = Wn(te.current).call(le), G = G0.translate(x.x, x.y).scale(F0(x.zoom, z, M)), ae = [
        [0, 0],
        [F.width, F.height]
      ], se = le.constrain()(G, ae, w);
      le.transform(k, se), le.wheelDelta(R5), V.setState({
        d3Zoom: le,
        d3Selection: k,
        d3ZoomHandler: k.on("wheel.zoom"),
        // we need to pass transform because zoom handler is not registered when we set the initial transform
        transform: [se.x, se.y, se.k],
        domNode: te.current.closest(".react-flow")
      });
    }
  }, []), B.useEffect(() => {
    de && ue && (c && !J && !_ ? de.on("wheel.zoom", (F) => {
      if (hl(F, q))
        return !1;
      F.preventDefault(), F.stopImmediatePropagation();
      const le = de.property("__zoom").k || 1;
      if (F.ctrlKey && u) {
        const Re = ya(F), Be = R5(F), Xe = le * Math.pow(2, Be);
        ue.scaleTo(de, Xe, Re, F);
        return;
      }
      const k = F.deltaMode === 1 ? 20 : 1;
      let G = d === Mr.Vertical ? 0 : F.deltaX * k, ae = d === Mr.Horizontal ? 0 : F.deltaY * k;
      !uu() && F.shiftKey && d !== Mr.Vertical && (G = F.deltaY * k, ae = 0), ue.translateBy(
        de,
        -(G / le) * h,
        -(ae / le) * h,
        // @ts-ignore
        { internal: !0 }
      );
      const se = Uo(de.property("__zoom")), { onViewportChangeStart: xe, onViewportChange: Te, onViewportChangeEnd: Ae } = V.getState();
      clearTimeout(I.current), Y.current || (Y.current = !0, n?.(F, se), xe?.(se)), Y.current && (e?.(F, se), Te?.(se), I.current = setTimeout(() => {
        r?.(F, se), Ae?.(se), Y.current = !1;
      }, 150));
    }, { passive: !1 }) : typeof ge < "u" && de.on("wheel.zoom", function(F, le) {
      if (!T && F.type === "wheel" && !F.ctrlKey || hl(F, q))
        return null;
      F.preventDefault(), ge.call(this, F, le);
    }, { passive: !1 }));
  }, [
    _,
    c,
    d,
    de,
    ue,
    ge,
    J,
    u,
    T,
    q,
    n,
    e,
    r
  ]), B.useEffect(() => {
    ue && ue.on("start", (F) => {
      if (!F.sourceEvent || F.sourceEvent.internal)
        return null;
      D.current = F.sourceEvent?.button;
      const { onViewportChangeStart: le } = V.getState(), k = Uo(F.transform);
      Q.current = !0, ie.current = k, F.sourceEvent?.type === "mousedown" && V.setState({ paneDragging: !0 }), le?.(k), n?.(F.sourceEvent, k);
    });
  }, [ue, n]), B.useEffect(() => {
    ue && (_ && !Q.current ? ue.on("zoom", null) : _ || ue.on("zoom", (F) => {
      const { onViewportChange: le } = V.getState();
      if (V.setState({ transform: [F.transform.x, F.transform.y, F.transform.k] }), re.current = !!(l && _5(y, D.current ?? 0)), (e || le) && !F.sourceEvent?.internal) {
        const k = Uo(F.transform);
        le?.(k), e?.(F.sourceEvent, k);
      }
    }));
  }, [_, ue, e, y, l]), B.useEffect(() => {
    ue && ue.on("end", (F) => {
      if (!F.sourceEvent || F.sourceEvent.internal)
        return null;
      const { onViewportChangeEnd: le } = V.getState();
      if (Q.current = !1, V.setState({ paneDragging: !1 }), l && _5(y, D.current ?? 0) && !re.current && l(F.sourceEvent), re.current = !1, (r || le) && zb(ie.current, F.transform)) {
        const k = Uo(F.transform);
        ie.current = k, clearTimeout($.current), $.current = setTimeout(() => {
          le?.(k), r?.(F.sourceEvent, k);
        }, c ? 150 : 0);
      }
    });
  }, [ue, c, y, r, l]), B.useEffect(() => {
    ue && ue.filter((F) => {
      const le = J || s, k = u && F.ctrlKey;
      if ((y === !0 || Array.isArray(y) && y.includes(1)) && F.button === 1 && F.type === "mousedown" && (hl(F, "react-flow__node") || hl(F, "react-flow__edge")))
        return !0;
      if (!y && !le && !c && !p && !u || _ || !p && F.type === "dblclick" || hl(F, q) && F.type === "wheel" || hl(F, H) && (F.type !== "wheel" || c && F.type === "wheel" && !J) || !u && F.ctrlKey && F.type === "wheel" || !le && !c && !k && F.type === "wheel" || !y && (F.type === "mousedown" || F.type === "touchstart") || Array.isArray(y) && !y.includes(F.button) && F.type === "mousedown")
        return !1;
      const G = Array.isArray(y) && y.includes(F.button) || !F.button || F.button <= 1;
      return (!F.ctrlKey || F.type === "wheel") && G;
    });
  }, [
    _,
    ue,
    s,
    u,
    c,
    p,
    y,
    g,
    J
  ]), ce.createElement("div", { className: "react-flow__renderer", ref: te, style: Nh }, R);
}, Nb = (e) => ({
  userSelectionActive: e.userSelectionActive,
  userSelectionRect: e.userSelectionRect
});
function kb() {
  const { userSelectionActive: e, userSelectionRect: n } = pt(Nb, Kt);
  return e && n ? ce.createElement("div", { className: "react-flow__selection react-flow__container", style: {
    width: n.width,
    height: n.height,
    transform: `translate(${n.x}px, ${n.y}px)`
  } }) : null;
}
function B5(e, n) {
  const r = n.parentNode || n.parentId, l = e.find((s) => s.id === r);
  if (l) {
    const s = n.position.x + n.width - l.width, u = n.position.y + n.height - l.height;
    if (s > 0 || u > 0 || n.position.x < 0 || n.position.y < 0) {
      if (l.style = { ...l.style }, l.style.width = l.style.width ?? l.width, l.style.height = l.style.height ?? l.height, s > 0 && (l.style.width += s), u > 0 && (l.style.height += u), n.position.x < 0) {
        const c = Math.abs(n.position.x);
        l.position.x = l.position.x - c, l.style.width += c, n.position.x = 0;
      }
      if (n.position.y < 0) {
        const c = Math.abs(n.position.y);
        l.position.y = l.position.y - c, l.style.height += c, n.position.y = 0;
      }
      l.width = l.style.width, l.height = l.style.height;
    }
  }
}
function J6(e, n) {
  if (e.some((l) => l.type === "reset"))
    return e.filter((l) => l.type === "reset").map((l) => l.item);
  const r = e.filter((l) => l.type === "add").map((l) => l.item);
  return n.reduce((l, s) => {
    const u = e.filter((h) => h.id === s.id);
    if (u.length === 0)
      return l.push(s), l;
    const c = { ...s };
    for (const h of u)
      if (h)
        switch (h.type) {
          case "select": {
            c.selected = h.selected;
            break;
          }
          case "position": {
            typeof h.position < "u" && (c.position = h.position), typeof h.positionAbsolute < "u" && (c.positionAbsolute = h.positionAbsolute), typeof h.dragging < "u" && (c.dragging = h.dragging), c.expandParent && B5(l, c);
            break;
          }
          case "dimensions": {
            typeof h.dimensions < "u" && (c.width = h.dimensions.width, c.height = h.dimensions.height), typeof h.updateStyle < "u" && (c.style = { ...c.style || {}, ...h.dimensions }), typeof h.resizing == "boolean" && (c.resizing = h.resizing), c.expandParent && B5(l, c);
            break;
          }
          case "remove":
            return l;
        }
    return l.push(c), l;
  }, r);
}
function W6(e, n) {
  return J6(e, n);
}
function Db(e, n) {
  return J6(e, n);
}
const j0 = (e, n) => ({
  id: e,
  type: "select",
  selected: n
});
function yl(e, n) {
  return e.reduce((r, l) => {
    const s = n.includes(l.id);
    return !l.selected && s ? (l.selected = !0, r.push(j0(l.id, !0))) : l.selected && !s && (l.selected = !1, r.push(j0(l.id, !1))), r;
  }, []);
}
const p1 = (e, n) => (r) => {
  r.target === n.current && e?.(r);
}, _b = (e) => ({
  userSelectionActive: e.userSelectionActive,
  elementsSelectable: e.elementsSelectable,
  dragging: e.paneDragging
}), P6 = B.memo(({ isSelecting: e, selectionMode: n = $i.Full, panOnDrag: r, onSelectionStart: l, onSelectionEnd: s, onPaneClick: u, onPaneContextMenu: c, onPaneScroll: h, onPaneMouseEnter: d, onPaneMouseMove: p, onPaneMouseLeave: g, children: y }) => {
  const x = B.useRef(null), w = Ut(), z = B.useRef(0), M = B.useRef(0), A = B.useRef(), { userSelectionActive: T, elementsSelectable: R, dragging: q } = pt(_b, Kt), H = () => {
    w.setState({ userSelectionActive: !1, userSelectionRect: null }), z.current = 0, M.current = 0;
  }, $ = (ge) => {
    u?.(ge), w.getState().resetSelectedElements(), w.setState({ nodesSelectionActive: !1 });
  }, V = (ge) => {
    if (Array.isArray(r) && r?.includes(2)) {
      ge.preventDefault();
      return;
    }
    c?.(ge);
  }, Q = h ? (ge) => h(ge) : void 0, re = (ge) => {
    const { resetSelectedElements: _, domNode: J } = w.getState();
    if (A.current = J?.getBoundingClientRect(), !R || !e || ge.button !== 0 || ge.target !== x.current || !A.current)
      return;
    const { x: D, y: Y } = X0(ge, A.current);
    _(), w.setState({
      userSelectionRect: {
        width: 0,
        height: 0,
        startX: D,
        startY: Y,
        x: D,
        y: Y
      }
    }), l?.(ge);
  }, te = (ge) => {
    const { userSelectionRect: _, nodeInternals: J, edges: D, transform: Y, onNodesChange: I, onEdgesChange: F, nodeOrigin: le, getNodes: k } = w.getState();
    if (!e || !A.current || !_)
      return;
    w.setState({ userSelectionActive: !0, nodesSelectionActive: !1 });
    const G = X0(ge, A.current), ae = _.startX ?? 0, se = _.startY ?? 0, xe = {
      ..._,
      x: G.x < ae ? G.x : ae,
      y: G.y < se ? G.y : se,
      width: Math.abs(G.x - ae),
      height: Math.abs(G.y - se)
    }, Te = k(), Ae = R6(J, xe, Y, n === $i.Partial, !0, le), Re = B6(Ae, D).map((Xe) => Xe.id), Be = Ae.map((Xe) => Xe.id);
    if (z.current !== Be.length) {
      z.current = Be.length;
      const Xe = yl(Te, Be);
      Xe.length && I?.(Xe);
    }
    if (M.current !== Re.length) {
      M.current = Re.length;
      const Xe = yl(D, Re);
      Xe.length && F?.(Xe);
    }
    w.setState({
      userSelectionRect: xe
    });
  }, ie = (ge) => {
    if (ge.button !== 0)
      return;
    const { userSelectionRect: _ } = w.getState();
    !T && _ && ge.target === x.current && $?.(ge), w.setState({ nodesSelectionActive: z.current > 0 }), H(), s?.(ge);
  }, ue = (ge) => {
    T && (w.setState({ nodesSelectionActive: z.current > 0 }), s?.(ge)), H();
  }, de = R && (e || T);
  return ce.createElement(
    "div",
    { className: ln(["react-flow__pane", { dragging: q, selection: e }]), onClick: de ? void 0 : p1($, x), onContextMenu: p1(V, x), onWheel: p1(Q, x), onMouseEnter: de ? void 0 : d, onMouseDown: de ? re : void 0, onMouseMove: de ? te : p, onMouseUp: de ? ie : void 0, onMouseLeave: de ? ue : g, ref: x, style: Nh },
    y,
    ce.createElement(kb, null)
  );
});
P6.displayName = "Pane";
function ep(e, n) {
  const r = e.parentNode || e.parentId;
  if (!r)
    return !1;
  const l = n.get(r);
  return l ? l.selected ? !0 : ep(l, n) : !1;
}
function O5(e, n, r) {
  let l = e;
  do {
    if (l?.matches(n))
      return !0;
    if (l === r.current)
      return !1;
    l = l.parentElement;
  } while (l);
  return !1;
}
function Rb(e, n, r, l) {
  return Array.from(e.values()).filter((s) => (s.selected || s.id === l) && (!s.parentNode || s.parentId || !ep(s, e)) && (s.draggable || n && typeof s.draggable > "u")).map((s) => ({
    id: s.id,
    position: s.position || { x: 0, y: 0 },
    positionAbsolute: s.positionAbsolute || { x: 0, y: 0 },
    distance: {
      x: r.x - (s.positionAbsolute?.x ?? 0),
      y: r.y - (s.positionAbsolute?.y ?? 0)
    },
    delta: {
      x: 0,
      y: 0
    },
    extent: s.extent,
    parentNode: s.parentNode || s.parentId,
    parentId: s.parentNode || s.parentId,
    width: s.width,
    height: s.height,
    expandParent: s.expandParent
  }));
}
function Bb(e, n) {
  return !n || n === "parent" ? n : [n[0], [n[1][0] - (e.width || 0), n[1][1] - (e.height || 0)]];
}
function tp(e, n, r, l, s = [0, 0], u) {
  const c = Bb(e, e.extent || l);
  let h = c;
  const d = e.parentNode || e.parentId;
  if (e.extent === "parent" && !e.expandParent)
    if (d && e.width && e.height) {
      const y = r.get(d), { x, y: w } = Sl(y, s).positionAbsolute;
      h = y && Pn(x) && Pn(w) && Pn(y.width) && Pn(y.height) ? [
        [x + e.width * s[0], w + e.height * s[1]],
        [
          x + y.width - e.width + e.width * s[0],
          w + y.height - e.height + e.height * s[1]
        ]
      ] : h;
    } else
      u?.("005", a0.error005()), h = c;
  else if (e.extent && d && e.extent !== "parent") {
    const y = r.get(d), { x, y: w } = Sl(y, s).positionAbsolute;
    h = [
      [e.extent[0][0] + x, e.extent[0][1] + w],
      [e.extent[1][0] + x, e.extent[1][1] + w]
    ];
  }
  let p = { x: 0, y: 0 };
  if (d) {
    const y = r.get(d);
    p = Sl(y, s).positionAbsolute;
  }
  const g = h && h !== "parent" ? bh(n, h) : n;
  return {
    position: {
      x: g.x - p.x,
      y: g.y - p.y
    },
    positionAbsolute: g
  };
}
function g1({ nodeId: e, dragItems: n, nodeInternals: r }) {
  const l = n.map((s) => ({
    ...r.get(s.id),
    position: s.position,
    positionAbsolute: s.positionAbsolute
  }));
  return [e ? l.find((s) => s.id === e) : l[0], l];
}
const H5 = (e, n, r, l) => {
  const s = n.querySelectorAll(e);
  if (!s || !s.length)
    return null;
  const u = Array.from(s), c = n.getBoundingClientRect(), h = {
    x: c.width * l[0],
    y: c.height * l[1]
  };
  return u.map((d) => {
    const p = d.getBoundingClientRect();
    return {
      id: d.getAttribute("data-handleid"),
      position: d.getAttribute("data-handlepos"),
      x: (p.left - c.left - h.x) / r,
      y: (p.top - c.top - h.y) / r,
      ...xh(d)
    };
  });
};
function _i(e, n, r) {
  return r === void 0 ? r : (l) => {
    const s = n().nodeInternals.get(e);
    s && r(l, { ...s });
  };
}
function K1({ id: e, store: n, unselect: r = !1, nodeRef: l }) {
  const { addSelectedNodes: s, unselectNodesAndEdges: u, multiSelectionActive: c, nodeInternals: h, onError: d } = n.getState(), p = h.get(e);
  if (!p) {
    d?.("012", a0.error012(e));
    return;
  }
  n.setState({ nodesSelectionActive: !1 }), p.selected ? (r || p.selected && c) && (u({ nodes: [p], edges: [] }), requestAnimationFrame(() => l?.current?.blur())) : s([e]);
}
function np() {
  const e = Ut();
  return B.useCallback(({ sourceEvent: r }) => {
    const { transform: l, snapGrid: s, snapToGrid: u } = e.getState(), c = r.touches ? r.touches[0].clientX : r.clientX, h = r.touches ? r.touches[0].clientY : r.clientY, d = {
      x: (c - l[0]) / l[2],
      y: (h - l[1]) / l[2]
    };
    return {
      xSnapped: u ? s[0] * Math.round(d.x / s[0]) : d.x,
      ySnapped: u ? s[1] * Math.round(d.y / s[1]) : d.y,
      ...d
    };
  }, []);
}
function y1(e) {
  return (n, r, l) => e?.(n, l);
}
function ap({ nodeRef: e, disabled: n = !1, noDragClassName: r, handleSelector: l, nodeId: s, isSelectable: u, selectNodesOnDrag: c }) {
  const h = Ut(), [d, p] = B.useState(!1), g = B.useRef([]), y = B.useRef({ x: null, y: null }), x = B.useRef(0), w = B.useRef(null), z = B.useRef({ x: 0, y: 0 }), M = B.useRef(null), A = B.useRef(!1), T = B.useRef(!1), R = B.useRef(!1), q = np();
  return B.useEffect(() => {
    if (e?.current) {
      const H = Wn(e.current), $ = ({ x: re, y: te }) => {
        const { nodeInternals: ie, onNodeDrag: ue, onSelectionDrag: de, updateNodePositions: ge, nodeExtent: _, snapGrid: J, snapToGrid: D, nodeOrigin: Y, onError: I } = h.getState();
        y.current = { x: re, y: te };
        let F = !1, le = { x: 0, y: 0, x2: 0, y2: 0 };
        if (g.current.length > 1 && _) {
          const G = zh(g.current, Y);
          le = Sh(G);
        }
        if (g.current = g.current.map((G) => {
          const ae = { x: re - G.distance.x, y: te - G.distance.y };
          D && (ae.x = J[0] * Math.round(ae.x / J[0]), ae.y = J[1] * Math.round(ae.y / J[1]));
          const se = [
            [_[0][0], _[0][1]],
            [_[1][0], _[1][1]]
          ];
          g.current.length > 1 && _ && !G.extent && (se[0][0] = G.positionAbsolute.x - le.x + _[0][0], se[1][0] = G.positionAbsolute.x + (G.width ?? 0) - le.x2 + _[1][0], se[0][1] = G.positionAbsolute.y - le.y + _[0][1], se[1][1] = G.positionAbsolute.y + (G.height ?? 0) - le.y2 + _[1][1]);
          const xe = tp(G, ae, ie, se, Y, I);
          return F = F || G.position.x !== xe.position.x || G.position.y !== xe.position.y, G.position = xe.position, G.positionAbsolute = xe.positionAbsolute, G;
        }), !F)
          return;
        ge(g.current, !0, !0), p(!0);
        const k = s ? ue : y1(de);
        if (k && M.current) {
          const [G, ae] = g1({
            nodeId: s,
            dragItems: g.current,
            nodeInternals: ie
          });
          k(M.current, G, ae);
        }
      }, V = () => {
        if (!w.current)
          return;
        const [re, te] = E6(z.current, w.current);
        if (re !== 0 || te !== 0) {
          const { transform: ie, panBy: ue } = h.getState();
          y.current.x = (y.current.x ?? 0) - re / ie[2], y.current.y = (y.current.y ?? 0) - te / ie[2], ue({ x: re, y: te }) && $(y.current);
        }
        x.current = requestAnimationFrame(V);
      }, Q = (re) => {
        const { nodeInternals: te, multiSelectionActive: ie, nodesDraggable: ue, unselectNodesAndEdges: de, onNodeDragStart: ge, onSelectionDragStart: _ } = h.getState();
        T.current = !0;
        const J = s ? ge : y1(_);
        (!c || !u) && !ie && s && (te.get(s)?.selected || de()), s && u && c && K1({
          id: s,
          store: h,
          nodeRef: e
        });
        const D = q(re);
        if (y.current = D, g.current = Rb(te, ue, D, s), J && g.current) {
          const [Y, I] = g1({
            nodeId: s,
            dragItems: g.current,
            nodeInternals: te
          });
          J(re.sourceEvent, Y, I);
        }
      };
      if (n)
        H.on(".drag", null);
      else {
        const re = o6().on("start", (te) => {
          const { domNode: ie, nodeDragThreshold: ue } = h.getState();
          ue === 0 && Q(te), R.current = !1;
          const de = q(te);
          y.current = de, w.current = ie?.getBoundingClientRect() || null, z.current = X0(te.sourceEvent, w.current);
        }).on("drag", (te) => {
          const ie = q(te), { autoPanOnNodeDrag: ue, nodeDragThreshold: de } = h.getState();
          if (te.sourceEvent.type === "touchmove" && te.sourceEvent.touches.length > 1 && (R.current = !0), !R.current) {
            if (!A.current && T.current && ue && (A.current = !0, V()), !T.current) {
              const ge = ie.xSnapped - (y?.current?.x ?? 0), _ = ie.ySnapped - (y?.current?.y ?? 0);
              Math.sqrt(ge * ge + _ * _) > de && Q(te);
            }
            (y.current.x !== ie.xSnapped || y.current.y !== ie.ySnapped) && g.current && T.current && (M.current = te.sourceEvent, z.current = X0(te.sourceEvent, w.current), $(ie));
          }
        }).on("end", (te) => {
          if (!(!T.current || R.current) && (p(!1), A.current = !1, T.current = !1, cancelAnimationFrame(x.current), g.current)) {
            const { updateNodePositions: ie, nodeInternals: ue, onNodeDragStop: de, onSelectionDragStop: ge } = h.getState(), _ = s ? de : y1(ge);
            if (ie(g.current, !1, !1), _) {
              const [J, D] = g1({
                nodeId: s,
                dragItems: g.current,
                nodeInternals: ue
              });
              _(te.sourceEvent, J, D);
            }
          }
        }).filter((te) => {
          const ie = te.target;
          return !te.button && (!r || !O5(ie, `.${r}`, e)) && (!l || O5(ie, l, e));
        });
        return H.call(re), () => {
          H.on(".drag", null);
        };
      }
    }
  }, [
    e,
    n,
    r,
    l,
    u,
    h,
    s,
    c,
    q
  ]), d;
}
function rp() {
  const e = Ut();
  return B.useCallback((r) => {
    const { nodeInternals: l, nodeExtent: s, updateNodePositions: u, getNodes: c, snapToGrid: h, snapGrid: d, onError: p, nodesDraggable: g } = e.getState(), y = c().filter((R) => R.selected && (R.draggable || g && typeof R.draggable > "u")), x = h ? d[0] : 5, w = h ? d[1] : 5, z = r.isShiftPressed ? 4 : 1, M = r.x * x * z, A = r.y * w * z, T = y.map((R) => {
      if (R.positionAbsolute) {
        const q = { x: R.positionAbsolute.x + M, y: R.positionAbsolute.y + A };
        h && (q.x = d[0] * Math.round(q.x / d[0]), q.y = d[1] * Math.round(q.y / d[1]));
        const { positionAbsolute: H, position: $ } = tp(R, q, l, s, void 0, p);
        R.position = $, R.positionAbsolute = H;
      }
      return R;
    });
    u(T, !0, !1);
  }, []);
}
const wl = {
  ArrowUp: { x: 0, y: -1 },
  ArrowDown: { x: 0, y: 1 },
  ArrowLeft: { x: -1, y: 0 },
  ArrowRight: { x: 1, y: 0 }
};
var Ri = (e) => {
  const n = ({ id: r, type: l, data: s, xPos: u, yPos: c, xPosOrigin: h, yPosOrigin: d, selected: p, onClick: g, onMouseEnter: y, onMouseMove: x, onMouseLeave: w, onContextMenu: z, onDoubleClick: M, style: A, className: T, isDraggable: R, isSelectable: q, isConnectable: H, isFocusable: $, selectNodesOnDrag: V, sourcePosition: Q, targetPosition: re, hidden: te, resizeObserver: ie, dragHandle: ue, zIndex: de, isParent: ge, noDragClassName: _, noPanClassName: J, initialized: D, disableKeyboardA11y: Y, ariaLabel: I, rfId: F, hasHandleBounds: le }) => {
    const k = Ut(), G = B.useRef(null), ae = B.useRef(null), se = B.useRef(Q), xe = B.useRef(re), Te = B.useRef(l), Ae = q || R || g || y || x || w, Re = rp(), Be = _i(r, k.getState, y), Xe = _i(r, k.getState, x), lt = _i(r, k.getState, w), St = _i(r, k.getState, z), be = _i(r, k.getState, M), ye = (je) => {
      const { nodeDragThreshold: Ee } = k.getState();
      if (q && (!V || !R || Ee > 0) && K1({
        id: r,
        store: k,
        nodeRef: G
      }), g) {
        const Oe = k.getState().nodeInternals.get(r);
        Oe && g(je, { ...Oe });
      }
    }, ze = (je) => {
      if (!$1(je) && !Y)
        if (T6.includes(je.key) && q) {
          const Ee = je.key === "Escape";
          K1({
            id: r,
            store: k,
            unselect: Ee,
            nodeRef: G
          });
        } else R && p && Object.prototype.hasOwnProperty.call(wl, je.key) && (k.setState({
          ariaLiveMessage: `Moved selected node ${je.key.replace("Arrow", "").toLowerCase()}. New position, x: ${~~u}, y: ${~~c}`
        }), Re({
          x: wl[je.key].x,
          y: wl[je.key].y,
          isShiftPressed: je.shiftKey
        }));
    };
    B.useEffect(() => () => {
      ae.current && (ie?.unobserve(ae.current), ae.current = null);
    }, []), B.useEffect(() => {
      if (G.current && !te) {
        const je = G.current;
        (!D || !le || ae.current !== je) && (ae.current && ie?.unobserve(ae.current), ie?.observe(je), ae.current = je);
      }
    }, [te, D, le]), B.useEffect(() => {
      const je = Te.current !== l, Ee = se.current !== Q, Oe = xe.current !== re;
      G.current && (je || Ee || Oe) && (je && (Te.current = l), Ee && (se.current = Q), Oe && (xe.current = re), k.getState().updateNodeDimensions([{ id: r, nodeElement: G.current, forceUpdate: !0 }]));
    }, [r, l, Q, re]);
    const _e = ap({
      nodeRef: G,
      disabled: te || !R,
      noDragClassName: _,
      handleSelector: ue,
      nodeId: r,
      isSelectable: q,
      selectNodesOnDrag: V
    });
    return te ? null : ce.createElement(
      "div",
      { className: ln([
        "react-flow__node",
        `react-flow__node-${l}`,
        {
          // this is overwritable by passing `nopan` as a class name
          [J]: R
        },
        T,
        {
          selected: p,
          selectable: q,
          parent: ge,
          dragging: _e
        }
      ]), ref: G, style: {
        zIndex: de,
        transform: `translate(${h}px,${d}px)`,
        pointerEvents: Ae ? "all" : "none",
        visibility: D ? "visible" : "hidden",
        ...A
      }, "data-id": r, "data-testid": `rf__node-${r}`, onMouseEnter: Be, onMouseMove: Xe, onMouseLeave: lt, onContextMenu: St, onClick: ye, onDoubleClick: be, onKeyDown: $ ? ze : void 0, tabIndex: $ ? 0 : void 0, role: $ ? "button" : void 0, "aria-describedby": Y ? void 0 : `${Z6}-${F}`, "aria-label": I },
      ce.createElement(
        Qx,
        { value: r },
        ce.createElement(e, { id: r, data: s, type: l, xPos: u, yPos: c, selected: p, isConnectable: H, sourcePosition: Q, targetPosition: re, dragging: _e, dragHandle: ue, zIndex: de })
      )
    );
  };
  return n.displayName = "NodeWrapper", B.memo(n);
};
const Ob = (e) => {
  const n = e.getNodes().filter((r) => r.selected);
  return {
    ...zh(n, e.nodeOrigin),
    transformString: `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,
    userSelectionActive: e.userSelectionActive
  };
};
function Hb({ onSelectionContextMenu: e, noPanClassName: n, disableKeyboardA11y: r }) {
  const l = Ut(), { width: s, height: u, x: c, y: h, transformString: d, userSelectionActive: p } = pt(Ob, Kt), g = rp(), y = B.useRef(null);
  if (B.useEffect(() => {
    r || y.current?.focus({
      preventScroll: !0
    });
  }, [r]), ap({
    nodeRef: y
  }), p || !s || !u)
    return null;
  const x = e ? (z) => {
    const M = l.getState().getNodes().filter((A) => A.selected);
    e(z, M);
  } : void 0, w = (z) => {
    Object.prototype.hasOwnProperty.call(wl, z.key) && g({
      x: wl[z.key].x,
      y: wl[z.key].y,
      isShiftPressed: z.shiftKey
    });
  };
  return ce.createElement(
    "div",
    { className: ln(["react-flow__nodesselection", "react-flow__container", n]), style: {
      transform: d
    } },
    ce.createElement("div", { ref: y, className: "react-flow__nodesselection-rect", onContextMenu: x, tabIndex: r ? void 0 : -1, onKeyDown: r ? void 0 : w, style: {
      width: s,
      height: u,
      top: h,
      left: c
    } })
  );
}
var Lb = B.memo(Hb);
const qb = (e) => e.nodesSelectionActive, lp = ({ children: e, onPaneClick: n, onPaneMouseEnter: r, onPaneMouseMove: l, onPaneMouseLeave: s, onPaneContextMenu: u, onPaneScroll: c, deleteKeyCode: h, onMove: d, onMoveStart: p, onMoveEnd: g, selectionKeyCode: y, selectionOnDrag: x, selectionMode: w, onSelectionStart: z, onSelectionEnd: M, multiSelectionKeyCode: A, panActivationKeyCode: T, zoomActivationKeyCode: R, elementsSelectable: q, zoomOnScroll: H, zoomOnPinch: $, panOnScroll: V, panOnScrollSpeed: Q, panOnScrollMode: re, zoomOnDoubleClick: te, panOnDrag: ie, defaultViewport: ue, translateExtent: de, minZoom: ge, maxZoom: _, preventScrolling: J, onSelectionContextMenu: D, noWheelClassName: Y, noPanClassName: I, disableKeyboardA11y: F }) => {
  const le = pt(qb), k = Zi(y), G = Zi(T), ae = G || ie, se = G || V, xe = k || x && ae !== !0;
  return Mb({ deleteKeyCode: h, multiSelectionKeyCode: A }), ce.createElement(
    Cb,
    { onMove: d, onMoveStart: p, onMoveEnd: g, onPaneContextMenu: u, elementsSelectable: q, zoomOnScroll: H, zoomOnPinch: $, panOnScroll: se, panOnScrollSpeed: Q, panOnScrollMode: re, zoomOnDoubleClick: te, panOnDrag: !k && ae, defaultViewport: ue, translateExtent: de, minZoom: ge, maxZoom: _, zoomActivationKeyCode: R, preventScrolling: J, noWheelClassName: Y, noPanClassName: I },
    ce.createElement(
      P6,
      { onSelectionStart: z, onSelectionEnd: M, onPaneClick: n, onPaneMouseEnter: r, onPaneMouseMove: l, onPaneMouseLeave: s, onPaneContextMenu: u, onPaneScroll: c, panOnDrag: ae, isSelecting: !!xe, selectionMode: w },
      e,
      le && ce.createElement(Lb, { onSelectionContextMenu: D, noPanClassName: I, disableKeyboardA11y: F })
    )
  );
};
lp.displayName = "FlowRenderer";
var Ub = B.memo(lp);
function jb(e) {
  return pt(B.useCallback((r) => e ? R6(r.nodeInternals, { x: 0, y: 0, width: r.width, height: r.height }, r.transform, !0) : r.getNodes(), [e]));
}
function Vb(e) {
  const n = {
    input: Ri(e.input || Y6),
    default: Ri(e.default || I1),
    output: Ri(e.output || X6),
    group: Ri(e.group || Ch)
  }, r = {}, l = Object.keys(e).filter((s) => !["input", "default", "output", "group"].includes(s)).reduce((s, u) => (s[u] = Ri(e[u] || I1), s), r);
  return {
    ...n,
    ...l
  };
}
const Yb = ({ x: e, y: n, width: r, height: l, origin: s }) => !r || !l ? { x: e, y: n } : s[0] < 0 || s[1] < 0 || s[0] > 1 || s[1] > 1 ? { x: e, y: n } : {
  x: e - r * s[0],
  y: n - l * s[1]
}, Gb = (e) => ({
  nodesDraggable: e.nodesDraggable,
  nodesConnectable: e.nodesConnectable,
  nodesFocusable: e.nodesFocusable,
  elementsSelectable: e.elementsSelectable,
  updateNodeDimensions: e.updateNodeDimensions,
  onError: e.onError
}), ip = (e) => {
  const { nodesDraggable: n, nodesConnectable: r, nodesFocusable: l, elementsSelectable: s, updateNodeDimensions: u, onError: c } = pt(Gb, Kt), h = jb(e.onlyRenderVisibleElements), d = B.useRef(), p = B.useMemo(() => {
    if (typeof ResizeObserver > "u")
      return null;
    const g = new ResizeObserver((y) => {
      const x = y.map((w) => ({
        id: w.target.getAttribute("data-id"),
        nodeElement: w.target,
        forceUpdate: !0
      }));
      u(x);
    });
    return d.current = g, g;
  }, []);
  return B.useEffect(() => () => {
    d?.current?.disconnect();
  }, []), ce.createElement("div", { className: "react-flow__nodes", style: Nh }, h.map((g) => {
    let y = g.type || "default";
    e.nodeTypes[y] || (c?.("003", a0.error003(y)), y = "default");
    const x = e.nodeTypes[y] || e.nodeTypes.default, w = !!(g.draggable || n && typeof g.draggable > "u"), z = !!(g.selectable || s && typeof g.selectable > "u"), M = !!(g.connectable || r && typeof g.connectable > "u"), A = !!(g.focusable || l && typeof g.focusable > "u"), T = e.nodeExtent ? bh(g.positionAbsolute, e.nodeExtent) : g.positionAbsolute, R = T?.x ?? 0, q = T?.y ?? 0, H = Yb({
      x: R,
      y: q,
      width: g.width ?? 0,
      height: g.height ?? 0,
      origin: e.nodeOrigin
    });
    return ce.createElement(x, { key: g.id, id: g.id, className: g.className, style: g.style, type: y, data: g.data, sourcePosition: g.sourcePosition || he.Bottom, targetPosition: g.targetPosition || he.Top, hidden: g.hidden, xPos: R, yPos: q, xPosOrigin: H.x, yPosOrigin: H.y, selectNodesOnDrag: e.selectNodesOnDrag, onClick: e.onNodeClick, onMouseEnter: e.onNodeMouseEnter, onMouseMove: e.onNodeMouseMove, onMouseLeave: e.onNodeMouseLeave, onContextMenu: e.onNodeContextMenu, onDoubleClick: e.onNodeDoubleClick, selected: !!g.selected, isDraggable: w, isSelectable: z, isConnectable: M, isFocusable: A, resizeObserver: p, dragHandle: g.dragHandle, zIndex: g[Nt]?.z ?? 0, isParent: !!g[Nt]?.isParent, noDragClassName: e.noDragClassName, noPanClassName: e.noPanClassName, initialized: !!g.width && !!g.height, rfId: e.rfId, disableKeyboardA11y: e.disableKeyboardA11y, ariaLabel: g.ariaLabel, hasHandleBounds: !!g[Nt]?.handleBounds });
  }));
};
ip.displayName = "NodeRenderer";
var Xb = B.memo(ip);
const $b = (e, n, r) => r === he.Left ? e - n : r === he.Right ? e + n : e, Zb = (e, n, r) => r === he.Top ? e - n : r === he.Bottom ? e + n : e, L5 = "react-flow__edgeupdater", q5 = ({ position: e, centerX: n, centerY: r, radius: l = 10, onMouseDown: s, onMouseEnter: u, onMouseOut: c, type: h }) => ce.createElement("circle", { onMouseDown: s, onMouseEnter: u, onMouseOut: c, className: ln([L5, `${L5}-${h}`]), cx: $b(n, l, e), cy: Zb(r, l, e), r: l, stroke: "transparent", fill: "transparent" }), Fb = () => !0;
var dl = (e) => {
  const n = ({ id: r, className: l, type: s, data: u, onClick: c, onEdgeDoubleClick: h, selected: d, animated: p, label: g, labelStyle: y, labelShowBg: x, labelBgStyle: w, labelBgPadding: z, labelBgBorderRadius: M, style: A, source: T, target: R, sourceX: q, sourceY: H, targetX: $, targetY: V, sourcePosition: Q, targetPosition: re, elementsSelectable: te, hidden: ie, sourceHandleId: ue, targetHandleId: de, onContextMenu: ge, onMouseEnter: _, onMouseMove: J, onMouseLeave: D, reconnectRadius: Y, onReconnect: I, onReconnectStart: F, onReconnectEnd: le, markerEnd: k, markerStart: G, rfId: ae, ariaLabel: se, isFocusable: xe, isReconnectable: Te, pathOptions: Ae, interactionWidth: Re, disableKeyboardA11y: Be }) => {
    const Xe = B.useRef(null), [lt, St] = B.useState(!1), [be, ye] = B.useState(!1), ze = Ut(), _e = B.useMemo(() => `url('#${Z1(G, ae)}')`, [G, ae]), je = B.useMemo(() => `url('#${Z1(k, ae)}')`, [k, ae]);
    if (ie)
      return null;
    const Ee = (Ft) => {
      const { edges: Vn, addSelectedEdges: An, unselectNodesAndEdges: kt, multiSelectionActive: sn } = ze.getState(), vt = Vn.find((Ca) => Ca.id === r);
      vt && (te && (ze.setState({ nodesSelectionActive: !1 }), vt.selected && sn ? (kt({ nodes: [], edges: [vt] }), Xe.current?.blur()) : An([r])), c && c(Ft, vt));
    }, Oe = Di(r, ze.getState, h), ot = Di(r, ze.getState, ge), wt = Di(r, ze.getState, _), Vt = Di(r, ze.getState, J), mn = Di(r, ze.getState, D), We = (Ft, Vn) => {
      if (Ft.button !== 0)
        return;
      const { edges: An, isValidConnection: kt } = ze.getState(), sn = Vn ? R : T, vt = (Vn ? de : ue) || null, Ca = Vn ? "target" : "source", _l = kt || Fb, Rl = Vn, fa = An.find((on) => on.id === r);
      ye(!0), F?.(Ft, fa, Ca);
      const u0 = (on) => {
        ye(!1), le?.(on, fa, Ca);
      };
      q6({
        event: Ft,
        handleId: vt,
        nodeId: sn,
        onConnect: (on) => I?.(fa, on),
        isTarget: Rl,
        getState: ze.getState,
        setState: ze.setState,
        isValidConnection: _l,
        edgeUpdaterType: Ca,
        onReconnectEnd: u0
      });
    }, Yt = (Ft) => We(Ft, !0), Zt = (Ft) => We(Ft, !1), tn = () => St(!0), nn = () => St(!1), jn = !te && !c, o0 = (Ft) => {
      if (!Be && T6.includes(Ft.key) && te) {
        const { unselectNodesAndEdges: Vn, addSelectedEdges: An, edges: kt } = ze.getState();
        Ft.key === "Escape" ? (Xe.current?.blur(), Vn({ edges: [kt.find((vt) => vt.id === r)] })) : An([r]);
      }
    };
    return ce.createElement(
      "g",
      { className: ln([
        "react-flow__edge",
        `react-flow__edge-${s}`,
        l,
        { selected: d, animated: p, inactive: jn, updating: lt }
      ]), onClick: Ee, onDoubleClick: Oe, onContextMenu: ot, onMouseEnter: wt, onMouseMove: Vt, onMouseLeave: mn, onKeyDown: xe ? o0 : void 0, tabIndex: xe ? 0 : void 0, role: xe ? "button" : "img", "data-testid": `rf__edge-${r}`, "aria-label": se === null ? void 0 : se || `Edge from ${T} to ${R}`, "aria-describedby": xe ? `${F6}-${ae}` : void 0, ref: Xe },
      !be && ce.createElement(e, { id: r, source: T, target: R, selected: d, animated: p, label: g, labelStyle: y, labelShowBg: x, labelBgStyle: w, labelBgPadding: z, labelBgBorderRadius: M, data: u, style: A, sourceX: q, sourceY: H, targetX: $, targetY: V, sourcePosition: Q, targetPosition: re, sourceHandleId: ue, targetHandleId: de, markerStart: _e, markerEnd: je, pathOptions: Ae, interactionWidth: Re }),
      Te && ce.createElement(
        ce.Fragment,
        null,
        (Te === "source" || Te === !0) && ce.createElement(q5, { position: Q, centerX: q, centerY: H, radius: Y, onMouseDown: Yt, onMouseEnter: tn, onMouseOut: nn, type: "source" }),
        (Te === "target" || Te === !0) && ce.createElement(q5, { position: re, centerX: $, centerY: V, radius: Y, onMouseDown: Zt, onMouseEnter: tn, onMouseOut: nn, type: "target" })
      )
    );
  };
  return n.displayName = "EdgeWrapper", B.memo(n);
};
function Ib(e) {
  const n = {
    default: dl(e.default || hu),
    straight: dl(e.bezier || Mh),
    step: dl(e.step || Eh),
    smoothstep: dl(e.step || Nu),
    simplebezier: dl(e.simplebezier || wh)
  }, r = {}, l = Object.keys(e).filter((s) => !["default", "bezier"].includes(s)).reduce((s, u) => (s[u] = dl(e[u] || hu), s), r);
  return {
    ...n,
    ...l
  };
}
function U5(e, n, r = null) {
  const l = (r?.x || 0) + n.x, s = (r?.y || 0) + n.y, u = r?.width || n.width, c = r?.height || n.height;
  switch (e) {
    case he.Top:
      return {
        x: l + u / 2,
        y: s
      };
    case he.Right:
      return {
        x: l + u,
        y: s + c / 2
      };
    case he.Bottom:
      return {
        x: l + u / 2,
        y: s + c
      };
    case he.Left:
      return {
        x: l,
        y: s + c / 2
      };
  }
}
function j5(e, n) {
  return e ? e.length === 1 || !n ? e[0] : n && e.find((r) => r.id === n) || null : null;
}
const Kb = (e, n, r, l, s, u) => {
  const c = U5(r, e, n), h = U5(u, l, s);
  return {
    sourceX: c.x,
    sourceY: c.y,
    targetX: h.x,
    targetY: h.y
  };
};
function Qb({ sourcePos: e, targetPos: n, sourceWidth: r, sourceHeight: l, targetWidth: s, targetHeight: u, width: c, height: h, transform: d }) {
  const p = {
    x: Math.min(e.x, n.x),
    y: Math.min(e.y, n.y),
    x2: Math.max(e.x + r, n.x + s),
    y2: Math.max(e.y + l, n.y + u)
  };
  p.x === p.x2 && (p.x2 += 1), p.y === p.y2 && (p.y2 += 1);
  const g = Sh({
    x: (0 - d[0]) / d[2],
    y: (0 - d[1]) / d[2],
    width: c / d[2],
    height: h / d[2]
  }), y = Math.max(0, Math.min(g.x2, p.x2) - Math.max(g.x, p.x)), x = Math.max(0, Math.min(g.y2, p.y2) - Math.max(g.y, p.y));
  return Math.ceil(y * x) > 0;
}
function V5(e) {
  const n = e?.[Nt]?.handleBounds || null, r = n && e?.width && e?.height && typeof e?.positionAbsolute?.x < "u" && typeof e?.positionAbsolute?.y < "u";
  return [
    {
      x: e?.positionAbsolute?.x || 0,
      y: e?.positionAbsolute?.y || 0,
      width: e?.width || 0,
      height: e?.height || 0
    },
    n,
    !!r
  ];
}
const Jb = [{ level: 0, isMaxLevel: !0, edges: [] }];
function Wb(e, n, r = !1) {
  let l = -1;
  const s = e.reduce((c, h) => {
    const d = Pn(h.zIndex);
    let p = d ? h.zIndex : 0;
    if (r) {
      const g = n.get(h.target), y = n.get(h.source), x = h.selected || g?.selected || y?.selected, w = Math.max(y?.[Nt]?.z || 0, g?.[Nt]?.z || 0, 1e3);
      p = (d ? h.zIndex : 0) + (x ? w : 0);
    }
    return c[p] ? c[p].push(h) : c[p] = [h], l = p > l ? p : l, c;
  }, {}), u = Object.entries(s).map(([c, h]) => {
    const d = +c;
    return {
      edges: h,
      level: d,
      isMaxLevel: d === l
    };
  });
  return u.length === 0 ? Jb : u;
}
function Pb(e, n, r) {
  const l = pt(B.useCallback((s) => e ? s.edges.filter((u) => {
    const c = n.get(u.source), h = n.get(u.target);
    return c?.width && c?.height && h?.width && h?.height && Qb({
      sourcePos: c.positionAbsolute || { x: 0, y: 0 },
      targetPos: h.positionAbsolute || { x: 0, y: 0 },
      sourceWidth: c.width,
      sourceHeight: c.height,
      targetWidth: h.width,
      targetHeight: h.height,
      width: s.width,
      height: s.height,
      transform: s.transform
    });
  }) : s.edges, [e, n]));
  return Wb(l, n, r);
}
const eS = ({ color: e = "none", strokeWidth: n = 1 }) => ce.createElement("polyline", { style: {
  stroke: e,
  strokeWidth: n
}, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" }), tS = ({ color: e = "none", strokeWidth: n = 1 }) => ce.createElement("polyline", { style: {
  stroke: e,
  fill: e,
  strokeWidth: n
}, strokeLinecap: "round", strokeLinejoin: "round", points: "-5,-4 0,0 -5,4 -5,-4" }), Y5 = {
  [cu.Arrow]: eS,
  [cu.ArrowClosed]: tS
};
function nS(e) {
  const n = Ut();
  return B.useMemo(() => Object.prototype.hasOwnProperty.call(Y5, e) ? Y5[e] : (n.getState().onError?.("009", a0.error009(e)), null), [e]);
}
const aS = ({ id: e, type: n, color: r, width: l = 12.5, height: s = 12.5, markerUnits: u = "strokeWidth", strokeWidth: c, orient: h = "auto-start-reverse" }) => {
  const d = nS(n);
  return d ? ce.createElement(
    "marker",
    { className: "react-flow__arrowhead", id: e, markerWidth: `${l}`, markerHeight: `${s}`, viewBox: "-10 -10 20 20", markerUnits: u, orient: h, refX: "0", refY: "0" },
    ce.createElement(d, { color: r, strokeWidth: c })
  ) : null;
}, rS = ({ defaultColor: e, rfId: n }) => (r) => {
  const l = [];
  return r.edges.reduce((s, u) => ([u.markerStart, u.markerEnd].forEach((c) => {
    if (c && typeof c == "object") {
      const h = Z1(c, n);
      l.includes(h) || (s.push({ id: h, color: c.color || e, ...c }), l.push(h));
    }
  }), s), []).sort((s, u) => s.id.localeCompare(u.id));
}, sp = ({ defaultColor: e, rfId: n }) => {
  const r = pt(
    B.useCallback(rS({ defaultColor: e, rfId: n }), [e, n]),
    // the id includes all marker options, so we just need to look at that part of the marker
    (l, s) => !(l.length !== s.length || l.some((u, c) => u.id !== s[c].id))
  );
  return ce.createElement("defs", null, r.map((l) => ce.createElement(aS, { id: l.id, key: l.id, type: l.type, color: l.color, width: l.width, height: l.height, markerUnits: l.markerUnits, strokeWidth: l.strokeWidth, orient: l.orient })));
};
sp.displayName = "MarkerDefinitions";
var lS = B.memo(sp);
const iS = (e) => ({
  nodesConnectable: e.nodesConnectable,
  edgesFocusable: e.edgesFocusable,
  edgesUpdatable: e.edgesUpdatable,
  elementsSelectable: e.elementsSelectable,
  width: e.width,
  height: e.height,
  connectionMode: e.connectionMode,
  nodeInternals: e.nodeInternals,
  onError: e.onError
}), op = ({ defaultMarkerColor: e, onlyRenderVisibleElements: n, elevateEdgesOnSelect: r, rfId: l, edgeTypes: s, noPanClassName: u, onEdgeContextMenu: c, onEdgeMouseEnter: h, onEdgeMouseMove: d, onEdgeMouseLeave: p, onEdgeClick: g, onEdgeDoubleClick: y, onReconnect: x, onReconnectStart: w, onReconnectEnd: z, reconnectRadius: M, children: A, disableKeyboardA11y: T }) => {
  const { edgesFocusable: R, edgesUpdatable: q, elementsSelectable: H, width: $, height: V, connectionMode: Q, nodeInternals: re, onError: te } = pt(iS, Kt), ie = Pb(n, re, r);
  return $ ? ce.createElement(
    ce.Fragment,
    null,
    ie.map(({ level: ue, edges: de, isMaxLevel: ge }) => ce.createElement(
      "svg",
      { key: ue, style: { zIndex: ue }, width: $, height: V, className: "react-flow__edges react-flow__container" },
      ge && ce.createElement(lS, { defaultColor: e, rfId: l }),
      ce.createElement("g", null, de.map((_) => {
        const [J, D, Y] = V5(re.get(_.source)), [I, F, le] = V5(re.get(_.target));
        if (!Y || !le)
          return null;
        let k = _.type || "default";
        s[k] || (te?.("011", a0.error011(k)), k = "default");
        const G = s[k] || s.default, ae = Q === Cr.Strict ? F.target : (F.target ?? []).concat(F.source ?? []), se = j5(D.source, _.sourceHandle), xe = j5(ae, _.targetHandle), Te = se?.position || he.Bottom, Ae = xe?.position || he.Top, Re = !!(_.focusable || R && typeof _.focusable > "u"), Be = _.reconnectable || _.updatable, Xe = typeof x < "u" && (Be || q && typeof Be > "u");
        if (!se || !xe)
          return te?.("008", a0.error008(se, _)), null;
        const { sourceX: lt, sourceY: St, targetX: be, targetY: ye } = Kb(J, se, Te, I, xe, Ae);
        return ce.createElement(G, { key: _.id, id: _.id, className: ln([_.className, u]), type: k, data: _.data, selected: !!_.selected, animated: !!_.animated, hidden: !!_.hidden, label: _.label, labelStyle: _.labelStyle, labelShowBg: _.labelShowBg, labelBgStyle: _.labelBgStyle, labelBgPadding: _.labelBgPadding, labelBgBorderRadius: _.labelBgBorderRadius, style: _.style, source: _.source, target: _.target, sourceHandleId: _.sourceHandle, targetHandleId: _.targetHandle, markerEnd: _.markerEnd, markerStart: _.markerStart, sourceX: lt, sourceY: St, targetX: be, targetY: ye, sourcePosition: Te, targetPosition: Ae, elementsSelectable: H, onContextMenu: c, onMouseEnter: h, onMouseMove: d, onMouseLeave: p, onClick: g, onEdgeDoubleClick: y, onReconnect: x, onReconnectStart: w, onReconnectEnd: z, reconnectRadius: M, rfId: l, ariaLabel: _.ariaLabel, isFocusable: Re, isReconnectable: Xe, pathOptions: "pathOptions" in _ ? _.pathOptions : void 0, interactionWidth: _.interactionWidth, disableKeyboardA11y: T });
      }))
    )),
    A
  ) : null;
};
op.displayName = "EdgeRenderer";
var sS = B.memo(op);
const oS = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
function uS({ children: e }) {
  const n = pt(oS);
  return ce.createElement("div", { className: "react-flow__viewport react-flow__container", style: { transform: n } }, e);
}
function cS(e) {
  const n = Wi(), r = B.useRef(!1);
  B.useEffect(() => {
    !r.current && n.viewportInitialized && e && (setTimeout(() => e(n), 1), r.current = !0);
  }, [e, n.viewportInitialized]);
}
const fS = {
  [he.Left]: he.Right,
  [he.Right]: he.Left,
  [he.Top]: he.Bottom,
  [he.Bottom]: he.Top
}, up = ({ nodeId: e, handleType: n, style: r, type: l = V0.Bezier, CustomComponent: s, connectionStatus: u }) => {
  const { fromNode: c, handleId: h, toX: d, toY: p, connectionMode: g } = pt(B.useCallback((V) => ({
    fromNode: V.nodeInternals.get(e),
    handleId: V.connectionHandleId,
    toX: (V.connectionPosition.x - V.transform[0]) / V.transform[2],
    toY: (V.connectionPosition.y - V.transform[1]) / V.transform[2],
    connectionMode: V.connectionMode
  }), [e]), Kt), y = c?.[Nt]?.handleBounds;
  let x = y?.[n];
  if (g === Cr.Loose && (x = x || y?.[n === "source" ? "target" : "source"]), !c || !x)
    return null;
  const w = h ? x.find((V) => V.id === h) : x[0], z = w ? w.x + w.width / 2 : (c.width ?? 0) / 2, M = w ? w.y + w.height / 2 : c.height ?? 0, A = (c.positionAbsolute?.x ?? 0) + z, T = (c.positionAbsolute?.y ?? 0) + M, R = w?.position, q = R ? fS[R] : null;
  if (!R || !q)
    return null;
  if (s)
    return ce.createElement(s, { connectionLineType: l, connectionLineStyle: r, fromNode: c, fromHandle: w, fromX: A, fromY: T, toX: d, toY: p, fromPosition: R, toPosition: q, connectionStatus: u });
  let H = "";
  const $ = {
    sourceX: A,
    sourceY: T,
    sourcePosition: R,
    targetX: d,
    targetY: p,
    targetPosition: q
  };
  return l === V0.Bezier ? [H] = k6($) : l === V0.Step ? [H] = fu({
    ...$,
    borderRadius: 0
  }) : l === V0.SmoothStep ? [H] = fu($) : l === V0.SimpleBezier ? [H] = N6($) : H = `M${A},${T} ${d},${p}`, ce.createElement("path", { d: H, fill: "none", className: "react-flow__connection-path", style: r });
};
up.displayName = "ConnectionLine";
const hS = (e) => ({
  nodeId: e.connectionNodeId,
  handleType: e.connectionHandleType,
  nodesConnectable: e.nodesConnectable,
  connectionStatus: e.connectionStatus,
  width: e.width,
  height: e.height
});
function dS({ containerStyle: e, style: n, type: r, component: l }) {
  const { nodeId: s, handleType: u, nodesConnectable: c, width: h, height: d, connectionStatus: p } = pt(hS, Kt);
  return !(s && u && h && c) ? null : ce.createElement(
    "svg",
    { style: e, width: h, height: d, className: "react-flow__edges react-flow__connectionline react-flow__container" },
    ce.createElement(
      "g",
      { className: ln(["react-flow__connection", p]) },
      ce.createElement(up, { nodeId: s, handleType: u, style: n, type: r, CustomComponent: l, connectionStatus: p })
    )
  );
}
function G5(e, n) {
  return B.useRef(null), Ut(), B.useMemo(() => n(e), [e]);
}
const cp = ({ nodeTypes: e, edgeTypes: n, onMove: r, onMoveStart: l, onMoveEnd: s, onInit: u, onNodeClick: c, onEdgeClick: h, onNodeDoubleClick: d, onEdgeDoubleClick: p, onNodeMouseEnter: g, onNodeMouseMove: y, onNodeMouseLeave: x, onNodeContextMenu: w, onSelectionContextMenu: z, onSelectionStart: M, onSelectionEnd: A, connectionLineType: T, connectionLineStyle: R, connectionLineComponent: q, connectionLineContainerStyle: H, selectionKeyCode: $, selectionOnDrag: V, selectionMode: Q, multiSelectionKeyCode: re, panActivationKeyCode: te, zoomActivationKeyCode: ie, deleteKeyCode: ue, onlyRenderVisibleElements: de, elementsSelectable: ge, selectNodesOnDrag: _, defaultViewport: J, translateExtent: D, minZoom: Y, maxZoom: I, preventScrolling: F, defaultMarkerColor: le, zoomOnScroll: k, zoomOnPinch: G, panOnScroll: ae, panOnScrollSpeed: se, panOnScrollMode: xe, zoomOnDoubleClick: Te, panOnDrag: Ae, onPaneClick: Re, onPaneMouseEnter: Be, onPaneMouseMove: Xe, onPaneMouseLeave: lt, onPaneScroll: St, onPaneContextMenu: be, onEdgeContextMenu: ye, onEdgeMouseEnter: ze, onEdgeMouseMove: _e, onEdgeMouseLeave: je, onReconnect: Ee, onReconnectStart: Oe, onReconnectEnd: ot, reconnectRadius: wt, noDragClassName: Vt, noWheelClassName: mn, noPanClassName: We, elevateEdgesOnSelect: Yt, disableKeyboardA11y: Zt, nodeOrigin: tn, nodeExtent: nn, rfId: jn }) => {
  const o0 = G5(e, Vb), Ft = G5(n, Ib);
  return cS(u), ce.createElement(
    Ub,
    { onPaneClick: Re, onPaneMouseEnter: Be, onPaneMouseMove: Xe, onPaneMouseLeave: lt, onPaneContextMenu: be, onPaneScroll: St, deleteKeyCode: ue, selectionKeyCode: $, selectionOnDrag: V, selectionMode: Q, onSelectionStart: M, onSelectionEnd: A, multiSelectionKeyCode: re, panActivationKeyCode: te, zoomActivationKeyCode: ie, elementsSelectable: ge, onMove: r, onMoveStart: l, onMoveEnd: s, zoomOnScroll: k, zoomOnPinch: G, zoomOnDoubleClick: Te, panOnScroll: ae, panOnScrollSpeed: se, panOnScrollMode: xe, panOnDrag: Ae, defaultViewport: J, translateExtent: D, minZoom: Y, maxZoom: I, onSelectionContextMenu: z, preventScrolling: F, noDragClassName: Vt, noWheelClassName: mn, noPanClassName: We, disableKeyboardA11y: Zt },
    ce.createElement(
      uS,
      null,
      ce.createElement(
        sS,
        { edgeTypes: Ft, onEdgeClick: h, onEdgeDoubleClick: p, onlyRenderVisibleElements: de, onEdgeContextMenu: ye, onEdgeMouseEnter: ze, onEdgeMouseMove: _e, onEdgeMouseLeave: je, onReconnect: Ee, onReconnectStart: Oe, onReconnectEnd: ot, reconnectRadius: wt, defaultMarkerColor: le, noPanClassName: We, elevateEdgesOnSelect: !!Yt, disableKeyboardA11y: Zt, rfId: jn },
        ce.createElement(dS, { style: R, type: T, component: q, containerStyle: H })
      ),
      ce.createElement("div", { className: "react-flow__edgelabel-renderer" }),
      ce.createElement(Xb, { nodeTypes: o0, onNodeClick: c, onNodeDoubleClick: d, onNodeMouseEnter: g, onNodeMouseMove: y, onNodeMouseLeave: x, onNodeContextMenu: w, selectNodesOnDrag: _, onlyRenderVisibleElements: de, noPanClassName: We, noDragClassName: Vt, disableKeyboardA11y: Zt, nodeOrigin: tn, nodeExtent: nn, rfId: jn })
    )
  );
};
cp.displayName = "GraphView";
var mS = B.memo(cp);
const Q1 = [
  [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
  [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]
], H0 = {
  rfId: "1",
  width: 0,
  height: 0,
  transform: [0, 0, 1],
  nodeInternals: /* @__PURE__ */ new Map(),
  edges: [],
  onNodesChange: null,
  onEdgesChange: null,
  hasDefaultNodes: !1,
  hasDefaultEdges: !1,
  d3Zoom: null,
  d3Selection: null,
  d3ZoomHandler: void 0,
  minZoom: 0.5,
  maxZoom: 2,
  translateExtent: Q1,
  nodeExtent: Q1,
  nodesSelectionActive: !1,
  userSelectionActive: !1,
  userSelectionRect: null,
  connectionNodeId: null,
  connectionHandleId: null,
  connectionHandleType: "source",
  connectionPosition: { x: 0, y: 0 },
  connectionStatus: null,
  connectionMode: Cr.Strict,
  domNode: null,
  paneDragging: !1,
  noPanClassName: "nopan",
  nodeOrigin: [0, 0],
  nodeDragThreshold: 0,
  snapGrid: [15, 15],
  snapToGrid: !1,
  nodesDraggable: !0,
  nodesConnectable: !0,
  nodesFocusable: !0,
  edgesFocusable: !0,
  edgesUpdatable: !0,
  elementsSelectable: !0,
  elevateNodesOnSelect: !0,
  fitViewOnInit: !1,
  fitViewOnInitDone: !1,
  fitViewOnInitOptions: void 0,
  onSelectionChange: [],
  multiSelectionActive: !1,
  connectionStartHandle: null,
  connectionEndHandle: null,
  connectionClickStartHandle: null,
  connectOnClick: !0,
  ariaLiveMessage: "",
  autoPanOnConnect: !0,
  autoPanOnNodeDrag: !0,
  connectionRadius: 20,
  onError: Xx,
  isValidConnection: void 0
}, pS = () => ay((e, n) => ({
  ...H0,
  setNodes: (r) => {
    const { nodeInternals: l, nodeOrigin: s, elevateNodesOnSelect: u } = n();
    e({ nodeInternals: m1(r, l, s, u) });
  },
  getNodes: () => Array.from(n().nodeInternals.values()),
  setEdges: (r) => {
    const { defaultEdgeOptions: l = {} } = n();
    e({ edges: r.map((s) => ({ ...l, ...s })) });
  },
  setDefaultNodesAndEdges: (r, l) => {
    const s = typeof r < "u", u = typeof l < "u", c = s ? m1(r, /* @__PURE__ */ new Map(), n().nodeOrigin, n().elevateNodesOnSelect) : /* @__PURE__ */ new Map();
    e({ nodeInternals: c, edges: u ? l : [], hasDefaultNodes: s, hasDefaultEdges: u });
  },
  updateNodeDimensions: (r) => {
    const { onNodesChange: l, nodeInternals: s, fitViewOnInit: u, fitViewOnInitDone: c, fitViewOnInitOptions: h, domNode: d, nodeOrigin: p } = n(), g = d?.querySelector(".react-flow__viewport");
    if (!g)
      return;
    const y = window.getComputedStyle(g), { m22: x } = new window.DOMMatrixReadOnly(y.transform), w = r.reduce((M, A) => {
      const T = s.get(A.id);
      if (T?.hidden)
        s.set(T.id, {
          ...T,
          [Nt]: {
            ...T[Nt],
            // we need to reset the handle bounds when the node is hidden
            // in order to force a new observation when the node is shown again
            handleBounds: void 0
          }
        });
      else if (T) {
        const R = xh(A.nodeElement);
        R.width && R.height && (T.width !== R.width || T.height !== R.height || A.forceUpdate) && (s.set(T.id, {
          ...T,
          [Nt]: {
            ...T[Nt],
            handleBounds: {
              source: H5(".source", A.nodeElement, x, p),
              target: H5(".target", A.nodeElement, x, p)
            }
          },
          ...R
        }), M.push({
          id: T.id,
          type: "dimensions",
          dimensions: R
        }));
      }
      return M;
    }, []);
    K6(s, p);
    const z = c || u && !c && Q6(n, { initial: !0, ...h });
    e({ nodeInternals: new Map(s), fitViewOnInitDone: z }), w?.length > 0 && l?.(w);
  },
  updateNodePositions: (r, l = !0, s = !1) => {
    const { triggerNodeChanges: u } = n(), c = r.map((h) => {
      const d = {
        id: h.id,
        type: "position",
        dragging: s
      };
      return l && (d.positionAbsolute = h.positionAbsolute, d.position = h.position), d;
    });
    u(c);
  },
  triggerNodeChanges: (r) => {
    const { onNodesChange: l, nodeInternals: s, hasDefaultNodes: u, nodeOrigin: c, getNodes: h, elevateNodesOnSelect: d } = n();
    if (r?.length) {
      if (u) {
        const p = W6(r, h()), g = m1(p, s, c, d);
        e({ nodeInternals: g });
      }
      l?.(r);
    }
  },
  addSelectedNodes: (r) => {
    const { multiSelectionActive: l, edges: s, getNodes: u } = n();
    let c, h = null;
    l ? c = r.map((d) => j0(d, !0)) : (c = yl(u(), r), h = yl(s, [])), qo({
      changedNodes: c,
      changedEdges: h,
      get: n,
      set: e
    });
  },
  addSelectedEdges: (r) => {
    const { multiSelectionActive: l, edges: s, getNodes: u } = n();
    let c, h = null;
    l ? c = r.map((d) => j0(d, !0)) : (c = yl(s, r), h = yl(u(), [])), qo({
      changedNodes: h,
      changedEdges: c,
      get: n,
      set: e
    });
  },
  unselectNodesAndEdges: ({ nodes: r, edges: l } = {}) => {
    const { edges: s, getNodes: u } = n(), c = r || u(), h = l || s, d = c.map((g) => (g.selected = !1, j0(g.id, !1))), p = h.map((g) => j0(g.id, !1));
    qo({
      changedNodes: d,
      changedEdges: p,
      get: n,
      set: e
    });
  },
  setMinZoom: (r) => {
    const { d3Zoom: l, maxZoom: s } = n();
    l?.scaleExtent([r, s]), e({ minZoom: r });
  },
  setMaxZoom: (r) => {
    const { d3Zoom: l, minZoom: s } = n();
    l?.scaleExtent([s, r]), e({ maxZoom: r });
  },
  setTranslateExtent: (r) => {
    n().d3Zoom?.translateExtent(r), e({ translateExtent: r });
  },
  resetSelectedElements: () => {
    const { edges: r, getNodes: l } = n(), u = l().filter((h) => h.selected).map((h) => j0(h.id, !1)), c = r.filter((h) => h.selected).map((h) => j0(h.id, !1));
    qo({
      changedNodes: u,
      changedEdges: c,
      get: n,
      set: e
    });
  },
  setNodeExtent: (r) => {
    const { nodeInternals: l } = n();
    l.forEach((s) => {
      s.positionAbsolute = bh(s.position, r);
    }), e({
      nodeExtent: r,
      nodeInternals: new Map(l)
    });
  },
  panBy: (r) => {
    const { transform: l, width: s, height: u, d3Zoom: c, d3Selection: h, translateExtent: d } = n();
    if (!c || !h || !r.x && !r.y)
      return !1;
    const p = G0.translate(l[0] + r.x, l[1] + r.y).scale(l[2]), g = [
      [0, 0],
      [s, u]
    ], y = c?.constrain()(p, g, d);
    return c.transform(h, y), l[0] !== y.x || l[1] !== y.y || l[2] !== y.k;
  },
  cancelConnection: () => e({
    connectionNodeId: H0.connectionNodeId,
    connectionHandleId: H0.connectionHandleId,
    connectionHandleType: H0.connectionHandleType,
    connectionStatus: H0.connectionStatus,
    connectionStartHandle: H0.connectionStartHandle,
    connectionEndHandle: H0.connectionEndHandle
  }),
  reset: () => e({ ...H0 })
}), Object.is), kh = ({ children: e }) => {
  const n = B.useRef(null);
  return n.current || (n.current = pS()), ce.createElement(Hx, { value: n.current }, e);
};
kh.displayName = "ReactFlowProvider";
const fp = ({ children: e }) => B.useContext(Cu) ? ce.createElement(ce.Fragment, null, e) : ce.createElement(kh, null, e);
fp.displayName = "ReactFlowWrapper";
const gS = {
  input: Y6,
  default: I1,
  output: X6,
  group: Ch
}, yS = {
  default: hu,
  straight: Mh,
  step: Eh,
  smoothstep: Nu,
  simplebezier: wh
}, vS = [0, 0], xS = [15, 15], bS = { x: 0, y: 0, zoom: 1 }, SS = {
  width: "100%",
  height: "100%",
  overflow: "hidden",
  position: "relative",
  zIndex: 0
}, Dh = B.forwardRef(({ nodes: e, edges: n, defaultNodes: r, defaultEdges: l, className: s, nodeTypes: u = gS, edgeTypes: c = yS, onNodeClick: h, onEdgeClick: d, onInit: p, onMove: g, onMoveStart: y, onMoveEnd: x, onConnect: w, onConnectStart: z, onConnectEnd: M, onClickConnectStart: A, onClickConnectEnd: T, onNodeMouseEnter: R, onNodeMouseMove: q, onNodeMouseLeave: H, onNodeContextMenu: $, onNodeDoubleClick: V, onNodeDragStart: Q, onNodeDrag: re, onNodeDragStop: te, onNodesDelete: ie, onEdgesDelete: ue, onSelectionChange: de, onSelectionDragStart: ge, onSelectionDrag: _, onSelectionDragStop: J, onSelectionContextMenu: D, onSelectionStart: Y, onSelectionEnd: I, connectionMode: F = Cr.Strict, connectionLineType: le = V0.Bezier, connectionLineStyle: k, connectionLineComponent: G, connectionLineContainerStyle: ae, deleteKeyCode: se = "Backspace", selectionKeyCode: xe = "Shift", selectionOnDrag: Te = !1, selectionMode: Ae = $i.Full, panActivationKeyCode: Re = "Space", multiSelectionKeyCode: Be = uu() ? "Meta" : "Control", zoomActivationKeyCode: Xe = uu() ? "Meta" : "Control", snapToGrid: lt = !1, snapGrid: St = xS, onlyRenderVisibleElements: be = !1, selectNodesOnDrag: ye = !0, nodesDraggable: ze, nodesConnectable: _e, nodesFocusable: je, nodeOrigin: Ee = vS, edgesFocusable: Oe, edgesUpdatable: ot, elementsSelectable: wt, defaultViewport: Vt = bS, minZoom: mn = 0.5, maxZoom: We = 2, translateExtent: Yt = Q1, preventScrolling: Zt = !0, nodeExtent: tn, defaultMarkerColor: nn = "#b1b1b7", zoomOnScroll: jn = !0, zoomOnPinch: o0 = !0, panOnScroll: Ft = !1, panOnScrollSpeed: Vn = 0.5, panOnScrollMode: An = Mr.Free, zoomOnDoubleClick: kt = !0, panOnDrag: sn = !0, onPaneClick: vt, onPaneMouseEnter: Ca, onPaneMouseMove: _l, onPaneMouseLeave: Rl, onPaneScroll: fa, onPaneContextMenu: u0, children: P0, onEdgeContextMenu: on, onEdgeDoubleClick: kr, onEdgeMouseEnter: er, onEdgeMouseMove: ju, onEdgeMouseLeave: ss, onEdgeUpdate: Bl, onEdgeUpdateStart: tr, onEdgeUpdateEnd: Vu, onReconnect: os, onReconnectStart: us, onReconnectEnd: cs, reconnectRadius: Ol = 10, edgeUpdaterRadius: Hl = 10, onNodesChange: fs, onEdgesChange: hs, noDragClassName: ha = "nodrag", noWheelClassName: Gt = "nowheel", noPanClassName: Qt = "nopan", fitView: c0 = !1, fitViewOptions: Ll, connectOnClick: Yu = !0, attributionPosition: Gu, proOptions: ds, defaultEdgeOptions: nr, elevateNodesOnSelect: ql = !0, elevateEdgesOnSelect: f0 = !1, disableKeyboardA11y: Na = !1, autoPanOnConnect: ar = !0, autoPanOnNodeDrag: h0 = !0, connectionRadius: Bt = 20, isValidConnection: ms, onError: ps, style: ka, id: Da, nodeDragThreshold: Xu, ...gs }, ys) => {
  const Ul = Da || "1";
  return ce.createElement(
    "div",
    { ...gs, style: { ...ka, ...SS }, ref: ys, className: ln(["react-flow", s]), "data-testid": "rf__wrapper", id: Da },
    ce.createElement(
      fp,
      null,
      ce.createElement(mS, { onInit: p, onMove: g, onMoveStart: y, onMoveEnd: x, onNodeClick: h, onEdgeClick: d, onNodeMouseEnter: R, onNodeMouseMove: q, onNodeMouseLeave: H, onNodeContextMenu: $, onNodeDoubleClick: V, nodeTypes: u, edgeTypes: c, connectionLineType: le, connectionLineStyle: k, connectionLineComponent: G, connectionLineContainerStyle: ae, selectionKeyCode: xe, selectionOnDrag: Te, selectionMode: Ae, deleteKeyCode: se, multiSelectionKeyCode: Be, panActivationKeyCode: Re, zoomActivationKeyCode: Xe, onlyRenderVisibleElements: be, selectNodesOnDrag: ye, defaultViewport: Vt, translateExtent: Yt, minZoom: mn, maxZoom: We, preventScrolling: Zt, zoomOnScroll: jn, zoomOnPinch: o0, zoomOnDoubleClick: kt, panOnScroll: Ft, panOnScrollSpeed: Vn, panOnScrollMode: An, panOnDrag: sn, onPaneClick: vt, onPaneMouseEnter: Ca, onPaneMouseMove: _l, onPaneMouseLeave: Rl, onPaneScroll: fa, onPaneContextMenu: u0, onSelectionContextMenu: D, onSelectionStart: Y, onSelectionEnd: I, onEdgeContextMenu: on, onEdgeDoubleClick: kr, onEdgeMouseEnter: er, onEdgeMouseMove: ju, onEdgeMouseLeave: ss, onReconnect: os ?? Bl, onReconnectStart: us ?? tr, onReconnectEnd: cs ?? Vu, reconnectRadius: Ol ?? Hl, defaultMarkerColor: nn, noDragClassName: ha, noWheelClassName: Gt, noPanClassName: Qt, elevateEdgesOnSelect: f0, rfId: Ul, disableKeyboardA11y: Na, nodeOrigin: Ee, nodeExtent: tn }),
      ce.createElement(hb, { nodes: e, edges: n, defaultNodes: r, defaultEdges: l, onConnect: w, onConnectStart: z, onConnectEnd: M, onClickConnectStart: A, onClickConnectEnd: T, nodesDraggable: ze, nodesConnectable: _e, nodesFocusable: je, edgesFocusable: Oe, edgesUpdatable: ot, elementsSelectable: wt, elevateNodesOnSelect: ql, minZoom: mn, maxZoom: We, nodeExtent: tn, onNodesChange: fs, onEdgesChange: hs, snapToGrid: lt, snapGrid: St, connectionMode: F, translateExtent: Yt, connectOnClick: Yu, defaultEdgeOptions: nr, fitView: c0, fitViewOptions: Ll, onNodesDelete: ie, onEdgesDelete: ue, onNodeDragStart: Q, onNodeDrag: re, onNodeDragStop: te, onSelectionDrag: _, onSelectionDragStart: ge, onSelectionDragStop: J, noPanClassName: Qt, nodeOrigin: Ee, rfId: Ul, autoPanOnConnect: ar, autoPanOnNodeDrag: h0, onError: ps, connectionRadius: Bt, isValidConnection: ms, nodeDragThreshold: Xu }),
      ce.createElement(cb, { onSelectionChange: de }),
      P0,
      ce.createElement(qx, { proOptions: ds, position: Gu }),
      ce.createElement(yb, { rfId: Ul, disableKeyboardA11y: Na })
    )
  );
});
Dh.displayName = "ReactFlow";
const wS = (e) => e.domNode?.querySelector(".react-flow__edgelabel-renderer");
function ES({ children: e }) {
  const n = pt(wS);
  return n ? Ox.createPortal(e, n) : null;
}
function MS() {
  const e = Ut();
  return B.useCallback((n) => {
    const { domNode: r, updateNodeDimensions: l } = e.getState(), u = (Array.isArray(n) ? n : [n]).reduce((c, h) => {
      const d = r?.querySelector(`.react-flow__node[data-id="${h}"]`);
      return d && c.push({ id: h, nodeElement: d, forceUpdate: !0 }), c;
    }, []);
    requestAnimationFrame(() => l(u));
  }, []);
}
const TS = (e) => e.getNodes();
function zS() {
  return pt(TS, Kt);
}
const AS = (e) => e.edges;
function CS() {
  return pt(AS, Kt);
}
function NS() {
  return ce.createElement(
    "svg",
    { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
    ce.createElement("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
  );
}
function kS() {
  return ce.createElement(
    "svg",
    { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 5" },
    ce.createElement("path", { d: "M0 0h32v4.2H0z" })
  );
}
function DS() {
  return ce.createElement(
    "svg",
    { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 30" },
    ce.createElement("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" })
  );
}
function _S() {
  return ce.createElement(
    "svg",
    { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32" },
    ce.createElement("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" })
  );
}
function RS() {
  return ce.createElement(
    "svg",
    { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32" },
    ce.createElement("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" })
  );
}
const Tr = ({ children: e, className: n, ...r }) => ce.createElement("button", { type: "button", className: ln(["react-flow__controls-button", n]), ...r }, e);
Tr.displayName = "ControlButton";
const BS = (e) => ({
  isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
  minZoomReached: e.transform[2] <= e.minZoom,
  maxZoomReached: e.transform[2] >= e.maxZoom
}), hp = ({ style: e, showZoom: n = !0, showFitView: r = !0, showInteractive: l = !0, fitViewOptions: s, onZoomIn: u, onZoomOut: c, onFitView: h, onInteractiveChange: d, className: p, children: g, position: y = "bottom-left" }) => {
  const x = Ut(), [w, z] = B.useState(!1), { isInteractive: M, minZoomReached: A, maxZoomReached: T } = pt(BS, Kt), { zoomIn: R, zoomOut: q, fitView: H } = Wi();
  if (B.useEffect(() => {
    z(!0);
  }, []), !w)
    return null;
  const $ = () => {
    R(), u?.();
  }, V = () => {
    q(), c?.();
  }, Q = () => {
    H(s), h?.();
  }, re = () => {
    x.setState({
      nodesDraggable: !M,
      nodesConnectable: !M,
      elementsSelectable: !M
    }), d?.(!M);
  };
  return ce.createElement(
    vh,
    { className: ln(["react-flow__controls", p]), position: y, style: e, "data-testid": "rf__controls" },
    n && ce.createElement(
      ce.Fragment,
      null,
      ce.createElement(
        Tr,
        { onClick: $, className: "react-flow__controls-zoomin", title: "zoom in", "aria-label": "zoom in", disabled: T },
        ce.createElement(NS, null)
      ),
      ce.createElement(
        Tr,
        { onClick: V, className: "react-flow__controls-zoomout", title: "zoom out", "aria-label": "zoom out", disabled: A },
        ce.createElement(kS, null)
      )
    ),
    r && ce.createElement(
      Tr,
      { className: "react-flow__controls-fitview", onClick: Q, title: "fit view", "aria-label": "fit view" },
      ce.createElement(DS, null)
    ),
    l && ce.createElement(Tr, { className: "react-flow__controls-interactive", onClick: re, title: "toggle interactivity", "aria-label": "toggle interactivity" }, M ? ce.createElement(RS, null) : ce.createElement(_S, null)),
    g
  );
};
hp.displayName = "Controls";
var OS = B.memo(hp), ua;
(function(e) {
  e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
})(ua || (ua = {}));
function HS({ color: e, dimensions: n, lineWidth: r }) {
  return ce.createElement("path", { stroke: e, strokeWidth: r, d: `M${n[0] / 2} 0 V${n[1]} M0 ${n[1] / 2} H${n[0]}` });
}
function LS({ color: e, radius: n }) {
  return ce.createElement("circle", { cx: n, cy: n, r: n, fill: e });
}
const qS = {
  [ua.Dots]: "#91919a",
  [ua.Lines]: "#eee",
  [ua.Cross]: "#e2e2e2"
}, US = {
  [ua.Dots]: 1,
  [ua.Lines]: 1,
  [ua.Cross]: 6
}, jS = (e) => ({ transform: e.transform, patternId: `pattern-${e.rfId}` });
function dp({
  id: e,
  variant: n = ua.Dots,
  // only used for dots and cross
  gap: r = 20,
  // only used for lines and cross
  size: l,
  lineWidth: s = 1,
  offset: u = 2,
  color: c,
  style: h,
  className: d
}) {
  const p = B.useRef(null), { transform: g, patternId: y } = pt(jS, Kt), x = c || qS[n], w = l || US[n], z = n === ua.Dots, M = n === ua.Cross, A = Array.isArray(r) ? r : [r, r], T = [A[0] * g[2] || 1, A[1] * g[2] || 1], R = w * g[2], q = M ? [R, R] : T, H = z ? [R / u, R / u] : [q[0] / u, q[1] / u];
  return ce.createElement(
    "svg",
    { className: ln(["react-flow__background", d]), style: {
      ...h,
      position: "absolute",
      width: "100%",
      height: "100%",
      top: 0,
      left: 0
    }, ref: p, "data-testid": "rf__background" },
    ce.createElement("pattern", { id: y + e, x: g[0] % T[0], y: g[1] % T[1], width: T[0], height: T[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${H[0]},-${H[1]})` }, z ? ce.createElement(LS, { color: x, radius: R / u }) : ce.createElement(HS, { dimensions: q, color: x, lineWidth: s })),
    ce.createElement("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${y + e})` })
  );
}
dp.displayName = "Background";
var VS = B.memo(dp), El;
(function(e) {
  e.Line = "line", e.Handle = "handle";
})(El || (El = {}));
function YS({ width: e, prevWidth: n, height: r, prevHeight: l, invertX: s, invertY: u }) {
  const c = e - n, h = r - l, d = [c > 0 ? 1 : c < 0 ? -1 : 0, h > 0 ? 1 : h < 0 ? -1 : 0];
  return c && s && (d[0] = d[0] * -1), h && u && (d[1] = d[1] * -1), d;
}
const mp = { width: 0, height: 0, x: 0, y: 0 }, GS = {
  ...mp,
  pointerX: 0,
  pointerY: 0,
  aspectRatio: 1
};
function XS({ nodeId: e, position: n, variant: r = El.Handle, className: l, style: s = {}, children: u, color: c, minWidth: h = 10, minHeight: d = 10, maxWidth: p = Number.MAX_VALUE, maxHeight: g = Number.MAX_VALUE, keepAspectRatio: y = !1, shouldResize: x, onResizeStart: w, onResize: z, onResizeEnd: M }) {
  const A = D6(), T = typeof e == "string" ? e : A, R = Ut(), q = B.useRef(null), H = B.useRef(GS), $ = B.useRef(mp), V = np(), Q = r === El.Line ? "right" : "bottom-right", re = n ?? Q;
  B.useEffect(() => {
    if (!q.current || !T)
      return;
    const de = Wn(q.current), ge = re.includes("right") || re.includes("left"), _ = re.includes("bottom") || re.includes("top"), J = re.includes("left"), D = re.includes("top"), Y = o6().on("start", (I) => {
      const F = R.getState().nodeInternals.get(T), { xSnapped: le, ySnapped: k } = V(I);
      $.current = {
        width: F?.width ?? 0,
        height: F?.height ?? 0,
        x: F?.position.x ?? 0,
        y: F?.position.y ?? 0
      }, H.current = {
        ...$.current,
        pointerX: le,
        pointerY: k,
        aspectRatio: $.current.width / $.current.height
      }, w?.(I, { ...$.current });
    }).on("drag", (I) => {
      const { nodeInternals: F, triggerNodeChanges: le } = R.getState(), { xSnapped: k, ySnapped: G } = V(I), ae = F.get(T);
      if (ae) {
        const se = [], { pointerX: xe, pointerY: Te, width: Ae, height: Re, x: Be, y: Xe, aspectRatio: lt } = H.current, { x: St, y: be, width: ye, height: ze } = $.current, _e = Math.floor(ge ? k - xe : 0), je = Math.floor(_ ? G - Te : 0);
        let Ee = F0(Ae + (J ? -_e : _e), h, p), Oe = F0(Re + (D ? -je : je), d, g);
        if (y) {
          const Yt = Ee / Oe, Zt = ge && _, tn = ge && !_, nn = _ && !ge;
          Ee = Yt <= lt && Zt || nn ? Oe * lt : Ee, Oe = Yt > lt && Zt || tn ? Ee / lt : Oe, Ee >= p ? (Ee = p, Oe = p / lt) : Ee <= h && (Ee = h, Oe = h / lt), Oe >= g ? (Oe = g, Ee = g * lt) : Oe <= d && (Oe = d, Ee = d * lt);
        }
        const ot = Ee !== ye, wt = Oe !== ze;
        if (J || D) {
          const Yt = J ? Be - (Ee - Ae) : Be, Zt = D ? Xe - (Oe - Re) : Xe, tn = Yt !== St && ot, nn = Zt !== be && wt;
          if (tn || nn) {
            const jn = {
              id: ae.id,
              type: "position",
              position: {
                x: tn ? Yt : St,
                y: nn ? Zt : be
              }
            };
            se.push(jn), $.current.x = jn.position.x, $.current.y = jn.position.y;
          }
        }
        if (ot || wt) {
          const Yt = {
            id: T,
            type: "dimensions",
            updateStyle: !0,
            resizing: !0,
            dimensions: {
              width: Ee,
              height: Oe
            }
          };
          se.push(Yt), $.current.width = Ee, $.current.height = Oe;
        }
        if (se.length === 0)
          return;
        const Vt = YS({
          width: $.current.width,
          prevWidth: ye,
          height: $.current.height,
          prevHeight: ze,
          invertX: J,
          invertY: D
        }), mn = { ...$.current, direction: Vt };
        if (x?.(I, mn) === !1)
          return;
        z?.(I, mn), le(se);
      }
    }).on("end", (I) => {
      const F = {
        id: T,
        type: "dimensions",
        resizing: !1
      };
      M?.(I, { ...$.current }), R.getState().triggerNodeChanges([F]);
    });
    return de.call(Y), () => {
      de.on(".drag", null);
    };
  }, [
    T,
    re,
    h,
    d,
    p,
    g,
    y,
    V,
    w,
    z,
    M
  ]);
  const te = re.split("-"), ie = r === El.Line ? "borderColor" : "backgroundColor", ue = c ? { ...s, [ie]: c } : s;
  return ce.createElement("div", { className: ln(["react-flow__resize-control", "nodrag", ...te, r, l]), ref: q, style: ue }, u);
}
var X5 = B.memo(XS);
const $S = ["top-left", "top-right", "bottom-left", "bottom-right"], ZS = ["top", "right", "bottom", "left"];
function Pi({ nodeId: e, isVisible: n = !0, handleClassName: r, handleStyle: l, lineClassName: s, lineStyle: u, color: c, minWidth: h = 10, minHeight: d = 10, maxWidth: p = Number.MAX_VALUE, maxHeight: g = Number.MAX_VALUE, keepAspectRatio: y = !1, shouldResize: x, onResizeStart: w, onResize: z, onResizeEnd: M }) {
  return n ? ce.createElement(
    ce.Fragment,
    null,
    ZS.map((A) => ce.createElement(X5, { key: A, className: s, style: u, nodeId: e, position: A, variant: El.Line, color: c, minWidth: h, minHeight: d, maxWidth: p, maxHeight: g, onResizeStart: w, keepAspectRatio: y, shouldResize: x, onResize: z, onResizeEnd: M })),
    $S.map((A) => ce.createElement(X5, { key: A, className: r, style: l, nodeId: e, position: A, color: c, minWidth: h, minHeight: d, maxWidth: p, maxHeight: g, onResizeStart: w, keepAspectRatio: y, shouldResize: x, onResize: z, onResizeEnd: M }))
  ) : null;
}
function Mt(e, n, r) {
  const l = {
    type: n,
    payload: r,
    timestamp: Date.now()
  };
  e.set("_action", l), e.save_changes();
}
function _h(e) {
  return e.get("diagram_state") || { version: "1.0.0", blocks: [], connections: [] };
}
function pp(e, n) {
  const r = () => {
    n(_h(e));
  };
  return e.on("change:diagram_state", r), () => {
    e.off("change:diagram_state", r);
  };
}
function FS(e) {
  const { size: n, position: r, portType: l, isFlipped: s } = e;
  if (n <= 0)
    throw new Error("Size must be positive");
  const u = n / 2, c = n * 0.6 / 2, h = l === "input";
  let d, p;
  switch (r) {
    case he.Left:
    case he.Right:
      s ? h ? (d = { x1: n, y1: u - c, x2: u, y2: u }, p = { x1: n, y1: u + c, x2: u, y2: u }) : (d = { x1: u, y1: u - c, x2: 0, y2: u }, p = { x1: u, y1: u + c, x2: 0, y2: u }) : h ? (d = { x1: 0, y1: u - c, x2: u, y2: u }, p = { x1: 0, y1: u + c, x2: u, y2: u }) : (d = { x1: u, y1: u - c, x2: n, y2: u }, p = { x1: u, y1: u + c, x2: n, y2: u });
      break;
    case he.Top:
      h ? (d = { x1: u - c, y1: 0, x2: u, y2: u }, p = { x1: u + c, y1: 0, x2: u, y2: u }) : (d = { x1: u - c, y1: u, x2: u, y2: n }, p = { x1: u + c, y1: u, x2: u, y2: n });
      break;
    case he.Bottom:
      h ? (d = { x1: u - c, y1: n, x2: u, y2: u }, p = { x1: u + c, y1: n, x2: u, y2: u }) : (d = { x1: u - c, y1: u, x2: u, y2: n }, p = { x1: u + c, y1: u, x2: u, y2: n });
      break;
    default:
      d = { x1: 0, y1: u - c, x2: u, y2: u }, p = { x1: 0, y1: u + c, x2: u, y2: u };
  }
  return {
    line1: d,
    line2: p,
    viewBox: `0 0 ${n} ${n}`
  };
}
const wa = ({
  position: e,
  portType: n,
  isConnected: r,
  isFlipped: l = !1,
  isDragTarget: s = !1,
  size: u = 10,
  className: c = ""
}) => {
  if (!(!r && !s))
    return null;
  const { line1: d, line2: p, viewBox: g } = FS({
    size: u,
    position: e,
    portType: n,
    isFlipped: l
  });
  let y = "50%", x = "50%";
  return e === he.Left ? y = "calc(50% - 3px)" : e === he.Top ? x = "calc(50% - 3px)" : e === he.Bottom ? x = "calc(50% + 3px)" : e === he.Right && (y = "calc(50% + 3px)"), /* @__PURE__ */ O.jsxs(
    "svg",
    {
      width: u,
      height: u,
      viewBox: g,
      className: `port-marker ${c}`,
      style: {
        position: "absolute",
        left: y,
        top: x,
        transform: "translate(-50%, -50%)",
        // Center the SVG on the handle
        pointerEvents: "none",
        // Don't interfere with Handle interaction
        zIndex: 20
        // Above Handle (which is z-10)
      },
      children: [
        /* @__PURE__ */ O.jsx(
          "line",
          {
            x1: d.x1,
            y1: d.y1,
            x2: d.x2,
            y2: d.y2,
            stroke: "var(--color-primary-600)",
            strokeWidth: "2",
            strokeLinecap: "round"
          }
        ),
        /* @__PURE__ */ O.jsx(
          "line",
          {
            x1: p.x1,
            y1: p.y1,
            x2: p.x2,
            y2: p.y2,
            stroke: "var(--color-primary-600)",
            strokeWidth: "2",
            strokeLinecap: "round"
          }
        )
      ]
    }
  );
};
function Nl({ value: e, onSave: n, className: r = "" }) {
  const [l, s] = B.useState(!1), [u, c] = B.useState(e), h = B.useRef(null);
  B.useEffect(() => {
    l && h.current && (h.current.focus(), h.current.select());
  }, [l]);
  const d = B.useCallback(
    (y) => {
      y.stopPropagation(), c(e), s(!0);
    },
    [e]
  ), p = B.useCallback(() => {
    s(!1), u.trim() && u !== e ? n(u.trim()) : c(e);
  }, [u, e, n]), g = B.useCallback(
    (y) => {
      y.key === "Enter" ? (y.preventDefault(), h.current?.blur()) : y.key === "Escape" && (c(e), s(!1));
    },
    [e]
  );
  return l ? /* @__PURE__ */ O.jsx(
    "input",
    {
      ref: h,
      type: "text",
      value: u,
      onChange: (y) => c(y.target.value),
      onBlur: p,
      onKeyDown: g,
      className: `${r} bg-white border border-primary-600 rounded px-1 outline-none`,
      style: { width: `${Math.max(u.length * 7, 80)}px` }
    }
  ) : /* @__PURE__ */ O.jsx(
    "div",
    {
      onDoubleClick: d,
      className: `${r} cursor-text hover:bg-slate-100 rounded px-1`,
      title: "Double-click to edit",
      children: e
    }
  );
}
class wn {
  // The + prefix indicates that these fields aren't writeable
  // Lexer holding the input string.
  // Start offset, zero-based inclusive.
  // End offset, zero-based exclusive.
  constructor(n, r, l) {
    this.lexer = void 0, this.start = void 0, this.end = void 0, this.lexer = n, this.start = r, this.end = l;
  }
  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(n, r) {
    return r ? !n || !n.loc || !r.loc || n.loc.lexer !== r.loc.lexer ? null : new wn(n.loc.lexer, n.loc.start, r.loc.end) : n && n.loc;
  }
}
class Ln {
  // don't expand the token
  // used in \noexpand
  constructor(n, r) {
    this.text = void 0, this.loc = void 0, this.noexpand = void 0, this.treatAsRelax = void 0, this.text = n, this.loc = r;
  }
  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(n, r) {
    return new Ln(r, wn.range(this, n));
  }
}
class we {
  // Error start position based on passed-in Token or ParseNode.
  // Length of affected text based on passed-in Token or ParseNode.
  // The underlying error message without any context added.
  constructor(n, r) {
    this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0;
    var l = "KaTeX parse error: " + n, s, u, c = r && r.loc;
    if (c && c.start <= c.end) {
      var h = c.lexer.input;
      s = c.start, u = c.end, s === h.length ? l += " at end of input: " : l += " at position " + (s + 1) + ": ";
      var d = h.slice(s, u).replace(/[^]/g, "$&̲"), p;
      s > 15 ? p = "…" + h.slice(s - 15, s) : p = h.slice(0, s);
      var g;
      u + 15 < h.length ? g = h.slice(u, u + 15) + "…" : g = h.slice(u), l += p + d + g;
    }
    var y = new Error(l);
    return y.name = "ParseError", y.__proto__ = we.prototype, y.position = s, s != null && u != null && (y.length = u - s), y.rawMessage = n, y;
  }
}
we.prototype.__proto__ = Error.prototype;
var IS = function(n, r) {
  return n === void 0 ? r : n;
}, KS = /([A-Z])/g, QS = function(n) {
  return n.replace(KS, "-$1").toLowerCase();
}, JS = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, WS = /[&><"']/g;
function PS(e) {
  return String(e).replace(WS, (n) => JS[n]);
}
var gp = function e(n) {
  return n.type === "ordgroup" || n.type === "color" ? n.body.length === 1 ? e(n.body[0]) : n : n.type === "font" ? e(n.body) : n;
}, ew = function(n) {
  var r = gp(n);
  return r.type === "mathord" || r.type === "textord" || r.type === "atom";
}, tw = function(n) {
  if (!n)
    throw new Error("Expected non-null, but got " + String(n));
  return n;
}, nw = function(n) {
  var r = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(n);
  return r ? r[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1]) ? null : r[1].toLowerCase() : "_relative";
}, at = {
  deflt: IS,
  escape: PS,
  hyphenate: QS,
  getBaseElem: gp,
  isCharacterBox: ew,
  protocolFromUrl: nw
}, tu = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: !0,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",
    cliProcessor: (e) => "#" + e
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (e, n) => (n.push(e), n)
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: (e) => Math.max(0, e),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: !1
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: 1 / 0,
    description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",
    processor: (e) => Math.max(0, e),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1e3,
    description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",
    processor: (e) => Math.max(0, e),
    cli: "-e, --max-expand <n>",
    cliProcessor: (e) => e === "Infinity" ? 1 / 0 : parseInt(e)
  },
  globalGroup: {
    type: "boolean",
    cli: !1
  }
};
function aw(e) {
  if (e.default)
    return e.default;
  var n = e.type, r = Array.isArray(n) ? n[0] : n;
  if (typeof r != "string")
    return r.enum[0];
  switch (r) {
    case "boolean":
      return !1;
    case "string":
      return "";
    case "number":
      return 0;
    case "object":
      return {};
  }
}
class Rh {
  constructor(n) {
    this.displayMode = void 0, this.output = void 0, this.leqno = void 0, this.fleqn = void 0, this.throwOnError = void 0, this.errorColor = void 0, this.macros = void 0, this.minRuleThickness = void 0, this.colorIsTextColor = void 0, this.strict = void 0, this.trust = void 0, this.maxSize = void 0, this.maxExpand = void 0, this.globalGroup = void 0, n = n || {};
    for (var r in tu)
      if (tu.hasOwnProperty(r)) {
        var l = tu[r];
        this[r] = n[r] !== void 0 ? l.processor ? l.processor(n[r]) : n[r] : aw(l);
      }
  }
  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(n, r, l) {
    var s = this.strict;
    if (typeof s == "function" && (s = s(n, r, l)), !(!s || s === "ignore")) {
      if (s === !0 || s === "error")
        throw new we("LaTeX-incompatible input and strict mode is set to 'error': " + (r + " [" + n + "]"), l);
      s === "warn" ? typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (r + " [" + n + "]")) : typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + s + "': " + r + " [" + n + "]"));
    }
  }
  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(n, r, l) {
    var s = this.strict;
    if (typeof s == "function")
      try {
        s = s(n, r, l);
      } catch {
        s = "error";
      }
    return !s || s === "ignore" ? !1 : s === !0 || s === "error" ? !0 : s === "warn" ? (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (r + " [" + n + "]")), !1) : (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + s + "': " + r + " [" + n + "]")), !1);
  }
  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(n) {
    if (n.url && !n.protocol) {
      var r = at.protocolFromUrl(n.url);
      if (r == null)
        return !1;
      n.protocol = r;
    }
    var l = typeof this.trust == "function" ? this.trust(n) : this.trust;
    return !!l;
  }
}
class L0 {
  constructor(n, r, l) {
    this.id = void 0, this.size = void 0, this.cramped = void 0, this.id = n, this.size = r, this.cramped = l;
  }
  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return va[rw[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return va[lw[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return va[iw[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return va[sw[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return va[ow[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return va[uw[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var Bh = 0, du = 1, Ml = 2, e0 = 3, Fi = 4, ea = 5, Al = 6, hn = 7, va = [new L0(Bh, 0, !1), new L0(du, 0, !0), new L0(Ml, 1, !1), new L0(e0, 1, !0), new L0(Fi, 2, !1), new L0(ea, 2, !0), new L0(Al, 3, !1), new L0(hn, 3, !0)], rw = [Fi, ea, Fi, ea, Al, hn, Al, hn], lw = [ea, ea, ea, ea, hn, hn, hn, hn], iw = [Ml, e0, Fi, ea, Al, hn, Al, hn], sw = [e0, e0, ea, ea, hn, hn, hn, hn], ow = [du, du, e0, e0, ea, ea, hn, hn], uw = [Bh, du, Ml, e0, Ml, e0, Ml, e0], qe = {
  DISPLAY: va[Bh],
  TEXT: va[Ml],
  SCRIPT: va[Fi],
  SCRIPTSCRIPT: va[Al]
}, J1 = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: "latin",
  blocks: [
    [256, 591],
    // Latin Extended-A and Latin Extended-B
    [768, 879]
    // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: "cyrillic",
  blocks: [[1024, 1279]]
}, {
  // Armenian
  name: "armenian",
  blocks: [[1328, 1423]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: "brahmic",
  blocks: [[2304, 4255]]
}, {
  name: "georgian",
  blocks: [[4256, 4351]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [
    [12288, 12543],
    // CJK symbols and punctuation, Hiragana, Katakana
    [19968, 40879],
    // CJK ideograms
    [65280, 65376]
    // Fullwidth punctuation
    // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: "hangul",
  blocks: [[44032, 55215]]
}];
function cw(e) {
  for (var n = 0; n < J1.length; n++)
    for (var r = J1[n], l = 0; l < r.blocks.length; l++) {
      var s = r.blocks[l];
      if (e >= s[0] && e <= s[1])
        return r.name;
    }
  return null;
}
var nu = [];
J1.forEach((e) => e.blocks.forEach((n) => nu.push(...n)));
function yp(e) {
  for (var n = 0; n < nu.length; n += 2)
    if (e >= nu[n] && e <= nu[n + 1])
      return !0;
  return !1;
}
var ml = 80, fw = function(n, r) {
  return "M95," + (622 + n + r) + `
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l` + n / 2.075 + " -" + n + `
c5.3,-9.3,12,-14,20,-14
H400000v` + (40 + n) + `H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M` + (834 + n) + " " + r + "h400000v" + (40 + n) + "h-400000z";
}, hw = function(n, r) {
  return "M263," + (601 + n + r) + `c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l` + n / 2.084 + " -" + n + `
c4.7,-7.3,11,-11,19,-11
H40000v` + (40 + n) + `H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M` + (1001 + n) + " " + r + "h400000v" + (40 + n) + "h-400000z";
}, dw = function(n, r) {
  return "M983 " + (10 + n + r) + `
l` + n / 3.13 + " -" + n + `
c4,-6.7,10,-10,18,-10 H400000v` + (40 + n) + `
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M` + (1001 + n) + " " + r + "h400000v" + (40 + n) + "h-400000z";
}, mw = function(n, r) {
  return "M424," + (2398 + n + r) + `
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l` + n / 4.223 + " -" + n + `c4,-6.7,10,-10,18,-10 H400000
v` + (40 + n) + `H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M` + (1001 + n) + " " + r + `
h400000v` + (40 + n) + "h-400000z";
}, pw = function(n, r) {
  return "M473," + (2713 + n + r) + `
c339.3,-1799.3,509.3,-2700,510,-2702 l` + n / 5.298 + " -" + n + `
c3.3,-7.3,9.3,-11,18,-11 H400000v` + (40 + n) + `H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM` + (1001 + n) + " " + r + "h400000v" + (40 + n) + "H1017.7z";
}, gw = function(n) {
  var r = n / 2;
  return "M400000 " + n + " H0 L" + r + " 0 l65 45 L145 " + (n - 80) + " H400000z";
}, yw = function(n, r, l) {
  var s = l - 54 - r - n;
  return "M702 " + (n + r) + "H400000" + (40 + n) + `
H742v` + s + `l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ` + r + "H400000v" + (40 + n) + "H742z";
}, vw = function(n, r, l) {
  r = 1e3 * r;
  var s = "";
  switch (n) {
    case "sqrtMain":
      s = fw(r, ml);
      break;
    case "sqrtSize1":
      s = hw(r, ml);
      break;
    case "sqrtSize2":
      s = dw(r, ml);
      break;
    case "sqrtSize3":
      s = mw(r, ml);
      break;
    case "sqrtSize4":
      s = pw(r, ml);
      break;
    case "sqrtTall":
      s = yw(r, ml, l);
  }
  return s;
}, xw = function(n, r) {
  switch (n) {
    case "⎜":
      return "M291 0 H417 V" + r + " H291z M291 0 H417 V" + r + " H291z";
    case "∣":
      return "M145 0 H188 V" + r + " H145z M145 0 H188 V" + r + " H145z";
    case "∥":
      return "M145 0 H188 V" + r + " H145z M145 0 H188 V" + r + " H145z" + ("M367 0 H410 V" + r + " H367z M367 0 H410 V" + r + " H367z");
    case "⎟":
      return "M457 0 H583 V" + r + " H457z M457 0 H583 V" + r + " H457z";
    case "⎢":
      return "M319 0 H403 V" + r + " H319z M319 0 H403 V" + r + " H319z";
    case "⎥":
      return "M263 0 H347 V" + r + " H263z M263 0 H347 V" + r + " H263z";
    case "⎪":
      return "M384 0 H504 V" + r + " H384z M384 0 H504 V" + r + " H384z";
    case "⏐":
      return "M312 0 H355 V" + r + " H312z M312 0 H355 V" + r + " H312z";
    case "‖":
      return "M257 0 H300 V" + r + " H257z M257 0 H300 V" + r + " H257z" + ("M478 0 H521 V" + r + " H478z M478 0 H521 V" + r + " H478z");
    default:
      return "";
  }
}, $5 = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: `M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: `M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,
  leftbraceunder: `M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: `M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,
  leftgroupunder: `M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,
  leftharpoonplus: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,
  leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,
  leftharpoondownplus: `M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,
  leftlinesegment: `M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,
  leftmapsto: `M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: `M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,
  longequal: `M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,
  midbrace: `M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,
  midbraceunder: `M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,
  oiintSize1: `M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,
  oiintSize2: `M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,
  oiiintSize1: `M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,
  oiiintSize2: `M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,
  rightarrow: `M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,
  rightbrace: `M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,
  rightbraceunder: `M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,
  rightgroup: `M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,
  rightgroupunder: `M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,
  rightharpoon: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,
  rightharpoonplus: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,
  rightharpoondown: `M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,
  rightharpoondownplus: `M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,
  righthook: `M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,
  rightlinesegment: `M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,
  rightToFrom: `M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: `M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,
  twoheadrightarrow: `M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,
  // ditto tilde2, tilde3, & tilde4
  tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,
  tilde3: `M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,
  tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,
  // ditto widehat2, widehat3, & widehat4
  widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat3: `M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat4: `M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  // widecheck paths are all inverted versions of widehat
  widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,
  widecheck2: `M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck3: `M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck4: `M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  // The next ten paths support reaction arrows from the mhchem package.
  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,
  rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,
  shortbaraboveleftharpoon: `M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,
  shortrightharpoonabovebar: `M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`
}, bw = function(n, r) {
  switch (n) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + r + ` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v` + r + " v1759 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + r + ` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v` + r + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + r + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + r + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + r + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + r + ` v585 h43z
M367 15 v585 v` + r + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v` + r + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + r + ` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v` + r + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + r + ` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v` + r + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + r + ` v602 h84z
M403 1759 V0 H319 V1759 v` + r + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + r + ` v602 h84z
M347 1759 V0 h-84 V1759 v` + r + " v602 h84z";
    case "lparen":
      return `M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,` + (r + 84) + `c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-` + (r + 92) + `c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;
    case "rparen":
      return `M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,` + (r + 9) + `
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-` + (r + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;
    default:
      throw new Error("Unknown stretchy delimiter.");
  }
};
class es {
  // Never used; needed for satisfying interface.
  constructor(n) {
    this.children = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.children = n, this.classes = [], this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = {};
  }
  hasClass(n) {
    return this.classes.includes(n);
  }
  /** Convert the fragment into a node. */
  toNode() {
    for (var n = document.createDocumentFragment(), r = 0; r < this.children.length; r++)
      n.appendChild(this.children[r].toNode());
    return n;
  }
  /** Convert the fragment into HTML markup. */
  toMarkup() {
    for (var n = "", r = 0; r < this.children.length; r++)
      n += this.children[r].toMarkup();
    return n;
  }
  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    var n = (r) => r.toText();
    return this.children.map(n).join("");
  }
}
var xa = {
  "AMS-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68889, 0, 0, 0.72222],
    66: [0, 0.68889, 0, 0, 0.66667],
    67: [0, 0.68889, 0, 0, 0.72222],
    68: [0, 0.68889, 0, 0, 0.72222],
    69: [0, 0.68889, 0, 0, 0.66667],
    70: [0, 0.68889, 0, 0, 0.61111],
    71: [0, 0.68889, 0, 0, 0.77778],
    72: [0, 0.68889, 0, 0, 0.77778],
    73: [0, 0.68889, 0, 0, 0.38889],
    74: [0.16667, 0.68889, 0, 0, 0.5],
    75: [0, 0.68889, 0, 0, 0.77778],
    76: [0, 0.68889, 0, 0, 0.66667],
    77: [0, 0.68889, 0, 0, 0.94445],
    78: [0, 0.68889, 0, 0, 0.72222],
    79: [0.16667, 0.68889, 0, 0, 0.77778],
    80: [0, 0.68889, 0, 0, 0.61111],
    81: [0.16667, 0.68889, 0, 0, 0.77778],
    82: [0, 0.68889, 0, 0, 0.72222],
    83: [0, 0.68889, 0, 0, 0.55556],
    84: [0, 0.68889, 0, 0, 0.66667],
    85: [0, 0.68889, 0, 0, 0.72222],
    86: [0, 0.68889, 0, 0, 0.72222],
    87: [0, 0.68889, 0, 0, 1],
    88: [0, 0.68889, 0, 0, 0.72222],
    89: [0, 0.68889, 0, 0, 0.72222],
    90: [0, 0.68889, 0, 0, 0.66667],
    107: [0, 0.68889, 0, 0, 0.55556],
    160: [0, 0, 0, 0, 0.25],
    165: [0, 0.675, 0.025, 0, 0.75],
    174: [0.15559, 0.69224, 0, 0, 0.94666],
    240: [0, 0.68889, 0, 0, 0.55556],
    295: [0, 0.68889, 0, 0, 0.54028],
    710: [0, 0.825, 0, 0, 2.33334],
    732: [0, 0.9, 0, 0, 2.33334],
    770: [0, 0.825, 0, 0, 2.33334],
    771: [0, 0.9, 0, 0, 2.33334],
    989: [0.08167, 0.58167, 0, 0, 0.77778],
    1008: [0, 0.43056, 0.04028, 0, 0.66667],
    8245: [0, 0.54986, 0, 0, 0.275],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8487: [0, 0.68889, 0, 0, 0.72222],
    8498: [0, 0.68889, 0, 0, 0.55556],
    8502: [0, 0.68889, 0, 0, 0.66667],
    8503: [0, 0.68889, 0, 0, 0.44445],
    8504: [0, 0.68889, 0, 0, 0.66667],
    8513: [0, 0.68889, 0, 0, 0.63889],
    8592: [-0.03598, 0.46402, 0, 0, 0.5],
    8594: [-0.03598, 0.46402, 0, 0, 0.5],
    8602: [-0.13313, 0.36687, 0, 0, 1],
    8603: [-0.13313, 0.36687, 0, 0, 1],
    8606: [0.01354, 0.52239, 0, 0, 1],
    8608: [0.01354, 0.52239, 0, 0, 1],
    8610: [0.01354, 0.52239, 0, 0, 1.11111],
    8611: [0.01354, 0.52239, 0, 0, 1.11111],
    8619: [0, 0.54986, 0, 0, 1],
    8620: [0, 0.54986, 0, 0, 1],
    8621: [-0.13313, 0.37788, 0, 0, 1.38889],
    8622: [-0.13313, 0.36687, 0, 0, 1],
    8624: [0, 0.69224, 0, 0, 0.5],
    8625: [0, 0.69224, 0, 0, 0.5],
    8630: [0, 0.43056, 0, 0, 1],
    8631: [0, 0.43056, 0, 0, 1],
    8634: [0.08198, 0.58198, 0, 0, 0.77778],
    8635: [0.08198, 0.58198, 0, 0, 0.77778],
    8638: [0.19444, 0.69224, 0, 0, 0.41667],
    8639: [0.19444, 0.69224, 0, 0, 0.41667],
    8642: [0.19444, 0.69224, 0, 0, 0.41667],
    8643: [0.19444, 0.69224, 0, 0, 0.41667],
    8644: [0.1808, 0.675, 0, 0, 1],
    8646: [0.1808, 0.675, 0, 0, 1],
    8647: [0.1808, 0.675, 0, 0, 1],
    8648: [0.19444, 0.69224, 0, 0, 0.83334],
    8649: [0.1808, 0.675, 0, 0, 1],
    8650: [0.19444, 0.69224, 0, 0, 0.83334],
    8651: [0.01354, 0.52239, 0, 0, 1],
    8652: [0.01354, 0.52239, 0, 0, 1],
    8653: [-0.13313, 0.36687, 0, 0, 1],
    8654: [-0.13313, 0.36687, 0, 0, 1],
    8655: [-0.13313, 0.36687, 0, 0, 1],
    8666: [0.13667, 0.63667, 0, 0, 1],
    8667: [0.13667, 0.63667, 0, 0, 1],
    8669: [-0.13313, 0.37788, 0, 0, 1],
    8672: [-0.064, 0.437, 0, 0, 1.334],
    8674: [-0.064, 0.437, 0, 0, 1.334],
    8705: [0, 0.825, 0, 0, 0.5],
    8708: [0, 0.68889, 0, 0, 0.55556],
    8709: [0.08167, 0.58167, 0, 0, 0.77778],
    8717: [0, 0.43056, 0, 0, 0.42917],
    8722: [-0.03598, 0.46402, 0, 0, 0.5],
    8724: [0.08198, 0.69224, 0, 0, 0.77778],
    8726: [0.08167, 0.58167, 0, 0, 0.77778],
    8733: [0, 0.69224, 0, 0, 0.77778],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8737: [0, 0.69224, 0, 0, 0.72222],
    8738: [0.03517, 0.52239, 0, 0, 0.72222],
    8739: [0.08167, 0.58167, 0, 0, 0.22222],
    8740: [0.25142, 0.74111, 0, 0, 0.27778],
    8741: [0.08167, 0.58167, 0, 0, 0.38889],
    8742: [0.25142, 0.74111, 0, 0, 0.5],
    8756: [0, 0.69224, 0, 0, 0.66667],
    8757: [0, 0.69224, 0, 0, 0.66667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8765: [-0.13313, 0.37788, 0, 0, 0.77778],
    8769: [-0.13313, 0.36687, 0, 0, 0.77778],
    8770: [-0.03625, 0.46375, 0, 0, 0.77778],
    8774: [0.30274, 0.79383, 0, 0, 0.77778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8778: [0.08167, 0.58167, 0, 0, 0.77778],
    8782: [0.06062, 0.54986, 0, 0, 0.77778],
    8783: [0.06062, 0.54986, 0, 0, 0.77778],
    8785: [0.08198, 0.58198, 0, 0, 0.77778],
    8786: [0.08198, 0.58198, 0, 0, 0.77778],
    8787: [0.08198, 0.58198, 0, 0, 0.77778],
    8790: [0, 0.69224, 0, 0, 0.77778],
    8791: [0.22958, 0.72958, 0, 0, 0.77778],
    8796: [0.08198, 0.91667, 0, 0, 0.77778],
    8806: [0.25583, 0.75583, 0, 0, 0.77778],
    8807: [0.25583, 0.75583, 0, 0, 0.77778],
    8808: [0.25142, 0.75726, 0, 0, 0.77778],
    8809: [0.25142, 0.75726, 0, 0, 0.77778],
    8812: [0.25583, 0.75583, 0, 0, 0.5],
    8814: [0.20576, 0.70576, 0, 0, 0.77778],
    8815: [0.20576, 0.70576, 0, 0, 0.77778],
    8816: [0.30274, 0.79383, 0, 0, 0.77778],
    8817: [0.30274, 0.79383, 0, 0, 0.77778],
    8818: [0.22958, 0.72958, 0, 0, 0.77778],
    8819: [0.22958, 0.72958, 0, 0, 0.77778],
    8822: [0.1808, 0.675, 0, 0, 0.77778],
    8823: [0.1808, 0.675, 0, 0, 0.77778],
    8828: [0.13667, 0.63667, 0, 0, 0.77778],
    8829: [0.13667, 0.63667, 0, 0, 0.77778],
    8830: [0.22958, 0.72958, 0, 0, 0.77778],
    8831: [0.22958, 0.72958, 0, 0, 0.77778],
    8832: [0.20576, 0.70576, 0, 0, 0.77778],
    8833: [0.20576, 0.70576, 0, 0, 0.77778],
    8840: [0.30274, 0.79383, 0, 0, 0.77778],
    8841: [0.30274, 0.79383, 0, 0, 0.77778],
    8842: [0.13597, 0.63597, 0, 0, 0.77778],
    8843: [0.13597, 0.63597, 0, 0, 0.77778],
    8847: [0.03517, 0.54986, 0, 0, 0.77778],
    8848: [0.03517, 0.54986, 0, 0, 0.77778],
    8858: [0.08198, 0.58198, 0, 0, 0.77778],
    8859: [0.08198, 0.58198, 0, 0, 0.77778],
    8861: [0.08198, 0.58198, 0, 0, 0.77778],
    8862: [0, 0.675, 0, 0, 0.77778],
    8863: [0, 0.675, 0, 0, 0.77778],
    8864: [0, 0.675, 0, 0, 0.77778],
    8865: [0, 0.675, 0, 0, 0.77778],
    8872: [0, 0.69224, 0, 0, 0.61111],
    8873: [0, 0.69224, 0, 0, 0.72222],
    8874: [0, 0.69224, 0, 0, 0.88889],
    8876: [0, 0.68889, 0, 0, 0.61111],
    8877: [0, 0.68889, 0, 0, 0.61111],
    8878: [0, 0.68889, 0, 0, 0.72222],
    8879: [0, 0.68889, 0, 0, 0.72222],
    8882: [0.03517, 0.54986, 0, 0, 0.77778],
    8883: [0.03517, 0.54986, 0, 0, 0.77778],
    8884: [0.13667, 0.63667, 0, 0, 0.77778],
    8885: [0.13667, 0.63667, 0, 0, 0.77778],
    8888: [0, 0.54986, 0, 0, 1.11111],
    8890: [0.19444, 0.43056, 0, 0, 0.55556],
    8891: [0.19444, 0.69224, 0, 0, 0.61111],
    8892: [0.19444, 0.69224, 0, 0, 0.61111],
    8901: [0, 0.54986, 0, 0, 0.27778],
    8903: [0.08167, 0.58167, 0, 0, 0.77778],
    8905: [0.08167, 0.58167, 0, 0, 0.77778],
    8906: [0.08167, 0.58167, 0, 0, 0.77778],
    8907: [0, 0.69224, 0, 0, 0.77778],
    8908: [0, 0.69224, 0, 0, 0.77778],
    8909: [-0.03598, 0.46402, 0, 0, 0.77778],
    8910: [0, 0.54986, 0, 0, 0.76042],
    8911: [0, 0.54986, 0, 0, 0.76042],
    8912: [0.03517, 0.54986, 0, 0, 0.77778],
    8913: [0.03517, 0.54986, 0, 0, 0.77778],
    8914: [0, 0.54986, 0, 0, 0.66667],
    8915: [0, 0.54986, 0, 0, 0.66667],
    8916: [0, 0.69224, 0, 0, 0.66667],
    8918: [0.0391, 0.5391, 0, 0, 0.77778],
    8919: [0.0391, 0.5391, 0, 0, 0.77778],
    8920: [0.03517, 0.54986, 0, 0, 1.33334],
    8921: [0.03517, 0.54986, 0, 0, 1.33334],
    8922: [0.38569, 0.88569, 0, 0, 0.77778],
    8923: [0.38569, 0.88569, 0, 0, 0.77778],
    8926: [0.13667, 0.63667, 0, 0, 0.77778],
    8927: [0.13667, 0.63667, 0, 0, 0.77778],
    8928: [0.30274, 0.79383, 0, 0, 0.77778],
    8929: [0.30274, 0.79383, 0, 0, 0.77778],
    8934: [0.23222, 0.74111, 0, 0, 0.77778],
    8935: [0.23222, 0.74111, 0, 0, 0.77778],
    8936: [0.23222, 0.74111, 0, 0, 0.77778],
    8937: [0.23222, 0.74111, 0, 0, 0.77778],
    8938: [0.20576, 0.70576, 0, 0, 0.77778],
    8939: [0.20576, 0.70576, 0, 0, 0.77778],
    8940: [0.30274, 0.79383, 0, 0, 0.77778],
    8941: [0.30274, 0.79383, 0, 0, 0.77778],
    8994: [0.19444, 0.69224, 0, 0, 0.77778],
    8995: [0.19444, 0.69224, 0, 0, 0.77778],
    9416: [0.15559, 0.69224, 0, 0, 0.90222],
    9484: [0, 0.69224, 0, 0, 0.5],
    9488: [0, 0.69224, 0, 0, 0.5],
    9492: [0, 0.37788, 0, 0, 0.5],
    9496: [0, 0.37788, 0, 0, 0.5],
    9585: [0.19444, 0.68889, 0, 0, 0.88889],
    9586: [0.19444, 0.74111, 0, 0, 0.88889],
    9632: [0, 0.675, 0, 0, 0.77778],
    9633: [0, 0.675, 0, 0, 0.77778],
    9650: [0, 0.54986, 0, 0, 0.72222],
    9651: [0, 0.54986, 0, 0, 0.72222],
    9654: [0.03517, 0.54986, 0, 0, 0.77778],
    9660: [0, 0.54986, 0, 0, 0.72222],
    9661: [0, 0.54986, 0, 0, 0.72222],
    9664: [0.03517, 0.54986, 0, 0, 0.77778],
    9674: [0.11111, 0.69224, 0, 0, 0.66667],
    9733: [0.19444, 0.69224, 0, 0, 0.94445],
    10003: [0, 0.69224, 0, 0, 0.83334],
    10016: [0, 0.69224, 0, 0, 0.83334],
    10731: [0.11111, 0.69224, 0, 0, 0.66667],
    10846: [0.19444, 0.75583, 0, 0, 0.61111],
    10877: [0.13667, 0.63667, 0, 0, 0.77778],
    10878: [0.13667, 0.63667, 0, 0, 0.77778],
    10885: [0.25583, 0.75583, 0, 0, 0.77778],
    10886: [0.25583, 0.75583, 0, 0, 0.77778],
    10887: [0.13597, 0.63597, 0, 0, 0.77778],
    10888: [0.13597, 0.63597, 0, 0, 0.77778],
    10889: [0.26167, 0.75726, 0, 0, 0.77778],
    10890: [0.26167, 0.75726, 0, 0, 0.77778],
    10891: [0.48256, 0.98256, 0, 0, 0.77778],
    10892: [0.48256, 0.98256, 0, 0, 0.77778],
    10901: [0.13667, 0.63667, 0, 0, 0.77778],
    10902: [0.13667, 0.63667, 0, 0, 0.77778],
    10933: [0.25142, 0.75726, 0, 0, 0.77778],
    10934: [0.25142, 0.75726, 0, 0, 0.77778],
    10935: [0.26167, 0.75726, 0, 0, 0.77778],
    10936: [0.26167, 0.75726, 0, 0, 0.77778],
    10937: [0.26167, 0.75726, 0, 0, 0.77778],
    10938: [0.26167, 0.75726, 0, 0, 0.77778],
    10949: [0.25583, 0.75583, 0, 0, 0.77778],
    10950: [0.25583, 0.75583, 0, 0, 0.77778],
    10955: [0.28481, 0.79383, 0, 0, 0.77778],
    10956: [0.28481, 0.79383, 0, 0, 0.77778],
    57350: [0.08167, 0.58167, 0, 0, 0.22222],
    57351: [0.08167, 0.58167, 0, 0, 0.38889],
    57352: [0.08167, 0.58167, 0, 0, 0.77778],
    57353: [0, 0.43056, 0.04028, 0, 0.66667],
    57356: [0.25142, 0.75726, 0, 0, 0.77778],
    57357: [0.25142, 0.75726, 0, 0, 0.77778],
    57358: [0.41951, 0.91951, 0, 0, 0.77778],
    57359: [0.30274, 0.79383, 0, 0, 0.77778],
    57360: [0.30274, 0.79383, 0, 0, 0.77778],
    57361: [0.41951, 0.91951, 0, 0, 0.77778],
    57366: [0.25142, 0.75726, 0, 0, 0.77778],
    57367: [0.25142, 0.75726, 0, 0, 0.77778],
    57368: [0.25142, 0.75726, 0, 0, 0.77778],
    57369: [0.25142, 0.75726, 0, 0, 0.77778],
    57370: [0.13597, 0.63597, 0, 0, 0.77778],
    57371: [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68333, 0, 0.19445, 0.79847],
    66: [0, 0.68333, 0.03041, 0.13889, 0.65681],
    67: [0, 0.68333, 0.05834, 0.13889, 0.52653],
    68: [0, 0.68333, 0.02778, 0.08334, 0.77139],
    69: [0, 0.68333, 0.08944, 0.11111, 0.52778],
    70: [0, 0.68333, 0.09931, 0.11111, 0.71875],
    71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    72: [0, 0.68333, 965e-5, 0.11111, 0.84452],
    73: [0, 0.68333, 0.07382, 0, 0.54452],
    74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    75: [0, 0.68333, 0.01445, 0.05556, 0.76195],
    76: [0, 0.68333, 0, 0.13889, 0.68972],
    77: [0, 0.68333, 0, 0.13889, 1.2009],
    78: [0, 0.68333, 0.14736, 0.08334, 0.82049],
    79: [0, 0.68333, 0.02778, 0.11111, 0.79611],
    80: [0, 0.68333, 0.08222, 0.08334, 0.69556],
    81: [0.09722, 0.68333, 0, 0.11111, 0.81667],
    82: [0, 0.68333, 0, 0.08334, 0.8475],
    83: [0, 0.68333, 0.075, 0.13889, 0.60556],
    84: [0, 0.68333, 0.25417, 0, 0.54464],
    85: [0, 0.68333, 0.09931, 0.08334, 0.62583],
    86: [0, 0.68333, 0.08222, 0, 0.61278],
    87: [0, 0.68333, 0.08222, 0.08334, 0.98778],
    88: [0, 0.68333, 0.14643, 0.13889, 0.7133],
    89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    90: [0, 0.68333, 0.07944, 0.13889, 0.72473],
    160: [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69141, 0, 0, 0.29574],
    34: [0, 0.69141, 0, 0, 0.21471],
    38: [0, 0.69141, 0, 0, 0.73786],
    39: [0, 0.69141, 0, 0, 0.21201],
    40: [0.24982, 0.74947, 0, 0, 0.38865],
    41: [0.24982, 0.74947, 0, 0, 0.38865],
    42: [0, 0.62119, 0, 0, 0.27764],
    43: [0.08319, 0.58283, 0, 0, 0.75623],
    44: [0, 0.10803, 0, 0, 0.27764],
    45: [0.08319, 0.58283, 0, 0, 0.75623],
    46: [0, 0.10803, 0, 0, 0.27764],
    47: [0.24982, 0.74947, 0, 0, 0.50181],
    48: [0, 0.47534, 0, 0, 0.50181],
    49: [0, 0.47534, 0, 0, 0.50181],
    50: [0, 0.47534, 0, 0, 0.50181],
    51: [0.18906, 0.47534, 0, 0, 0.50181],
    52: [0.18906, 0.47534, 0, 0, 0.50181],
    53: [0.18906, 0.47534, 0, 0, 0.50181],
    54: [0, 0.69141, 0, 0, 0.50181],
    55: [0.18906, 0.47534, 0, 0, 0.50181],
    56: [0, 0.69141, 0, 0, 0.50181],
    57: [0.18906, 0.47534, 0, 0, 0.50181],
    58: [0, 0.47534, 0, 0, 0.21606],
    59: [0.12604, 0.47534, 0, 0, 0.21606],
    61: [-0.13099, 0.36866, 0, 0, 0.75623],
    63: [0, 0.69141, 0, 0, 0.36245],
    65: [0, 0.69141, 0, 0, 0.7176],
    66: [0, 0.69141, 0, 0, 0.88397],
    67: [0, 0.69141, 0, 0, 0.61254],
    68: [0, 0.69141, 0, 0, 0.83158],
    69: [0, 0.69141, 0, 0, 0.66278],
    70: [0.12604, 0.69141, 0, 0, 0.61119],
    71: [0, 0.69141, 0, 0, 0.78539],
    72: [0.06302, 0.69141, 0, 0, 0.7203],
    73: [0, 0.69141, 0, 0, 0.55448],
    74: [0.12604, 0.69141, 0, 0, 0.55231],
    75: [0, 0.69141, 0, 0, 0.66845],
    76: [0, 0.69141, 0, 0, 0.66602],
    77: [0, 0.69141, 0, 0, 1.04953],
    78: [0, 0.69141, 0, 0, 0.83212],
    79: [0, 0.69141, 0, 0, 0.82699],
    80: [0.18906, 0.69141, 0, 0, 0.82753],
    81: [0.03781, 0.69141, 0, 0, 0.82699],
    82: [0, 0.69141, 0, 0, 0.82807],
    83: [0, 0.69141, 0, 0, 0.82861],
    84: [0, 0.69141, 0, 0, 0.66899],
    85: [0, 0.69141, 0, 0, 0.64576],
    86: [0, 0.69141, 0, 0, 0.83131],
    87: [0, 0.69141, 0, 0, 1.04602],
    88: [0, 0.69141, 0, 0, 0.71922],
    89: [0.18906, 0.69141, 0, 0, 0.83293],
    90: [0.12604, 0.69141, 0, 0, 0.60201],
    91: [0.24982, 0.74947, 0, 0, 0.27764],
    93: [0.24982, 0.74947, 0, 0, 0.27764],
    94: [0, 0.69141, 0, 0, 0.49965],
    97: [0, 0.47534, 0, 0, 0.50046],
    98: [0, 0.69141, 0, 0, 0.51315],
    99: [0, 0.47534, 0, 0, 0.38946],
    100: [0, 0.62119, 0, 0, 0.49857],
    101: [0, 0.47534, 0, 0, 0.40053],
    102: [0.18906, 0.69141, 0, 0, 0.32626],
    103: [0.18906, 0.47534, 0, 0, 0.5037],
    104: [0.18906, 0.69141, 0, 0, 0.52126],
    105: [0, 0.69141, 0, 0, 0.27899],
    106: [0, 0.69141, 0, 0, 0.28088],
    107: [0, 0.69141, 0, 0, 0.38946],
    108: [0, 0.69141, 0, 0, 0.27953],
    109: [0, 0.47534, 0, 0, 0.76676],
    110: [0, 0.47534, 0, 0, 0.52666],
    111: [0, 0.47534, 0, 0, 0.48885],
    112: [0.18906, 0.52396, 0, 0, 0.50046],
    113: [0.18906, 0.47534, 0, 0, 0.48912],
    114: [0, 0.47534, 0, 0, 0.38919],
    115: [0, 0.47534, 0, 0, 0.44266],
    116: [0, 0.62119, 0, 0, 0.33301],
    117: [0, 0.47534, 0, 0, 0.5172],
    118: [0, 0.52396, 0, 0, 0.5118],
    119: [0, 0.52396, 0, 0, 0.77351],
    120: [0.18906, 0.47534, 0, 0, 0.38865],
    121: [0.18906, 0.47534, 0, 0, 0.49884],
    122: [0.18906, 0.47534, 0, 0, 0.39054],
    160: [0, 0, 0, 0, 0.25],
    8216: [0, 0.69141, 0, 0, 0.21471],
    8217: [0, 0.69141, 0, 0, 0.21471],
    58112: [0, 0.62119, 0, 0, 0.49749],
    58113: [0, 0.62119, 0, 0, 0.4983],
    58114: [0.18906, 0.69141, 0, 0, 0.33328],
    58115: [0.18906, 0.69141, 0, 0, 0.32923],
    58116: [0.18906, 0.47534, 0, 0, 0.50343],
    58117: [0, 0.69141, 0, 0, 0.33301],
    58118: [0, 0.62119, 0, 0, 0.33409],
    58119: [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.35],
    34: [0, 0.69444, 0, 0, 0.60278],
    35: [0.19444, 0.69444, 0, 0, 0.95833],
    36: [0.05556, 0.75, 0, 0, 0.575],
    37: [0.05556, 0.75, 0, 0, 0.95833],
    38: [0, 0.69444, 0, 0, 0.89444],
    39: [0, 0.69444, 0, 0, 0.31944],
    40: [0.25, 0.75, 0, 0, 0.44722],
    41: [0.25, 0.75, 0, 0, 0.44722],
    42: [0, 0.75, 0, 0, 0.575],
    43: [0.13333, 0.63333, 0, 0, 0.89444],
    44: [0.19444, 0.15556, 0, 0, 0.31944],
    45: [0, 0.44444, 0, 0, 0.38333],
    46: [0, 0.15556, 0, 0, 0.31944],
    47: [0.25, 0.75, 0, 0, 0.575],
    48: [0, 0.64444, 0, 0, 0.575],
    49: [0, 0.64444, 0, 0, 0.575],
    50: [0, 0.64444, 0, 0, 0.575],
    51: [0, 0.64444, 0, 0, 0.575],
    52: [0, 0.64444, 0, 0, 0.575],
    53: [0, 0.64444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0, 0.64444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0, 0.64444, 0, 0, 0.575],
    58: [0, 0.44444, 0, 0, 0.31944],
    59: [0.19444, 0.44444, 0, 0, 0.31944],
    60: [0.08556, 0.58556, 0, 0, 0.89444],
    61: [-0.10889, 0.39111, 0, 0, 0.89444],
    62: [0.08556, 0.58556, 0, 0, 0.89444],
    63: [0, 0.69444, 0, 0, 0.54305],
    64: [0, 0.69444, 0, 0, 0.89444],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0, 0, 0.81805],
    67: [0, 0.68611, 0, 0, 0.83055],
    68: [0, 0.68611, 0, 0, 0.88194],
    69: [0, 0.68611, 0, 0, 0.75555],
    70: [0, 0.68611, 0, 0, 0.72361],
    71: [0, 0.68611, 0, 0, 0.90416],
    72: [0, 0.68611, 0, 0, 0.9],
    73: [0, 0.68611, 0, 0, 0.43611],
    74: [0, 0.68611, 0, 0, 0.59444],
    75: [0, 0.68611, 0, 0, 0.90138],
    76: [0, 0.68611, 0, 0, 0.69166],
    77: [0, 0.68611, 0, 0, 1.09166],
    78: [0, 0.68611, 0, 0, 0.9],
    79: [0, 0.68611, 0, 0, 0.86388],
    80: [0, 0.68611, 0, 0, 0.78611],
    81: [0.19444, 0.68611, 0, 0, 0.86388],
    82: [0, 0.68611, 0, 0, 0.8625],
    83: [0, 0.68611, 0, 0, 0.63889],
    84: [0, 0.68611, 0, 0, 0.8],
    85: [0, 0.68611, 0, 0, 0.88472],
    86: [0, 0.68611, 0.01597, 0, 0.86944],
    87: [0, 0.68611, 0.01597, 0, 1.18888],
    88: [0, 0.68611, 0, 0, 0.86944],
    89: [0, 0.68611, 0.02875, 0, 0.86944],
    90: [0, 0.68611, 0, 0, 0.70277],
    91: [0.25, 0.75, 0, 0, 0.31944],
    92: [0.25, 0.75, 0, 0, 0.575],
    93: [0.25, 0.75, 0, 0, 0.31944],
    94: [0, 0.69444, 0, 0, 0.575],
    95: [0.31, 0.13444, 0.03194, 0, 0.575],
    97: [0, 0.44444, 0, 0, 0.55902],
    98: [0, 0.69444, 0, 0, 0.63889],
    99: [0, 0.44444, 0, 0, 0.51111],
    100: [0, 0.69444, 0, 0, 0.63889],
    101: [0, 0.44444, 0, 0, 0.52708],
    102: [0, 0.69444, 0.10903, 0, 0.35139],
    103: [0.19444, 0.44444, 0.01597, 0, 0.575],
    104: [0, 0.69444, 0, 0, 0.63889],
    105: [0, 0.69444, 0, 0, 0.31944],
    106: [0.19444, 0.69444, 0, 0, 0.35139],
    107: [0, 0.69444, 0, 0, 0.60694],
    108: [0, 0.69444, 0, 0, 0.31944],
    109: [0, 0.44444, 0, 0, 0.95833],
    110: [0, 0.44444, 0, 0, 0.63889],
    111: [0, 0.44444, 0, 0, 0.575],
    112: [0.19444, 0.44444, 0, 0, 0.63889],
    113: [0.19444, 0.44444, 0, 0, 0.60694],
    114: [0, 0.44444, 0, 0, 0.47361],
    115: [0, 0.44444, 0, 0, 0.45361],
    116: [0, 0.63492, 0, 0, 0.44722],
    117: [0, 0.44444, 0, 0, 0.63889],
    118: [0, 0.44444, 0.01597, 0, 0.60694],
    119: [0, 0.44444, 0.01597, 0, 0.83055],
    120: [0, 0.44444, 0, 0, 0.60694],
    121: [0.19444, 0.44444, 0.01597, 0, 0.60694],
    122: [0, 0.44444, 0, 0, 0.51111],
    123: [0.25, 0.75, 0, 0, 0.575],
    124: [0.25, 0.75, 0, 0, 0.31944],
    125: [0.25, 0.75, 0, 0, 0.575],
    126: [0.35, 0.34444, 0, 0, 0.575],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.86853],
    168: [0, 0.69444, 0, 0, 0.575],
    172: [0, 0.44444, 0, 0, 0.76666],
    176: [0, 0.69444, 0, 0, 0.86944],
    177: [0.13333, 0.63333, 0, 0, 0.89444],
    184: [0.17014, 0, 0, 0, 0.51111],
    198: [0, 0.68611, 0, 0, 1.04166],
    215: [0.13333, 0.63333, 0, 0, 0.89444],
    216: [0.04861, 0.73472, 0, 0, 0.89444],
    223: [0, 0.69444, 0, 0, 0.59722],
    230: [0, 0.44444, 0, 0, 0.83055],
    247: [0.13333, 0.63333, 0, 0, 0.89444],
    248: [0.09722, 0.54167, 0, 0, 0.575],
    305: [0, 0.44444, 0, 0, 0.31944],
    338: [0, 0.68611, 0, 0, 1.16944],
    339: [0, 0.44444, 0, 0, 0.89444],
    567: [0.19444, 0.44444, 0, 0, 0.35139],
    710: [0, 0.69444, 0, 0, 0.575],
    711: [0, 0.63194, 0, 0, 0.575],
    713: [0, 0.59611, 0, 0, 0.575],
    714: [0, 0.69444, 0, 0, 0.575],
    715: [0, 0.69444, 0, 0, 0.575],
    728: [0, 0.69444, 0, 0, 0.575],
    729: [0, 0.69444, 0, 0, 0.31944],
    730: [0, 0.69444, 0, 0, 0.86944],
    732: [0, 0.69444, 0, 0, 0.575],
    733: [0, 0.69444, 0, 0, 0.575],
    915: [0, 0.68611, 0, 0, 0.69166],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0, 0, 0.89444],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0, 0, 0.76666],
    928: [0, 0.68611, 0, 0, 0.9],
    931: [0, 0.68611, 0, 0, 0.83055],
    933: [0, 0.68611, 0, 0, 0.89444],
    934: [0, 0.68611, 0, 0, 0.83055],
    936: [0, 0.68611, 0, 0, 0.89444],
    937: [0, 0.68611, 0, 0, 0.83055],
    8211: [0, 0.44444, 0.03194, 0, 0.575],
    8212: [0, 0.44444, 0.03194, 0, 1.14999],
    8216: [0, 0.69444, 0, 0, 0.31944],
    8217: [0, 0.69444, 0, 0, 0.31944],
    8220: [0, 0.69444, 0, 0, 0.60278],
    8221: [0, 0.69444, 0, 0, 0.60278],
    8224: [0.19444, 0.69444, 0, 0, 0.51111],
    8225: [0.19444, 0.69444, 0, 0, 0.51111],
    8242: [0, 0.55556, 0, 0, 0.34444],
    8407: [0, 0.72444, 0.15486, 0, 0.575],
    8463: [0, 0.69444, 0, 0, 0.66759],
    8465: [0, 0.69444, 0, 0, 0.83055],
    8467: [0, 0.69444, 0, 0, 0.47361],
    8472: [0.19444, 0.44444, 0, 0, 0.74027],
    8476: [0, 0.69444, 0, 0, 0.83055],
    8501: [0, 0.69444, 0, 0, 0.70277],
    8592: [-0.10889, 0.39111, 0, 0, 1.14999],
    8593: [0.19444, 0.69444, 0, 0, 0.575],
    8594: [-0.10889, 0.39111, 0, 0, 1.14999],
    8595: [0.19444, 0.69444, 0, 0, 0.575],
    8596: [-0.10889, 0.39111, 0, 0, 1.14999],
    8597: [0.25, 0.75, 0, 0, 0.575],
    8598: [0.19444, 0.69444, 0, 0, 1.14999],
    8599: [0.19444, 0.69444, 0, 0, 1.14999],
    8600: [0.19444, 0.69444, 0, 0, 1.14999],
    8601: [0.19444, 0.69444, 0, 0, 1.14999],
    8636: [-0.10889, 0.39111, 0, 0, 1.14999],
    8637: [-0.10889, 0.39111, 0, 0, 1.14999],
    8640: [-0.10889, 0.39111, 0, 0, 1.14999],
    8641: [-0.10889, 0.39111, 0, 0, 1.14999],
    8656: [-0.10889, 0.39111, 0, 0, 1.14999],
    8657: [0.19444, 0.69444, 0, 0, 0.70277],
    8658: [-0.10889, 0.39111, 0, 0, 1.14999],
    8659: [0.19444, 0.69444, 0, 0, 0.70277],
    8660: [-0.10889, 0.39111, 0, 0, 1.14999],
    8661: [0.25, 0.75, 0, 0, 0.70277],
    8704: [0, 0.69444, 0, 0, 0.63889],
    8706: [0, 0.69444, 0.06389, 0, 0.62847],
    8707: [0, 0.69444, 0, 0, 0.63889],
    8709: [0.05556, 0.75, 0, 0, 0.575],
    8711: [0, 0.68611, 0, 0, 0.95833],
    8712: [0.08556, 0.58556, 0, 0, 0.76666],
    8715: [0.08556, 0.58556, 0, 0, 0.76666],
    8722: [0.13333, 0.63333, 0, 0, 0.89444],
    8723: [0.13333, 0.63333, 0, 0, 0.89444],
    8725: [0.25, 0.75, 0, 0, 0.575],
    8726: [0.25, 0.75, 0, 0, 0.575],
    8727: [-0.02778, 0.47222, 0, 0, 0.575],
    8728: [-0.02639, 0.47361, 0, 0, 0.575],
    8729: [-0.02639, 0.47361, 0, 0, 0.575],
    8730: [0.18, 0.82, 0, 0, 0.95833],
    8733: [0, 0.44444, 0, 0, 0.89444],
    8734: [0, 0.44444, 0, 0, 1.14999],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.31944],
    8741: [0.25, 0.75, 0, 0, 0.575],
    8743: [0, 0.55556, 0, 0, 0.76666],
    8744: [0, 0.55556, 0, 0, 0.76666],
    8745: [0, 0.55556, 0, 0, 0.76666],
    8746: [0, 0.55556, 0, 0, 0.76666],
    8747: [0.19444, 0.69444, 0.12778, 0, 0.56875],
    8764: [-0.10889, 0.39111, 0, 0, 0.89444],
    8768: [0.19444, 0.69444, 0, 0, 0.31944],
    8771: [222e-5, 0.50222, 0, 0, 0.89444],
    8773: [0.027, 0.638, 0, 0, 0.894],
    8776: [0.02444, 0.52444, 0, 0, 0.89444],
    8781: [222e-5, 0.50222, 0, 0, 0.89444],
    8801: [222e-5, 0.50222, 0, 0, 0.89444],
    8804: [0.19667, 0.69667, 0, 0, 0.89444],
    8805: [0.19667, 0.69667, 0, 0, 0.89444],
    8810: [0.08556, 0.58556, 0, 0, 1.14999],
    8811: [0.08556, 0.58556, 0, 0, 1.14999],
    8826: [0.08556, 0.58556, 0, 0, 0.89444],
    8827: [0.08556, 0.58556, 0, 0, 0.89444],
    8834: [0.08556, 0.58556, 0, 0, 0.89444],
    8835: [0.08556, 0.58556, 0, 0, 0.89444],
    8838: [0.19667, 0.69667, 0, 0, 0.89444],
    8839: [0.19667, 0.69667, 0, 0, 0.89444],
    8846: [0, 0.55556, 0, 0, 0.76666],
    8849: [0.19667, 0.69667, 0, 0, 0.89444],
    8850: [0.19667, 0.69667, 0, 0, 0.89444],
    8851: [0, 0.55556, 0, 0, 0.76666],
    8852: [0, 0.55556, 0, 0, 0.76666],
    8853: [0.13333, 0.63333, 0, 0, 0.89444],
    8854: [0.13333, 0.63333, 0, 0, 0.89444],
    8855: [0.13333, 0.63333, 0, 0, 0.89444],
    8856: [0.13333, 0.63333, 0, 0, 0.89444],
    8857: [0.13333, 0.63333, 0, 0, 0.89444],
    8866: [0, 0.69444, 0, 0, 0.70277],
    8867: [0, 0.69444, 0, 0, 0.70277],
    8868: [0, 0.69444, 0, 0, 0.89444],
    8869: [0, 0.69444, 0, 0, 0.89444],
    8900: [-0.02639, 0.47361, 0, 0, 0.575],
    8901: [-0.02639, 0.47361, 0, 0, 0.31944],
    8902: [-0.02778, 0.47222, 0, 0, 0.575],
    8968: [0.25, 0.75, 0, 0, 0.51111],
    8969: [0.25, 0.75, 0, 0, 0.51111],
    8970: [0.25, 0.75, 0, 0, 0.51111],
    8971: [0.25, 0.75, 0, 0, 0.51111],
    8994: [-0.13889, 0.36111, 0, 0, 1.14999],
    8995: [-0.13889, 0.36111, 0, 0, 1.14999],
    9651: [0.19444, 0.69444, 0, 0, 1.02222],
    9657: [-0.02778, 0.47222, 0, 0, 0.575],
    9661: [0.19444, 0.69444, 0, 0, 1.02222],
    9667: [-0.02778, 0.47222, 0, 0, 0.575],
    9711: [0.19444, 0.69444, 0, 0, 1.14999],
    9824: [0.12963, 0.69444, 0, 0, 0.89444],
    9825: [0.12963, 0.69444, 0, 0, 0.89444],
    9826: [0.12963, 0.69444, 0, 0, 0.89444],
    9827: [0.12963, 0.69444, 0, 0, 0.89444],
    9837: [0, 0.75, 0, 0, 0.44722],
    9838: [0.19444, 0.69444, 0, 0, 0.44722],
    9839: [0.19444, 0.69444, 0, 0, 0.44722],
    10216: [0.25, 0.75, 0, 0, 0.44722],
    10217: [0.25, 0.75, 0, 0, 0.44722],
    10815: [0, 0.68611, 0, 0, 0.9],
    10927: [0.19667, 0.69667, 0, 0, 0.89444],
    10928: [0.19667, 0.69667, 0, 0, 0.89444],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.11417, 0, 0.38611],
    34: [0, 0.69444, 0.07939, 0, 0.62055],
    35: [0.19444, 0.69444, 0.06833, 0, 0.94444],
    37: [0.05556, 0.75, 0.12861, 0, 0.94444],
    38: [0, 0.69444, 0.08528, 0, 0.88555],
    39: [0, 0.69444, 0.12945, 0, 0.35555],
    40: [0.25, 0.75, 0.15806, 0, 0.47333],
    41: [0.25, 0.75, 0.03306, 0, 0.47333],
    42: [0, 0.75, 0.14333, 0, 0.59111],
    43: [0.10333, 0.60333, 0.03306, 0, 0.88555],
    44: [0.19444, 0.14722, 0, 0, 0.35555],
    45: [0, 0.44444, 0.02611, 0, 0.41444],
    46: [0, 0.14722, 0, 0, 0.35555],
    47: [0.25, 0.75, 0.15806, 0, 0.59111],
    48: [0, 0.64444, 0.13167, 0, 0.59111],
    49: [0, 0.64444, 0.13167, 0, 0.59111],
    50: [0, 0.64444, 0.13167, 0, 0.59111],
    51: [0, 0.64444, 0.13167, 0, 0.59111],
    52: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    53: [0, 0.64444, 0.13167, 0, 0.59111],
    54: [0, 0.64444, 0.13167, 0, 0.59111],
    55: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    56: [0, 0.64444, 0.13167, 0, 0.59111],
    57: [0, 0.64444, 0.13167, 0, 0.59111],
    58: [0, 0.44444, 0.06695, 0, 0.35555],
    59: [0.19444, 0.44444, 0.06695, 0, 0.35555],
    61: [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    63: [0, 0.69444, 0.11472, 0, 0.59111],
    64: [0, 0.69444, 0.09208, 0, 0.88555],
    65: [0, 0.68611, 0, 0, 0.86555],
    66: [0, 0.68611, 0.0992, 0, 0.81666],
    67: [0, 0.68611, 0.14208, 0, 0.82666],
    68: [0, 0.68611, 0.09062, 0, 0.87555],
    69: [0, 0.68611, 0.11431, 0, 0.75666],
    70: [0, 0.68611, 0.12903, 0, 0.72722],
    71: [0, 0.68611, 0.07347, 0, 0.89527],
    72: [0, 0.68611, 0.17208, 0, 0.8961],
    73: [0, 0.68611, 0.15681, 0, 0.47166],
    74: [0, 0.68611, 0.145, 0, 0.61055],
    75: [0, 0.68611, 0.14208, 0, 0.89499],
    76: [0, 0.68611, 0, 0, 0.69777],
    77: [0, 0.68611, 0.17208, 0, 1.07277],
    78: [0, 0.68611, 0.17208, 0, 0.8961],
    79: [0, 0.68611, 0.09062, 0, 0.85499],
    80: [0, 0.68611, 0.0992, 0, 0.78721],
    81: [0.19444, 0.68611, 0.09062, 0, 0.85499],
    82: [0, 0.68611, 0.02559, 0, 0.85944],
    83: [0, 0.68611, 0.11264, 0, 0.64999],
    84: [0, 0.68611, 0.12903, 0, 0.7961],
    85: [0, 0.68611, 0.17208, 0, 0.88083],
    86: [0, 0.68611, 0.18625, 0, 0.86555],
    87: [0, 0.68611, 0.18625, 0, 1.15999],
    88: [0, 0.68611, 0.15681, 0, 0.86555],
    89: [0, 0.68611, 0.19803, 0, 0.86555],
    90: [0, 0.68611, 0.14208, 0, 0.70888],
    91: [0.25, 0.75, 0.1875, 0, 0.35611],
    93: [0.25, 0.75, 0.09972, 0, 0.35611],
    94: [0, 0.69444, 0.06709, 0, 0.59111],
    95: [0.31, 0.13444, 0.09811, 0, 0.59111],
    97: [0, 0.44444, 0.09426, 0, 0.59111],
    98: [0, 0.69444, 0.07861, 0, 0.53222],
    99: [0, 0.44444, 0.05222, 0, 0.53222],
    100: [0, 0.69444, 0.10861, 0, 0.59111],
    101: [0, 0.44444, 0.085, 0, 0.53222],
    102: [0.19444, 0.69444, 0.21778, 0, 0.4],
    103: [0.19444, 0.44444, 0.105, 0, 0.53222],
    104: [0, 0.69444, 0.09426, 0, 0.59111],
    105: [0, 0.69326, 0.11387, 0, 0.35555],
    106: [0.19444, 0.69326, 0.1672, 0, 0.35555],
    107: [0, 0.69444, 0.11111, 0, 0.53222],
    108: [0, 0.69444, 0.10861, 0, 0.29666],
    109: [0, 0.44444, 0.09426, 0, 0.94444],
    110: [0, 0.44444, 0.09426, 0, 0.64999],
    111: [0, 0.44444, 0.07861, 0, 0.59111],
    112: [0.19444, 0.44444, 0.07861, 0, 0.59111],
    113: [0.19444, 0.44444, 0.105, 0, 0.53222],
    114: [0, 0.44444, 0.11111, 0, 0.50167],
    115: [0, 0.44444, 0.08167, 0, 0.48694],
    116: [0, 0.63492, 0.09639, 0, 0.385],
    117: [0, 0.44444, 0.09426, 0, 0.62055],
    118: [0, 0.44444, 0.11111, 0, 0.53222],
    119: [0, 0.44444, 0.11111, 0, 0.76777],
    120: [0, 0.44444, 0.12583, 0, 0.56055],
    121: [0.19444, 0.44444, 0.105, 0, 0.56166],
    122: [0, 0.44444, 0.13889, 0, 0.49055],
    126: [0.35, 0.34444, 0.11472, 0, 0.59111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0.11473, 0, 0.59111],
    176: [0, 0.69444, 0, 0, 0.94888],
    184: [0.17014, 0, 0, 0, 0.53222],
    198: [0, 0.68611, 0.11431, 0, 1.02277],
    216: [0.04861, 0.73472, 0.09062, 0, 0.88555],
    223: [0.19444, 0.69444, 0.09736, 0, 0.665],
    230: [0, 0.44444, 0.085, 0, 0.82666],
    248: [0.09722, 0.54167, 0.09458, 0, 0.59111],
    305: [0, 0.44444, 0.09426, 0, 0.35555],
    338: [0, 0.68611, 0.11431, 0, 1.14054],
    339: [0, 0.44444, 0.085, 0, 0.82666],
    567: [0.19444, 0.44444, 0.04611, 0, 0.385],
    710: [0, 0.69444, 0.06709, 0, 0.59111],
    711: [0, 0.63194, 0.08271, 0, 0.59111],
    713: [0, 0.59444, 0.10444, 0, 0.59111],
    714: [0, 0.69444, 0.08528, 0, 0.59111],
    715: [0, 0.69444, 0, 0, 0.59111],
    728: [0, 0.69444, 0.10333, 0, 0.59111],
    729: [0, 0.69444, 0.12945, 0, 0.35555],
    730: [0, 0.69444, 0, 0, 0.94888],
    732: [0, 0.69444, 0.11472, 0, 0.59111],
    733: [0, 0.69444, 0.11472, 0, 0.59111],
    915: [0, 0.68611, 0.12903, 0, 0.69777],
    916: [0, 0.68611, 0, 0, 0.94444],
    920: [0, 0.68611, 0.09062, 0, 0.88555],
    923: [0, 0.68611, 0, 0, 0.80666],
    926: [0, 0.68611, 0.15092, 0, 0.76777],
    928: [0, 0.68611, 0.17208, 0, 0.8961],
    931: [0, 0.68611, 0.11431, 0, 0.82666],
    933: [0, 0.68611, 0.10778, 0, 0.88555],
    934: [0, 0.68611, 0.05632, 0, 0.82666],
    936: [0, 0.68611, 0.10778, 0, 0.88555],
    937: [0, 0.68611, 0.0992, 0, 0.82666],
    8211: [0, 0.44444, 0.09811, 0, 0.59111],
    8212: [0, 0.44444, 0.09811, 0, 1.18221],
    8216: [0, 0.69444, 0.12945, 0, 0.35555],
    8217: [0, 0.69444, 0.12945, 0, 0.35555],
    8220: [0, 0.69444, 0.16772, 0, 0.62055],
    8221: [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.12417, 0, 0.30667],
    34: [0, 0.69444, 0.06961, 0, 0.51444],
    35: [0.19444, 0.69444, 0.06616, 0, 0.81777],
    37: [0.05556, 0.75, 0.13639, 0, 0.81777],
    38: [0, 0.69444, 0.09694, 0, 0.76666],
    39: [0, 0.69444, 0.12417, 0, 0.30667],
    40: [0.25, 0.75, 0.16194, 0, 0.40889],
    41: [0.25, 0.75, 0.03694, 0, 0.40889],
    42: [0, 0.75, 0.14917, 0, 0.51111],
    43: [0.05667, 0.56167, 0.03694, 0, 0.76666],
    44: [0.19444, 0.10556, 0, 0, 0.30667],
    45: [0, 0.43056, 0.02826, 0, 0.35778],
    46: [0, 0.10556, 0, 0, 0.30667],
    47: [0.25, 0.75, 0.16194, 0, 0.51111],
    48: [0, 0.64444, 0.13556, 0, 0.51111],
    49: [0, 0.64444, 0.13556, 0, 0.51111],
    50: [0, 0.64444, 0.13556, 0, 0.51111],
    51: [0, 0.64444, 0.13556, 0, 0.51111],
    52: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    53: [0, 0.64444, 0.13556, 0, 0.51111],
    54: [0, 0.64444, 0.13556, 0, 0.51111],
    55: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    56: [0, 0.64444, 0.13556, 0, 0.51111],
    57: [0, 0.64444, 0.13556, 0, 0.51111],
    58: [0, 0.43056, 0.0582, 0, 0.30667],
    59: [0.19444, 0.43056, 0.0582, 0, 0.30667],
    61: [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    63: [0, 0.69444, 0.1225, 0, 0.51111],
    64: [0, 0.69444, 0.09597, 0, 0.76666],
    65: [0, 0.68333, 0, 0, 0.74333],
    66: [0, 0.68333, 0.10257, 0, 0.70389],
    67: [0, 0.68333, 0.14528, 0, 0.71555],
    68: [0, 0.68333, 0.09403, 0, 0.755],
    69: [0, 0.68333, 0.12028, 0, 0.67833],
    70: [0, 0.68333, 0.13305, 0, 0.65277],
    71: [0, 0.68333, 0.08722, 0, 0.77361],
    72: [0, 0.68333, 0.16389, 0, 0.74333],
    73: [0, 0.68333, 0.15806, 0, 0.38555],
    74: [0, 0.68333, 0.14028, 0, 0.525],
    75: [0, 0.68333, 0.14528, 0, 0.76888],
    76: [0, 0.68333, 0, 0, 0.62722],
    77: [0, 0.68333, 0.16389, 0, 0.89666],
    78: [0, 0.68333, 0.16389, 0, 0.74333],
    79: [0, 0.68333, 0.09403, 0, 0.76666],
    80: [0, 0.68333, 0.10257, 0, 0.67833],
    81: [0.19444, 0.68333, 0.09403, 0, 0.76666],
    82: [0, 0.68333, 0.03868, 0, 0.72944],
    83: [0, 0.68333, 0.11972, 0, 0.56222],
    84: [0, 0.68333, 0.13305, 0, 0.71555],
    85: [0, 0.68333, 0.16389, 0, 0.74333],
    86: [0, 0.68333, 0.18361, 0, 0.74333],
    87: [0, 0.68333, 0.18361, 0, 0.99888],
    88: [0, 0.68333, 0.15806, 0, 0.74333],
    89: [0, 0.68333, 0.19383, 0, 0.74333],
    90: [0, 0.68333, 0.14528, 0, 0.61333],
    91: [0.25, 0.75, 0.1875, 0, 0.30667],
    93: [0.25, 0.75, 0.10528, 0, 0.30667],
    94: [0, 0.69444, 0.06646, 0, 0.51111],
    95: [0.31, 0.12056, 0.09208, 0, 0.51111],
    97: [0, 0.43056, 0.07671, 0, 0.51111],
    98: [0, 0.69444, 0.06312, 0, 0.46],
    99: [0, 0.43056, 0.05653, 0, 0.46],
    100: [0, 0.69444, 0.10333, 0, 0.51111],
    101: [0, 0.43056, 0.07514, 0, 0.46],
    102: [0.19444, 0.69444, 0.21194, 0, 0.30667],
    103: [0.19444, 0.43056, 0.08847, 0, 0.46],
    104: [0, 0.69444, 0.07671, 0, 0.51111],
    105: [0, 0.65536, 0.1019, 0, 0.30667],
    106: [0.19444, 0.65536, 0.14467, 0, 0.30667],
    107: [0, 0.69444, 0.10764, 0, 0.46],
    108: [0, 0.69444, 0.10333, 0, 0.25555],
    109: [0, 0.43056, 0.07671, 0, 0.81777],
    110: [0, 0.43056, 0.07671, 0, 0.56222],
    111: [0, 0.43056, 0.06312, 0, 0.51111],
    112: [0.19444, 0.43056, 0.06312, 0, 0.51111],
    113: [0.19444, 0.43056, 0.08847, 0, 0.46],
    114: [0, 0.43056, 0.10764, 0, 0.42166],
    115: [0, 0.43056, 0.08208, 0, 0.40889],
    116: [0, 0.61508, 0.09486, 0, 0.33222],
    117: [0, 0.43056, 0.07671, 0, 0.53666],
    118: [0, 0.43056, 0.10764, 0, 0.46],
    119: [0, 0.43056, 0.10764, 0, 0.66444],
    120: [0, 0.43056, 0.12042, 0, 0.46389],
    121: [0.19444, 0.43056, 0.08847, 0, 0.48555],
    122: [0, 0.43056, 0.12292, 0, 0.40889],
    126: [0.35, 0.31786, 0.11585, 0, 0.51111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.66786, 0.10474, 0, 0.51111],
    176: [0, 0.69444, 0, 0, 0.83129],
    184: [0.17014, 0, 0, 0, 0.46],
    198: [0, 0.68333, 0.12028, 0, 0.88277],
    216: [0.04861, 0.73194, 0.09403, 0, 0.76666],
    223: [0.19444, 0.69444, 0.10514, 0, 0.53666],
    230: [0, 0.43056, 0.07514, 0, 0.71555],
    248: [0.09722, 0.52778, 0.09194, 0, 0.51111],
    338: [0, 0.68333, 0.12028, 0, 0.98499],
    339: [0, 0.43056, 0.07514, 0, 0.71555],
    710: [0, 0.69444, 0.06646, 0, 0.51111],
    711: [0, 0.62847, 0.08295, 0, 0.51111],
    713: [0, 0.56167, 0.10333, 0, 0.51111],
    714: [0, 0.69444, 0.09694, 0, 0.51111],
    715: [0, 0.69444, 0, 0, 0.51111],
    728: [0, 0.69444, 0.10806, 0, 0.51111],
    729: [0, 0.66786, 0.11752, 0, 0.30667],
    730: [0, 0.69444, 0, 0, 0.83129],
    732: [0, 0.66786, 0.11585, 0, 0.51111],
    733: [0, 0.69444, 0.1225, 0, 0.51111],
    915: [0, 0.68333, 0.13305, 0, 0.62722],
    916: [0, 0.68333, 0, 0, 0.81777],
    920: [0, 0.68333, 0.09403, 0, 0.76666],
    923: [0, 0.68333, 0, 0, 0.69222],
    926: [0, 0.68333, 0.15294, 0, 0.66444],
    928: [0, 0.68333, 0.16389, 0, 0.74333],
    931: [0, 0.68333, 0.12028, 0, 0.71555],
    933: [0, 0.68333, 0.11111, 0, 0.76666],
    934: [0, 0.68333, 0.05986, 0, 0.71555],
    936: [0, 0.68333, 0.11111, 0, 0.76666],
    937: [0, 0.68333, 0.10257, 0, 0.71555],
    8211: [0, 0.43056, 0.09208, 0, 0.51111],
    8212: [0, 0.43056, 0.09208, 0, 1.02222],
    8216: [0, 0.69444, 0.12417, 0, 0.30667],
    8217: [0, 0.69444, 0.12417, 0, 0.30667],
    8220: [0, 0.69444, 0.1685, 0, 0.51444],
    8221: [0, 0.69444, 0.06961, 0, 0.51444],
    8463: [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.27778],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.77778],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.19444, 0.10556, 0, 0, 0.27778],
    45: [0, 0.43056, 0, 0, 0.33333],
    46: [0, 0.10556, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.64444, 0, 0, 0.5],
    49: [0, 0.64444, 0, 0, 0.5],
    50: [0, 0.64444, 0, 0, 0.5],
    51: [0, 0.64444, 0, 0, 0.5],
    52: [0, 0.64444, 0, 0, 0.5],
    53: [0, 0.64444, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0, 0.64444, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0, 0.64444, 0, 0, 0.5],
    58: [0, 0.43056, 0, 0, 0.27778],
    59: [0.19444, 0.43056, 0, 0, 0.27778],
    60: [0.0391, 0.5391, 0, 0, 0.77778],
    61: [-0.13313, 0.36687, 0, 0, 0.77778],
    62: [0.0391, 0.5391, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.77778],
    65: [0, 0.68333, 0, 0, 0.75],
    66: [0, 0.68333, 0, 0, 0.70834],
    67: [0, 0.68333, 0, 0, 0.72222],
    68: [0, 0.68333, 0, 0, 0.76389],
    69: [0, 0.68333, 0, 0, 0.68056],
    70: [0, 0.68333, 0, 0, 0.65278],
    71: [0, 0.68333, 0, 0, 0.78472],
    72: [0, 0.68333, 0, 0, 0.75],
    73: [0, 0.68333, 0, 0, 0.36111],
    74: [0, 0.68333, 0, 0, 0.51389],
    75: [0, 0.68333, 0, 0, 0.77778],
    76: [0, 0.68333, 0, 0, 0.625],
    77: [0, 0.68333, 0, 0, 0.91667],
    78: [0, 0.68333, 0, 0, 0.75],
    79: [0, 0.68333, 0, 0, 0.77778],
    80: [0, 0.68333, 0, 0, 0.68056],
    81: [0.19444, 0.68333, 0, 0, 0.77778],
    82: [0, 0.68333, 0, 0, 0.73611],
    83: [0, 0.68333, 0, 0, 0.55556],
    84: [0, 0.68333, 0, 0, 0.72222],
    85: [0, 0.68333, 0, 0, 0.75],
    86: [0, 0.68333, 0.01389, 0, 0.75],
    87: [0, 0.68333, 0.01389, 0, 1.02778],
    88: [0, 0.68333, 0, 0, 0.75],
    89: [0, 0.68333, 0.025, 0, 0.75],
    90: [0, 0.68333, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.27778],
    92: [0.25, 0.75, 0, 0, 0.5],
    93: [0.25, 0.75, 0, 0, 0.27778],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.31, 0.12056, 0.02778, 0, 0.5],
    97: [0, 0.43056, 0, 0, 0.5],
    98: [0, 0.69444, 0, 0, 0.55556],
    99: [0, 0.43056, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.55556],
    101: [0, 0.43056, 0, 0, 0.44445],
    102: [0, 0.69444, 0.07778, 0, 0.30556],
    103: [0.19444, 0.43056, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.55556],
    105: [0, 0.66786, 0, 0, 0.27778],
    106: [0.19444, 0.66786, 0, 0, 0.30556],
    107: [0, 0.69444, 0, 0, 0.52778],
    108: [0, 0.69444, 0, 0, 0.27778],
    109: [0, 0.43056, 0, 0, 0.83334],
    110: [0, 0.43056, 0, 0, 0.55556],
    111: [0, 0.43056, 0, 0, 0.5],
    112: [0.19444, 0.43056, 0, 0, 0.55556],
    113: [0.19444, 0.43056, 0, 0, 0.52778],
    114: [0, 0.43056, 0, 0, 0.39167],
    115: [0, 0.43056, 0, 0, 0.39445],
    116: [0, 0.61508, 0, 0, 0.38889],
    117: [0, 0.43056, 0, 0, 0.55556],
    118: [0, 0.43056, 0.01389, 0, 0.52778],
    119: [0, 0.43056, 0.01389, 0, 0.72222],
    120: [0, 0.43056, 0, 0, 0.52778],
    121: [0.19444, 0.43056, 0.01389, 0, 0.52778],
    122: [0, 0.43056, 0, 0, 0.44445],
    123: [0.25, 0.75, 0, 0, 0.5],
    124: [0.25, 0.75, 0, 0, 0.27778],
    125: [0.25, 0.75, 0, 0, 0.5],
    126: [0.35, 0.31786, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.76909],
    167: [0.19444, 0.69444, 0, 0, 0.44445],
    168: [0, 0.66786, 0, 0, 0.5],
    172: [0, 0.43056, 0, 0, 0.66667],
    176: [0, 0.69444, 0, 0, 0.75],
    177: [0.08333, 0.58333, 0, 0, 0.77778],
    182: [0.19444, 0.69444, 0, 0, 0.61111],
    184: [0.17014, 0, 0, 0, 0.44445],
    198: [0, 0.68333, 0, 0, 0.90278],
    215: [0.08333, 0.58333, 0, 0, 0.77778],
    216: [0.04861, 0.73194, 0, 0, 0.77778],
    223: [0, 0.69444, 0, 0, 0.5],
    230: [0, 0.43056, 0, 0, 0.72222],
    247: [0.08333, 0.58333, 0, 0, 0.77778],
    248: [0.09722, 0.52778, 0, 0, 0.5],
    305: [0, 0.43056, 0, 0, 0.27778],
    338: [0, 0.68333, 0, 0, 1.01389],
    339: [0, 0.43056, 0, 0, 0.77778],
    567: [0.19444, 0.43056, 0, 0, 0.30556],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.62847, 0, 0, 0.5],
    713: [0, 0.56778, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.66786, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.75],
    732: [0, 0.66786, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.68333, 0, 0, 0.625],
    916: [0, 0.68333, 0, 0, 0.83334],
    920: [0, 0.68333, 0, 0, 0.77778],
    923: [0, 0.68333, 0, 0, 0.69445],
    926: [0, 0.68333, 0, 0, 0.66667],
    928: [0, 0.68333, 0, 0, 0.75],
    931: [0, 0.68333, 0, 0, 0.72222],
    933: [0, 0.68333, 0, 0, 0.77778],
    934: [0, 0.68333, 0, 0, 0.72222],
    936: [0, 0.68333, 0, 0, 0.77778],
    937: [0, 0.68333, 0, 0, 0.72222],
    8211: [0, 0.43056, 0.02778, 0, 0.5],
    8212: [0, 0.43056, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5],
    8224: [0.19444, 0.69444, 0, 0, 0.44445],
    8225: [0.19444, 0.69444, 0, 0, 0.44445],
    8230: [0, 0.123, 0, 0, 1.172],
    8242: [0, 0.55556, 0, 0, 0.275],
    8407: [0, 0.71444, 0.15382, 0, 0.5],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8465: [0, 0.69444, 0, 0, 0.72222],
    8467: [0, 0.69444, 0, 0.11111, 0.41667],
    8472: [0.19444, 0.43056, 0, 0.11111, 0.63646],
    8476: [0, 0.69444, 0, 0, 0.72222],
    8501: [0, 0.69444, 0, 0, 0.61111],
    8592: [-0.13313, 0.36687, 0, 0, 1],
    8593: [0.19444, 0.69444, 0, 0, 0.5],
    8594: [-0.13313, 0.36687, 0, 0, 1],
    8595: [0.19444, 0.69444, 0, 0, 0.5],
    8596: [-0.13313, 0.36687, 0, 0, 1],
    8597: [0.25, 0.75, 0, 0, 0.5],
    8598: [0.19444, 0.69444, 0, 0, 1],
    8599: [0.19444, 0.69444, 0, 0, 1],
    8600: [0.19444, 0.69444, 0, 0, 1],
    8601: [0.19444, 0.69444, 0, 0, 1],
    8614: [0.011, 0.511, 0, 0, 1],
    8617: [0.011, 0.511, 0, 0, 1.126],
    8618: [0.011, 0.511, 0, 0, 1.126],
    8636: [-0.13313, 0.36687, 0, 0, 1],
    8637: [-0.13313, 0.36687, 0, 0, 1],
    8640: [-0.13313, 0.36687, 0, 0, 1],
    8641: [-0.13313, 0.36687, 0, 0, 1],
    8652: [0.011, 0.671, 0, 0, 1],
    8656: [-0.13313, 0.36687, 0, 0, 1],
    8657: [0.19444, 0.69444, 0, 0, 0.61111],
    8658: [-0.13313, 0.36687, 0, 0, 1],
    8659: [0.19444, 0.69444, 0, 0, 0.61111],
    8660: [-0.13313, 0.36687, 0, 0, 1],
    8661: [0.25, 0.75, 0, 0, 0.61111],
    8704: [0, 0.69444, 0, 0, 0.55556],
    8706: [0, 0.69444, 0.05556, 0.08334, 0.5309],
    8707: [0, 0.69444, 0, 0, 0.55556],
    8709: [0.05556, 0.75, 0, 0, 0.5],
    8711: [0, 0.68333, 0, 0, 0.83334],
    8712: [0.0391, 0.5391, 0, 0, 0.66667],
    8715: [0.0391, 0.5391, 0, 0, 0.66667],
    8722: [0.08333, 0.58333, 0, 0, 0.77778],
    8723: [0.08333, 0.58333, 0, 0, 0.77778],
    8725: [0.25, 0.75, 0, 0, 0.5],
    8726: [0.25, 0.75, 0, 0, 0.5],
    8727: [-0.03472, 0.46528, 0, 0, 0.5],
    8728: [-0.05555, 0.44445, 0, 0, 0.5],
    8729: [-0.05555, 0.44445, 0, 0, 0.5],
    8730: [0.2, 0.8, 0, 0, 0.83334],
    8733: [0, 0.43056, 0, 0, 0.77778],
    8734: [0, 0.43056, 0, 0, 1],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.27778],
    8741: [0.25, 0.75, 0, 0, 0.5],
    8743: [0, 0.55556, 0, 0, 0.66667],
    8744: [0, 0.55556, 0, 0, 0.66667],
    8745: [0, 0.55556, 0, 0, 0.66667],
    8746: [0, 0.55556, 0, 0, 0.66667],
    8747: [0.19444, 0.69444, 0.11111, 0, 0.41667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8768: [0.19444, 0.69444, 0, 0, 0.27778],
    8771: [-0.03625, 0.46375, 0, 0, 0.77778],
    8773: [-0.022, 0.589, 0, 0, 0.778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8781: [-0.03625, 0.46375, 0, 0, 0.77778],
    8784: [-0.133, 0.673, 0, 0, 0.778],
    8801: [-0.03625, 0.46375, 0, 0, 0.77778],
    8804: [0.13597, 0.63597, 0, 0, 0.77778],
    8805: [0.13597, 0.63597, 0, 0, 0.77778],
    8810: [0.0391, 0.5391, 0, 0, 1],
    8811: [0.0391, 0.5391, 0, 0, 1],
    8826: [0.0391, 0.5391, 0, 0, 0.77778],
    8827: [0.0391, 0.5391, 0, 0, 0.77778],
    8834: [0.0391, 0.5391, 0, 0, 0.77778],
    8835: [0.0391, 0.5391, 0, 0, 0.77778],
    8838: [0.13597, 0.63597, 0, 0, 0.77778],
    8839: [0.13597, 0.63597, 0, 0, 0.77778],
    8846: [0, 0.55556, 0, 0, 0.66667],
    8849: [0.13597, 0.63597, 0, 0, 0.77778],
    8850: [0.13597, 0.63597, 0, 0, 0.77778],
    8851: [0, 0.55556, 0, 0, 0.66667],
    8852: [0, 0.55556, 0, 0, 0.66667],
    8853: [0.08333, 0.58333, 0, 0, 0.77778],
    8854: [0.08333, 0.58333, 0, 0, 0.77778],
    8855: [0.08333, 0.58333, 0, 0, 0.77778],
    8856: [0.08333, 0.58333, 0, 0, 0.77778],
    8857: [0.08333, 0.58333, 0, 0, 0.77778],
    8866: [0, 0.69444, 0, 0, 0.61111],
    8867: [0, 0.69444, 0, 0, 0.61111],
    8868: [0, 0.69444, 0, 0, 0.77778],
    8869: [0, 0.69444, 0, 0, 0.77778],
    8872: [0.249, 0.75, 0, 0, 0.867],
    8900: [-0.05555, 0.44445, 0, 0, 0.5],
    8901: [-0.05555, 0.44445, 0, 0, 0.27778],
    8902: [-0.03472, 0.46528, 0, 0, 0.5],
    8904: [5e-3, 0.505, 0, 0, 0.9],
    8942: [0.03, 0.903, 0, 0, 0.278],
    8943: [-0.19, 0.313, 0, 0, 1.172],
    8945: [-0.1, 0.823, 0, 0, 1.282],
    8968: [0.25, 0.75, 0, 0, 0.44445],
    8969: [0.25, 0.75, 0, 0, 0.44445],
    8970: [0.25, 0.75, 0, 0, 0.44445],
    8971: [0.25, 0.75, 0, 0, 0.44445],
    8994: [-0.14236, 0.35764, 0, 0, 1],
    8995: [-0.14236, 0.35764, 0, 0, 1],
    9136: [0.244, 0.744, 0, 0, 0.412],
    9137: [0.244, 0.745, 0, 0, 0.412],
    9651: [0.19444, 0.69444, 0, 0, 0.88889],
    9657: [-0.03472, 0.46528, 0, 0, 0.5],
    9661: [0.19444, 0.69444, 0, 0, 0.88889],
    9667: [-0.03472, 0.46528, 0, 0, 0.5],
    9711: [0.19444, 0.69444, 0, 0, 1],
    9824: [0.12963, 0.69444, 0, 0, 0.77778],
    9825: [0.12963, 0.69444, 0, 0, 0.77778],
    9826: [0.12963, 0.69444, 0, 0, 0.77778],
    9827: [0.12963, 0.69444, 0, 0, 0.77778],
    9837: [0, 0.75, 0, 0, 0.38889],
    9838: [0.19444, 0.69444, 0, 0, 0.38889],
    9839: [0.19444, 0.69444, 0, 0, 0.38889],
    10216: [0.25, 0.75, 0, 0, 0.38889],
    10217: [0.25, 0.75, 0, 0, 0.38889],
    10222: [0.244, 0.744, 0, 0, 0.412],
    10223: [0.244, 0.745, 0, 0, 0.412],
    10229: [0.011, 0.511, 0, 0, 1.609],
    10230: [0.011, 0.511, 0, 0, 1.638],
    10231: [0.011, 0.511, 0, 0, 1.859],
    10232: [0.024, 0.525, 0, 0, 1.609],
    10233: [0.024, 0.525, 0, 0, 1.638],
    10234: [0.024, 0.525, 0, 0, 1.858],
    10236: [0.011, 0.511, 0, 0, 1.638],
    10815: [0, 0.68333, 0, 0, 0.75],
    10927: [0.13597, 0.63597, 0, 0, 0.77778],
    10928: [0.13597, 0.63597, 0, 0, 0.77778],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.44444, 0, 0, 0.575],
    49: [0, 0.44444, 0, 0, 0.575],
    50: [0, 0.44444, 0, 0, 0.575],
    51: [0.19444, 0.44444, 0, 0, 0.575],
    52: [0.19444, 0.44444, 0, 0, 0.575],
    53: [0.19444, 0.44444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0.19444, 0.44444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0.19444, 0.44444, 0, 0, 0.575],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0.04835, 0, 0.8664],
    67: [0, 0.68611, 0.06979, 0, 0.81694],
    68: [0, 0.68611, 0.03194, 0, 0.93812],
    69: [0, 0.68611, 0.05451, 0, 0.81007],
    70: [0, 0.68611, 0.15972, 0, 0.68889],
    71: [0, 0.68611, 0, 0, 0.88673],
    72: [0, 0.68611, 0.08229, 0, 0.98229],
    73: [0, 0.68611, 0.07778, 0, 0.51111],
    74: [0, 0.68611, 0.10069, 0, 0.63125],
    75: [0, 0.68611, 0.06979, 0, 0.97118],
    76: [0, 0.68611, 0, 0, 0.75555],
    77: [0, 0.68611, 0.11424, 0, 1.14201],
    78: [0, 0.68611, 0.11424, 0, 0.95034],
    79: [0, 0.68611, 0.03194, 0, 0.83666],
    80: [0, 0.68611, 0.15972, 0, 0.72309],
    81: [0.19444, 0.68611, 0, 0, 0.86861],
    82: [0, 0.68611, 421e-5, 0, 0.87235],
    83: [0, 0.68611, 0.05382, 0, 0.69271],
    84: [0, 0.68611, 0.15972, 0, 0.63663],
    85: [0, 0.68611, 0.11424, 0, 0.80027],
    86: [0, 0.68611, 0.25555, 0, 0.67778],
    87: [0, 0.68611, 0.15972, 0, 1.09305],
    88: [0, 0.68611, 0.07778, 0, 0.94722],
    89: [0, 0.68611, 0.25555, 0, 0.67458],
    90: [0, 0.68611, 0.06979, 0, 0.77257],
    97: [0, 0.44444, 0, 0, 0.63287],
    98: [0, 0.69444, 0, 0, 0.52083],
    99: [0, 0.44444, 0, 0, 0.51342],
    100: [0, 0.69444, 0, 0, 0.60972],
    101: [0, 0.44444, 0, 0, 0.55361],
    102: [0.19444, 0.69444, 0.11042, 0, 0.56806],
    103: [0.19444, 0.44444, 0.03704, 0, 0.5449],
    104: [0, 0.69444, 0, 0, 0.66759],
    105: [0, 0.69326, 0, 0, 0.4048],
    106: [0.19444, 0.69326, 0.0622, 0, 0.47083],
    107: [0, 0.69444, 0.01852, 0, 0.6037],
    108: [0, 0.69444, 88e-4, 0, 0.34815],
    109: [0, 0.44444, 0, 0, 1.0324],
    110: [0, 0.44444, 0, 0, 0.71296],
    111: [0, 0.44444, 0, 0, 0.58472],
    112: [0.19444, 0.44444, 0, 0, 0.60092],
    113: [0.19444, 0.44444, 0.03704, 0, 0.54213],
    114: [0, 0.44444, 0.03194, 0, 0.5287],
    115: [0, 0.44444, 0, 0, 0.53125],
    116: [0, 0.63492, 0, 0, 0.41528],
    117: [0, 0.44444, 0, 0, 0.68102],
    118: [0, 0.44444, 0.03704, 0, 0.56666],
    119: [0, 0.44444, 0.02778, 0, 0.83148],
    120: [0, 0.44444, 0, 0, 0.65903],
    121: [0.19444, 0.44444, 0.03704, 0, 0.59028],
    122: [0, 0.44444, 0.04213, 0, 0.55509],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68611, 0.15972, 0, 0.65694],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0.03194, 0, 0.86722],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0.07458, 0, 0.84125],
    928: [0, 0.68611, 0.08229, 0, 0.98229],
    931: [0, 0.68611, 0.05451, 0, 0.88507],
    933: [0, 0.68611, 0.15972, 0, 0.67083],
    934: [0, 0.68611, 0, 0, 0.76666],
    936: [0, 0.68611, 0.11653, 0, 0.71402],
    937: [0, 0.68611, 0.04835, 0, 0.8789],
    945: [0, 0.44444, 0, 0, 0.76064],
    946: [0.19444, 0.69444, 0.03403, 0, 0.65972],
    947: [0.19444, 0.44444, 0.06389, 0, 0.59003],
    948: [0, 0.69444, 0.03819, 0, 0.52222],
    949: [0, 0.44444, 0, 0, 0.52882],
    950: [0.19444, 0.69444, 0.06215, 0, 0.50833],
    951: [0.19444, 0.44444, 0.03704, 0, 0.6],
    952: [0, 0.69444, 0.03194, 0, 0.5618],
    953: [0, 0.44444, 0, 0, 0.41204],
    954: [0, 0.44444, 0, 0, 0.66759],
    955: [0, 0.69444, 0, 0, 0.67083],
    956: [0.19444, 0.44444, 0, 0, 0.70787],
    957: [0, 0.44444, 0.06898, 0, 0.57685],
    958: [0.19444, 0.69444, 0.03021, 0, 0.50833],
    959: [0, 0.44444, 0, 0, 0.58472],
    960: [0, 0.44444, 0.03704, 0, 0.68241],
    961: [0.19444, 0.44444, 0, 0, 0.6118],
    962: [0.09722, 0.44444, 0.07917, 0, 0.42361],
    963: [0, 0.44444, 0.03704, 0, 0.68588],
    964: [0, 0.44444, 0.13472, 0, 0.52083],
    965: [0, 0.44444, 0.03704, 0, 0.63055],
    966: [0.19444, 0.44444, 0, 0, 0.74722],
    967: [0.19444, 0.44444, 0, 0, 0.71805],
    968: [0.19444, 0.69444, 0.03704, 0, 0.75833],
    969: [0, 0.44444, 0.03704, 0, 0.71782],
    977: [0, 0.69444, 0, 0, 0.69155],
    981: [0.19444, 0.69444, 0, 0, 0.7125],
    982: [0, 0.44444, 0.03194, 0, 0.975],
    1009: [0.19444, 0.44444, 0, 0, 0.6118],
    1013: [0, 0.44444, 0, 0, 0.48333],
    57649: [0, 0.44444, 0, 0, 0.39352],
    57911: [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.43056, 0, 0, 0.5],
    49: [0, 0.43056, 0, 0, 0.5],
    50: [0, 0.43056, 0, 0, 0.5],
    51: [0.19444, 0.43056, 0, 0, 0.5],
    52: [0.19444, 0.43056, 0, 0, 0.5],
    53: [0.19444, 0.43056, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0.19444, 0.43056, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0.19444, 0.43056, 0, 0, 0.5],
    65: [0, 0.68333, 0, 0.13889, 0.75],
    66: [0, 0.68333, 0.05017, 0.08334, 0.75851],
    67: [0, 0.68333, 0.07153, 0.08334, 0.71472],
    68: [0, 0.68333, 0.02778, 0.05556, 0.82792],
    69: [0, 0.68333, 0.05764, 0.08334, 0.7382],
    70: [0, 0.68333, 0.13889, 0.08334, 0.64306],
    71: [0, 0.68333, 0, 0.08334, 0.78625],
    72: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    73: [0, 0.68333, 0.07847, 0.11111, 0.43958],
    74: [0, 0.68333, 0.09618, 0.16667, 0.55451],
    75: [0, 0.68333, 0.07153, 0.05556, 0.84931],
    76: [0, 0.68333, 0, 0.02778, 0.68056],
    77: [0, 0.68333, 0.10903, 0.08334, 0.97014],
    78: [0, 0.68333, 0.10903, 0.08334, 0.80347],
    79: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    80: [0, 0.68333, 0.13889, 0.08334, 0.64201],
    81: [0.19444, 0.68333, 0, 0.08334, 0.79056],
    82: [0, 0.68333, 773e-5, 0.08334, 0.75929],
    83: [0, 0.68333, 0.05764, 0.08334, 0.6132],
    84: [0, 0.68333, 0.13889, 0.08334, 0.58438],
    85: [0, 0.68333, 0.10903, 0.02778, 0.68278],
    86: [0, 0.68333, 0.22222, 0, 0.58333],
    87: [0, 0.68333, 0.13889, 0, 0.94445],
    88: [0, 0.68333, 0.07847, 0.08334, 0.82847],
    89: [0, 0.68333, 0.22222, 0, 0.58056],
    90: [0, 0.68333, 0.07153, 0.08334, 0.68264],
    97: [0, 0.43056, 0, 0, 0.52859],
    98: [0, 0.69444, 0, 0, 0.42917],
    99: [0, 0.43056, 0, 0.05556, 0.43276],
    100: [0, 0.69444, 0, 0.16667, 0.52049],
    101: [0, 0.43056, 0, 0.05556, 0.46563],
    102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    104: [0, 0.69444, 0, 0, 0.57616],
    105: [0, 0.65952, 0, 0, 0.34451],
    106: [0.19444, 0.65952, 0.05724, 0, 0.41181],
    107: [0, 0.69444, 0.03148, 0, 0.5206],
    108: [0, 0.69444, 0.01968, 0.08334, 0.29838],
    109: [0, 0.43056, 0, 0, 0.87801],
    110: [0, 0.43056, 0, 0, 0.60023],
    111: [0, 0.43056, 0, 0.05556, 0.48472],
    112: [0.19444, 0.43056, 0, 0.08334, 0.50313],
    113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    114: [0, 0.43056, 0.02778, 0.05556, 0.45116],
    115: [0, 0.43056, 0, 0.05556, 0.46875],
    116: [0, 0.61508, 0, 0.08334, 0.36111],
    117: [0, 0.43056, 0, 0.02778, 0.57246],
    118: [0, 0.43056, 0.03588, 0.02778, 0.48472],
    119: [0, 0.43056, 0.02691, 0.08334, 0.71592],
    120: [0, 0.43056, 0, 0.02778, 0.57153],
    121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    122: [0, 0.43056, 0.04398, 0.05556, 0.46505],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68333, 0.13889, 0.08334, 0.61528],
    916: [0, 0.68333, 0, 0.16667, 0.83334],
    920: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    923: [0, 0.68333, 0, 0.16667, 0.69445],
    926: [0, 0.68333, 0.07569, 0.08334, 0.74236],
    928: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    931: [0, 0.68333, 0.05764, 0.08334, 0.77986],
    933: [0, 0.68333, 0.13889, 0.05556, 0.58333],
    934: [0, 0.68333, 0, 0.08334, 0.66667],
    936: [0, 0.68333, 0.11, 0.05556, 0.61222],
    937: [0, 0.68333, 0.05017, 0.08334, 0.7724],
    945: [0, 0.43056, 37e-4, 0.02778, 0.6397],
    946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    947: [0.19444, 0.43056, 0.05556, 0, 0.51773],
    948: [0, 0.69444, 0.03785, 0.05556, 0.44444],
    949: [0, 0.43056, 0, 0.08334, 0.46632],
    950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    952: [0, 0.69444, 0.02778, 0.08334, 0.46944],
    953: [0, 0.43056, 0, 0.05556, 0.35394],
    954: [0, 0.43056, 0, 0, 0.57616],
    955: [0, 0.69444, 0, 0, 0.58334],
    956: [0.19444, 0.43056, 0, 0.02778, 0.60255],
    957: [0, 0.43056, 0.06366, 0.02778, 0.49398],
    958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    959: [0, 0.43056, 0, 0.05556, 0.48472],
    960: [0, 0.43056, 0.03588, 0, 0.57003],
    961: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    963: [0, 0.43056, 0.03588, 0, 0.57141],
    964: [0, 0.43056, 0.1132, 0.02778, 0.43715],
    965: [0, 0.43056, 0.03588, 0.02778, 0.54028],
    966: [0.19444, 0.43056, 0, 0.08334, 0.65417],
    967: [0.19444, 0.43056, 0, 0.05556, 0.62569],
    968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    969: [0, 0.43056, 0.03588, 0, 0.62245],
    977: [0, 0.69444, 0, 0.08334, 0.59144],
    981: [0.19444, 0.69444, 0, 0.08334, 0.59583],
    982: [0, 0.43056, 0.02778, 0, 0.82813],
    1009: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    1013: [0, 0.43056, 0, 0.05556, 0.4059],
    57649: [0, 0.43056, 0, 0.02778, 0.32246],
    57911: [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.36667],
    34: [0, 0.69444, 0, 0, 0.55834],
    35: [0.19444, 0.69444, 0, 0, 0.91667],
    36: [0.05556, 0.75, 0, 0, 0.55],
    37: [0.05556, 0.75, 0, 0, 1.02912],
    38: [0, 0.69444, 0, 0, 0.83056],
    39: [0, 0.69444, 0, 0, 0.30556],
    40: [0.25, 0.75, 0, 0, 0.42778],
    41: [0.25, 0.75, 0, 0, 0.42778],
    42: [0, 0.75, 0, 0, 0.55],
    43: [0.11667, 0.61667, 0, 0, 0.85556],
    44: [0.10556, 0.13056, 0, 0, 0.30556],
    45: [0, 0.45833, 0, 0, 0.36667],
    46: [0, 0.13056, 0, 0, 0.30556],
    47: [0.25, 0.75, 0, 0, 0.55],
    48: [0, 0.69444, 0, 0, 0.55],
    49: [0, 0.69444, 0, 0, 0.55],
    50: [0, 0.69444, 0, 0, 0.55],
    51: [0, 0.69444, 0, 0, 0.55],
    52: [0, 0.69444, 0, 0, 0.55],
    53: [0, 0.69444, 0, 0, 0.55],
    54: [0, 0.69444, 0, 0, 0.55],
    55: [0, 0.69444, 0, 0, 0.55],
    56: [0, 0.69444, 0, 0, 0.55],
    57: [0, 0.69444, 0, 0, 0.55],
    58: [0, 0.45833, 0, 0, 0.30556],
    59: [0.10556, 0.45833, 0, 0, 0.30556],
    61: [-0.09375, 0.40625, 0, 0, 0.85556],
    63: [0, 0.69444, 0, 0, 0.51945],
    64: [0, 0.69444, 0, 0, 0.73334],
    65: [0, 0.69444, 0, 0, 0.73334],
    66: [0, 0.69444, 0, 0, 0.73334],
    67: [0, 0.69444, 0, 0, 0.70278],
    68: [0, 0.69444, 0, 0, 0.79445],
    69: [0, 0.69444, 0, 0, 0.64167],
    70: [0, 0.69444, 0, 0, 0.61111],
    71: [0, 0.69444, 0, 0, 0.73334],
    72: [0, 0.69444, 0, 0, 0.79445],
    73: [0, 0.69444, 0, 0, 0.33056],
    74: [0, 0.69444, 0, 0, 0.51945],
    75: [0, 0.69444, 0, 0, 0.76389],
    76: [0, 0.69444, 0, 0, 0.58056],
    77: [0, 0.69444, 0, 0, 0.97778],
    78: [0, 0.69444, 0, 0, 0.79445],
    79: [0, 0.69444, 0, 0, 0.79445],
    80: [0, 0.69444, 0, 0, 0.70278],
    81: [0.10556, 0.69444, 0, 0, 0.79445],
    82: [0, 0.69444, 0, 0, 0.70278],
    83: [0, 0.69444, 0, 0, 0.61111],
    84: [0, 0.69444, 0, 0, 0.73334],
    85: [0, 0.69444, 0, 0, 0.76389],
    86: [0, 0.69444, 0.01528, 0, 0.73334],
    87: [0, 0.69444, 0.01528, 0, 1.03889],
    88: [0, 0.69444, 0, 0, 0.73334],
    89: [0, 0.69444, 0.0275, 0, 0.73334],
    90: [0, 0.69444, 0, 0, 0.67223],
    91: [0.25, 0.75, 0, 0, 0.34306],
    93: [0.25, 0.75, 0, 0, 0.34306],
    94: [0, 0.69444, 0, 0, 0.55],
    95: [0.35, 0.10833, 0.03056, 0, 0.55],
    97: [0, 0.45833, 0, 0, 0.525],
    98: [0, 0.69444, 0, 0, 0.56111],
    99: [0, 0.45833, 0, 0, 0.48889],
    100: [0, 0.69444, 0, 0, 0.56111],
    101: [0, 0.45833, 0, 0, 0.51111],
    102: [0, 0.69444, 0.07639, 0, 0.33611],
    103: [0.19444, 0.45833, 0.01528, 0, 0.55],
    104: [0, 0.69444, 0, 0, 0.56111],
    105: [0, 0.69444, 0, 0, 0.25556],
    106: [0.19444, 0.69444, 0, 0, 0.28611],
    107: [0, 0.69444, 0, 0, 0.53056],
    108: [0, 0.69444, 0, 0, 0.25556],
    109: [0, 0.45833, 0, 0, 0.86667],
    110: [0, 0.45833, 0, 0, 0.56111],
    111: [0, 0.45833, 0, 0, 0.55],
    112: [0.19444, 0.45833, 0, 0, 0.56111],
    113: [0.19444, 0.45833, 0, 0, 0.56111],
    114: [0, 0.45833, 0.01528, 0, 0.37222],
    115: [0, 0.45833, 0, 0, 0.42167],
    116: [0, 0.58929, 0, 0, 0.40417],
    117: [0, 0.45833, 0, 0, 0.56111],
    118: [0, 0.45833, 0.01528, 0, 0.5],
    119: [0, 0.45833, 0.01528, 0, 0.74445],
    120: [0, 0.45833, 0, 0, 0.5],
    121: [0.19444, 0.45833, 0.01528, 0, 0.5],
    122: [0, 0.45833, 0, 0, 0.47639],
    126: [0.35, 0.34444, 0, 0, 0.55],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0, 0, 0.55],
    176: [0, 0.69444, 0, 0, 0.73334],
    180: [0, 0.69444, 0, 0, 0.55],
    184: [0.17014, 0, 0, 0, 0.48889],
    305: [0, 0.45833, 0, 0, 0.25556],
    567: [0.19444, 0.45833, 0, 0, 0.28611],
    710: [0, 0.69444, 0, 0, 0.55],
    711: [0, 0.63542, 0, 0, 0.55],
    713: [0, 0.63778, 0, 0, 0.55],
    728: [0, 0.69444, 0, 0, 0.55],
    729: [0, 0.69444, 0, 0, 0.30556],
    730: [0, 0.69444, 0, 0, 0.73334],
    732: [0, 0.69444, 0, 0, 0.55],
    733: [0, 0.69444, 0, 0, 0.55],
    915: [0, 0.69444, 0, 0, 0.58056],
    916: [0, 0.69444, 0, 0, 0.91667],
    920: [0, 0.69444, 0, 0, 0.85556],
    923: [0, 0.69444, 0, 0, 0.67223],
    926: [0, 0.69444, 0, 0, 0.73334],
    928: [0, 0.69444, 0, 0, 0.79445],
    931: [0, 0.69444, 0, 0, 0.79445],
    933: [0, 0.69444, 0, 0, 0.85556],
    934: [0, 0.69444, 0, 0, 0.79445],
    936: [0, 0.69444, 0, 0, 0.85556],
    937: [0, 0.69444, 0, 0, 0.79445],
    8211: [0, 0.45833, 0.03056, 0, 0.55],
    8212: [0, 0.45833, 0.03056, 0, 1.10001],
    8216: [0, 0.69444, 0, 0, 0.30556],
    8217: [0, 0.69444, 0, 0, 0.30556],
    8220: [0, 0.69444, 0, 0, 0.55834],
    8221: [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.05733, 0, 0.31945],
    34: [0, 0.69444, 316e-5, 0, 0.5],
    35: [0.19444, 0.69444, 0.05087, 0, 0.83334],
    36: [0.05556, 0.75, 0.11156, 0, 0.5],
    37: [0.05556, 0.75, 0.03126, 0, 0.83334],
    38: [0, 0.69444, 0.03058, 0, 0.75834],
    39: [0, 0.69444, 0.07816, 0, 0.27778],
    40: [0.25, 0.75, 0.13164, 0, 0.38889],
    41: [0.25, 0.75, 0.02536, 0, 0.38889],
    42: [0, 0.75, 0.11775, 0, 0.5],
    43: [0.08333, 0.58333, 0.02536, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0.01946, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0.13164, 0, 0.5],
    48: [0, 0.65556, 0.11156, 0, 0.5],
    49: [0, 0.65556, 0.11156, 0, 0.5],
    50: [0, 0.65556, 0.11156, 0, 0.5],
    51: [0, 0.65556, 0.11156, 0, 0.5],
    52: [0, 0.65556, 0.11156, 0, 0.5],
    53: [0, 0.65556, 0.11156, 0, 0.5],
    54: [0, 0.65556, 0.11156, 0, 0.5],
    55: [0, 0.65556, 0.11156, 0, 0.5],
    56: [0, 0.65556, 0.11156, 0, 0.5],
    57: [0, 0.65556, 0.11156, 0, 0.5],
    58: [0, 0.44444, 0.02502, 0, 0.27778],
    59: [0.125, 0.44444, 0.02502, 0, 0.27778],
    61: [-0.13, 0.37, 0.05087, 0, 0.77778],
    63: [0, 0.69444, 0.11809, 0, 0.47222],
    64: [0, 0.69444, 0.07555, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0.08293, 0, 0.66667],
    67: [0, 0.69444, 0.11983, 0, 0.63889],
    68: [0, 0.69444, 0.07555, 0, 0.72223],
    69: [0, 0.69444, 0.11983, 0, 0.59722],
    70: [0, 0.69444, 0.13372, 0, 0.56945],
    71: [0, 0.69444, 0.11983, 0, 0.66667],
    72: [0, 0.69444, 0.08094, 0, 0.70834],
    73: [0, 0.69444, 0.13372, 0, 0.27778],
    74: [0, 0.69444, 0.08094, 0, 0.47222],
    75: [0, 0.69444, 0.11983, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0.08094, 0, 0.875],
    78: [0, 0.69444, 0.08094, 0, 0.70834],
    79: [0, 0.69444, 0.07555, 0, 0.73611],
    80: [0, 0.69444, 0.08293, 0, 0.63889],
    81: [0.125, 0.69444, 0.07555, 0, 0.73611],
    82: [0, 0.69444, 0.08293, 0, 0.64584],
    83: [0, 0.69444, 0.09205, 0, 0.55556],
    84: [0, 0.69444, 0.13372, 0, 0.68056],
    85: [0, 0.69444, 0.08094, 0, 0.6875],
    86: [0, 0.69444, 0.1615, 0, 0.66667],
    87: [0, 0.69444, 0.1615, 0, 0.94445],
    88: [0, 0.69444, 0.13372, 0, 0.66667],
    89: [0, 0.69444, 0.17261, 0, 0.66667],
    90: [0, 0.69444, 0.11983, 0, 0.61111],
    91: [0.25, 0.75, 0.15942, 0, 0.28889],
    93: [0.25, 0.75, 0.08719, 0, 0.28889],
    94: [0, 0.69444, 0.0799, 0, 0.5],
    95: [0.35, 0.09444, 0.08616, 0, 0.5],
    97: [0, 0.44444, 981e-5, 0, 0.48056],
    98: [0, 0.69444, 0.03057, 0, 0.51667],
    99: [0, 0.44444, 0.08336, 0, 0.44445],
    100: [0, 0.69444, 0.09483, 0, 0.51667],
    101: [0, 0.44444, 0.06778, 0, 0.44445],
    102: [0, 0.69444, 0.21705, 0, 0.30556],
    103: [0.19444, 0.44444, 0.10836, 0, 0.5],
    104: [0, 0.69444, 0.01778, 0, 0.51667],
    105: [0, 0.67937, 0.09718, 0, 0.23889],
    106: [0.19444, 0.67937, 0.09162, 0, 0.26667],
    107: [0, 0.69444, 0.08336, 0, 0.48889],
    108: [0, 0.69444, 0.09483, 0, 0.23889],
    109: [0, 0.44444, 0.01778, 0, 0.79445],
    110: [0, 0.44444, 0.01778, 0, 0.51667],
    111: [0, 0.44444, 0.06613, 0, 0.5],
    112: [0.19444, 0.44444, 0.0389, 0, 0.51667],
    113: [0.19444, 0.44444, 0.04169, 0, 0.51667],
    114: [0, 0.44444, 0.10836, 0, 0.34167],
    115: [0, 0.44444, 0.0778, 0, 0.38333],
    116: [0, 0.57143, 0.07225, 0, 0.36111],
    117: [0, 0.44444, 0.04169, 0, 0.51667],
    118: [0, 0.44444, 0.10836, 0, 0.46111],
    119: [0, 0.44444, 0.10836, 0, 0.68334],
    120: [0, 0.44444, 0.09169, 0, 0.46111],
    121: [0.19444, 0.44444, 0.10836, 0, 0.46111],
    122: [0, 0.44444, 0.08752, 0, 0.43472],
    126: [0.35, 0.32659, 0.08826, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0.06385, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.73752],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0.04169, 0, 0.23889],
    567: [0.19444, 0.44444, 0.04169, 0, 0.26667],
    710: [0, 0.69444, 0.0799, 0, 0.5],
    711: [0, 0.63194, 0.08432, 0, 0.5],
    713: [0, 0.60889, 0.08776, 0, 0.5],
    714: [0, 0.69444, 0.09205, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0.09483, 0, 0.5],
    729: [0, 0.67937, 0.07774, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.73752],
    732: [0, 0.67659, 0.08826, 0, 0.5],
    733: [0, 0.69444, 0.09205, 0, 0.5],
    915: [0, 0.69444, 0.13372, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0.07555, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0.12816, 0, 0.66667],
    928: [0, 0.69444, 0.08094, 0, 0.70834],
    931: [0, 0.69444, 0.11983, 0, 0.72222],
    933: [0, 0.69444, 0.09031, 0, 0.77778],
    934: [0, 0.69444, 0.04603, 0, 0.72222],
    936: [0, 0.69444, 0.09031, 0, 0.77778],
    937: [0, 0.69444, 0.08293, 0, 0.72222],
    8211: [0, 0.44444, 0.08616, 0, 0.5],
    8212: [0, 0.44444, 0.08616, 0, 1],
    8216: [0, 0.69444, 0.07816, 0, 0.27778],
    8217: [0, 0.69444, 0.07816, 0, 0.27778],
    8220: [0, 0.69444, 0.14205, 0, 0.5],
    8221: [0, 0.69444, 316e-5, 0, 0.5]
  },
  "SansSerif-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.31945],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.75834],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.65556, 0, 0, 0.5],
    49: [0, 0.65556, 0, 0, 0.5],
    50: [0, 0.65556, 0, 0, 0.5],
    51: [0, 0.65556, 0, 0, 0.5],
    52: [0, 0.65556, 0, 0, 0.5],
    53: [0, 0.65556, 0, 0, 0.5],
    54: [0, 0.65556, 0, 0, 0.5],
    55: [0, 0.65556, 0, 0, 0.5],
    56: [0, 0.65556, 0, 0, 0.5],
    57: [0, 0.65556, 0, 0, 0.5],
    58: [0, 0.44444, 0, 0, 0.27778],
    59: [0.125, 0.44444, 0, 0, 0.27778],
    61: [-0.13, 0.37, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0, 0, 0.66667],
    67: [0, 0.69444, 0, 0, 0.63889],
    68: [0, 0.69444, 0, 0, 0.72223],
    69: [0, 0.69444, 0, 0, 0.59722],
    70: [0, 0.69444, 0, 0, 0.56945],
    71: [0, 0.69444, 0, 0, 0.66667],
    72: [0, 0.69444, 0, 0, 0.70834],
    73: [0, 0.69444, 0, 0, 0.27778],
    74: [0, 0.69444, 0, 0, 0.47222],
    75: [0, 0.69444, 0, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0, 0, 0.875],
    78: [0, 0.69444, 0, 0, 0.70834],
    79: [0, 0.69444, 0, 0, 0.73611],
    80: [0, 0.69444, 0, 0, 0.63889],
    81: [0.125, 0.69444, 0, 0, 0.73611],
    82: [0, 0.69444, 0, 0, 0.64584],
    83: [0, 0.69444, 0, 0, 0.55556],
    84: [0, 0.69444, 0, 0, 0.68056],
    85: [0, 0.69444, 0, 0, 0.6875],
    86: [0, 0.69444, 0.01389, 0, 0.66667],
    87: [0, 0.69444, 0.01389, 0, 0.94445],
    88: [0, 0.69444, 0, 0, 0.66667],
    89: [0, 0.69444, 0.025, 0, 0.66667],
    90: [0, 0.69444, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.28889],
    93: [0.25, 0.75, 0, 0, 0.28889],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.35, 0.09444, 0.02778, 0, 0.5],
    97: [0, 0.44444, 0, 0, 0.48056],
    98: [0, 0.69444, 0, 0, 0.51667],
    99: [0, 0.44444, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.51667],
    101: [0, 0.44444, 0, 0, 0.44445],
    102: [0, 0.69444, 0.06944, 0, 0.30556],
    103: [0.19444, 0.44444, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.51667],
    105: [0, 0.67937, 0, 0, 0.23889],
    106: [0.19444, 0.67937, 0, 0, 0.26667],
    107: [0, 0.69444, 0, 0, 0.48889],
    108: [0, 0.69444, 0, 0, 0.23889],
    109: [0, 0.44444, 0, 0, 0.79445],
    110: [0, 0.44444, 0, 0, 0.51667],
    111: [0, 0.44444, 0, 0, 0.5],
    112: [0.19444, 0.44444, 0, 0, 0.51667],
    113: [0.19444, 0.44444, 0, 0, 0.51667],
    114: [0, 0.44444, 0.01389, 0, 0.34167],
    115: [0, 0.44444, 0, 0, 0.38333],
    116: [0, 0.57143, 0, 0, 0.36111],
    117: [0, 0.44444, 0, 0, 0.51667],
    118: [0, 0.44444, 0.01389, 0, 0.46111],
    119: [0, 0.44444, 0.01389, 0, 0.68334],
    120: [0, 0.44444, 0, 0, 0.46111],
    121: [0.19444, 0.44444, 0.01389, 0, 0.46111],
    122: [0, 0.44444, 0, 0, 0.43472],
    126: [0.35, 0.32659, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.66667],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0, 0, 0.23889],
    567: [0.19444, 0.44444, 0, 0, 0.26667],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.63194, 0, 0, 0.5],
    713: [0, 0.60889, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.67937, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.66667],
    732: [0, 0.67659, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.69444, 0, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0, 0, 0.66667],
    928: [0, 0.69444, 0, 0, 0.70834],
    931: [0, 0.69444, 0, 0, 0.72222],
    933: [0, 0.69444, 0, 0, 0.77778],
    934: [0, 0.69444, 0, 0, 0.72222],
    936: [0, 0.69444, 0, 0, 0.77778],
    937: [0, 0.69444, 0, 0, 0.72222],
    8211: [0, 0.44444, 0.02778, 0, 0.5],
    8212: [0, 0.44444, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.7, 0.22925, 0, 0.80253],
    66: [0, 0.7, 0.04087, 0, 0.90757],
    67: [0, 0.7, 0.1689, 0, 0.66619],
    68: [0, 0.7, 0.09371, 0, 0.77443],
    69: [0, 0.7, 0.18583, 0, 0.56162],
    70: [0, 0.7, 0.13634, 0, 0.89544],
    71: [0, 0.7, 0.17322, 0, 0.60961],
    72: [0, 0.7, 0.29694, 0, 0.96919],
    73: [0, 0.7, 0.19189, 0, 0.80907],
    74: [0.27778, 0.7, 0.19189, 0, 1.05159],
    75: [0, 0.7, 0.31259, 0, 0.91364],
    76: [0, 0.7, 0.19189, 0, 0.87373],
    77: [0, 0.7, 0.15981, 0, 1.08031],
    78: [0, 0.7, 0.3525, 0, 0.9015],
    79: [0, 0.7, 0.08078, 0, 0.73787],
    80: [0, 0.7, 0.08078, 0, 1.01262],
    81: [0, 0.7, 0.03305, 0, 0.88282],
    82: [0, 0.7, 0.06259, 0, 0.85],
    83: [0, 0.7, 0.19189, 0, 0.86767],
    84: [0, 0.7, 0.29087, 0, 0.74697],
    85: [0, 0.7, 0.25815, 0, 0.79996],
    86: [0, 0.7, 0.27523, 0, 0.62204],
    87: [0, 0.7, 0.27523, 0, 0.80532],
    88: [0, 0.7, 0.26006, 0, 0.94445],
    89: [0, 0.7, 0.2939, 0, 0.70961],
    90: [0, 0.7, 0.24037, 0, 0.8212],
    160: [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.35001, 0.85, 0, 0, 0.45834],
    41: [0.35001, 0.85, 0, 0, 0.45834],
    47: [0.35001, 0.85, 0, 0, 0.57778],
    91: [0.35001, 0.85, 0, 0, 0.41667],
    92: [0.35001, 0.85, 0, 0, 0.57778],
    93: [0.35001, 0.85, 0, 0, 0.41667],
    123: [0.35001, 0.85, 0, 0, 0.58334],
    125: [0.35001, 0.85, 0, 0, 0.58334],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.72222, 0, 0, 0.55556],
    732: [0, 0.72222, 0, 0, 0.55556],
    770: [0, 0.72222, 0, 0, 0.55556],
    771: [0, 0.72222, 0, 0, 0.55556],
    8214: [-99e-5, 0.601, 0, 0, 0.77778],
    8593: [1e-5, 0.6, 0, 0, 0.66667],
    8595: [1e-5, 0.6, 0, 0, 0.66667],
    8657: [1e-5, 0.6, 0, 0, 0.77778],
    8659: [1e-5, 0.6, 0, 0, 0.77778],
    8719: [0.25001, 0.75, 0, 0, 0.94445],
    8720: [0.25001, 0.75, 0, 0, 0.94445],
    8721: [0.25001, 0.75, 0, 0, 1.05556],
    8730: [0.35001, 0.85, 0, 0, 1],
    8739: [-599e-5, 0.606, 0, 0, 0.33333],
    8741: [-599e-5, 0.606, 0, 0, 0.55556],
    8747: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8748: [0.306, 0.805, 0.19445, 0, 0.47222],
    8749: [0.306, 0.805, 0.19445, 0, 0.47222],
    8750: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8896: [0.25001, 0.75, 0, 0, 0.83334],
    8897: [0.25001, 0.75, 0, 0, 0.83334],
    8898: [0.25001, 0.75, 0, 0, 0.83334],
    8899: [0.25001, 0.75, 0, 0, 0.83334],
    8968: [0.35001, 0.85, 0, 0, 0.47222],
    8969: [0.35001, 0.85, 0, 0, 0.47222],
    8970: [0.35001, 0.85, 0, 0, 0.47222],
    8971: [0.35001, 0.85, 0, 0, 0.47222],
    9168: [-99e-5, 0.601, 0, 0, 0.66667],
    10216: [0.35001, 0.85, 0, 0, 0.47222],
    10217: [0.35001, 0.85, 0, 0, 0.47222],
    10752: [0.25001, 0.75, 0, 0, 1.11111],
    10753: [0.25001, 0.75, 0, 0, 1.11111],
    10754: [0.25001, 0.75, 0, 0, 1.11111],
    10756: [0.25001, 0.75, 0, 0, 0.83334],
    10758: [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.65002, 1.15, 0, 0, 0.59722],
    41: [0.65002, 1.15, 0, 0, 0.59722],
    47: [0.65002, 1.15, 0, 0, 0.81111],
    91: [0.65002, 1.15, 0, 0, 0.47222],
    92: [0.65002, 1.15, 0, 0, 0.81111],
    93: [0.65002, 1.15, 0, 0, 0.47222],
    123: [0.65002, 1.15, 0, 0, 0.66667],
    125: [0.65002, 1.15, 0, 0, 0.66667],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1],
    732: [0, 0.75, 0, 0, 1],
    770: [0, 0.75, 0, 0, 1],
    771: [0, 0.75, 0, 0, 1],
    8719: [0.55001, 1.05, 0, 0, 1.27778],
    8720: [0.55001, 1.05, 0, 0, 1.27778],
    8721: [0.55001, 1.05, 0, 0, 1.44445],
    8730: [0.65002, 1.15, 0, 0, 1],
    8747: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8748: [0.862, 1.36, 0.44445, 0, 0.55556],
    8749: [0.862, 1.36, 0.44445, 0, 0.55556],
    8750: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8896: [0.55001, 1.05, 0, 0, 1.11111],
    8897: [0.55001, 1.05, 0, 0, 1.11111],
    8898: [0.55001, 1.05, 0, 0, 1.11111],
    8899: [0.55001, 1.05, 0, 0, 1.11111],
    8968: [0.65002, 1.15, 0, 0, 0.52778],
    8969: [0.65002, 1.15, 0, 0, 0.52778],
    8970: [0.65002, 1.15, 0, 0, 0.52778],
    8971: [0.65002, 1.15, 0, 0, 0.52778],
    10216: [0.65002, 1.15, 0, 0, 0.61111],
    10217: [0.65002, 1.15, 0, 0, 0.61111],
    10752: [0.55001, 1.05, 0, 0, 1.51112],
    10753: [0.55001, 1.05, 0, 0, 1.51112],
    10754: [0.55001, 1.05, 0, 0, 1.51112],
    10756: [0.55001, 1.05, 0, 0, 1.11111],
    10758: [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.95003, 1.45, 0, 0, 0.73611],
    41: [0.95003, 1.45, 0, 0, 0.73611],
    47: [0.95003, 1.45, 0, 0, 1.04445],
    91: [0.95003, 1.45, 0, 0, 0.52778],
    92: [0.95003, 1.45, 0, 0, 1.04445],
    93: [0.95003, 1.45, 0, 0, 0.52778],
    123: [0.95003, 1.45, 0, 0, 0.75],
    125: [0.95003, 1.45, 0, 0, 0.75],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1.44445],
    732: [0, 0.75, 0, 0, 1.44445],
    770: [0, 0.75, 0, 0, 1.44445],
    771: [0, 0.75, 0, 0, 1.44445],
    8730: [0.95003, 1.45, 0, 0, 1],
    8968: [0.95003, 1.45, 0, 0, 0.58334],
    8969: [0.95003, 1.45, 0, 0, 0.58334],
    8970: [0.95003, 1.45, 0, 0, 0.58334],
    8971: [0.95003, 1.45, 0, 0, 0.58334],
    10216: [0.95003, 1.45, 0, 0, 0.75],
    10217: [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [1.25003, 1.75, 0, 0, 0.79167],
    41: [1.25003, 1.75, 0, 0, 0.79167],
    47: [1.25003, 1.75, 0, 0, 1.27778],
    91: [1.25003, 1.75, 0, 0, 0.58334],
    92: [1.25003, 1.75, 0, 0, 1.27778],
    93: [1.25003, 1.75, 0, 0, 0.58334],
    123: [1.25003, 1.75, 0, 0, 0.80556],
    125: [1.25003, 1.75, 0, 0, 0.80556],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.825, 0, 0, 1.8889],
    732: [0, 0.825, 0, 0, 1.8889],
    770: [0, 0.825, 0, 0, 1.8889],
    771: [0, 0.825, 0, 0, 1.8889],
    8730: [1.25003, 1.75, 0, 0, 1],
    8968: [1.25003, 1.75, 0, 0, 0.63889],
    8969: [1.25003, 1.75, 0, 0, 0.63889],
    8970: [1.25003, 1.75, 0, 0, 0.63889],
    8971: [1.25003, 1.75, 0, 0, 0.63889],
    9115: [0.64502, 1.155, 0, 0, 0.875],
    9116: [1e-5, 0.6, 0, 0, 0.875],
    9117: [0.64502, 1.155, 0, 0, 0.875],
    9118: [0.64502, 1.155, 0, 0, 0.875],
    9119: [1e-5, 0.6, 0, 0, 0.875],
    9120: [0.64502, 1.155, 0, 0, 0.875],
    9121: [0.64502, 1.155, 0, 0, 0.66667],
    9122: [-99e-5, 0.601, 0, 0, 0.66667],
    9123: [0.64502, 1.155, 0, 0, 0.66667],
    9124: [0.64502, 1.155, 0, 0, 0.66667],
    9125: [-99e-5, 0.601, 0, 0, 0.66667],
    9126: [0.64502, 1.155, 0, 0, 0.66667],
    9127: [1e-5, 0.9, 0, 0, 0.88889],
    9128: [0.65002, 1.15, 0, 0, 0.88889],
    9129: [0.90001, 0, 0, 0, 0.88889],
    9130: [0, 0.3, 0, 0, 0.88889],
    9131: [1e-5, 0.9, 0, 0, 0.88889],
    9132: [0.65002, 1.15, 0, 0, 0.88889],
    9133: [0.90001, 0, 0, 0, 0.88889],
    9143: [0.88502, 0.915, 0, 0, 1.05556],
    10216: [1.25003, 1.75, 0, 0, 0.80556],
    10217: [1.25003, 1.75, 0, 0, 0.80556],
    57344: [-499e-5, 0.605, 0, 0, 1.05556],
    57345: [-499e-5, 0.605, 0, 0, 1.05556],
    57680: [0, 0.12, 0, 0, 0.45],
    57681: [0, 0.12, 0, 0, 0.45],
    57682: [0, 0.12, 0, 0, 0.45],
    57683: [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    32: [0, 0, 0, 0, 0.525],
    33: [0, 0.61111, 0, 0, 0.525],
    34: [0, 0.61111, 0, 0, 0.525],
    35: [0, 0.61111, 0, 0, 0.525],
    36: [0.08333, 0.69444, 0, 0, 0.525],
    37: [0.08333, 0.69444, 0, 0, 0.525],
    38: [0, 0.61111, 0, 0, 0.525],
    39: [0, 0.61111, 0, 0, 0.525],
    40: [0.08333, 0.69444, 0, 0, 0.525],
    41: [0.08333, 0.69444, 0, 0, 0.525],
    42: [0, 0.52083, 0, 0, 0.525],
    43: [-0.08056, 0.53055, 0, 0, 0.525],
    44: [0.13889, 0.125, 0, 0, 0.525],
    45: [-0.08056, 0.53055, 0, 0, 0.525],
    46: [0, 0.125, 0, 0, 0.525],
    47: [0.08333, 0.69444, 0, 0, 0.525],
    48: [0, 0.61111, 0, 0, 0.525],
    49: [0, 0.61111, 0, 0, 0.525],
    50: [0, 0.61111, 0, 0, 0.525],
    51: [0, 0.61111, 0, 0, 0.525],
    52: [0, 0.61111, 0, 0, 0.525],
    53: [0, 0.61111, 0, 0, 0.525],
    54: [0, 0.61111, 0, 0, 0.525],
    55: [0, 0.61111, 0, 0, 0.525],
    56: [0, 0.61111, 0, 0, 0.525],
    57: [0, 0.61111, 0, 0, 0.525],
    58: [0, 0.43056, 0, 0, 0.525],
    59: [0.13889, 0.43056, 0, 0, 0.525],
    60: [-0.05556, 0.55556, 0, 0, 0.525],
    61: [-0.19549, 0.41562, 0, 0, 0.525],
    62: [-0.05556, 0.55556, 0, 0, 0.525],
    63: [0, 0.61111, 0, 0, 0.525],
    64: [0, 0.61111, 0, 0, 0.525],
    65: [0, 0.61111, 0, 0, 0.525],
    66: [0, 0.61111, 0, 0, 0.525],
    67: [0, 0.61111, 0, 0, 0.525],
    68: [0, 0.61111, 0, 0, 0.525],
    69: [0, 0.61111, 0, 0, 0.525],
    70: [0, 0.61111, 0, 0, 0.525],
    71: [0, 0.61111, 0, 0, 0.525],
    72: [0, 0.61111, 0, 0, 0.525],
    73: [0, 0.61111, 0, 0, 0.525],
    74: [0, 0.61111, 0, 0, 0.525],
    75: [0, 0.61111, 0, 0, 0.525],
    76: [0, 0.61111, 0, 0, 0.525],
    77: [0, 0.61111, 0, 0, 0.525],
    78: [0, 0.61111, 0, 0, 0.525],
    79: [0, 0.61111, 0, 0, 0.525],
    80: [0, 0.61111, 0, 0, 0.525],
    81: [0.13889, 0.61111, 0, 0, 0.525],
    82: [0, 0.61111, 0, 0, 0.525],
    83: [0, 0.61111, 0, 0, 0.525],
    84: [0, 0.61111, 0, 0, 0.525],
    85: [0, 0.61111, 0, 0, 0.525],
    86: [0, 0.61111, 0, 0, 0.525],
    87: [0, 0.61111, 0, 0, 0.525],
    88: [0, 0.61111, 0, 0, 0.525],
    89: [0, 0.61111, 0, 0, 0.525],
    90: [0, 0.61111, 0, 0, 0.525],
    91: [0.08333, 0.69444, 0, 0, 0.525],
    92: [0.08333, 0.69444, 0, 0, 0.525],
    93: [0.08333, 0.69444, 0, 0, 0.525],
    94: [0, 0.61111, 0, 0, 0.525],
    95: [0.09514, 0, 0, 0, 0.525],
    96: [0, 0.61111, 0, 0, 0.525],
    97: [0, 0.43056, 0, 0, 0.525],
    98: [0, 0.61111, 0, 0, 0.525],
    99: [0, 0.43056, 0, 0, 0.525],
    100: [0, 0.61111, 0, 0, 0.525],
    101: [0, 0.43056, 0, 0, 0.525],
    102: [0, 0.61111, 0, 0, 0.525],
    103: [0.22222, 0.43056, 0, 0, 0.525],
    104: [0, 0.61111, 0, 0, 0.525],
    105: [0, 0.61111, 0, 0, 0.525],
    106: [0.22222, 0.61111, 0, 0, 0.525],
    107: [0, 0.61111, 0, 0, 0.525],
    108: [0, 0.61111, 0, 0, 0.525],
    109: [0, 0.43056, 0, 0, 0.525],
    110: [0, 0.43056, 0, 0, 0.525],
    111: [0, 0.43056, 0, 0, 0.525],
    112: [0.22222, 0.43056, 0, 0, 0.525],
    113: [0.22222, 0.43056, 0, 0, 0.525],
    114: [0, 0.43056, 0, 0, 0.525],
    115: [0, 0.43056, 0, 0, 0.525],
    116: [0, 0.55358, 0, 0, 0.525],
    117: [0, 0.43056, 0, 0, 0.525],
    118: [0, 0.43056, 0, 0, 0.525],
    119: [0, 0.43056, 0, 0, 0.525],
    120: [0, 0.43056, 0, 0, 0.525],
    121: [0.22222, 0.43056, 0, 0, 0.525],
    122: [0, 0.43056, 0, 0, 0.525],
    123: [0.08333, 0.69444, 0, 0, 0.525],
    124: [0.08333, 0.69444, 0, 0, 0.525],
    125: [0.08333, 0.69444, 0, 0, 0.525],
    126: [0, 0.61111, 0, 0, 0.525],
    127: [0, 0.61111, 0, 0, 0.525],
    160: [0, 0, 0, 0, 0.525],
    176: [0, 0.61111, 0, 0, 0.525],
    184: [0.19445, 0, 0, 0, 0.525],
    305: [0, 0.43056, 0, 0, 0.525],
    567: [0.22222, 0.43056, 0, 0, 0.525],
    711: [0, 0.56597, 0, 0, 0.525],
    713: [0, 0.56555, 0, 0, 0.525],
    714: [0, 0.61111, 0, 0, 0.525],
    715: [0, 0.61111, 0, 0, 0.525],
    728: [0, 0.61111, 0, 0, 0.525],
    730: [0, 0.61111, 0, 0, 0.525],
    770: [0, 0.61111, 0, 0, 0.525],
    771: [0, 0.61111, 0, 0, 0.525],
    776: [0, 0.61111, 0, 0, 0.525],
    915: [0, 0.61111, 0, 0, 0.525],
    916: [0, 0.61111, 0, 0, 0.525],
    920: [0, 0.61111, 0, 0, 0.525],
    923: [0, 0.61111, 0, 0, 0.525],
    926: [0, 0.61111, 0, 0, 0.525],
    928: [0, 0.61111, 0, 0, 0.525],
    931: [0, 0.61111, 0, 0, 0.525],
    933: [0, 0.61111, 0, 0, 0.525],
    934: [0, 0.61111, 0, 0, 0.525],
    936: [0, 0.61111, 0, 0, 0.525],
    937: [0, 0.61111, 0, 0, 0.525],
    8216: [0, 0.61111, 0, 0, 0.525],
    8217: [0, 0.61111, 0, 0, 0.525],
    8242: [0, 0.61111, 0, 0, 0.525],
    9251: [0.11111, 0.21944, 0, 0, 0.525]
  }
}, jo = {
  slant: [0.25, 0.25, 0.25],
  // sigma1
  space: [0, 0, 0],
  // sigma2
  stretch: [0, 0, 0],
  // sigma3
  shrink: [0, 0, 0],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1, 1.171, 1.472],
  // sigma6
  extraSpace: [0, 0, 0],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.15, 0.143, 0.2],
  // sigma16
  sub2: [0.247, 0.286, 0.4],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.05, 0.071, 0.1],
  // sigma19
  delim1: [2.39, 1.7, 1.98],
  // sigma20
  delim2: [1.01, 1.157, 1.42],
  // sigma21
  axisHeight: [0.25, 0.25, 0.25],
  // sigma22
  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143
  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10, 10, 10],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04]
  // 0.4 pt / ptPerEm
}, Z5 = {
  // Latin-1
  Å: "A",
  Ð: "D",
  Þ: "o",
  å: "a",
  ð: "d",
  þ: "o",
  // Cyrillic
  А: "A",
  Б: "B",
  В: "B",
  Г: "F",
  Д: "A",
  Е: "E",
  Ж: "K",
  З: "3",
  И: "N",
  Й: "N",
  К: "K",
  Л: "N",
  М: "M",
  Н: "H",
  О: "O",
  П: "N",
  Р: "P",
  С: "C",
  Т: "T",
  У: "y",
  Ф: "O",
  Х: "X",
  Ц: "U",
  Ч: "h",
  Ш: "W",
  Щ: "W",
  Ъ: "B",
  Ы: "X",
  Ь: "B",
  Э: "3",
  Ю: "X",
  Я: "R",
  а: "a",
  б: "b",
  в: "a",
  г: "r",
  д: "y",
  е: "e",
  ж: "m",
  з: "e",
  и: "n",
  й: "n",
  к: "n",
  л: "n",
  м: "m",
  н: "n",
  о: "o",
  п: "n",
  р: "p",
  с: "c",
  т: "o",
  у: "y",
  ф: "b",
  х: "x",
  ц: "n",
  ч: "n",
  ш: "w",
  щ: "w",
  ъ: "a",
  ы: "m",
  ь: "a",
  э: "e",
  ю: "m",
  я: "r"
};
function Sw(e, n) {
  xa[e] = n;
}
function Oh(e, n, r) {
  if (!xa[n])
    throw new Error("Font metrics not found for font: " + n + ".");
  var l = e.charCodeAt(0), s = xa[n][l];
  if (!s && e[0] in Z5 && (l = Z5[e[0]].charCodeAt(0), s = xa[n][l]), !s && r === "text" && yp(l) && (s = xa[n][77]), s)
    return {
      depth: s[0],
      height: s[1],
      italic: s[2],
      skew: s[3],
      width: s[4]
    };
}
var v1 = {};
function ww(e) {
  var n;
  if (e >= 5 ? n = 0 : e >= 3 ? n = 1 : n = 2, !v1[n]) {
    var r = v1[n] = {
      cssEmPerMu: jo.quad[n] / 18
    };
    for (var l in jo)
      jo.hasOwnProperty(l) && (r[l] = jo[l][n]);
  }
  return v1[n];
}
var Ew = [
  // Each element contains [textsize, scriptsize, scriptscriptsize].
  // The size mappings are taken from TeX with \normalsize=10pt.
  [1, 1, 1],
  // size1: [5, 5, 5]              \tiny
  [2, 1, 1],
  // size2: [6, 5, 5]
  [3, 1, 1],
  // size3: [7, 5, 5]              \scriptsize
  [4, 2, 1],
  // size4: [8, 6, 5]              \footnotesize
  [5, 2, 1],
  // size5: [9, 6, 5]              \small
  [6, 3, 1],
  // size6: [10, 7, 5]             \normalsize
  [7, 4, 2],
  // size7: [12, 8, 6]             \large
  [8, 6, 3],
  // size8: [14.4, 10, 7]          \Large
  [9, 7, 6],
  // size9: [17.28, 12, 10]        \LARGE
  [10, 8, 7],
  // size10: [20.74, 14.4, 12]     \huge
  [11, 10, 9]
  // size11: [24.88, 20.74, 17.28] \HUGE
], F5 = [
  // fontMetrics.js:getGlobalMetrics also uses size indexes, so if
  // you change size indexes, change that function.
  0.5,
  0.6,
  0.7,
  0.8,
  0.9,
  1,
  1.2,
  1.44,
  1.728,
  2.074,
  2.488
], I5 = function(n, r) {
  return r.size < 2 ? n : Ew[n - 1][r.size - 1];
};
class Wa {
  // A font family applies to a group of fonts (i.e. SansSerif), while a font
  // represents a specific font (i.e. SansSerif Bold).
  // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
  /**
   * The base size index.
   */
  constructor(n) {
    this.style = void 0, this.color = void 0, this.size = void 0, this.textSize = void 0, this.phantom = void 0, this.font = void 0, this.fontFamily = void 0, this.fontWeight = void 0, this.fontShape = void 0, this.sizeMultiplier = void 0, this.maxSize = void 0, this.minRuleThickness = void 0, this._fontMetrics = void 0, this.style = n.style, this.color = n.color, this.size = n.size || Wa.BASESIZE, this.textSize = n.textSize || this.size, this.phantom = !!n.phantom, this.font = n.font || "", this.fontFamily = n.fontFamily || "", this.fontWeight = n.fontWeight || "", this.fontShape = n.fontShape || "", this.sizeMultiplier = F5[this.size - 1], this.maxSize = n.maxSize, this.minRuleThickness = n.minRuleThickness, this._fontMetrics = void 0;
  }
  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(n) {
    var r = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    for (var l in n)
      n.hasOwnProperty(l) && (r[l] = n[l]);
    return new Wa(r);
  }
  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(n) {
    return this.style === n ? this : this.extend({
      style: n,
      size: I5(this.textSize, n)
    });
  }
  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }
  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(n) {
    return this.size === n && this.textSize === n ? this : this.extend({
      style: this.style.text(),
      size: n,
      textSize: n,
      sizeMultiplier: F5[n - 1]
    });
  }
  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(n) {
    n = n || this.style.text();
    var r = I5(Wa.BASESIZE, n);
    return this.size === r && this.textSize === Wa.BASESIZE && this.style === n ? this : this.extend({
      style: n,
      size: r
    });
  }
  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    var n;
    switch (this.style.id) {
      case 4:
      case 5:
        n = 3;
        break;
      case 6:
      case 7:
        n = 1;
        break;
      default:
        n = 6;
    }
    return this.extend({
      style: this.style.text(),
      size: n
    });
  }
  /**
   * Create a new options object with the given color.
   */
  withColor(n) {
    return this.extend({
      color: n
    });
  }
  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: !0
    });
  }
  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(n) {
    return this.extend({
      font: n
    });
  }
  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(n) {
    return this.extend({
      fontFamily: n,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(n) {
    return this.extend({
      fontWeight: n,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(n) {
    return this.extend({
      fontShape: n,
      font: ""
    });
  }
  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(n) {
    return n.size !== this.size ? ["sizing", "reset-size" + n.size, "size" + this.size] : [];
  }
  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    return this.size !== Wa.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + Wa.BASESIZE] : [];
  }
  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    return this._fontMetrics || (this._fontMetrics = ww(this.size)), this._fontMetrics;
  }
  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    return this.phantom ? "transparent" : this.color;
  }
}
Wa.BASESIZE = 6;
var W1 = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  pt: 1,
  // TeX point
  mm: 7227 / 2540,
  // millimeter
  cm: 7227 / 254,
  // centimeter
  in: 72.27,
  // inch
  bp: 803 / 800,
  // big (PostScript) points
  pc: 12,
  // pica
  dd: 1238 / 1157,
  // didot
  cc: 14856 / 1157,
  // cicero (12 didot)
  nd: 685 / 642,
  // new didot
  nc: 1370 / 107,
  // new cicero (12 new didot)
  sp: 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  px: 803 / 800
  // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
}, Mw = {
  ex: !0,
  em: !0,
  mu: !0
}, vp = function(n) {
  return typeof n != "string" && (n = n.unit), n in W1 || n in Mw || n === "ex";
}, Tt = function(n, r) {
  var l;
  if (n.unit in W1)
    l = W1[n.unit] / r.fontMetrics().ptPerEm / r.sizeMultiplier;
  else if (n.unit === "mu")
    l = r.fontMetrics().cssEmPerMu;
  else {
    var s;
    if (r.style.isTight() ? s = r.havingStyle(r.style.text()) : s = r, n.unit === "ex")
      l = s.fontMetrics().xHeight;
    else if (n.unit === "em")
      l = s.fontMetrics().quad;
    else
      throw new we("Invalid unit: '" + n.unit + "'");
    s !== r && (l *= s.sizeMultiplier / r.sizeMultiplier);
  }
  return Math.min(n.number * l, r.maxSize);
}, Me = function(n) {
  return +n.toFixed(4) + "em";
}, I0 = function(n) {
  return n.filter((r) => r).join(" ");
}, xp = function(n, r, l) {
  if (this.classes = n || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = l || {}, r) {
    r.style.isTight() && this.classes.push("mtight");
    var s = r.getColor();
    s && (this.style.color = s);
  }
}, bp = function(n) {
  var r = document.createElement(n);
  r.className = I0(this.classes);
  for (var l in this.style)
    this.style.hasOwnProperty(l) && (r.style[l] = this.style[l]);
  for (var s in this.attributes)
    this.attributes.hasOwnProperty(s) && r.setAttribute(s, this.attributes[s]);
  for (var u = 0; u < this.children.length; u++)
    r.appendChild(this.children[u].toNode());
  return r;
}, Tw = /[\s"'>/=\x00-\x1f]/, Sp = function(n) {
  var r = "<" + n;
  this.classes.length && (r += ' class="' + at.escape(I0(this.classes)) + '"');
  var l = "";
  for (var s in this.style)
    this.style.hasOwnProperty(s) && (l += at.hyphenate(s) + ":" + this.style[s] + ";");
  l && (r += ' style="' + at.escape(l) + '"');
  for (var u in this.attributes)
    if (this.attributes.hasOwnProperty(u)) {
      if (Tw.test(u))
        throw new we("Invalid attribute name '" + u + "'");
      r += " " + u + '="' + at.escape(this.attributes[u]) + '"';
    }
  r += ">";
  for (var c = 0; c < this.children.length; c++)
    r += this.children[c].toMarkup();
  return r += "</" + n + ">", r;
};
class ts {
  constructor(n, r, l, s) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.width = void 0, this.maxFontSize = void 0, this.style = void 0, xp.call(this, n, l, s), this.children = r || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(n, r) {
    this.attributes[n] = r;
  }
  hasClass(n) {
    return this.classes.includes(n);
  }
  toNode() {
    return bp.call(this, "span");
  }
  toMarkup() {
    return Sp.call(this, "span");
  }
}
class Hh {
  constructor(n, r, l, s) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, xp.call(this, r, s), this.children = l || [], this.setAttribute("href", n);
  }
  setAttribute(n, r) {
    this.attributes[n] = r;
  }
  hasClass(n) {
    return this.classes.includes(n);
  }
  toNode() {
    return bp.call(this, "a");
  }
  toMarkup() {
    return Sp.call(this, "a");
  }
}
class zw {
  constructor(n, r, l) {
    this.src = void 0, this.alt = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.alt = r, this.src = n, this.classes = ["mord"], this.style = l;
  }
  hasClass(n) {
    return this.classes.includes(n);
  }
  toNode() {
    var n = document.createElement("img");
    n.src = this.src, n.alt = this.alt, n.className = "mord";
    for (var r in this.style)
      this.style.hasOwnProperty(r) && (n.style[r] = this.style[r]);
    return n;
  }
  toMarkup() {
    var n = '<img src="' + at.escape(this.src) + '"' + (' alt="' + at.escape(this.alt) + '"'), r = "";
    for (var l in this.style)
      this.style.hasOwnProperty(l) && (r += at.hyphenate(l) + ":" + this.style[l] + ";");
    return r && (n += ' style="' + at.escape(r) + '"'), n += "'/>", n;
  }
}
var Aw = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class ta {
  constructor(n, r, l, s, u, c, h, d) {
    this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = n, this.height = r || 0, this.depth = l || 0, this.italic = s || 0, this.skew = u || 0, this.width = c || 0, this.classes = h || [], this.style = d || {}, this.maxFontSize = 0;
    var p = cw(this.text.charCodeAt(0));
    p && this.classes.push(p + "_fallback"), /[îïíì]/.test(this.text) && (this.text = Aw[this.text]);
  }
  hasClass(n) {
    return this.classes.includes(n);
  }
  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created if it is needed.
   */
  toNode() {
    var n = document.createTextNode(this.text), r = null;
    this.italic > 0 && (r = document.createElement("span"), r.style.marginRight = Me(this.italic)), this.classes.length > 0 && (r = r || document.createElement("span"), r.className = I0(this.classes));
    for (var l in this.style)
      this.style.hasOwnProperty(l) && (r = r || document.createElement("span"), r.style[l] = this.style[l]);
    return r ? (r.appendChild(n), r) : n;
  }
  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    var n = !1, r = "<span";
    this.classes.length && (n = !0, r += ' class="', r += at.escape(I0(this.classes)), r += '"');
    var l = "";
    this.italic > 0 && (l += "margin-right:" + this.italic + "em;");
    for (var s in this.style)
      this.style.hasOwnProperty(s) && (l += at.hyphenate(s) + ":" + this.style[s] + ";");
    l && (n = !0, r += ' style="' + at.escape(l) + '"');
    var u = at.escape(this.text);
    return n ? (r += ">", r += u, r += "</span>", r) : u;
  }
}
class r0 {
  constructor(n, r) {
    this.children = void 0, this.attributes = void 0, this.children = n || [], this.attributes = r || {};
  }
  toNode() {
    var n = "http://www.w3.org/2000/svg", r = document.createElementNS(n, "svg");
    for (var l in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, l) && r.setAttribute(l, this.attributes[l]);
    for (var s = 0; s < this.children.length; s++)
      r.appendChild(this.children[s].toNode());
    return r;
  }
  toMarkup() {
    var n = '<svg xmlns="http://www.w3.org/2000/svg"';
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && (n += " " + r + '="' + at.escape(this.attributes[r]) + '"');
    n += ">";
    for (var l = 0; l < this.children.length; l++)
      n += this.children[l].toMarkup();
    return n += "</svg>", n;
  }
}
class K0 {
  constructor(n, r) {
    this.pathName = void 0, this.alternate = void 0, this.pathName = n, this.alternate = r;
  }
  toNode() {
    var n = "http://www.w3.org/2000/svg", r = document.createElementNS(n, "path");
    return this.alternate ? r.setAttribute("d", this.alternate) : r.setAttribute("d", $5[this.pathName]), r;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + at.escape(this.alternate) + '"/>' : '<path d="' + at.escape($5[this.pathName]) + '"/>';
  }
}
class P1 {
  constructor(n) {
    this.attributes = void 0, this.attributes = n || {};
  }
  toNode() {
    var n = "http://www.w3.org/2000/svg", r = document.createElementNS(n, "line");
    for (var l in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, l) && r.setAttribute(l, this.attributes[l]);
    return r;
  }
  toMarkup() {
    var n = "<line";
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && (n += " " + r + '="' + at.escape(this.attributes[r]) + '"');
    return n += "/>", n;
  }
}
function K5(e) {
  if (e instanceof ta)
    return e;
  throw new Error("Expected symbolNode but got " + String(e) + ".");
}
function Cw(e) {
  if (e instanceof ts)
    return e;
  throw new Error("Expected span<HtmlDomNode> but got " + String(e) + ".");
}
var Nw = {
  bin: 1,
  close: 1,
  inner: 1,
  open: 1,
  punct: 1,
  rel: 1
}, kw = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, mt = {
  math: {},
  text: {}
};
function v(e, n, r, l, s, u) {
  mt[e][s] = {
    font: n,
    group: r,
    replace: l
  }, u && l && (mt[e][l] = mt[e][s]);
}
var b = "math", ve = "text", E = "main", L = "ams", bt = "accent-token", Ne = "bin", dn = "close", kl = "inner", Le = "mathord", jt = "op-token", Un = "open", ku = "punct", U = "rel", s0 = "spacing", Z = "textord";
v(b, E, U, "≡", "\\equiv", !0);
v(b, E, U, "≺", "\\prec", !0);
v(b, E, U, "≻", "\\succ", !0);
v(b, E, U, "∼", "\\sim", !0);
v(b, E, U, "⊥", "\\perp");
v(b, E, U, "⪯", "\\preceq", !0);
v(b, E, U, "⪰", "\\succeq", !0);
v(b, E, U, "≃", "\\simeq", !0);
v(b, E, U, "∣", "\\mid", !0);
v(b, E, U, "≪", "\\ll", !0);
v(b, E, U, "≫", "\\gg", !0);
v(b, E, U, "≍", "\\asymp", !0);
v(b, E, U, "∥", "\\parallel");
v(b, E, U, "⋈", "\\bowtie", !0);
v(b, E, U, "⌣", "\\smile", !0);
v(b, E, U, "⊑", "\\sqsubseteq", !0);
v(b, E, U, "⊒", "\\sqsupseteq", !0);
v(b, E, U, "≐", "\\doteq", !0);
v(b, E, U, "⌢", "\\frown", !0);
v(b, E, U, "∋", "\\ni", !0);
v(b, E, U, "∝", "\\propto", !0);
v(b, E, U, "⊢", "\\vdash", !0);
v(b, E, U, "⊣", "\\dashv", !0);
v(b, E, U, "∋", "\\owns");
v(b, E, ku, ".", "\\ldotp");
v(b, E, ku, "⋅", "\\cdotp");
v(b, E, Z, "#", "\\#");
v(ve, E, Z, "#", "\\#");
v(b, E, Z, "&", "\\&");
v(ve, E, Z, "&", "\\&");
v(b, E, Z, "ℵ", "\\aleph", !0);
v(b, E, Z, "∀", "\\forall", !0);
v(b, E, Z, "ℏ", "\\hbar", !0);
v(b, E, Z, "∃", "\\exists", !0);
v(b, E, Z, "∇", "\\nabla", !0);
v(b, E, Z, "♭", "\\flat", !0);
v(b, E, Z, "ℓ", "\\ell", !0);
v(b, E, Z, "♮", "\\natural", !0);
v(b, E, Z, "♣", "\\clubsuit", !0);
v(b, E, Z, "℘", "\\wp", !0);
v(b, E, Z, "♯", "\\sharp", !0);
v(b, E, Z, "♢", "\\diamondsuit", !0);
v(b, E, Z, "ℜ", "\\Re", !0);
v(b, E, Z, "♡", "\\heartsuit", !0);
v(b, E, Z, "ℑ", "\\Im", !0);
v(b, E, Z, "♠", "\\spadesuit", !0);
v(b, E, Z, "§", "\\S", !0);
v(ve, E, Z, "§", "\\S");
v(b, E, Z, "¶", "\\P", !0);
v(ve, E, Z, "¶", "\\P");
v(b, E, Z, "†", "\\dag");
v(ve, E, Z, "†", "\\dag");
v(ve, E, Z, "†", "\\textdagger");
v(b, E, Z, "‡", "\\ddag");
v(ve, E, Z, "‡", "\\ddag");
v(ve, E, Z, "‡", "\\textdaggerdbl");
v(b, E, dn, "⎱", "\\rmoustache", !0);
v(b, E, Un, "⎰", "\\lmoustache", !0);
v(b, E, dn, "⟯", "\\rgroup", !0);
v(b, E, Un, "⟮", "\\lgroup", !0);
v(b, E, Ne, "∓", "\\mp", !0);
v(b, E, Ne, "⊖", "\\ominus", !0);
v(b, E, Ne, "⊎", "\\uplus", !0);
v(b, E, Ne, "⊓", "\\sqcap", !0);
v(b, E, Ne, "∗", "\\ast");
v(b, E, Ne, "⊔", "\\sqcup", !0);
v(b, E, Ne, "◯", "\\bigcirc", !0);
v(b, E, Ne, "∙", "\\bullet", !0);
v(b, E, Ne, "‡", "\\ddagger");
v(b, E, Ne, "≀", "\\wr", !0);
v(b, E, Ne, "⨿", "\\amalg");
v(b, E, Ne, "&", "\\And");
v(b, E, U, "⟵", "\\longleftarrow", !0);
v(b, E, U, "⇐", "\\Leftarrow", !0);
v(b, E, U, "⟸", "\\Longleftarrow", !0);
v(b, E, U, "⟶", "\\longrightarrow", !0);
v(b, E, U, "⇒", "\\Rightarrow", !0);
v(b, E, U, "⟹", "\\Longrightarrow", !0);
v(b, E, U, "↔", "\\leftrightarrow", !0);
v(b, E, U, "⟷", "\\longleftrightarrow", !0);
v(b, E, U, "⇔", "\\Leftrightarrow", !0);
v(b, E, U, "⟺", "\\Longleftrightarrow", !0);
v(b, E, U, "↦", "\\mapsto", !0);
v(b, E, U, "⟼", "\\longmapsto", !0);
v(b, E, U, "↗", "\\nearrow", !0);
v(b, E, U, "↩", "\\hookleftarrow", !0);
v(b, E, U, "↪", "\\hookrightarrow", !0);
v(b, E, U, "↘", "\\searrow", !0);
v(b, E, U, "↼", "\\leftharpoonup", !0);
v(b, E, U, "⇀", "\\rightharpoonup", !0);
v(b, E, U, "↙", "\\swarrow", !0);
v(b, E, U, "↽", "\\leftharpoondown", !0);
v(b, E, U, "⇁", "\\rightharpoondown", !0);
v(b, E, U, "↖", "\\nwarrow", !0);
v(b, E, U, "⇌", "\\rightleftharpoons", !0);
v(b, L, U, "≮", "\\nless", !0);
v(b, L, U, "", "\\@nleqslant");
v(b, L, U, "", "\\@nleqq");
v(b, L, U, "⪇", "\\lneq", !0);
v(b, L, U, "≨", "\\lneqq", !0);
v(b, L, U, "", "\\@lvertneqq");
v(b, L, U, "⋦", "\\lnsim", !0);
v(b, L, U, "⪉", "\\lnapprox", !0);
v(b, L, U, "⊀", "\\nprec", !0);
v(b, L, U, "⋠", "\\npreceq", !0);
v(b, L, U, "⋨", "\\precnsim", !0);
v(b, L, U, "⪹", "\\precnapprox", !0);
v(b, L, U, "≁", "\\nsim", !0);
v(b, L, U, "", "\\@nshortmid");
v(b, L, U, "∤", "\\nmid", !0);
v(b, L, U, "⊬", "\\nvdash", !0);
v(b, L, U, "⊭", "\\nvDash", !0);
v(b, L, U, "⋪", "\\ntriangleleft");
v(b, L, U, "⋬", "\\ntrianglelefteq", !0);
v(b, L, U, "⊊", "\\subsetneq", !0);
v(b, L, U, "", "\\@varsubsetneq");
v(b, L, U, "⫋", "\\subsetneqq", !0);
v(b, L, U, "", "\\@varsubsetneqq");
v(b, L, U, "≯", "\\ngtr", !0);
v(b, L, U, "", "\\@ngeqslant");
v(b, L, U, "", "\\@ngeqq");
v(b, L, U, "⪈", "\\gneq", !0);
v(b, L, U, "≩", "\\gneqq", !0);
v(b, L, U, "", "\\@gvertneqq");
v(b, L, U, "⋧", "\\gnsim", !0);
v(b, L, U, "⪊", "\\gnapprox", !0);
v(b, L, U, "⊁", "\\nsucc", !0);
v(b, L, U, "⋡", "\\nsucceq", !0);
v(b, L, U, "⋩", "\\succnsim", !0);
v(b, L, U, "⪺", "\\succnapprox", !0);
v(b, L, U, "≆", "\\ncong", !0);
v(b, L, U, "", "\\@nshortparallel");
v(b, L, U, "∦", "\\nparallel", !0);
v(b, L, U, "⊯", "\\nVDash", !0);
v(b, L, U, "⋫", "\\ntriangleright");
v(b, L, U, "⋭", "\\ntrianglerighteq", !0);
v(b, L, U, "", "\\@nsupseteqq");
v(b, L, U, "⊋", "\\supsetneq", !0);
v(b, L, U, "", "\\@varsupsetneq");
v(b, L, U, "⫌", "\\supsetneqq", !0);
v(b, L, U, "", "\\@varsupsetneqq");
v(b, L, U, "⊮", "\\nVdash", !0);
v(b, L, U, "⪵", "\\precneqq", !0);
v(b, L, U, "⪶", "\\succneqq", !0);
v(b, L, U, "", "\\@nsubseteqq");
v(b, L, Ne, "⊴", "\\unlhd");
v(b, L, Ne, "⊵", "\\unrhd");
v(b, L, U, "↚", "\\nleftarrow", !0);
v(b, L, U, "↛", "\\nrightarrow", !0);
v(b, L, U, "⇍", "\\nLeftarrow", !0);
v(b, L, U, "⇏", "\\nRightarrow", !0);
v(b, L, U, "↮", "\\nleftrightarrow", !0);
v(b, L, U, "⇎", "\\nLeftrightarrow", !0);
v(b, L, U, "△", "\\vartriangle");
v(b, L, Z, "ℏ", "\\hslash");
v(b, L, Z, "▽", "\\triangledown");
v(b, L, Z, "◊", "\\lozenge");
v(b, L, Z, "Ⓢ", "\\circledS");
v(b, L, Z, "®", "\\circledR");
v(ve, L, Z, "®", "\\circledR");
v(b, L, Z, "∡", "\\measuredangle", !0);
v(b, L, Z, "∄", "\\nexists");
v(b, L, Z, "℧", "\\mho");
v(b, L, Z, "Ⅎ", "\\Finv", !0);
v(b, L, Z, "⅁", "\\Game", !0);
v(b, L, Z, "‵", "\\backprime");
v(b, L, Z, "▲", "\\blacktriangle");
v(b, L, Z, "▼", "\\blacktriangledown");
v(b, L, Z, "■", "\\blacksquare");
v(b, L, Z, "⧫", "\\blacklozenge");
v(b, L, Z, "★", "\\bigstar");
v(b, L, Z, "∢", "\\sphericalangle", !0);
v(b, L, Z, "∁", "\\complement", !0);
v(b, L, Z, "ð", "\\eth", !0);
v(ve, E, Z, "ð", "ð");
v(b, L, Z, "╱", "\\diagup");
v(b, L, Z, "╲", "\\diagdown");
v(b, L, Z, "□", "\\square");
v(b, L, Z, "□", "\\Box");
v(b, L, Z, "◊", "\\Diamond");
v(b, L, Z, "¥", "\\yen", !0);
v(ve, L, Z, "¥", "\\yen", !0);
v(b, L, Z, "✓", "\\checkmark", !0);
v(ve, L, Z, "✓", "\\checkmark");
v(b, L, Z, "ℶ", "\\beth", !0);
v(b, L, Z, "ℸ", "\\daleth", !0);
v(b, L, Z, "ℷ", "\\gimel", !0);
v(b, L, Z, "ϝ", "\\digamma", !0);
v(b, L, Z, "ϰ", "\\varkappa");
v(b, L, Un, "┌", "\\@ulcorner", !0);
v(b, L, dn, "┐", "\\@urcorner", !0);
v(b, L, Un, "└", "\\@llcorner", !0);
v(b, L, dn, "┘", "\\@lrcorner", !0);
v(b, L, U, "≦", "\\leqq", !0);
v(b, L, U, "⩽", "\\leqslant", !0);
v(b, L, U, "⪕", "\\eqslantless", !0);
v(b, L, U, "≲", "\\lesssim", !0);
v(b, L, U, "⪅", "\\lessapprox", !0);
v(b, L, U, "≊", "\\approxeq", !0);
v(b, L, Ne, "⋖", "\\lessdot");
v(b, L, U, "⋘", "\\lll", !0);
v(b, L, U, "≶", "\\lessgtr", !0);
v(b, L, U, "⋚", "\\lesseqgtr", !0);
v(b, L, U, "⪋", "\\lesseqqgtr", !0);
v(b, L, U, "≑", "\\doteqdot");
v(b, L, U, "≓", "\\risingdotseq", !0);
v(b, L, U, "≒", "\\fallingdotseq", !0);
v(b, L, U, "∽", "\\backsim", !0);
v(b, L, U, "⋍", "\\backsimeq", !0);
v(b, L, U, "⫅", "\\subseteqq", !0);
v(b, L, U, "⋐", "\\Subset", !0);
v(b, L, U, "⊏", "\\sqsubset", !0);
v(b, L, U, "≼", "\\preccurlyeq", !0);
v(b, L, U, "⋞", "\\curlyeqprec", !0);
v(b, L, U, "≾", "\\precsim", !0);
v(b, L, U, "⪷", "\\precapprox", !0);
v(b, L, U, "⊲", "\\vartriangleleft");
v(b, L, U, "⊴", "\\trianglelefteq");
v(b, L, U, "⊨", "\\vDash", !0);
v(b, L, U, "⊪", "\\Vvdash", !0);
v(b, L, U, "⌣", "\\smallsmile");
v(b, L, U, "⌢", "\\smallfrown");
v(b, L, U, "≏", "\\bumpeq", !0);
v(b, L, U, "≎", "\\Bumpeq", !0);
v(b, L, U, "≧", "\\geqq", !0);
v(b, L, U, "⩾", "\\geqslant", !0);
v(b, L, U, "⪖", "\\eqslantgtr", !0);
v(b, L, U, "≳", "\\gtrsim", !0);
v(b, L, U, "⪆", "\\gtrapprox", !0);
v(b, L, Ne, "⋗", "\\gtrdot");
v(b, L, U, "⋙", "\\ggg", !0);
v(b, L, U, "≷", "\\gtrless", !0);
v(b, L, U, "⋛", "\\gtreqless", !0);
v(b, L, U, "⪌", "\\gtreqqless", !0);
v(b, L, U, "≖", "\\eqcirc", !0);
v(b, L, U, "≗", "\\circeq", !0);
v(b, L, U, "≜", "\\triangleq", !0);
v(b, L, U, "∼", "\\thicksim");
v(b, L, U, "≈", "\\thickapprox");
v(b, L, U, "⫆", "\\supseteqq", !0);
v(b, L, U, "⋑", "\\Supset", !0);
v(b, L, U, "⊐", "\\sqsupset", !0);
v(b, L, U, "≽", "\\succcurlyeq", !0);
v(b, L, U, "⋟", "\\curlyeqsucc", !0);
v(b, L, U, "≿", "\\succsim", !0);
v(b, L, U, "⪸", "\\succapprox", !0);
v(b, L, U, "⊳", "\\vartriangleright");
v(b, L, U, "⊵", "\\trianglerighteq");
v(b, L, U, "⊩", "\\Vdash", !0);
v(b, L, U, "∣", "\\shortmid");
v(b, L, U, "∥", "\\shortparallel");
v(b, L, U, "≬", "\\between", !0);
v(b, L, U, "⋔", "\\pitchfork", !0);
v(b, L, U, "∝", "\\varpropto");
v(b, L, U, "◀", "\\blacktriangleleft");
v(b, L, U, "∴", "\\therefore", !0);
v(b, L, U, "∍", "\\backepsilon");
v(b, L, U, "▶", "\\blacktriangleright");
v(b, L, U, "∵", "\\because", !0);
v(b, L, U, "⋘", "\\llless");
v(b, L, U, "⋙", "\\gggtr");
v(b, L, Ne, "⊲", "\\lhd");
v(b, L, Ne, "⊳", "\\rhd");
v(b, L, U, "≂", "\\eqsim", !0);
v(b, E, U, "⋈", "\\Join");
v(b, L, U, "≑", "\\Doteq", !0);
v(b, L, Ne, "∔", "\\dotplus", !0);
v(b, L, Ne, "∖", "\\smallsetminus");
v(b, L, Ne, "⋒", "\\Cap", !0);
v(b, L, Ne, "⋓", "\\Cup", !0);
v(b, L, Ne, "⩞", "\\doublebarwedge", !0);
v(b, L, Ne, "⊟", "\\boxminus", !0);
v(b, L, Ne, "⊞", "\\boxplus", !0);
v(b, L, Ne, "⋇", "\\divideontimes", !0);
v(b, L, Ne, "⋉", "\\ltimes", !0);
v(b, L, Ne, "⋊", "\\rtimes", !0);
v(b, L, Ne, "⋋", "\\leftthreetimes", !0);
v(b, L, Ne, "⋌", "\\rightthreetimes", !0);
v(b, L, Ne, "⋏", "\\curlywedge", !0);
v(b, L, Ne, "⋎", "\\curlyvee", !0);
v(b, L, Ne, "⊝", "\\circleddash", !0);
v(b, L, Ne, "⊛", "\\circledast", !0);
v(b, L, Ne, "⋅", "\\centerdot");
v(b, L, Ne, "⊺", "\\intercal", !0);
v(b, L, Ne, "⋒", "\\doublecap");
v(b, L, Ne, "⋓", "\\doublecup");
v(b, L, Ne, "⊠", "\\boxtimes", !0);
v(b, L, U, "⇢", "\\dashrightarrow", !0);
v(b, L, U, "⇠", "\\dashleftarrow", !0);
v(b, L, U, "⇇", "\\leftleftarrows", !0);
v(b, L, U, "⇆", "\\leftrightarrows", !0);
v(b, L, U, "⇚", "\\Lleftarrow", !0);
v(b, L, U, "↞", "\\twoheadleftarrow", !0);
v(b, L, U, "↢", "\\leftarrowtail", !0);
v(b, L, U, "↫", "\\looparrowleft", !0);
v(b, L, U, "⇋", "\\leftrightharpoons", !0);
v(b, L, U, "↶", "\\curvearrowleft", !0);
v(b, L, U, "↺", "\\circlearrowleft", !0);
v(b, L, U, "↰", "\\Lsh", !0);
v(b, L, U, "⇈", "\\upuparrows", !0);
v(b, L, U, "↿", "\\upharpoonleft", !0);
v(b, L, U, "⇃", "\\downharpoonleft", !0);
v(b, E, U, "⊶", "\\origof", !0);
v(b, E, U, "⊷", "\\imageof", !0);
v(b, L, U, "⊸", "\\multimap", !0);
v(b, L, U, "↭", "\\leftrightsquigarrow", !0);
v(b, L, U, "⇉", "\\rightrightarrows", !0);
v(b, L, U, "⇄", "\\rightleftarrows", !0);
v(b, L, U, "↠", "\\twoheadrightarrow", !0);
v(b, L, U, "↣", "\\rightarrowtail", !0);
v(b, L, U, "↬", "\\looparrowright", !0);
v(b, L, U, "↷", "\\curvearrowright", !0);
v(b, L, U, "↻", "\\circlearrowright", !0);
v(b, L, U, "↱", "\\Rsh", !0);
v(b, L, U, "⇊", "\\downdownarrows", !0);
v(b, L, U, "↾", "\\upharpoonright", !0);
v(b, L, U, "⇂", "\\downharpoonright", !0);
v(b, L, U, "⇝", "\\rightsquigarrow", !0);
v(b, L, U, "⇝", "\\leadsto");
v(b, L, U, "⇛", "\\Rrightarrow", !0);
v(b, L, U, "↾", "\\restriction");
v(b, E, Z, "‘", "`");
v(b, E, Z, "$", "\\$");
v(ve, E, Z, "$", "\\$");
v(ve, E, Z, "$", "\\textdollar");
v(b, E, Z, "%", "\\%");
v(ve, E, Z, "%", "\\%");
v(b, E, Z, "_", "\\_");
v(ve, E, Z, "_", "\\_");
v(ve, E, Z, "_", "\\textunderscore");
v(b, E, Z, "∠", "\\angle", !0);
v(b, E, Z, "∞", "\\infty", !0);
v(b, E, Z, "′", "\\prime");
v(b, E, Z, "△", "\\triangle");
v(b, E, Z, "Γ", "\\Gamma", !0);
v(b, E, Z, "Δ", "\\Delta", !0);
v(b, E, Z, "Θ", "\\Theta", !0);
v(b, E, Z, "Λ", "\\Lambda", !0);
v(b, E, Z, "Ξ", "\\Xi", !0);
v(b, E, Z, "Π", "\\Pi", !0);
v(b, E, Z, "Σ", "\\Sigma", !0);
v(b, E, Z, "Υ", "\\Upsilon", !0);
v(b, E, Z, "Φ", "\\Phi", !0);
v(b, E, Z, "Ψ", "\\Psi", !0);
v(b, E, Z, "Ω", "\\Omega", !0);
v(b, E, Z, "A", "Α");
v(b, E, Z, "B", "Β");
v(b, E, Z, "E", "Ε");
v(b, E, Z, "Z", "Ζ");
v(b, E, Z, "H", "Η");
v(b, E, Z, "I", "Ι");
v(b, E, Z, "K", "Κ");
v(b, E, Z, "M", "Μ");
v(b, E, Z, "N", "Ν");
v(b, E, Z, "O", "Ο");
v(b, E, Z, "P", "Ρ");
v(b, E, Z, "T", "Τ");
v(b, E, Z, "X", "Χ");
v(b, E, Z, "¬", "\\neg", !0);
v(b, E, Z, "¬", "\\lnot");
v(b, E, Z, "⊤", "\\top");
v(b, E, Z, "⊥", "\\bot");
v(b, E, Z, "∅", "\\emptyset");
v(b, L, Z, "∅", "\\varnothing");
v(b, E, Le, "α", "\\alpha", !0);
v(b, E, Le, "β", "\\beta", !0);
v(b, E, Le, "γ", "\\gamma", !0);
v(b, E, Le, "δ", "\\delta", !0);
v(b, E, Le, "ϵ", "\\epsilon", !0);
v(b, E, Le, "ζ", "\\zeta", !0);
v(b, E, Le, "η", "\\eta", !0);
v(b, E, Le, "θ", "\\theta", !0);
v(b, E, Le, "ι", "\\iota", !0);
v(b, E, Le, "κ", "\\kappa", !0);
v(b, E, Le, "λ", "\\lambda", !0);
v(b, E, Le, "μ", "\\mu", !0);
v(b, E, Le, "ν", "\\nu", !0);
v(b, E, Le, "ξ", "\\xi", !0);
v(b, E, Le, "ο", "\\omicron", !0);
v(b, E, Le, "π", "\\pi", !0);
v(b, E, Le, "ρ", "\\rho", !0);
v(b, E, Le, "σ", "\\sigma", !0);
v(b, E, Le, "τ", "\\tau", !0);
v(b, E, Le, "υ", "\\upsilon", !0);
v(b, E, Le, "ϕ", "\\phi", !0);
v(b, E, Le, "χ", "\\chi", !0);
v(b, E, Le, "ψ", "\\psi", !0);
v(b, E, Le, "ω", "\\omega", !0);
v(b, E, Le, "ε", "\\varepsilon", !0);
v(b, E, Le, "ϑ", "\\vartheta", !0);
v(b, E, Le, "ϖ", "\\varpi", !0);
v(b, E, Le, "ϱ", "\\varrho", !0);
v(b, E, Le, "ς", "\\varsigma", !0);
v(b, E, Le, "φ", "\\varphi", !0);
v(b, E, Ne, "∗", "*", !0);
v(b, E, Ne, "+", "+");
v(b, E, Ne, "−", "-", !0);
v(b, E, Ne, "⋅", "\\cdot", !0);
v(b, E, Ne, "∘", "\\circ", !0);
v(b, E, Ne, "÷", "\\div", !0);
v(b, E, Ne, "±", "\\pm", !0);
v(b, E, Ne, "×", "\\times", !0);
v(b, E, Ne, "∩", "\\cap", !0);
v(b, E, Ne, "∪", "\\cup", !0);
v(b, E, Ne, "∖", "\\setminus", !0);
v(b, E, Ne, "∧", "\\land");
v(b, E, Ne, "∨", "\\lor");
v(b, E, Ne, "∧", "\\wedge", !0);
v(b, E, Ne, "∨", "\\vee", !0);
v(b, E, Z, "√", "\\surd");
v(b, E, Un, "⟨", "\\langle", !0);
v(b, E, Un, "∣", "\\lvert");
v(b, E, Un, "∥", "\\lVert");
v(b, E, dn, "?", "?");
v(b, E, dn, "!", "!");
v(b, E, dn, "⟩", "\\rangle", !0);
v(b, E, dn, "∣", "\\rvert");
v(b, E, dn, "∥", "\\rVert");
v(b, E, U, "=", "=");
v(b, E, U, ":", ":");
v(b, E, U, "≈", "\\approx", !0);
v(b, E, U, "≅", "\\cong", !0);
v(b, E, U, "≥", "\\ge");
v(b, E, U, "≥", "\\geq", !0);
v(b, E, U, "←", "\\gets");
v(b, E, U, ">", "\\gt", !0);
v(b, E, U, "∈", "\\in", !0);
v(b, E, U, "", "\\@not");
v(b, E, U, "⊂", "\\subset", !0);
v(b, E, U, "⊃", "\\supset", !0);
v(b, E, U, "⊆", "\\subseteq", !0);
v(b, E, U, "⊇", "\\supseteq", !0);
v(b, L, U, "⊈", "\\nsubseteq", !0);
v(b, L, U, "⊉", "\\nsupseteq", !0);
v(b, E, U, "⊨", "\\models");
v(b, E, U, "←", "\\leftarrow", !0);
v(b, E, U, "≤", "\\le");
v(b, E, U, "≤", "\\leq", !0);
v(b, E, U, "<", "\\lt", !0);
v(b, E, U, "→", "\\rightarrow", !0);
v(b, E, U, "→", "\\to");
v(b, L, U, "≱", "\\ngeq", !0);
v(b, L, U, "≰", "\\nleq", !0);
v(b, E, s0, " ", "\\ ");
v(b, E, s0, " ", "\\space");
v(b, E, s0, " ", "\\nobreakspace");
v(ve, E, s0, " ", "\\ ");
v(ve, E, s0, " ", " ");
v(ve, E, s0, " ", "\\space");
v(ve, E, s0, " ", "\\nobreakspace");
v(b, E, s0, null, "\\nobreak");
v(b, E, s0, null, "\\allowbreak");
v(b, E, ku, ",", ",");
v(b, E, ku, ";", ";");
v(b, L, Ne, "⊼", "\\barwedge", !0);
v(b, L, Ne, "⊻", "\\veebar", !0);
v(b, E, Ne, "⊙", "\\odot", !0);
v(b, E, Ne, "⊕", "\\oplus", !0);
v(b, E, Ne, "⊗", "\\otimes", !0);
v(b, E, Z, "∂", "\\partial", !0);
v(b, E, Ne, "⊘", "\\oslash", !0);
v(b, L, Ne, "⊚", "\\circledcirc", !0);
v(b, L, Ne, "⊡", "\\boxdot", !0);
v(b, E, Ne, "△", "\\bigtriangleup");
v(b, E, Ne, "▽", "\\bigtriangledown");
v(b, E, Ne, "†", "\\dagger");
v(b, E, Ne, "⋄", "\\diamond");
v(b, E, Ne, "⋆", "\\star");
v(b, E, Ne, "◃", "\\triangleleft");
v(b, E, Ne, "▹", "\\triangleright");
v(b, E, Un, "{", "\\{");
v(ve, E, Z, "{", "\\{");
v(ve, E, Z, "{", "\\textbraceleft");
v(b, E, dn, "}", "\\}");
v(ve, E, Z, "}", "\\}");
v(ve, E, Z, "}", "\\textbraceright");
v(b, E, Un, "{", "\\lbrace");
v(b, E, dn, "}", "\\rbrace");
v(b, E, Un, "[", "\\lbrack", !0);
v(ve, E, Z, "[", "\\lbrack", !0);
v(b, E, dn, "]", "\\rbrack", !0);
v(ve, E, Z, "]", "\\rbrack", !0);
v(b, E, Un, "(", "\\lparen", !0);
v(b, E, dn, ")", "\\rparen", !0);
v(ve, E, Z, "<", "\\textless", !0);
v(ve, E, Z, ">", "\\textgreater", !0);
v(b, E, Un, "⌊", "\\lfloor", !0);
v(b, E, dn, "⌋", "\\rfloor", !0);
v(b, E, Un, "⌈", "\\lceil", !0);
v(b, E, dn, "⌉", "\\rceil", !0);
v(b, E, Z, "\\", "\\backslash");
v(b, E, Z, "∣", "|");
v(b, E, Z, "∣", "\\vert");
v(ve, E, Z, "|", "\\textbar", !0);
v(b, E, Z, "∥", "\\|");
v(b, E, Z, "∥", "\\Vert");
v(ve, E, Z, "∥", "\\textbardbl");
v(ve, E, Z, "~", "\\textasciitilde");
v(ve, E, Z, "\\", "\\textbackslash");
v(ve, E, Z, "^", "\\textasciicircum");
v(b, E, U, "↑", "\\uparrow", !0);
v(b, E, U, "⇑", "\\Uparrow", !0);
v(b, E, U, "↓", "\\downarrow", !0);
v(b, E, U, "⇓", "\\Downarrow", !0);
v(b, E, U, "↕", "\\updownarrow", !0);
v(b, E, U, "⇕", "\\Updownarrow", !0);
v(b, E, jt, "∐", "\\coprod");
v(b, E, jt, "⋁", "\\bigvee");
v(b, E, jt, "⋀", "\\bigwedge");
v(b, E, jt, "⨄", "\\biguplus");
v(b, E, jt, "⋂", "\\bigcap");
v(b, E, jt, "⋃", "\\bigcup");
v(b, E, jt, "∫", "\\int");
v(b, E, jt, "∫", "\\intop");
v(b, E, jt, "∬", "\\iint");
v(b, E, jt, "∭", "\\iiint");
v(b, E, jt, "∏", "\\prod");
v(b, E, jt, "∑", "\\sum");
v(b, E, jt, "⨂", "\\bigotimes");
v(b, E, jt, "⨁", "\\bigoplus");
v(b, E, jt, "⨀", "\\bigodot");
v(b, E, jt, "∮", "\\oint");
v(b, E, jt, "∯", "\\oiint");
v(b, E, jt, "∰", "\\oiiint");
v(b, E, jt, "⨆", "\\bigsqcup");
v(b, E, jt, "∫", "\\smallint");
v(ve, E, kl, "…", "\\textellipsis");
v(b, E, kl, "…", "\\mathellipsis");
v(ve, E, kl, "…", "\\ldots", !0);
v(b, E, kl, "…", "\\ldots", !0);
v(b, E, kl, "⋯", "\\@cdots", !0);
v(b, E, kl, "⋱", "\\ddots", !0);
v(b, E, Z, "⋮", "\\varvdots");
v(ve, E, Z, "⋮", "\\varvdots");
v(b, E, bt, "ˊ", "\\acute");
v(b, E, bt, "ˋ", "\\grave");
v(b, E, bt, "¨", "\\ddot");
v(b, E, bt, "~", "\\tilde");
v(b, E, bt, "ˉ", "\\bar");
v(b, E, bt, "˘", "\\breve");
v(b, E, bt, "ˇ", "\\check");
v(b, E, bt, "^", "\\hat");
v(b, E, bt, "⃗", "\\vec");
v(b, E, bt, "˙", "\\dot");
v(b, E, bt, "˚", "\\mathring");
v(b, E, Le, "", "\\@imath");
v(b, E, Le, "", "\\@jmath");
v(b, E, Z, "ı", "ı");
v(b, E, Z, "ȷ", "ȷ");
v(ve, E, Z, "ı", "\\i", !0);
v(ve, E, Z, "ȷ", "\\j", !0);
v(ve, E, Z, "ß", "\\ss", !0);
v(ve, E, Z, "æ", "\\ae", !0);
v(ve, E, Z, "œ", "\\oe", !0);
v(ve, E, Z, "ø", "\\o", !0);
v(ve, E, Z, "Æ", "\\AE", !0);
v(ve, E, Z, "Œ", "\\OE", !0);
v(ve, E, Z, "Ø", "\\O", !0);
v(ve, E, bt, "ˊ", "\\'");
v(ve, E, bt, "ˋ", "\\`");
v(ve, E, bt, "ˆ", "\\^");
v(ve, E, bt, "˜", "\\~");
v(ve, E, bt, "ˉ", "\\=");
v(ve, E, bt, "˘", "\\u");
v(ve, E, bt, "˙", "\\.");
v(ve, E, bt, "¸", "\\c");
v(ve, E, bt, "˚", "\\r");
v(ve, E, bt, "ˇ", "\\v");
v(ve, E, bt, "¨", '\\"');
v(ve, E, bt, "˝", "\\H");
v(ve, E, bt, "◯", "\\textcircled");
var wp = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
v(ve, E, Z, "–", "--", !0);
v(ve, E, Z, "–", "\\textendash");
v(ve, E, Z, "—", "---", !0);
v(ve, E, Z, "—", "\\textemdash");
v(ve, E, Z, "‘", "`", !0);
v(ve, E, Z, "‘", "\\textquoteleft");
v(ve, E, Z, "’", "'", !0);
v(ve, E, Z, "’", "\\textquoteright");
v(ve, E, Z, "“", "``", !0);
v(ve, E, Z, "“", "\\textquotedblleft");
v(ve, E, Z, "”", "''", !0);
v(ve, E, Z, "”", "\\textquotedblright");
v(b, E, Z, "°", "\\degree", !0);
v(ve, E, Z, "°", "\\degree");
v(ve, E, Z, "°", "\\textdegree", !0);
v(b, E, Z, "£", "\\pounds");
v(b, E, Z, "£", "\\mathsterling", !0);
v(ve, E, Z, "£", "\\pounds");
v(ve, E, Z, "£", "\\textsterling", !0);
v(b, L, Z, "✠", "\\maltese");
v(ve, L, Z, "✠", "\\maltese");
var Q5 = '0123456789/@."';
for (var x1 = 0; x1 < Q5.length; x1++) {
  var J5 = Q5.charAt(x1);
  v(b, E, Z, J5, J5);
}
var W5 = '0123456789!@*()-=+";:?/.,';
for (var b1 = 0; b1 < W5.length; b1++) {
  var P5 = W5.charAt(b1);
  v(ve, E, Z, P5, P5);
}
var mu = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var S1 = 0; S1 < mu.length; S1++) {
  var Vo = mu.charAt(S1);
  v(b, E, Le, Vo, Vo), v(ve, E, Z, Vo, Vo);
}
v(b, L, Z, "C", "ℂ");
v(ve, L, Z, "C", "ℂ");
v(b, L, Z, "H", "ℍ");
v(ve, L, Z, "H", "ℍ");
v(b, L, Z, "N", "ℕ");
v(ve, L, Z, "N", "ℕ");
v(b, L, Z, "P", "ℙ");
v(ve, L, Z, "P", "ℙ");
v(b, L, Z, "Q", "ℚ");
v(ve, L, Z, "Q", "ℚ");
v(b, L, Z, "R", "ℝ");
v(ve, L, Z, "R", "ℝ");
v(b, L, Z, "Z", "ℤ");
v(ve, L, Z, "Z", "ℤ");
v(b, E, Le, "h", "ℎ");
v(ve, E, Le, "h", "ℎ");
var Ve = "";
for (var cn = 0; cn < mu.length; cn++) {
  var Ct = mu.charAt(cn);
  Ve = String.fromCharCode(55349, 56320 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56372 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56424 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56580 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56684 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56736 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56788 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56840 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56944 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), cn < 26 && (Ve = String.fromCharCode(55349, 56632 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve), Ve = String.fromCharCode(55349, 56476 + cn), v(b, E, Le, Ct, Ve), v(ve, E, Z, Ct, Ve));
}
Ve = "𝕜";
v(b, E, Le, "k", Ve);
v(ve, E, Z, "k", Ve);
for (var br = 0; br < 10; br++) {
  var q0 = br.toString();
  Ve = String.fromCharCode(55349, 57294 + br), v(b, E, Le, q0, Ve), v(ve, E, Z, q0, Ve), Ve = String.fromCharCode(55349, 57314 + br), v(b, E, Le, q0, Ve), v(ve, E, Z, q0, Ve), Ve = String.fromCharCode(55349, 57324 + br), v(b, E, Le, q0, Ve), v(ve, E, Z, q0, Ve), Ve = String.fromCharCode(55349, 57334 + br), v(b, E, Le, q0, Ve), v(ve, E, Z, q0, Ve);
}
var eh = "ÐÞþ";
for (var w1 = 0; w1 < eh.length; w1++) {
  var Yo = eh.charAt(w1);
  v(b, E, Le, Yo, Yo), v(ve, E, Z, Yo, Yo);
}
var Go = [
  ["mathbf", "textbf", "Main-Bold"],
  // A-Z bold upright
  ["mathbf", "textbf", "Main-Bold"],
  // a-z bold upright
  ["mathnormal", "textit", "Math-Italic"],
  // A-Z italic
  ["mathnormal", "textit", "Math-Italic"],
  // a-z italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // A-Z bold italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // a-z bold italic
  // Map fancy A-Z letters to script, not calligraphic.
  // This aligns with unicode-math and math fonts (except Cambria Math).
  ["mathscr", "textscr", "Script-Regular"],
  // A-Z script
  ["", "", ""],
  // a-z script.  No font
  ["", "", ""],
  // A-Z bold script. No font
  ["", "", ""],
  // a-z bold script. No font
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // A-Z Fraktur
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // a-z Fraktur
  ["mathbb", "textbb", "AMS-Regular"],
  // A-Z double-struck
  ["mathbb", "textbb", "AMS-Regular"],
  // k double-struck
  // Note that we are using a bold font, but font metrics for regular Fraktur.
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // A-Z bold Fraktur
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // a-z bold Fraktur
  ["mathsf", "textsf", "SansSerif-Regular"],
  // A-Z sans-serif
  ["mathsf", "textsf", "SansSerif-Regular"],
  // a-z sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // A-Z bold sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // a-z bold sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // A-Z italic sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // a-z italic sans-serif
  ["", "", ""],
  // A-Z bold italic sans. No font
  ["", "", ""],
  // a-z bold italic sans. No font
  ["mathtt", "texttt", "Typewriter-Regular"],
  // A-Z monospace
  ["mathtt", "texttt", "Typewriter-Regular"]
  // a-z monospace
], e3 = [
  ["mathbf", "textbf", "Main-Bold"],
  // 0-9 bold
  ["", "", ""],
  // 0-9 double-struck. No KaTeX font.
  ["mathsf", "textsf", "SansSerif-Regular"],
  // 0-9 sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // 0-9 bold sans-serif
  ["mathtt", "texttt", "Typewriter-Regular"]
  // 0-9 monospace
], Dw = function(n, r) {
  var l = n.charCodeAt(0), s = n.charCodeAt(1), u = (l - 55296) * 1024 + (s - 56320) + 65536, c = r === "math" ? 0 : 1;
  if (119808 <= u && u < 120484) {
    var h = Math.floor((u - 119808) / 26);
    return [Go[h][2], Go[h][c]];
  } else if (120782 <= u && u <= 120831) {
    var d = Math.floor((u - 120782) / 10);
    return [e3[d][2], e3[d][c]];
  } else {
    if (u === 120485 || u === 120486)
      return [Go[0][2], Go[0][c]];
    if (120486 < u && u < 120782)
      return ["", ""];
    throw new we("Unsupported character: " + n);
  }
}, Du = function(n, r, l) {
  return mt[l][n] && mt[l][n].replace && (n = mt[l][n].replace), {
    value: n,
    metrics: Oh(n, r, l)
  };
}, ia = function(n, r, l, s, u) {
  var c = Du(n, r, l), h = c.metrics;
  n = c.value;
  var d;
  if (h) {
    var p = h.italic;
    (l === "text" || s && s.font === "mathit") && (p = 0), d = new ta(n, h.height, h.depth, p, h.skew, h.width, u);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + n + "' in style '" + r + "' and mode '" + l + "'")), d = new ta(n, 0, 0, 0, 0, 0, u);
  if (s) {
    d.maxFontSize = s.sizeMultiplier, s.style.isTight() && d.classes.push("mtight");
    var g = s.getColor();
    g && (d.style.color = g);
  }
  return d;
}, _w = function(n, r, l, s) {
  return s === void 0 && (s = []), l.font === "boldsymbol" && Du(n, "Main-Bold", r).metrics ? ia(n, "Main-Bold", r, l, s.concat(["mathbf"])) : n === "\\" || mt[r][n].font === "main" ? ia(n, "Main-Regular", r, l, s) : ia(n, "AMS-Regular", r, l, s.concat(["amsrm"]));
}, Rw = function(n, r, l, s, u) {
  return u !== "textord" && Du(n, "Math-BoldItalic", r).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, Bw = function(n, r, l) {
  var s = n.mode, u = n.text, c = ["mord"], h = s === "math" || s === "text" && r.font, d = h ? r.font : r.fontFamily, p = "", g = "";
  if (u.charCodeAt(0) === 55349 && ([p, g] = Dw(u, s)), p.length > 0)
    return ia(u, p, s, r, c.concat(g));
  if (d) {
    var y, x;
    if (d === "boldsymbol") {
      var w = Rw(u, s, r, c, l);
      y = w.fontName, x = [w.fontClass];
    } else h ? (y = Tp[d].fontName, x = [d]) : (y = Xo(d, r.fontWeight, r.fontShape), x = [d, r.fontWeight, r.fontShape]);
    if (Du(u, y, s).metrics)
      return ia(u, y, s, r, c.concat(x));
    if (wp.hasOwnProperty(u) && y.slice(0, 10) === "Typewriter") {
      for (var z = [], M = 0; M < u.length; M++)
        z.push(ia(u[M], y, s, r, c.concat(x)));
      return Mp(z);
    }
  }
  if (l === "mathord")
    return ia(u, "Math-Italic", s, r, c.concat(["mathnormal"]));
  if (l === "textord") {
    var A = mt[s][u] && mt[s][u].font;
    if (A === "ams") {
      var T = Xo("amsrm", r.fontWeight, r.fontShape);
      return ia(u, T, s, r, c.concat("amsrm", r.fontWeight, r.fontShape));
    } else if (A === "main" || !A) {
      var R = Xo("textrm", r.fontWeight, r.fontShape);
      return ia(u, R, s, r, c.concat(r.fontWeight, r.fontShape));
    } else {
      var q = Xo(A, r.fontWeight, r.fontShape);
      return ia(u, q, s, r, c.concat(q, r.fontWeight, r.fontShape));
    }
  } else
    throw new Error("unexpected type: " + l + " in makeOrd");
}, Ow = (e, n) => {
  if (I0(e.classes) !== I0(n.classes) || e.skew !== n.skew || e.maxFontSize !== n.maxFontSize)
    return !1;
  if (e.classes.length === 1) {
    var r = e.classes[0];
    if (r === "mbin" || r === "mord")
      return !1;
  }
  for (var l in e.style)
    if (e.style.hasOwnProperty(l) && e.style[l] !== n.style[l])
      return !1;
  for (var s in n.style)
    if (n.style.hasOwnProperty(s) && e.style[s] !== n.style[s])
      return !1;
  return !0;
}, Hw = (e) => {
  for (var n = 0; n < e.length - 1; n++) {
    var r = e[n], l = e[n + 1];
    r instanceof ta && l instanceof ta && Ow(r, l) && (r.text += l.text, r.height = Math.max(r.height, l.height), r.depth = Math.max(r.depth, l.depth), r.italic = l.italic, e.splice(n + 1, 1), n--);
  }
  return e;
}, Lh = function(n) {
  for (var r = 0, l = 0, s = 0, u = 0; u < n.children.length; u++) {
    var c = n.children[u];
    c.height > r && (r = c.height), c.depth > l && (l = c.depth), c.maxFontSize > s && (s = c.maxFontSize);
  }
  n.height = r, n.depth = l, n.maxFontSize = s;
}, Sn = function(n, r, l, s) {
  var u = new ts(n, r, l, s);
  return Lh(u), u;
}, Ep = (e, n, r, l) => new ts(e, n, r, l), Lw = function(n, r, l) {
  var s = Sn([n], [], r);
  return s.height = Math.max(l || r.fontMetrics().defaultRuleThickness, r.minRuleThickness), s.style.borderBottomWidth = Me(s.height), s.maxFontSize = 1, s;
}, qw = function(n, r, l, s) {
  var u = new Hh(n, r, l, s);
  return Lh(u), u;
}, Mp = function(n) {
  var r = new es(n);
  return Lh(r), r;
}, Uw = function(n, r) {
  return n instanceof es ? Sn([], [n], r) : n;
}, jw = function(n) {
  if (n.positionType === "individualShift") {
    for (var r = n.children, l = [r[0]], s = -r[0].shift - r[0].elem.depth, u = s, c = 1; c < r.length; c++) {
      var h = -r[c].shift - u - r[c].elem.depth, d = h - (r[c - 1].elem.height + r[c - 1].elem.depth);
      u = u + h, l.push({
        type: "kern",
        size: d
      }), l.push(r[c]);
    }
    return {
      children: l,
      depth: s
    };
  }
  var p;
  if (n.positionType === "top") {
    for (var g = n.positionData, y = 0; y < n.children.length; y++) {
      var x = n.children[y];
      g -= x.type === "kern" ? x.size : x.elem.height + x.elem.depth;
    }
    p = g;
  } else if (n.positionType === "bottom")
    p = -n.positionData;
  else {
    var w = n.children[0];
    if (w.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (n.positionType === "shift")
      p = -w.elem.depth - n.positionData;
    else if (n.positionType === "firstBaseline")
      p = -w.elem.depth;
    else
      throw new Error("Invalid positionType " + n.positionType + ".");
  }
  return {
    children: n.children,
    depth: p
  };
}, Vw = function(n, r) {
  for (var {
    children: l,
    depth: s
  } = jw(n), u = 0, c = 0; c < l.length; c++) {
    var h = l[c];
    if (h.type === "elem") {
      var d = h.elem;
      u = Math.max(u, d.maxFontSize, d.height);
    }
  }
  u += 2;
  var p = Sn(["pstrut"], []);
  p.style.height = Me(u);
  for (var g = [], y = s, x = s, w = s, z = 0; z < l.length; z++) {
    var M = l[z];
    if (M.type === "kern")
      w += M.size;
    else {
      var A = M.elem, T = M.wrapperClasses || [], R = M.wrapperStyle || {}, q = Sn(T, [p, A], void 0, R);
      q.style.top = Me(-u - w - A.depth), M.marginLeft && (q.style.marginLeft = M.marginLeft), M.marginRight && (q.style.marginRight = M.marginRight), g.push(q), w += A.height + A.depth;
    }
    y = Math.min(y, w), x = Math.max(x, w);
  }
  var H = Sn(["vlist"], g);
  H.style.height = Me(x);
  var $;
  if (y < 0) {
    var V = Sn([], []), Q = Sn(["vlist"], [V]);
    Q.style.height = Me(-y);
    var re = Sn(["vlist-s"], [new ta("​")]);
    $ = [Sn(["vlist-r"], [H, re]), Sn(["vlist-r"], [Q])];
  } else
    $ = [Sn(["vlist-r"], [H])];
  var te = Sn(["vlist-t"], $);
  return $.length === 2 && te.classes.push("vlist-t2"), te.height = x, te.depth = -y, te;
}, Yw = (e, n) => {
  var r = Sn(["mspace"], [], n), l = Tt(e, n);
  return r.style.marginRight = Me(l), r;
}, Xo = function(n, r, l) {
  var s = "";
  switch (n) {
    case "amsrm":
      s = "AMS";
      break;
    case "textrm":
      s = "Main";
      break;
    case "textsf":
      s = "SansSerif";
      break;
    case "texttt":
      s = "Typewriter";
      break;
    default:
      s = n;
  }
  var u;
  return r === "textbf" && l === "textit" ? u = "BoldItalic" : r === "textbf" ? u = "Bold" : r === "textit" ? u = "Italic" : u = "Regular", s + "-" + u;
}, Tp = {
  // styles
  mathbf: {
    variant: "bold",
    fontName: "Main-Bold"
  },
  mathrm: {
    variant: "normal",
    fontName: "Main-Regular"
  },
  textit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathnormal: {
    variant: "italic",
    fontName: "Math-Italic"
  },
  mathsfit: {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.
  // families
  mathbb: {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  mathcal: {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  mathfrak: {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  mathscr: {
    variant: "script",
    fontName: "Script-Regular"
  },
  mathsf: {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  mathtt: {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
}, zp = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
}, Gw = function(n, r) {
  var [l, s, u] = zp[n], c = new K0(l), h = new r0([c], {
    width: Me(s),
    height: Me(u),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Me(s),
    viewBox: "0 0 " + 1e3 * s + " " + 1e3 * u,
    preserveAspectRatio: "xMinYMin"
  }), d = Ep(["overlay"], [h], r);
  return d.height = u, d.style.height = Me(u), d.style.width = Me(s), d;
}, P = {
  fontMap: Tp,
  makeSymbol: ia,
  mathsym: _w,
  makeSpan: Sn,
  makeSvgSpan: Ep,
  makeLineSpan: Lw,
  makeAnchor: qw,
  makeFragment: Mp,
  wrapFragment: Uw,
  makeVList: Vw,
  makeOrd: Bw,
  makeGlue: Yw,
  staticSvg: Gw,
  svgData: zp,
  tryCombineChars: Hw
}, Et = {
  number: 3,
  unit: "mu"
}, Sr = {
  number: 4,
  unit: "mu"
}, Ja = {
  number: 5,
  unit: "mu"
}, Xw = {
  mord: {
    mop: Et,
    mbin: Sr,
    mrel: Ja,
    minner: Et
  },
  mop: {
    mord: Et,
    mop: Et,
    mrel: Ja,
    minner: Et
  },
  mbin: {
    mord: Sr,
    mop: Sr,
    mopen: Sr,
    minner: Sr
  },
  mrel: {
    mord: Ja,
    mop: Ja,
    mopen: Ja,
    minner: Ja
  },
  mopen: {},
  mclose: {
    mop: Et,
    mbin: Sr,
    mrel: Ja,
    minner: Et
  },
  mpunct: {
    mord: Et,
    mop: Et,
    mrel: Ja,
    mopen: Et,
    mclose: Et,
    mpunct: Et,
    minner: Et
  },
  minner: {
    mord: Et,
    mop: Et,
    mbin: Sr,
    mrel: Ja,
    mopen: Et,
    mpunct: Et,
    minner: Et
  }
}, $w = {
  mord: {
    mop: Et
  },
  mop: {
    mord: Et,
    mop: Et
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: Et
  },
  mpunct: {},
  minner: {
    mop: Et
  }
}, Ap = {}, pu = {}, gu = {};
function Ce(e) {
  for (var {
    type: n,
    names: r,
    props: l,
    handler: s,
    htmlBuilder: u,
    mathmlBuilder: c
  } = e, h = {
    type: n,
    numArgs: l.numArgs,
    argTypes: l.argTypes,
    allowedInArgument: !!l.allowedInArgument,
    allowedInText: !!l.allowedInText,
    allowedInMath: l.allowedInMath === void 0 ? !0 : l.allowedInMath,
    numOptionalArgs: l.numOptionalArgs || 0,
    infix: !!l.infix,
    primitive: !!l.primitive,
    handler: s
  }, d = 0; d < r.length; ++d)
    Ap[r[d]] = h;
  n && (u && (pu[n] = u), c && (gu[n] = c));
}
function Nr(e) {
  var {
    type: n,
    htmlBuilder: r,
    mathmlBuilder: l
  } = e;
  Ce({
    type: n,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: r,
    mathmlBuilder: l
  });
}
var yu = function(n) {
  return n.type === "ordgroup" && n.body.length === 1 ? n.body[0] : n;
}, Rt = function(n) {
  return n.type === "ordgroup" ? n.body : [n];
}, l0 = P.makeSpan, Zw = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], Fw = ["rightmost", "mrel", "mclose", "mpunct"], Iw = {
  display: qe.DISPLAY,
  text: qe.TEXT,
  script: qe.SCRIPT,
  scriptscript: qe.SCRIPTSCRIPT
}, Kw = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, $t = function(n, r, l, s) {
  s === void 0 && (s = [null, null]);
  for (var u = [], c = 0; c < n.length; c++) {
    var h = et(n[c], r);
    if (h instanceof es) {
      var d = h.children;
      u.push(...d);
    } else
      u.push(h);
  }
  if (P.tryCombineChars(u), !l)
    return u;
  var p = r;
  if (n.length === 1) {
    var g = n[0];
    g.type === "sizing" ? p = r.havingSize(g.size) : g.type === "styling" && (p = r.havingStyle(Iw[g.style]));
  }
  var y = l0([s[0] || "leftmost"], [], r), x = l0([s[1] || "rightmost"], [], r), w = l === "root";
  return t3(u, (z, M) => {
    var A = M.classes[0], T = z.classes[0];
    A === "mbin" && Fw.includes(T) ? M.classes[0] = "mord" : T === "mbin" && Zw.includes(A) && (z.classes[0] = "mord");
  }, {
    node: y
  }, x, w), t3(u, (z, M) => {
    var A = th(M), T = th(z), R = A && T ? z.hasClass("mtight") ? $w[A][T] : Xw[A][T] : null;
    if (R)
      return P.makeGlue(R, p);
  }, {
    node: y
  }, x, w), u;
}, t3 = function e(n, r, l, s, u) {
  s && n.push(s);
  for (var c = 0; c < n.length; c++) {
    var h = n[c], d = Cp(h);
    if (d) {
      e(d.children, r, l, null, u);
      continue;
    }
    var p = !h.hasClass("mspace");
    if (p) {
      var g = r(h, l.node);
      g && (l.insertAfter ? l.insertAfter(g) : (n.unshift(g), c++));
    }
    p ? l.node = h : u && h.hasClass("newline") && (l.node = l0(["leftmost"])), l.insertAfter = /* @__PURE__ */ ((y) => (x) => {
      n.splice(y + 1, 0, x), c++;
    })(c);
  }
  s && n.pop();
}, Cp = function(n) {
  return n instanceof es || n instanceof Hh || n instanceof ts && n.hasClass("enclosing") ? n : null;
}, Qw = function e(n, r) {
  var l = Cp(n);
  if (l) {
    var s = l.children;
    if (s.length) {
      if (r === "right")
        return e(s[s.length - 1], "right");
      if (r === "left")
        return e(s[0], "left");
    }
  }
  return n;
}, th = function(n, r) {
  return n ? (r && (n = Qw(n, r)), Kw[n.classes[0]] || null) : null;
}, Ii = function(n, r) {
  var l = ["nulldelimiter"].concat(n.baseSizingClasses());
  return l0(r.concat(l));
}, et = function(n, r, l) {
  if (!n)
    return l0();
  if (pu[n.type]) {
    var s = pu[n.type](n, r);
    if (l && r.size !== l.size) {
      s = l0(r.sizingClasses(l), [s], r);
      var u = r.sizeMultiplier / l.sizeMultiplier;
      s.height *= u, s.depth *= u;
    }
    return s;
  } else
    throw new we("Got group of unknown type: '" + n.type + "'");
};
function $o(e, n) {
  var r = l0(["base"], e, n), l = l0(["strut"]);
  return l.style.height = Me(r.height + r.depth), r.depth && (l.style.verticalAlign = Me(-r.depth)), r.children.unshift(l), r;
}
function nh(e, n) {
  var r = null;
  e.length === 1 && e[0].type === "tag" && (r = e[0].tag, e = e[0].body);
  var l = $t(e, n, "root"), s;
  l.length === 2 && l[1].hasClass("tag") && (s = l.pop());
  for (var u = [], c = [], h = 0; h < l.length; h++)
    if (c.push(l[h]), l[h].hasClass("mbin") || l[h].hasClass("mrel") || l[h].hasClass("allowbreak")) {
      for (var d = !1; h < l.length - 1 && l[h + 1].hasClass("mspace") && !l[h + 1].hasClass("newline"); )
        h++, c.push(l[h]), l[h].hasClass("nobreak") && (d = !0);
      d || (u.push($o(c, n)), c = []);
    } else l[h].hasClass("newline") && (c.pop(), c.length > 0 && (u.push($o(c, n)), c = []), u.push(l[h]));
  c.length > 0 && u.push($o(c, n));
  var p;
  r ? (p = $o($t(r, n, !0)), p.classes = ["tag"], u.push(p)) : s && u.push(s);
  var g = l0(["katex-html"], u);
  if (g.setAttribute("aria-hidden", "true"), p) {
    var y = p.children[0];
    y.style.height = Me(g.height + g.depth), g.depth && (y.style.verticalAlign = Me(-g.depth));
  }
  return g;
}
function Np(e) {
  return new es(e);
}
class Hn {
  constructor(n, r, l) {
    this.type = void 0, this.attributes = void 0, this.children = void 0, this.classes = void 0, this.type = n, this.attributes = {}, this.children = r || [], this.classes = l || [];
  }
  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(n, r) {
    this.attributes[n] = r;
  }
  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(n) {
    return this.attributes[n];
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    var n = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && n.setAttribute(r, this.attributes[r]);
    this.classes.length > 0 && (n.className = I0(this.classes));
    for (var l = 0; l < this.children.length; l++)
      if (this.children[l] instanceof ba && this.children[l + 1] instanceof ba) {
        for (var s = this.children[l].toText() + this.children[++l].toText(); this.children[l + 1] instanceof ba; )
          s += this.children[++l].toText();
        n.appendChild(new ba(s).toNode());
      } else
        n.appendChild(this.children[l].toNode());
    return n;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    var n = "<" + this.type;
    for (var r in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, r) && (n += " " + r + '="', n += at.escape(this.attributes[r]), n += '"');
    this.classes.length > 0 && (n += ' class ="' + at.escape(I0(this.classes)) + '"'), n += ">";
    for (var l = 0; l < this.children.length; l++)
      n += this.children[l].toMarkup();
    return n += "</" + this.type + ">", n;
  }
  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map((n) => n.toText()).join("");
  }
}
class ba {
  constructor(n) {
    this.text = void 0, this.text = n;
  }
  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }
  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return at.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class Jw {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(n) {
    this.width = void 0, this.character = void 0, this.width = n, n >= 0.05555 && n <= 0.05556 ? this.character = " " : n >= 0.1666 && n <= 0.1667 ? this.character = " " : n >= 0.2222 && n <= 0.2223 ? this.character = " " : n >= 0.2777 && n <= 0.2778 ? this.character = "  " : n >= -0.05556 && n <= -0.05555 ? this.character = " ⁣" : n >= -0.1667 && n <= -0.1666 ? this.character = " ⁣" : n >= -0.2223 && n <= -0.2222 ? this.character = " ⁣" : n >= -0.2778 && n <= -0.2777 ? this.character = " ⁣" : this.character = null;
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character)
      return document.createTextNode(this.character);
    var n = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
    return n.setAttribute("width", Me(this.width)), n;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + Me(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var Se = {
  MathNode: Hn,
  TextNode: ba,
  SpaceNode: Jw,
  newDocumentFragment: Np
}, na = function(n, r, l) {
  return mt[r][n] && mt[r][n].replace && n.charCodeAt(0) !== 55349 && !(wp.hasOwnProperty(n) && l && (l.fontFamily && l.fontFamily.slice(4, 6) === "tt" || l.font && l.font.slice(4, 6) === "tt")) && (n = mt[r][n].replace), new Se.TextNode(n);
}, qh = function(n) {
  return n.length === 1 ? n[0] : new Se.MathNode("mrow", n);
}, Uh = function(n, r) {
  if (r.fontFamily === "texttt")
    return "monospace";
  if (r.fontFamily === "textsf")
    return r.fontShape === "textit" && r.fontWeight === "textbf" ? "sans-serif-bold-italic" : r.fontShape === "textit" ? "sans-serif-italic" : r.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
  if (r.fontShape === "textit" && r.fontWeight === "textbf")
    return "bold-italic";
  if (r.fontShape === "textit")
    return "italic";
  if (r.fontWeight === "textbf")
    return "bold";
  var l = r.font;
  if (!l || l === "mathnormal")
    return null;
  var s = n.mode;
  if (l === "mathit")
    return "italic";
  if (l === "boldsymbol")
    return n.type === "textord" ? "bold" : "bold-italic";
  if (l === "mathbf")
    return "bold";
  if (l === "mathbb")
    return "double-struck";
  if (l === "mathsfit")
    return "sans-serif-italic";
  if (l === "mathfrak")
    return "fraktur";
  if (l === "mathscr" || l === "mathcal")
    return "script";
  if (l === "mathsf")
    return "sans-serif";
  if (l === "mathtt")
    return "monospace";
  var u = n.text;
  if (["\\imath", "\\jmath"].includes(u))
    return null;
  mt[s][u] && mt[s][u].replace && (u = mt[s][u].replace);
  var c = P.fontMap[l].fontName;
  return Oh(u, c, s) ? P.fontMap[l].variant : null;
};
function E1(e) {
  if (!e)
    return !1;
  if (e.type === "mi" && e.children.length === 1) {
    var n = e.children[0];
    return n instanceof ba && n.text === ".";
  } else if (e.type === "mo" && e.children.length === 1 && e.getAttribute("separator") === "true" && e.getAttribute("lspace") === "0em" && e.getAttribute("rspace") === "0em") {
    var r = e.children[0];
    return r instanceof ba && r.text === ",";
  } else
    return !1;
}
var zn = function(n, r, l) {
  if (n.length === 1) {
    var s = dt(n[0], r);
    return l && s instanceof Hn && s.type === "mo" && (s.setAttribute("lspace", "0em"), s.setAttribute("rspace", "0em")), [s];
  }
  for (var u = [], c, h = 0; h < n.length; h++) {
    var d = dt(n[h], r);
    if (d instanceof Hn && c instanceof Hn) {
      if (d.type === "mtext" && c.type === "mtext" && d.getAttribute("mathvariant") === c.getAttribute("mathvariant")) {
        c.children.push(...d.children);
        continue;
      } else if (d.type === "mn" && c.type === "mn") {
        c.children.push(...d.children);
        continue;
      } else if (E1(d) && c.type === "mn") {
        c.children.push(...d.children);
        continue;
      } else if (d.type === "mn" && E1(c))
        d.children = [...c.children, ...d.children], u.pop();
      else if ((d.type === "msup" || d.type === "msub") && d.children.length >= 1 && (c.type === "mn" || E1(c))) {
        var p = d.children[0];
        p instanceof Hn && p.type === "mn" && (p.children = [...c.children, ...p.children], u.pop());
      } else if (c.type === "mi" && c.children.length === 1) {
        var g = c.children[0];
        if (g instanceof ba && g.text === "̸" && (d.type === "mo" || d.type === "mi" || d.type === "mn")) {
          var y = d.children[0];
          y instanceof ba && y.text.length > 0 && (y.text = y.text.slice(0, 1) + "̸" + y.text.slice(1), u.pop());
        }
      }
    }
    u.push(d), c = d;
  }
  return u;
}, Q0 = function(n, r, l) {
  return qh(zn(n, r, l));
}, dt = function(n, r) {
  if (!n)
    return new Se.MathNode("mrow");
  if (gu[n.type]) {
    var l = gu[n.type](n, r);
    return l;
  } else
    throw new we("Got group of unknown type: '" + n.type + "'");
};
function n3(e, n, r, l, s) {
  var u = zn(e, r), c;
  u.length === 1 && u[0] instanceof Hn && ["mrow", "mtable"].includes(u[0].type) ? c = u[0] : c = new Se.MathNode("mrow", u);
  var h = new Se.MathNode("annotation", [new Se.TextNode(n)]);
  h.setAttribute("encoding", "application/x-tex");
  var d = new Se.MathNode("semantics", [c, h]), p = new Se.MathNode("math", [d]);
  p.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), l && p.setAttribute("display", "block");
  var g = s ? "katex" : "katex-mathml";
  return P.makeSpan([g], [p]);
}
var kp = function(n) {
  return new Wa({
    style: n.displayMode ? qe.DISPLAY : qe.TEXT,
    maxSize: n.maxSize,
    minRuleThickness: n.minRuleThickness
  });
}, Dp = function(n, r) {
  if (r.displayMode) {
    var l = ["katex-display"];
    r.leqno && l.push("leqno"), r.fleqn && l.push("fleqn"), n = P.makeSpan(l, [n]);
  }
  return n;
}, Ww = function(n, r, l) {
  var s = kp(l), u;
  if (l.output === "mathml")
    return n3(n, r, s, l.displayMode, !0);
  if (l.output === "html") {
    var c = nh(n, s);
    u = P.makeSpan(["katex"], [c]);
  } else {
    var h = n3(n, r, s, l.displayMode, !1), d = nh(n, s);
    u = P.makeSpan(["katex"], [h, d]);
  }
  return Dp(u, l);
}, Pw = function(n, r, l) {
  var s = kp(l), u = nh(n, s), c = P.makeSpan(["katex"], [u]);
  return Dp(c, l);
}, eE = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "←",
  underleftarrow: "←",
  xleftarrow: "←",
  overrightarrow: "→",
  underrightarrow: "→",
  xrightarrow: "→",
  underbrace: "⏟",
  overbrace: "⏞",
  overgroup: "⏠",
  undergroup: "⏡",
  overleftrightarrow: "↔",
  underleftrightarrow: "↔",
  xleftrightarrow: "↔",
  Overrightarrow: "⇒",
  xRightarrow: "⇒",
  overleftharpoon: "↼",
  xleftharpoonup: "↼",
  overrightharpoon: "⇀",
  xrightharpoonup: "⇀",
  xLeftarrow: "⇐",
  xLeftrightarrow: "⇔",
  xhookleftarrow: "↩",
  xhookrightarrow: "↪",
  xmapsto: "↦",
  xrightharpoondown: "⇁",
  xleftharpoondown: "↽",
  xrightleftharpoons: "⇌",
  xleftrightharpoons: "⇋",
  xtwoheadleftarrow: "↞",
  xtwoheadrightarrow: "↠",
  xlongequal: "=",
  xtofrom: "⇄",
  xrightleftarrows: "⇄",
  xrightequilibrium: "⇌",
  // Not a perfect match.
  xleftequilibrium: "⇋",
  // None better available.
  "\\cdrightarrow": "→",
  "\\cdleftarrow": "←",
  "\\cdlongequal": "="
}, tE = function(n) {
  var r = new Se.MathNode("mo", [new Se.TextNode(eE[n.replace(/^\\/, "")])]);
  return r.setAttribute("stretchy", "true"), r;
}, nE = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
}, aE = function(n) {
  return n.type === "ordgroup" ? n.body.length : 1;
}, rE = function(n, r) {
  function l() {
    var h = 4e5, d = n.label.slice(1);
    if (["widehat", "widecheck", "widetilde", "utilde"].includes(d)) {
      var p = n, g = aE(p.base), y, x, w;
      if (g > 5)
        d === "widehat" || d === "widecheck" ? (y = 420, h = 2364, w = 0.42, x = d + "4") : (y = 312, h = 2340, w = 0.34, x = "tilde4");
      else {
        var z = [1, 1, 2, 2, 3, 3][g];
        d === "widehat" || d === "widecheck" ? (h = [0, 1062, 2364, 2364, 2364][z], y = [0, 239, 300, 360, 420][z], w = [0, 0.24, 0.3, 0.3, 0.36, 0.42][z], x = d + z) : (h = [0, 600, 1033, 2339, 2340][z], y = [0, 260, 286, 306, 312][z], w = [0, 0.26, 0.286, 0.3, 0.306, 0.34][z], x = "tilde" + z);
      }
      var M = new K0(x), A = new r0([M], {
        width: "100%",
        height: Me(w),
        viewBox: "0 0 " + h + " " + y,
        preserveAspectRatio: "none"
      });
      return {
        span: P.makeSvgSpan([], [A], r),
        minWidth: 0,
        height: w
      };
    } else {
      var T = [], R = nE[d], [q, H, $] = R, V = $ / 1e3, Q = q.length, re, te;
      if (Q === 1) {
        var ie = R[3];
        re = ["hide-tail"], te = [ie];
      } else if (Q === 2)
        re = ["halfarrow-left", "halfarrow-right"], te = ["xMinYMin", "xMaxYMin"];
      else if (Q === 3)
        re = ["brace-left", "brace-center", "brace-right"], te = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + Q + " children.");
      for (var ue = 0; ue < Q; ue++) {
        var de = new K0(q[ue]), ge = new r0([de], {
          width: "400em",
          height: Me(V),
          viewBox: "0 0 " + h + " " + $,
          preserveAspectRatio: te[ue] + " slice"
        }), _ = P.makeSvgSpan([re[ue]], [ge], r);
        if (Q === 1)
          return {
            span: _,
            minWidth: H,
            height: V
          };
        _.style.height = Me(V), T.push(_);
      }
      return {
        span: P.makeSpan(["stretchy"], T, r),
        minWidth: H,
        height: V
      };
    }
  }
  var {
    span: s,
    minWidth: u,
    height: c
  } = l();
  return s.height = c, s.style.height = Me(c), u > 0 && (s.style.minWidth = Me(u)), s;
}, lE = function(n, r, l, s, u) {
  var c, h = n.height + n.depth + l + s;
  if (/fbox|color|angl/.test(r)) {
    if (c = P.makeSpan(["stretchy", r], [], u), r === "fbox") {
      var d = u.color && u.getColor();
      d && (c.style.borderColor = d);
    }
  } else {
    var p = [];
    /^[bx]cancel$/.test(r) && p.push(new P1({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(r) && p.push(new P1({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var g = new r0(p, {
      width: "100%",
      height: Me(h)
    });
    c = P.makeSvgSpan([], [g], u);
  }
  return c.height = h, c.style.height = Me(h), c;
}, i0 = {
  encloseSpan: lE,
  mathMLnode: tE,
  svgSpan: rE
};
function Ze(e, n) {
  if (!e || e.type !== n)
    throw new Error("Expected node of type " + n + ", but got " + (e ? "node of type " + e.type : String(e)));
  return e;
}
function jh(e) {
  var n = _u(e);
  if (!n)
    throw new Error("Expected node of symbol group type, but got " + (e ? "node of type " + e.type : String(e)));
  return n;
}
function _u(e) {
  return e && (e.type === "atom" || kw.hasOwnProperty(e.type)) ? e : null;
}
var Vh = (e, n) => {
  var r, l, s;
  e && e.type === "supsub" ? (l = Ze(e.base, "accent"), r = l.base, e.base = r, s = Cw(et(e, n)), e.base = l) : (l = Ze(e, "accent"), r = l.base);
  var u = et(r, n.havingCrampedStyle()), c = l.isShifty && at.isCharacterBox(r), h = 0;
  if (c) {
    var d = at.getBaseElem(r), p = et(d, n.havingCrampedStyle());
    h = K5(p).skew;
  }
  var g = l.label === "\\c", y = g ? u.height + u.depth : Math.min(u.height, n.fontMetrics().xHeight), x;
  if (l.isStretchy)
    x = i0.svgSpan(l, n), x = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: u
      }, {
        type: "elem",
        elem: x,
        wrapperClasses: ["svg-align"],
        wrapperStyle: h > 0 ? {
          width: "calc(100% - " + Me(2 * h) + ")",
          marginLeft: Me(2 * h)
        } : void 0
      }]
    }, n);
  else {
    var w, z;
    l.label === "\\vec" ? (w = P.staticSvg("vec", n), z = P.svgData.vec[1]) : (w = P.makeOrd({
      mode: l.mode,
      text: l.label
    }, n, "textord"), w = K5(w), w.italic = 0, z = w.width, g && (y += w.depth)), x = P.makeSpan(["accent-body"], [w]);
    var M = l.label === "\\textcircled";
    M && (x.classes.push("accent-full"), y = u.height);
    var A = h;
    M || (A -= z / 2), x.style.left = Me(A), l.label === "\\textcircled" && (x.style.top = ".2em"), x = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: u
      }, {
        type: "kern",
        size: -y
      }, {
        type: "elem",
        elem: x
      }]
    }, n);
  }
  var T = P.makeSpan(["mord", "accent"], [x], n);
  return s ? (s.children[0] = T, s.height = Math.max(T.height, s.height), s.classes[0] = "mord", s) : T;
}, _p = (e, n) => {
  var r = e.isStretchy ? i0.mathMLnode(e.label) : new Se.MathNode("mo", [na(e.label, e.mode)]), l = new Se.MathNode("mover", [dt(e.base, n), r]);
  return l.setAttribute("accent", "true"), l;
}, iE = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((e) => "\\" + e).join("|"));
Ce({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (e, n) => {
    var r = yu(n[0]), l = !iE.test(e.funcName), s = !l || e.funcName === "\\widehat" || e.funcName === "\\widetilde" || e.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: e.parser.mode,
      label: e.funcName,
      isStretchy: l,
      isShifty: s,
      base: r
    };
  },
  htmlBuilder: Vh,
  mathmlBuilder: _p
});
Ce({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (e, n) => {
    var r = n[0], l = e.parser.mode;
    return l === "math" && (e.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + e.funcName + " works only in text mode"), l = "text"), {
      type: "accent",
      mode: l,
      label: e.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: r
    };
  },
  htmlBuilder: Vh,
  mathmlBuilder: _p
});
Ce({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "accentUnder",
      mode: r.mode,
      label: l,
      base: s
    };
  },
  htmlBuilder: (e, n) => {
    var r = et(e.base, n), l = i0.svgSpan(e, n), s = e.label === "\\utilde" ? 0.12 : 0, u = P.makeVList({
      positionType: "top",
      positionData: r.height,
      children: [{
        type: "elem",
        elem: l,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: s
      }, {
        type: "elem",
        elem: r
      }]
    }, n);
    return P.makeSpan(["mord", "accentunder"], [u], n);
  },
  mathmlBuilder: (e, n) => {
    var r = i0.mathMLnode(e.label), l = new Se.MathNode("munder", [dt(e.base, n), r]);
    return l.setAttribute("accentunder", "true"), l;
  }
});
var Zo = (e) => {
  var n = new Se.MathNode("mpadded", e ? [e] : []);
  return n.setAttribute("width", "+0.6em"), n.setAttribute("lspace", "0.3em"), n;
};
Ce({
  type: "xArrow",
  names: [
    "\\xleftarrow",
    "\\xrightarrow",
    "\\xLeftarrow",
    "\\xRightarrow",
    "\\xleftrightarrow",
    "\\xLeftrightarrow",
    "\\xhookleftarrow",
    "\\xhookrightarrow",
    "\\xmapsto",
    "\\xrightharpoondown",
    "\\xrightharpoonup",
    "\\xleftharpoondown",
    "\\xleftharpoonup",
    "\\xrightleftharpoons",
    "\\xleftrightharpoons",
    "\\xlongequal",
    "\\xtwoheadrightarrow",
    "\\xtwoheadleftarrow",
    "\\xtofrom",
    // The next 3 functions are here to support the mhchem extension.
    // Direct use of these functions is discouraged and may break someday.
    "\\xrightleftarrows",
    "\\xrightequilibrium",
    "\\xleftequilibrium",
    // The next 3 functions are here only to support the {CD} environment.
    "\\\\cdrightarrow",
    "\\\\cdleftarrow",
    "\\\\cdlongequal"
  ],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(e, n, r) {
    var {
      parser: l,
      funcName: s
    } = e;
    return {
      type: "xArrow",
      mode: l.mode,
      label: s,
      body: n[0],
      below: r[0]
    };
  },
  // Flow is unable to correctly infer the type of `group`, even though it's
  // unambiguously determined from the passed-in `type` above.
  htmlBuilder(e, n) {
    var r = n.style, l = n.havingStyle(r.sup()), s = P.wrapFragment(et(e.body, l, n), n), u = e.label.slice(0, 2) === "\\x" ? "x" : "cd";
    s.classes.push(u + "-arrow-pad");
    var c;
    e.below && (l = n.havingStyle(r.sub()), c = P.wrapFragment(et(e.below, l, n), n), c.classes.push(u + "-arrow-pad"));
    var h = i0.svgSpan(e, n), d = -n.fontMetrics().axisHeight + 0.5 * h.height, p = -n.fontMetrics().axisHeight - 0.5 * h.height - 0.111;
    (s.depth > 0.25 || e.label === "\\xleftequilibrium") && (p -= s.depth);
    var g;
    if (c) {
      var y = -n.fontMetrics().axisHeight + c.height + 0.5 * h.height + 0.111;
      g = P.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: s,
          shift: p
        }, {
          type: "elem",
          elem: h,
          shift: d
        }, {
          type: "elem",
          elem: c,
          shift: y
        }]
      }, n);
    } else
      g = P.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: s,
          shift: p
        }, {
          type: "elem",
          elem: h,
          shift: d
        }]
      }, n);
    return g.children[0].children[0].children[1].classes.push("svg-align"), P.makeSpan(["mrel", "x-arrow"], [g], n);
  },
  mathmlBuilder(e, n) {
    var r = i0.mathMLnode(e.label);
    r.setAttribute("minsize", e.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var l;
    if (e.body) {
      var s = Zo(dt(e.body, n));
      if (e.below) {
        var u = Zo(dt(e.below, n));
        l = new Se.MathNode("munderover", [r, u, s]);
      } else
        l = new Se.MathNode("mover", [r, s]);
    } else if (e.below) {
      var c = Zo(dt(e.below, n));
      l = new Se.MathNode("munder", [r, c]);
    } else
      l = Zo(), l = new Se.MathNode("mover", [r, l]);
    return l;
  }
});
var sE = P.makeSpan;
function Rp(e, n) {
  var r = $t(e.body, n, !0);
  return sE([e.mclass], r, n);
}
function Bp(e, n) {
  var r, l = zn(e.body, n);
  return e.mclass === "minner" ? r = new Se.MathNode("mpadded", l) : e.mclass === "mord" ? e.isCharacterBox ? (r = l[0], r.type = "mi") : r = new Se.MathNode("mi", l) : (e.isCharacterBox ? (r = l[0], r.type = "mo") : r = new Se.MathNode("mo", l), e.mclass === "mbin" ? (r.attributes.lspace = "0.22em", r.attributes.rspace = "0.22em") : e.mclass === "mpunct" ? (r.attributes.lspace = "0em", r.attributes.rspace = "0.17em") : e.mclass === "mopen" || e.mclass === "mclose" ? (r.attributes.lspace = "0em", r.attributes.rspace = "0em") : e.mclass === "minner" && (r.attributes.lspace = "0.0556em", r.attributes.width = "+0.1111em")), r;
}
Ce({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "mclass",
      mode: r.mode,
      mclass: "m" + l.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: Rt(s),
      isCharacterBox: at.isCharacterBox(s)
    };
  },
  htmlBuilder: Rp,
  mathmlBuilder: Bp
});
var Ru = (e) => {
  var n = e.type === "ordgroup" && e.body.length ? e.body[0] : e;
  return n.type === "atom" && (n.family === "bin" || n.family === "rel") ? "m" + n.family : "mord";
};
Ce({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "mclass",
      mode: r.mode,
      mclass: Ru(n[0]),
      body: Rt(n[1]),
      isCharacterBox: at.isCharacterBox(n[1])
    };
  }
});
Ce({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = n[1], u = n[0], c;
    l !== "\\stackrel" ? c = Ru(s) : c = "mrel";
    var h = {
      type: "op",
      mode: s.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: l !== "\\stackrel",
      body: Rt(s)
    }, d = {
      type: "supsub",
      mode: u.mode,
      base: h,
      sup: l === "\\underset" ? null : u,
      sub: l === "\\underset" ? u : null
    };
    return {
      type: "mclass",
      mode: r.mode,
      mclass: c,
      body: [d],
      isCharacterBox: at.isCharacterBox(d)
    };
  },
  htmlBuilder: Rp,
  mathmlBuilder: Bp
});
Ce({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "pmb",
      mode: r.mode,
      mclass: Ru(n[0]),
      body: Rt(n[0])
    };
  },
  htmlBuilder(e, n) {
    var r = $t(e.body, n, !0), l = P.makeSpan([e.mclass], r, n);
    return l.style.textShadow = "0.02em 0.01em 0.04px", l;
  },
  mathmlBuilder(e, n) {
    var r = zn(e.body, n), l = new Se.MathNode("mstyle", r);
    return l.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), l;
  }
});
var oE = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, a3 = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), r3 = (e) => e.type === "textord" && e.text === "@", uE = (e, n) => (e.type === "mathord" || e.type === "atom") && e.text === n;
function cE(e, n, r) {
  var l = oE[e];
  switch (l) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return r.callFunction(l, [n[0]], [n[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var s = r.callFunction("\\\\cdleft", [n[0]], []), u = {
        type: "atom",
        text: l,
        mode: "math",
        family: "rel"
      }, c = r.callFunction("\\Big", [u], []), h = r.callFunction("\\\\cdright", [n[1]], []), d = {
        type: "ordgroup",
        mode: "math",
        body: [s, c, h]
      };
      return r.callFunction("\\\\cdparent", [d], []);
    }
    case "\\\\cdlongequal":
      return r.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var p = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return r.callFunction("\\Big", [p], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function fE(e) {
  var n = [];
  for (e.gullet.beginGroup(), e.gullet.macros.set("\\cr", "\\\\\\relax"), e.gullet.beginGroup(); ; ) {
    n.push(e.parseExpression(!1, "\\\\")), e.gullet.endGroup(), e.gullet.beginGroup();
    var r = e.fetch().text;
    if (r === "&" || r === "\\\\")
      e.consume();
    else if (r === "\\end") {
      n[n.length - 1].length === 0 && n.pop();
      break;
    } else
      throw new we("Expected \\\\ or \\cr or \\end", e.nextToken);
  }
  for (var l = [], s = [l], u = 0; u < n.length; u++) {
    for (var c = n[u], h = a3(), d = 0; d < c.length; d++)
      if (!r3(c[d]))
        h.body.push(c[d]);
      else {
        l.push(h), d += 1;
        var p = jh(c[d]).text, g = new Array(2);
        if (g[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, g[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(p) > -1)) if ("<>AV".indexOf(p) > -1)
          for (var y = 0; y < 2; y++) {
            for (var x = !0, w = d + 1; w < c.length; w++) {
              if (uE(c[w], p)) {
                x = !1, d = w;
                break;
              }
              if (r3(c[w]))
                throw new we("Missing a " + p + " character to complete a CD arrow.", c[w]);
              g[y].body.push(c[w]);
            }
            if (x)
              throw new we("Missing a " + p + " character to complete a CD arrow.", c[d]);
          }
        else
          throw new we('Expected one of "<>AV=|." after @', c[d]);
        var z = cE(p, g, e), M = {
          type: "styling",
          body: [z],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        l.push(M), h = a3();
      }
    u % 2 === 0 ? l.push(h) : l.shift(), l = [], s.push(l);
  }
  e.gullet.endGroup(), e.gullet.endGroup();
  var A = new Array(s[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25
    // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body: s,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: A,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(s.length + 1).fill([])
  };
}
Ce({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e;
    return {
      type: "cdlabel",
      mode: r.mode,
      side: l.slice(4),
      label: n[0]
    };
  },
  htmlBuilder(e, n) {
    var r = n.havingStyle(n.style.sup()), l = P.wrapFragment(et(e.label, r, n), n);
    return l.classes.push("cd-label-" + e.side), l.style.bottom = Me(0.8 - l.depth), l.height = 0, l.depth = 0, l;
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mrow", [dt(e.label, n)]);
    return r = new Se.MathNode("mpadded", [r]), r.setAttribute("width", "0"), e.side === "left" && r.setAttribute("lspace", "-1width"), r.setAttribute("voffset", "0.7em"), r = new Se.MathNode("mstyle", [r]), r.setAttribute("displaystyle", "false"), r.setAttribute("scriptlevel", "1"), r;
  }
});
Ce({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "cdlabelparent",
      mode: r.mode,
      fragment: n[0]
    };
  },
  htmlBuilder(e, n) {
    var r = P.wrapFragment(et(e.fragment, n), n);
    return r.classes.push("cd-vert-arrow"), r;
  },
  mathmlBuilder(e, n) {
    return new Se.MathNode("mrow", [dt(e.fragment, n)]);
  }
});
Ce({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(e, n) {
    for (var {
      parser: r
    } = e, l = Ze(n[0], "ordgroup"), s = l.body, u = "", c = 0; c < s.length; c++) {
      var h = Ze(s[c], "textord");
      u += h.text;
    }
    var d = parseInt(u), p;
    if (isNaN(d))
      throw new we("\\@char has non-numeric argument " + u);
    if (d < 0 || d >= 1114111)
      throw new we("\\@char with invalid code point " + u);
    return d <= 65535 ? p = String.fromCharCode(d) : (d -= 65536, p = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), {
      type: "textord",
      mode: r.mode,
      text: p
    };
  }
});
var Op = (e, n) => {
  var r = $t(e.body, n.withColor(e.color), !1);
  return P.makeFragment(r);
}, Hp = (e, n) => {
  var r = zn(e.body, n.withColor(e.color)), l = new Se.MathNode("mstyle", r);
  return l.setAttribute("mathcolor", e.color), l;
};
Ce({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(e, n) {
    var {
      parser: r
    } = e, l = Ze(n[0], "color-token").color, s = n[1];
    return {
      type: "color",
      mode: r.mode,
      color: l,
      body: Rt(s)
    };
  },
  htmlBuilder: Op,
  mathmlBuilder: Hp
});
Ce({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(e, n) {
    var {
      parser: r,
      breakOnTokenText: l
    } = e, s = Ze(n[0], "color-token").color;
    r.gullet.macros.set("\\current@color", s);
    var u = r.parseExpression(!0, l);
    return {
      type: "color",
      mode: r.mode,
      color: s,
      body: u
    };
  },
  htmlBuilder: Op,
  mathmlBuilder: Hp
});
Ce({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(e, n, r) {
    var {
      parser: l
    } = e, s = l.gullet.future().text === "[" ? l.parseSizeGroup(!0) : null, u = !l.settings.displayMode || !l.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: l.mode,
      newLine: u,
      size: s && Ze(s, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(e, n) {
    var r = P.makeSpan(["mspace"], [], n);
    return e.newLine && (r.classes.push("newline"), e.size && (r.style.marginTop = Me(Tt(e.size, n)))), r;
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mspace");
    return e.newLine && (r.setAttribute("linebreak", "newline"), e.size && r.setAttribute("height", Me(Tt(e.size, n)))), r;
  }
});
var ah = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, Lp = (e) => {
  var n = e.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(n))
    throw new we("Expected a control sequence", e);
  return n;
}, hE = (e) => {
  var n = e.gullet.popToken();
  return n.text === "=" && (n = e.gullet.popToken(), n.text === " " && (n = e.gullet.popToken())), n;
}, qp = (e, n, r, l) => {
  var s = e.gullet.macros.get(r.text);
  s == null && (r.noexpand = !0, s = {
    tokens: [r],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !e.gullet.isExpandable(r.text)
  }), e.gullet.macros.set(n, s, l);
};
Ce({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e;
    n.consumeSpaces();
    var l = n.fetch();
    if (ah[l.text])
      return (r === "\\global" || r === "\\\\globallong") && (l.text = ah[l.text]), Ze(n.parseFunction(), "internal");
    throw new we("Invalid token after macro prefix", l);
  }
});
Ce({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e, l = n.gullet.popToken(), s = l.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(s))
      throw new we("Expected a control sequence", l);
    for (var u = 0, c, h = [[]]; n.gullet.future().text !== "{"; )
      if (l = n.gullet.popToken(), l.text === "#") {
        if (n.gullet.future().text === "{") {
          c = n.gullet.future(), h[u].push("{");
          break;
        }
        if (l = n.gullet.popToken(), !/^[1-9]$/.test(l.text))
          throw new we('Invalid argument number "' + l.text + '"');
        if (parseInt(l.text) !== u + 1)
          throw new we('Argument number "' + l.text + '" out of order');
        u++, h.push([]);
      } else {
        if (l.text === "EOF")
          throw new we("Expected a macro definition");
        h[u].push(l.text);
      }
    var {
      tokens: d
    } = n.gullet.consumeArg();
    return c && d.unshift(c), (r === "\\edef" || r === "\\xdef") && (d = n.gullet.expandTokens(d), d.reverse()), n.gullet.macros.set(s, {
      tokens: d,
      numArgs: u,
      delimiters: h
    }, r === ah[r]), {
      type: "internal",
      mode: n.mode
    };
  }
});
Ce({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e, l = Lp(n.gullet.popToken());
    n.gullet.consumeSpaces();
    var s = hE(n);
    return qp(n, l, s, r === "\\\\globallet"), {
      type: "internal",
      mode: n.mode
    };
  }
});
Ce({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e, l = Lp(n.gullet.popToken()), s = n.gullet.popToken(), u = n.gullet.popToken();
    return qp(n, l, u, r === "\\\\globalfuture"), n.gullet.pushToken(u), n.gullet.pushToken(s), {
      type: "internal",
      mode: n.mode
    };
  }
});
var Hi = function(n, r, l) {
  var s = mt.math[n] && mt.math[n].replace, u = Oh(s || n, r, l);
  if (!u)
    throw new Error("Unsupported symbol " + n + " and font size " + r + ".");
  return u;
}, Yh = function(n, r, l, s) {
  var u = l.havingBaseStyle(r), c = P.makeSpan(s.concat(u.sizingClasses(l)), [n], l), h = u.sizeMultiplier / l.sizeMultiplier;
  return c.height *= h, c.depth *= h, c.maxFontSize = u.sizeMultiplier, c;
}, Up = function(n, r, l) {
  var s = r.havingBaseStyle(l), u = (1 - r.sizeMultiplier / s.sizeMultiplier) * r.fontMetrics().axisHeight;
  n.classes.push("delimcenter"), n.style.top = Me(u), n.height -= u, n.depth += u;
}, dE = function(n, r, l, s, u, c) {
  var h = P.makeSymbol(n, "Main-Regular", u, s), d = Yh(h, r, s, c);
  return l && Up(d, s, r), d;
}, mE = function(n, r, l, s) {
  return P.makeSymbol(n, "Size" + r + "-Regular", l, s);
}, jp = function(n, r, l, s, u, c) {
  var h = mE(n, r, u, s), d = Yh(P.makeSpan(["delimsizing", "size" + r], [h], s), qe.TEXT, s, c);
  return l && Up(d, s, qe.TEXT), d;
}, M1 = function(n, r, l) {
  var s;
  r === "Size1-Regular" ? s = "delim-size1" : s = "delim-size4";
  var u = P.makeSpan(["delimsizinginner", s], [P.makeSpan([], [P.makeSymbol(n, r, l)])]);
  return {
    type: "elem",
    elem: u
  };
}, T1 = function(n, r, l) {
  var s = xa["Size4-Regular"][n.charCodeAt(0)] ? xa["Size4-Regular"][n.charCodeAt(0)][4] : xa["Size1-Regular"][n.charCodeAt(0)][4], u = new K0("inner", xw(n, Math.round(1e3 * r))), c = new r0([u], {
    width: Me(s),
    height: Me(r),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Me(s),
    viewBox: "0 0 " + 1e3 * s + " " + Math.round(1e3 * r),
    preserveAspectRatio: "xMinYMin"
  }), h = P.makeSvgSpan([], [c], l);
  return h.height = r, h.style.height = Me(r), h.style.width = Me(s), {
    type: "elem",
    elem: h
  };
}, rh = 8e-3, Fo = {
  type: "kern",
  size: -1 * rh
}, pE = ["|", "\\lvert", "\\rvert", "\\vert"], gE = ["\\|", "\\lVert", "\\rVert", "\\Vert"], Vp = function(n, r, l, s, u, c) {
  var h, d, p, g, y = "", x = 0;
  h = p = g = n, d = null;
  var w = "Size1-Regular";
  n === "\\uparrow" ? p = g = "⏐" : n === "\\Uparrow" ? p = g = "‖" : n === "\\downarrow" ? h = p = "⏐" : n === "\\Downarrow" ? h = p = "‖" : n === "\\updownarrow" ? (h = "\\uparrow", p = "⏐", g = "\\downarrow") : n === "\\Updownarrow" ? (h = "\\Uparrow", p = "‖", g = "\\Downarrow") : pE.includes(n) ? (p = "∣", y = "vert", x = 333) : gE.includes(n) ? (p = "∥", y = "doublevert", x = 556) : n === "[" || n === "\\lbrack" ? (h = "⎡", p = "⎢", g = "⎣", w = "Size4-Regular", y = "lbrack", x = 667) : n === "]" || n === "\\rbrack" ? (h = "⎤", p = "⎥", g = "⎦", w = "Size4-Regular", y = "rbrack", x = 667) : n === "\\lfloor" || n === "⌊" ? (p = h = "⎢", g = "⎣", w = "Size4-Regular", y = "lfloor", x = 667) : n === "\\lceil" || n === "⌈" ? (h = "⎡", p = g = "⎢", w = "Size4-Regular", y = "lceil", x = 667) : n === "\\rfloor" || n === "⌋" ? (p = h = "⎥", g = "⎦", w = "Size4-Regular", y = "rfloor", x = 667) : n === "\\rceil" || n === "⌉" ? (h = "⎤", p = g = "⎥", w = "Size4-Regular", y = "rceil", x = 667) : n === "(" || n === "\\lparen" ? (h = "⎛", p = "⎜", g = "⎝", w = "Size4-Regular", y = "lparen", x = 875) : n === ")" || n === "\\rparen" ? (h = "⎞", p = "⎟", g = "⎠", w = "Size4-Regular", y = "rparen", x = 875) : n === "\\{" || n === "\\lbrace" ? (h = "⎧", d = "⎨", g = "⎩", p = "⎪", w = "Size4-Regular") : n === "\\}" || n === "\\rbrace" ? (h = "⎫", d = "⎬", g = "⎭", p = "⎪", w = "Size4-Regular") : n === "\\lgroup" || n === "⟮" ? (h = "⎧", g = "⎩", p = "⎪", w = "Size4-Regular") : n === "\\rgroup" || n === "⟯" ? (h = "⎫", g = "⎭", p = "⎪", w = "Size4-Regular") : n === "\\lmoustache" || n === "⎰" ? (h = "⎧", g = "⎭", p = "⎪", w = "Size4-Regular") : (n === "\\rmoustache" || n === "⎱") && (h = "⎫", g = "⎩", p = "⎪", w = "Size4-Regular");
  var z = Hi(h, w, u), M = z.height + z.depth, A = Hi(p, w, u), T = A.height + A.depth, R = Hi(g, w, u), q = R.height + R.depth, H = 0, $ = 1;
  if (d !== null) {
    var V = Hi(d, w, u);
    H = V.height + V.depth, $ = 2;
  }
  var Q = M + q + H, re = Math.max(0, Math.ceil((r - Q) / ($ * T))), te = Q + re * $ * T, ie = s.fontMetrics().axisHeight;
  l && (ie *= s.sizeMultiplier);
  var ue = te / 2 - ie, de = [];
  if (y.length > 0) {
    var ge = te - M - q, _ = Math.round(te * 1e3), J = bw(y, Math.round(ge * 1e3)), D = new K0(y, J), Y = (x / 1e3).toFixed(3) + "em", I = (_ / 1e3).toFixed(3) + "em", F = new r0([D], {
      width: Y,
      height: I,
      viewBox: "0 0 " + x + " " + _
    }), le = P.makeSvgSpan([], [F], s);
    le.height = _ / 1e3, le.style.width = Y, le.style.height = I, de.push({
      type: "elem",
      elem: le
    });
  } else {
    if (de.push(M1(g, w, u)), de.push(Fo), d === null) {
      var k = te - M - q + 2 * rh;
      de.push(T1(p, k, s));
    } else {
      var G = (te - M - q - H) / 2 + 2 * rh;
      de.push(T1(p, G, s)), de.push(Fo), de.push(M1(d, w, u)), de.push(Fo), de.push(T1(p, G, s));
    }
    de.push(Fo), de.push(M1(h, w, u));
  }
  var ae = s.havingBaseStyle(qe.TEXT), se = P.makeVList({
    positionType: "bottom",
    positionData: ue,
    children: de
  }, ae);
  return Yh(P.makeSpan(["delimsizing", "mult"], [se], ae), qe.TEXT, s, c);
}, z1 = 80, A1 = 0.08, C1 = function(n, r, l, s, u) {
  var c = vw(n, s, l), h = new K0(n, c), d = new r0([h], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: Me(r),
    viewBox: "0 0 400000 " + l,
    preserveAspectRatio: "xMinYMin slice"
  });
  return P.makeSvgSpan(["hide-tail"], [d], u);
}, yE = function(n, r) {
  var l = r.havingBaseSizing(), s = $p("\\surd", n * l.sizeMultiplier, Xp, l), u = l.sizeMultiplier, c = Math.max(0, r.minRuleThickness - r.fontMetrics().sqrtRuleThickness), h, d = 0, p = 0, g = 0, y;
  return s.type === "small" ? (g = 1e3 + 1e3 * c + z1, n < 1 ? u = 1 : n < 1.4 && (u = 0.7), d = (1 + c + A1) / u, p = (1 + c) / u, h = C1("sqrtMain", d, g, c, r), h.style.minWidth = "0.853em", y = 0.833 / u) : s.type === "large" ? (g = (1e3 + z1) * Li[s.size], p = (Li[s.size] + c) / u, d = (Li[s.size] + c + A1) / u, h = C1("sqrtSize" + s.size, d, g, c, r), h.style.minWidth = "1.02em", y = 1 / u) : (d = n + c + A1, p = n + c, g = Math.floor(1e3 * n + c) + z1, h = C1("sqrtTall", d, g, c, r), h.style.minWidth = "0.742em", y = 1.056), h.height = p, h.style.height = Me(d), {
    span: h,
    advanceWidth: y,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (r.fontMetrics().sqrtRuleThickness + c) * u
  };
}, Yp = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], vE = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], Gp = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], Li = [0, 1.2, 1.8, 2.4, 3], xE = function(n, r, l, s, u) {
  if (n === "<" || n === "\\lt" || n === "⟨" ? n = "\\langle" : (n === ">" || n === "\\gt" || n === "⟩") && (n = "\\rangle"), Yp.includes(n) || Gp.includes(n))
    return jp(n, r, !1, l, s, u);
  if (vE.includes(n))
    return Vp(n, Li[r], !1, l, s, u);
  throw new we("Illegal delimiter: '" + n + "'");
}, bE = [{
  type: "small",
  style: qe.SCRIPTSCRIPT
}, {
  type: "small",
  style: qe.SCRIPT
}, {
  type: "small",
  style: qe.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], SE = [{
  type: "small",
  style: qe.SCRIPTSCRIPT
}, {
  type: "small",
  style: qe.SCRIPT
}, {
  type: "small",
  style: qe.TEXT
}, {
  type: "stack"
}], Xp = [{
  type: "small",
  style: qe.SCRIPTSCRIPT
}, {
  type: "small",
  style: qe.SCRIPT
}, {
  type: "small",
  style: qe.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], wE = function(n) {
  if (n.type === "small")
    return "Main-Regular";
  if (n.type === "large")
    return "Size" + n.size + "-Regular";
  if (n.type === "stack")
    return "Size4-Regular";
  throw new Error("Add support for delim type '" + n.type + "' here.");
}, $p = function(n, r, l, s) {
  for (var u = Math.min(2, 3 - s.style.size), c = u; c < l.length && l[c].type !== "stack"; c++) {
    var h = Hi(n, wE(l[c]), "math"), d = h.height + h.depth;
    if (l[c].type === "small") {
      var p = s.havingBaseStyle(l[c].style);
      d *= p.sizeMultiplier;
    }
    if (d > r)
      return l[c];
  }
  return l[l.length - 1];
}, Zp = function(n, r, l, s, u, c) {
  n === "<" || n === "\\lt" || n === "⟨" ? n = "\\langle" : (n === ">" || n === "\\gt" || n === "⟩") && (n = "\\rangle");
  var h;
  Gp.includes(n) ? h = bE : Yp.includes(n) ? h = Xp : h = SE;
  var d = $p(n, r, h, s);
  return d.type === "small" ? dE(n, d.style, l, s, u, c) : d.type === "large" ? jp(n, d.size, l, s, u, c) : Vp(n, r, l, s, u, c);
}, EE = function(n, r, l, s, u, c) {
  var h = s.fontMetrics().axisHeight * s.sizeMultiplier, d = 901, p = 5 / s.fontMetrics().ptPerEm, g = Math.max(r - h, l + h), y = Math.max(
    // In real TeX, calculations are done using integral values which are
    // 65536 per pt, or 655360 per em. So, the division here truncates in
    // TeX but doesn't here, producing different results. If we wanted to
    // exactly match TeX's calculation, we could do
    //   Math.floor(655360 * maxDistFromAxis / 500) *
    //    delimiterFactor / 655360
    // (To see the difference, compare
    //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
    // in TeX and KaTeX)
    g / 500 * d,
    2 * g - p
  );
  return Zp(n, y, !0, s, u, c);
}, t0 = {
  sqrtImage: yE,
  sizedDelim: xE,
  sizeToMaxHeight: Li,
  customSizedDelim: Zp,
  leftRightDelim: EE
}, l3 = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
}, ME = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."];
function Bu(e, n) {
  var r = _u(e);
  if (r && ME.includes(r.text))
    return r;
  throw r ? new we("Invalid delimiter '" + r.text + "' after '" + n.funcName + "'", e) : new we("Invalid delimiter type '" + e.type + "'", e);
}
Ce({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (e, n) => {
    var r = Bu(n[0], e);
    return {
      type: "delimsizing",
      mode: e.parser.mode,
      size: l3[e.funcName].size,
      mclass: l3[e.funcName].mclass,
      delim: r.text
    };
  },
  htmlBuilder: (e, n) => e.delim === "." ? P.makeSpan([e.mclass]) : t0.sizedDelim(e.delim, e.size, n, e.mode, [e.mclass]),
  mathmlBuilder: (e) => {
    var n = [];
    e.delim !== "." && n.push(na(e.delim, e.mode));
    var r = new Se.MathNode("mo", n);
    e.mclass === "mopen" || e.mclass === "mclose" ? r.setAttribute("fence", "true") : r.setAttribute("fence", "false"), r.setAttribute("stretchy", "true");
    var l = Me(t0.sizeToMaxHeight[e.size]);
    return r.setAttribute("minsize", l), r.setAttribute("maxsize", l), r;
  }
});
function i3(e) {
  if (!e.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
Ce({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (e, n) => {
    var r = e.parser.gullet.macros.get("\\current@color");
    if (r && typeof r != "string")
      throw new we("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: e.parser.mode,
      delim: Bu(n[0], e).text,
      color: r
      // undefined if not set via \color
    };
  }
});
Ce({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (e, n) => {
    var r = Bu(n[0], e), l = e.parser;
    ++l.leftrightDepth;
    var s = l.parseExpression(!1);
    --l.leftrightDepth, l.expect("\\right", !1);
    var u = Ze(l.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: l.mode,
      body: s,
      left: r.text,
      right: u.delim,
      rightColor: u.color
    };
  },
  htmlBuilder: (e, n) => {
    i3(e);
    for (var r = $t(e.body, n, !0, ["mopen", "mclose"]), l = 0, s = 0, u = !1, c = 0; c < r.length; c++)
      r[c].isMiddle ? u = !0 : (l = Math.max(r[c].height, l), s = Math.max(r[c].depth, s));
    l *= n.sizeMultiplier, s *= n.sizeMultiplier;
    var h;
    if (e.left === "." ? h = Ii(n, ["mopen"]) : h = t0.leftRightDelim(e.left, l, s, n, e.mode, ["mopen"]), r.unshift(h), u)
      for (var d = 1; d < r.length; d++) {
        var p = r[d], g = p.isMiddle;
        g && (r[d] = t0.leftRightDelim(g.delim, l, s, g.options, e.mode, []));
      }
    var y;
    if (e.right === ".")
      y = Ii(n, ["mclose"]);
    else {
      var x = e.rightColor ? n.withColor(e.rightColor) : n;
      y = t0.leftRightDelim(e.right, l, s, x, e.mode, ["mclose"]);
    }
    return r.push(y), P.makeSpan(["minner"], r, n);
  },
  mathmlBuilder: (e, n) => {
    i3(e);
    var r = zn(e.body, n);
    if (e.left !== ".") {
      var l = new Se.MathNode("mo", [na(e.left, e.mode)]);
      l.setAttribute("fence", "true"), r.unshift(l);
    }
    if (e.right !== ".") {
      var s = new Se.MathNode("mo", [na(e.right, e.mode)]);
      s.setAttribute("fence", "true"), e.rightColor && s.setAttribute("mathcolor", e.rightColor), r.push(s);
    }
    return qh(r);
  }
});
Ce({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (e, n) => {
    var r = Bu(n[0], e);
    if (!e.parser.leftrightDepth)
      throw new we("\\middle without preceding \\left", r);
    return {
      type: "middle",
      mode: e.parser.mode,
      delim: r.text
    };
  },
  htmlBuilder: (e, n) => {
    var r;
    if (e.delim === ".")
      r = Ii(n, []);
    else {
      r = t0.sizedDelim(e.delim, 1, n, e.mode, []);
      var l = {
        delim: e.delim,
        options: n
      };
      r.isMiddle = l;
    }
    return r;
  },
  mathmlBuilder: (e, n) => {
    var r = e.delim === "\\vert" || e.delim === "|" ? na("|", "text") : na(e.delim, e.mode), l = new Se.MathNode("mo", [r]);
    return l.setAttribute("fence", "true"), l.setAttribute("lspace", "0.05em"), l.setAttribute("rspace", "0.05em"), l;
  }
});
var Gh = (e, n) => {
  var r = P.wrapFragment(et(e.body, n), n), l = e.label.slice(1), s = n.sizeMultiplier, u, c = 0, h = at.isCharacterBox(e.body);
  if (l === "sout")
    u = P.makeSpan(["stretchy", "sout"]), u.height = n.fontMetrics().defaultRuleThickness / s, c = -0.5 * n.fontMetrics().xHeight;
  else if (l === "phase") {
    var d = Tt({
      number: 0.6,
      unit: "pt"
    }, n), p = Tt({
      number: 0.35,
      unit: "ex"
    }, n), g = n.havingBaseSizing();
    s = s / g.sizeMultiplier;
    var y = r.height + r.depth + d + p;
    r.style.paddingLeft = Me(y / 2 + d);
    var x = Math.floor(1e3 * y * s), w = gw(x), z = new r0([new K0("phase", w)], {
      width: "400em",
      height: Me(x / 1e3),
      viewBox: "0 0 400000 " + x,
      preserveAspectRatio: "xMinYMin slice"
    });
    u = P.makeSvgSpan(["hide-tail"], [z], n), u.style.height = Me(y), c = r.depth + d + p;
  } else {
    /cancel/.test(l) ? h || r.classes.push("cancel-pad") : l === "angl" ? r.classes.push("anglpad") : r.classes.push("boxpad");
    var M = 0, A = 0, T = 0;
    /box/.test(l) ? (T = Math.max(
      n.fontMetrics().fboxrule,
      // default
      n.minRuleThickness
      // User override.
    ), M = n.fontMetrics().fboxsep + (l === "colorbox" ? 0 : T), A = M) : l === "angl" ? (T = Math.max(n.fontMetrics().defaultRuleThickness, n.minRuleThickness), M = 4 * T, A = Math.max(0, 0.25 - r.depth)) : (M = h ? 0.2 : 0, A = M), u = i0.encloseSpan(r, l, M, A, n), /fbox|boxed|fcolorbox/.test(l) ? (u.style.borderStyle = "solid", u.style.borderWidth = Me(T)) : l === "angl" && T !== 0.049 && (u.style.borderTopWidth = Me(T), u.style.borderRightWidth = Me(T)), c = r.depth + A, e.backgroundColor && (u.style.backgroundColor = e.backgroundColor, e.borderColor && (u.style.borderColor = e.borderColor));
  }
  var R;
  if (e.backgroundColor)
    R = P.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: u,
          shift: c
        },
        {
          type: "elem",
          elem: r,
          shift: 0
        }
      ]
    }, n);
  else {
    var q = /cancel|phase/.test(l) ? ["svg-align"] : [];
    R = P.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: r,
          shift: 0
        },
        {
          type: "elem",
          elem: u,
          shift: c,
          wrapperClasses: q
        }
      ]
    }, n);
  }
  return /cancel/.test(l) && (R.height = r.height, R.depth = r.depth), /cancel/.test(l) && !h ? P.makeSpan(["mord", "cancel-lap"], [R], n) : P.makeSpan(["mord"], [R], n);
}, Xh = (e, n) => {
  var r = 0, l = new Se.MathNode(e.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [dt(e.body, n)]);
  switch (e.label) {
    case "\\cancel":
      l.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      l.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      l.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      l.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      l.setAttribute("notation", "box");
      break;
    case "\\angl":
      l.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      if (r = n.fontMetrics().fboxsep * n.fontMetrics().ptPerEm, l.setAttribute("width", "+" + 2 * r + "pt"), l.setAttribute("height", "+" + 2 * r + "pt"), l.setAttribute("lspace", r + "pt"), l.setAttribute("voffset", r + "pt"), e.label === "\\fcolorbox") {
        var s = Math.max(
          n.fontMetrics().fboxrule,
          // default
          n.minRuleThickness
          // user override
        );
        l.setAttribute("style", "border: " + s + "em solid " + String(e.borderColor));
      }
      break;
    case "\\xcancel":
      l.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return e.backgroundColor && l.setAttribute("mathbackground", e.backgroundColor), l;
};
Ce({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(e, n, r) {
    var {
      parser: l,
      funcName: s
    } = e, u = Ze(n[0], "color-token").color, c = n[1];
    return {
      type: "enclose",
      mode: l.mode,
      label: s,
      backgroundColor: u,
      body: c
    };
  },
  htmlBuilder: Gh,
  mathmlBuilder: Xh
});
Ce({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(e, n, r) {
    var {
      parser: l,
      funcName: s
    } = e, u = Ze(n[0], "color-token").color, c = Ze(n[1], "color-token").color, h = n[2];
    return {
      type: "enclose",
      mode: l.mode,
      label: s,
      backgroundColor: c,
      borderColor: u,
      body: h
    };
  },
  htmlBuilder: Gh,
  mathmlBuilder: Xh
});
Ce({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "enclose",
      mode: r.mode,
      label: "\\fbox",
      body: n[0]
    };
  }
});
Ce({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "enclose",
      mode: r.mode,
      label: l,
      body: s
    };
  },
  htmlBuilder: Gh,
  mathmlBuilder: Xh
});
Ce({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "enclose",
      mode: r.mode,
      label: "\\angl",
      body: n[0]
    };
  }
});
var Fp = {};
function Ta(e) {
  for (var {
    type: n,
    names: r,
    props: l,
    handler: s,
    htmlBuilder: u,
    mathmlBuilder: c
  } = e, h = {
    type: n,
    numArgs: l.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: s
  }, d = 0; d < r.length; ++d)
    Fp[r[d]] = h;
  u && (pu[n] = u), c && (gu[n] = c);
}
var Ip = {};
function N(e, n) {
  Ip[e] = n;
}
function s3(e) {
  var n = [];
  e.consumeSpaces();
  var r = e.fetch().text;
  for (r === "\\relax" && (e.consume(), e.consumeSpaces(), r = e.fetch().text); r === "\\hline" || r === "\\hdashline"; )
    e.consume(), n.push(r === "\\hdashline"), e.consumeSpaces(), r = e.fetch().text;
  return n;
}
var Ou = (e) => {
  var n = e.parser.settings;
  if (!n.displayMode)
    throw new we("{" + e.envName + "} can be used only in display mode.");
};
function $h(e) {
  if (e.indexOf("ed") === -1)
    return e.indexOf("*") === -1;
}
function J0(e, n, r) {
  var {
    hskipBeforeAndAfter: l,
    addJot: s,
    cols: u,
    arraystretch: c,
    colSeparationType: h,
    autoTag: d,
    singleRow: p,
    emptySingleRow: g,
    maxNumCols: y,
    leqno: x
  } = n;
  if (e.gullet.beginGroup(), p || e.gullet.macros.set("\\cr", "\\\\\\relax"), !c) {
    var w = e.gullet.expandMacroAsText("\\arraystretch");
    if (w == null)
      c = 1;
    else if (c = parseFloat(w), !c || c < 0)
      throw new we("Invalid \\arraystretch: " + w);
  }
  e.gullet.beginGroup();
  var z = [], M = [z], A = [], T = [], R = d != null ? [] : void 0;
  function q() {
    d && e.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function H() {
    R && (e.gullet.macros.get("\\df@tag") ? (R.push(e.subparse([new Ln("\\df@tag")])), e.gullet.macros.set("\\df@tag", void 0, !0)) : R.push(!!d && e.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (q(), T.push(s3(e)); ; ) {
    var $ = e.parseExpression(!1, p ? "\\end" : "\\\\");
    e.gullet.endGroup(), e.gullet.beginGroup(), $ = {
      type: "ordgroup",
      mode: e.mode,
      body: $
    }, r && ($ = {
      type: "styling",
      mode: e.mode,
      style: r,
      body: [$]
    }), z.push($);
    var V = e.fetch().text;
    if (V === "&") {
      if (y && z.length === y) {
        if (p || h)
          throw new we("Too many tab characters: &", e.nextToken);
        e.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      e.consume();
    } else if (V === "\\end") {
      H(), z.length === 1 && $.type === "styling" && $.body[0].body.length === 0 && (M.length > 1 || !g) && M.pop(), T.length < M.length + 1 && T.push([]);
      break;
    } else if (V === "\\\\") {
      e.consume();
      var Q = void 0;
      e.gullet.future().text !== " " && (Q = e.parseSizeGroup(!0)), A.push(Q ? Q.value : null), H(), T.push(s3(e)), z = [], M.push(z), q();
    } else
      throw new we("Expected & or \\\\ or \\cr or \\end", e.nextToken);
  }
  return e.gullet.endGroup(), e.gullet.endGroup(), {
    type: "array",
    mode: e.mode,
    addJot: s,
    arraystretch: c,
    body: M,
    cols: u,
    rowGaps: A,
    hskipBeforeAndAfter: l,
    hLinesBeforeRow: T,
    colSeparationType: h,
    tags: R,
    leqno: x
  };
}
function Zh(e) {
  return e.slice(0, 1) === "d" ? "display" : "text";
}
var za = function(n, r) {
  var l, s, u = n.body.length, c = n.hLinesBeforeRow, h = 0, d = new Array(u), p = [], g = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    r.fontMetrics().arrayRuleWidth,
    r.minRuleThickness
    // User override.
  ), y = 1 / r.fontMetrics().ptPerEm, x = 5 * y;
  if (n.colSeparationType && n.colSeparationType === "small") {
    var w = r.havingStyle(qe.SCRIPT).sizeMultiplier;
    x = 0.2778 * (w / r.sizeMultiplier);
  }
  var z = n.colSeparationType === "CD" ? Tt({
    number: 3,
    unit: "ex"
  }, r) : 12 * y, M = 3 * y, A = n.arraystretch * z, T = 0.7 * A, R = 0.3 * A, q = 0;
  function H(Ee) {
    for (var Oe = 0; Oe < Ee.length; ++Oe)
      Oe > 0 && (q += 0.25), p.push({
        pos: q,
        isDashed: Ee[Oe]
      });
  }
  for (H(c[0]), l = 0; l < n.body.length; ++l) {
    var $ = n.body[l], V = T, Q = R;
    h < $.length && (h = $.length);
    var re = new Array($.length);
    for (s = 0; s < $.length; ++s) {
      var te = et($[s], r);
      Q < te.depth && (Q = te.depth), V < te.height && (V = te.height), re[s] = te;
    }
    var ie = n.rowGaps[l], ue = 0;
    ie && (ue = Tt(ie, r), ue > 0 && (ue += R, Q < ue && (Q = ue), ue = 0)), n.addJot && (Q += M), re.height = V, re.depth = Q, q += V, re.pos = q, q += Q + ue, d[l] = re, H(c[l + 1]);
  }
  var de = q / 2 + r.fontMetrics().axisHeight, ge = n.cols || [], _ = [], J, D, Y = [];
  if (n.tags && n.tags.some((Ee) => Ee))
    for (l = 0; l < u; ++l) {
      var I = d[l], F = I.pos - de, le = n.tags[l], k = void 0;
      le === !0 ? k = P.makeSpan(["eqn-num"], [], r) : le === !1 ? k = P.makeSpan([], [], r) : k = P.makeSpan([], $t(le, r, !0), r), k.depth = I.depth, k.height = I.height, Y.push({
        type: "elem",
        elem: k,
        shift: F
      });
    }
  for (
    s = 0, D = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    s < h || D < ge.length;
    ++s, ++D
  ) {
    for (var G = ge[D] || {}, ae = !0; G.type === "separator"; ) {
      if (ae || (J = P.makeSpan(["arraycolsep"], []), J.style.width = Me(r.fontMetrics().doubleRuleSep), _.push(J)), G.separator === "|" || G.separator === ":") {
        var se = G.separator === "|" ? "solid" : "dashed", xe = P.makeSpan(["vertical-separator"], [], r);
        xe.style.height = Me(q), xe.style.borderRightWidth = Me(g), xe.style.borderRightStyle = se, xe.style.margin = "0 " + Me(-g / 2);
        var Te = q - de;
        Te && (xe.style.verticalAlign = Me(-Te)), _.push(xe);
      } else
        throw new we("Invalid separator type: " + G.separator);
      D++, G = ge[D] || {}, ae = !1;
    }
    if (!(s >= h)) {
      var Ae = void 0;
      (s > 0 || n.hskipBeforeAndAfter) && (Ae = at.deflt(G.pregap, x), Ae !== 0 && (J = P.makeSpan(["arraycolsep"], []), J.style.width = Me(Ae), _.push(J)));
      var Re = [];
      for (l = 0; l < u; ++l) {
        var Be = d[l], Xe = Be[s];
        if (Xe) {
          var lt = Be.pos - de;
          Xe.depth = Be.depth, Xe.height = Be.height, Re.push({
            type: "elem",
            elem: Xe,
            shift: lt
          });
        }
      }
      Re = P.makeVList({
        positionType: "individualShift",
        children: Re
      }, r), Re = P.makeSpan(["col-align-" + (G.align || "c")], [Re]), _.push(Re), (s < h - 1 || n.hskipBeforeAndAfter) && (Ae = at.deflt(G.postgap, x), Ae !== 0 && (J = P.makeSpan(["arraycolsep"], []), J.style.width = Me(Ae), _.push(J)));
    }
  }
  if (d = P.makeSpan(["mtable"], _), p.length > 0) {
    for (var St = P.makeLineSpan("hline", r, g), be = P.makeLineSpan("hdashline", r, g), ye = [{
      type: "elem",
      elem: d,
      shift: 0
    }]; p.length > 0; ) {
      var ze = p.pop(), _e = ze.pos - de;
      ze.isDashed ? ye.push({
        type: "elem",
        elem: be,
        shift: _e
      }) : ye.push({
        type: "elem",
        elem: St,
        shift: _e
      });
    }
    d = P.makeVList({
      positionType: "individualShift",
      children: ye
    }, r);
  }
  if (Y.length === 0)
    return P.makeSpan(["mord"], [d], r);
  var je = P.makeVList({
    positionType: "individualShift",
    children: Y
  }, r);
  return je = P.makeSpan(["tag"], [je], r), P.makeFragment([d, je]);
}, TE = {
  c: "center ",
  l: "left ",
  r: "right "
}, Aa = function(n, r) {
  for (var l = [], s = new Se.MathNode("mtd", [], ["mtr-glue"]), u = new Se.MathNode("mtd", [], ["mml-eqn-num"]), c = 0; c < n.body.length; c++) {
    for (var h = n.body[c], d = [], p = 0; p < h.length; p++)
      d.push(new Se.MathNode("mtd", [dt(h[p], r)]));
    n.tags && n.tags[c] && (d.unshift(s), d.push(s), n.leqno ? d.unshift(u) : d.push(u)), l.push(new Se.MathNode("mtr", d));
  }
  var g = new Se.MathNode("mtable", l), y = n.arraystretch === 0.5 ? 0.1 : 0.16 + n.arraystretch - 1 + (n.addJot ? 0.09 : 0);
  g.setAttribute("rowspacing", Me(y));
  var x = "", w = "";
  if (n.cols && n.cols.length > 0) {
    var z = n.cols, M = "", A = !1, T = 0, R = z.length;
    z[0].type === "separator" && (x += "top ", T = 1), z[z.length - 1].type === "separator" && (x += "bottom ", R -= 1);
    for (var q = T; q < R; q++)
      z[q].type === "align" ? (w += TE[z[q].align], A && (M += "none "), A = !0) : z[q].type === "separator" && A && (M += z[q].separator === "|" ? "solid " : "dashed ", A = !1);
    g.setAttribute("columnalign", w.trim()), /[sd]/.test(M) && g.setAttribute("columnlines", M.trim());
  }
  if (n.colSeparationType === "align") {
    for (var H = n.cols || [], $ = "", V = 1; V < H.length; V++)
      $ += V % 2 ? "0em " : "1em ";
    g.setAttribute("columnspacing", $.trim());
  } else n.colSeparationType === "alignat" || n.colSeparationType === "gather" ? g.setAttribute("columnspacing", "0em") : n.colSeparationType === "small" ? g.setAttribute("columnspacing", "0.2778em") : n.colSeparationType === "CD" ? g.setAttribute("columnspacing", "0.5em") : g.setAttribute("columnspacing", "1em");
  var Q = "", re = n.hLinesBeforeRow;
  x += re[0].length > 0 ? "left " : "", x += re[re.length - 1].length > 0 ? "right " : "";
  for (var te = 1; te < re.length - 1; te++)
    Q += re[te].length === 0 ? "none " : re[te][0] ? "dashed " : "solid ";
  return /[sd]/.test(Q) && g.setAttribute("rowlines", Q.trim()), x !== "" && (g = new Se.MathNode("menclose", [g]), g.setAttribute("notation", x.trim())), n.arraystretch && n.arraystretch < 1 && (g = new Se.MathNode("mstyle", [g]), g.setAttribute("scriptlevel", "1")), g;
}, Kp = function(n, r) {
  n.envName.indexOf("ed") === -1 && Ou(n);
  var l = [], s = n.envName.indexOf("at") > -1 ? "alignat" : "align", u = n.envName === "split", c = J0(n.parser, {
    cols: l,
    addJot: !0,
    autoTag: u ? void 0 : $h(n.envName),
    emptySingleRow: !0,
    colSeparationType: s,
    maxNumCols: u ? 2 : void 0,
    leqno: n.parser.settings.leqno
  }, "display"), h, d = 0, p = {
    type: "ordgroup",
    mode: n.mode,
    body: []
  };
  if (r[0] && r[0].type === "ordgroup") {
    for (var g = "", y = 0; y < r[0].body.length; y++) {
      var x = Ze(r[0].body[y], "textord");
      g += x.text;
    }
    h = Number(g), d = h * 2;
  }
  var w = !d;
  c.body.forEach(function(T) {
    for (var R = 1; R < T.length; R += 2) {
      var q = Ze(T[R], "styling"), H = Ze(q.body[0], "ordgroup");
      H.body.unshift(p);
    }
    if (w)
      d < T.length && (d = T.length);
    else {
      var $ = T.length / 2;
      if (h < $)
        throw new we("Too many math in a row: " + ("expected " + h + ", but got " + $), T[0]);
    }
  });
  for (var z = 0; z < d; ++z) {
    var M = "r", A = 0;
    z % 2 === 1 ? M = "l" : z > 0 && w && (A = 1), l[z] = {
      type: "align",
      align: M,
      pregap: A,
      postgap: 0
    };
  }
  return c.colSeparationType = w ? "align" : "alignat", c;
};
Ta({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var r = _u(n[0]), l = r ? [n[0]] : Ze(n[0], "ordgroup").body, s = l.map(function(c) {
      var h = jh(c), d = h.text;
      if ("lcr".indexOf(d) !== -1)
        return {
          type: "align",
          align: d
        };
      if (d === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (d === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new we("Unknown column alignment: " + d, c);
    }), u = {
      cols: s,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: s.length
    };
    return J0(e.parser, u, Zh(e.envName));
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(e) {
    var n = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[e.envName.replace("*", "")], r = "c", l = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: r
      }]
    };
    if (e.envName.charAt(e.envName.length - 1) === "*") {
      var s = e.parser;
      if (s.consumeSpaces(), s.fetch().text === "[") {
        if (s.consume(), s.consumeSpaces(), r = s.fetch().text, "lcr".indexOf(r) === -1)
          throw new we("Expected l or c or r", s.nextToken);
        s.consume(), s.consumeSpaces(), s.expect("]"), s.consume(), l.cols = [{
          type: "align",
          align: r
        }];
      }
    }
    var u = J0(e.parser, l, Zh(e.envName)), c = Math.max(0, ...u.body.map((h) => h.length));
    return u.cols = new Array(c).fill({
      type: "align",
      align: r
    }), n ? {
      type: "leftright",
      mode: e.mode,
      body: [u],
      left: n[0],
      right: n[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : u;
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(e) {
    var n = {
      arraystretch: 0.5
    }, r = J0(e.parser, n, "script");
    return r.colSeparationType = "small", r;
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var r = _u(n[0]), l = r ? [n[0]] : Ze(n[0], "ordgroup").body, s = l.map(function(c) {
      var h = jh(c), d = h.text;
      if ("lc".indexOf(d) !== -1)
        return {
          type: "align",
          align: d
        };
      throw new we("Unknown column alignment: " + d, c);
    });
    if (s.length > 1)
      throw new we("{subarray} can contain only one column");
    var u = {
      cols: s,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (u = J0(e.parser, u, "script"), u.body.length > 0 && u.body[0].length > 1)
      throw new we("{subarray} can contain only one column");
    return u;
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(e) {
    var n = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1
        /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    }, r = J0(e.parser, n, Zh(e.envName));
    return {
      type: "leftright",
      mode: e.mode,
      body: [r],
      left: e.envName.indexOf("r") > -1 ? "." : "\\{",
      right: e.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: Kp,
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(e) {
    ["gather", "gather*"].includes(e.envName) && Ou(e);
    var n = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: $h(e.envName),
      emptySingleRow: !0,
      leqno: e.parser.settings.leqno
    };
    return J0(e.parser, n, "display");
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: Kp,
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(e) {
    Ou(e);
    var n = {
      autoTag: $h(e.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: e.parser.settings.leqno
    };
    return J0(e.parser, n, "display");
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
Ta({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(e) {
    return Ou(e), fE(e.parser);
  },
  htmlBuilder: za,
  mathmlBuilder: Aa
});
N("\\nonumber", "\\gdef\\@eqnsw{0}");
N("\\notag", "\\nonumber");
Ce({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(e, n) {
    throw new we(e.funcName + " valid only within array environment");
  }
});
var o3 = Fp;
Ce({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    if (s.type !== "ordgroup")
      throw new we("Invalid environment name", s);
    for (var u = "", c = 0; c < s.body.length; ++c)
      u += Ze(s.body[c], "textord").text;
    if (l === "\\begin") {
      if (!o3.hasOwnProperty(u))
        throw new we("No such environment: " + u, s);
      var h = o3[u], {
        args: d,
        optArgs: p
      } = r.parseArguments("\\begin{" + u + "}", h), g = {
        mode: r.mode,
        envName: u,
        parser: r
      }, y = h.handler(g, d, p);
      r.expect("\\end", !1);
      var x = r.nextToken, w = Ze(r.parseFunction(), "environment");
      if (w.name !== u)
        throw new we("Mismatch: \\begin{" + u + "} matched by \\end{" + w.name + "}", x);
      return y;
    }
    return {
      type: "environment",
      mode: r.mode,
      name: u,
      nameGroup: s
    };
  }
});
var Qp = (e, n) => {
  var r = e.font, l = n.withFont(r);
  return et(e.body, l);
}, Jp = (e, n) => {
  var r = e.font, l = n.withFont(r);
  return dt(e.body, l);
}, u3 = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
Ce({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    "\\mathsfit",
    // families
    "\\mathbb",
    "\\mathcal",
    "\\mathfrak",
    "\\mathscr",
    "\\mathsf",
    "\\mathtt",
    // aliases, except \bm defined below
    "\\Bbb",
    "\\bold",
    "\\frak"
  ],
  props: {
    numArgs: 1,
    allowedInArgument: !0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = yu(n[0]), u = l;
    return u in u3 && (u = u3[u]), {
      type: "font",
      mode: r.mode,
      font: u.slice(1),
      body: s
    };
  },
  htmlBuilder: Qp,
  mathmlBuilder: Jp
});
Ce({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[0], s = at.isCharacterBox(l);
    return {
      type: "mclass",
      mode: r.mode,
      mclass: Ru(l),
      body: [{
        type: "font",
        mode: r.mode,
        font: "boldsymbol",
        body: l
      }],
      isCharacterBox: s
    };
  }
});
Ce({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l,
      breakOnTokenText: s
    } = e, {
      mode: u
    } = r, c = r.parseExpression(!0, s), h = "math" + l.slice(1);
    return {
      type: "font",
      mode: u,
      font: h,
      body: {
        type: "ordgroup",
        mode: r.mode,
        body: c
      }
    };
  },
  htmlBuilder: Qp,
  mathmlBuilder: Jp
});
var Wp = (e, n) => {
  var r = n;
  return e === "display" ? r = r.id >= qe.SCRIPT.id ? r.text() : qe.DISPLAY : e === "text" && r.size === qe.DISPLAY.size ? r = qe.TEXT : e === "script" ? r = qe.SCRIPT : e === "scriptscript" && (r = qe.SCRIPTSCRIPT), r;
}, Fh = (e, n) => {
  var r = Wp(e.size, n.style), l = r.fracNum(), s = r.fracDen(), u;
  u = n.havingStyle(l);
  var c = et(e.numer, u, n);
  if (e.continued) {
    var h = 8.5 / n.fontMetrics().ptPerEm, d = 3.5 / n.fontMetrics().ptPerEm;
    c.height = c.height < h ? h : c.height, c.depth = c.depth < d ? d : c.depth;
  }
  u = n.havingStyle(s);
  var p = et(e.denom, u, n), g, y, x;
  e.hasBarLine ? (e.barSize ? (y = Tt(e.barSize, n), g = P.makeLineSpan("frac-line", n, y)) : g = P.makeLineSpan("frac-line", n), y = g.height, x = g.height) : (g = null, y = 0, x = n.fontMetrics().defaultRuleThickness);
  var w, z, M;
  r.size === qe.DISPLAY.size || e.size === "display" ? (w = n.fontMetrics().num1, y > 0 ? z = 3 * x : z = 7 * x, M = n.fontMetrics().denom1) : (y > 0 ? (w = n.fontMetrics().num2, z = x) : (w = n.fontMetrics().num3, z = 3 * x), M = n.fontMetrics().denom2);
  var A;
  if (g) {
    var R = n.fontMetrics().axisHeight;
    w - c.depth - (R + 0.5 * y) < z && (w += z - (w - c.depth - (R + 0.5 * y))), R - 0.5 * y - (p.height - M) < z && (M += z - (R - 0.5 * y - (p.height - M)));
    var q = -(R - 0.5 * y);
    A = P.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: p,
        shift: M
      }, {
        type: "elem",
        elem: g,
        shift: q
      }, {
        type: "elem",
        elem: c,
        shift: -w
      }]
    }, n);
  } else {
    var T = w - c.depth - (p.height - M);
    T < z && (w += 0.5 * (z - T), M += 0.5 * (z - T)), A = P.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: p,
        shift: M
      }, {
        type: "elem",
        elem: c,
        shift: -w
      }]
    }, n);
  }
  u = n.havingStyle(r), A.height *= u.sizeMultiplier / n.sizeMultiplier, A.depth *= u.sizeMultiplier / n.sizeMultiplier;
  var H;
  r.size === qe.DISPLAY.size ? H = n.fontMetrics().delim1 : r.size === qe.SCRIPTSCRIPT.size ? H = n.havingStyle(qe.SCRIPT).fontMetrics().delim2 : H = n.fontMetrics().delim2;
  var $, V;
  return e.leftDelim == null ? $ = Ii(n, ["mopen"]) : $ = t0.customSizedDelim(e.leftDelim, H, !0, n.havingStyle(r), e.mode, ["mopen"]), e.continued ? V = P.makeSpan([]) : e.rightDelim == null ? V = Ii(n, ["mclose"]) : V = t0.customSizedDelim(e.rightDelim, H, !0, n.havingStyle(r), e.mode, ["mclose"]), P.makeSpan(["mord"].concat(u.sizingClasses(n)), [$, P.makeSpan(["mfrac"], [A]), V], n);
}, Ih = (e, n) => {
  var r = new Se.MathNode("mfrac", [dt(e.numer, n), dt(e.denom, n)]);
  if (!e.hasBarLine)
    r.setAttribute("linethickness", "0px");
  else if (e.barSize) {
    var l = Tt(e.barSize, n);
    r.setAttribute("linethickness", Me(l));
  }
  var s = Wp(e.size, n.style);
  if (s.size !== n.style.size) {
    r = new Se.MathNode("mstyle", [r]);
    var u = s.size === qe.DISPLAY.size ? "true" : "false";
    r.setAttribute("displaystyle", u), r.setAttribute("scriptlevel", "0");
  }
  if (e.leftDelim != null || e.rightDelim != null) {
    var c = [];
    if (e.leftDelim != null) {
      var h = new Se.MathNode("mo", [new Se.TextNode(e.leftDelim.replace("\\", ""))]);
      h.setAttribute("fence", "true"), c.push(h);
    }
    if (c.push(r), e.rightDelim != null) {
      var d = new Se.MathNode("mo", [new Se.TextNode(e.rightDelim.replace("\\", ""))]);
      d.setAttribute("fence", "true"), c.push(d);
    }
    return qh(c);
  }
  return r;
};
Ce({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0], u = n[1], c, h = null, d = null, p = "auto";
    switch (l) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        c = !0;
        break;
      case "\\\\atopfrac":
        c = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        c = !1, h = "(", d = ")";
        break;
      case "\\\\bracefrac":
        c = !1, h = "\\{", d = "\\}";
        break;
      case "\\\\brackfrac":
        c = !1, h = "[", d = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (l) {
      case "\\dfrac":
      case "\\dbinom":
        p = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        p = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: r.mode,
      continued: !1,
      numer: s,
      denom: u,
      hasBarLine: c,
      leftDelim: h,
      rightDelim: d,
      size: p,
      barSize: null
    };
  },
  htmlBuilder: Fh,
  mathmlBuilder: Ih
});
Ce({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0], u = n[1];
    return {
      type: "genfrac",
      mode: r.mode,
      continued: !0,
      numer: s,
      denom: u,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
Ce({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r,
      token: l
    } = e, s;
    switch (r) {
      case "\\over":
        s = "\\frac";
        break;
      case "\\choose":
        s = "\\binom";
        break;
      case "\\atop":
        s = "\\\\atopfrac";
        break;
      case "\\brace":
        s = "\\\\bracefrac";
        break;
      case "\\brack":
        s = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: n.mode,
      replaceWith: s,
      token: l
    };
  }
});
var c3 = ["display", "text", "script", "scriptscript"], f3 = function(n) {
  var r = null;
  return n.length > 0 && (r = n, r = r === "." ? null : r), r;
};
Ce({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(e, n) {
    var {
      parser: r
    } = e, l = n[4], s = n[5], u = yu(n[0]), c = u.type === "atom" && u.family === "open" ? f3(u.text) : null, h = yu(n[1]), d = h.type === "atom" && h.family === "close" ? f3(h.text) : null, p = Ze(n[2], "size"), g, y = null;
    p.isBlank ? g = !0 : (y = p.value, g = y.number > 0);
    var x = "auto", w = n[3];
    if (w.type === "ordgroup") {
      if (w.body.length > 0) {
        var z = Ze(w.body[0], "textord");
        x = c3[Number(z.text)];
      }
    } else
      w = Ze(w, "textord"), x = c3[Number(w.text)];
    return {
      type: "genfrac",
      mode: r.mode,
      numer: l,
      denom: s,
      continued: !1,
      hasBarLine: g,
      barSize: y,
      leftDelim: c,
      rightDelim: d,
      size: x
    };
  },
  htmlBuilder: Fh,
  mathmlBuilder: Ih
});
Ce({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l,
      token: s
    } = e;
    return {
      type: "infix",
      mode: r.mode,
      replaceWith: "\\\\abovefrac",
      size: Ze(n[0], "size").value,
      token: s
    };
  }
});
Ce({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0], u = tw(Ze(n[1], "infix").size), c = n[2], h = u.number > 0;
    return {
      type: "genfrac",
      mode: r.mode,
      numer: s,
      denom: c,
      continued: !1,
      hasBarLine: h,
      barSize: u,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: Fh,
  mathmlBuilder: Ih
});
var Pp = (e, n) => {
  var r = n.style, l, s;
  e.type === "supsub" ? (l = e.sup ? et(e.sup, n.havingStyle(r.sup()), n) : et(e.sub, n.havingStyle(r.sub()), n), s = Ze(e.base, "horizBrace")) : s = Ze(e, "horizBrace");
  var u = et(s.base, n.havingBaseStyle(qe.DISPLAY)), c = i0.svgSpan(s, n), h;
  if (s.isOver ? (h = P.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: u
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: c
    }]
  }, n), h.children[0].children[0].children[1].classes.push("svg-align")) : (h = P.makeVList({
    positionType: "bottom",
    positionData: u.depth + 0.1 + c.height,
    children: [{
      type: "elem",
      elem: c
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: u
    }]
  }, n), h.children[0].children[0].children[0].classes.push("svg-align")), l) {
    var d = P.makeSpan(["mord", s.isOver ? "mover" : "munder"], [h], n);
    s.isOver ? h = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: d
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: l
      }]
    }, n) : h = P.makeVList({
      positionType: "bottom",
      positionData: d.depth + 0.2 + l.height + l.depth,
      children: [{
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: d
      }]
    }, n);
  }
  return P.makeSpan(["mord", s.isOver ? "mover" : "munder"], [h], n);
}, zE = (e, n) => {
  var r = i0.mathMLnode(e.label);
  return new Se.MathNode(e.isOver ? "mover" : "munder", [dt(e.base, n), r]);
};
Ce({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e;
    return {
      type: "horizBrace",
      mode: r.mode,
      label: l,
      isOver: /^\\over/.test(l),
      base: n[0]
    };
  },
  htmlBuilder: Pp,
  mathmlBuilder: zE
});
Ce({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[1], s = Ze(n[0], "url").url;
    return r.settings.isTrusted({
      command: "\\href",
      url: s
    }) ? {
      type: "href",
      mode: r.mode,
      href: s,
      body: Rt(l)
    } : r.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (e, n) => {
    var r = $t(e.body, n, !1);
    return P.makeAnchor(e.href, [], r, n);
  },
  mathmlBuilder: (e, n) => {
    var r = Q0(e.body, n);
    return r instanceof Hn || (r = new Hn("mrow", [r])), r.setAttribute("href", e.href), r;
  }
});
Ce({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = Ze(n[0], "url").url;
    if (!r.settings.isTrusted({
      command: "\\url",
      url: l
    }))
      return r.formatUnsupportedCmd("\\url");
    for (var s = [], u = 0; u < l.length; u++) {
      var c = l[u];
      c === "~" && (c = "\\textasciitilde"), s.push({
        type: "textord",
        mode: "text",
        text: c
      });
    }
    var h = {
      type: "text",
      mode: r.mode,
      font: "\\texttt",
      body: s
    };
    return {
      type: "href",
      mode: r.mode,
      href: l,
      body: Rt(h)
    };
  }
});
Ce({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "hbox",
      mode: r.mode,
      body: Rt(n[0])
    };
  },
  htmlBuilder(e, n) {
    var r = $t(e.body, n, !1);
    return P.makeFragment(r);
  },
  mathmlBuilder(e, n) {
    return new Se.MathNode("mrow", zn(e.body, n));
  }
});
Ce({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l,
      token: s
    } = e, u = Ze(n[0], "raw").string, c = n[1];
    r.settings.strict && r.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var h, d = {};
    switch (l) {
      case "\\htmlClass":
        d.class = u, h = {
          command: "\\htmlClass",
          class: u
        };
        break;
      case "\\htmlId":
        d.id = u, h = {
          command: "\\htmlId",
          id: u
        };
        break;
      case "\\htmlStyle":
        d.style = u, h = {
          command: "\\htmlStyle",
          style: u
        };
        break;
      case "\\htmlData": {
        for (var p = u.split(","), g = 0; g < p.length; g++) {
          var y = p[g], x = y.indexOf("=");
          if (x < 0)
            throw new we("\\htmlData key/value '" + y + "' missing equals sign");
          var w = y.slice(0, x), z = y.slice(x + 1);
          d["data-" + w.trim()] = z;
        }
        h = {
          command: "\\htmlData",
          attributes: d
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return r.settings.isTrusted(h) ? {
      type: "html",
      mode: r.mode,
      attributes: d,
      body: Rt(c)
    } : r.formatUnsupportedCmd(l);
  },
  htmlBuilder: (e, n) => {
    var r = $t(e.body, n, !1), l = ["enclosing"];
    e.attributes.class && l.push(...e.attributes.class.trim().split(/\s+/));
    var s = P.makeSpan(l, r, n);
    for (var u in e.attributes)
      u !== "class" && e.attributes.hasOwnProperty(u) && s.setAttribute(u, e.attributes[u]);
    return s;
  },
  mathmlBuilder: (e, n) => Q0(e.body, n)
});
Ce({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e;
    return {
      type: "htmlmathml",
      mode: r.mode,
      html: Rt(n[0]),
      mathml: Rt(n[1])
    };
  },
  htmlBuilder: (e, n) => {
    var r = $t(e.html, n, !1);
    return P.makeFragment(r);
  },
  mathmlBuilder: (e, n) => Q0(e.mathml, n)
});
var N1 = function(n) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))
    return {
      number: +n,
      unit: "bp"
    };
  var r = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);
  if (!r)
    throw new we("Invalid size: '" + n + "' in \\includegraphics");
  var l = {
    number: +(r[1] + r[2]),
    // sign + magnitude, cast to number
    unit: r[3]
  };
  if (!vp(l))
    throw new we("Invalid unit: '" + l.unit + "' in \\includegraphics.");
  return l;
};
Ce({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (e, n, r) => {
    var {
      parser: l
    } = e, s = {
      number: 0,
      unit: "em"
    }, u = {
      number: 0.9,
      unit: "em"
    }, c = {
      number: 0,
      unit: "em"
    }, h = "";
    if (r[0])
      for (var d = Ze(r[0], "raw").string, p = d.split(","), g = 0; g < p.length; g++) {
        var y = p[g].split("=");
        if (y.length === 2) {
          var x = y[1].trim();
          switch (y[0].trim()) {
            case "alt":
              h = x;
              break;
            case "width":
              s = N1(x);
              break;
            case "height":
              u = N1(x);
              break;
            case "totalheight":
              c = N1(x);
              break;
            default:
              throw new we("Invalid key: '" + y[0] + "' in \\includegraphics.");
          }
        }
      }
    var w = Ze(n[0], "url").url;
    return h === "" && (h = w, h = h.replace(/^.*[\\/]/, ""), h = h.substring(0, h.lastIndexOf("."))), l.settings.isTrusted({
      command: "\\includegraphics",
      url: w
    }) ? {
      type: "includegraphics",
      mode: l.mode,
      alt: h,
      width: s,
      height: u,
      totalheight: c,
      src: w
    } : l.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (e, n) => {
    var r = Tt(e.height, n), l = 0;
    e.totalheight.number > 0 && (l = Tt(e.totalheight, n) - r);
    var s = 0;
    e.width.number > 0 && (s = Tt(e.width, n));
    var u = {
      height: Me(r + l)
    };
    s > 0 && (u.width = Me(s)), l > 0 && (u.verticalAlign = Me(-l));
    var c = new zw(e.src, e.alt, u);
    return c.height = r, c.depth = l, c;
  },
  mathmlBuilder: (e, n) => {
    var r = new Se.MathNode("mglyph", []);
    r.setAttribute("alt", e.alt);
    var l = Tt(e.height, n), s = 0;
    if (e.totalheight.number > 0 && (s = Tt(e.totalheight, n) - l, r.setAttribute("valign", Me(-s))), r.setAttribute("height", Me(l + s)), e.width.number > 0) {
      var u = Tt(e.width, n);
      r.setAttribute("width", Me(u));
    }
    return r.setAttribute("src", e.src), r;
  }
});
Ce({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = Ze(n[0], "size");
    if (r.settings.strict) {
      var u = l[1] === "m", c = s.value.unit === "mu";
      u ? (c || r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + l + " supports only mu units, " + ("not " + s.value.unit + " units")), r.mode !== "math" && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + l + " works only in math mode")) : c && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + l + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: r.mode,
      dimension: s.value
    };
  },
  htmlBuilder(e, n) {
    return P.makeGlue(e.dimension, n);
  },
  mathmlBuilder(e, n) {
    var r = Tt(e.dimension, n);
    return new Se.SpaceNode(r);
  }
});
Ce({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "lap",
      mode: r.mode,
      alignment: l.slice(5),
      body: s
    };
  },
  htmlBuilder: (e, n) => {
    var r;
    e.alignment === "clap" ? (r = P.makeSpan([], [et(e.body, n)]), r = P.makeSpan(["inner"], [r], n)) : r = P.makeSpan(["inner"], [et(e.body, n)]);
    var l = P.makeSpan(["fix"], []), s = P.makeSpan([e.alignment], [r, l], n), u = P.makeSpan(["strut"]);
    return u.style.height = Me(s.height + s.depth), s.depth && (u.style.verticalAlign = Me(-s.depth)), s.children.unshift(u), s = P.makeSpan(["thinbox"], [s], n), P.makeSpan(["mord", "vbox"], [s], n);
  },
  mathmlBuilder: (e, n) => {
    var r = new Se.MathNode("mpadded", [dt(e.body, n)]);
    if (e.alignment !== "rlap") {
      var l = e.alignment === "llap" ? "-1" : "-0.5";
      r.setAttribute("lspace", l + "width");
    }
    return r.setAttribute("width", "0px"), r;
  }
});
Ce({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(e, n) {
    var {
      funcName: r,
      parser: l
    } = e, s = l.mode;
    l.switchMode("math");
    var u = r === "\\(" ? "\\)" : "$", c = l.parseExpression(!1, u);
    return l.expect(u), l.switchMode(s), {
      type: "styling",
      mode: l.mode,
      style: "text",
      body: c
    };
  }
});
Ce({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(e, n) {
    throw new we("Mismatched " + e.funcName);
  }
});
var h3 = (e, n) => {
  switch (n.style.size) {
    case qe.DISPLAY.size:
      return e.display;
    case qe.TEXT.size:
      return e.text;
    case qe.SCRIPT.size:
      return e.script;
    case qe.SCRIPTSCRIPT.size:
      return e.scriptscript;
    default:
      return e.text;
  }
};
Ce({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e;
    return {
      type: "mathchoice",
      mode: r.mode,
      display: Rt(n[0]),
      text: Rt(n[1]),
      script: Rt(n[2]),
      scriptscript: Rt(n[3])
    };
  },
  htmlBuilder: (e, n) => {
    var r = h3(e, n), l = $t(r, n, !1);
    return P.makeFragment(l);
  },
  mathmlBuilder: (e, n) => {
    var r = h3(e, n);
    return Q0(r, n);
  }
});
var e7 = (e, n, r, l, s, u, c) => {
  e = P.makeSpan([], [e]);
  var h = r && at.isCharacterBox(r), d, p;
  if (n) {
    var g = et(n, l.havingStyle(s.sup()), l);
    p = {
      elem: g,
      kern: Math.max(l.fontMetrics().bigOpSpacing1, l.fontMetrics().bigOpSpacing3 - g.depth)
    };
  }
  if (r) {
    var y = et(r, l.havingStyle(s.sub()), l);
    d = {
      elem: y,
      kern: Math.max(l.fontMetrics().bigOpSpacing2, l.fontMetrics().bigOpSpacing4 - y.height)
    };
  }
  var x;
  if (p && d) {
    var w = l.fontMetrics().bigOpSpacing5 + d.elem.height + d.elem.depth + d.kern + e.depth + c;
    x = P.makeVList({
      positionType: "bottom",
      positionData: w,
      children: [{
        type: "kern",
        size: l.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: d.elem,
        marginLeft: Me(-u)
      }, {
        type: "kern",
        size: d.kern
      }, {
        type: "elem",
        elem: e
      }, {
        type: "kern",
        size: p.kern
      }, {
        type: "elem",
        elem: p.elem,
        marginLeft: Me(u)
      }, {
        type: "kern",
        size: l.fontMetrics().bigOpSpacing5
      }]
    }, l);
  } else if (d) {
    var z = e.height - c;
    x = P.makeVList({
      positionType: "top",
      positionData: z,
      children: [{
        type: "kern",
        size: l.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: d.elem,
        marginLeft: Me(-u)
      }, {
        type: "kern",
        size: d.kern
      }, {
        type: "elem",
        elem: e
      }]
    }, l);
  } else if (p) {
    var M = e.depth + c;
    x = P.makeVList({
      positionType: "bottom",
      positionData: M,
      children: [{
        type: "elem",
        elem: e
      }, {
        type: "kern",
        size: p.kern
      }, {
        type: "elem",
        elem: p.elem,
        marginLeft: Me(u)
      }, {
        type: "kern",
        size: l.fontMetrics().bigOpSpacing5
      }]
    }, l);
  } else
    return e;
  var A = [x];
  if (d && u !== 0 && !h) {
    var T = P.makeSpan(["mspace"], [], l);
    T.style.marginRight = Me(u), A.unshift(T);
  }
  return P.makeSpan(["mop", "op-limits"], A, l);
}, t7 = ["\\smallint"], Dl = (e, n) => {
  var r, l, s = !1, u;
  e.type === "supsub" ? (r = e.sup, l = e.sub, u = Ze(e.base, "op"), s = !0) : u = Ze(e, "op");
  var c = n.style, h = !1;
  c.size === qe.DISPLAY.size && u.symbol && !t7.includes(u.name) && (h = !0);
  var d;
  if (u.symbol) {
    var p = h ? "Size2-Regular" : "Size1-Regular", g = "";
    if ((u.name === "\\oiint" || u.name === "\\oiiint") && (g = u.name.slice(1), u.name = g === "oiint" ? "\\iint" : "\\iiint"), d = P.makeSymbol(u.name, p, "math", n, ["mop", "op-symbol", h ? "large-op" : "small-op"]), g.length > 0) {
      var y = d.italic, x = P.staticSvg(g + "Size" + (h ? "2" : "1"), n);
      d = P.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: d,
          shift: 0
        }, {
          type: "elem",
          elem: x,
          shift: h ? 0.08 : 0
        }]
      }, n), u.name = "\\" + g, d.classes.unshift("mop"), d.italic = y;
    }
  } else if (u.body) {
    var w = $t(u.body, n, !0);
    w.length === 1 && w[0] instanceof ta ? (d = w[0], d.classes[0] = "mop") : d = P.makeSpan(["mop"], w, n);
  } else {
    for (var z = [], M = 1; M < u.name.length; M++)
      z.push(P.mathsym(u.name[M], u.mode, n));
    d = P.makeSpan(["mop"], z, n);
  }
  var A = 0, T = 0;
  return (d instanceof ta || u.name === "\\oiint" || u.name === "\\oiiint") && !u.suppressBaseShift && (A = (d.height - d.depth) / 2 - n.fontMetrics().axisHeight, T = d.italic), s ? e7(d, r, l, n, c, T, A) : (A && (d.style.position = "relative", d.style.top = Me(A)), d);
}, ns = (e, n) => {
  var r;
  if (e.symbol)
    r = new Hn("mo", [na(e.name, e.mode)]), t7.includes(e.name) && r.setAttribute("largeop", "false");
  else if (e.body)
    r = new Hn("mo", zn(e.body, n));
  else {
    r = new Hn("mi", [new ba(e.name.slice(1))]);
    var l = new Hn("mo", [na("⁡", "text")]);
    e.parentIsSupSub ? r = new Hn("mrow", [r, l]) : r = Np([r, l]);
  }
  return r;
}, AE = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
Ce({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = l;
    return s.length === 1 && (s = AE[s]), {
      type: "op",
      mode: r.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: s
    };
  },
  htmlBuilder: Dl,
  mathmlBuilder: ns
});
Ce({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[0];
    return {
      type: "op",
      mode: r.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: Rt(l)
    };
  },
  htmlBuilder: Dl,
  mathmlBuilder: ns
});
var CE = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
Ce({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e;
    return {
      type: "op",
      mode: n.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: r
    };
  },
  htmlBuilder: Dl,
  mathmlBuilder: ns
});
Ce({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e;
    return {
      type: "op",
      mode: n.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: r
    };
  },
  htmlBuilder: Dl,
  mathmlBuilder: ns
});
Ce({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0,
    allowedInArgument: !0
  },
  handler(e) {
    var {
      parser: n,
      funcName: r
    } = e, l = r;
    return l.length === 1 && (l = CE[l]), {
      type: "op",
      mode: n.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: l
    };
  },
  htmlBuilder: Dl,
  mathmlBuilder: ns
});
var n7 = (e, n) => {
  var r, l, s = !1, u;
  e.type === "supsub" ? (r = e.sup, l = e.sub, u = Ze(e.base, "operatorname"), s = !0) : u = Ze(e, "operatorname");
  var c;
  if (u.body.length > 0) {
    for (var h = u.body.map((y) => {
      var x = y.text;
      return typeof x == "string" ? {
        type: "textord",
        mode: y.mode,
        text: x
      } : y;
    }), d = $t(h, n.withFont("mathrm"), !0), p = 0; p < d.length; p++) {
      var g = d[p];
      g instanceof ta && (g.text = g.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    c = P.makeSpan(["mop"], d, n);
  } else
    c = P.makeSpan(["mop"], [], n);
  return s ? e7(c, r, l, n, n.style, 0, 0) : c;
}, NE = (e, n) => {
  for (var r = zn(e.body, n.withFont("mathrm")), l = !0, s = 0; s < r.length; s++) {
    var u = r[s];
    if (!(u instanceof Se.SpaceNode)) if (u instanceof Se.MathNode)
      switch (u.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        // Do nothing yet.
        case "mo": {
          var c = u.children[0];
          u.children.length === 1 && c instanceof Se.TextNode ? c.text = c.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : l = !1;
          break;
        }
        default:
          l = !1;
      }
    else
      l = !1;
  }
  if (l) {
    var h = r.map((g) => g.toText()).join("");
    r = [new Se.TextNode(h)];
  }
  var d = new Se.MathNode("mi", r);
  d.setAttribute("mathvariant", "normal");
  var p = new Se.MathNode("mo", [na("⁡", "text")]);
  return e.parentIsSupSub ? new Se.MathNode("mrow", [d, p]) : Se.newDocumentFragment([d, p]);
};
Ce({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (e, n) => {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "operatorname",
      mode: r.mode,
      body: Rt(s),
      alwaysHandleSupSub: l === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: n7,
  mathmlBuilder: NE
});
N("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
Nr({
  type: "ordgroup",
  htmlBuilder(e, n) {
    return e.semisimple ? P.makeFragment($t(e.body, n, !1)) : P.makeSpan(["mord"], $t(e.body, n, !0), n);
  },
  mathmlBuilder(e, n) {
    return Q0(e.body, n, !0);
  }
});
Ce({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(e, n) {
    var {
      parser: r
    } = e, l = n[0];
    return {
      type: "overline",
      mode: r.mode,
      body: l
    };
  },
  htmlBuilder(e, n) {
    var r = et(e.body, n.havingCrampedStyle()), l = P.makeLineSpan("overline-line", n), s = n.fontMetrics().defaultRuleThickness, u = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: 3 * s
      }, {
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: s
      }]
    }, n);
    return P.makeSpan(["mord", "overline"], [u], n);
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mo", [new Se.TextNode("‾")]);
    r.setAttribute("stretchy", "true");
    var l = new Se.MathNode("mover", [dt(e.body, n), r]);
    return l.setAttribute("accent", "true"), l;
  }
});
Ce({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[0];
    return {
      type: "phantom",
      mode: r.mode,
      body: Rt(l)
    };
  },
  htmlBuilder: (e, n) => {
    var r = $t(e.body, n.withPhantom(), !1);
    return P.makeFragment(r);
  },
  mathmlBuilder: (e, n) => {
    var r = zn(e.body, n);
    return new Se.MathNode("mphantom", r);
  }
});
Ce({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[0];
    return {
      type: "hphantom",
      mode: r.mode,
      body: l
    };
  },
  htmlBuilder: (e, n) => {
    var r = P.makeSpan([], [et(e.body, n.withPhantom())]);
    if (r.height = 0, r.depth = 0, r.children)
      for (var l = 0; l < r.children.length; l++)
        r.children[l].height = 0, r.children[l].depth = 0;
    return r = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r
      }]
    }, n), P.makeSpan(["mord"], [r], n);
  },
  mathmlBuilder: (e, n) => {
    var r = zn(Rt(e.body), n), l = new Se.MathNode("mphantom", r), s = new Se.MathNode("mpadded", [l]);
    return s.setAttribute("height", "0px"), s.setAttribute("depth", "0px"), s;
  }
});
Ce({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      parser: r
    } = e, l = n[0];
    return {
      type: "vphantom",
      mode: r.mode,
      body: l
    };
  },
  htmlBuilder: (e, n) => {
    var r = P.makeSpan(["inner"], [et(e.body, n.withPhantom())]), l = P.makeSpan(["fix"], []);
    return P.makeSpan(["mord", "rlap"], [r, l], n);
  },
  mathmlBuilder: (e, n) => {
    var r = zn(Rt(e.body), n), l = new Se.MathNode("mphantom", r), s = new Se.MathNode("mpadded", [l]);
    return s.setAttribute("width", "0px"), s;
  }
});
Ce({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r
    } = e, l = Ze(n[0], "size").value, s = n[1];
    return {
      type: "raisebox",
      mode: r.mode,
      dy: l,
      body: s
    };
  },
  htmlBuilder(e, n) {
    var r = et(e.body, n), l = Tt(e.dy, n);
    return P.makeVList({
      positionType: "shift",
      positionData: -l,
      children: [{
        type: "elem",
        elem: r
      }]
    }, n);
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mpadded", [dt(e.body, n)]), l = e.dy.number + e.dy.unit;
    return r.setAttribute("voffset", l), r;
  }
});
Ce({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInArgument: !0
  },
  handler(e) {
    var {
      parser: n
    } = e;
    return {
      type: "internal",
      mode: n.mode
    };
  }
});
Ce({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    argTypes: ["size", "size", "size"]
  },
  handler(e, n, r) {
    var {
      parser: l
    } = e, s = r[0], u = Ze(n[0], "size"), c = Ze(n[1], "size");
    return {
      type: "rule",
      mode: l.mode,
      shift: s && Ze(s, "size").value,
      width: u.value,
      height: c.value
    };
  },
  htmlBuilder(e, n) {
    var r = P.makeSpan(["mord", "rule"], [], n), l = Tt(e.width, n), s = Tt(e.height, n), u = e.shift ? Tt(e.shift, n) : 0;
    return r.style.borderRightWidth = Me(l), r.style.borderTopWidth = Me(s), r.style.bottom = Me(u), r.width = l, r.height = s + u, r.depth = -u, r.maxFontSize = s * 1.125 * n.sizeMultiplier, r;
  },
  mathmlBuilder(e, n) {
    var r = Tt(e.width, n), l = Tt(e.height, n), s = e.shift ? Tt(e.shift, n) : 0, u = n.color && n.getColor() || "black", c = new Se.MathNode("mspace");
    c.setAttribute("mathbackground", u), c.setAttribute("width", Me(r)), c.setAttribute("height", Me(l));
    var h = new Se.MathNode("mpadded", [c]);
    return s >= 0 ? h.setAttribute("height", Me(s)) : (h.setAttribute("height", Me(s)), h.setAttribute("depth", Me(-s))), h.setAttribute("voffset", Me(s)), h;
  }
});
function a7(e, n, r) {
  for (var l = $t(e, n, !1), s = n.sizeMultiplier / r.sizeMultiplier, u = 0; u < l.length; u++) {
    var c = l[u].classes.indexOf("sizing");
    c < 0 ? Array.prototype.push.apply(l[u].classes, n.sizingClasses(r)) : l[u].classes[c + 1] === "reset-size" + n.size && (l[u].classes[c + 1] = "reset-size" + r.size), l[u].height *= s, l[u].depth *= s;
  }
  return P.makeFragment(l);
}
var d3 = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], kE = (e, n) => {
  var r = n.havingSize(e.size);
  return a7(e.body, r, n);
};
Ce({
  type: "sizing",
  names: d3,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (e, n) => {
    var {
      breakOnTokenText: r,
      funcName: l,
      parser: s
    } = e, u = s.parseExpression(!1, r);
    return {
      type: "sizing",
      mode: s.mode,
      // Figure out what size to use based on the list of functions above
      size: d3.indexOf(l) + 1,
      body: u
    };
  },
  htmlBuilder: kE,
  mathmlBuilder: (e, n) => {
    var r = n.havingSize(e.size), l = zn(e.body, r), s = new Se.MathNode("mstyle", l);
    return s.setAttribute("mathsize", Me(r.sizeMultiplier)), s;
  }
});
Ce({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (e, n, r) => {
    var {
      parser: l
    } = e, s = !1, u = !1, c = r[0] && Ze(r[0], "ordgroup");
    if (c)
      for (var h = "", d = 0; d < c.body.length; ++d) {
        var p = c.body[d];
        if (h = p.text, h === "t")
          s = !0;
        else if (h === "b")
          u = !0;
        else {
          s = !1, u = !1;
          break;
        }
      }
    else
      s = !0, u = !0;
    var g = n[0];
    return {
      type: "smash",
      mode: l.mode,
      body: g,
      smashHeight: s,
      smashDepth: u
    };
  },
  htmlBuilder: (e, n) => {
    var r = P.makeSpan([], [et(e.body, n)]);
    if (!e.smashHeight && !e.smashDepth)
      return r;
    if (e.smashHeight && (r.height = 0, r.children))
      for (var l = 0; l < r.children.length; l++)
        r.children[l].height = 0;
    if (e.smashDepth && (r.depth = 0, r.children))
      for (var s = 0; s < r.children.length; s++)
        r.children[s].depth = 0;
    var u = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r
      }]
    }, n);
    return P.makeSpan(["mord"], [u], n);
  },
  mathmlBuilder: (e, n) => {
    var r = new Se.MathNode("mpadded", [dt(e.body, n)]);
    return e.smashHeight && r.setAttribute("height", "0px"), e.smashDepth && r.setAttribute("depth", "0px"), r;
  }
});
Ce({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(e, n, r) {
    var {
      parser: l
    } = e, s = r[0], u = n[0];
    return {
      type: "sqrt",
      mode: l.mode,
      body: u,
      index: s
    };
  },
  htmlBuilder(e, n) {
    var r = et(e.body, n.havingCrampedStyle());
    r.height === 0 && (r.height = n.fontMetrics().xHeight), r = P.wrapFragment(r, n);
    var l = n.fontMetrics(), s = l.defaultRuleThickness, u = s;
    n.style.id < qe.TEXT.id && (u = n.fontMetrics().xHeight);
    var c = s + u / 4, h = r.height + r.depth + c + s, {
      span: d,
      ruleWidth: p,
      advanceWidth: g
    } = t0.sqrtImage(h, n), y = d.height - p;
    y > r.height + r.depth + c && (c = (c + y - r.height - r.depth) / 2);
    var x = d.height - r.height - c - p;
    r.style.paddingLeft = Me(g);
    var w = P.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(r.height + x)
      }, {
        type: "elem",
        elem: d
      }, {
        type: "kern",
        size: p
      }]
    }, n);
    if (e.index) {
      var z = n.havingStyle(qe.SCRIPTSCRIPT), M = et(e.index, z, n), A = 0.6 * (w.height - w.depth), T = P.makeVList({
        positionType: "shift",
        positionData: -A,
        children: [{
          type: "elem",
          elem: M
        }]
      }, n), R = P.makeSpan(["root"], [T]);
      return P.makeSpan(["mord", "sqrt"], [R, w], n);
    } else
      return P.makeSpan(["mord", "sqrt"], [w], n);
  },
  mathmlBuilder(e, n) {
    var {
      body: r,
      index: l
    } = e;
    return l ? new Se.MathNode("mroot", [dt(r, n), dt(l, n)]) : new Se.MathNode("msqrt", [dt(r, n)]);
  }
});
var m3 = {
  display: qe.DISPLAY,
  text: qe.TEXT,
  script: qe.SCRIPT,
  scriptscript: qe.SCRIPTSCRIPT
};
Ce({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(e, n) {
    var {
      breakOnTokenText: r,
      funcName: l,
      parser: s
    } = e, u = s.parseExpression(!0, r), c = l.slice(1, l.length - 5);
    return {
      type: "styling",
      mode: s.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: c,
      body: u
    };
  },
  htmlBuilder(e, n) {
    var r = m3[e.style], l = n.havingStyle(r).withFont("");
    return a7(e.body, l, n);
  },
  mathmlBuilder(e, n) {
    var r = m3[e.style], l = n.havingStyle(r), s = zn(e.body, l), u = new Se.MathNode("mstyle", s), c = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, h = c[e.style];
    return u.setAttribute("scriptlevel", h[0]), u.setAttribute("displaystyle", h[1]), u;
  }
});
var DE = function(n, r) {
  var l = n.base;
  if (l)
    if (l.type === "op") {
      var s = l.limits && (r.style.size === qe.DISPLAY.size || l.alwaysHandleSupSub);
      return s ? Dl : null;
    } else if (l.type === "operatorname") {
      var u = l.alwaysHandleSupSub && (r.style.size === qe.DISPLAY.size || l.limits);
      return u ? n7 : null;
    } else {
      if (l.type === "accent")
        return at.isCharacterBox(l.base) ? Vh : null;
      if (l.type === "horizBrace") {
        var c = !n.sub;
        return c === l.isOver ? Pp : null;
      } else
        return null;
    }
  else return null;
};
Nr({
  type: "supsub",
  htmlBuilder(e, n) {
    var r = DE(e, n);
    if (r)
      return r(e, n);
    var {
      base: l,
      sup: s,
      sub: u
    } = e, c = et(l, n), h, d, p = n.fontMetrics(), g = 0, y = 0, x = l && at.isCharacterBox(l);
    if (s) {
      var w = n.havingStyle(n.style.sup());
      h = et(s, w, n), x || (g = c.height - w.fontMetrics().supDrop * w.sizeMultiplier / n.sizeMultiplier);
    }
    if (u) {
      var z = n.havingStyle(n.style.sub());
      d = et(u, z, n), x || (y = c.depth + z.fontMetrics().subDrop * z.sizeMultiplier / n.sizeMultiplier);
    }
    var M;
    n.style === qe.DISPLAY ? M = p.sup1 : n.style.cramped ? M = p.sup3 : M = p.sup2;
    var A = n.sizeMultiplier, T = Me(0.5 / p.ptPerEm / A), R = null;
    if (d) {
      var q = e.base && e.base.type === "op" && e.base.name && (e.base.name === "\\oiint" || e.base.name === "\\oiiint");
      (c instanceof ta || q) && (R = Me(-c.italic));
    }
    var H;
    if (h && d) {
      g = Math.max(g, M, h.depth + 0.25 * p.xHeight), y = Math.max(y, p.sub2);
      var $ = p.defaultRuleThickness, V = 4 * $;
      if (g - h.depth - (d.height - y) < V) {
        y = V - (g - h.depth) + d.height;
        var Q = 0.8 * p.xHeight - (g - h.depth);
        Q > 0 && (g += Q, y -= Q);
      }
      var re = [{
        type: "elem",
        elem: d,
        shift: y,
        marginRight: T,
        marginLeft: R
      }, {
        type: "elem",
        elem: h,
        shift: -g,
        marginRight: T
      }];
      H = P.makeVList({
        positionType: "individualShift",
        children: re
      }, n);
    } else if (d) {
      y = Math.max(y, p.sub1, d.height - 0.8 * p.xHeight);
      var te = [{
        type: "elem",
        elem: d,
        marginLeft: R,
        marginRight: T
      }];
      H = P.makeVList({
        positionType: "shift",
        positionData: y,
        children: te
      }, n);
    } else if (h)
      g = Math.max(g, M, h.depth + 0.25 * p.xHeight), H = P.makeVList({
        positionType: "shift",
        positionData: -g,
        children: [{
          type: "elem",
          elem: h,
          marginRight: T
        }]
      }, n);
    else
      throw new Error("supsub must have either sup or sub.");
    var ie = th(c, "right") || "mord";
    return P.makeSpan([ie], [c, P.makeSpan(["msupsub"], [H])], n);
  },
  mathmlBuilder(e, n) {
    var r = !1, l, s;
    e.base && e.base.type === "horizBrace" && (s = !!e.sup, s === e.base.isOver && (r = !0, l = e.base.isOver)), e.base && (e.base.type === "op" || e.base.type === "operatorname") && (e.base.parentIsSupSub = !0);
    var u = [dt(e.base, n)];
    e.sub && u.push(dt(e.sub, n)), e.sup && u.push(dt(e.sup, n));
    var c;
    if (r)
      c = l ? "mover" : "munder";
    else if (e.sub)
      if (e.sup) {
        var p = e.base;
        p && p.type === "op" && p.limits && n.style === qe.DISPLAY || p && p.type === "operatorname" && p.alwaysHandleSupSub && (n.style === qe.DISPLAY || p.limits) ? c = "munderover" : c = "msubsup";
      } else {
        var d = e.base;
        d && d.type === "op" && d.limits && (n.style === qe.DISPLAY || d.alwaysHandleSupSub) || d && d.type === "operatorname" && d.alwaysHandleSupSub && (d.limits || n.style === qe.DISPLAY) ? c = "munder" : c = "msub";
      }
    else {
      var h = e.base;
      h && h.type === "op" && h.limits && (n.style === qe.DISPLAY || h.alwaysHandleSupSub) || h && h.type === "operatorname" && h.alwaysHandleSupSub && (h.limits || n.style === qe.DISPLAY) ? c = "mover" : c = "msup";
    }
    return new Se.MathNode(c, u);
  }
});
Nr({
  type: "atom",
  htmlBuilder(e, n) {
    return P.mathsym(e.text, e.mode, n, ["m" + e.family]);
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mo", [na(e.text, e.mode)]);
    if (e.family === "bin") {
      var l = Uh(e, n);
      l === "bold-italic" && r.setAttribute("mathvariant", l);
    } else e.family === "punct" ? r.setAttribute("separator", "true") : (e.family === "open" || e.family === "close") && r.setAttribute("stretchy", "false");
    return r;
  }
});
var r7 = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
Nr({
  type: "mathord",
  htmlBuilder(e, n) {
    return P.makeOrd(e, n, "mathord");
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mi", [na(e.text, e.mode, n)]), l = Uh(e, n) || "italic";
    return l !== r7[r.type] && r.setAttribute("mathvariant", l), r;
  }
});
Nr({
  type: "textord",
  htmlBuilder(e, n) {
    return P.makeOrd(e, n, "textord");
  },
  mathmlBuilder(e, n) {
    var r = na(e.text, e.mode, n), l = Uh(e, n) || "normal", s;
    return e.mode === "text" ? s = new Se.MathNode("mtext", [r]) : /[0-9]/.test(e.text) ? s = new Se.MathNode("mn", [r]) : e.text === "\\prime" ? s = new Se.MathNode("mo", [r]) : s = new Se.MathNode("mi", [r]), l !== r7[s.type] && s.setAttribute("mathvariant", l), s;
  }
});
var k1 = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, D1 = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
Nr({
  type: "spacing",
  htmlBuilder(e, n) {
    if (D1.hasOwnProperty(e.text)) {
      var r = D1[e.text].className || "";
      if (e.mode === "text") {
        var l = P.makeOrd(e, n, "textord");
        return l.classes.push(r), l;
      } else
        return P.makeSpan(["mspace", r], [P.mathsym(e.text, e.mode, n)], n);
    } else {
      if (k1.hasOwnProperty(e.text))
        return P.makeSpan(["mspace", k1[e.text]], [], n);
      throw new we('Unknown type of space "' + e.text + '"');
    }
  },
  mathmlBuilder(e, n) {
    var r;
    if (D1.hasOwnProperty(e.text))
      r = new Se.MathNode("mtext", [new Se.TextNode(" ")]);
    else {
      if (k1.hasOwnProperty(e.text))
        return new Se.MathNode("mspace");
      throw new we('Unknown type of space "' + e.text + '"');
    }
    return r;
  }
});
var p3 = () => {
  var e = new Se.MathNode("mtd", []);
  return e.setAttribute("width", "50%"), e;
};
Nr({
  type: "tag",
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mtable", [new Se.MathNode("mtr", [p3(), new Se.MathNode("mtd", [Q0(e.body, n)]), p3(), new Se.MathNode("mtd", [Q0(e.tag, n)])])]);
    return r.setAttribute("width", "100%"), r;
  }
});
var g3 = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, y3 = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, _E = {
  "\\textit": "textit",
  "\\textup": "textup"
}, v3 = (e, n) => {
  var r = e.font;
  if (r) {
    if (g3[r])
      return n.withTextFontFamily(g3[r]);
    if (y3[r])
      return n.withTextFontWeight(y3[r]);
    if (r === "\\emph")
      return n.fontShape === "textit" ? n.withTextFontShape("textup") : n.withTextFontShape("textit");
  } else return n;
  return n.withTextFontShape(_E[r]);
};
Ce({
  type: "text",
  names: [
    // Font families
    "\\text",
    "\\textrm",
    "\\textsf",
    "\\texttt",
    "\\textnormal",
    // Font weights
    "\\textbf",
    "\\textmd",
    // Font Shapes
    "\\textit",
    "\\textup",
    "\\emph"
  ],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: !0,
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r,
      funcName: l
    } = e, s = n[0];
    return {
      type: "text",
      mode: r.mode,
      body: Rt(s),
      font: l
    };
  },
  htmlBuilder(e, n) {
    var r = v3(e, n), l = $t(e.body, r, !0);
    return P.makeSpan(["mord", "text"], l, r);
  },
  mathmlBuilder(e, n) {
    var r = v3(e, n);
    return Q0(e.body, r);
  }
});
Ce({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "underline",
      mode: r.mode,
      body: n[0]
    };
  },
  htmlBuilder(e, n) {
    var r = et(e.body, n), l = P.makeLineSpan("underline-line", n), s = n.fontMetrics().defaultRuleThickness, u = P.makeVList({
      positionType: "top",
      positionData: r.height,
      children: [{
        type: "kern",
        size: s
      }, {
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: 3 * s
      }, {
        type: "elem",
        elem: r
      }]
    }, n);
    return P.makeSpan(["mord", "underline"], [u], n);
  },
  mathmlBuilder(e, n) {
    var r = new Se.MathNode("mo", [new Se.TextNode("‾")]);
    r.setAttribute("stretchy", "true");
    var l = new Se.MathNode("munder", [dt(e.body, n), r]);
    return l.setAttribute("accentunder", "true"), l;
  }
});
Ce({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(e, n) {
    var {
      parser: r
    } = e;
    return {
      type: "vcenter",
      mode: r.mode,
      body: n[0]
    };
  },
  htmlBuilder(e, n) {
    var r = et(e.body, n), l = n.fontMetrics().axisHeight, s = 0.5 * (r.height - l - (r.depth + l));
    return P.makeVList({
      positionType: "shift",
      positionData: s,
      children: [{
        type: "elem",
        elem: r
      }]
    }, n);
  },
  mathmlBuilder(e, n) {
    return new Se.MathNode("mpadded", [dt(e.body, n)], ["vcenter"]);
  }
});
Ce({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(e, n, r) {
    throw new we("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(e, n) {
    for (var r = x3(e), l = [], s = n.havingStyle(n.style.text()), u = 0; u < r.length; u++) {
      var c = r[u];
      c === "~" && (c = "\\textasciitilde"), l.push(P.makeSymbol(c, "Typewriter-Regular", e.mode, s, ["mord", "texttt"]));
    }
    return P.makeSpan(["mord", "text"].concat(s.sizingClasses(n)), P.tryCombineChars(l), s);
  },
  mathmlBuilder(e, n) {
    var r = new Se.TextNode(x3(e)), l = new Se.MathNode("mtext", [r]);
    return l.setAttribute("mathvariant", "monospace"), l;
  }
});
var x3 = (e) => e.body.replace(/ /g, e.star ? "␣" : " "), Y0 = Ap, l7 = `[ \r
	]`, RE = "\\\\[a-zA-Z@]+", BE = "\\\\[^\uD800-\uDFFF]", OE = "(" + RE + ")" + l7 + "*", HE = `\\\\(
|[ \r	]+
?)[ \r	]*`, lh = "[̀-ͯ]", LE = new RegExp(lh + "+$"), qE = "(" + l7 + "+)|" + // whitespace
(HE + "|") + // \whitespace
"([!-\\[\\]-‧‪-퟿豈-]" + // single codepoint
(lh + "*") + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
(lh + "*") + // ...plus accents
"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
("|" + OE) + // \macroName + spaces
("|" + BE + ")");
class b3 {
  // Category codes. The lexer only supports comment characters (14) for now.
  // MacroExpander additionally distinguishes active (13).
  constructor(n, r) {
    this.input = void 0, this.settings = void 0, this.tokenRegex = void 0, this.catcodes = void 0, this.input = n, this.settings = r, this.tokenRegex = new RegExp(qE, "g"), this.catcodes = {
      "%": 14,
      // comment character
      "~": 13
      // active character
    };
  }
  setCatcode(n, r) {
    this.catcodes[n] = r;
  }
  /**
   * This function lexes a single token.
   */
  lex() {
    var n = this.input, r = this.tokenRegex.lastIndex;
    if (r === n.length)
      return new Ln("EOF", new wn(this, r, r));
    var l = this.tokenRegex.exec(n);
    if (l === null || l.index !== r)
      throw new we("Unexpected character: '" + n[r] + "'", new Ln(n[r], new wn(this, r, r + 1)));
    var s = l[6] || l[3] || (l[2] ? "\\ " : " ");
    if (this.catcodes[s] === 14) {
      var u = n.indexOf(`
`, this.tokenRegex.lastIndex);
      return u === -1 ? (this.tokenRegex.lastIndex = n.length, this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")) : this.tokenRegex.lastIndex = u + 1, this.lex();
    }
    return new Ln(s, new wn(this, r, this.tokenRegex.lastIndex));
  }
}
class UE {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(n, r) {
    n === void 0 && (n = {}), r === void 0 && (r = {}), this.current = void 0, this.builtins = void 0, this.undefStack = void 0, this.current = r, this.builtins = n, this.undefStack = [];
  }
  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }
  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0)
      throw new we("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
    var n = this.undefStack.pop();
    for (var r in n)
      n.hasOwnProperty(r) && (n[r] == null ? delete this.current[r] : this.current[r] = n[r]);
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    for (; this.undefStack.length > 0; )
      this.endGroup();
  }
  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(n) {
    return this.current.hasOwnProperty(n) || this.builtins.hasOwnProperty(n);
  }
  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(n) {
    return this.current.hasOwnProperty(n) ? this.current[n] : this.builtins[n];
  }
  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(n, r, l) {
    if (l === void 0 && (l = !1), l) {
      for (var s = 0; s < this.undefStack.length; s++)
        delete this.undefStack[s][n];
      this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][n] = r);
    } else {
      var u = this.undefStack[this.undefStack.length - 1];
      u && !u.hasOwnProperty(n) && (u[n] = this.current[n]);
    }
    r == null ? delete this.current[n] : this.current[n] = r;
  }
}
var jE = Ip;
N("\\noexpand", function(e) {
  var n = e.popToken();
  return e.isExpandable(n.text) && (n.noexpand = !0, n.treatAsRelax = !0), {
    tokens: [n],
    numArgs: 0
  };
});
N("\\expandafter", function(e) {
  var n = e.popToken();
  return e.expandOnce(!0), {
    tokens: [n],
    numArgs: 0
  };
});
N("\\@firstoftwo", function(e) {
  var n = e.consumeArgs(2);
  return {
    tokens: n[0],
    numArgs: 0
  };
});
N("\\@secondoftwo", function(e) {
  var n = e.consumeArgs(2);
  return {
    tokens: n[1],
    numArgs: 0
  };
});
N("\\@ifnextchar", function(e) {
  var n = e.consumeArgs(3);
  e.consumeSpaces();
  var r = e.future();
  return n[0].length === 1 && n[0][0].text === r.text ? {
    tokens: n[1],
    numArgs: 0
  } : {
    tokens: n[2],
    numArgs: 0
  };
});
N("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
N("\\TextOrMath", function(e) {
  var n = e.consumeArgs(2);
  return e.mode === "text" ? {
    tokens: n[0],
    numArgs: 0
  } : {
    tokens: n[1],
    numArgs: 0
  };
});
var S3 = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  a: 10,
  A: 10,
  b: 11,
  B: 11,
  c: 12,
  C: 12,
  d: 13,
  D: 13,
  e: 14,
  E: 14,
  f: 15,
  F: 15
};
N("\\char", function(e) {
  var n = e.popToken(), r, l = "";
  if (n.text === "'")
    r = 8, n = e.popToken();
  else if (n.text === '"')
    r = 16, n = e.popToken();
  else if (n.text === "`")
    if (n = e.popToken(), n.text[0] === "\\")
      l = n.text.charCodeAt(1);
    else {
      if (n.text === "EOF")
        throw new we("\\char` missing argument");
      l = n.text.charCodeAt(0);
    }
  else
    r = 10;
  if (r) {
    if (l = S3[n.text], l == null || l >= r)
      throw new we("Invalid base-" + r + " digit " + n.text);
    for (var s; (s = S3[e.future().text]) != null && s < r; )
      l *= r, l += s, e.popToken();
  }
  return "\\@char{" + l + "}";
});
var Kh = (e, n, r, l) => {
  var s = e.consumeArg().tokens;
  if (s.length !== 1)
    throw new we("\\newcommand's first argument must be a macro name");
  var u = s[0].text, c = e.isDefined(u);
  if (c && !n)
    throw new we("\\newcommand{" + u + "} attempting to redefine " + (u + "; use \\renewcommand"));
  if (!c && !r)
    throw new we("\\renewcommand{" + u + "} when command " + u + " does not yet exist; use \\newcommand");
  var h = 0;
  if (s = e.consumeArg().tokens, s.length === 1 && s[0].text === "[") {
    for (var d = "", p = e.expandNextToken(); p.text !== "]" && p.text !== "EOF"; )
      d += p.text, p = e.expandNextToken();
    if (!d.match(/^\s*[0-9]+\s*$/))
      throw new we("Invalid number of arguments: " + d);
    h = parseInt(d), s = e.consumeArg().tokens;
  }
  return c && l || e.macros.set(u, {
    tokens: s,
    numArgs: h
  }), "";
};
N("\\newcommand", (e) => Kh(e, !1, !0, !1));
N("\\renewcommand", (e) => Kh(e, !0, !1, !1));
N("\\providecommand", (e) => Kh(e, !0, !0, !0));
N("\\message", (e) => {
  var n = e.consumeArgs(1)[0];
  return console.log(n.reverse().map((r) => r.text).join("")), "";
});
N("\\errmessage", (e) => {
  var n = e.consumeArgs(1)[0];
  return console.error(n.reverse().map((r) => r.text).join("")), "";
});
N("\\show", (e) => {
  var n = e.popToken(), r = n.text;
  return console.log(n, e.macros.get(r), Y0[r], mt.math[r], mt.text[r]), "";
});
N("\\bgroup", "{");
N("\\egroup", "}");
N("~", "\\nobreakspace");
N("\\lq", "`");
N("\\rq", "'");
N("\\aa", "\\r a");
N("\\AA", "\\r A");
N("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
N("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
N("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
N("ℬ", "\\mathscr{B}");
N("ℰ", "\\mathscr{E}");
N("ℱ", "\\mathscr{F}");
N("ℋ", "\\mathscr{H}");
N("ℐ", "\\mathscr{I}");
N("ℒ", "\\mathscr{L}");
N("ℳ", "\\mathscr{M}");
N("ℛ", "\\mathscr{R}");
N("ℭ", "\\mathfrak{C}");
N("ℌ", "\\mathfrak{H}");
N("ℨ", "\\mathfrak{Z}");
N("\\Bbbk", "\\Bbb{k}");
N("·", "\\cdotp");
N("\\llap", "\\mathllap{\\textrm{#1}}");
N("\\rlap", "\\mathrlap{\\textrm{#1}}");
N("\\clap", "\\mathclap{\\textrm{#1}}");
N("\\mathstrut", "\\vphantom{(}");
N("\\underbar", "\\underline{\\text{#1}}");
N("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
N("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
N("\\ne", "\\neq");
N("≠", "\\neq");
N("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
N("∉", "\\notin");
N("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
N("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
N("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
N("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
N("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
N("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
N("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
N("⟂", "\\perp");
N("‼", "\\mathclose{!\\mkern-0.8mu!}");
N("∌", "\\notni");
N("⌜", "\\ulcorner");
N("⌝", "\\urcorner");
N("⌞", "\\llcorner");
N("⌟", "\\lrcorner");
N("©", "\\copyright");
N("®", "\\textregistered");
N("️", "\\textregistered");
N("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
N("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
N("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
N("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
N("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
N("⋮", "\\vdots");
N("\\varGamma", "\\mathit{\\Gamma}");
N("\\varDelta", "\\mathit{\\Delta}");
N("\\varTheta", "\\mathit{\\Theta}");
N("\\varLambda", "\\mathit{\\Lambda}");
N("\\varXi", "\\mathit{\\Xi}");
N("\\varPi", "\\mathit{\\Pi}");
N("\\varSigma", "\\mathit{\\Sigma}");
N("\\varUpsilon", "\\mathit{\\Upsilon}");
N("\\varPhi", "\\mathit{\\Phi}");
N("\\varPsi", "\\mathit{\\Psi}");
N("\\varOmega", "\\mathit{\\Omega}");
N("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
N("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
N("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
N("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
N("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
N("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
N("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
N("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
var w3 = {
  ",": "\\dotsc",
  "\\not": "\\dotsb",
  // \keybin@ checks for the following:
  "+": "\\dotsb",
  "=": "\\dotsb",
  "<": "\\dotsb",
  ">": "\\dotsb",
  "-": "\\dotsb",
  "*": "\\dotsb",
  ":": "\\dotsb",
  // Symbols whose definition starts with \DOTSB:
  "\\DOTSB": "\\dotsb",
  "\\coprod": "\\dotsb",
  "\\bigvee": "\\dotsb",
  "\\bigwedge": "\\dotsb",
  "\\biguplus": "\\dotsb",
  "\\bigcap": "\\dotsb",
  "\\bigcup": "\\dotsb",
  "\\prod": "\\dotsb",
  "\\sum": "\\dotsb",
  "\\bigotimes": "\\dotsb",
  "\\bigoplus": "\\dotsb",
  "\\bigodot": "\\dotsb",
  "\\bigsqcup": "\\dotsb",
  "\\And": "\\dotsb",
  "\\longrightarrow": "\\dotsb",
  "\\Longrightarrow": "\\dotsb",
  "\\longleftarrow": "\\dotsb",
  "\\Longleftarrow": "\\dotsb",
  "\\longleftrightarrow": "\\dotsb",
  "\\Longleftrightarrow": "\\dotsb",
  "\\mapsto": "\\dotsb",
  "\\longmapsto": "\\dotsb",
  "\\hookrightarrow": "\\dotsb",
  "\\doteq": "\\dotsb",
  // Symbols whose definition starts with \mathbin:
  "\\mathbin": "\\dotsb",
  // Symbols whose definition starts with \mathrel:
  "\\mathrel": "\\dotsb",
  "\\relbar": "\\dotsb",
  "\\Relbar": "\\dotsb",
  "\\xrightarrow": "\\dotsb",
  "\\xleftarrow": "\\dotsb",
  // Symbols whose definition starts with \DOTSI:
  "\\DOTSI": "\\dotsi",
  "\\int": "\\dotsi",
  "\\oint": "\\dotsi",
  "\\iint": "\\dotsi",
  "\\iiint": "\\dotsi",
  "\\iiiint": "\\dotsi",
  "\\idotsint": "\\dotsi",
  // Symbols whose definition starts with \DOTSX:
  "\\DOTSX": "\\dotsx"
};
N("\\dots", function(e) {
  var n = "\\dotso", r = e.expandAfterFuture().text;
  return r in w3 ? n = w3[r] : (r.slice(0, 4) === "\\not" || r in mt.math && ["bin", "rel"].includes(mt.math[r].group)) && (n = "\\dotsb"), n;
});
var Qh = {
  // \rightdelim@ checks for the following:
  ")": !0,
  "]": !0,
  "\\rbrack": !0,
  "\\}": !0,
  "\\rbrace": !0,
  "\\rangle": !0,
  "\\rceil": !0,
  "\\rfloor": !0,
  "\\rgroup": !0,
  "\\rmoustache": !0,
  "\\right": !0,
  "\\bigr": !0,
  "\\biggr": !0,
  "\\Bigr": !0,
  "\\Biggr": !0,
  // \extra@ also tests for the following:
  $: !0,
  // \extrap@ checks for the following:
  ";": !0,
  ".": !0,
  ",": !0
};
N("\\dotso", function(e) {
  var n = e.future().text;
  return n in Qh ? "\\ldots\\," : "\\ldots";
});
N("\\dotsc", function(e) {
  var n = e.future().text;
  return n in Qh && n !== "," ? "\\ldots\\," : "\\ldots";
});
N("\\cdots", function(e) {
  var n = e.future().text;
  return n in Qh ? "\\@cdots\\," : "\\@cdots";
});
N("\\dotsb", "\\cdots");
N("\\dotsm", "\\cdots");
N("\\dotsi", "\\!\\cdots");
N("\\dotsx", "\\ldots\\,");
N("\\DOTSI", "\\relax");
N("\\DOTSB", "\\relax");
N("\\DOTSX", "\\relax");
N("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
N("\\,", "\\tmspace+{3mu}{.1667em}");
N("\\thinspace", "\\,");
N("\\>", "\\mskip{4mu}");
N("\\:", "\\tmspace+{4mu}{.2222em}");
N("\\medspace", "\\:");
N("\\;", "\\tmspace+{5mu}{.2777em}");
N("\\thickspace", "\\;");
N("\\!", "\\tmspace-{3mu}{.1667em}");
N("\\negthinspace", "\\!");
N("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
N("\\negthickspace", "\\tmspace-{5mu}{.277em}");
N("\\enspace", "\\kern.5em ");
N("\\enskip", "\\hskip.5em\\relax");
N("\\quad", "\\hskip1em\\relax");
N("\\qquad", "\\hskip2em\\relax");
N("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
N("\\tag@paren", "\\tag@literal{({#1})}");
N("\\tag@literal", (e) => {
  if (e.macros.get("\\df@tag"))
    throw new we("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
N("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
N("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
N("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
N("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
N("\\newline", "\\\\\\relax");
N("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var i7 = Me(xa["Main-Regular"][84][1] - 0.7 * xa["Main-Regular"][65][1]);
N("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + i7 + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
N("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + i7 + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
N("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
N("\\@hspace", "\\hskip #1\\relax");
N("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
N("\\ordinarycolon", ":");
N("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
N("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
N("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
N("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
N("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
N("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
N("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
N("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
N("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
N("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
N("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
N("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
N("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
N("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
N("∷", "\\dblcolon");
N("∹", "\\eqcolon");
N("≔", "\\coloneqq");
N("≕", "\\eqqcolon");
N("⩴", "\\Coloneqq");
N("\\ratio", "\\vcentcolon");
N("\\coloncolon", "\\dblcolon");
N("\\colonequals", "\\coloneqq");
N("\\coloncolonequals", "\\Coloneqq");
N("\\equalscolon", "\\eqqcolon");
N("\\equalscoloncolon", "\\Eqqcolon");
N("\\colonminus", "\\coloneq");
N("\\coloncolonminus", "\\Coloneq");
N("\\minuscolon", "\\eqcolon");
N("\\minuscoloncolon", "\\Eqcolon");
N("\\coloncolonapprox", "\\Colonapprox");
N("\\coloncolonsim", "\\Colonsim");
N("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
N("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
N("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
N("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
N("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
N("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
N("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
N("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
N("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
N("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
N("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
N("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
N("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
N("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
N("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
N("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
N("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
N("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
N("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
N("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
N("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
N("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
N("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
N("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
N("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
N("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
N("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
N("\\imath", "\\html@mathml{\\@imath}{ı}");
N("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
N("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
N("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
N("⟦", "\\llbracket");
N("⟧", "\\rrbracket");
N("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
N("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
N("⦃", "\\lBrace");
N("⦄", "\\rBrace");
N("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
N("⦵", "\\minuso");
N("\\darr", "\\downarrow");
N("\\dArr", "\\Downarrow");
N("\\Darr", "\\Downarrow");
N("\\lang", "\\langle");
N("\\rang", "\\rangle");
N("\\uarr", "\\uparrow");
N("\\uArr", "\\Uparrow");
N("\\Uarr", "\\Uparrow");
N("\\N", "\\mathbb{N}");
N("\\R", "\\mathbb{R}");
N("\\Z", "\\mathbb{Z}");
N("\\alef", "\\aleph");
N("\\alefsym", "\\aleph");
N("\\Alpha", "\\mathrm{A}");
N("\\Beta", "\\mathrm{B}");
N("\\bull", "\\bullet");
N("\\Chi", "\\mathrm{X}");
N("\\clubs", "\\clubsuit");
N("\\cnums", "\\mathbb{C}");
N("\\Complex", "\\mathbb{C}");
N("\\Dagger", "\\ddagger");
N("\\diamonds", "\\diamondsuit");
N("\\empty", "\\emptyset");
N("\\Epsilon", "\\mathrm{E}");
N("\\Eta", "\\mathrm{H}");
N("\\exist", "\\exists");
N("\\harr", "\\leftrightarrow");
N("\\hArr", "\\Leftrightarrow");
N("\\Harr", "\\Leftrightarrow");
N("\\hearts", "\\heartsuit");
N("\\image", "\\Im");
N("\\infin", "\\infty");
N("\\Iota", "\\mathrm{I}");
N("\\isin", "\\in");
N("\\Kappa", "\\mathrm{K}");
N("\\larr", "\\leftarrow");
N("\\lArr", "\\Leftarrow");
N("\\Larr", "\\Leftarrow");
N("\\lrarr", "\\leftrightarrow");
N("\\lrArr", "\\Leftrightarrow");
N("\\Lrarr", "\\Leftrightarrow");
N("\\Mu", "\\mathrm{M}");
N("\\natnums", "\\mathbb{N}");
N("\\Nu", "\\mathrm{N}");
N("\\Omicron", "\\mathrm{O}");
N("\\plusmn", "\\pm");
N("\\rarr", "\\rightarrow");
N("\\rArr", "\\Rightarrow");
N("\\Rarr", "\\Rightarrow");
N("\\real", "\\Re");
N("\\reals", "\\mathbb{R}");
N("\\Reals", "\\mathbb{R}");
N("\\Rho", "\\mathrm{P}");
N("\\sdot", "\\cdot");
N("\\sect", "\\S");
N("\\spades", "\\spadesuit");
N("\\sub", "\\subset");
N("\\sube", "\\subseteq");
N("\\supe", "\\supseteq");
N("\\Tau", "\\mathrm{T}");
N("\\thetasym", "\\vartheta");
N("\\weierp", "\\wp");
N("\\Zeta", "\\mathrm{Z}");
N("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
N("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
N("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
N("\\bra", "\\mathinner{\\langle{#1}|}");
N("\\ket", "\\mathinner{|{#1}\\rangle}");
N("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
N("\\Bra", "\\left\\langle#1\\right|");
N("\\Ket", "\\left|#1\\right\\rangle");
var s7 = (e) => (n) => {
  var r = n.consumeArg().tokens, l = n.consumeArg().tokens, s = n.consumeArg().tokens, u = n.consumeArg().tokens, c = n.macros.get("|"), h = n.macros.get("\\|");
  n.macros.beginGroup();
  var d = (y) => (x) => {
    e && (x.macros.set("|", c), s.length && x.macros.set("\\|", h));
    var w = y;
    if (!y && s.length) {
      var z = x.future();
      z.text === "|" && (x.popToken(), w = !0);
    }
    return {
      tokens: w ? s : l,
      numArgs: 0
    };
  };
  n.macros.set("|", d(!1)), s.length && n.macros.set("\\|", d(!0));
  var p = n.consumeArg().tokens, g = n.expandTokens([
    ...u,
    ...p,
    ...r
    // reversed
  ]);
  return n.macros.endGroup(), {
    tokens: g.reverse(),
    numArgs: 0
  };
};
N("\\bra@ket", s7(!1));
N("\\bra@set", s7(!0));
N("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
N("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
N("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
N("\\angln", "{\\angl n}");
N("\\blue", "\\textcolor{##6495ed}{#1}");
N("\\orange", "\\textcolor{##ffa500}{#1}");
N("\\pink", "\\textcolor{##ff00af}{#1}");
N("\\red", "\\textcolor{##df0030}{#1}");
N("\\green", "\\textcolor{##28ae7b}{#1}");
N("\\gray", "\\textcolor{gray}{#1}");
N("\\purple", "\\textcolor{##9d38bd}{#1}");
N("\\blueA", "\\textcolor{##ccfaff}{#1}");
N("\\blueB", "\\textcolor{##80f6ff}{#1}");
N("\\blueC", "\\textcolor{##63d9ea}{#1}");
N("\\blueD", "\\textcolor{##11accd}{#1}");
N("\\blueE", "\\textcolor{##0c7f99}{#1}");
N("\\tealA", "\\textcolor{##94fff5}{#1}");
N("\\tealB", "\\textcolor{##26edd5}{#1}");
N("\\tealC", "\\textcolor{##01d1c1}{#1}");
N("\\tealD", "\\textcolor{##01a995}{#1}");
N("\\tealE", "\\textcolor{##208170}{#1}");
N("\\greenA", "\\textcolor{##b6ffb0}{#1}");
N("\\greenB", "\\textcolor{##8af281}{#1}");
N("\\greenC", "\\textcolor{##74cf70}{#1}");
N("\\greenD", "\\textcolor{##1fab54}{#1}");
N("\\greenE", "\\textcolor{##0d923f}{#1}");
N("\\goldA", "\\textcolor{##ffd0a9}{#1}");
N("\\goldB", "\\textcolor{##ffbb71}{#1}");
N("\\goldC", "\\textcolor{##ff9c39}{#1}");
N("\\goldD", "\\textcolor{##e07d10}{#1}");
N("\\goldE", "\\textcolor{##a75a05}{#1}");
N("\\redA", "\\textcolor{##fca9a9}{#1}");
N("\\redB", "\\textcolor{##ff8482}{#1}");
N("\\redC", "\\textcolor{##f9685d}{#1}");
N("\\redD", "\\textcolor{##e84d39}{#1}");
N("\\redE", "\\textcolor{##bc2612}{#1}");
N("\\maroonA", "\\textcolor{##ffbde0}{#1}");
N("\\maroonB", "\\textcolor{##ff92c6}{#1}");
N("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
N("\\maroonD", "\\textcolor{##ca337c}{#1}");
N("\\maroonE", "\\textcolor{##9e034e}{#1}");
N("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
N("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
N("\\purpleC", "\\textcolor{##aa87ff}{#1}");
N("\\purpleD", "\\textcolor{##7854ab}{#1}");
N("\\purpleE", "\\textcolor{##543b78}{#1}");
N("\\mintA", "\\textcolor{##f5f9e8}{#1}");
N("\\mintB", "\\textcolor{##edf2df}{#1}");
N("\\mintC", "\\textcolor{##e0e5cc}{#1}");
N("\\grayA", "\\textcolor{##f6f7f7}{#1}");
N("\\grayB", "\\textcolor{##f0f1f2}{#1}");
N("\\grayC", "\\textcolor{##e3e5e6}{#1}");
N("\\grayD", "\\textcolor{##d6d8da}{#1}");
N("\\grayE", "\\textcolor{##babec2}{#1}");
N("\\grayF", "\\textcolor{##888d93}{#1}");
N("\\grayG", "\\textcolor{##626569}{#1}");
N("\\grayH", "\\textcolor{##3b3e40}{#1}");
N("\\grayI", "\\textcolor{##21242c}{#1}");
N("\\kaBlue", "\\textcolor{##314453}{#1}");
N("\\kaGreen", "\\textcolor{##71B307}{#1}");
var o7 = {
  "^": !0,
  // Parser.js
  _: !0,
  // Parser.js
  "\\limits": !0,
  // Parser.js
  "\\nolimits": !0
  // Parser.js
};
class VE {
  constructor(n, r, l) {
    this.settings = void 0, this.expansionCount = void 0, this.lexer = void 0, this.macros = void 0, this.stack = void 0, this.mode = void 0, this.settings = r, this.expansionCount = 0, this.feed(n), this.macros = new UE(jE, r.macros), this.mode = l, this.stack = [];
  }
  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(n) {
    this.lexer = new b3(n, this.settings);
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(n) {
    this.mode = n;
  }
  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }
  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }
  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    return this.stack.length === 0 && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1];
  }
  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    return this.future(), this.stack.pop();
  }
  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(n) {
    this.stack.push(n);
  }
  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(n) {
    this.stack.push(...n);
  }
  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(n) {
    var r, l, s;
    if (n) {
      if (this.consumeSpaces(), this.future().text !== "[")
        return null;
      r = this.popToken(), {
        tokens: s,
        end: l
      } = this.consumeArg(["]"]);
    } else
      ({
        tokens: s,
        start: r,
        end: l
      } = this.consumeArg());
    return this.pushToken(new Ln("EOF", l.loc)), this.pushTokens(s), new Ln("", wn.range(r, l));
  }
  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (; ; ) {
      var n = this.future();
      if (n.text === " ")
        this.stack.pop();
      else
        break;
    }
  }
  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(n) {
    var r = [], l = n && n.length > 0;
    l || this.consumeSpaces();
    var s = this.future(), u, c = 0, h = 0;
    do {
      if (u = this.popToken(), r.push(u), u.text === "{")
        ++c;
      else if (u.text === "}") {
        if (--c, c === -1)
          throw new we("Extra }", u);
      } else if (u.text === "EOF")
        throw new we("Unexpected end of input in a macro argument, expected '" + (n && l ? n[h] : "}") + "'", u);
      if (n && l)
        if ((c === 0 || c === 1 && n[h] === "{") && u.text === n[h]) {
          if (++h, h === n.length) {
            r.splice(-h, h);
            break;
          }
        } else
          h = 0;
    } while (c !== 0 || l);
    return s.text === "{" && r[r.length - 1].text === "}" && (r.pop(), r.shift()), r.reverse(), {
      tokens: r,
      start: s,
      end: u
    };
  }
  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(n, r) {
    if (r) {
      if (r.length !== n + 1)
        throw new we("The length of delimiters doesn't match the number of args!");
      for (var l = r[0], s = 0; s < l.length; s++) {
        var u = this.popToken();
        if (l[s] !== u.text)
          throw new we("Use of the macro doesn't match its definition", u);
      }
    }
    for (var c = [], h = 0; h < n; h++)
      c.push(this.consumeArg(r && r[h + 1]).tokens);
    return c;
  }
  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(n) {
    if (this.expansionCount += n, this.expansionCount > this.settings.maxExpand)
      throw new we("Too many expansions: infinite loop or need to increase maxExpand setting");
  }
  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(n) {
    var r = this.popToken(), l = r.text, s = r.noexpand ? null : this._getExpansion(l);
    if (s == null || n && s.unexpandable) {
      if (n && s == null && l[0] === "\\" && !this.isDefined(l))
        throw new we("Undefined control sequence: " + l);
      return this.pushToken(r), !1;
    }
    this.countExpansion(1);
    var u = s.tokens, c = this.consumeArgs(s.numArgs, s.delimiters);
    if (s.numArgs) {
      u = u.slice();
      for (var h = u.length - 1; h >= 0; --h) {
        var d = u[h];
        if (d.text === "#") {
          if (h === 0)
            throw new we("Incomplete placeholder at end of macro body", d);
          if (d = u[--h], d.text === "#")
            u.splice(h + 1, 1);
          else if (/^[1-9]$/.test(d.text))
            u.splice(h, 2, ...c[+d.text - 1]);
          else
            throw new we("Not a valid argument number", d);
        }
      }
    }
    return this.pushTokens(u), u.length;
  }
  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    return this.expandOnce(), this.future();
  }
  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (; ; )
      if (this.expandOnce() === !1) {
        var n = this.stack.pop();
        return n.treatAsRelax && (n.text = "\\relax"), n;
      }
    throw new Error();
  }
  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(n) {
    return this.macros.has(n) ? this.expandTokens([new Ln(n)]) : void 0;
  }
  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(n) {
    var r = [], l = this.stack.length;
    for (this.pushTokens(n); this.stack.length > l; )
      if (this.expandOnce(!0) === !1) {
        var s = this.stack.pop();
        s.treatAsRelax && (s.noexpand = !1, s.treatAsRelax = !1), r.push(s);
      }
    return this.countExpansion(r.length), r;
  }
  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(n) {
    var r = this.expandMacro(n);
    return r && r.map((l) => l.text).join("");
  }
  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(n) {
    var r = this.macros.get(n);
    if (r == null)
      return r;
    if (n.length === 1) {
      var l = this.lexer.catcodes[n];
      if (l != null && l !== 13)
        return;
    }
    var s = typeof r == "function" ? r(this) : r;
    if (typeof s == "string") {
      var u = 0;
      if (s.indexOf("#") !== -1)
        for (var c = s.replace(/##/g, ""); c.indexOf("#" + (u + 1)) !== -1; )
          ++u;
      for (var h = new b3(s, this.settings), d = [], p = h.lex(); p.text !== "EOF"; )
        d.push(p), p = h.lex();
      d.reverse();
      var g = {
        tokens: d,
        numArgs: u
      };
      return g;
    }
    return s;
  }
  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(n) {
    return this.macros.has(n) || Y0.hasOwnProperty(n) || mt.math.hasOwnProperty(n) || mt.text.hasOwnProperty(n) || o7.hasOwnProperty(n);
  }
  /**
   * Determine whether a command is expandable.
   */
  isExpandable(n) {
    var r = this.macros.get(n);
    return r != null ? typeof r == "string" || typeof r == "function" || !r.unexpandable : Y0.hasOwnProperty(n) && !Y0[n].primitive;
  }
}
var E3 = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, Io = Object.freeze({
  "₊": "+",
  "₋": "-",
  "₌": "=",
  "₍": "(",
  "₎": ")",
  "₀": "0",
  "₁": "1",
  "₂": "2",
  "₃": "3",
  "₄": "4",
  "₅": "5",
  "₆": "6",
  "₇": "7",
  "₈": "8",
  "₉": "9",
  "ₐ": "a",
  "ₑ": "e",
  "ₕ": "h",
  "ᵢ": "i",
  "ⱼ": "j",
  "ₖ": "k",
  "ₗ": "l",
  "ₘ": "m",
  "ₙ": "n",
  "ₒ": "o",
  "ₚ": "p",
  "ᵣ": "r",
  "ₛ": "s",
  "ₜ": "t",
  "ᵤ": "u",
  "ᵥ": "v",
  "ₓ": "x",
  "ᵦ": "β",
  "ᵧ": "γ",
  "ᵨ": "ρ",
  "ᵩ": "ϕ",
  "ᵪ": "χ",
  "⁺": "+",
  "⁻": "-",
  "⁼": "=",
  "⁽": "(",
  "⁾": ")",
  "⁰": "0",
  "¹": "1",
  "²": "2",
  "³": "3",
  "⁴": "4",
  "⁵": "5",
  "⁶": "6",
  "⁷": "7",
  "⁸": "8",
  "⁹": "9",
  "ᴬ": "A",
  "ᴮ": "B",
  "ᴰ": "D",
  "ᴱ": "E",
  "ᴳ": "G",
  "ᴴ": "H",
  "ᴵ": "I",
  "ᴶ": "J",
  "ᴷ": "K",
  "ᴸ": "L",
  "ᴹ": "M",
  "ᴺ": "N",
  "ᴼ": "O",
  "ᴾ": "P",
  "ᴿ": "R",
  "ᵀ": "T",
  "ᵁ": "U",
  "ⱽ": "V",
  "ᵂ": "W",
  "ᵃ": "a",
  "ᵇ": "b",
  "ᶜ": "c",
  "ᵈ": "d",
  "ᵉ": "e",
  "ᶠ": "f",
  "ᵍ": "g",
  ʰ: "h",
  "ⁱ": "i",
  ʲ: "j",
  "ᵏ": "k",
  ˡ: "l",
  "ᵐ": "m",
  ⁿ: "n",
  "ᵒ": "o",
  "ᵖ": "p",
  ʳ: "r",
  ˢ: "s",
  "ᵗ": "t",
  "ᵘ": "u",
  "ᵛ": "v",
  ʷ: "w",
  ˣ: "x",
  ʸ: "y",
  "ᶻ": "z",
  "ᵝ": "β",
  "ᵞ": "γ",
  "ᵟ": "δ",
  "ᵠ": "ϕ",
  "ᵡ": "χ",
  "ᶿ": "θ"
}), _1 = {
  "́": {
    text: "\\'",
    math: "\\acute"
  },
  "̀": {
    text: "\\`",
    math: "\\grave"
  },
  "̈": {
    text: '\\"',
    math: "\\ddot"
  },
  "̃": {
    text: "\\~",
    math: "\\tilde"
  },
  "̄": {
    text: "\\=",
    math: "\\bar"
  },
  "̆": {
    text: "\\u",
    math: "\\breve"
  },
  "̌": {
    text: "\\v",
    math: "\\check"
  },
  "̂": {
    text: "\\^",
    math: "\\hat"
  },
  "̇": {
    text: "\\.",
    math: "\\dot"
  },
  "̊": {
    text: "\\r",
    math: "\\mathring"
  },
  "̋": {
    text: "\\H"
  },
  "̧": {
    text: "\\c"
  }
}, M3 = {
  á: "á",
  à: "à",
  ä: "ä",
  ǟ: "ǟ",
  ã: "ã",
  ā: "ā",
  ă: "ă",
  ắ: "ắ",
  ằ: "ằ",
  ẵ: "ẵ",
  ǎ: "ǎ",
  â: "â",
  ấ: "ấ",
  ầ: "ầ",
  ẫ: "ẫ",
  ȧ: "ȧ",
  ǡ: "ǡ",
  å: "å",
  ǻ: "ǻ",
  ḃ: "ḃ",
  ć: "ć",
  ḉ: "ḉ",
  č: "č",
  ĉ: "ĉ",
  ċ: "ċ",
  ç: "ç",
  ď: "ď",
  ḋ: "ḋ",
  ḑ: "ḑ",
  é: "é",
  è: "è",
  ë: "ë",
  ẽ: "ẽ",
  ē: "ē",
  ḗ: "ḗ",
  ḕ: "ḕ",
  ĕ: "ĕ",
  ḝ: "ḝ",
  ě: "ě",
  ê: "ê",
  ế: "ế",
  ề: "ề",
  ễ: "ễ",
  ė: "ė",
  ȩ: "ȩ",
  ḟ: "ḟ",
  ǵ: "ǵ",
  ḡ: "ḡ",
  ğ: "ğ",
  ǧ: "ǧ",
  ĝ: "ĝ",
  ġ: "ġ",
  ģ: "ģ",
  ḧ: "ḧ",
  ȟ: "ȟ",
  ĥ: "ĥ",
  ḣ: "ḣ",
  ḩ: "ḩ",
  í: "í",
  ì: "ì",
  ï: "ï",
  ḯ: "ḯ",
  ĩ: "ĩ",
  ī: "ī",
  ĭ: "ĭ",
  ǐ: "ǐ",
  î: "î",
  ǰ: "ǰ",
  ĵ: "ĵ",
  ḱ: "ḱ",
  ǩ: "ǩ",
  ķ: "ķ",
  ĺ: "ĺ",
  ľ: "ľ",
  ļ: "ļ",
  ḿ: "ḿ",
  ṁ: "ṁ",
  ń: "ń",
  ǹ: "ǹ",
  ñ: "ñ",
  ň: "ň",
  ṅ: "ṅ",
  ņ: "ņ",
  ó: "ó",
  ò: "ò",
  ö: "ö",
  ȫ: "ȫ",
  õ: "õ",
  ṍ: "ṍ",
  ṏ: "ṏ",
  ȭ: "ȭ",
  ō: "ō",
  ṓ: "ṓ",
  ṑ: "ṑ",
  ŏ: "ŏ",
  ǒ: "ǒ",
  ô: "ô",
  ố: "ố",
  ồ: "ồ",
  ỗ: "ỗ",
  ȯ: "ȯ",
  ȱ: "ȱ",
  ő: "ő",
  ṕ: "ṕ",
  ṗ: "ṗ",
  ŕ: "ŕ",
  ř: "ř",
  ṙ: "ṙ",
  ŗ: "ŗ",
  ś: "ś",
  ṥ: "ṥ",
  š: "š",
  ṧ: "ṧ",
  ŝ: "ŝ",
  ṡ: "ṡ",
  ş: "ş",
  ẗ: "ẗ",
  ť: "ť",
  ṫ: "ṫ",
  ţ: "ţ",
  ú: "ú",
  ù: "ù",
  ü: "ü",
  ǘ: "ǘ",
  ǜ: "ǜ",
  ǖ: "ǖ",
  ǚ: "ǚ",
  ũ: "ũ",
  ṹ: "ṹ",
  ū: "ū",
  ṻ: "ṻ",
  ŭ: "ŭ",
  ǔ: "ǔ",
  û: "û",
  ů: "ů",
  ű: "ű",
  ṽ: "ṽ",
  ẃ: "ẃ",
  ẁ: "ẁ",
  ẅ: "ẅ",
  ŵ: "ŵ",
  ẇ: "ẇ",
  ẘ: "ẘ",
  ẍ: "ẍ",
  ẋ: "ẋ",
  ý: "ý",
  ỳ: "ỳ",
  ÿ: "ÿ",
  ỹ: "ỹ",
  ȳ: "ȳ",
  ŷ: "ŷ",
  ẏ: "ẏ",
  ẙ: "ẙ",
  ź: "ź",
  ž: "ž",
  ẑ: "ẑ",
  ż: "ż",
  Á: "Á",
  À: "À",
  Ä: "Ä",
  Ǟ: "Ǟ",
  Ã: "Ã",
  Ā: "Ā",
  Ă: "Ă",
  Ắ: "Ắ",
  Ằ: "Ằ",
  Ẵ: "Ẵ",
  Ǎ: "Ǎ",
  Â: "Â",
  Ấ: "Ấ",
  Ầ: "Ầ",
  Ẫ: "Ẫ",
  Ȧ: "Ȧ",
  Ǡ: "Ǡ",
  Å: "Å",
  Ǻ: "Ǻ",
  Ḃ: "Ḃ",
  Ć: "Ć",
  Ḉ: "Ḉ",
  Č: "Č",
  Ĉ: "Ĉ",
  Ċ: "Ċ",
  Ç: "Ç",
  Ď: "Ď",
  Ḋ: "Ḋ",
  Ḑ: "Ḑ",
  É: "É",
  È: "È",
  Ë: "Ë",
  Ẽ: "Ẽ",
  Ē: "Ē",
  Ḗ: "Ḗ",
  Ḕ: "Ḕ",
  Ĕ: "Ĕ",
  Ḝ: "Ḝ",
  Ě: "Ě",
  Ê: "Ê",
  Ế: "Ế",
  Ề: "Ề",
  Ễ: "Ễ",
  Ė: "Ė",
  Ȩ: "Ȩ",
  Ḟ: "Ḟ",
  Ǵ: "Ǵ",
  Ḡ: "Ḡ",
  Ğ: "Ğ",
  Ǧ: "Ǧ",
  Ĝ: "Ĝ",
  Ġ: "Ġ",
  Ģ: "Ģ",
  Ḧ: "Ḧ",
  Ȟ: "Ȟ",
  Ĥ: "Ĥ",
  Ḣ: "Ḣ",
  Ḩ: "Ḩ",
  Í: "Í",
  Ì: "Ì",
  Ï: "Ï",
  Ḯ: "Ḯ",
  Ĩ: "Ĩ",
  Ī: "Ī",
  Ĭ: "Ĭ",
  Ǐ: "Ǐ",
  Î: "Î",
  İ: "İ",
  Ĵ: "Ĵ",
  Ḱ: "Ḱ",
  Ǩ: "Ǩ",
  Ķ: "Ķ",
  Ĺ: "Ĺ",
  Ľ: "Ľ",
  Ļ: "Ļ",
  Ḿ: "Ḿ",
  Ṁ: "Ṁ",
  Ń: "Ń",
  Ǹ: "Ǹ",
  Ñ: "Ñ",
  Ň: "Ň",
  Ṅ: "Ṅ",
  Ņ: "Ņ",
  Ó: "Ó",
  Ò: "Ò",
  Ö: "Ö",
  Ȫ: "Ȫ",
  Õ: "Õ",
  Ṍ: "Ṍ",
  Ṏ: "Ṏ",
  Ȭ: "Ȭ",
  Ō: "Ō",
  Ṓ: "Ṓ",
  Ṑ: "Ṑ",
  Ŏ: "Ŏ",
  Ǒ: "Ǒ",
  Ô: "Ô",
  Ố: "Ố",
  Ồ: "Ồ",
  Ỗ: "Ỗ",
  Ȯ: "Ȯ",
  Ȱ: "Ȱ",
  Ő: "Ő",
  Ṕ: "Ṕ",
  Ṗ: "Ṗ",
  Ŕ: "Ŕ",
  Ř: "Ř",
  Ṙ: "Ṙ",
  Ŗ: "Ŗ",
  Ś: "Ś",
  Ṥ: "Ṥ",
  Š: "Š",
  Ṧ: "Ṧ",
  Ŝ: "Ŝ",
  Ṡ: "Ṡ",
  Ş: "Ş",
  Ť: "Ť",
  Ṫ: "Ṫ",
  Ţ: "Ţ",
  Ú: "Ú",
  Ù: "Ù",
  Ü: "Ü",
  Ǘ: "Ǘ",
  Ǜ: "Ǜ",
  Ǖ: "Ǖ",
  Ǚ: "Ǚ",
  Ũ: "Ũ",
  Ṹ: "Ṹ",
  Ū: "Ū",
  Ṻ: "Ṻ",
  Ŭ: "Ŭ",
  Ǔ: "Ǔ",
  Û: "Û",
  Ů: "Ů",
  Ű: "Ű",
  Ṽ: "Ṽ",
  Ẃ: "Ẃ",
  Ẁ: "Ẁ",
  Ẅ: "Ẅ",
  Ŵ: "Ŵ",
  Ẇ: "Ẇ",
  Ẍ: "Ẍ",
  Ẋ: "Ẋ",
  Ý: "Ý",
  Ỳ: "Ỳ",
  Ÿ: "Ÿ",
  Ỹ: "Ỹ",
  Ȳ: "Ȳ",
  Ŷ: "Ŷ",
  Ẏ: "Ẏ",
  Ź: "Ź",
  Ž: "Ž",
  Ẑ: "Ẑ",
  Ż: "Ż",
  ά: "ά",
  ὰ: "ὰ",
  ᾱ: "ᾱ",
  ᾰ: "ᾰ",
  έ: "έ",
  ὲ: "ὲ",
  ή: "ή",
  ὴ: "ὴ",
  ί: "ί",
  ὶ: "ὶ",
  ϊ: "ϊ",
  ΐ: "ΐ",
  ῒ: "ῒ",
  ῑ: "ῑ",
  ῐ: "ῐ",
  ό: "ό",
  ὸ: "ὸ",
  ύ: "ύ",
  ὺ: "ὺ",
  ϋ: "ϋ",
  ΰ: "ΰ",
  ῢ: "ῢ",
  ῡ: "ῡ",
  ῠ: "ῠ",
  ώ: "ώ",
  ὼ: "ὼ",
  Ύ: "Ύ",
  Ὺ: "Ὺ",
  Ϋ: "Ϋ",
  Ῡ: "Ῡ",
  Ῠ: "Ῠ",
  Ώ: "Ώ",
  Ὼ: "Ὼ"
};
class Hu {
  constructor(n, r) {
    this.mode = void 0, this.gullet = void 0, this.settings = void 0, this.leftrightDepth = void 0, this.nextToken = void 0, this.mode = "math", this.gullet = new VE(n, r, this.mode), this.settings = r, this.leftrightDepth = 0;
  }
  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(n, r) {
    if (r === void 0 && (r = !0), this.fetch().text !== n)
      throw new we("Expected '" + n + "', got '" + this.fetch().text + "'", this.fetch());
    r && this.consume();
  }
  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }
  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    return this.nextToken == null && (this.nextToken = this.gullet.expandNextToken()), this.nextToken;
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(n) {
    this.mode = n, this.gullet.switchMode(n);
  }
  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    this.settings.globalGroup || this.gullet.beginGroup(), this.settings.colorIsTextColor && this.gullet.macros.set("\\color", "\\textcolor");
    try {
      var n = this.parseExpression(!1);
      return this.expect("EOF"), this.settings.globalGroup || this.gullet.endGroup(), n;
    } finally {
      this.gullet.endGroups();
    }
  }
  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(n) {
    var r = this.nextToken;
    this.consume(), this.gullet.pushToken(new Ln("}")), this.gullet.pushTokens(n);
    var l = this.parseExpression(!1);
    return this.expect("}"), this.nextToken = r, l;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence han infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(n, r) {
    for (var l = []; ; ) {
      this.mode === "math" && this.consumeSpaces();
      var s = this.fetch();
      if (Hu.endOfExpression.indexOf(s.text) !== -1 || r && s.text === r || n && Y0[s.text] && Y0[s.text].infix)
        break;
      var u = this.parseAtom(r);
      if (u) {
        if (u.type === "internal")
          continue;
      } else break;
      l.push(u);
    }
    return this.mode === "text" && this.formLigatures(l), this.handleInfixNodes(l);
  }
  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(n) {
    for (var r = -1, l, s = 0; s < n.length; s++)
      if (n[s].type === "infix") {
        if (r !== -1)
          throw new we("only one infix operator per group", n[s].token);
        r = s, l = n[s].replaceWith;
      }
    if (r !== -1 && l) {
      var u, c, h = n.slice(0, r), d = n.slice(r + 1);
      h.length === 1 && h[0].type === "ordgroup" ? u = h[0] : u = {
        type: "ordgroup",
        mode: this.mode,
        body: h
      }, d.length === 1 && d[0].type === "ordgroup" ? c = d[0] : c = {
        type: "ordgroup",
        mode: this.mode,
        body: d
      };
      var p;
      return l === "\\\\abovefrac" ? p = this.callFunction(l, [u, n[r], c], []) : p = this.callFunction(l, [u, c], []), [p];
    } else
      return n;
  }
  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(n) {
    var r = this.fetch(), l = r.text;
    this.consume(), this.consumeSpaces();
    var s;
    do {
      var u;
      s = this.parseGroup(n);
    } while (((u = s) == null ? void 0 : u.type) === "internal");
    if (!s)
      throw new we("Expected group after '" + l + "'", r);
    return s;
  }
  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(n) {
    for (var r = [], l = 0; l < n.length; l++)
      r.push({
        type: "textord",
        mode: "text",
        text: n[l]
      });
    var s = {
      type: "text",
      mode: this.mode,
      body: r
    }, u = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [s]
    };
    return u;
  }
  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(n) {
    var r = this.parseGroup("atom", n);
    if (r?.type === "internal" || this.mode === "text")
      return r;
    for (var l, s; ; ) {
      this.consumeSpaces();
      var u = this.fetch();
      if (u.text === "\\limits" || u.text === "\\nolimits") {
        if (r && r.type === "op") {
          var c = u.text === "\\limits";
          r.limits = c, r.alwaysHandleSupSub = !0;
        } else if (r && r.type === "operatorname")
          r.alwaysHandleSupSub && (r.limits = u.text === "\\limits");
        else
          throw new we("Limit controls must follow a math operator", u);
        this.consume();
      } else if (u.text === "^") {
        if (l)
          throw new we("Double superscript", u);
        l = this.handleSupSubscript("superscript");
      } else if (u.text === "_") {
        if (s)
          throw new we("Double subscript", u);
        s = this.handleSupSubscript("subscript");
      } else if (u.text === "'") {
        if (l)
          throw new we("Double superscript", u);
        var h = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        }, d = [h];
        for (this.consume(); this.fetch().text === "'"; )
          d.push(h), this.consume();
        this.fetch().text === "^" && d.push(this.handleSupSubscript("superscript")), l = {
          type: "ordgroup",
          mode: this.mode,
          body: d
        };
      } else if (Io[u.text]) {
        var p = E3.test(u.text), g = [];
        for (g.push(new Ln(Io[u.text])), this.consume(); ; ) {
          var y = this.fetch().text;
          if (!Io[y] || E3.test(y) !== p)
            break;
          g.unshift(new Ln(Io[y])), this.consume();
        }
        var x = this.subparse(g);
        p ? s = {
          type: "ordgroup",
          mode: "math",
          body: x
        } : l = {
          type: "ordgroup",
          mode: "math",
          body: x
        };
      } else
        break;
    }
    return l || s ? {
      type: "supsub",
      mode: this.mode,
      base: r,
      sup: l,
      sub: s
    } : r;
  }
  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(n, r) {
    var l = this.fetch(), s = l.text, u = Y0[s];
    if (!u)
      return null;
    if (this.consume(), r && r !== "atom" && !u.allowedInArgument)
      throw new we("Got function '" + s + "' with no arguments" + (r ? " as " + r : ""), l);
    if (this.mode === "text" && !u.allowedInText)
      throw new we("Can't use function '" + s + "' in text mode", l);
    if (this.mode === "math" && u.allowedInMath === !1)
      throw new we("Can't use function '" + s + "' in math mode", l);
    var {
      args: c,
      optArgs: h
    } = this.parseArguments(s, u);
    return this.callFunction(s, c, h, l, n);
  }
  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(n, r, l, s, u) {
    var c = {
      funcName: n,
      parser: this,
      token: s,
      breakOnTokenText: u
    }, h = Y0[n];
    if (h && h.handler)
      return h.handler(c, r, l);
    throw new we("No function handler for " + n);
  }
  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(n, r) {
    var l = r.numArgs + r.numOptionalArgs;
    if (l === 0)
      return {
        args: [],
        optArgs: []
      };
    for (var s = [], u = [], c = 0; c < l; c++) {
      var h = r.argTypes && r.argTypes[c], d = c < r.numOptionalArgs;
      (r.primitive && h == null || // \sqrt expands into primitive if optional argument doesn't exist
      r.type === "sqrt" && c === 1 && u[0] == null) && (h = "primitive");
      var p = this.parseGroupOfType("argument to '" + n + "'", h, d);
      if (d)
        u.push(p);
      else if (p != null)
        s.push(p);
      else
        throw new we("Null argument, please report this as a bug");
    }
    return {
      args: s,
      optArgs: u
    };
  }
  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(n, r, l) {
    switch (r) {
      case "color":
        return this.parseColorGroup(l);
      case "size":
        return this.parseSizeGroup(l);
      case "url":
        return this.parseUrlGroup(l);
      case "math":
      case "text":
        return this.parseArgumentGroup(l, r);
      case "hbox": {
        var s = this.parseArgumentGroup(l, "text");
        return s != null ? {
          type: "styling",
          mode: s.mode,
          body: [s],
          style: "text"
          // simulate \textstyle
        } : null;
      }
      case "raw": {
        var u = this.parseStringGroup("raw", l);
        return u != null ? {
          type: "raw",
          mode: "text",
          string: u.text
        } : null;
      }
      case "primitive": {
        if (l)
          throw new we("A primitive argument cannot be optional");
        var c = this.parseGroup(n);
        if (c == null)
          throw new we("Expected group as " + n, this.fetch());
        return c;
      }
      case "original":
      case null:
      case void 0:
        return this.parseArgumentGroup(l);
      default:
        throw new we("Unknown group type as " + n, this.fetch());
    }
  }
  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    for (; this.fetch().text === " "; )
      this.consume();
  }
  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(n, r) {
    var l = this.gullet.scanArgument(r);
    if (l == null)
      return null;
    for (var s = "", u; (u = this.fetch()).text !== "EOF"; )
      s += u.text, this.consume();
    return this.consume(), l.text = s, l;
  }
  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(n, r) {
    for (var l = this.fetch(), s = l, u = "", c; (c = this.fetch()).text !== "EOF" && n.test(u + c.text); )
      s = c, u += s.text, this.consume();
    if (u === "")
      throw new we("Invalid " + r + ": '" + l.text + "'", l);
    return l.range(s, u);
  }
  /**
   * Parses a color description.
   */
  parseColorGroup(n) {
    var r = this.parseStringGroup("color", n);
    if (r == null)
      return null;
    var l = /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);
    if (!l)
      throw new we("Invalid color: '" + r.text + "'", r);
    var s = l[0];
    return /^[0-9a-f]{6}$/i.test(s) && (s = "#" + s), {
      type: "color-token",
      mode: this.mode,
      color: s
    };
  }
  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(n) {
    var r, l = !1;
    if (this.gullet.consumeSpaces(), !n && this.gullet.future().text !== "{" ? r = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size") : r = this.parseStringGroup("size", n), !r)
      return null;
    !n && r.text.length === 0 && (r.text = "0pt", l = !0);
    var s = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);
    if (!s)
      throw new we("Invalid size: '" + r.text + "'", r);
    var u = {
      number: +(s[1] + s[2]),
      // sign + magnitude, cast to number
      unit: s[3]
    };
    if (!vp(u))
      throw new we("Invalid unit: '" + u.unit + "'", r);
    return {
      type: "size",
      mode: this.mode,
      value: u,
      isBlank: l
    };
  }
  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(n) {
    this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12);
    var r = this.parseStringGroup("url", n);
    if (this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), r == null)
      return null;
    var l = r.text.replace(/\\([#$%&~_^{}])/g, "$1");
    return {
      type: "url",
      mode: this.mode,
      url: l
    };
  }
  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(n, r) {
    var l = this.gullet.scanArgument(n);
    if (l == null)
      return null;
    var s = this.mode;
    r && this.switchMode(r), this.gullet.beginGroup();
    var u = this.parseExpression(!1, "EOF");
    this.expect("EOF"), this.gullet.endGroup();
    var c = {
      type: "ordgroup",
      mode: this.mode,
      loc: l.loc,
      body: u
    };
    return r && this.switchMode(s), c;
  }
  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(n, r) {
    var l = this.fetch(), s = l.text, u;
    if (s === "{" || s === "\\begingroup") {
      this.consume();
      var c = s === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      var h = this.parseExpression(!1, c), d = this.fetch();
      this.expect(c), this.gullet.endGroup(), u = {
        type: "ordgroup",
        mode: this.mode,
        loc: wn.range(l, d),
        body: h,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: s === "\\begingroup" || void 0
      };
    } else if (u = this.parseFunction(r, n) || this.parseSymbol(), u == null && s[0] === "\\" && !o7.hasOwnProperty(s)) {
      if (this.settings.throwOnError)
        throw new we("Undefined control sequence: " + s, l);
      u = this.formatUnsupportedCmd(s), this.consume();
    }
    return u;
  }
  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(n) {
    for (var r = n.length - 1, l = 0; l < r; ++l) {
      var s = n[l], u = s.text;
      u === "-" && n[l + 1].text === "-" && (l + 1 < r && n[l + 2].text === "-" ? (n.splice(l, 3, {
        type: "textord",
        mode: "text",
        loc: wn.range(s, n[l + 2]),
        text: "---"
      }), r -= 2) : (n.splice(l, 2, {
        type: "textord",
        mode: "text",
        loc: wn.range(s, n[l + 1]),
        text: "--"
      }), r -= 1)), (u === "'" || u === "`") && n[l + 1].text === u && (n.splice(l, 2, {
        type: "textord",
        mode: "text",
        loc: wn.range(s, n[l + 1]),
        text: u + u
      }), r -= 1);
    }
  }
  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    var n = this.fetch(), r = n.text;
    if (/^\\verb[^a-zA-Z]/.test(r)) {
      this.consume();
      var l = r.slice(5), s = l.charAt(0) === "*";
      if (s && (l = l.slice(1)), l.length < 2 || l.charAt(0) !== l.slice(-1))
        throw new we(`\\verb assertion failed --
                    please report what input caused this bug`);
      return l = l.slice(1, -1), {
        type: "verb",
        mode: "text",
        body: l,
        star: s
      };
    }
    M3.hasOwnProperty(r[0]) && !mt[this.mode][r[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + r[0] + '" used in math mode', n), r = M3[r[0]] + r.slice(1));
    var u = LE.exec(r);
    u && (r = r.substring(0, u.index), r === "i" ? r = "ı" : r === "j" && (r = "ȷ"));
    var c;
    if (mt[this.mode][r]) {
      this.settings.strict && this.mode === "math" && eh.indexOf(r) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + r[0] + '" used in math mode', n);
      var h = mt[this.mode][r].group, d = wn.range(n), p;
      if (Nw.hasOwnProperty(h)) {
        var g = h;
        p = {
          type: "atom",
          mode: this.mode,
          family: g,
          loc: d,
          text: r
        };
      } else
        p = {
          type: h,
          mode: this.mode,
          loc: d,
          text: r
        };
      c = p;
    } else if (r.charCodeAt(0) >= 128)
      this.settings.strict && (yp(r.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + r[0] + '" used in math mode', n) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + r[0] + '"' + (" (" + r.charCodeAt(0) + ")"), n)), c = {
        type: "textord",
        mode: "text",
        loc: wn.range(n),
        text: r
      };
    else
      return null;
    if (this.consume(), u)
      for (var y = 0; y < u[0].length; y++) {
        var x = u[0][y];
        if (!_1[x])
          throw new we("Unknown accent ' " + x + "'", n);
        var w = _1[x][this.mode] || _1[x].text;
        if (!w)
          throw new we("Accent " + x + " unsupported in " + this.mode + " mode", n);
        c = {
          type: "accent",
          mode: this.mode,
          loc: wn.range(n),
          label: w,
          isStretchy: !1,
          isShifty: !0,
          // $FlowFixMe
          base: c
        };
      }
    return c;
  }
}
Hu.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
var Jh = function(n, r) {
  if (!(typeof n == "string" || n instanceof String))
    throw new TypeError("KaTeX can only parse string typed expression");
  var l = new Hu(n, r);
  delete l.gullet.macros.current["\\df@tag"];
  var s = l.parse();
  if (delete l.gullet.macros.current["\\current@color"], delete l.gullet.macros.current["\\color"], l.gullet.macros.get("\\df@tag")) {
    if (!r.displayMode)
      throw new we("\\tag works only in display equations");
    s = [{
      type: "tag",
      mode: "text",
      body: s,
      tag: l.subparse([new Ln("\\df@tag")])
    }];
  }
  return s;
}, u7 = function(n, r, l) {
  r.textContent = "";
  var s = Wh(n, l).toNode();
  r.appendChild(s);
};
typeof document < "u" && document.compatMode !== "CSS1Compat" && (typeof console < "u" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."), u7 = function() {
  throw new we("KaTeX doesn't work in quirks mode.");
});
var YE = function(n, r) {
  var l = Wh(n, r).toMarkup();
  return l;
}, GE = function(n, r) {
  var l = new Rh(r);
  return Jh(n, l);
}, c7 = function(n, r, l) {
  if (l.throwOnError || !(n instanceof we))
    throw n;
  var s = P.makeSpan(["katex-error"], [new ta(r)]);
  return s.setAttribute("title", n.toString()), s.setAttribute("style", "color:" + l.errorColor), s;
}, Wh = function(n, r) {
  var l = new Rh(r);
  try {
    var s = Jh(n, l);
    return Ww(s, n, l);
  } catch (u) {
    return c7(u, n, l);
  }
}, XE = function(n, r) {
  var l = new Rh(r);
  try {
    var s = Jh(n, l);
    return Pw(s, n, l);
  } catch (u) {
    return c7(u, n, l);
  }
}, $E = "0.16.27", ZE = {
  Span: ts,
  Anchor: Hh,
  SymbolNode: ta,
  SvgNode: r0,
  PathNode: K0,
  LineNode: P1
}, FE = {
  /**
   * Current KaTeX version
   */
  version: $E,
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render: u7,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString: YE,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError: we,
  /**
   * The schema of Settings
   */
  SETTINGS_SCHEMA: tu,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: GE,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: Wh,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: XE,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: Sw,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: v,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: Ce,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: N,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: These methods are not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree: ZE
};
const Lu = ({
  latex: e,
  className: n = "",
  autoScale: r = !0,
  onError: l,
  align: s = "center",
  displayMode: u = !1
}) => {
  const c = B.useRef(null), h = B.useRef(null), [d, p] = B.useState(null), [g, y] = B.useState(1);
  if (B.useEffect(() => {
    if (h.current)
      try {
        p(null), FE.render(e, h.current, {
          throwOnError: !0,
          displayMode: u,
          output: "html"
        });
      } catch (w) {
        const z = w instanceof Error ? w.message : "Invalid LaTeX syntax";
        p(z), l && l(z);
      }
  }, [e, l, u]), B.useEffect(() => {
    if (!r || !c.current || !h.current || d) {
      y(1);
      return;
    }
    const w = c.current, z = h.current, M = w.getBoundingClientRect(), A = z.getBoundingClientRect();
    if (A.width === 0 || A.height === 0) {
      y(1);
      return;
    }
    const T = M.width / A.width, R = M.height / A.height, q = Math.min(1, T, R);
    y(q);
  }, [e, r, d]), d)
    return /* @__PURE__ */ O.jsx(
      "div",
      {
        ref: c,
        className: `latex-renderer latex-renderer-error ${n}`,
        style: { color: "red", fontSize: "0.8em" },
        children: /* @__PURE__ */ O.jsx("span", { children: "Invalid LaTeX" })
      }
    );
  const x = s === "left" ? "flex-start" : s === "right" ? "flex-end" : "center";
  return /* @__PURE__ */ O.jsx(
    "div",
    {
      ref: c,
      className: `latex-renderer ${n}`,
      style: {
        display: "flex",
        alignItems: "center",
        justifyContent: x,
        overflow: "hidden",
        width: "100%",
        height: "100%"
      },
      children: /* @__PURE__ */ O.jsx(
        "span",
        {
          ref: h,
          className: "katex-content",
          style: {
            transform: `scale(${g})`,
            transformOrigin: "center",
            transition: "transform 0.1s ease-out"
          }
        }
      )
    }
  );
};
function IE({ blockId: e, initialLabel: n, onUpdate: r }) {
  const [l, s] = B.useState(n), [u, c] = B.useState(n), h = B.useRef(null), d = B.useRef(n);
  B.useLayoutEffect(() => {
    d.current = l;
  }, [l]), B.useEffect(() => {
    s(n), c(n);
  }, [n]);
  const p = (z) => z.replace(/[\n\t]/g, " ").trim(), g = (z) => {
    s(z.target.value);
  }, y = () => {
    const z = p(d.current);
    r(e, "label", z), c(z), s(z);
  }, x = (z) => {
    z.key === "Enter" ? (z.preventDefault(), y(), h.current?.blur()) : z.key === "Escape" && (s(u), h.current?.blur());
  }, w = () => {
    y();
  };
  return /* @__PURE__ */ O.jsxs("div", { className: "mb-3 pb-3 border-b border-gray-200 flex items-center gap-2", children: [
    /* @__PURE__ */ O.jsx(
      "label",
      {
        htmlFor: `label-${e}`,
        className: "text-xs font-medium text-gray-700 whitespace-nowrap",
        children: "Label:"
      }
    ),
    /* @__PURE__ */ O.jsx(
      "input",
      {
        ref: h,
        id: `label-${e}`,
        type: "text",
        value: l,
        onChange: g,
        onKeyDown: x,
        onBlur: w,
        className: "flex-1 px-2 py-1 text-xs border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500",
        placeholder: e
      }
    )
  ] });
}
const oa = 20, KE = 50, rn = 20;
function QE(e, n, r) {
  const l = Math.min(e.x, n.x), s = Math.max(e.x, n.x), u = Math.min(e.y, n.y), c = Math.max(e.y, n.y), h = r.x, d = r.x + r.width, p = r.y, g = r.y + r.height;
  if (e.y === n.y) {
    const y = e.y;
    return !(y <= p || y >= g || s <= h || l >= d);
  }
  if (e.x === n.x) {
    const y = e.x;
    return !(y <= h || y >= d || c <= p || u >= g);
  }
  return !1;
}
function ih(e, n, r) {
  for (const l of r)
    if (QE(e, n, l))
      return !0;
  return !1;
}
function JE(e, n) {
  switch (n) {
    case he.Right:
      return { x: e.x + oa, y: e.y };
    case he.Left:
      return { x: e.x - oa, y: e.y };
    case he.Bottom:
      return { x: e.x, y: e.y + oa };
    case he.Top:
      return { x: e.x, y: e.y - oa };
    default:
      return e;
  }
}
function WE(e, n) {
  switch (n) {
    case he.Left:
      return { x: e.x - oa, y: e.y };
    case he.Right:
      return { x: e.x + oa, y: e.y };
    case he.Top:
      return { x: e.x, y: e.y - oa };
    case he.Bottom:
      return { x: e.x, y: e.y + oa };
    default:
      return e;
  }
}
function PE(e, n, r, l, s, u) {
  const c = (x, w) => `${x.id}:${w}`, h = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), p = [], g = s, y = c(n, g);
  for (h.set(y, 0), p.push({ node: n, direction: g, distance: 0 }); p.length > 0; ) {
    p.sort((M, A) => M.distance - A.distance);
    const x = p.shift(), w = c(x.node, x.direction);
    if (h.has(w) && h.get(w) < x.distance)
      continue;
    if (x.node.id === r.id) {
      const M = [];
      let A = {
        node: x.node,
        direction: x.direction
      };
      for (; A; ) {
        M.unshift(A.node);
        const T = c(A.node, A.direction);
        A = d.get(T);
      }
      return M;
    }
    const z = e.get(x.node.id) || [];
    for (const M of z) {
      const A = M.orientation, T = x.direction !== "start" && x.direction !== A ? l : 0, R = M.to.id === r.id && u && A !== u ? l : 0, q = x.distance + M.distance + T + R, H = c(M.to, A);
      (!h.has(H) || q < h.get(H)) && (h.set(H, q), d.set(H, { node: x.node, direction: x.direction }), p.push({ node: M.to, direction: A, distance: q }));
    }
  }
  return [];
}
function eM(e) {
  if (e.length < 2)
    return [];
  const n = [];
  for (let r = 0; r < e.length - 1; r++) {
    const l = e[r].point, s = e[r + 1].point, u = l.y === s.y ? "horizontal" : "vertical";
    n.push({ from: l, to: s, orientation: u });
  }
  return n;
}
function tM(e, n) {
  if (e.orientation !== n.orientation) return !1;
  if (e.orientation === "horizontal") {
    const r = e.to.x - e.from.x, l = n.to.x - n.from.x;
    return r > 0 && l > 0 || r < 0 && l < 0;
  } else {
    const r = e.to.y - e.from.y, l = n.to.y - n.from.y;
    return r > 0 && l > 0 || r < 0 && l < 0;
  }
}
function nM(e) {
  if (e.length <= 1) return e;
  const n = [];
  let r = e[0];
  for (let l = 1; l < e.length; l++) {
    const s = e[l];
    tM(r, s) ? r = { from: r.from, to: s.to, orientation: r.orientation } : (n.push(r), r = s);
  }
  return n.push(r), n;
}
function aM(e, n) {
  if (e.length !== 3) return e;
  const [r, l, s] = e;
  if (r.orientation === "horizontal" && l.orientation === "vertical" && s.orientation === "horizontal") {
    const u = l.from.x, c = r.from.x, h = s.to.x, d = (c + h) / 2;
    if (Math.abs(u - d) < 5) return e;
    const p = r.to.x - r.from.x, g = d - r.from.x, y = s.to.x - s.from.x, x = s.to.x - d;
    if (p > 0 && g <= 0 || p < 0 && g >= 0 || y > 0 && x <= 0 || y < 0 && x >= 0)
      return e;
    const w = {
      from: r.from,
      to: { x: d, y: r.from.y },
      orientation: "horizontal"
    }, z = {
      from: { x: d, y: r.from.y },
      to: { x: d, y: s.to.y },
      orientation: "vertical"
    }, M = {
      from: { x: d, y: s.to.y },
      to: s.to,
      orientation: "horizontal"
    };
    if (!ih(z.from, z.to, n))
      return [w, z, M];
  }
  if (r.orientation === "vertical" && l.orientation === "horizontal" && s.orientation === "vertical") {
    const u = l.from.y, c = r.from.y, h = s.to.y, d = (c + h) / 2;
    if (Math.abs(u - d) < 5) return e;
    const p = r.to.y - r.from.y, g = d - r.from.y, y = s.to.y - s.from.y, x = s.to.y - d;
    if (p > 0 && g <= 0 || p < 0 && g >= 0 || y > 0 && x <= 0 || y < 0 && x >= 0)
      return e;
    const w = {
      from: r.from,
      to: { x: r.from.x, y: d },
      orientation: "vertical"
    }, z = {
      from: { x: r.from.x, y: d },
      to: { x: s.to.x, y: d },
      orientation: "horizontal"
    }, M = {
      from: { x: s.to.x, y: d },
      to: s.to,
      orientation: "vertical"
    };
    if (!ih(z.from, z.to, n))
      return [w, z, M];
  }
  return e;
}
function rM(e, n, r, l, s, u, c) {
  const h = vu(r) ? "horizontal" : "vertical", d = vu(l) ? "horizontal" : "vertical", p = sM(
    e,
    n,
    r,
    l,
    s,
    u,
    c
  );
  if (p.length < 2)
    return [];
  const g = p.find((T) => T.type === "source"), y = p.find((T) => T.type === "target");
  if (!g || !y)
    return [];
  const x = oM(
    p,
    s,
    g,
    y,
    r,
    l
  ), w = PE(
    x,
    g,
    y,
    KE,
    h,
    d
  );
  if (w.length === 0)
    return [];
  const z = eM(w), M = nM(z);
  return aM(M, s);
}
function lM(e, n, r) {
  const l = Ph(r, oa);
  switch (n) {
    case he.Right:
      return { x: Math.max(l.x + l.width, e.x + rn), y: e.y };
    case he.Left:
      return { x: Math.min(l.x, e.x - rn), y: e.y };
    case he.Bottom:
      return { x: e.x, y: Math.max(l.y + l.height, e.y + rn) };
    case he.Top:
      return { x: e.x, y: Math.min(l.y, e.y - rn) };
    default:
      return e;
  }
}
function iM(e, n, r) {
  const l = Ph(r, oa);
  switch (n) {
    case he.Left:
      return { x: Math.min(l.x, e.x - rn), y: e.y };
    case he.Right:
      return { x: Math.max(l.x + l.width, e.x + rn), y: e.y };
    case he.Top:
      return { x: e.x, y: Math.min(l.y, e.y - rn) };
    case he.Bottom:
      return { x: e.x, y: Math.max(l.y + l.height, e.y + rn) };
    default:
      return e;
  }
}
function sM(e, n, r, l, s, u, c) {
  const h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
  h.add(e.x), d.add(e.y), h.add(n.x), d.add(n.y);
  const p = (e.x + n.x) / 2, g = (e.y + n.y) / 2;
  h.add(p), d.add(g);
  const y = JE(e, r), x = WE(n, l);
  if (h.add(y.x), d.add(y.y), h.add(x.x), d.add(x.y), u) {
    const T = lM(e, r, u);
    h.add(T.x), d.add(T.y);
  }
  if (c) {
    const T = iM(n, l, c);
    h.add(T.x), d.add(T.y);
  }
  for (const T of s) {
    const R = Ph(T, oa);
    h.add(R.x), h.add(R.x + R.width), d.add(R.y), d.add(R.y + R.height);
  }
  const w = [];
  let z = 0;
  const M = Array.from(h), A = Array.from(d);
  for (const T of M)
    for (const R of A) {
      let q = "corner";
      T === e.x && R === e.y ? q = "source" : T === n.x && R === n.y && (q = "target"), w.push({
        id: `node_${z++}`,
        point: { x: T, y: R },
        type: q
      });
    }
  return w;
}
function oM(e, n, r, l, s, u) {
  const c = /* @__PURE__ */ new Map(), h = n.findIndex((p) => T3(r.point, p)), d = n.findIndex((p) => T3(l.point, p));
  for (const p of e)
    c.set(p.id, []);
  for (let p = 0; p < e.length; p++)
    for (let g = p + 1; g < e.length; g++) {
      const y = e[p], x = e[g], w = y.point.y === x.point.y, z = y.point.x === x.point.x;
      if (!w && !z)
        continue;
      const M = Math.abs(y.point.x - x.point.x) + Math.abs(y.point.y - x.point.y), A = w ? "horizontal" : "vertical", T = y.id !== r.id || z3(y.point, x.point, s) && A3(y.point, x.point, s, rn), R = x.id !== r.id || z3(x.point, y.point, s) && A3(x.point, y.point, s, rn), q = y.id !== l.id || N3(x.point, y.point, u) && C3(x.point, y.point, u, rn), H = x.id !== l.id || N3(y.point, x.point, u) && C3(y.point, x.point, u, rn), $ = y.id === r.id || x.id === r.id, V = y.id === l.id || x.id === l.id, Q = n.filter((re, te) => !($ && te === h || V && te === d));
      ih(y.point, x.point, Q) || (T && H && c.get(y.id).push({ to: x, distance: M, orientation: A }), R && q && c.get(x.id).push({ to: y, distance: M, orientation: A }));
    }
  return c;
}
function T3(e, n) {
  return e.x >= n.x && e.x <= n.x + n.width && e.y >= n.y && e.y <= n.y + n.height;
}
function z3(e, n, r) {
  switch (r) {
    case he.Right:
      return n.x > e.x;
    // Must go right
    case he.Left:
      return n.x < e.x;
    // Must go left
    case he.Bottom:
      return n.y > e.y;
    // Must go down
    case he.Top:
      return n.y < e.y;
    // Must go up
    default:
      return !0;
  }
}
function A3(e, n, r, l) {
  switch (r) {
    case he.Right:
      return n.x - e.x >= l;
    case he.Left:
      return e.x - n.x >= l;
    case he.Bottom:
      return n.y - e.y >= l;
    case he.Top:
      return e.y - n.y >= l;
    default:
      return !0;
  }
}
function C3(e, n, r, l) {
  switch (r) {
    case he.Left:
      return n.x - e.x >= l;
    // Approach from left
    case he.Right:
      return e.x - n.x >= l;
    // Approach from right
    case he.Top:
      return n.y - e.y >= l;
    // Approach from above
    case he.Bottom:
      return e.y - n.y >= l;
    // Approach from below
    default:
      return !0;
  }
}
function N3(e, n, r) {
  switch (r) {
    case he.Left:
      return e.x < n.x;
    // Must approach from left (from.x < to.x)
    case he.Right:
      return e.x > n.x;
    // Must approach from right
    case he.Top:
      return e.y < n.y;
    // Must approach from above
    case he.Bottom:
      return e.y > n.y;
    // Must approach from below
    default:
      return !0;
  }
}
function Ph(e, n) {
  return {
    x: e.x - n,
    y: e.y - n,
    width: e.width + 2 * n,
    height: e.height + 2 * n
  };
}
function k3(e) {
  return e.filter((r) => Math.abs(r.to.x - r.from.x) + Math.abs(r.to.y - r.from.y) >= 1);
}
function Ko(e, n) {
  const r = n.x - e.x, l = n.y - e.y;
  if (r === 0 && l === 0)
    return [];
  if (l === 0)
    return [{ from: e, to: n, orientation: "horizontal" }];
  if (r === 0)
    return [{ from: e, to: n, orientation: "vertical" }];
  const s = Math.abs(r), u = Math.abs(l);
  if (s > u) {
    const c = { x: n.x, y: e.y };
    return [
      { from: e, to: c, orientation: "horizontal" },
      { from: c, to: n, orientation: "vertical" }
    ];
  } else {
    const c = { x: e.x, y: n.y };
    return [
      { from: e, to: c, orientation: "vertical" },
      { from: c, to: n, orientation: "horizontal" }
    ];
  }
}
function vu(e) {
  return e === he.Left || e === he.Right;
}
function xu(e, n, r) {
  switch (n) {
    case he.Right:
      return { x: e.x + r, y: e.y };
    case he.Left:
      return { x: e.x - r, y: e.y };
    case he.Top:
      return { x: e.x, y: e.y - r };
    case he.Bottom:
      return { x: e.x, y: e.y + r };
    default:
      return e;
  }
}
function uM(e, n, r, l, s, u, c, h) {
  if (console.log("[calculateOrthogonalPath] Called with:", {
    source: e,
    target: n,
    waypoints: r,
    sourcePosition: l,
    targetPosition: s
  }), r.length === 0 && l && s)
    return rM(
      e,
      n,
      l,
      s,
      h || [],
      u,
      c
    );
  if (r.length > 0 && l && s) {
    const y = [], x = r[0], w = xu(e, l, rn), z = vu(l) ? "horizontal" : "vertical";
    if (console.log("[calculateOrthogonalPath] First leg routing:", {
      source: e,
      sourceExt: w,
      firstWaypoint: x,
      sourceOrientation: z
    }), e.x !== w.x || e.y !== w.y) {
      const $ = { from: e, to: w, orientation: z };
      console.log("[calculateOrthogonalPath] Adding source exit segment:", $), y.push($);
    }
    const M = Ko(w, x);
    console.log(
      "[calculateOrthogonalPath] Segments from sourceExt to firstWaypoint:",
      M
    ), y.push(...M);
    for (let $ = 0; $ < r.length - 1; $++) {
      const V = Ko(r[$], r[$ + 1]);
      y.push(...V);
    }
    const A = r[r.length - 1], T = xu(n, s, rn), R = vu(s) ? "horizontal" : "vertical";
    console.log("[calculateOrthogonalPath] Last leg routing:", {
      lastWaypoint: A,
      targetExt: T,
      target: n,
      targetOrientation: R
    });
    const q = Ko(A, T);
    if (console.log("[calculateOrthogonalPath] Segments from lastWaypoint to targetExt:", q), y.push(...q), T.x !== n.x || T.y !== n.y) {
      const $ = { from: T, to: n, orientation: R };
      console.log("[calculateOrthogonalPath] Adding target entry segment:", $), y.push($);
    }
    console.log("[calculateOrthogonalPath] Final segments array:", y);
    const H = k3(y);
    return console.log("[calculateOrthogonalPath] After filtering sub-pixel segments:", {
      before: y.length,
      after: H.length,
      removed: y.length - H.length
    }), H;
  }
  const d = [e, ...r, n], p = [];
  for (let y = 0; y < d.length - 1; y++) {
    const x = d[y], w = d[y + 1], z = Ko(x, w);
    p.push(...z);
  }
  return k3(p);
}
function cM(e) {
  if (e.length <= 1)
    return console.log("[extractWaypointsFromSegments] Too few segments, returning empty"), [];
  const n = [];
  for (let r = 0; r < e.length - 1; r++)
    n.push({ x: e[r].to.x, y: e[r].to.y });
  return console.log("[extractWaypointsFromSegments] Extracted waypoints from segments:", {
    inputSegments: e,
    extractedWaypoints: n
  }), n;
}
function fM(e) {
  if (e.length === 0)
    return "";
  const n = [`M ${e[0].from.x} ${e[0].from.y}`];
  for (const r of e)
    n.push(`L ${r.to.x} ${r.to.y}`);
  return n.join(" ");
}
function hM(e, n) {
  const r = Math.min(e.from.x, e.to.x), l = Math.max(e.from.x, e.to.x), s = Math.min(e.from.y, e.to.y), u = Math.max(e.from.y, e.to.y);
  return e.orientation === "horizontal" ? {
    x: r,
    y: s - n / 2,
    width: l - r,
    height: n
  } : {
    x: r - n / 2,
    y: s,
    width: n,
    height: u - s
  };
}
function dM(e, n, r, l, s, u, c) {
  console.log("[updateWaypointsFromDrag] Called with:", {
    source: e,
    target: n,
    currentWaypoints: r,
    draggedSegment: l,
    newPosition: s,
    sourcePosition: u,
    targetPosition: c
  });
  const h = u ? xu(e, u, rn) : e, d = c ? xu(n, c, rn) : n, p = (T, R, q = 1) => Math.abs(T.x - R.x) < q && Math.abs(T.y - R.y) < q, g = r.findIndex((T) => p(T, l.from)), y = r.findIndex((T) => p(T, l.to)), x = p(l.from, h), w = p(l.to, d);
  console.log("[updateWaypointsFromDrag] Segment position analysis:", {
    fromWpIndex: g,
    toWpIndex: y,
    fromIsSourceExt: x,
    toIsTargetExt: w,
    sourceExt: h,
    targetExt: d
  });
  let z = l.from, M = l.to;
  p(l.from, e) && (z = h, console.log("[updateWaypointsFromDrag] Adjusted segment start from source to sourceExt")), p(l.to, n) && (M = d, console.log("[updateWaypointsFromDrag] Adjusted segment end from target to targetExt"));
  let A;
  if (l.orientation === "horizontal" ? A = [
    { x: z.x, y: s.y },
    { x: M.x, y: s.y }
  ] : A = [
    { x: s.x, y: z.y },
    { x: s.x, y: M.y }
  ], console.log("[updateWaypointsFromDrag] New bend waypoints:", A), g >= 0 && y >= 0 && y > g) {
    const T = [...r];
    return T.splice(g, y - g + 1, ...A), console.log("[updateWaypointsFromDrag] Case 1: Between waypoints", {
      fromWpIndex: g,
      toWpIndex: y,
      result: T
    }), T;
  }
  if (x && r.length > 0) {
    const T = [...A, ...r.slice(1)];
    return console.log("[updateWaypointsFromDrag] Case 2: SourceExt to first waypoint", T), T;
  }
  if (w && g >= 0) {
    const T = [...r];
    return T.splice(g + 1, 0, ...A), console.log("[updateWaypointsFromDrag] Case 3: Waypoint to targetExt", { fromWpIndex: g, result: T }), T;
  }
  return x && w || r.length === 0 ? (console.log(
    "[updateWaypointsFromDrag] Case 4: SourceExt to targetExt (no existing waypoints)",
    A
  ), A) : (console.warn("[updateWaypointsFromDrag] Fallback case - segment position not identified clearly"), A);
}
function mM(e, n = 15) {
  if (e.length <= 1)
    return [...e];
  const r = e.map((s, u) => {
    if (u === 0) return { ...s };
    const c = e[u - 1];
    return {
      // If X coords are close, align to previous X
      x: Math.abs(s.x - c.x) < n ? c.x : s.x,
      // If Y coords are close, align to previous Y
      y: Math.abs(s.y - c.y) < n ? c.y : s.y
    };
  });
  if (r.length <= 2)
    return r;
  const l = [r[0]];
  for (let s = 1; s < r.length - 1; s++) {
    const u = r[s - 1], c = r[s], h = r[s + 1], d = Math.abs(u.y - c.y) < n && Math.abs(c.y - h.y) < n, p = Math.abs(u.x - c.x) < n && Math.abs(c.x - h.x) < n;
    !d && !p && l.push(c);
  }
  return l.push(r[r.length - 1]), l;
}
function pM(e) {
  const n = [];
  for (let r = 0; r < e.length - 1; r++) {
    const l = e[r], s = e[r + 1];
    l.orientation !== s.orientation && n.push({ x: l.to.x, y: l.to.y });
  }
  return n;
}
function gM(e, n) {
  for (const r of e)
    if (r.orientation === "horizontal") {
      const l = Math.min(r.from.x, r.to.x), s = Math.max(r.from.x, r.to.x);
      if (n > l && n < s)
        return r;
    }
  for (const r of e)
    if (r.orientation === "horizontal") {
      const l = Math.min(r.from.x, r.to.x), s = Math.max(r.from.x, r.to.x);
      if (n >= l && n <= s)
        return r;
    }
  for (const r of e)
    if (r.orientation === "vertical" && Math.abs(r.from.x - n) < 0.5)
      return r;
}
function yM(e, n, r) {
  const l = gM(e, n);
  if (!l)
    return r;
  if (l.orientation === "horizontal")
    return l.from.y;
  {
    const s = l.to.x !== l.from.x ? (n - l.from.x) / (l.to.x - l.from.x) : 0.5;
    return l.from.y + s * (l.to.y - l.from.y);
  }
}
function vM(e, n, r = 7, l = 4) {
  if (e.length === 0)
    return { x: 0, y: 0 };
  const s = 25;
  let u = e;
  if (e.length > 1) {
    const A = [...e];
    if (Math.abs(e[0].to.x - e[0].from.x) + Math.abs(e[0].to.y - e[0].from.y) < s && A.shift(), A.length > 0) {
      const R = A[A.length - 1];
      Math.abs(R.to.x - R.from.x) + Math.abs(R.to.y - R.from.y) < s && A.pop();
    }
    A.length > 0 && (u = A);
  }
  const c = [];
  for (const A of u)
    c.push(A.from.x, A.to.x);
  const h = Math.min(...c), d = Math.max(...c);
  let p = (h + d) / 2;
  console.log("[calculateConnectionLabelPosition] Bounding box calculation:", {
    totalSegments: e.length,
    segmentsUsedForBounds: u.length,
    segments: e,
    segmentsForBounds: u,
    allX: c,
    minX: h,
    maxX: d,
    centerX: p,
    labelText: n
  });
  const y = (n.length * r + l * 2) / 2, x = pM(u);
  if (x.length > 0) {
    let A = p - y, T = p + y;
    for (const R of x)
      if (A < R.x && T > R.x) {
        const q = R.x - y, H = R.x + y, $ = p - q, V = H - p, Q = q >= h - y, re = H <= d + y;
        $ <= V && Q ? p = q : re ? p = H : Q && (p = q), A = p - y, T = p + y;
      }
  }
  const w = u[0].from.y;
  let z = yM(u, p, w);
  return z -= 12, { x: p, y: z };
}
const bu = {
  gain: { width: 120, height: 80, minWidth: 60, minHeight: 40 },
  sum: { width: 56, height: 56, minWidth: 40, minHeight: 40 },
  transfer_function: { width: 100, height: 50, minWidth: 80, minHeight: 40 },
  state_space: { width: 120, height: 60, minWidth: 80, minHeight: 40 },
  io_marker: { width: 60, height: 32, minWidth: 60, minHeight: 32 }
};
function $0(e, n, r) {
  const l = bu[e] || bu.gain;
  return {
    width: n ?? l.width,
    height: r ?? l.height
  };
}
function as(e) {
  const n = bu[e] || bu.gain;
  return {
    minWidth: n.minWidth,
    minHeight: n.minHeight
  };
}
const R1 = 10;
function xM({ segment: e, index: n, onDragStart: r, isDragging: l }) {
  const [s, u] = B.useState(!1), c = hM(e, R1), d = e.orientation === "horizontal" ? "ns-resize" : "ew-resize", p = B.useCallback(
    (g) => {
      g.stopPropagation(), g.preventDefault();
      const y = { x: g.clientX, y: g.clientY };
      r(n, e, y);
    },
    [n, e, r]
  );
  return /* @__PURE__ */ O.jsx(
    "rect",
    {
      x: c.x,
      y: c.y,
      width: Math.max(c.width, R1),
      height: Math.max(c.height, R1),
      fill: s ? "var(--color-primary-200)" : "transparent",
      stroke: s ? "var(--color-primary-400)" : "transparent",
      strokeWidth: 1,
      rx: 2,
      cursor: d,
      onMouseDown: p,
      onMouseEnter: () => u(!0),
      onMouseLeave: () => u(!1),
      style: {
        pointerEvents: l ? "none" : "all",
        transition: "fill 0.15s ease, stroke 0.15s ease"
      }
    }
  );
}
function f7({
  id: e,
  source: n,
  target: r,
  sourceX: l,
  sourceY: s,
  targetX: u,
  targetY: c,
  sourcePosition: h,
  targetPosition: d,
  data: p,
  selected: g,
  markerEnd: y,
  style: x
}) {
  const w = B.useContext(W0), { getViewport: z } = Wi(), M = zS(), A = p?.waypoints || [], T = p?.label ?? e, R = p?.label_visible || !1, q = B.useMemo(() => ({ x: l, y: s }), [l, s]), H = B.useMemo(() => ({ x: u, y: c }), [u, c]), { sourceBounds: $, targetBounds: V } = B.useMemo(() => {
    const Y = M.find((k) => k.id === n), I = M.find((k) => k.id === r), F = Y ? {
      x: Y.position.x,
      y: Y.position.y,
      ...$0(
        Y.type || "gain",
        Y.data?.width,
        Y.data?.height
      )
    } : void 0, le = I ? {
      x: I.position.x,
      y: I.position.y,
      ...$0(
        I.type || "gain",
        I.data?.width,
        I.data?.height
      )
    } : void 0;
    return { sourceBounds: F, targetBounds: le };
  }, [M, n, r]), Q = B.useMemo(() => M.map((Y) => ({
    x: Y.position.x,
    y: Y.position.y,
    ...$0(Y.type || "gain", Y.data?.width, Y.data?.height)
  })), [M]), [re, te] = B.useState(null), ie = B.useMemo(() => {
    const Y = re?.previewWaypoints ?? A, I = uM(
      q,
      H,
      Y,
      h,
      d,
      $,
      V,
      Q
    );
    return console.log("[OrthogonalEditableEdge] Calculated segments:", {
      waypoints: Y,
      resultSegments: I,
      sourcePoint: q,
      targetPoint: H
    }), I;
  }, [
    q,
    H,
    A,
    re?.previewWaypoints,
    h,
    d,
    $,
    V,
    Q
  ]), ue = B.useMemo(() => {
    if (ie.length > 0)
      return fM(ie);
    const [Y] = fu({
      sourceX: l,
      sourceY: s,
      sourcePosition: h,
      targetX: u,
      targetY: c,
      targetPosition: d
    });
    return Y;
  }, [ie, l, s, h, u, c, d]), de = B.useMemo(() => {
    if (!R) return { x: 0, y: 0 };
    const Y = ie.map((I) => ({
      from: I.from,
      to: I.to,
      orientation: I.orientation
    }));
    return vM(Y, T);
  }, [R, ie, T]), ge = B.useCallback(
    (Y) => {
      w && Mt(w, "updateConnectionLabel", {
        connectionId: e,
        label: Y
      });
    },
    [w, e]
  ), _ = B.useCallback(
    (Y, I, F) => {
      const le = A.length === 0 ? cM(ie) : A;
      console.log("[OrthogonalEditableEdge] handleDragStart:", {
        segmentIndex: Y,
        segment: I,
        currentSegments: ie,
        storedWaypoints: A,
        effectiveWaypoints: le,
        sourcePoint: q,
        targetPoint: H
      }), te({
        segmentIndex: Y,
        segment: I,
        startPos: F,
        startWaypoints: le,
        previewWaypoints: le
      });
      const k = (ae) => {
        const se = z(), xe = {
          x: ae.clientX - F.x,
          y: ae.clientY - F.y
        }, Te = {
          x: xe.x / se.zoom,
          y: xe.y / se.zoom
        };
        let Ae;
        I.orientation === "horizontal" ? Ae = {
          x: I.from.x,
          y: I.from.y + Te.y
        } : Ae = {
          x: I.from.x + Te.x,
          y: I.from.y
        }, console.log("[OrthogonalEditableEdge] handleMouseMove:", {
          canvasDelta: Te,
          segmentBeingDragged: I,
          newPosition: Ae,
          effectiveWaypoints: le
        });
        const Re = dM(
          q,
          H,
          le,
          I,
          Ae,
          h,
          d
        );
        console.log("[OrthogonalEditableEdge] Updated waypoints from drag:", Re), te(
          (Be) => Be ? {
            ...Be,
            previewWaypoints: Re
          } : null
        );
      }, G = () => {
        window.removeEventListener("mousemove", k), window.removeEventListener("mouseup", G), te((ae) => {
          if (!ae || !w) return null;
          const se = mM(ae.previewWaypoints);
          return Mt(w, "updateConnectionRouting", {
            connectionId: e,
            waypoints: se
          }), null;
        });
      };
      window.addEventListener("mousemove", k), window.addEventListener("mouseup", G);
    },
    // eslint-disable-next-line react-hooks/exhaustive-deps
    [A, ie, q, H, e, w, z]
  ), J = re !== null, D = {
    ...x,
    stroke: J ? "var(--color-primary-400)" : g ? "var(--color-primary-500)" : "var(--color-primary-600)",
    strokeWidth: g || J ? 2 : 1.5,
    opacity: J ? 0.7 : 1
  };
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(Cl, { id: e, path: ue, markerEnd: y, style: D }),
    g && !J && ie.length > 0 && /* @__PURE__ */ O.jsx("g", { className: "segment-handles", children: ie.map((Y, I) => /* @__PURE__ */ O.jsx(
      xM,
      {
        segment: Y,
        index: I,
        onDragStart: _,
        isDragging: J
      },
      `segment-${I}`
    )) }),
    R && /* @__PURE__ */ O.jsx(ES, { children: /* @__PURE__ */ O.jsx(
      "div",
      {
        style: {
          position: "absolute",
          transform: `translate(-50%, -50%) translate(${de.x}px, ${de.y}px)`,
          pointerEvents: "all"
        },
        children: /* @__PURE__ */ O.jsx(
          Nl,
          {
            value: T,
            onSave: ge,
            className: "text-xs font-mono text-slate-600 whitespace-nowrap"
          }
        )
      }
    ) })
  ] });
}
const bM = 120, SM = 80, wM = {
  gain: { width: 120, height: 80 },
  transfer_function: { width: 120, height: 80 },
  state_space: { width: 120, height: 80 },
  sum: { width: 56, height: 56 },
  io_marker: { width: 100, height: 60 }
};
function D3(e) {
  if (e.width && e.height)
    return { width: e.width, height: e.height };
  const n = wM[e.type || ""];
  return n || { width: bM, height: SM };
}
function _3(e, n, r, l, s, u) {
  const { width: c, height: h } = n, d = e.y + h / 2;
  return s === "sum" ? l === "output" ? {
    x: u ? e.x : e.x + c,
    y: d
  } : {
    x: u ? e.x + c : e.x,
    y: d
  } : s === "io_marker" ? l === "input" ? {
    x: u ? e.x + c : e.x,
    y: d
  } : {
    x: u ? e.x : e.x + c,
    y: d
  } : l === "input" ? {
    x: u ? e.x + c : e.x,
    y: d
  } : {
    x: u ? e.x : e.x + c,
    y: d
  };
}
function EM(e, n, r, l, s = 20) {
  const u = r.find((x) => x.id === e);
  if (!u)
    return n;
  const c = D3(u), h = u.type || "", d = u.data?.flipped || !1, p = l.filter(
    (x) => x.source === e || x.target === e
  );
  if (p.length === 0)
    return n;
  const g = [];
  for (const x of p) {
    const w = x.source === e, z = w ? x.target : x.source, M = r.find((ue) => ue.id === z);
    if (!M) continue;
    const A = D3(M), T = M.type || "", R = M.data?.flipped || !1, q = w ? x.sourceHandle || "out" : x.targetHandle || "in", H = w ? x.targetHandle || "in" : x.sourceHandle || "out", $ = w ? "output" : "input", V = w ? "input" : "output", Q = _3(
      n,
      c,
      q,
      $,
      h,
      d
    ), re = _3(
      M.position,
      A,
      H,
      V,
      T,
      R
    ), te = Math.abs(Q.y - re.y);
    te < s && te > 0 && g.push({
      axis: "y",
      adjustment: re.y - Q.y,
      distance: te
    });
    const ie = Math.abs(Q.x - re.x);
    ie < s && ie > 0 && g.push({
      axis: "x",
      adjustment: re.x - Q.x,
      distance: ie
    });
  }
  if (g.length === 0)
    return n;
  g.sort((x, w) => x.distance - w.distance);
  const y = g[0];
  return {
    x: y.axis === "x" ? n.x + y.adjustment : n.x,
    y: y.axis === "y" ? n.y + y.adjustment : n.y
  };
}
const fn = {
  GAIN: "gain",
  TRANSFER_FUNCTION: "transfer_function",
  STATE_SPACE: "state_space",
  SUM: "sum",
  IO_MARKER: "io_marker"
}, B1 = {
  sigFigs: 3,
  expNotationMin: 0.01,
  expNotationMax: 1e3
}, Qo = {
  dragThresholdPx: 5,
  positionChangeThresholdPx: 1
}, MM = "data:image/png;base64,dmVyc2lvbiBodHRwczovL2dpdC1sZnMuZ2l0aHViLmNvbS9zcGVjL3YxCm9pZCBzaGEyNTY6ZTFmYTM5NjJlZTNmZDE3ZDRkMWIyZjYyMTU0YzM5N2RjNzY1ODM0NGM5ZWMyZDA2ZTgxNDhjNjJhYmE2ZTI1MwpzaXplIDkzODQ4Cg==", h7 = {
  x: 0,
  y: 0,
  zoom: 0.5
}, qi = 0.3, Ui = 2, d7 = {
  padding: 0.1,
  // 10% padding on each side = 20% total, leaving 80% for content
  minZoom: qi,
  maxZoom: Ui
}, R3 = {
  width: 14,
  height: 14
}, TM = 2.5;
function m7(e) {
  return {
    style: { stroke: e, strokeWidth: TM },
    type: "orthogonal",
    markerEnd: {
      type: "arrowclosed",
      width: R3.width,
      height: R3.height,
      color: e
    }
  };
}
function Su(e) {
  return {
    id: e.id,
    type: e.type,
    position: e.position,
    data: {
      parameters: e.parameters,
      ports: e.ports,
      label: e.label,
      flipped: e.flipped || !1,
      custom_latex: e.custom_latex,
      label_visible: e.label_visible || !1,
      width: e.width,
      height: e.height
    }
  };
}
function sh(e, n) {
  return {
    id: e.id,
    source: e.source_block_id,
    sourceHandle: e.source_port_id,
    target: e.target_block_id,
    targetHandle: e.target_port_id,
    type: "orthogonal",
    data: {
      waypoints: e.waypoints || [],
      label: e.label,
      label_visible: e.label_visible || !1
    },
    style: { stroke: n, strokeWidth: 2.5 },
    markerEnd: {
      type: "arrowclosed",
      width: 14,
      height: 14,
      color: n
    }
  };
}
const zM = {
  gain: { width: 120, height: 80 },
  sum: { width: 56, height: 56 },
  transfer_function: { width: 100, height: 50 },
  state_space: { width: 100, height: 60 },
  io_marker: { width: 60, height: 48 }
};
function oh(e, n) {
  if (e.length === 0)
    return { x: 0, y: 0, width: 800, height: 600 };
  let r = 1 / 0, l = 1 / 0, s = -1 / 0, u = -1 / 0;
  return e.forEach((c) => {
    const h = zM[c.type || "gain"] || { width: 100, height: 60 }, d = c.data?.width ?? h.width, p = c.data?.height ?? h.height;
    r = Math.min(r, c.position.x), l = Math.min(l, c.position.y), s = Math.max(s, c.position.x + d), u = Math.max(u, c.position.y + p);
  }), n.forEach((c) => {
    const h = c.data?.waypoints;
    h && Array.isArray(h) && h.forEach((d) => {
      r = Math.min(r, d.x), l = Math.min(l, d.y), s = Math.max(s, d.x), u = Math.max(u, d.y);
    });
  }), {
    x: r,
    y: l,
    width: s - r,
    height: u - l
  };
}
function uh(e, n, r, l = {}) {
  const { padding: s = 0.1, minZoom: u = 0.3, maxZoom: c = 2 } = l, h = n * (1 - s * 2), d = r * (1 - s * 2), p = h / e.width, g = d / e.height;
  let y = Math.min(p, g);
  y = Math.max(u, Math.min(c, y));
  const x = e.x + e.width / 2, w = e.y + e.height / 2, z = n / 2 - x * y, M = r / 2 - w * y;
  return { x: z, y: M, zoom: y };
}
function rs(e, n) {
  const r = B.useContext(W0), l = n.label || e, s = B.useCallback(
    (u) => {
      r && Mt(r, "updateBlockLabel", {
        blockId: e,
        label: u
      });
    },
    [r, e]
  );
  return { blockLabel: l, handleLabelSave: s };
}
function ls(e) {
  return {
    getHandlePosition: (l) => {
      if (!e) return l;
      switch (l) {
        case he.Left:
          return he.Right;
        case he.Right:
          return he.Left;
        default:
          return l;
      }
    },
    getFlipTransform: () => e ? "scaleX(-1)" : "none"
  };
}
function is(e) {
  const n = B.useContext(W0), { setNodes: r } = Wi(), l = MS(), s = B.useCallback(() => {
  }, []), u = B.useCallback(
    (h, d) => {
      const { width: p, height: g, x: y, y: x } = d;
      r(
        (w) => w.map(
          (z) => z.id === e ? {
            ...z,
            position: { x: y, y: x },
            data: { ...z.data, width: p, height: g }
          } : z
        )
      );
    },
    [e, r]
  ), c = B.useCallback(
    (h, d) => {
      const { width: p, height: g, x: y, y: x } = d;
      n && (Mt(n, "resizeBlock", {
        blockId: e,
        width: p,
        height: g
      }), Mt(n, "moveBlock", {
        blockId: e,
        position: { x: y, y: x }
      })), l(e);
    },
    [n, e, l]
  );
  return {
    handleResizeStart: s,
    handleResize: u,
    handleResizeEnd: c
  };
}
function AM(e, n, r) {
  return r.some(
    (l) => l.source === e && l.sourceHandle === n || l.target === e && l.targetHandle === n
  );
}
function Ea(e, n) {
  const r = CS();
  return AM(e, n, r);
}
function qu(e, n, r) {
  const [l, s] = B.useState(!!n), [u, c] = B.useState(n || ""), [h, d] = B.useState(null), p = B.useCallback(
    (x) => {
      s(x), x || (r(e, "custom_latex", null), d(null));
    },
    [e, r]
  ), g = B.useCallback((x) => {
    c(x);
    const w = (x.match(/\{/g) || []).length, z = (x.match(/\}/g) || []).length;
    d(w !== z ? "Unbalanced braces in LaTeX expression" : null);
  }, []), y = B.useCallback(() => {
    h || r(e, "custom_latex", u || null);
  }, [e, u, h, r]);
  return {
    useCustomLatex: l,
    latexValue: u,
    latexError: h,
    handleToggle: p,
    handleChange: g,
    handleApply: y
  };
}
function p7(e, n = B1.sigFigs) {
  if (e === 0)
    return "0";
  const r = Math.abs(e);
  if (r < B1.expNotationMin || r >= B1.expNotationMax) {
    const l = e.toExponential(n - 1), [s, u] = l.split("e"), c = parseInt(u, 10);
    return `${s} \\times 10^{${c}}`;
  } else {
    const l = Math.floor(Math.log10(r)), s = n - l - 1;
    if (s >= 0) {
      const u = e.toFixed(s);
      return u.includes(".") ? u.replace(/\.?0+$/, "") : u;
    } else
      return (Math.round(e * Math.pow(10, s)) / Math.pow(10, s)).toFixed(0);
  }
}
function CM() {
  return String.raw`\dot{x} = Ax + Bu \\ y = Cx + Du`;
}
function NM(e, n) {
  const r = Array.isArray(e) ? e : [e], l = Array.isArray(n) ? n : [n];
  if (!r || r.length === 0 || !l || l.length === 0)
    return "Invalid parameters";
  const s = B3(r), u = B3(l);
  return String.raw`\frac{${s}}{${u}}`;
}
function kM(e) {
  return e == null || isNaN(e) ? "Invalid parameters" : p7(e);
}
function B3(e) {
  if (!e || e.length === 0)
    return "0";
  const n = e.length - 1, r = [];
  for (let l = 0; l < e.length; l++) {
    const s = e[l], u = n - l;
    if (s === 0)
      continue;
    let c = "";
    const h = Math.abs(s), d = s < 0 ? "-" : "+";
    let p = "";
    (u === 0 || h !== 1) && (p = p7(h), p = p.replace(/e([+-])0?(\d+)/g, (g, y, x) => String.raw` \times 10^{${y}${x}}`)), u === 0 ? c = p : u === 1 ? c = p ? `${p}s` : "s" : c = p ? `${p}s^{${u}}` : `s^{${u}}`, r.length === 0 ? d === "-" && (c = `-${c}`) : c = ` ${d} ${c}`, r.push(c);
  }
  return r.length === 0 ? "0" : r.join("");
}
function DM({ data: e, id: n, selected: r }) {
  const l = e.parameters?.find((H) => H.name === "K")?.value ?? 1, s = e.custom_latex, u = e.flipped || !1, { width: c, height: h } = $0("gain", e.width, e.height), { minWidth: d, minHeight: p } = as("gain"), { blockLabel: g, handleLabelSave: y } = rs(n, e), { getHandlePosition: x, getFlipTransform: w } = ls(u), { handleResizeStart: z, handleResize: M, handleResizeEnd: A } = is(
    n
  ), T = Ea(n, "in"), R = Ea(n, "out"), q = s || kM(l);
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      Pi,
      {
        minWidth: d,
        minHeight: p,
        isVisible: r,
        onResizeStart: z,
        onResize: M,
        onResizeEnd: A,
        handleStyle: {
          width: 8,
          height: 8,
          backgroundColor: "var(--color-primary-600)",
          borderRadius: 2
        },
        lineStyle: {
          borderColor: "var(--color-primary-400)",
          borderWidth: 1
        }
      }
    ),
    /* @__PURE__ */ O.jsxs("div", { className: "relative", style: { width: `${c}px`, height: `${h}px` }, children: [
      /* @__PURE__ */ O.jsx(
        Tn,
        {
          type: "target",
          position: x(he.Left),
          id: "in",
          style: {
            position: "absolute",
            left: u ? "91.67%" : "8.33%",
            // Flipped: right edge at 91.67%, unflipped: left edge at 8.33%
            top: "50%",
            // 40px/80px = 50%
            transform: "translate(-50%, -50%)"
          },
          children: /* @__PURE__ */ O.jsx(
            wa,
            {
              position: x(he.Left),
              portType: "input",
              isConnected: T,
              isFlipped: u
            }
          )
        }
      ),
      /* @__PURE__ */ O.jsxs(
        "svg",
        {
          width: c,
          height: h,
          className: "drop-shadow-md",
          style: { transform: w() },
          children: [
            /* @__PURE__ */ O.jsx(
              "polygon",
              {
                points: `${c * 0.083},0 ${c * 0.083},${h} ${c},${h / 2}`,
                fill: "var(--color-slate-200)",
                stroke: "var(--color-primary-600)",
                strokeWidth: "2"
              }
            ),
            /* @__PURE__ */ O.jsx(
              "foreignObject",
              {
                x: c * 0.083,
                y: h * 0.2,
                width: c * 0.75,
                height: h * 0.6,
                children: /* @__PURE__ */ O.jsx(
                  "div",
                  {
                    style: {
                      transform: w(),
                      transformOrigin: "center",
                      width: "100%",
                      height: "100%",
                      display: "flex",
                      alignItems: "center",
                      justifyContent: u ? "flex-end" : "flex-start",
                      paddingLeft: u ? "5px" : "10px",
                      paddingRight: u ? "10px" : "5px"
                    },
                    children: /* @__PURE__ */ O.jsx(
                      Lu,
                      {
                        latex: q,
                        className: "text-primary-600",
                        align: u ? "right" : "left"
                      }
                    )
                  }
                )
              }
            )
          ]
        }
      ),
      /* @__PURE__ */ O.jsx(
        Tn,
        {
          type: "source",
          position: x(he.Right),
          id: "out",
          style: {
            position: "absolute",
            left: u ? "calc(0% + 1px)" : "100%",
            // Flipped: left tip at 0%, unflipped: right tip at 100%
            top: "50%",
            transform: "translate(-50%, -50%)"
          },
          children: /* @__PURE__ */ O.jsx(
            wa,
            {
              position: x(he.Right),
              portType: "output",
              isConnected: R,
              isFlipped: u
            }
          )
        }
      ),
      e.label_visible && /* @__PURE__ */ O.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1", children: /* @__PURE__ */ O.jsx(
        Nl,
        {
          value: g,
          onSave: y,
          className: "text-xs text-slate-600 font-mono whitespace-nowrap"
        }
      ) })
    ] })
  ] });
}
function _M({ block: e, onUpdate: n }) {
  const r = e.parameters?.find((A) => A.name === "K"), l = r?.expression ?? String(r?.value ?? 1), s = r?.value ?? 1, [u, c] = B.useState(l), h = B.useRef(u);
  B.useLayoutEffect(() => {
    h.current = u;
  }, [u]), B.useEffect(() => {
    const A = e.parameters?.find((T) => T.name === "K");
    c(A?.expression ?? String(A?.value ?? 1));
  }, [e.parameters]);
  const {
    useCustomLatex: d,
    latexValue: p,
    latexError: g,
    handleToggle: y,
    handleChange: x,
    handleApply: w
  } = qu(e.id, e.custom_latex, n), z = (A) => {
    c(A);
  }, M = () => {
    n(e.id, "K", h.current);
  };
  return /* @__PURE__ */ O.jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ O.jsxs("div", { className: "mb-3 pb-3 border-b", children: [
      /* @__PURE__ */ O.jsxs("label", { className: "flex items-center text-xs font-medium mb-2 cursor-pointer", children: [
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "checkbox",
            checked: d,
            onChange: (A) => y(A.target.checked),
            className: "mr-2"
          }
        ),
        "Render custom block contents"
      ] }),
      d && /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Custom LaTeX Expression" }),
        /* @__PURE__ */ O.jsx(
          "textarea",
          {
            value: p,
            onChange: (A) => x(A.target.value),
            onBlur: () => w(),
            onKeyDown: (A) => {
              A.key === "Enter" && !A.shiftKey && (A.preventDefault(), A.stopPropagation(), w(), A.currentTarget.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono resize-none",
            rows: 3,
            placeholder: String.raw`e.g., H(s) = \frac{1}{s+1}`
          }
        ),
        g && /* @__PURE__ */ O.jsx("div", { className: "text-xs text-red-600 mt-1", children: g })
      ] })
    ] }),
    /* @__PURE__ */ O.jsxs("div", { children: [
      /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Gain (K)" }),
      /* @__PURE__ */ O.jsxs("div", { className: "mb-1", children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Expression:" }),
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "text",
            value: u,
            onChange: (A) => z(A.target.value),
            onBlur: M,
            onKeyDown: (A) => {
              A.key === "Enter" && (A.preventDefault(), A.stopPropagation(), M(), A.target.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono",
            placeholder: "e.g., gain_value or 2*np.pi"
          }
        )
      ] }),
      /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Resolved Value:" }),
        /* @__PURE__ */ O.jsx("div", { className: "px-2 py-1 text-sm bg-gray-50 rounded font-mono text-gray-700", children: typeof s == "number" ? s.toFixed(3) : String(s) })
      ] })
    ] })
  ] });
}
const W0 = B.createContext(null);
function RM(e, n, r, l, s) {
  if (![0, 1, 2].includes(e))
    return "";
  const u = `M ${n},${r}`, c = (h) => {
    const d = h * Math.PI / 180, p = n + l * Math.cos(d), g = r + s * Math.sin(d);
    return { x: p, y: g };
  };
  switch (e) {
    case 0: {
      const h = c(-135), d = c(-45);
      return `${u} L ${h.x},${h.y} A ${l},${s} 0 0 1 ${d.x},${d.y} Z`;
    }
    case 1: {
      const h = c(135), d = c(-135);
      return `${u} L ${h.x},${h.y} A ${l},${s} 0 0 1 ${d.x},${d.y} Z`;
    }
    case 2: {
      const h = c(45), d = c(135);
      return `${u} L ${h.x},${h.y} A ${l},${s} 0 0 1 ${d.x},${d.y} Z`;
    }
    default:
      return "";
  }
}
function BM({
  blockId: e,
  portId: n,
  position: r,
  style: l,
  isFlipped: s
}) {
  const u = Ea(e, n);
  return /* @__PURE__ */ O.jsx(Tn, { type: "target", position: r, id: n, style: l, children: /* @__PURE__ */ O.jsx(
    wa,
    {
      position: r,
      portType: "input",
      isConnected: u,
      isFlipped: s
    }
  ) });
}
function OM({ data: e, id: n, selected: r }) {
  const l = e.parameters?.find((ie) => ie.name === "signs")?.value ?? ["+", "+", "|"], s = e.flipped || !1, { width: u, height: c } = $0("sum", e.width, e.height), { minWidth: h, minHeight: d } = as("sum"), { blockLabel: p, handleLabelSave: g } = rs(n, e), { getHandlePosition: y } = ls(s), { handleResizeStart: x, handleResize: w, handleResizeEnd: z } = is(
    n
  ), M = Ea(n, "out"), A = u / 2, T = c / 2, R = (u - 4) / 2, q = (c - 4) / 2, H = B.useContext(W0), $ = (ie) => {
    switch (ie) {
      case "+":
        return "-";
      case "-":
        return "|";
      case "|":
        return "+";
      default:
        return "+";
    }
  }, V = B.useCallback(
    (ie) => {
      ie.stopPropagation(), ie.preventDefault();
      const ue = parseInt(ie.currentTarget.getAttribute("data-quadrant") || "-1", 10);
      if (ue < 0 || ue > 2)
        return;
      const de = l[ue] || "+", ge = $(de), _ = [...l];
      _[ue] = ge, H && Mt(H, "updateParameter", {
        blockId: n,
        parameterName: "signs",
        value: _
      });
    },
    [l, n, H]
  ), Q = [
    {
      position: "top",
      angle: -Math.PI / 2,
      // -90 degrees (up)
      sign: l[0] || "+",
      handlePosition: he.Top,
      rx: R,
      ry: q
    },
    {
      position: "left",
      angle: Math.PI,
      // 180 degrees
      sign: l[1] || "+",
      handlePosition: he.Left,
      rx: R,
      ry: q
    },
    {
      position: "bottom",
      angle: Math.PI / 2,
      // 90 degrees (down)
      sign: l[2] || "|",
      handlePosition: he.Bottom,
      rx: R,
      ry: q
    }
  ], te = Q.map((ie, ue) => ({ ...ie, originalIndex: ue })).filter((ie) => ie.sign !== "|").map((ie, ue) => ({
    ...ie,
    portId: `in${ue + 1}`
  }));
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      Pi,
      {
        minWidth: h,
        minHeight: d,
        isVisible: r,
        onResizeStart: x,
        onResize: w,
        onResizeEnd: z,
        handleStyle: {
          width: 8,
          height: 8,
          backgroundColor: "var(--color-primary-600)",
          borderRadius: 2
        },
        lineStyle: {
          borderColor: "var(--color-primary-400)",
          borderWidth: 1
        }
      }
    ),
    /* @__PURE__ */ O.jsxs("div", { className: "relative", style: { width: `${u}px`, height: `${c}px` }, children: [
      /* @__PURE__ */ O.jsxs("svg", { width: u, height: c, className: "drop-shadow-md", children: [
        /* @__PURE__ */ O.jsx(
          "ellipse",
          {
            cx: A,
            cy: T,
            rx: R,
            ry: q,
            fill: "var(--color-slate-200)",
            stroke: "var(--color-primary-600)",
            strokeWidth: "2"
          }
        ),
        /* @__PURE__ */ O.jsx(
          "line",
          {
            x1: A - R * 0.707,
            y1: T - q * 0.707,
            x2: A + R * 0.707,
            y2: T + q * 0.707,
            stroke: "var(--color-primary-600)",
            strokeWidth: "2"
          }
        ),
        /* @__PURE__ */ O.jsx(
          "line",
          {
            x1: A + R * 0.707,
            y1: T - q * 0.707,
            x2: A - R * 0.707,
            y2: T + q * 0.707,
            stroke: "var(--color-primary-600)",
            strokeWidth: "2"
          }
        ),
        /* @__PURE__ */ O.jsx("style", { children: `
              .sum-quadrant {
                fill: transparent;
                cursor: pointer;
                pointer-events: auto;
                transition: fill 0.15s ease, opacity 0.15s ease;
              }
              .sum-quadrant:hover {
                fill: var(--color-primary-200);
                opacity: 0.5;
              }
            ` }),
        [0, 1, 2].map((ie) => {
          const ue = RM(
            ie,
            A,
            T,
            R,
            q
          );
          return /* @__PURE__ */ O.jsx(
            "path",
            {
              className: "sum-quadrant",
              d: ue,
              "data-quadrant": ie,
              onDoubleClick: (de) => {
                V(de);
              }
            },
            `quadrant-${ie}`
          );
        }),
        Q.map((ie, ue) => {
          if (ie.sign === "|") return null;
          const de = R * 0.55, ge = q * 0.55, _ = de * Math.cos(ie.angle), J = T + ge * Math.sin(ie.angle), D = A + (s ? -_ : _);
          return /* @__PURE__ */ O.jsx(
            "text",
            {
              x: D,
              y: J,
              textAnchor: "middle",
              dominantBaseline: "middle",
              style: {
                fontSize: "18px",
                fontWeight: "bold",
                fontFamily: "monospace",
                pointerEvents: "none"
                // Allow clicks to pass through to quadrant paths
              },
              fill: "var(--color-primary-600)",
              children: ie.sign
            },
            ue
          );
        })
      ] }),
      te.map((ie) => {
        const ue = R * Math.cos(ie.angle), de = T + q * Math.sin(ie.angle), ge = A + (s ? -ue : ue);
        return /* @__PURE__ */ O.jsx(
          BM,
          {
            blockId: n,
            portId: ie.portId,
            position: y(ie.handlePosition),
            style: {
              position: "absolute",
              left: `${ge}px`,
              top: `${de}px`,
              transform: "translate(-50%, -50%)",
              zIndex: 10
            },
            isFlipped: s
          },
          ie.portId
        );
      }),
      /* @__PURE__ */ O.jsx(
        Tn,
        {
          type: "source",
          position: y(he.Right),
          id: "out",
          style: {
            position: "absolute",
            left: `${A + (s ? -R : R)}px`,
            top: `${T}px`,
            transform: "translate(-50%, -50%)",
            zIndex: 10
          },
          children: /* @__PURE__ */ O.jsx(
            wa,
            {
              position: y(he.Right),
              portType: "output",
              isConnected: M,
              isFlipped: s
            }
          )
        }
      ),
      e.label_visible && /* @__PURE__ */ O.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1", children: /* @__PURE__ */ O.jsx(
        Nl,
        {
          value: p,
          onSave: g,
          className: "text-xs text-slate-600 font-mono whitespace-nowrap"
        }
      ) })
    ] })
  ] });
}
function HM({
  data: e,
  id: n,
  selected: r
}) {
  const l = e.parameters?.find((H) => H.name === "num")?.value ?? [1], s = e.parameters?.find((H) => H.name === "den")?.value ?? [1, 1], u = e.custom_latex, c = e.flipped || !1, { width: h, height: d } = $0("transfer_function", e.width, e.height), { minWidth: p, minHeight: g } = as("transfer_function"), { blockLabel: y, handleLabelSave: x } = rs(n, e), { getHandlePosition: w } = ls(c), { handleResizeStart: z, handleResize: M, handleResizeEnd: A } = is(
    n
  ), T = Ea(n, "in"), R = Ea(n, "out"), q = u || NM(l, s);
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      Pi,
      {
        minWidth: p,
        minHeight: g,
        isVisible: r,
        onResizeStart: z,
        onResize: M,
        onResizeEnd: A,
        handleStyle: {
          width: 8,
          height: 8,
          backgroundColor: "var(--color-primary-600)",
          borderRadius: 2
        },
        lineStyle: {
          borderColor: "var(--color-primary-400)",
          borderWidth: 1
        }
      }
    ),
    /* @__PURE__ */ O.jsxs("div", { className: "relative", style: { width: `${h}px`, height: `${d}px` }, children: [
      /* @__PURE__ */ O.jsxs(
        "div",
        {
          className: "bg-slate-200 border-2 border-primary-600 rounded shadow-md relative flex items-center justify-center",
          style: { width: `${h}px`, height: `${d}px` },
          children: [
            /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "target",
                position: w(he.Left),
                id: "in",
                style: {
                  position: "absolute",
                  left: c ? "100%" : "0",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: w(he.Left),
                    portType: "input",
                    isConnected: T,
                    isFlipped: c
                  }
                )
              }
            ),
            /* @__PURE__ */ O.jsx("div", { className: "text-center px-2", children: /* @__PURE__ */ O.jsx(
              Lu,
              {
                latex: q,
                autoScale: !0,
                displayMode: !0,
                className: "text-primary-600"
              }
            ) }),
            /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "source",
                position: w(he.Right),
                id: "out",
                style: {
                  position: "absolute",
                  left: c ? "0" : "100%",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: w(he.Right),
                    portType: "output",
                    isConnected: R,
                    isFlipped: c
                  }
                )
              }
            )
          ]
        }
      ),
      e.label_visible && /* @__PURE__ */ O.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1", children: /* @__PURE__ */ O.jsx(
        Nl,
        {
          value: y,
          onSave: x,
          className: "text-xs text-slate-600 font-mono whitespace-nowrap"
        }
      ) })
    ] })
  ] });
}
function LM({ block: e, onUpdate: n }) {
  const r = e.parameters?.find((V) => V.name === "num"), l = e.parameters?.find((V) => V.name === "den"), s = r?.expression ?? (Array.isArray(r?.value) ? r.value.join(",") : String(r?.value ?? "[1]")), u = l?.expression ?? (Array.isArray(l?.value) ? l.value.join(",") : String(l?.value ?? "[1,1]")), c = r?.value ?? [1], h = l?.value ?? [1, 1], [d, p] = B.useState(s), [g, y] = B.useState(u);
  B.useEffect(() => {
    const V = e.parameters?.find((re) => re.name === "num"), Q = V?.expression ?? (Array.isArray(V?.value) ? V.value.join(",") : String(V?.value ?? "[1]"));
    p(Q);
  }, [e.parameters]), B.useEffect(() => {
    const V = e.parameters?.find((re) => re.name === "den"), Q = V?.expression ?? (Array.isArray(V?.value) ? V.value.join(",") : String(V?.value ?? "[1,1]"));
    y(Q);
  }, [e.parameters]);
  const {
    useCustomLatex: x,
    latexValue: w,
    latexError: z,
    handleToggle: M,
    handleChange: A,
    handleApply: T
  } = qu(e.id, e.custom_latex, n), R = (V) => {
    p(V);
  }, q = () => {
    n(e.id, "num", d);
  }, H = (V) => {
    y(V);
  }, $ = () => {
    n(e.id, "den", g);
  };
  return /* @__PURE__ */ O.jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ O.jsxs("div", { className: "mb-3 pb-3 border-b", children: [
      /* @__PURE__ */ O.jsxs("label", { className: "flex items-center text-xs font-medium mb-2 cursor-pointer", children: [
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "checkbox",
            checked: x,
            onChange: (V) => M(V.target.checked),
            className: "mr-2"
          }
        ),
        "Render custom block contents"
      ] }),
      x && /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Custom LaTeX Expression" }),
        /* @__PURE__ */ O.jsx(
          "textarea",
          {
            value: w,
            onChange: (V) => A(V.target.value),
            onBlur: () => T(),
            onKeyDown: (V) => {
              V.key === "Enter" && !V.shiftKey && (V.preventDefault(), V.stopPropagation(), T(), V.currentTarget.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono resize-none",
            rows: 3,
            placeholder: String.raw`e.g., H(s) = \frac{1}{s+1}`
          }
        ),
        z && /* @__PURE__ */ O.jsx("div", { className: "text-xs text-red-600 mt-1", children: z })
      ] })
    ] }),
    /* @__PURE__ */ O.jsxs("div", { children: [
      /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Numerator" }),
      /* @__PURE__ */ O.jsxs("div", { className: "mb-1", children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Expression:" }),
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "text",
            value: d,
            onChange: (V) => R(V.target.value),
            onBlur: () => q(),
            onKeyDown: (V) => {
              V.key === "Enter" && (V.preventDefault(), V.stopPropagation(), q(), V.target.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono",
            placeholder: "e.g., [1, 2, 3] or num_coeffs"
          }
        )
      ] }),
      /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Resolved Value:" }),
        /* @__PURE__ */ O.jsx("div", { className: "px-2 py-1 text-sm bg-gray-50 rounded font-mono text-gray-700", children: O3(c) })
      ] })
    ] }),
    /* @__PURE__ */ O.jsxs("div", { children: [
      /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Denominator" }),
      /* @__PURE__ */ O.jsxs("div", { className: "mb-1", children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Expression:" }),
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "text",
            value: g,
            onChange: (V) => H(V.target.value),
            onBlur: () => $(),
            onKeyDown: (V) => {
              V.key === "Enter" && (V.preventDefault(), V.stopPropagation(), $(), V.target.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono",
            placeholder: String.raw`e.g., [1, 2*zeta, 1] or den_coeffs`
          }
        )
      ] }),
      /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Resolved Value:" }),
        /* @__PURE__ */ O.jsx("div", { className: "px-2 py-1 text-sm bg-gray-50 rounded font-mono text-gray-700", children: O3(h) })
      ] })
    ] })
  ] });
}
function O3(e) {
  return Array.isArray(e) ? `[${e.map((n) => typeof n == "number" ? n.toFixed(3) : String(n)).join(", ")}]` : String(e);
}
function qM({ data: e, id: n, selected: r }) {
  const l = e.custom_latex, s = e.flipped || !1, { width: u, height: c } = $0("state_space", e.width, e.height), { minWidth: h, minHeight: d } = as("state_space"), { blockLabel: p, handleLabelSave: g } = rs(n, e), { getHandlePosition: y } = ls(s), { handleResizeStart: x, handleResize: w, handleResizeEnd: z } = is(
    n
  ), M = Ea(n, "in"), A = Ea(n, "out"), T = l || CM();
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      Pi,
      {
        minWidth: h,
        minHeight: d,
        isVisible: r,
        onResizeStart: x,
        onResize: w,
        onResizeEnd: z,
        handleStyle: {
          width: 8,
          height: 8,
          backgroundColor: "var(--color-primary-600)",
          borderRadius: 2
        },
        lineStyle: {
          borderColor: "var(--color-primary-400)",
          borderWidth: 1
        }
      }
    ),
    /* @__PURE__ */ O.jsxs("div", { className: "relative", style: { width: `${u}px`, height: `${c}px` }, children: [
      /* @__PURE__ */ O.jsxs(
        "div",
        {
          className: "bg-slate-200 border-2 border-primary-600 rounded shadow-md relative flex items-center justify-center",
          style: { width: `${u}px`, height: `${c}px` },
          children: [
            /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "target",
                position: y(he.Left),
                id: "in",
                style: {
                  position: "absolute",
                  left: s ? "100%" : "0",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: y(he.Left),
                    portType: "input",
                    isConnected: M,
                    isFlipped: s
                  }
                )
              }
            ),
            /* @__PURE__ */ O.jsx("div", { className: "text-center px-2", children: /* @__PURE__ */ O.jsx(Lu, { latex: T, autoScale: !0, className: "text-primary-600" }) }),
            /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "source",
                position: y(he.Right),
                id: "out",
                style: {
                  position: "absolute",
                  left: s ? "0" : "100%",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: y(he.Right),
                    portType: "output",
                    isConnected: A,
                    isFlipped: s
                  }
                )
              }
            )
          ]
        }
      ),
      e.label_visible && /* @__PURE__ */ O.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1", children: /* @__PURE__ */ O.jsx(
        Nl,
        {
          value: p,
          onSave: g,
          className: "text-xs text-slate-600 font-mono whitespace-nowrap"
        }
      ) })
    ] })
  ] });
}
function UM({
  name: e,
  expression: n,
  value: r,
  isEditing: l,
  onEdit: s,
  onSave: u,
  onCancel: c
}) {
  const [h, d] = ce.useState(n || "");
  ce.useEffect(() => {
    d(n || "");
  }, [n]);
  const p = (g) => {
    g.key === "Enter" && !g.shiftKey ? (g.preventDefault(), u(h)) : g.key === "Escape" && (g.preventDefault(), c());
  };
  return /* @__PURE__ */ O.jsxs("div", { className: "matrix-display border border-gray-300 rounded p-1.5 mb-1.5", children: [
    /* @__PURE__ */ O.jsx("div", { className: "font-semibold text-xs text-gray-700 mb-1", children: e }),
    /* @__PURE__ */ O.jsxs("div", { className: "mb-1", children: [
      /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Expression:" }),
      l ? /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "text",
            value: h,
            onChange: (g) => d(g.target.value),
            onKeyDown: p,
            onBlur: () => u(h),
            className: "w-full px-1.5 py-0.5 text-xs border border-blue-500 rounded font-mono",
            placeholder: "e.g., A_matrix or np.eye(2)",
            autoFocus: !0
          }
        ),
        /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-400 mt-0.5", children: "Enter to save, Esc to cancel" })
      ] }) : /* @__PURE__ */ O.jsx(
        "div",
        {
          onClick: s,
          className: "px-1.5 py-0.5 text-xs bg-gray-50 rounded font-mono cursor-pointer hover:bg-gray-100",
          children: n || /* @__PURE__ */ O.jsx("span", { className: "text-gray-400 italic text-[10px]", children: "Click to add" })
        }
      )
    ] }),
    r && r.length > 0 && /* @__PURE__ */ O.jsxs("div", { children: [
      /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-500 mb-0.5", children: "Value:" }),
      /* @__PURE__ */ O.jsx("div", { className: "matrix-value bg-blue-50 p-1 rounded text-[10px] font-mono overflow-auto max-h-20", children: jM(r) })
    ] })
  ] });
}
function jM(e) {
  if (!e || e.length === 0)
    return "[]";
  const n = Math.max(...e.map((s) => s.length)), r = [];
  for (let s = 0; s < n; s++) {
    let u = 0;
    for (const c of e)
      if (s < c.length) {
        const h = H3(c[s]);
        u = Math.max(u, h.length);
      }
    r.push(u);
  }
  return e.map((s) => `[${s.map((c, h) => H3(c).padStart(r[h], " ")).join("  ")}]`).join(`
`);
}
function H3(e) {
  return isFinite(e) ? Math.abs(e) < 1e-3 && e !== 0 || Math.abs(e) > 1e3 ? e.toExponential(2) : e.toFixed(3) : String(e);
}
function VM({ block: e, onUpdate: n }) {
  const [r, l] = B.useState(null), {
    useCustomLatex: s,
    latexValue: u,
    latexError: c,
    handleToggle: h,
    handleChange: d,
    handleApply: p
  } = qu(e.id, e.custom_latex, n);
  return /* @__PURE__ */ O.jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ O.jsxs("div", { className: "mb-3 pb-3 border-b", children: [
      /* @__PURE__ */ O.jsxs("label", { className: "flex items-center text-xs font-medium mb-2 cursor-pointer", children: [
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "checkbox",
            checked: s,
            onChange: (g) => h(g.target.checked),
            className: "mr-2"
          }
        ),
        "Render custom block contents"
      ] }),
      s && /* @__PURE__ */ O.jsxs("div", { children: [
        /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Custom LaTeX Expression" }),
        /* @__PURE__ */ O.jsx(
          "textarea",
          {
            value: u,
            onChange: (g) => d(g.target.value),
            onBlur: () => p(),
            onKeyDown: (g) => {
              g.key === "Enter" && !g.shiftKey && (g.preventDefault(), g.stopPropagation(), p(), g.currentTarget.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono resize-none",
            rows: 3,
            placeholder: String.raw`e.g., \dot{x} = Ax + Bu`
          }
        ),
        c && /* @__PURE__ */ O.jsx("div", { className: "text-xs text-red-600 mt-1", children: c })
      ] })
    ] }),
    /* @__PURE__ */ O.jsx("div", { className: "text-[10px] text-gray-600 mb-1", children: "State Space: x' = Ax + Bu, y = Cx + Du" }),
    /* @__PURE__ */ O.jsx("div", { children: ["A", "B", "C", "D"].map((g) => {
      const y = e.parameters.find((x) => x.name === g);
      return /* @__PURE__ */ O.jsx(
        UM,
        {
          name: g,
          expression: y?.expression || null,
          value: y?.value || null,
          isEditing: r === g,
          onEdit: () => l(g),
          onSave: (x) => {
            n(e.id, g, x), l(null);
          },
          onCancel: () => l(null)
        },
        g
      );
    }) })
  ] });
}
function YM({ data: e, id: n, selected: r }) {
  const l = e.parameters?.find(($) => $.name === "index")?.value ?? 0, s = e.custom_latex, u = e.flipped || !1, c = e.ports?.some(($) => $.type === "output"), h = e.ports?.some(($) => $.type === "input"), { width: d, height: p } = $0("io_marker", e.width, e.height), { minWidth: g, minHeight: y } = as("io_marker"), { blockLabel: x, handleLabelSave: w } = rs(n, e), { getHandlePosition: z } = ls(u), { handleResizeStart: M, handleResize: A, handleResizeEnd: T } = is(
    n
  ), R = Ea(n, "in"), q = Ea(n, "out"), H = s || String.raw`${l}`;
  return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      Pi,
      {
        minWidth: g,
        minHeight: y,
        isVisible: r,
        onResizeStart: M,
        onResize: A,
        onResizeEnd: T,
        handleStyle: {
          width: 8,
          height: 8,
          backgroundColor: "var(--color-primary-600)",
          borderRadius: 2
        },
        lineStyle: {
          borderColor: "var(--color-primary-400)",
          borderWidth: 1
        }
      }
    ),
    /* @__PURE__ */ O.jsxs("div", { className: "relative", style: { width: `${d}px`, height: `${p}px` }, children: [
      /* @__PURE__ */ O.jsxs(
        "div",
        {
          className: "bg-slate-200 border-2 border-primary-600 rounded-full shadow-md relative flex items-center justify-center",
          style: { width: `${d}px`, height: `${p}px` },
          children: [
            h && /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "target",
                position: z(he.Left),
                id: "in",
                style: {
                  position: "absolute",
                  left: u ? "100%" : "0",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: z(he.Left),
                    portType: "input",
                    isConnected: R,
                    isFlipped: u
                  }
                )
              }
            ),
            /* @__PURE__ */ O.jsx("div", { className: "text-center px-2", children: /* @__PURE__ */ O.jsx(
              Lu,
              {
                latex: H,
                autoScale: !0,
                displayMode: !0,
                className: "text-primary-600"
              }
            ) }),
            c && /* @__PURE__ */ O.jsx(
              Tn,
              {
                type: "source",
                position: z(he.Right),
                id: "out",
                style: {
                  position: "absolute",
                  left: u ? "0" : "100%",
                  top: "50%",
                  transform: "translate(-50%, -50%)"
                },
                children: /* @__PURE__ */ O.jsx(
                  wa,
                  {
                    position: z(he.Right),
                    portType: "output",
                    isConnected: q,
                    isFlipped: u
                  }
                )
              }
            )
          ]
        }
      ),
      e.label_visible && /* @__PURE__ */ O.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1", children: /* @__PURE__ */ O.jsx(
        Nl,
        {
          value: x,
          onSave: w,
          className: "text-xs text-slate-600 font-mono whitespace-nowrap"
        }
      ) })
    ] })
  ] });
}
function GM({ block: e, onUpdate: n }) {
  const l = e.parameters?.find((M) => M.name === "index")?.value ?? 0, [s, u] = B.useState(String(l)), c = B.useRef(s);
  B.useLayoutEffect(() => {
    c.current = s;
  }, [s]), B.useEffect(() => {
    const M = e.parameters?.find((A) => A.name === "index");
    u(String(M?.value ?? 0));
  }, [e.parameters]);
  const {
    useCustomLatex: h,
    latexValue: d,
    latexError: p,
    handleToggle: g,
    handleChange: y,
    handleApply: x
  } = qu(e.id, e.custom_latex, n), w = (M) => {
    u(M);
  }, z = () => {
    const M = c.current, A = M === "" ? 0 : parseInt(M, 10), T = isNaN(A) || A < 0 ? 0 : A;
    n(e.id, "index", T);
  };
  return /* @__PURE__ */ O.jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ O.jsxs("div", { className: "mb-3 pb-3 border-b", children: [
      /* @__PURE__ */ O.jsxs("label", { className: "flex items-center text-xs font-medium mb-2 cursor-pointer", children: [
        /* @__PURE__ */ O.jsx(
          "input",
          {
            type: "checkbox",
            checked: h,
            onChange: (M) => g(M.target.checked),
            className: "mr-2"
          }
        ),
        "Render custom block contents"
      ] }),
      h && /* @__PURE__ */ O.jsxs("div", { style: { display: h ? "block" : "none" }, children: [
        /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Custom LaTeX Expression" }),
        /* @__PURE__ */ O.jsx(
          "textarea",
          {
            value: d,
            onChange: (M) => y(M.target.value),
            onBlur: () => x(),
            onKeyDown: (M) => {
              M.key === "Enter" && !M.shiftKey && (M.preventDefault(), M.stopPropagation(), x(), M.currentTarget.blur());
            },
            className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono resize-none",
            rows: 3,
            placeholder: String.raw`e.g., r, \theta, \dot{x}`
          }
        ),
        p && /* @__PURE__ */ O.jsx("div", { className: "text-xs text-red-600 mt-1", children: p })
      ] })
    ] }),
    /* @__PURE__ */ O.jsxs("div", { children: [
      /* @__PURE__ */ O.jsx("label", { className: "block text-xs font-medium mb-1", children: "Index" }),
      /* @__PURE__ */ O.jsx(
        "input",
        {
          type: "text",
          value: s,
          onChange: (M) => w(M.target.value),
          onBlur: () => z(),
          onKeyDown: (M) => {
            M.key === "Enter" && (M.preventDefault(), M.target.blur());
          },
          className: "w-full px-2 py-1 text-sm border rounded focus:outline-none focus:ring-1 focus:ring-blue-500",
          placeholder: "0"
        }
      )
    ] })
  ] });
}
const g7 = {
  [fn.GAIN]: DM,
  [fn.IO_MARKER]: YM,
  [fn.SUM]: OM,
  [fn.TRANSFER_FUNCTION]: HM,
  [fn.STATE_SPACE]: qM
}, XM = {
  [fn.GAIN]: _M,
  [fn.IO_MARKER]: GM,
  [fn.TRANSFER_FUNCTION]: LM,
  [fn.STATE_SPACE]: VM
}, $M = 200;
function ZM() {
  const e = B.useContext(W0), [n, r] = B.useState(!1), l = B.useRef(null);
  B.useEffect(() => () => {
    l.current && clearTimeout(l.current);
  }, []);
  const s = B.useCallback(() => {
    l.current && (clearTimeout(l.current), l.current = null), r(!0);
  }, []), u = B.useCallback(() => {
    l.current = window.setTimeout(() => {
      r(!1);
    }, $M);
  }, []), c = (h, d = {}) => {
    if (!e) return;
    const p = `${h}_${Date.now()}`;
    Mt(e, "addBlock", {
      blockType: h,
      id: p,
      position: {
        x: 250,
        // Center of typical viewport
        y: 200
      },
      ...d
    });
  };
  return /* @__PURE__ */ O.jsxs(
    "div",
    {
      "data-testid": "block-palette",
      className: "absolute top-2 left-2 z-10 bg-slate-100 border-2 border-slate-300 rounded-lg shadow-lg",
      onMouseEnter: s,
      onMouseLeave: u,
      children: [
        /* @__PURE__ */ O.jsx("div", { className: "px-3 py-1.5 text-xs font-semibold text-slate-600 cursor-default", children: "Library" }),
        /* @__PURE__ */ O.jsxs(
          "div",
          {
            "data-testid": "button-panel",
            className: `flex flex-col gap-1 transition-all duration-150 ease-in-out ${n ? "max-h-96 opacity-100 p-2 pt-0" : "max-h-0 opacity-0 overflow-hidden"}`,
            children: [
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.GAIN, { K: 1 }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add Gain Block (K)",
                  children: "Gain"
                }
              ),
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.IO_MARKER, { marker_type: "input", label: "u" }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add Input Marker",
                  children: "Input"
                }
              ),
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.IO_MARKER, { marker_type: "output", label: "y" }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add Output Marker",
                  children: "Output"
                }
              ),
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.SUM, { signs: ["+", "+", "|"] }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add Sum Block (top, left, bottom quadrants)",
                  children: "Sum"
                }
              ),
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.TRANSFER_FUNCTION, { num: [1], den: [1, 1] }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add Transfer Function Block",
                  children: "TF"
                }
              ),
              /* @__PURE__ */ O.jsx(
                "button",
                {
                  onClick: () => c(fn.STATE_SPACE, {
                    A: [
                      [0, 1],
                      [-1, -1]
                    ],
                    B: [[0], [1]],
                    C: [[1, 0]],
                    D: [[0]]
                  }),
                  disabled: !e,
                  className: "palette-button w-full px-3 py-1.5 bg-slate-600 text-slate-50 text-xs rounded hover:bg-primary-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",
                  title: "Add State Space Block",
                  children: "SS"
                }
              )
            ]
          }
        )
      ]
    }
  );
}
function FM({ block: e, onUpdate: n, onClose: r }) {
  const l = B.useCallback(
    (u) => {
      if (u.key === "Enter" && !u.shiftKey) {
        const c = document.activeElement;
        c instanceof HTMLInputElement || c instanceof HTMLTextAreaElement || (u.preventDefault(), r());
      }
    },
    [r]
  );
  if (!e || e.type === "sum") return null;
  const s = XM[e.type];
  return s ? /* @__PURE__ */ O.jsxs(
    "div",
    {
      tabIndex: 0,
      onKeyDown: l,
      className: "absolute top-2 right-2 z-10 bg-white rounded shadow-lg min-w-[250px] max-w-[350px] max-h-[280px] flex flex-col focus:outline-none",
      children: [
        /* @__PURE__ */ O.jsxs("div", { className: "flex justify-between items-center px-3 py-2 border-b flex-shrink-0", children: [
          /* @__PURE__ */ O.jsx("h3", { className: "text-sm font-semibold", children: "Edit Block Parameters" }),
          /* @__PURE__ */ O.jsx(
            "button",
            {
              onClick: r,
              className: "text-gray-500 hover:text-gray-700 text-lg leading-none",
              title: "Close",
              children: "×"
            }
          )
        ] }),
        /* @__PURE__ */ O.jsxs("div", { className: "overflow-y-auto flex-1 px-3 py-2", children: [
          /* @__PURE__ */ O.jsx(
            IE,
            {
              blockId: e.id,
              initialLabel: e.label || e.id,
              onUpdate: n
            }
          ),
          /* @__PURE__ */ O.jsx(s, { block: e, onUpdate: n })
        ] })
      ]
    }
  ) : null;
}
function IM({ validationResult: e }) {
  const [n, r] = B.useState(!1), l = e?.errors?.length ?? !1, s = e?.warnings?.length ?? !1, u = !l && !s;
  let c, h, d, p, g;
  return l ? (h = "var(--color-error)", d = "bg-red-50", p = "border-red-500", g = "Validation Errors", c = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z") : s ? (h = "var(--color-warning)", d = "bg-yellow-50", p = "border-yellow-500", g = "Validation Warnings", c = "M12 2L1 21h22L12 2zm0 3.99L19.53 19H4.47L12 5.99zM11 16h2v2h-2v-2zm0-6h2v4h-2v-4z") : (h = "var(--color-success)", d = "bg-green-50", p = "border-green-500", g = "Valid", c = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
    /* @__PURE__ */ O.jsx(
      "button",
      {
        onClick: () => r(!n),
        className: "react-flow__controls-button validation-button",
        title: g,
        "aria-label": g,
        children: /* @__PURE__ */ O.jsx(
          "svg",
          {
            xmlns: "http://www.w3.org/2000/svg",
            viewBox: "0 0 24 24",
            fill: h,
            style: {
              width: "100%",
              height: "100%"
            },
            children: /* @__PURE__ */ O.jsx("path", { d: c })
          }
        )
      }
    ),
    n && /* @__PURE__ */ O.jsxs(
      "div",
      {
        className: `absolute bottom-0 left-12 z-40 rounded-lg shadow-lg border-2 ${p} ${d} max-w-2xl`,
        style: { marginBottom: "10px", minWidth: "500px" },
        children: [
          /* @__PURE__ */ O.jsxs(
            "div",
            {
              className: `flex items-center justify-between px-4 py-2 border-b ${p}`,
              children: [
                /* @__PURE__ */ O.jsx("h3", { className: "font-semibold text-xs", children: g }),
                /* @__PURE__ */ O.jsx(
                  "button",
                  {
                    onClick: () => r(!1),
                    className: "text-lg font-bold hover:opacity-70",
                    "aria-label": "Close",
                    children: "×"
                  }
                )
              ]
            }
          ),
          /* @__PURE__ */ O.jsxs("div", { className: "px-4 py-3 space-y-2 max-h-64 overflow-y-auto", children: [
            l && e && /* @__PURE__ */ O.jsx("div", { children: e.errors.map((y, x) => /* @__PURE__ */ O.jsxs(
              "div",
              {
                className: "flex items-start gap-2 text-xs text-red-700 mb-2",
                children: [
                  /* @__PURE__ */ O.jsx("span", { className: "font-bold", children: "•" }),
                  /* @__PURE__ */ O.jsx("span", { children: y })
                ]
              },
              `error-${x}`
            )) }),
            s && e && /* @__PURE__ */ O.jsx("div", { children: e.warnings.map((y, x) => /* @__PURE__ */ O.jsxs(
              "div",
              {
                className: "flex items-start gap-2 text-xs text-yellow-700 mb-2",
                children: [
                  /* @__PURE__ */ O.jsx("span", { className: "font-bold", children: "•" }),
                  /* @__PURE__ */ O.jsx("span", { children: y })
                ]
              },
              `warning-${x}`
            )) }),
            u && /* @__PURE__ */ O.jsx("div", { className: "text-xs text-green-700", children: "No validation errors or warnings." })
          ] })
        ]
      }
    )
  ] });
}
function KM({
  x: e,
  y: n,
  labelVisible: r,
  onDelete: l,
  onFlip: s,
  onToggleLabel: u,
  onClose: c
}) {
  const h = B.useRef(null);
  return B.useEffect(() => {
    const d = (g) => {
      h.current && !h.current.contains(g.target) && c();
    }, p = (g) => {
      g.key === "Escape" && c();
    };
    return setTimeout(() => {
      document.addEventListener("mousedown", d), document.addEventListener("keydown", p);
    }, 100), () => {
      document.removeEventListener("mousedown", d), document.removeEventListener("keydown", p);
    };
  }, [c]), /* @__PURE__ */ O.jsxs(
    "div",
    {
      ref: h,
      className: "fixed bg-white border border-slate-300 rounded-lg shadow-lg py-1 z-50 min-w-32",
      style: {
        left: `${e}px`,
        top: `${n}px`
      },
      children: [
        u && /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              u(), c();
            },
            className: "w-full px-4 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: "🏷️" }),
              /* @__PURE__ */ O.jsx("span", { children: r ? "Hide Label" : "Show Label" })
            ]
          }
        ),
        s && /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              s(), c();
            },
            className: "w-full px-4 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: "↔️" }),
              /* @__PURE__ */ O.jsx("span", { children: "Flip Horizontal" })
            ]
          }
        ),
        /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              l(), c();
            },
            className: "w-full px-4 py-2 text-left text-sm text-red-600 hover:bg-red-50 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: "🗑️" }),
              /* @__PURE__ */ O.jsx("span", { children: "Delete" })
            ]
          }
        )
      ]
    }
  );
}
function QM({
  x: e,
  y: n,
  hasCustomRouting: r,
  labelVisible: l,
  onToggleLabel: s,
  onResetRouting: u,
  onDelete: c,
  onClose: h
}) {
  const d = B.useRef(null);
  return B.useEffect(() => {
    const p = (y) => {
      d.current && !d.current.contains(y.target) && h();
    }, g = (y) => {
      y.key === "Escape" && h();
    };
    return setTimeout(() => {
      document.addEventListener("mousedown", p), document.addEventListener("keydown", g);
    }, 100), () => {
      document.removeEventListener("mousedown", p), document.removeEventListener("keydown", g);
    };
  }, [h]), /* @__PURE__ */ O.jsxs(
    "div",
    {
      ref: d,
      className: "fixed bg-white border border-slate-300 rounded-lg shadow-lg py-1 z-50 min-w-40",
      style: {
        left: `${e}px`,
        top: `${n}px`
      },
      children: [
        /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              s(), h();
            },
            className: "w-full px-4 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: l ? "👁️‍🗨️" : "👁️" }),
              /* @__PURE__ */ O.jsx("span", { children: l ? "Hide Label" : "Show Label" })
            ]
          }
        ),
        r && /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              u(), h();
            },
            className: "w-full px-4 py-2 text-left text-sm text-slate-700 hover:bg-slate-100 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: "↺" }),
              /* @__PURE__ */ O.jsx("span", { children: "Reset to Auto Routing" })
            ]
          }
        ),
        /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => {
              c(), h();
            },
            className: "w-full px-4 py-2 text-left text-sm text-red-600 hover:bg-red-50 flex items-center gap-2",
            children: [
              /* @__PURE__ */ O.jsx("span", { children: "🗑️" }),
              /* @__PURE__ */ O.jsx("span", { children: "Delete Connection" })
            ]
          }
        )
      ]
    }
  );
}
const y7 = {
  background: "var(--color-slate-100)",
  border: "1px solid var(--color-slate-300)",
  borderRadius: "4px",
  boxShadow: "var(--shadow-xl)",
  padding: "4px 0",
  minWidth: "80px",
  zIndex: 1e3
}, v7 = {
  display: "flex",
  alignItems: "center",
  width: "100%",
  padding: "2px 8px",
  border: "none",
  background: "transparent",
  cursor: "pointer",
  fontSize: "14px",
  textAlign: "left"
}, JM = {
  position: "absolute",
  left: "100%",
  bottom: "-5px",
  marginLeft: "0px"
}, ch = {
  fontSize: "12px",
  color: "var(--color-slate-600)",
  fontWeight: 500
}, WM = {
  ...v7,
  justifyContent: "space-between"
}, PM = {
  ...v7,
  ...ch,
  gap: "2px"
}, vl = {
  hoverBg: "var(--color-slate-200)",
  activeBg: "var(--color-slate-200)",
  transparent: "transparent"
}, eT = {
  position: "absolute",
  left: "42px",
  bottom: "15px"
}, tT = [
  { value: "light", label: "Light" },
  { value: "dark", label: "Dark" },
  { value: "high-contrast", label: "High Contrast" },
  { value: "archimedes-light", label: "Archimedes (Light)" },
  { value: "archimedes-dark", label: "Archimedes (Dark)" }
];
function nT({ activeTheme: e, onThemeChange: n }) {
  return /* @__PURE__ */ O.jsx(
    "div",
    {
      className: "theme-selector",
      role: "menu",
      "aria-label": "Theme selection",
      style: { minWidth: "160px" },
      children: tT.map((r) => /* @__PURE__ */ O.jsxs(
        "button",
        {
          className: "theme-option",
          role: "menuitem",
          onClick: () => n(r.value),
          style: PM,
          onMouseEnter: (l) => {
            l.currentTarget.style.background = vl.hoverBg;
          },
          onMouseLeave: (l) => {
            l.currentTarget.style.background = vl.transparent;
          },
          children: [
            /* @__PURE__ */ O.jsx("span", { style: { width: "16px", fontWeight: "bold" }, children: e === r.value ? "✓" : "" }),
            /* @__PURE__ */ O.jsx("span", { children: r.label })
          ]
        },
        r.value
      ))
    }
  );
}
function aT({ activeTheme: e, onThemeChange: n, onClose: r }) {
  const [l, s] = B.useState(null), u = (c) => {
    s(l === c ? null : c);
  };
  return /* @__PURE__ */ O.jsx(
    "div",
    {
      style: {
        minWidth: "80px"
      },
      children: /* @__PURE__ */ O.jsxs("div", { style: { position: "relative" }, children: [
        /* @__PURE__ */ O.jsxs(
          "button",
          {
            onClick: () => u("theme"),
            style: {
              ...WM,
              background: l === "theme" ? vl.activeBg : vl.transparent
            },
            onMouseEnter: (c) => {
              l !== "theme" && (c.currentTarget.style.background = vl.hoverBg);
            },
            onMouseLeave: (c) => {
              l !== "theme" && (c.currentTarget.style.background = vl.transparent);
            },
            children: [
              /* @__PURE__ */ O.jsx("span", { style: ch, children: "Theme" }),
              /* @__PURE__ */ O.jsx("span", { style: ch, children: "▶" })
            ]
          }
        ),
        l === "theme" && /* @__PURE__ */ O.jsx(
          "div",
          {
            style: {
              ...y7,
              ...JM,
              minWidth: "140px"
              // Override to fit "High Contrast" text
            },
            children: /* @__PURE__ */ O.jsx(
              nT,
              {
                activeTheme: e,
                onThemeChange: (c) => {
                  n(c), r();
                }
              }
            )
          }
        )
      ] })
    }
  );
}
const rT = [
  "light",
  "dark",
  "high-contrast",
  "archimedes-light",
  "archimedes-dark"
];
function L3(e) {
  return e && rT.includes(e) ? e : (console.warn(`Invalid theme name: ${e}. Using default "light".`), "light");
}
const lT = {
  orthogonal: f7
};
function iT(e, n) {
  const r = n.x - e.x, l = n.y - e.y;
  return r * r + l * l;
}
function sT() {
  const e = B.useContext(W0), [n, r] = B.useState([]), [l, s] = B.useState([]), [u, c] = B.useState(null), [h, d] = B.useState(null), [p, g] = B.useState(null), [y, x] = B.useState(!1), [w, z] = B.useState("light"), [M, A] = B.useState("#3e4d98"), T = B.useRef(null), [R, q] = B.useState(null), [H, $] = B.useState(null), V = B.useRef(null), [Q, re] = B.useState(!1), te = B.useRef({}), ie = B.useRef(!1);
  B.useEffect(() => {
    if (!e) return;
    const be = e.get("theme") || "light", ye = L3(be);
    z(ye), T.current && T.current.setAttribute("data-theme", ye);
    const ze = () => {
      const _e = e.get("theme") || "light", je = L3(_e);
      z(je), T.current && T.current.setAttribute("data-theme", je);
    };
    return e.on("change:theme", ze), () => {
      e.off("change:theme", ze);
    };
  }, [e]), B.useEffect(() => {
    T.current && requestAnimationFrame(() => {
      if (!T.current) return;
      const ye = getComputedStyle(T.current).getPropertyValue("--color-primary-600").trim();
      ye && (A(ye), s(
        (ze) => ze.map((_e) => ({
          ..._e,
          style: { ..._e.style, stroke: ye },
          markerEnd: _e.markerEnd ? {
            ..._e.markerEnd,
            color: ye
          } : void 0
        }))
      ));
    });
  }, [w]);
  const ue = B.useCallback(
    (be) => sh(be, M),
    [M]
  );
  B.useEffect(() => {
    if (!e) return;
    const be = _h(e);
    return d(be), r(be.blocks.map(Su)), s(be.connections.map(ue)), pp(e, (ze) => {
      d(ze), r((_e) => {
        const je = ze.blocks.map(Su), Ee = new Map(_e.map((Oe) => [Oe.id, Oe]));
        return je.map((Oe) => {
          const ot = Ee.get(Oe.id);
          if (ot) {
            const wt = Oe.position, Vt = ot.position, mn = Math.abs(wt.x - Vt.x) > Qo.positionChangeThresholdPx || Math.abs(wt.y - Vt.y) > Qo.positionChangeThresholdPx, We = Oe.data.label, Yt = ot.data.label, Zt = We !== Yt;
            return {
              ...Oe,
              // Position: Trust Python if changed significantly (undo/redo),
              // otherwise preserve React's value (in-progress drag).
              // Always create new object {...} to force React Flow re-render.
              position: mn ? Oe.position : { ...ot.position },
              // Label: Trust Python if changed (undo/redo), otherwise preserve React.
              // Prevents label flickering during Python round-trip.
              data: {
                ...Oe.data,
                label: Zt ? We : Yt
              },
              // Selection: Always preserve React's selection state.
              // This is UI-only state that Python doesn't manage.
              // Required for keyboard delete and visual feedback.
              selected: ot.selected || !1
            };
          }
          return Oe;
        });
      }), s(ze.connections.map(ue));
    });
  }, [e, ue]), B.useEffect(() => {
    if (!e) return;
    const be = () => {
      const ye = e.get("validation_result");
      ye && (ye.errors?.length > 0 || ye.warnings?.length > 0) ? g(ye) : g(null);
    };
    return be(), e.on("change:validation_result", be), () => {
      e.off("change:validation_result", be);
    };
  }, [e]);
  const de = B.useRef(/* @__PURE__ */ new Set()), ge = B.useCallback(
    (be) => {
      be.forEach((ze) => {
        ze.type === "remove" && l.forEach((_e) => {
          (_e.source === ze.id || _e.target === ze.id) && de.current.add(_e.id);
        });
      });
      const ye = be.filter((ze) => {
        if (ze.type === "position" && !ze.dragging) {
          const _e = te.current[ze.id], je = n.find((Oe) => Oe.id === ze.id), Ee = ze.position || ("positionAbsolute" in ze ? ze.positionAbsolute : void 0) || je?.position;
          if (_e && Ee) {
            const Oe = iT(_e, Ee), ot = Qo.dragThresholdPx * Qo.dragThresholdPx;
            if (Oe < ot)
              return r(
                (wt) => wt.map((Vt) => ({
                  ...Vt,
                  selected: Vt.id === ze.id
                }))
              ), delete te.current[ze.id], !1;
            delete te.current[ze.id];
          }
        }
        return !0;
      });
      r((ze) => W6(ye, ze)), be.forEach((ze) => {
        ze.type === "remove" && Mt(e, "deleteBlock", {
          blockId: ze.id
        });
      });
    },
    [e, l, n]
  ), _ = B.useCallback(() => {
    if (!V.current) return;
    const be = document.querySelector(".react-flow");
    if (!be) return;
    const ye = oh(n, l), ze = uh(
      ye,
      be.offsetWidth,
      be.offsetHeight,
      d7
    );
    V.current.setViewport(ze);
  }, [n, l]);
  B.useEffect(() => {
    if (!Q || n.length === 0 || ie.current) return;
    const be = setTimeout(() => {
      _(), ie.current = !0;
    }, 100);
    return () => clearTimeout(be);
  }, [Q, n.length, _]), B.useEffect(() => {
    if (!e) return;
    const be = (ye) => {
      const ze = ye.target, _e = ze.tagName === "INPUT" || ze.tagName === "TEXTAREA" || ze.isContentEditable;
      if ((ye.ctrlKey || ye.metaKey) && ye.key === "z" && !ye.shiftKey && !_e) {
        ye.preventDefault(), Mt(e, "undo", {});
        return;
      }
      if (((ye.ctrlKey || ye.metaKey) && ye.key === "y" || (ye.ctrlKey || ye.metaKey) && ye.shiftKey && ye.key === "z") && !_e) {
        ye.preventDefault(), Mt(e, "redo", {});
        return;
      }
      if ((ye.key === "Delete" || ye.key === "Backspace") && !_e) {
        ye.preventDefault(), r((Oe) => {
          const ot = Oe.filter((wt) => wt.selected);
          if (ot.length > 0) {
            const wt = ot.map((Vt) => ({
              id: Vt.id,
              type: "remove"
            }));
            ge(wt);
          }
          return Oe;
        });
        return;
      }
      if (ye.key === " " && !_e) {
        ye.preventDefault(), _();
        return;
      }
      if (_e) return;
      const Ee = {
        g: "gain",
        s: "sum",
        t: "transfer_function",
        i: "io_marker",
        // Input
        o: "io_marker"
        // Output (will need to distinguish in handler if needed)
      }[ye.key.toLowerCase()];
      if (Ee && !ye.ctrlKey && !ye.metaKey && !ye.altKey) {
        ye.preventDefault();
        const Oe = `${Ee}_${Date.now()}`, ot = ye.key.toLowerCase() === "i", wt = ot ? "input" : "output", We = {
          blockId: Oe,
          blockType: Ee,
          position: { x: 400, y: 300 }
        };
        Ee === "gain" ? We.K = 1 : Ee === "sum" ? We.signs = ["+", "+"] : Ee === "transfer_function" ? (We.numerator = [1], We.denominator = [1, 1]) : Ee === "io_marker" && (We.marker_type = wt, We.label = ot ? "u" : "y"), Mt(e, "addBlock", We);
      }
    };
    return window.addEventListener("keydown", be), () => {
      window.removeEventListener("keydown", be);
    };
  }, [e, ge, _]);
  const J = B.useCallback((be, ye) => {
    te.current[ye.id] = { x: ye.position.x, y: ye.position.y }, r(
      (ze) => ze.map((_e) => ({
        ..._e,
        selected: !1
      }))
    ), s(
      (ze) => ze.map((_e) => _e.source === ye.id || _e.target === ye.id ? {
        ..._e,
        data: {
          ..._e.data,
          waypoints: []
        }
      } : _e)
    );
  }, []), D = B.useCallback(
    (be, ye) => {
      const ze = EM(ye.id, ye.position, n, l, 20);
      (ze.x !== ye.position.x || ze.y !== ye.position.y) && r(
        (_e) => _e.map((je) => je.id === ye.id ? { ...je, position: ze } : je)
      ), Mt(e, "moveBlock", {
        blockId: ye.id,
        position: ze
      });
    },
    [e, n, l]
  ), Y = B.useCallback(
    (be) => {
      if (!be.source || !be.target) return;
      const ye = `conn_${Date.now()}`;
      Mt(e, "addConnection", {
        connectionId: ye,
        sourceBlockId: be.source,
        sourcePortId: be.sourceHandle || "out",
        targetBlockId: be.target,
        targetPortId: be.targetHandle || "in"
      });
    },
    [e]
  ), I = B.useCallback(
    (be) => {
      s((ye) => {
        const ze = Db(be, ye);
        return be.forEach((_e) => {
          _e.type === "remove" && (de.current.has(_e.id) ? de.current.delete(_e.id) : Mt(e, "deleteConnection", {
            connectionId: _e.id
          }));
        }), ze;
      });
    },
    [e]
  ), F = B.useCallback(() => {
    x(!1);
  }, []), le = B.useCallback(
    (be, ye) => {
      be.stopPropagation(), be.preventDefault(), c(ye.id), e && (e.set("selected_block_id", ye.id), e.save_changes());
    },
    [e]
  ), k = B.useCallback(() => {
    c(null), e && (e.set("selected_block_id", null), e.save_changes()), r(
      (be) => be.map((ye) => ({
        ...ye,
        selected: !1
        // Deselect all nodes
      }))
    ), q(null), $(null), x(!1);
  }, [e]), G = B.useCallback((be, ye) => {
    be.preventDefault(), q({
      x: be.clientX,
      y: be.clientY,
      blockId: ye.id,
      blockType: ye.type || "unknown",
      labelVisible: ye.data?.label_visible || !1
    });
  }, []), ae = B.useCallback(
    (be) => {
      e && Mt(e, "flipBlock", { blockId: be });
    },
    [e]
  ), se = B.useCallback(
    (be) => {
      e && Mt(e, "toggleLabelVisibility", { blockId: be });
    },
    [e]
  ), xe = B.useCallback(
    (be) => {
      e && Mt(e, "deleteBlock", { blockId: be });
    },
    [e]
  ), Te = B.useCallback((be, ye) => {
    be.preventDefault();
    const _e = (ye.data?.waypoints || []).length > 0, je = ye.data?.label_visible || !1;
    $({
      x: be.clientX,
      y: be.clientY,
      connectionId: ye.id,
      hasCustomRouting: _e,
      labelVisible: je
    });
  }, []), Ae = B.useCallback(
    (be) => {
      e && Mt(e, "toggleConnectionLabelVisibility", { connectionId: be });
    },
    [e]
  ), Re = B.useCallback(
    (be) => {
      e && Mt(e, "resetConnectionRouting", { connectionId: be });
    },
    [e]
  ), Be = B.useCallback(
    (be) => {
      e && Mt(e, "deleteConnection", { connectionId: be });
    },
    [e]
  ), Xe = B.useCallback(
    (be, ye, ze) => {
      ye === "label" ? Mt(e, "updateBlockLabel", {
        blockId: be,
        label: ze
      }) : Mt(e, "updateParameter", {
        blockId: be,
        parameterName: ye,
        value: ze
      });
    },
    [e]
  ), lt = B.useCallback(
    (be) => {
      e && Mt(e, "updateTheme", { theme: be });
    },
    [e]
  ), St = h?.blocks.find((be) => be.id === u) || null;
  return /* @__PURE__ */ O.jsxs("div", { ref: T, className: "lynx-widget", "data-theme": w, children: [
    /* @__PURE__ */ O.jsx(ZM, {}),
    /* @__PURE__ */ O.jsx(
      FM,
      {
        block: St,
        onUpdate: Xe,
        onClose: () => c(null)
      }
    ),
    R && /* @__PURE__ */ O.jsx(
      KM,
      {
        x: R.x,
        y: R.y,
        blockId: R.blockId,
        blockType: R.blockType,
        labelVisible: R.labelVisible,
        onDelete: () => xe(R.blockId),
        onFlip: () => ae(R.blockId),
        onToggleLabel: () => se(R.blockId),
        onClose: () => q(null)
      }
    ),
    H && /* @__PURE__ */ O.jsx(
      QM,
      {
        x: H.x,
        y: H.y,
        connectionId: H.connectionId,
        hasCustomRouting: H.hasCustomRouting,
        labelVisible: H.labelVisible,
        onToggleLabel: () => Ae(H.connectionId),
        onResetRouting: () => Re(H.connectionId),
        onDelete: () => Be(H.connectionId),
        onClose: () => $(null)
      }
    ),
    /* @__PURE__ */ O.jsxs(
      Dh,
      {
        nodes: n,
        edges: l,
        onNodesChange: ge,
        onEdgesChange: I,
        onConnect: Y,
        onNodeClick: F,
        onNodeDoubleClick: le,
        onNodeDragStart: J,
        onNodeDragStop: D,
        onNodeContextMenu: G,
        onEdgeContextMenu: Te,
        onPaneClick: k,
        onInit: (be) => {
          V.current = be, re(!0);
        },
        nodeTypes: g7,
        edgeTypes: lT,
        nodeDragThreshold: 5,
        zoomOnDoubleClick: !1,
        defaultViewport: h7,
        minZoom: qi,
        maxZoom: Ui,
        connectionMode: "loose",
        isValidConnection: () => !0,
        defaultEdgeOptions: m7(M),
        style: { backgroundColor: "var(--color-slate-50)" },
        defaultMarkerColor: M,
        proOptions: { hideAttribution: !0 },
        children: [
          /* @__PURE__ */ O.jsx(
            VS,
            {
              color: "var(--color-slate-300)",
              gap: 20,
              size: 0.2,
              variant: "lines",
              style: { opacity: 0.1 }
            }
          ),
          /* @__PURE__ */ O.jsxs(OS, { showInteractive: !1, showZoom: !1, showFitView: !1, children: [
            /* @__PURE__ */ O.jsx(Tr, { onClick: _, title: "Zoom to Fit (Spacebar)", children: /* @__PURE__ */ O.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", children: /* @__PURE__ */ O.jsx(
              "path",
              {
                fill: "currentColor",
                d: "M3 3 L10 3 L10 5 L5 5 L5 10 L3 10 Z M22 3 L29 3 L29 10 L27 10 L27 5 L22 5 Z M3 22 L5 22 L5 27 L10 27 L10 29 L3 29 Z M22 27 L22 29 L29 29 L29 22 L27 22 L27 27 Z"
              }
            ) }) }),
            /* @__PURE__ */ O.jsx(IM, { validationResult: p }),
            /* @__PURE__ */ O.jsx(Tr, { onClick: () => x(!y), title: "Settings", children: /* @__PURE__ */ O.jsx(
              "svg",
              {
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 24 24",
                fill: "var(--color-slate-700)",
                style: {
                  width: "100%",
                  height: "100%",
                  transform: "scale(1.25)"
                },
                children: /* @__PURE__ */ O.jsx(
                  "path",
                  {
                    fillRule: "evenodd",
                    d: "M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843zM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5z",
                    clipRule: "evenodd"
                  }
                )
              }
            ) })
          ] }),
          y && /* @__PURE__ */ O.jsx(
            "div",
            {
              style: {
                ...y7,
                ...eT
              },
              children: /* @__PURE__ */ O.jsx(
                aT,
                {
                  activeTheme: w,
                  onThemeChange: lt,
                  onClose: () => x(!1)
                }
              )
            }
          ),
          /* @__PURE__ */ O.jsx(vh, { position: "bottom-right", style: { margin: 0, padding: 0 }, children: /* @__PURE__ */ O.jsxs(
            "a",
            {
              href: "https://github.com/jcallaham/lynx-dev",
              target: "_blank",
              rel: "noopener noreferrer",
              style: {
                display: "flex",
                alignItems: "center",
                gap: "4px",
                padding: "2px 6px",
                backgroundColor: "var(--color-slate-100)",
                border: "1px solid var(--color-slate-200)",
                borderRadius: "3px",
                textDecoration: "none",
                fontSize: "12px",
                color: "var(--color-slate-500)",
                fontWeight: 500,
                transition: "all 0.2s ease"
              },
              onMouseEnter: (be) => {
                be.currentTarget.style.backgroundColor = "var(--color-slate-50)", be.currentTarget.style.color = "var(--color-slate-700)";
              },
              onMouseLeave: (be) => {
                be.currentTarget.style.backgroundColor = "var(--color-slate-50)", be.currentTarget.style.color = "var(--color-slate-500)";
              },
              children: [
                /* @__PURE__ */ O.jsx(
                  "img",
                  {
                    src: MM,
                    alt: "Lynx",
                    style: {
                      height: "14px",
                      width: "auto",
                      display: "block"
                    }
                  }
                ),
                /* @__PURE__ */ O.jsx("span", { children: "Lynx" })
              ]
            }
          ) })
        ]
      }
    )
  ] });
}
function oT(e, n) {
  if (e.match(/^[a-z]+:\/\//i))
    return e;
  if (e.match(/^\/\//))
    return window.location.protocol + e;
  if (e.match(/^[a-z]+:/i))
    return e;
  const r = document.implementation.createHTMLDocument(), l = r.createElement("base"), s = r.createElement("a");
  return r.head.appendChild(l), r.body.appendChild(s), n && (l.href = n), s.href = e, s.href;
}
const uT = /* @__PURE__ */ (() => {
  let e = 0;
  const n = () => (
    // eslint-disable-next-line no-bitwise
    `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
  );
  return () => (e += 1, `u${n()}${e}`);
})();
function Z0(e) {
  const n = [];
  for (let r = 0, l = e.length; r < l; r++)
    n.push(e[r]);
  return n;
}
let pl = null;
function x7(e = {}) {
  return pl || (e.includeStyleProperties ? (pl = e.includeStyleProperties, pl) : (pl = Z0(window.getComputedStyle(document.documentElement)), pl));
}
function wu(e, n) {
  const l = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(n);
  return l ? parseFloat(l.replace("px", "")) : 0;
}
function cT(e) {
  const n = wu(e, "border-left-width"), r = wu(e, "border-right-width");
  return e.clientWidth + n + r;
}
function fT(e) {
  const n = wu(e, "border-top-width"), r = wu(e, "border-bottom-width");
  return e.clientHeight + n + r;
}
function b7(e, n = {}) {
  const r = n.width || cT(e), l = n.height || fT(e);
  return { width: r, height: l };
}
function hT() {
  let e, n;
  try {
    n = process;
  } catch {
  }
  const r = n && n.env ? n.env.devicePixelRatio : null;
  return r && (e = parseInt(r, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
}
const On = 16384;
function dT(e) {
  (e.width > On || e.height > On) && (e.width > On && e.height > On ? e.width > e.height ? (e.height *= On / e.width, e.width = On) : (e.width *= On / e.height, e.height = On) : e.width > On ? (e.height *= On / e.width, e.width = On) : (e.width *= On / e.height, e.height = On));
}
function Eu(e) {
  return new Promise((n, r) => {
    const l = new Image();
    l.onload = () => {
      l.decode().then(() => {
        requestAnimationFrame(() => n(l));
      });
    }, l.onerror = r, l.crossOrigin = "anonymous", l.decoding = "async", l.src = e;
  });
}
async function mT(e) {
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((n) => `data:image/svg+xml;charset=utf-8,${n}`);
}
async function pT(e, n, r) {
  const l = "http://www.w3.org/2000/svg", s = document.createElementNS(l, "svg"), u = document.createElementNS(l, "foreignObject");
  return s.setAttribute("width", `${n}`), s.setAttribute("height", `${r}`), s.setAttribute("viewBox", `0 0 ${n} ${r}`), u.setAttribute("width", "100%"), u.setAttribute("height", "100%"), u.setAttribute("x", "0"), u.setAttribute("y", "0"), u.setAttribute("externalResourcesRequired", "true"), s.appendChild(u), u.appendChild(e), mT(s);
}
const Mn = (e, n) => {
  if (e instanceof n)
    return !0;
  const r = Object.getPrototypeOf(e);
  return r === null ? !1 : r.constructor.name === n.name || Mn(r, n);
};
function gT(e) {
  const n = e.getPropertyValue("content");
  return `${e.cssText} content: '${n.replace(/'|"/g, "")}';`;
}
function yT(e, n) {
  return x7(n).map((r) => {
    const l = e.getPropertyValue(r), s = e.getPropertyPriority(r);
    return `${r}: ${l}${s ? " !important" : ""};`;
  }).join(" ");
}
function vT(e, n, r, l) {
  const s = `.${e}:${n}`, u = r.cssText ? gT(r) : yT(r, l);
  return document.createTextNode(`${s}{${u}}`);
}
function q3(e, n, r, l) {
  const s = window.getComputedStyle(e, r), u = s.getPropertyValue("content");
  if (u === "" || u === "none")
    return;
  const c = uT();
  try {
    n.className = `${n.className} ${c}`;
  } catch {
    return;
  }
  const h = document.createElement("style");
  h.appendChild(vT(c, r, s, l)), n.appendChild(h);
}
function xT(e, n, r) {
  q3(e, n, ":before", r), q3(e, n, ":after", r);
}
const U3 = "application/font-woff", j3 = "image/jpeg", bT = {
  woff: U3,
  woff2: U3,
  ttf: "application/font-truetype",
  eot: "application/vnd.ms-fontobject",
  png: "image/png",
  jpg: j3,
  jpeg: j3,
  gif: "image/gif",
  tiff: "image/tiff",
  svg: "image/svg+xml",
  webp: "image/webp"
};
function ST(e) {
  const n = /\.([^./]*?)$/g.exec(e);
  return n ? n[1] : "";
}
function ed(e) {
  const n = ST(e).toLowerCase();
  return bT[n] || "";
}
function wT(e) {
  return e.split(/,/)[1];
}
function fh(e) {
  return e.search(/^(data:)/) !== -1;
}
function ET(e, n) {
  return `data:${n};base64,${e}`;
}
async function S7(e, n, r) {
  const l = await fetch(e, n);
  if (l.status === 404)
    throw new Error(`Resource "${l.url}" not found`);
  const s = await l.blob();
  return new Promise((u, c) => {
    const h = new FileReader();
    h.onerror = c, h.onloadend = () => {
      try {
        u(r({ res: l, result: h.result }));
      } catch (d) {
        c(d);
      }
    }, h.readAsDataURL(s);
  });
}
const O1 = {};
function MT(e, n, r) {
  let l = e.replace(/\?.*/, "");
  return r && (l = e), /ttf|otf|eot|woff2?/i.test(l) && (l = l.replace(/.*\//, "")), n ? `[${n}]${l}` : l;
}
async function td(e, n, r) {
  const l = MT(e, n, r.includeQueryParams);
  if (O1[l] != null)
    return O1[l];
  r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
  let s;
  try {
    const u = await S7(e, r.fetchRequestInit, ({ res: c, result: h }) => (n || (n = c.headers.get("Content-Type") || ""), wT(h)));
    s = ET(u, n);
  } catch (u) {
    s = r.imagePlaceholder || "";
    let c = `Failed to fetch resource: ${e}`;
    u && (c = typeof u == "string" ? u : u.message), c && console.warn(c);
  }
  return O1[l] = s, s;
}
async function TT(e) {
  const n = e.toDataURL();
  return n === "data:," ? e.cloneNode(!1) : Eu(n);
}
async function zT(e, n) {
  if (e.currentSrc) {
    const u = document.createElement("canvas"), c = u.getContext("2d");
    u.width = e.clientWidth, u.height = e.clientHeight, c?.drawImage(e, 0, 0, u.width, u.height);
    const h = u.toDataURL();
    return Eu(h);
  }
  const r = e.poster, l = ed(r), s = await td(r, l, n);
  return Eu(s);
}
async function AT(e, n) {
  var r;
  try {
    if (!((r = e?.contentDocument) === null || r === void 0) && r.body)
      return await Uu(e.contentDocument.body, n, !0);
  } catch {
  }
  return e.cloneNode(!1);
}
async function CT(e, n) {
  return Mn(e, HTMLCanvasElement) ? TT(e) : Mn(e, HTMLVideoElement) ? zT(e, n) : Mn(e, HTMLIFrameElement) ? AT(e, n) : e.cloneNode(w7(e));
}
const NT = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", w7 = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
async function kT(e, n, r) {
  var l, s;
  if (w7(n))
    return n;
  let u = [];
  return NT(e) && e.assignedNodes ? u = Z0(e.assignedNodes()) : Mn(e, HTMLIFrameElement) && (!((l = e.contentDocument) === null || l === void 0) && l.body) ? u = Z0(e.contentDocument.body.childNodes) : u = Z0(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), u.length === 0 || Mn(e, HTMLVideoElement) || await u.reduce((c, h) => c.then(() => Uu(h, r)).then((d) => {
    d && n.appendChild(d);
  }), Promise.resolve()), n;
}
function DT(e, n, r) {
  const l = n.style;
  if (!l)
    return;
  const s = window.getComputedStyle(e);
  s.cssText ? (l.cssText = s.cssText, l.transformOrigin = s.transformOrigin) : x7(r).forEach((u) => {
    let c = s.getPropertyValue(u);
    u === "font-size" && c.endsWith("px") && (c = `${Math.floor(parseFloat(c.substring(0, c.length - 2))) - 0.1}px`), Mn(e, HTMLIFrameElement) && u === "display" && c === "inline" && (c = "block"), u === "d" && n.getAttribute("d") && (c = `path(${n.getAttribute("d")})`), l.setProperty(u, c, s.getPropertyPriority(u));
  });
}
function _T(e, n) {
  Mn(e, HTMLTextAreaElement) && (n.innerHTML = e.value), Mn(e, HTMLInputElement) && n.setAttribute("value", e.value);
}
function RT(e, n) {
  if (Mn(e, HTMLSelectElement)) {
    const l = Array.from(n.children).find((s) => e.value === s.getAttribute("value"));
    l && l.setAttribute("selected", "");
  }
}
function BT(e, n, r) {
  return Mn(n, Element) && (DT(e, n, r), xT(e, n, r), _T(e, n), RT(e, n)), n;
}
async function OT(e, n) {
  const r = e.querySelectorAll ? e.querySelectorAll("use") : [];
  if (r.length === 0)
    return e;
  const l = {};
  for (let u = 0; u < r.length; u++) {
    const h = r[u].getAttribute("xlink:href");
    if (h) {
      const d = e.querySelector(h), p = document.querySelector(h);
      !d && p && !l[h] && (l[h] = await Uu(p, n, !0));
    }
  }
  const s = Object.values(l);
  if (s.length) {
    const u = "http://www.w3.org/1999/xhtml", c = document.createElementNS(u, "svg");
    c.setAttribute("xmlns", u), c.style.position = "absolute", c.style.width = "0", c.style.height = "0", c.style.overflow = "hidden", c.style.display = "none";
    const h = document.createElementNS(u, "defs");
    c.appendChild(h);
    for (let d = 0; d < s.length; d++)
      h.appendChild(s[d]);
    e.appendChild(c);
  }
  return e;
}
async function Uu(e, n, r) {
  return !r && n.filter && !n.filter(e) ? null : Promise.resolve(e).then((l) => CT(l, n)).then((l) => kT(e, l, n)).then((l) => BT(e, l, n)).then((l) => OT(l, n));
}
const E7 = /url\((['"]?)([^'"]+?)\1\)/g, HT = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, LT = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
function qT(e) {
  const n = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
  return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`, "g");
}
function UT(e) {
  const n = [];
  return e.replace(E7, (r, l, s) => (n.push(s), r)), n.filter((r) => !fh(r));
}
async function jT(e, n, r, l, s) {
  try {
    const u = r ? oT(n, r) : n, c = ed(n);
    let h;
    return s || (h = await td(u, c, l)), e.replace(qT(n), `$1${h}$3`);
  } catch {
  }
  return e;
}
function VT(e, { preferredFontFormat: n }) {
  return n ? e.replace(LT, (r) => {
    for (; ; ) {
      const [l, , s] = HT.exec(r) || [];
      if (!s)
        return "";
      if (s === n)
        return `src: ${l};`;
    }
  }) : e;
}
function M7(e) {
  return e.search(E7) !== -1;
}
async function T7(e, n, r) {
  if (!M7(e))
    return e;
  const l = VT(e, r);
  return UT(l).reduce((u, c) => u.then((h) => jT(h, c, n, r)), Promise.resolve(l));
}
async function gl(e, n, r) {
  var l;
  const s = (l = n.style) === null || l === void 0 ? void 0 : l.getPropertyValue(e);
  if (s) {
    const u = await T7(s, null, r);
    return n.style.setProperty(e, u, n.style.getPropertyPriority(e)), !0;
  }
  return !1;
}
async function YT(e, n) {
  await gl("background", e, n) || await gl("background-image", e, n), await gl("mask", e, n) || await gl("-webkit-mask", e, n) || await gl("mask-image", e, n) || await gl("-webkit-mask-image", e, n);
}
async function GT(e, n) {
  const r = Mn(e, HTMLImageElement);
  if (!(r && !fh(e.src)) && !(Mn(e, SVGImageElement) && !fh(e.href.baseVal)))
    return;
  const l = r ? e.src : e.href.baseVal, s = await td(l, ed(l), n);
  await new Promise((u, c) => {
    e.onload = u, e.onerror = n.onImageErrorHandler ? (...d) => {
      try {
        u(n.onImageErrorHandler(...d));
      } catch (p) {
        c(p);
      }
    } : c;
    const h = e;
    h.decode && (h.decode = u), h.loading === "lazy" && (h.loading = "eager"), r ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
  });
}
async function XT(e, n) {
  const l = Z0(e.childNodes).map((s) => z7(s, n));
  await Promise.all(l).then(() => e);
}
async function z7(e, n) {
  Mn(e, Element) && (await YT(e, n), await GT(e, n), await XT(e, n));
}
function $T(e, n) {
  const { style: r } = e;
  n.backgroundColor && (r.backgroundColor = n.backgroundColor), n.width && (r.width = `${n.width}px`), n.height && (r.height = `${n.height}px`);
  const l = n.style;
  return l != null && Object.keys(l).forEach((s) => {
    r[s] = l[s];
  }), e;
}
const V3 = {};
async function Y3(e) {
  let n = V3[e];
  if (n != null)
    return n;
  const l = await (await fetch(e)).text();
  return n = { url: e, cssText: l }, V3[e] = n, n;
}
async function G3(e, n) {
  let r = e.cssText;
  const l = /url\(["']?([^"')]+)["']?\)/g, u = (r.match(/url\([^)]+\)/g) || []).map(async (c) => {
    let h = c.replace(l, "$1");
    return h.startsWith("https://") || (h = new URL(h, e.url).href), S7(h, n.fetchRequestInit, ({ result: d }) => (r = r.replace(c, `url(${d})`), [c, d]));
  });
  return Promise.all(u).then(() => r);
}
function X3(e) {
  if (e == null)
    return [];
  const n = [], r = /(\/\*[\s\S]*?\*\/)/gi;
  let l = e.replace(r, "");
  const s = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
  for (; ; ) {
    const d = s.exec(l);
    if (d === null)
      break;
    n.push(d[0]);
  }
  l = l.replace(s, "");
  const u = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, c = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", h = new RegExp(c, "gi");
  for (; ; ) {
    let d = u.exec(l);
    if (d === null) {
      if (d = h.exec(l), d === null)
        break;
      u.lastIndex = h.lastIndex;
    } else
      h.lastIndex = u.lastIndex;
    n.push(d[0]);
  }
  return n;
}
async function ZT(e, n) {
  const r = [], l = [];
  return e.forEach((s) => {
    if ("cssRules" in s)
      try {
        Z0(s.cssRules || []).forEach((u, c) => {
          if (u.type === CSSRule.IMPORT_RULE) {
            let h = c + 1;
            const d = u.href, p = Y3(d).then((g) => G3(g, n)).then((g) => X3(g).forEach((y) => {
              try {
                s.insertRule(y, y.startsWith("@import") ? h += 1 : s.cssRules.length);
              } catch (x) {
                console.error("Error inserting rule from remote css", {
                  rule: y,
                  error: x
                });
              }
            })).catch((g) => {
              console.error("Error loading remote css", g.toString());
            });
            l.push(p);
          }
        });
      } catch (u) {
        const c = e.find((h) => h.href == null) || document.styleSheets[0];
        s.href != null && l.push(Y3(s.href).then((h) => G3(h, n)).then((h) => X3(h).forEach((d) => {
          c.insertRule(d, c.cssRules.length);
        })).catch((h) => {
          console.error("Error loading remote stylesheet", h);
        })), console.error("Error inlining remote css file", u);
      }
  }), Promise.all(l).then(() => (e.forEach((s) => {
    if ("cssRules" in s)
      try {
        Z0(s.cssRules || []).forEach((u) => {
          r.push(u);
        });
      } catch (u) {
        console.error(`Error while reading CSS rules from ${s.href}`, u);
      }
  }), r));
}
function FT(e) {
  return e.filter((n) => n.type === CSSRule.FONT_FACE_RULE).filter((n) => M7(n.style.getPropertyValue("src")));
}
async function IT(e, n) {
  if (e.ownerDocument == null)
    throw new Error("Provided element is not within a Document");
  const r = Z0(e.ownerDocument.styleSheets), l = await ZT(r, n);
  return FT(l);
}
function A7(e) {
  return e.trim().replace(/["']/g, "");
}
function KT(e) {
  const n = /* @__PURE__ */ new Set();
  function r(l) {
    (l.style.fontFamily || getComputedStyle(l).fontFamily).split(",").forEach((u) => {
      n.add(A7(u));
    }), Array.from(l.children).forEach((u) => {
      u instanceof HTMLElement && r(u);
    });
  }
  return r(e), n;
}
async function QT(e, n) {
  const r = await IT(e, n), l = KT(e);
  return (await Promise.all(r.filter((u) => l.has(A7(u.style.fontFamily))).map((u) => {
    const c = u.parentStyleSheet ? u.parentStyleSheet.href : null;
    return T7(u.cssText, c, n);
  }))).join(`
`);
}
async function JT(e, n) {
  const r = n.fontEmbedCSS != null ? n.fontEmbedCSS : n.skipFonts ? null : await QT(e, n);
  if (r) {
    const l = document.createElement("style"), s = document.createTextNode(r);
    l.appendChild(s), e.firstChild ? e.insertBefore(l, e.firstChild) : e.appendChild(l);
  }
}
async function C7(e, n = {}) {
  const { width: r, height: l } = b7(e, n), s = await Uu(e, n, !0);
  return await JT(s, n), await z7(s, n), $T(s, n), await pT(s, r, l);
}
async function WT(e, n = {}) {
  const { width: r, height: l } = b7(e, n), s = await C7(e, n), u = await Eu(s), c = document.createElement("canvas"), h = c.getContext("2d"), d = n.pixelRatio || hT(), p = n.canvasWidth || r, g = n.canvasHeight || l;
  return c.width = p * d, c.height = g * d, n.skipAutoScale || dT(c), c.style.width = `${p}`, c.style.height = `${g}`, n.backgroundColor && (h.fillStyle = n.backgroundColor, h.fillRect(0, 0, c.width, c.height)), h.drawImage(u, 0, 0, c.width, c.height), c;
}
async function PT(e, n = {}) {
  return (await WT(e, n)).toDataURL();
}
function N7() {
  return (e) => !(e.classList?.contains("react-flow__panel") || e.classList?.contains("react-flow__controls") || e.classList?.contains("react-flow__minimap") || e.classList?.contains("react-flow__background"));
}
async function ez(e, n, r, l, s) {
  return (await PT(e, {
    width: n,
    height: r,
    backgroundColor: l ? void 0 : s,
    pixelRatio: 2,
    // 2x resolution for crisp output
    filter: N7(),
    // Force the captured element itself to have the background
    style: {
      background: l ? "transparent" : s
    }
  })).replace(/^data:image\/png;base64,/, "");
}
async function tz(e, n, r) {
  const s = (await C7(e, {
    width: n,
    height: r,
    filter: N7(),
    skipFonts: !1
  })).replace(/^data:image\/svg\+xml;charset=utf-8,/, ""), u = decodeURIComponent(s);
  return btoa(unescape(encodeURIComponent(u)));
}
const nz = {
  orthogonal: f7
};
function az({
  nodes: e,
  edges: n,
  captureRequest: r,
  onCaptureComplete: l
}) {
  const s = B.useRef(null), u = B.useRef(null), [c, h] = B.useState(!1);
  return B.useEffect(() => {
    if (!r || !c || !s.current || !u.current || e.length === 0)
      return;
    (async () => {
      try {
        const p = oh(e, n), g = 0.15;
        let y, x;
        if (r.width !== null || r.height !== null)
          y = Math.ceil(r.width ?? p.width * 1.2), x = Math.ceil(r.height ?? p.height * 1.2);
        else {
          const R = 1 / (1 - g * 2);
          y = Math.ceil(p.width * R), x = Math.ceil(p.height * R);
        }
        s.current && (s.current.style.width = `${y}px`, s.current.style.height = `${x}px`), await new Promise((R) => setTimeout(R, 100));
        const w = uh(p, y, x, {
          padding: g,
          minZoom: qi,
          maxZoom: Ui
        });
        u.current?.setViewport(w), await new Promise((R) => setTimeout(R, 200));
        const z = s.current?.querySelector(
          ".react-flow__viewport"
        );
        if (!z)
          throw new Error("Could not find React Flow viewport element");
        const A = getComputedStyle(s.current).getPropertyValue("--color-slate-50").trim() || "#fafbfc";
        let T;
        r.format === "png" ? T = await ez(
          z,
          y,
          x,
          r.transparent,
          A
        ) : T = await tz(z, y, x), l({
          success: !0,
          data: T,
          format: r.format,
          width: y,
          height: x,
          timestamp: r.timestamp
        });
      } catch (p) {
        console.error("[CaptureCanvasInner] Capture error:", p), l({
          success: !1,
          data: "",
          format: r.format,
          width: 0,
          height: 0,
          error: p instanceof Error ? p.message : "Unknown capture error",
          timestamp: r.timestamp
        });
      }
    })();
  }, [r, c, e, n, l]), /* @__PURE__ */ O.jsx(
    "div",
    {
      ref: s,
      style: {
        width: "100%",
        height: "100%",
        backgroundColor: "transparent"
      },
      children: /* @__PURE__ */ O.jsx(
        Dh,
        {
          nodes: e,
          edges: n,
          nodeTypes: g7,
          edgeTypes: nz,
          onInit: (d) => {
            u.current = d;
            const p = oh(e, n), g = s.current;
            if (g) {
              const y = uh(
                p,
                g.offsetWidth,
                g.offsetHeight,
                { padding: 0.1, minZoom: qi, maxZoom: Ui }
              );
              d.setViewport(y);
            }
            setTimeout(() => {
              h(!0);
            }, 100);
          },
          fitView: !0,
          fitViewOptions: d7,
          defaultViewport: h7,
          minZoom: qi,
          maxZoom: Ui,
          nodesDraggable: !1,
          nodesConnectable: !1,
          elementsSelectable: !1,
          panOnDrag: !1,
          zoomOnScroll: !1,
          zoomOnPinch: !1,
          zoomOnDoubleClick: !1,
          preventScrolling: !1,
          defaultEdgeOptions: m7("var(--color-primary-600)"),
          style: { backgroundColor: "transparent" },
          defaultMarkerColor: "var(--color-primary-600)",
          proOptions: { hideAttribution: !0 }
        }
      )
    }
  );
}
function rz() {
  const e = B.useContext(W0), [n, r] = B.useState([]), [l, s] = B.useState([]), [u, c] = B.useState(null), [h, d] = B.useState("light"), p = B.useRef(0);
  B.useEffect(() => {
    if (!e) return;
    const x = e.get("theme") || "light";
    d(x);
    const w = () => {
      const z = e.get("theme") || "light";
      d(z);
    };
    return e.on("change:theme", w), () => {
      e.off("change:theme", w);
    };
  }, [e]), B.useEffect(() => {
    if (!e) return;
    const x = _h(e);
    return r(x.blocks.map(Su)), s(
      x.connections.map((z) => sh(z, "var(--color-primary-600)"))
    ), pp(e, (z) => {
      r(z.blocks.map(Su)), s(z.connections.map((M) => sh(M, "var(--color-primary-600)")));
    });
  }, [e]), B.useEffect(() => {
    if (!e) return;
    const x = () => {
      const w = e.get("_capture_request");
      !w || !w.timestamp || w.timestamp <= p.current || (p.current = w.timestamp, c(w));
    };
    return e.on("change:_capture_request", x), x(), () => {
      e.off("change:_capture_request", x);
    };
  }, [e]);
  const g = B.useRef(null), y = B.useCallback(
    (x) => {
      if (e) {
        if (x.success && x.data) {
          const w = u?.displayInline ?? !0, z = x.format === "png" ? "image/png" : "image/svg+xml";
          if (w) {
            const M = g.current?.closest(".lynx-widget");
            if (M) {
              const A = document.createElement("img");
              A.src = `data:${z};base64,${x.data}`, A.style.maxWidth = "100%", A.style.display = "block", M.innerHTML = "", M.appendChild(A), M.classList.remove("capture-mode"), M.style.width = "auto", M.style.height = "auto", M.style.opacity = "1";
              let T = M.parentElement;
              for (; T; ) {
                const R = T.style.height, q = T.style.width;
                (R === "1px" || q === "1px") && (T.style.height = "auto", T.style.width = "auto"), T = T.parentElement;
              }
            } else
              console.error(
                "[CaptureCanvas] Could not find .lynx-widget container for inline display"
              );
          }
        }
        e.set("_capture_result", x), e.save_changes(), c(null);
      }
    },
    [e, u]
  );
  return /* @__PURE__ */ O.jsx(
    "div",
    {
      ref: g,
      "data-theme": h,
      style: {
        // Position off-screen but still render at full size
        position: "fixed",
        left: "-10000px",
        top: "-10000px",
        // Initial size - will be resized during capture
        width: "800px",
        height: "600px"
      },
      children: /* @__PURE__ */ O.jsx(kh, { children: /* @__PURE__ */ O.jsx(
        az,
        {
          nodes: n,
          edges: l,
          captureRequest: u,
          onCaptureComplete: y
        }
      ) })
    }
  );
}
function lz({ model: e }) {
  const [n, r] = B.useState(!1);
  B.useEffect(() => {
    if (!e) return;
    const s = () => {
      const u = e.get("_capture_mode");
      r(u || !1);
    };
    return s(), e.on("change:_capture_mode", s), () => {
      e.off("change:_capture_mode", s);
    };
  }, [e]);
  const l = n ? "lynx-widget capture-mode" : "lynx-widget";
  return /* @__PURE__ */ O.jsx("div", { className: l, children: n ? /* @__PURE__ */ O.jsx(rz, {}) : /* @__PURE__ */ O.jsx(sT, {}) });
}
function iz({ model: e, el: n }) {
  n.style.background = "transparent";
  const r = "lynx-widget-bg-override";
  if (!document.getElementById(r)) {
    const s = document.createElement("style");
    s.id = r, s.textContent = `
      .cell-output-ipywidget-background {
        background: transparent !important;
      }
      .widget-subarea,
      .jupyter-widgets-view {
        background: transparent !important;
      }
    `, document.head.appendChild(s);
  }
  const l = $g.createRoot(n);
  return l.render(
    /* @__PURE__ */ O.jsx(W0.Provider, { value: e, children: /* @__PURE__ */ O.jsx(lz, { model: e }) })
  ), () => l.unmount();
}
const sz = { render: iz };
export {
  W0 as AnyWidgetModelContext,
  sz as default
};
//# sourceMappingURL=index.js.map
