var f0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function FI(n) {
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var Lx = { exports: {} }, hb = {};
/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var m3;
function $I() {
  if (m3) return hb;
  m3 = 1;
  var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
  function e(a, s, l) {
    var f = null;
    if (l !== void 0 && (f = "" + l), s.key !== void 0 && (f = "" + s.key), "key" in s) {
      l = {};
      for (var h in s)
        h !== "key" && (l[h] = s[h]);
    } else l = s;
    return s = l.ref, {
      $$typeof: n,
      type: a,
      key: f,
      ref: s !== void 0 ? s : null,
      props: l
    };
  }
  return hb.Fragment = t, hb.jsx = e, hb.jsxs = e, hb;
}
var db = {}, Ix = { exports: {} }, vn = {};
/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var p3;
function XI() {
  if (p3) return vn;
  p3 = 1;
  var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), l = Symbol.for("react.consumer"), f = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), y = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), x = Symbol.iterator;
  function w(W) {
    return W === null || typeof W != "object" ? null : (W = x && W[x] || W["@@iterator"], typeof W == "function" ? W : null);
  }
  var A = {
    isMounted: function() {
      return !1;
    },
    enqueueForceUpdate: function() {
    },
    enqueueReplaceState: function() {
    },
    enqueueSetState: function() {
    }
  }, C = Object.assign, L = {};
  function N(W, j, X) {
    this.props = W, this.context = j, this.refs = L, this.updater = X || A;
  }
  N.prototype.isReactComponent = {}, N.prototype.setState = function(W, j) {
    if (typeof W != "object" && typeof W != "function" && W != 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, W, j, "setState");
  }, N.prototype.forceUpdate = function(W) {
    this.updater.enqueueForceUpdate(this, W, "forceUpdate");
  };
  function U() {
  }
  U.prototype = N.prototype;
  function k(W, j, X) {
    this.props = W, this.context = j, this.refs = L, this.updater = X || A;
  }
  var H = k.prototype = new U();
  H.constructor = k, C(H, N.prototype), H.isPureReactComponent = !0;
  var B = Array.isArray, z = { H: null, A: null, T: null, S: null, V: null }, Q = Object.prototype.hasOwnProperty;
  function et(W, j, X, st, At, Dt) {
    return X = Dt.ref, {
      $$typeof: n,
      type: W,
      key: j,
      ref: X !== void 0 ? X : null,
      props: Dt
    };
  }
  function ot(W, j) {
    return et(
      W.type,
      j,
      void 0,
      void 0,
      void 0,
      W.props
    );
  }
  function pt(W) {
    return typeof W == "object" && W !== null && W.$$typeof === n;
  }
  function ht(W) {
    var j = { "=": "=0", ":": "=2" };
    return "$" + W.replace(/[=:]/g, function(X) {
      return j[X];
    });
  }
  var Ct = /\/+/g;
  function mt(W, j) {
    return typeof W == "object" && W !== null && W.key != null ? ht("" + W.key) : j.toString(36);
  }
  function St() {
  }
  function Ut(W) {
    switch (W.status) {
      case "fulfilled":
        return W.value;
      case "rejected":
        throw W.reason;
      default:
        switch (typeof W.status == "string" ? W.then(St, St) : (W.status = "pending", W.then(
          function(j) {
            W.status === "pending" && (W.status = "fulfilled", W.value = j);
          },
          function(j) {
            W.status === "pending" && (W.status = "rejected", W.reason = j);
          }
        )), W.status) {
          case "fulfilled":
            return W.value;
          case "rejected":
            throw W.reason;
        }
    }
    throw W;
  }
  function Ft(W, j, X, st, At) {
    var Dt = typeof W;
    (Dt === "undefined" || Dt === "boolean") && (W = null);
    var It = !1;
    if (W === null) It = !0;
    else
      switch (Dt) {
        case "bigint":
        case "string":
        case "number":
          It = !0;
          break;
        case "object":
          switch (W.$$typeof) {
            case n:
            case t:
              It = !0;
              break;
            case b:
              return It = W._init, Ft(
                It(W._payload),
                j,
                X,
                st,
                At
              );
          }
      }
    if (It)
      return At = At(W), It = st === "" ? "." + mt(W, 0) : st, B(At) ? (X = "", It != null && (X = It.replace(Ct, "$&/") + "/"), Ft(At, j, X, "", function(ee) {
        return ee;
      })) : At != null && (pt(At) && (At = ot(
        At,
        X + (At.key == null || W && W.key === At.key ? "" : ("" + At.key).replace(
          Ct,
          "$&/"
        ) + "/") + It
      )), j.push(At)), 1;
    It = 0;
    var $t = st === "" ? "." : st + ":";
    if (B(W))
      for (var Qt = 0; Qt < W.length; Qt++)
        st = W[Qt], Dt = $t + mt(st, Qt), It += Ft(
          st,
          j,
          X,
          Dt,
          At
        );
    else if (Qt = w(W), typeof Qt == "function")
      for (W = Qt.call(W), Qt = 0; !(st = W.next()).done; )
        st = st.value, Dt = $t + mt(st, Qt++), It += Ft(
          st,
          j,
          X,
          Dt,
          At
        );
    else if (Dt === "object") {
      if (typeof W.then == "function")
        return Ft(
          Ut(W),
          j,
          X,
          st,
          At
        );
      throw j = String(W), Error(
        "Objects are not valid as a React child (found: " + (j === "[object Object]" ? "object with keys {" + Object.keys(W).join(", ") + "}" : j) + "). If you meant to render a collection of children, use an array instead."
      );
    }
    return It;
  }
  function nt(W, j, X) {
    if (W == null) return W;
    var st = [], At = 0;
    return Ft(W, st, "", "", function(Dt) {
      return j.call(X, Dt, At++);
    }), st;
  }
  function J(W) {
    if (W._status === -1) {
      var j = W._result;
      j = j(), j.then(
        function(X) {
          (W._status === 0 || W._status === -1) && (W._status = 1, W._result = X);
        },
        function(X) {
          (W._status === 0 || W._status === -1) && (W._status = 2, W._result = X);
        }
      ), W._status === -1 && (W._status = 0, W._result = j);
    }
    if (W._status === 1) return W._result.default;
    throw W._result;
  }
  var gt = typeof reportError == "function" ? reportError : function(W) {
    if (typeof window == "object" && typeof window.ErrorEvent == "function") {
      var j = new window.ErrorEvent("error", {
        bubbles: !0,
        cancelable: !0,
        message: typeof W == "object" && W !== null && typeof W.message == "string" ? String(W.message) : String(W),
        error: W
      });
      if (!window.dispatchEvent(j)) return;
    } else if (typeof process == "object" && typeof process.emit == "function") {
      process.emit("uncaughtException", W);
      return;
    }
    console.error(W);
  };
  function Ot() {
  }
  return vn.Children = {
    map: nt,
    forEach: function(W, j, X) {
      nt(
        W,
        function() {
          j.apply(this, arguments);
        },
        X
      );
    },
    count: function(W) {
      var j = 0;
      return nt(W, function() {
        j++;
      }), j;
    },
    toArray: function(W) {
      return nt(W, function(j) {
        return j;
      }) || [];
    },
    only: function(W) {
      if (!pt(W))
        throw Error(
          "React.Children.only expected to receive a single React element child."
        );
      return W;
    }
  }, vn.Component = N, vn.Fragment = e, vn.Profiler = s, vn.PureComponent = k, vn.StrictMode = a, vn.Suspense = p, vn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = z, vn.__COMPILER_RUNTIME = {
    __proto__: null,
    c: function(W) {
      return z.H.useMemoCache(W);
    }
  }, vn.cache = function(W) {
    return function() {
      return W.apply(null, arguments);
    };
  }, vn.cloneElement = function(W, j, X) {
    if (W == null)
      throw Error(
        "The argument must be a React element, but you passed " + W + "."
      );
    var st = C({}, W.props), At = W.key, Dt = void 0;
    if (j != null)
      for (It in j.ref !== void 0 && (Dt = void 0), j.key !== void 0 && (At = "" + j.key), j)
        !Q.call(j, It) || It === "key" || It === "__self" || It === "__source" || It === "ref" && j.ref === void 0 || (st[It] = j[It]);
    var It = arguments.length - 2;
    if (It === 1) st.children = X;
    else if (1 < It) {
      for (var $t = Array(It), Qt = 0; Qt < It; Qt++)
        $t[Qt] = arguments[Qt + 2];
      st.children = $t;
    }
    return et(W.type, At, void 0, void 0, Dt, st);
  }, vn.createContext = function(W) {
    return W = {
      $$typeof: f,
      _currentValue: W,
      _currentValue2: W,
      _threadCount: 0,
      Provider: null,
      Consumer: null
    }, W.Provider = W, W.Consumer = {
      $$typeof: l,
      _context: W
    }, W;
  }, vn.createElement = function(W, j, X) {
    var st, At = {}, Dt = null;
    if (j != null)
      for (st in j.key !== void 0 && (Dt = "" + j.key), j)
        Q.call(j, st) && st !== "key" && st !== "__self" && st !== "__source" && (At[st] = j[st]);
    var It = arguments.length - 2;
    if (It === 1) At.children = X;
    else if (1 < It) {
      for (var $t = Array(It), Qt = 0; Qt < It; Qt++)
        $t[Qt] = arguments[Qt + 2];
      At.children = $t;
    }
    if (W && W.defaultProps)
      for (st in It = W.defaultProps, It)
        At[st] === void 0 && (At[st] = It[st]);
    return et(W, Dt, void 0, void 0, null, At);
  }, vn.createRef = function() {
    return { current: null };
  }, vn.forwardRef = function(W) {
    return { $$typeof: h, render: W };
  }, vn.isValidElement = pt, vn.lazy = function(W) {
    return {
      $$typeof: b,
      _payload: { _status: -1, _result: W },
      _init: J
    };
  }, vn.memo = function(W, j) {
    return {
      $$typeof: y,
      type: W,
      compare: j === void 0 ? null : j
    };
  }, vn.startTransition = function(W) {
    var j = z.T, X = {};
    z.T = X;
    try {
      var st = W(), At = z.S;
      At !== null && At(X, st), typeof st == "object" && st !== null && typeof st.then == "function" && st.then(Ot, gt);
    } catch (Dt) {
      gt(Dt);
    } finally {
      z.T = j;
    }
  }, vn.unstable_useCacheRefresh = function() {
    return z.H.useCacheRefresh();
  }, vn.use = function(W) {
    return z.H.use(W);
  }, vn.useActionState = function(W, j, X) {
    return z.H.useActionState(W, j, X);
  }, vn.useCallback = function(W, j) {
    return z.H.useCallback(W, j);
  }, vn.useContext = function(W) {
    return z.H.useContext(W);
  }, vn.useDebugValue = function() {
  }, vn.useDeferredValue = function(W, j) {
    return z.H.useDeferredValue(W, j);
  }, vn.useEffect = function(W, j, X) {
    var st = z.H;
    if (typeof X == "function")
      throw Error(
        "useEffect CRUD overload is not enabled in this build of React."
      );
    return st.useEffect(W, j);
  }, vn.useId = function() {
    return z.H.useId();
  }, vn.useImperativeHandle = function(W, j, X) {
    return z.H.useImperativeHandle(W, j, X);
  }, vn.useInsertionEffect = function(W, j) {
    return z.H.useInsertionEffect(W, j);
  }, vn.useLayoutEffect = function(W, j) {
    return z.H.useLayoutEffect(W, j);
  }, vn.useMemo = function(W, j) {
    return z.H.useMemo(W, j);
  }, vn.useOptimistic = function(W, j) {
    return z.H.useOptimistic(W, j);
  }, vn.useReducer = function(W, j, X) {
    return z.H.useReducer(W, j, X);
  }, vn.useRef = function(W) {
    return z.H.useRef(W);
  }, vn.useState = function(W) {
    return z.H.useState(W);
  }, vn.useSyncExternalStore = function(W, j, X) {
    return z.H.useSyncExternalStore(
      W,
      j,
      X
    );
  }, vn.useTransition = function() {
    return z.H.useTransition();
  }, vn.version = "19.1.1", vn;
}
var Rb = { exports: {} };
Rb.exports;
var y3;
function KI() {
  return y3 || (y3 = 1, function(n, t) {
    var e = {};
    /**
     * @license React
     * react.development.js
     *
     * Copyright (c) Meta Platforms, Inc. and affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
    e.NODE_ENV !== "production" && function() {
      function a(Y, dt) {
        Object.defineProperty(f.prototype, Y, {
          get: function() {
            console.warn(
              "%s(...) is deprecated in plain JavaScript React classes. %s",
              dt[0],
              dt[1]
            );
          }
        });
      }
      function s(Y) {
        return Y === null || typeof Y != "object" ? null : (Y = Mn && Y[Mn] || Y["@@iterator"], typeof Y == "function" ? Y : null);
      }
      function l(Y, dt) {
        Y = (Y = Y.constructor) && (Y.displayName || Y.name) || "ReactClass";
        var Kt = Y + "." + dt;
        te[Kt] || (console.error(
          "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
          dt,
          Y
        ), te[Kt] = !0);
      }
      function f(Y, dt, Kt) {
        this.props = Y, this.context = dt, this.refs = Pi, this.updater = Kt || tn;
      }
      function h() {
      }
      function p(Y, dt, Kt) {
        this.props = Y, this.context = dt, this.refs = Pi, this.updater = Kt || tn;
      }
      function y(Y) {
        return "" + Y;
      }
      function b(Y) {
        try {
          y(Y);
          var dt = !1;
        } catch {
          dt = !0;
        }
        if (dt) {
          dt = console;
          var Kt = dt.error, Jt = typeof Symbol == "function" && Symbol.toStringTag && Y[Symbol.toStringTag] || Y.constructor.name || "Object";
          return Kt.call(
            dt,
            "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
            Jt
          ), y(Y);
        }
      }
      function x(Y) {
        if (Y == null) return null;
        if (typeof Y == "function")
          return Y.$$typeof === Ai ? null : Y.displayName || Y.name || null;
        if (typeof Y == "string") return Y;
        switch (Y) {
          case j:
            return "Fragment";
          case st:
            return "Profiler";
          case X:
            return "StrictMode";
          case $t:
            return "Suspense";
          case Qt:
            return "SuspenseList";
          case pe:
            return "Activity";
        }
        if (typeof Y == "object")
          switch (typeof Y.tag == "number" && console.error(
            "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
          ), Y.$$typeof) {
            case W:
              return "Portal";
            case Dt:
              return (Y.displayName || "Context") + ".Provider";
            case At:
              return (Y._context.displayName || "Context") + ".Consumer";
            case It:
              var dt = Y.render;
              return Y = Y.displayName, Y || (Y = dt.displayName || dt.name || "", Y = Y !== "" ? "ForwardRef(" + Y + ")" : "ForwardRef"), Y;
            case ee:
              return dt = Y.displayName || null, dt !== null ? dt : x(Y.type) || "Memo";
            case ce:
              dt = Y._payload, Y = Y._init;
              try {
                return x(Y(dt));
              } catch {
              }
          }
        return null;
      }
      function w(Y) {
        if (Y === j) return "<>";
        if (typeof Y == "object" && Y !== null && Y.$$typeof === ce)
          return "<...>";
        try {
          var dt = x(Y);
          return dt ? "<" + dt + ">" : "<...>";
        } catch {
          return "<...>";
        }
      }
      function A() {
        var Y = fe.A;
        return Y === null ? null : Y.getOwner();
      }
      function C() {
        return Error("react-stack-top-frame");
      }
      function L(Y) {
        if (Zi.call(Y, "key")) {
          var dt = Object.getOwnPropertyDescriptor(Y, "key").get;
          if (dt && dt.isReactWarning) return !1;
        }
        return Y.key !== void 0;
      }
      function N(Y, dt) {
        function Kt() {
          nr || (nr = !0, console.error(
            "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
            dt
          ));
        }
        Kt.isReactWarning = !0, Object.defineProperty(Y, "key", {
          get: Kt,
          configurable: !0
        });
      }
      function U() {
        var Y = x(this.type);
        return Ha[Y] || (Ha[Y] = !0, console.error(
          "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
        )), Y = this.props.ref, Y !== void 0 ? Y : null;
      }
      function k(Y, dt, Kt, Jt, oe, Be, Ue, Pe) {
        return Kt = Be.ref, Y = {
          $$typeof: Ot,
          type: Y,
          key: dt,
          props: Be,
          _owner: oe
        }, (Kt !== void 0 ? Kt : null) !== null ? Object.defineProperty(Y, "ref", {
          enumerable: !1,
          get: U
        }) : Object.defineProperty(Y, "ref", { enumerable: !1, value: null }), Y._store = {}, Object.defineProperty(Y._store, "validated", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: 0
        }), Object.defineProperty(Y, "_debugInfo", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: null
        }), Object.defineProperty(Y, "_debugStack", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: Ue
        }), Object.defineProperty(Y, "_debugTask", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: Pe
        }), Object.freeze && (Object.freeze(Y.props), Object.freeze(Y)), Y;
      }
      function H(Y, dt) {
        return dt = k(
          Y.type,
          dt,
          void 0,
          void 0,
          Y._owner,
          Y.props,
          Y._debugStack,
          Y._debugTask
        ), Y._store && (dt._store.validated = Y._store.validated), dt;
      }
      function B(Y) {
        return typeof Y == "object" && Y !== null && Y.$$typeof === Ot;
      }
      function z(Y) {
        var dt = { "=": "=0", ":": "=2" };
        return "$" + Y.replace(/[=:]/g, function(Kt) {
          return dt[Kt];
        });
      }
      function Q(Y, dt) {
        return typeof Y == "object" && Y !== null && Y.key != null ? (b(Y.key), z("" + Y.key)) : dt.toString(36);
      }
      function et() {
      }
      function ot(Y) {
        switch (Y.status) {
          case "fulfilled":
            return Y.value;
          case "rejected":
            throw Y.reason;
          default:
            switch (typeof Y.status == "string" ? Y.then(et, et) : (Y.status = "pending", Y.then(
              function(dt) {
                Y.status === "pending" && (Y.status = "fulfilled", Y.value = dt);
              },
              function(dt) {
                Y.status === "pending" && (Y.status = "rejected", Y.reason = dt);
              }
            )), Y.status) {
              case "fulfilled":
                return Y.value;
              case "rejected":
                throw Y.reason;
            }
        }
        throw Y;
      }
      function pt(Y, dt, Kt, Jt, oe) {
        var Be = typeof Y;
        (Be === "undefined" || Be === "boolean") && (Y = null);
        var Ue = !1;
        if (Y === null) Ue = !0;
        else
          switch (Be) {
            case "bigint":
            case "string":
            case "number":
              Ue = !0;
              break;
            case "object":
              switch (Y.$$typeof) {
                case Ot:
                case W:
                  Ue = !0;
                  break;
                case ce:
                  return Ue = Y._init, pt(
                    Ue(Y._payload),
                    dt,
                    Kt,
                    Jt,
                    oe
                  );
              }
          }
        if (Ue) {
          Ue = Y, oe = oe(Ue);
          var Pe = Jt === "" ? "." + Q(Ue, 0) : Jt;
          return ka(oe) ? (Kt = "", Pe != null && (Kt = Pe.replace(Io, "$&/") + "/"), pt(oe, dt, Kt, "", function(xn) {
            return xn;
          })) : oe != null && (B(oe) && (oe.key != null && (Ue && Ue.key === oe.key || b(oe.key)), Kt = H(
            oe,
            Kt + (oe.key == null || Ue && Ue.key === oe.key ? "" : ("" + oe.key).replace(
              Io,
              "$&/"
            ) + "/") + Pe
          ), Jt !== "" && Ue != null && B(Ue) && Ue.key == null && Ue._store && !Ue._store.validated && (Kt._store.validated = 2), oe = Kt), dt.push(oe)), 1;
        }
        if (Ue = 0, Pe = Jt === "" ? "." : Jt + ":", ka(Y))
          for (var Ae = 0; Ae < Y.length; Ae++)
            Jt = Y[Ae], Be = Pe + Q(Jt, Ae), Ue += pt(
              Jt,
              dt,
              Kt,
              Be,
              oe
            );
        else if (Ae = s(Y), typeof Ae == "function")
          for (Ae === Y.entries && (Gi || console.warn(
            "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
          ), Gi = !0), Y = Ae.call(Y), Ae = 0; !(Jt = Y.next()).done; )
            Jt = Jt.value, Be = Pe + Q(Jt, Ae++), Ue += pt(
              Jt,
              dt,
              Kt,
              Be,
              oe
            );
        else if (Be === "object") {
          if (typeof Y.then == "function")
            return pt(
              ot(Y),
              dt,
              Kt,
              Jt,
              oe
            );
          throw dt = String(Y), Error(
            "Objects are not valid as a React child (found: " + (dt === "[object Object]" ? "object with keys {" + Object.keys(Y).join(", ") + "}" : dt) + "). If you meant to render a collection of children, use an array instead."
          );
        }
        return Ue;
      }
      function ht(Y, dt, Kt) {
        if (Y == null) return Y;
        var Jt = [], oe = 0;
        return pt(Y, Jt, "", "", function(Be) {
          return dt.call(Kt, Be, oe++);
        }), Jt;
      }
      function Ct(Y) {
        if (Y._status === -1) {
          var dt = Y._result;
          dt = dt(), dt.then(
            function(Kt) {
              (Y._status === 0 || Y._status === -1) && (Y._status = 1, Y._result = Kt);
            },
            function(Kt) {
              (Y._status === 0 || Y._status === -1) && (Y._status = 2, Y._result = Kt);
            }
          ), Y._status === -1 && (Y._status = 0, Y._result = dt);
        }
        if (Y._status === 1)
          return dt = Y._result, dt === void 0 && console.error(
            `lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))

Did you accidentally put curly braces around the import?`,
            dt
          ), "default" in dt || console.error(
            `lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`,
            dt
          ), dt.default;
        throw Y._result;
      }
      function mt() {
        var Y = fe.H;
        return Y === null && console.error(
          `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
        ), Y;
      }
      function St() {
      }
      function Ut(Y) {
        if (ls === null)
          try {
            var dt = ("require" + Math.random()).slice(0, 7);
            ls = (n && n[dt]).call(
              n,
              "timers"
            ).setImmediate;
          } catch {
            ls = function(Jt) {
              _l === !1 && (_l = !0, typeof MessageChannel > "u" && console.error(
                "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
              ));
              var oe = new MessageChannel();
              oe.port1.onmessage = Jt, oe.port2.postMessage(void 0);
            };
          }
        return ls(Y);
      }
      function Ft(Y) {
        return 1 < Y.length && typeof AggregateError == "function" ? new AggregateError(Y) : Y[0];
      }
      function nt(Y, dt) {
        dt !== ir - 1 && console.error(
          "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
        ), ir = dt;
      }
      function J(Y, dt, Kt) {
        var Jt = fe.actQueue;
        if (Jt !== null)
          if (Jt.length !== 0)
            try {
              gt(Jt), Ut(function() {
                return J(Y, dt, Kt);
              });
              return;
            } catch (oe) {
              fe.thrownErrors.push(oe);
            }
          else fe.actQueue = null;
        0 < fe.thrownErrors.length ? (Jt = Ft(fe.thrownErrors), fe.thrownErrors.length = 0, Kt(Jt)) : dt(Y);
      }
      function gt(Y) {
        if (!sa) {
          sa = !0;
          var dt = 0;
          try {
            for (; dt < Y.length; dt++) {
              var Kt = Y[dt];
              do {
                fe.didUsePromise = !1;
                var Jt = Kt(!1);
                if (Jt !== null) {
                  if (fe.didUsePromise) {
                    Y[dt] = Kt, Y.splice(0, dt);
                    return;
                  }
                  Kt = Jt;
                } else break;
              } while (!0);
            }
            Y.length = 0;
          } catch (oe) {
            Y.splice(0, dt + 1), fe.thrownErrors.push(oe);
          } finally {
            sa = !1;
          }
        }
      }
      typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
      var Ot = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), X = Symbol.for("react.strict_mode"), st = Symbol.for("react.profiler"), At = Symbol.for("react.consumer"), Dt = Symbol.for("react.context"), It = Symbol.for("react.forward_ref"), $t = Symbol.for("react.suspense"), Qt = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), ce = Symbol.for("react.lazy"), pe = Symbol.for("react.activity"), Mn = Symbol.iterator, te = {}, tn = {
        isMounted: function() {
          return !1;
        },
        enqueueForceUpdate: function(Y) {
          l(Y, "forceUpdate");
        },
        enqueueReplaceState: function(Y) {
          l(Y, "replaceState");
        },
        enqueueSetState: function(Y) {
          l(Y, "setState");
        }
      }, Jn = Object.assign, Pi = {};
      Object.freeze(Pi), f.prototype.isReactComponent = {}, f.prototype.setState = function(Y, dt) {
        if (typeof Y != "object" && typeof Y != "function" && Y != 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, Y, dt, "setState");
      }, f.prototype.forceUpdate = function(Y) {
        this.updater.enqueueForceUpdate(this, Y, "forceUpdate");
      };
      var Ge = {
        isMounted: [
          "isMounted",
          "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
        ],
        replaceState: [
          "replaceState",
          "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
        ]
      }, pa;
      for (pa in Ge)
        Ge.hasOwnProperty(pa) && a(pa, Ge[pa]);
      h.prototype = f.prototype, Ge = p.prototype = new h(), Ge.constructor = p, Jn(Ge, f.prototype), Ge.isPureReactComponent = !0;
      var ka = Array.isArray, Ai = Symbol.for("react.client.reference"), fe = {
        H: null,
        A: null,
        T: null,
        S: null,
        V: null,
        actQueue: null,
        isBatchingLegacy: !1,
        didScheduleLegacyUpdate: !1,
        didUsePromise: !1,
        thrownErrors: [],
        getCurrentStack: null,
        recentlyCreatedOwnerStacks: 0
      }, Zi = Object.prototype.hasOwnProperty, Dn = console.createTask ? console.createTask : function() {
        return null;
      };
      Ge = {
        react_stack_bottom_frame: function(Y) {
          return Y();
        }
      };
      var nr, mr, Ha = {}, ti = Ge.react_stack_bottom_frame.bind(
        Ge,
        C
      )(), zi = Dn(w(C)), Gi = !1, Io = /\/+/g, Ms = typeof reportError == "function" ? reportError : function(Y) {
        if (typeof window == "object" && typeof window.ErrorEvent == "function") {
          var dt = new window.ErrorEvent("error", {
            bubbles: !0,
            cancelable: !0,
            message: typeof Y == "object" && Y !== null && typeof Y.message == "string" ? String(Y.message) : String(Y),
            error: Y
          });
          if (!window.dispatchEvent(dt)) return;
        } else if (typeof process == "object" && typeof process.emit == "function") {
          process.emit("uncaughtException", Y);
          return;
        }
        console.error(Y);
      }, _l = !1, ls = null, ir = 0, Ui = !1, sa = !1, Ba = typeof queueMicrotask == "function" ? function(Y) {
        queueMicrotask(function() {
          return queueMicrotask(Y);
        });
      } : Ut;
      Ge = Object.freeze({
        __proto__: null,
        c: function(Y) {
          return mt().useMemoCache(Y);
        }
      }), t.Children = {
        map: ht,
        forEach: function(Y, dt, Kt) {
          ht(
            Y,
            function() {
              dt.apply(this, arguments);
            },
            Kt
          );
        },
        count: function(Y) {
          var dt = 0;
          return ht(Y, function() {
            dt++;
          }), dt;
        },
        toArray: function(Y) {
          return ht(Y, function(dt) {
            return dt;
          }) || [];
        },
        only: function(Y) {
          if (!B(Y))
            throw Error(
              "React.Children.only expected to receive a single React element child."
            );
          return Y;
        }
      }, t.Component = f, t.Fragment = j, t.Profiler = st, t.PureComponent = p, t.StrictMode = X, t.Suspense = $t, t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = fe, t.__COMPILER_RUNTIME = Ge, t.act = function(Y) {
        var dt = fe.actQueue, Kt = ir;
        ir++;
        var Jt = fe.actQueue = dt !== null ? dt : [], oe = !1;
        try {
          var Be = Y();
        } catch (Ae) {
          fe.thrownErrors.push(Ae);
        }
        if (0 < fe.thrownErrors.length)
          throw nt(dt, Kt), Y = Ft(fe.thrownErrors), fe.thrownErrors.length = 0, Y;
        if (Be !== null && typeof Be == "object" && typeof Be.then == "function") {
          var Ue = Be;
          return Ba(function() {
            oe || Ui || (Ui = !0, console.error(
              "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
            ));
          }), {
            then: function(Ae, xn) {
              oe = !0, Ue.then(
                function(Wi) {
                  if (nt(dt, Kt), Kt === 0) {
                    try {
                      gt(Jt), Ut(function() {
                        return J(
                          Wi,
                          Ae,
                          xn
                        );
                      });
                    } catch (oa) {
                      fe.thrownErrors.push(oa);
                    }
                    if (0 < fe.thrownErrors.length) {
                      var ar = Ft(
                        fe.thrownErrors
                      );
                      fe.thrownErrors.length = 0, xn(ar);
                    }
                  } else Ae(Wi);
                },
                function(Wi) {
                  nt(dt, Kt), 0 < fe.thrownErrors.length && (Wi = Ft(
                    fe.thrownErrors
                  ), fe.thrownErrors.length = 0), xn(Wi);
                }
              );
            }
          };
        }
        var Pe = Be;
        if (nt(dt, Kt), Kt === 0 && (gt(Jt), Jt.length !== 0 && Ba(function() {
          oe || Ui || (Ui = !0, console.error(
            "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
          ));
        }), fe.actQueue = null), 0 < fe.thrownErrors.length)
          throw Y = Ft(fe.thrownErrors), fe.thrownErrors.length = 0, Y;
        return {
          then: function(Ae, xn) {
            oe = !0, Kt === 0 ? (fe.actQueue = Jt, Ut(function() {
              return J(
                Pe,
                Ae,
                xn
              );
            })) : Ae(Pe);
          }
        };
      }, t.cache = function(Y) {
        return function() {
          return Y.apply(null, arguments);
        };
      }, t.captureOwnerStack = function() {
        var Y = fe.getCurrentStack;
        return Y === null ? null : Y();
      }, t.cloneElement = function(Y, dt, Kt) {
        if (Y == null)
          throw Error(
            "The argument must be a React element, but you passed " + Y + "."
          );
        var Jt = Jn({}, Y.props), oe = Y.key, Be = Y._owner;
        if (dt != null) {
          var Ue;
          t: {
            if (Zi.call(dt, "ref") && (Ue = Object.getOwnPropertyDescriptor(
              dt,
              "ref"
            ).get) && Ue.isReactWarning) {
              Ue = !1;
              break t;
            }
            Ue = dt.ref !== void 0;
          }
          Ue && (Be = A()), L(dt) && (b(dt.key), oe = "" + dt.key);
          for (Pe in dt)
            !Zi.call(dt, Pe) || Pe === "key" || Pe === "__self" || Pe === "__source" || Pe === "ref" && dt.ref === void 0 || (Jt[Pe] = dt[Pe]);
        }
        var Pe = arguments.length - 2;
        if (Pe === 1) Jt.children = Kt;
        else if (1 < Pe) {
          Ue = Array(Pe);
          for (var Ae = 0; Ae < Pe; Ae++)
            Ue[Ae] = arguments[Ae + 2];
          Jt.children = Ue;
        }
        for (Jt = k(
          Y.type,
          oe,
          void 0,
          void 0,
          Be,
          Jt,
          Y._debugStack,
          Y._debugTask
        ), oe = 2; oe < arguments.length; oe++)
          Be = arguments[oe], B(Be) && Be._store && (Be._store.validated = 1);
        return Jt;
      }, t.createContext = function(Y) {
        return Y = {
          $$typeof: Dt,
          _currentValue: Y,
          _currentValue2: Y,
          _threadCount: 0,
          Provider: null,
          Consumer: null
        }, Y.Provider = Y, Y.Consumer = {
          $$typeof: At,
          _context: Y
        }, Y._currentRenderer = null, Y._currentRenderer2 = null, Y;
      }, t.createElement = function(Y, dt, Kt) {
        for (var Jt = 2; Jt < arguments.length; Jt++) {
          var oe = arguments[Jt];
          B(oe) && oe._store && (oe._store.validated = 1);
        }
        if (Jt = {}, oe = null, dt != null)
          for (Ae in mr || !("__self" in dt) || "key" in dt || (mr = !0, console.warn(
            "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
          )), L(dt) && (b(dt.key), oe = "" + dt.key), dt)
            Zi.call(dt, Ae) && Ae !== "key" && Ae !== "__self" && Ae !== "__source" && (Jt[Ae] = dt[Ae]);
        var Be = arguments.length - 2;
        if (Be === 1) Jt.children = Kt;
        else if (1 < Be) {
          for (var Ue = Array(Be), Pe = 0; Pe < Be; Pe++)
            Ue[Pe] = arguments[Pe + 2];
          Object.freeze && Object.freeze(Ue), Jt.children = Ue;
        }
        if (Y && Y.defaultProps)
          for (Ae in Be = Y.defaultProps, Be)
            Jt[Ae] === void 0 && (Jt[Ae] = Be[Ae]);
        oe && N(
          Jt,
          typeof Y == "function" ? Y.displayName || Y.name || "Unknown" : Y
        );
        var Ae = 1e4 > fe.recentlyCreatedOwnerStacks++;
        return k(
          Y,
          oe,
          void 0,
          void 0,
          A(),
          Jt,
          Ae ? Error("react-stack-top-frame") : ti,
          Ae ? Dn(w(Y)) : zi
        );
      }, t.createRef = function() {
        var Y = { current: null };
        return Object.seal(Y), Y;
      }, t.forwardRef = function(Y) {
        Y != null && Y.$$typeof === ee ? console.error(
          "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
        ) : typeof Y != "function" ? console.error(
          "forwardRef requires a render function but was given %s.",
          Y === null ? "null" : typeof Y
        ) : Y.length !== 0 && Y.length !== 2 && console.error(
          "forwardRef render functions accept exactly two parameters: props and ref. %s",
          Y.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
        ), Y != null && Y.defaultProps != null && console.error(
          "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
        );
        var dt = { $$typeof: It, render: Y }, Kt;
        return Object.defineProperty(dt, "displayName", {
          enumerable: !1,
          configurable: !0,
          get: function() {
            return Kt;
          },
          set: function(Jt) {
            Kt = Jt, Y.name || Y.displayName || (Object.defineProperty(Y, "name", { value: Jt }), Y.displayName = Jt);
          }
        }), dt;
      }, t.isValidElement = B, t.lazy = function(Y) {
        return {
          $$typeof: ce,
          _payload: { _status: -1, _result: Y },
          _init: Ct
        };
      }, t.memo = function(Y, dt) {
        Y == null && console.error(
          "memo: The first argument must be a component. Instead received: %s",
          Y === null ? "null" : typeof Y
        ), dt = {
          $$typeof: ee,
          type: Y,
          compare: dt === void 0 ? null : dt
        };
        var Kt;
        return Object.defineProperty(dt, "displayName", {
          enumerable: !1,
          configurable: !0,
          get: function() {
            return Kt;
          },
          set: function(Jt) {
            Kt = Jt, Y.name || Y.displayName || (Object.defineProperty(Y, "name", { value: Jt }), Y.displayName = Jt);
          }
        }), dt;
      }, t.startTransition = function(Y) {
        var dt = fe.T, Kt = {};
        fe.T = Kt, Kt._updatedFibers = /* @__PURE__ */ new Set();
        try {
          var Jt = Y(), oe = fe.S;
          oe !== null && oe(Kt, Jt), typeof Jt == "object" && Jt !== null && typeof Jt.then == "function" && Jt.then(St, Ms);
        } catch (Be) {
          Ms(Be);
        } finally {
          dt === null && Kt._updatedFibers && (Y = Kt._updatedFibers.size, Kt._updatedFibers.clear(), 10 < Y && console.warn(
            "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
          )), fe.T = dt;
        }
      }, t.unstable_useCacheRefresh = function() {
        return mt().useCacheRefresh();
      }, t.use = function(Y) {
        return mt().use(Y);
      }, t.useActionState = function(Y, dt, Kt) {
        return mt().useActionState(
          Y,
          dt,
          Kt
        );
      }, t.useCallback = function(Y, dt) {
        return mt().useCallback(Y, dt);
      }, t.useContext = function(Y) {
        var dt = mt();
        return Y.$$typeof === At && console.error(
          "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
        ), dt.useContext(Y);
      }, t.useDebugValue = function(Y, dt) {
        return mt().useDebugValue(Y, dt);
      }, t.useDeferredValue = function(Y, dt) {
        return mt().useDeferredValue(Y, dt);
      }, t.useEffect = function(Y, dt, Kt) {
        Y == null && console.warn(
          "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
        );
        var Jt = mt();
        if (typeof Kt == "function")
          throw Error(
            "useEffect CRUD overload is not enabled in this build of React."
          );
        return Jt.useEffect(Y, dt);
      }, t.useId = function() {
        return mt().useId();
      }, t.useImperativeHandle = function(Y, dt, Kt) {
        return mt().useImperativeHandle(Y, dt, Kt);
      }, t.useInsertionEffect = function(Y, dt) {
        return Y == null && console.warn(
          "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
        ), mt().useInsertionEffect(Y, dt);
      }, t.useLayoutEffect = function(Y, dt) {
        return Y == null && console.warn(
          "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
        ), mt().useLayoutEffect(Y, dt);
      }, t.useMemo = function(Y, dt) {
        return mt().useMemo(Y, dt);
      }, t.useOptimistic = function(Y, dt) {
        return mt().useOptimistic(Y, dt);
      }, t.useReducer = function(Y, dt, Kt) {
        return mt().useReducer(Y, dt, Kt);
      }, t.useRef = function(Y) {
        return mt().useRef(Y);
      }, t.useState = function(Y) {
        return mt().useState(Y);
      }, t.useSyncExternalStore = function(Y, dt, Kt) {
        return mt().useSyncExternalStore(
          Y,
          dt,
          Kt
        );
      }, t.useTransition = function() {
        return mt().useTransition();
      }, t.version = "19.1.1", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
    }();
  }(Rb, Rb.exports)), Rb.exports;
}
var _3;
function C0() {
  if (_3) return Ix.exports;
  _3 = 1;
  var n = {};
  return n.NODE_ENV === "production" ? Ix.exports = XI() : Ix.exports = KI(), Ix.exports;
}
var v3;
function ZI() {
  if (v3) return db;
  v3 = 1;
  var n = {};
  /**
   * @license React
   * react-jsx-runtime.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return n.NODE_ENV !== "production" && function() {
    function t(j) {
      if (j == null) return null;
      if (typeof j == "function")
        return j.$$typeof === Ct ? null : j.displayName || j.name || null;
      if (typeof j == "string") return j;
      switch (j) {
        case N:
          return "Fragment";
        case k:
          return "Profiler";
        case U:
          return "StrictMode";
        case Q:
          return "Suspense";
        case et:
          return "SuspenseList";
        case ht:
          return "Activity";
      }
      if (typeof j == "object")
        switch (typeof j.tag == "number" && console.error(
          "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
        ), j.$$typeof) {
          case L:
            return "Portal";
          case B:
            return (j.displayName || "Context") + ".Provider";
          case H:
            return (j._context.displayName || "Context") + ".Consumer";
          case z:
            var X = j.render;
            return j = j.displayName, j || (j = X.displayName || X.name || "", j = j !== "" ? "ForwardRef(" + j + ")" : "ForwardRef"), j;
          case ot:
            return X = j.displayName || null, X !== null ? X : t(j.type) || "Memo";
          case pt:
            X = j._payload, j = j._init;
            try {
              return t(j(X));
            } catch {
            }
        }
      return null;
    }
    function e(j) {
      return "" + j;
    }
    function a(j) {
      try {
        e(j);
        var X = !1;
      } catch {
        X = !0;
      }
      if (X) {
        X = console;
        var st = X.error, At = typeof Symbol == "function" && Symbol.toStringTag && j[Symbol.toStringTag] || j.constructor.name || "Object";
        return st.call(
          X,
          "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
          At
        ), e(j);
      }
    }
    function s(j) {
      if (j === N) return "<>";
      if (typeof j == "object" && j !== null && j.$$typeof === pt)
        return "<...>";
      try {
        var X = t(j);
        return X ? "<" + X + ">" : "<...>";
      } catch {
        return "<...>";
      }
    }
    function l() {
      var j = mt.A;
      return j === null ? null : j.getOwner();
    }
    function f() {
      return Error("react-stack-top-frame");
    }
    function h(j) {
      if (St.call(j, "key")) {
        var X = Object.getOwnPropertyDescriptor(j, "key").get;
        if (X && X.isReactWarning) return !1;
      }
      return j.key !== void 0;
    }
    function p(j, X) {
      function st() {
        nt || (nt = !0, console.error(
          "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
          X
        ));
      }
      st.isReactWarning = !0, Object.defineProperty(j, "key", {
        get: st,
        configurable: !0
      });
    }
    function y() {
      var j = t(this.type);
      return J[j] || (J[j] = !0, console.error(
        "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
      )), j = this.props.ref, j !== void 0 ? j : null;
    }
    function b(j, X, st, At, Dt, It, $t, Qt) {
      return st = It.ref, j = {
        $$typeof: C,
        type: j,
        key: X,
        props: It,
        _owner: Dt
      }, (st !== void 0 ? st : null) !== null ? Object.defineProperty(j, "ref", {
        enumerable: !1,
        get: y
      }) : Object.defineProperty(j, "ref", { enumerable: !1, value: null }), j._store = {}, Object.defineProperty(j._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: 0
      }), Object.defineProperty(j, "_debugInfo", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: null
      }), Object.defineProperty(j, "_debugStack", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: $t
      }), Object.defineProperty(j, "_debugTask", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: Qt
      }), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
    }
    function x(j, X, st, At, Dt, It, $t, Qt) {
      var ee = X.children;
      if (ee !== void 0)
        if (At)
          if (Ut(ee)) {
            for (At = 0; At < ee.length; At++)
              w(ee[At]);
            Object.freeze && Object.freeze(ee);
          } else
            console.error(
              "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
            );
        else w(ee);
      if (St.call(X, "key")) {
        ee = t(j);
        var ce = Object.keys(X).filter(function(Mn) {
          return Mn !== "key";
        });
        At = 0 < ce.length ? "{key: someKey, " + ce.join(": ..., ") + ": ...}" : "{key: someKey}", W[ee + At] || (ce = 0 < ce.length ? "{" + ce.join(": ..., ") + ": ...}" : "{}", console.error(
          `A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,
          At,
          ee,
          ce,
          ee
        ), W[ee + At] = !0);
      }
      if (ee = null, st !== void 0 && (a(st), ee = "" + st), h(X) && (a(X.key), ee = "" + X.key), "key" in X) {
        st = {};
        for (var pe in X)
          pe !== "key" && (st[pe] = X[pe]);
      } else st = X;
      return ee && p(
        st,
        typeof j == "function" ? j.displayName || j.name || "Unknown" : j
      ), b(
        j,
        ee,
        It,
        Dt,
        l(),
        st,
        $t,
        Qt
      );
    }
    function w(j) {
      typeof j == "object" && j !== null && j.$$typeof === C && j._store && (j._store.validated = 1);
    }
    var A = C0(), C = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), H = Symbol.for("react.consumer"), B = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), Q = Symbol.for("react.suspense"), et = Symbol.for("react.suspense_list"), ot = Symbol.for("react.memo"), pt = Symbol.for("react.lazy"), ht = Symbol.for("react.activity"), Ct = Symbol.for("react.client.reference"), mt = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, St = Object.prototype.hasOwnProperty, Ut = Array.isArray, Ft = console.createTask ? console.createTask : function() {
      return null;
    };
    A = {
      react_stack_bottom_frame: function(j) {
        return j();
      }
    };
    var nt, J = {}, gt = A.react_stack_bottom_frame.bind(
      A,
      f
    )(), Ot = Ft(s(f)), W = {};
    db.Fragment = N, db.jsx = function(j, X, st, At, Dt) {
      var It = 1e4 > mt.recentlyCreatedOwnerStacks++;
      return x(
        j,
        X,
        st,
        !1,
        At,
        Dt,
        It ? Error("react-stack-top-frame") : gt,
        It ? Ft(s(j)) : Ot
      );
    }, db.jsxs = function(j, X, st, At, Dt) {
      var It = 1e4 > mt.recentlyCreatedOwnerStacks++;
      return x(
        j,
        X,
        st,
        !0,
        At,
        Dt,
        It ? Error("react-stack-top-frame") : gt,
        It ? Ft(s(j)) : Ot
      );
    };
  }(), db;
}
var E3;
function WI() {
  if (E3) return Lx.exports;
  E3 = 1;
  var n = {};
  return n.NODE_ENV === "production" ? Lx.exports = $I() : Lx.exports = ZI(), Lx.exports;
}
var Z = WI();
const Je = (n) => typeof n == "string", gb = () => {
  let n, t;
  const e = new Promise((a, s) => {
    n = a, t = s;
  });
  return e.resolve = n, e.reject = t, e;
}, b3 = (n) => n == null ? "" : "" + n, QI = (n, t, e) => {
  n.forEach((a) => {
    t[a] && (e[a] = t[a]);
  });
}, JI = /###/g, S3 = (n) => n && n.indexOf("###") > -1 ? n.replace(JI, ".") : n, x3 = (n) => !n || Je(n), Ub = (n, t, e) => {
  const a = Je(t) ? t.split(".") : t;
  let s = 0;
  for (; s < a.length - 1; ) {
    if (x3(n)) return {};
    const l = S3(a[s]);
    !n[l] && e && (n[l] = new e()), Object.prototype.hasOwnProperty.call(n, l) ? n = n[l] : n = {}, ++s;
  }
  return x3(n) ? {} : {
    obj: n,
    k: S3(a[s])
  };
}, T3 = (n, t, e) => {
  const {
    obj: a,
    k: s
  } = Ub(n, t, Object);
  if (a !== void 0 || t.length === 1) {
    a[s] = e;
    return;
  }
  let l = t[t.length - 1], f = t.slice(0, t.length - 1), h = Ub(n, f, Object);
  for (; h.obj === void 0 && f.length; )
    l = `${f[f.length - 1]}.${l}`, f = f.slice(0, f.length - 1), h = Ub(n, f, Object), h?.obj && typeof h.obj[`${h.k}.${l}`] < "u" && (h.obj = void 0);
  h.obj[`${h.k}.${l}`] = e;
}, t7 = (n, t, e, a) => {
  const {
    obj: s,
    k: l
  } = Ub(n, t, Object);
  s[l] = s[l] || [], s[l].push(e);
}, xT = (n, t) => {
  const {
    obj: e,
    k: a
  } = Ub(n, t);
  if (e && Object.prototype.hasOwnProperty.call(e, a))
    return e[a];
}, e7 = (n, t, e) => {
  const a = xT(n, e);
  return a !== void 0 ? a : xT(t, e);
}, jL = (n, t, e) => {
  for (const a in t)
    a !== "__proto__" && a !== "constructor" && (a in n ? Je(n[a]) || n[a] instanceof String || Je(t[a]) || t[a] instanceof String ? e && (n[a] = t[a]) : jL(n[a], t[a], e) : n[a] = t[a]);
  return n;
}, p1 = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var n7 = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
const i7 = (n) => Je(n) ? n.replace(/[&<>"'\/]/g, (t) => n7[t]) : n;
class a7 {
  constructor(t) {
    this.capacity = t, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
  }
  getRegExp(t) {
    const e = this.regExpMap.get(t);
    if (e !== void 0)
      return e;
    const a = new RegExp(t);
    return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(t, a), this.regExpQueue.push(t), a;
  }
}
const r7 = [" ", ",", "?", "!", ";"], s7 = new a7(20), o7 = (n, t, e) => {
  t = t || "", e = e || "";
  const a = r7.filter((f) => t.indexOf(f) < 0 && e.indexOf(f) < 0);
  if (a.length === 0) return !0;
  const s = s7.getRegExp(`(${a.map((f) => f === "?" ? "\\?" : f).join("|")})`);
  let l = !s.test(n);
  if (!l) {
    const f = n.indexOf(e);
    f > 0 && !s.test(n.substring(0, f)) && (l = !0);
  }
  return l;
}, oM = (n, t, e = ".") => {
  if (!n) return;
  if (n[t])
    return Object.prototype.hasOwnProperty.call(n, t) ? n[t] : void 0;
  const a = t.split(e);
  let s = n;
  for (let l = 0; l < a.length; ) {
    if (!s || typeof s != "object")
      return;
    let f, h = "";
    for (let p = l; p < a.length; ++p)
      if (p !== l && (h += e), h += a[p], f = s[h], f !== void 0) {
        if (["string", "number", "boolean"].indexOf(typeof f) > -1 && p < a.length - 1)
          continue;
        l += p - l + 1;
        break;
      }
    s = f;
  }
  return s;
}, Xb = (n) => n?.replace("_", "-"), l7 = {
  type: "logger",
  log(n) {
    this.output("log", n);
  },
  warn(n) {
    this.output("warn", n);
  },
  error(n) {
    this.output("error", n);
  },
  output(n, t) {
    console?.[n]?.apply?.(console, t);
  }
};
class TT {
  constructor(t, e = {}) {
    this.init(t, e);
  }
  init(t, e = {}) {
    this.prefix = e.prefix || "i18next:", this.logger = t || l7, this.options = e, this.debug = e.debug;
  }
  log(...t) {
    return this.forward(t, "log", "", !0);
  }
  warn(...t) {
    return this.forward(t, "warn", "", !0);
  }
  error(...t) {
    return this.forward(t, "error", "");
  }
  deprecate(...t) {
    return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
  }
  forward(t, e, a, s) {
    return s && !this.debug ? null : (Je(t[0]) && (t[0] = `${a}${this.prefix} ${t[0]}`), this.logger[e](t));
  }
  create(t) {
    return new TT(this.logger, {
      prefix: `${this.prefix}:${t}:`,
      ...this.options
    });
  }
  clone(t) {
    return t = t || this.options, t.prefix = t.prefix || this.prefix, new TT(this.logger, t);
  }
}
var ed = new TT();
class sw {
  constructor() {
    this.observers = {};
  }
  on(t, e) {
    return t.split(" ").forEach((a) => {
      this.observers[a] || (this.observers[a] = /* @__PURE__ */ new Map());
      const s = this.observers[a].get(e) || 0;
      this.observers[a].set(e, s + 1);
    }), this;
  }
  off(t, e) {
    if (this.observers[t]) {
      if (!e) {
        delete this.observers[t];
        return;
      }
      this.observers[t].delete(e);
    }
  }
  emit(t, ...e) {
    this.observers[t] && Array.from(this.observers[t].entries()).forEach(([s, l]) => {
      for (let f = 0; f < l; f++)
        s(...e);
    }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([s, l]) => {
      for (let f = 0; f < l; f++)
        s.apply(s, [t, ...e]);
    });
  }
}
class w3 extends sw {
  constructor(t, e = {
    ns: ["translation"],
    defaultNS: "translation"
  }) {
    super(), this.data = t || {}, this.options = e, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
  }
  addNamespaces(t) {
    this.options.ns.indexOf(t) < 0 && this.options.ns.push(t);
  }
  removeNamespaces(t) {
    const e = this.options.ns.indexOf(t);
    e > -1 && this.options.ns.splice(e, 1);
  }
  getResource(t, e, a, s = {}) {
    const l = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, f = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
    let h;
    t.indexOf(".") > -1 ? h = t.split(".") : (h = [t, e], a && (Array.isArray(a) ? h.push(...a) : Je(a) && l ? h.push(...a.split(l)) : h.push(a)));
    const p = xT(this.data, h);
    return !p && !e && !a && t.indexOf(".") > -1 && (t = h[0], e = h[1], a = h.slice(2).join(".")), p || !f || !Je(a) ? p : oM(this.data?.[t]?.[e], a, l);
  }
  addResource(t, e, a, s, l = {
    silent: !1
  }) {
    const f = l.keySeparator !== void 0 ? l.keySeparator : this.options.keySeparator;
    let h = [t, e];
    a && (h = h.concat(f ? a.split(f) : a)), t.indexOf(".") > -1 && (h = t.split("."), s = e, e = h[1]), this.addNamespaces(e), T3(this.data, h, s), l.silent || this.emit("added", t, e, a, s);
  }
  addResources(t, e, a, s = {
    silent: !1
  }) {
    for (const l in a)
      (Je(a[l]) || Array.isArray(a[l])) && this.addResource(t, e, l, a[l], {
        silent: !0
      });
    s.silent || this.emit("added", t, e, a);
  }
  addResourceBundle(t, e, a, s, l, f = {
    silent: !1,
    skipCopy: !1
  }) {
    let h = [t, e];
    t.indexOf(".") > -1 && (h = t.split("."), s = a, a = e, e = h[1]), this.addNamespaces(e);
    let p = xT(this.data, h) || {};
    f.skipCopy || (a = JSON.parse(JSON.stringify(a))), s ? jL(p, a, l) : p = {
      ...p,
      ...a
    }, T3(this.data, h, p), f.silent || this.emit("added", t, e, a);
  }
  removeResourceBundle(t, e) {
    this.hasResourceBundle(t, e) && delete this.data[t][e], this.removeNamespaces(e), this.emit("removed", t, e);
  }
  hasResourceBundle(t, e) {
    return this.getResource(t, e) !== void 0;
  }
  getResourceBundle(t, e) {
    return e || (e = this.options.defaultNS), this.getResource(t, e);
  }
  getDataByLanguage(t) {
    return this.data[t];
  }
  hasLanguageSomeTranslations(t) {
    const e = this.getDataByLanguage(t);
    return !!(e && Object.keys(e) || []).find((s) => e[s] && Object.keys(e[s]).length > 0);
  }
  toJSON() {
    return this.data;
  }
}
var kL = {
  processors: {},
  addPostProcessor(n) {
    this.processors[n.name] = n;
  },
  handle(n, t, e, a, s) {
    return n.forEach((l) => {
      t = this.processors[l]?.process(t, e, a, s) ?? t;
    }), t;
  }
};
const R3 = {}, A3 = (n) => !Je(n) && typeof n != "boolean" && typeof n != "number";
class wT extends sw {
  constructor(t, e = {}) {
    super(), QI(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], t, this), this.options = e, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = ed.create("translator");
  }
  changeLanguage(t) {
    t && (this.language = t);
  }
  exists(t, e = {
    interpolation: {}
  }) {
    const a = {
      ...e
    };
    return t == null ? !1 : this.resolve(t, a)?.res !== void 0;
  }
  extractFromKey(t, e) {
    let a = e.nsSeparator !== void 0 ? e.nsSeparator : this.options.nsSeparator;
    a === void 0 && (a = ":");
    const s = e.keySeparator !== void 0 ? e.keySeparator : this.options.keySeparator;
    let l = e.ns || this.options.defaultNS || [];
    const f = a && t.indexOf(a) > -1, h = !this.options.userDefinedKeySeparator && !e.keySeparator && !this.options.userDefinedNsSeparator && !e.nsSeparator && !o7(t, a, s);
    if (f && !h) {
      const p = t.match(this.interpolator.nestingRegexp);
      if (p && p.length > 0)
        return {
          key: t,
          namespaces: Je(l) ? [l] : l
        };
      const y = t.split(a);
      (a !== s || a === s && this.options.ns.indexOf(y[0]) > -1) && (l = y.shift()), t = y.join(s);
    }
    return {
      key: t,
      namespaces: Je(l) ? [l] : l
    };
  }
  translate(t, e, a) {
    let s = typeof e == "object" ? {
      ...e
    } : e;
    if (typeof s != "object" && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), typeof options == "object" && (s = {
      ...s
    }), s || (s = {}), t == null) return "";
    Array.isArray(t) || (t = [String(t)]);
    const l = s.returnDetails !== void 0 ? s.returnDetails : this.options.returnDetails, f = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, {
      key: h,
      namespaces: p
    } = this.extractFromKey(t[t.length - 1], s), y = p[p.length - 1];
    let b = s.nsSeparator !== void 0 ? s.nsSeparator : this.options.nsSeparator;
    b === void 0 && (b = ":");
    const x = s.lng || this.language, w = s.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if (x?.toLowerCase() === "cimode")
      return w ? l ? {
        res: `${y}${b}${h}`,
        usedKey: h,
        exactUsedKey: h,
        usedLng: x,
        usedNS: y,
        usedParams: this.getUsedParamsDetails(s)
      } : `${y}${b}${h}` : l ? {
        res: h,
        usedKey: h,
        exactUsedKey: h,
        usedLng: x,
        usedNS: y,
        usedParams: this.getUsedParamsDetails(s)
      } : h;
    const A = this.resolve(t, s);
    let C = A?.res;
    const L = A?.usedKey || h, N = A?.exactUsedKey || h, U = ["[object Number]", "[object Function]", "[object RegExp]"], k = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, H = !this.i18nFormat || this.i18nFormat.handleAsObject, B = s.count !== void 0 && !Je(s.count), z = wT.hasDefaultValue(s), Q = B ? this.pluralResolver.getSuffix(x, s.count, s) : "", et = s.ordinal && B ? this.pluralResolver.getSuffix(x, s.count, {
      ordinal: !1
    }) : "", ot = B && !s.ordinal && s.count === 0, pt = ot && s[`defaultValue${this.options.pluralSeparator}zero`] || s[`defaultValue${Q}`] || s[`defaultValue${et}`] || s.defaultValue;
    let ht = C;
    H && !C && z && (ht = pt);
    const Ct = A3(ht), mt = Object.prototype.toString.apply(ht);
    if (H && ht && Ct && U.indexOf(mt) < 0 && !(Je(k) && Array.isArray(ht))) {
      if (!s.returnObjects && !this.options.returnObjects) {
        this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        const St = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(L, ht, {
          ...s,
          ns: p
        }) : `key '${h} (${this.language})' returned an object instead of string.`;
        return l ? (A.res = St, A.usedParams = this.getUsedParamsDetails(s), A) : St;
      }
      if (f) {
        const St = Array.isArray(ht), Ut = St ? [] : {}, Ft = St ? N : L;
        for (const nt in ht)
          if (Object.prototype.hasOwnProperty.call(ht, nt)) {
            const J = `${Ft}${f}${nt}`;
            z && !C ? Ut[nt] = this.translate(J, {
              ...s,
              defaultValue: A3(pt) ? pt[nt] : void 0,
              joinArrays: !1,
              ns: p
            }) : Ut[nt] = this.translate(J, {
              ...s,
              joinArrays: !1,
              ns: p
            }), Ut[nt] === J && (Ut[nt] = ht[nt]);
          }
        C = Ut;
      }
    } else if (H && Je(k) && Array.isArray(C))
      C = C.join(k), C && (C = this.extendTranslation(C, t, s, a));
    else {
      let St = !1, Ut = !1;
      !this.isValidLookup(C) && z && (St = !0, C = pt), this.isValidLookup(C) || (Ut = !0, C = h);
      const nt = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && Ut ? void 0 : C, J = z && pt !== C && this.options.updateMissing;
      if (Ut || St || J) {
        if (this.logger.log(J ? "updateKey" : "missingKey", x, y, h, J ? pt : C), f) {
          const j = this.resolve(h, {
            ...s,
            keySeparator: !1
          });
          j && j.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
        }
        let gt = [];
        const Ot = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
        if (this.options.saveMissingTo === "fallback" && Ot && Ot[0])
          for (let j = 0; j < Ot.length; j++)
            gt.push(Ot[j]);
        else this.options.saveMissingTo === "all" ? gt = this.languageUtils.toResolveHierarchy(s.lng || this.language) : gt.push(s.lng || this.language);
        const W = (j, X, st) => {
          const At = z && st !== C ? st : nt;
          this.options.missingKeyHandler ? this.options.missingKeyHandler(j, y, X, At, J, s) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(j, y, X, At, J, s), this.emit("missingKey", j, y, X, C);
        };
        this.options.saveMissing && (this.options.saveMissingPlurals && B ? gt.forEach((j) => {
          const X = this.pluralResolver.getSuffixes(j, s);
          ot && s[`defaultValue${this.options.pluralSeparator}zero`] && X.indexOf(`${this.options.pluralSeparator}zero`) < 0 && X.push(`${this.options.pluralSeparator}zero`), X.forEach((st) => {
            W([j], h + st, s[`defaultValue${st}`] || pt);
          });
        }) : W(gt, h, pt));
      }
      C = this.extendTranslation(C, t, s, A, a), Ut && C === h && this.options.appendNamespaceToMissingKey && (C = `${y}${b}${h}`), (Ut || St) && this.options.parseMissingKeyHandler && (C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${y}${b}${h}` : h, St ? C : void 0, s));
    }
    return l ? (A.res = C, A.usedParams = this.getUsedParamsDetails(s), A) : C;
  }
  extendTranslation(t, e, a, s, l) {
    if (this.i18nFormat?.parse)
      t = this.i18nFormat.parse(t, {
        ...this.options.interpolation.defaultVariables,
        ...a
      }, a.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
        resolved: s
      });
    else if (!a.skipInterpolation) {
      a.interpolation && this.interpolator.init({
        ...a,
        interpolation: {
          ...this.options.interpolation,
          ...a.interpolation
        }
      });
      const p = Je(t) && (a?.interpolation?.skipOnVariables !== void 0 ? a.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
      let y;
      if (p) {
        const x = t.match(this.interpolator.nestingRegexp);
        y = x && x.length;
      }
      let b = a.replace && !Je(a.replace) ? a.replace : a;
      if (this.options.interpolation.defaultVariables && (b = {
        ...this.options.interpolation.defaultVariables,
        ...b
      }), t = this.interpolator.interpolate(t, b, a.lng || this.language || s.usedLng, a), p) {
        const x = t.match(this.interpolator.nestingRegexp), w = x && x.length;
        y < w && (a.nest = !1);
      }
      !a.lng && s && s.res && (a.lng = this.language || s.usedLng), a.nest !== !1 && (t = this.interpolator.nest(t, (...x) => l?.[0] === x[0] && !a.context ? (this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${e[0]}`), null) : this.translate(...x, e), a)), a.interpolation && this.interpolator.reset();
    }
    const f = a.postProcess || this.options.postProcess, h = Je(f) ? [f] : f;
    return t != null && h?.length && a.applyPostProcessor !== !1 && (t = kL.handle(h, t, e, this.options && this.options.postProcessPassResolved ? {
      i18nResolved: {
        ...s,
        usedParams: this.getUsedParamsDetails(a)
      },
      ...a
    } : a, this)), t;
  }
  resolve(t, e = {}) {
    let a, s, l, f, h;
    return Je(t) && (t = [t]), t.forEach((p) => {
      if (this.isValidLookup(a)) return;
      const y = this.extractFromKey(p, e), b = y.key;
      s = b;
      let x = y.namespaces;
      this.options.fallbackNS && (x = x.concat(this.options.fallbackNS));
      const w = e.count !== void 0 && !Je(e.count), A = w && !e.ordinal && e.count === 0, C = e.context !== void 0 && (Je(e.context) || typeof e.context == "number") && e.context !== "", L = e.lngs ? e.lngs : this.languageUtils.toResolveHierarchy(e.lng || this.language, e.fallbackLng);
      x.forEach((N) => {
        this.isValidLookup(a) || (h = N, !R3[`${L[0]}-${N}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(h) && (R3[`${L[0]}-${N}`] = !0, this.logger.warn(`key "${s}" for languages "${L.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), L.forEach((U) => {
          if (this.isValidLookup(a)) return;
          f = U;
          const k = [b];
          if (this.i18nFormat?.addLookupKeys)
            this.i18nFormat.addLookupKeys(k, b, U, N, e);
          else {
            let B;
            w && (B = this.pluralResolver.getSuffix(U, e.count, e));
            const z = `${this.options.pluralSeparator}zero`, Q = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
            if (w && (k.push(b + B), e.ordinal && B.indexOf(Q) === 0 && k.push(b + B.replace(Q, this.options.pluralSeparator)), A && k.push(b + z)), C) {
              const et = `${b}${this.options.contextSeparator}${e.context}`;
              k.push(et), w && (k.push(et + B), e.ordinal && B.indexOf(Q) === 0 && k.push(et + B.replace(Q, this.options.pluralSeparator)), A && k.push(et + z));
            }
          }
          let H;
          for (; H = k.pop(); )
            this.isValidLookup(a) || (l = H, a = this.getResource(U, N, H, e));
        }));
      });
    }), {
      res: a,
      usedKey: s,
      exactUsedKey: l,
      usedLng: f,
      usedNS: h
    };
  }
  isValidLookup(t) {
    return t !== void 0 && !(!this.options.returnNull && t === null) && !(!this.options.returnEmptyString && t === "");
  }
  getResource(t, e, a, s = {}) {
    return this.i18nFormat?.getResource ? this.i18nFormat.getResource(t, e, a, s) : this.resourceStore.getResource(t, e, a, s);
  }
  getUsedParamsDetails(t = {}) {
    const e = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], a = t.replace && !Je(t.replace);
    let s = a ? t.replace : t;
    if (a && typeof t.count < "u" && (s.count = t.count), this.options.interpolation.defaultVariables && (s = {
      ...this.options.interpolation.defaultVariables,
      ...s
    }), !a) {
      s = {
        ...s
      };
      for (const l of e)
        delete s[l];
    }
    return s;
  }
  static hasDefaultValue(t) {
    const e = "defaultValue";
    for (const a in t)
      if (Object.prototype.hasOwnProperty.call(t, a) && e === a.substring(0, e.length) && t[a] !== void 0)
        return !0;
    return !1;
  }
}
class M3 {
  constructor(t) {
    this.options = t, this.supportedLngs = this.options.supportedLngs || !1, this.logger = ed.create("languageUtils");
  }
  getScriptPartFromCode(t) {
    if (t = Xb(t), !t || t.indexOf("-") < 0) return null;
    const e = t.split("-");
    return e.length === 2 || (e.pop(), e[e.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(e.join("-"));
  }
  getLanguagePartFromCode(t) {
    if (t = Xb(t), !t || t.indexOf("-") < 0) return t;
    const e = t.split("-");
    return this.formatLanguageCode(e[0]);
  }
  formatLanguageCode(t) {
    if (Je(t) && t.indexOf("-") > -1) {
      let e;
      try {
        e = Intl.getCanonicalLocales(t)[0];
      } catch {
      }
      return e && this.options.lowerCaseLng && (e = e.toLowerCase()), e || (this.options.lowerCaseLng ? t.toLowerCase() : t);
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
  }
  isSupportedCode(t) {
    return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(t) > -1;
  }
  getBestMatchFromCodes(t) {
    if (!t) return null;
    let e;
    return t.forEach((a) => {
      if (e) return;
      const s = this.formatLanguageCode(a);
      (!this.options.supportedLngs || this.isSupportedCode(s)) && (e = s);
    }), !e && this.options.supportedLngs && t.forEach((a) => {
      if (e) return;
      const s = this.getScriptPartFromCode(a);
      if (this.isSupportedCode(s)) return e = s;
      const l = this.getLanguagePartFromCode(a);
      if (this.isSupportedCode(l)) return e = l;
      e = this.options.supportedLngs.find((f) => {
        if (f === l) return f;
        if (!(f.indexOf("-") < 0 && l.indexOf("-") < 0) && (f.indexOf("-") > 0 && l.indexOf("-") < 0 && f.substring(0, f.indexOf("-")) === l || f.indexOf(l) === 0 && l.length > 1))
          return f;
      });
    }), e || (e = this.getFallbackCodes(this.options.fallbackLng)[0]), e;
  }
  getFallbackCodes(t, e) {
    if (!t) return [];
    if (typeof t == "function" && (t = t(e)), Je(t) && (t = [t]), Array.isArray(t)) return t;
    if (!e) return t.default || [];
    let a = t[e];
    return a || (a = t[this.getScriptPartFromCode(e)]), a || (a = t[this.formatLanguageCode(e)]), a || (a = t[this.getLanguagePartFromCode(e)]), a || (a = t.default), a || [];
  }
  toResolveHierarchy(t, e) {
    const a = this.getFallbackCodes((e === !1 ? [] : e) || this.options.fallbackLng || [], t), s = [], l = (f) => {
      f && (this.isSupportedCode(f) ? s.push(f) : this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`));
    };
    return Je(t) && (t.indexOf("-") > -1 || t.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && l(this.formatLanguageCode(t)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && l(this.getScriptPartFromCode(t)), this.options.load !== "currentOnly" && l(this.getLanguagePartFromCode(t))) : Je(t) && l(this.formatLanguageCode(t)), a.forEach((f) => {
      s.indexOf(f) < 0 && l(this.formatLanguageCode(f));
    }), s;
  }
}
const C3 = {
  zero: 0,
  one: 1,
  two: 2,
  few: 3,
  many: 4,
  other: 5
}, O3 = {
  select: (n) => n === 1 ? "one" : "other",
  resolvedOptions: () => ({
    pluralCategories: ["one", "other"]
  })
};
class u7 {
  constructor(t, e = {}) {
    this.languageUtils = t, this.options = e, this.logger = ed.create("pluralResolver"), this.pluralRulesCache = {};
  }
  addRule(t, e) {
    this.rules[t] = e;
  }
  clearCache() {
    this.pluralRulesCache = {};
  }
  getRule(t, e = {}) {
    const a = Xb(t === "dev" ? "en" : t), s = e.ordinal ? "ordinal" : "cardinal", l = JSON.stringify({
      cleanedCode: a,
      type: s
    });
    if (l in this.pluralRulesCache)
      return this.pluralRulesCache[l];
    let f;
    try {
      f = new Intl.PluralRules(a, {
        type: s
      });
    } catch {
      if (!Intl)
        return this.logger.error("No Intl support, please use an Intl polyfill!"), O3;
      if (!t.match(/-|_/)) return O3;
      const p = this.languageUtils.getLanguagePartFromCode(t);
      f = this.getRule(p, e);
    }
    return this.pluralRulesCache[l] = f, f;
  }
  needsPlural(t, e = {}) {
    let a = this.getRule(t, e);
    return a || (a = this.getRule("dev", e)), a?.resolvedOptions().pluralCategories.length > 1;
  }
  getPluralFormsOfKey(t, e, a = {}) {
    return this.getSuffixes(t, a).map((s) => `${e}${s}`);
  }
  getSuffixes(t, e = {}) {
    let a = this.getRule(t, e);
    return a || (a = this.getRule("dev", e)), a ? a.resolvedOptions().pluralCategories.sort((s, l) => C3[s] - C3[l]).map((s) => `${this.options.prepend}${e.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
  }
  getSuffix(t, e, a = {}) {
    const s = this.getRule(t, a);
    return s ? `${this.options.prepend}${a.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(e)}` : (this.logger.warn(`no plural rule found for: ${t}`), this.getSuffix("dev", e, a));
  }
}
const D3 = (n, t, e, a = ".", s = !0) => {
  let l = e7(n, t, e);
  return !l && s && Je(e) && (l = oM(n, e, a), l === void 0 && (l = oM(t, e, a))), l;
}, ZR = (n) => n.replace(/\$/g, "$$$$");
class c7 {
  constructor(t = {}) {
    this.logger = ed.create("interpolator"), this.options = t, this.format = t?.interpolation?.format || ((e) => e), this.init(t);
  }
  init(t = {}) {
    t.interpolation || (t.interpolation = {
      escapeValue: !0
    });
    const {
      escape: e,
      escapeValue: a,
      useRawValueToEscape: s,
      prefix: l,
      prefixEscaped: f,
      suffix: h,
      suffixEscaped: p,
      formatSeparator: y,
      unescapeSuffix: b,
      unescapePrefix: x,
      nestingPrefix: w,
      nestingPrefixEscaped: A,
      nestingSuffix: C,
      nestingSuffixEscaped: L,
      nestingOptionsSeparator: N,
      maxReplaces: U,
      alwaysFormat: k
    } = t.interpolation;
    this.escape = e !== void 0 ? e : i7, this.escapeValue = a !== void 0 ? a : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = l ? p1(l) : f || "{{", this.suffix = h ? p1(h) : p || "}}", this.formatSeparator = y || ",", this.unescapePrefix = b ? "" : x || "-", this.unescapeSuffix = this.unescapePrefix ? "" : b || "", this.nestingPrefix = w ? p1(w) : A || p1("$t("), this.nestingSuffix = C ? p1(C) : L || p1(")"), this.nestingOptionsSeparator = N || ",", this.maxReplaces = U || 1e3, this.alwaysFormat = k !== void 0 ? k : !1, this.resetRegExp();
  }
  reset() {
    this.options && this.init(this.options);
  }
  resetRegExp() {
    const t = (e, a) => e?.source === a ? (e.lastIndex = 0, e) : new RegExp(a, "g");
    this.regexp = t(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = t(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = t(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
  }
  interpolate(t, e, a, s) {
    let l, f, h;
    const p = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, y = (A) => {
      if (A.indexOf(this.formatSeparator) < 0) {
        const U = D3(e, p, A, this.options.keySeparator, this.options.ignoreJSONStructure);
        return this.alwaysFormat ? this.format(U, void 0, a, {
          ...s,
          ...e,
          interpolationkey: A
        }) : U;
      }
      const C = A.split(this.formatSeparator), L = C.shift().trim(), N = C.join(this.formatSeparator).trim();
      return this.format(D3(e, p, L, this.options.keySeparator, this.options.ignoreJSONStructure), N, a, {
        ...s,
        ...e,
        interpolationkey: L
      });
    };
    this.resetRegExp();
    const b = s?.missingInterpolationHandler || this.options.missingInterpolationHandler, x = s?.interpolation?.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
    return [{
      regex: this.regexpUnescape,
      safeValue: (A) => ZR(A)
    }, {
      regex: this.regexp,
      safeValue: (A) => this.escapeValue ? ZR(this.escape(A)) : ZR(A)
    }].forEach((A) => {
      for (h = 0; l = A.regex.exec(t); ) {
        const C = l[1].trim();
        if (f = y(C), f === void 0)
          if (typeof b == "function") {
            const N = b(t, l, s);
            f = Je(N) ? N : "";
          } else if (s && Object.prototype.hasOwnProperty.call(s, C))
            f = "";
          else if (x) {
            f = l[0];
            continue;
          } else
            this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`), f = "";
        else !Je(f) && !this.useRawValueToEscape && (f = b3(f));
        const L = A.safeValue(f);
        if (t = t.replace(l[0], L), x ? (A.regex.lastIndex += f.length, A.regex.lastIndex -= l[0].length) : A.regex.lastIndex = 0, h++, h >= this.maxReplaces)
          break;
      }
    }), t;
  }
  nest(t, e, a = {}) {
    let s, l, f;
    const h = (p, y) => {
      const b = this.nestingOptionsSeparator;
      if (p.indexOf(b) < 0) return p;
      const x = p.split(new RegExp(`${b}[ ]*{`));
      let w = `{${x[1]}`;
      p = x[0], w = this.interpolate(w, f);
      const A = w.match(/'/g), C = w.match(/"/g);
      ((A?.length ?? 0) % 2 === 0 && !C || C.length % 2 !== 0) && (w = w.replace(/'/g, '"'));
      try {
        f = JSON.parse(w), y && (f = {
          ...y,
          ...f
        });
      } catch (L) {
        return this.logger.warn(`failed parsing options string in nesting for key ${p}`, L), `${p}${b}${w}`;
      }
      return f.defaultValue && f.defaultValue.indexOf(this.prefix) > -1 && delete f.defaultValue, p;
    };
    for (; s = this.nestingRegexp.exec(t); ) {
      let p = [];
      f = {
        ...a
      }, f = f.replace && !Je(f.replace) ? f.replace : f, f.applyPostProcessor = !1, delete f.defaultValue;
      const y = /{.*}/.test(s[1]) ? s[1].lastIndexOf("}") + 1 : s[1].indexOf(this.formatSeparator);
      if (y !== -1 && (p = s[1].slice(y).split(this.formatSeparator).map((b) => b.trim()).filter(Boolean), s[1] = s[1].slice(0, y)), l = e(h.call(this, s[1].trim(), f), f), l && s[0] === t && !Je(l)) return l;
      Je(l) || (l = b3(l)), l || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`), l = ""), p.length && (l = p.reduce((b, x) => this.format(b, x, a.lng, {
        ...a,
        interpolationkey: s[1].trim()
      }), l.trim())), t = t.replace(s[0], l), this.regexp.lastIndex = 0;
    }
    return t;
  }
}
const f7 = (n) => {
  let t = n.toLowerCase().trim();
  const e = {};
  if (n.indexOf("(") > -1) {
    const a = n.split("(");
    t = a[0].toLowerCase().trim();
    const s = a[1].substring(0, a[1].length - 1);
    t === "currency" && s.indexOf(":") < 0 ? e.currency || (e.currency = s.trim()) : t === "relativetime" && s.indexOf(":") < 0 ? e.range || (e.range = s.trim()) : s.split(";").forEach((f) => {
      if (f) {
        const [h, ...p] = f.split(":"), y = p.join(":").trim().replace(/^'+|'+$/g, ""), b = h.trim();
        e[b] || (e[b] = y), y === "false" && (e[b] = !1), y === "true" && (e[b] = !0), isNaN(y) || (e[b] = parseInt(y, 10));
      }
    });
  }
  return {
    formatName: t,
    formatOptions: e
  };
}, N3 = (n) => {
  const t = {};
  return (e, a, s) => {
    let l = s;
    s && s.interpolationkey && s.formatParams && s.formatParams[s.interpolationkey] && s[s.interpolationkey] && (l = {
      ...l,
      [s.interpolationkey]: void 0
    });
    const f = a + JSON.stringify(l);
    let h = t[f];
    return h || (h = n(Xb(a), s), t[f] = h), h(e);
  };
}, h7 = (n) => (t, e, a) => n(Xb(e), a)(t);
class d7 {
  constructor(t = {}) {
    this.logger = ed.create("formatter"), this.options = t, this.init(t);
  }
  init(t, e = {
    interpolation: {}
  }) {
    this.formatSeparator = e.interpolation.formatSeparator || ",";
    const a = e.cacheInBuiltFormats ? N3 : h7;
    this.formats = {
      number: a((s, l) => {
        const f = new Intl.NumberFormat(s, {
          ...l
        });
        return (h) => f.format(h);
      }),
      currency: a((s, l) => {
        const f = new Intl.NumberFormat(s, {
          ...l,
          style: "currency"
        });
        return (h) => f.format(h);
      }),
      datetime: a((s, l) => {
        const f = new Intl.DateTimeFormat(s, {
          ...l
        });
        return (h) => f.format(h);
      }),
      relativetime: a((s, l) => {
        const f = new Intl.RelativeTimeFormat(s, {
          ...l
        });
        return (h) => f.format(h, l.range || "day");
      }),
      list: a((s, l) => {
        const f = new Intl.ListFormat(s, {
          ...l
        });
        return (h) => f.format(h);
      })
    };
  }
  add(t, e) {
    this.formats[t.toLowerCase().trim()] = e;
  }
  addCached(t, e) {
    this.formats[t.toLowerCase().trim()] = N3(e);
  }
  format(t, e, a, s = {}) {
    const l = e.split(this.formatSeparator);
    if (l.length > 1 && l[0].indexOf("(") > 1 && l[0].indexOf(")") < 0 && l.find((h) => h.indexOf(")") > -1)) {
      const h = l.findIndex((p) => p.indexOf(")") > -1);
      l[0] = [l[0], ...l.splice(1, h)].join(this.formatSeparator);
    }
    return l.reduce((h, p) => {
      const {
        formatName: y,
        formatOptions: b
      } = f7(p);
      if (this.formats[y]) {
        let x = h;
        try {
          const w = s?.formatParams?.[s.interpolationkey] || {}, A = w.locale || w.lng || s.locale || s.lng || a;
          x = this.formats[y](h, A, {
            ...b,
            ...s,
            ...w
          });
        } catch (w) {
          this.logger.warn(w);
        }
        return x;
      } else
        this.logger.warn(`there was no format function for ${y}`);
      return h;
    }, t);
  }
}
const g7 = (n, t) => {
  n.pending[t] !== void 0 && (delete n.pending[t], n.pendingCount--);
};
class m7 extends sw {
  constructor(t, e, a, s = {}) {
    super(), this.backend = t, this.store = e, this.services = a, this.languageUtils = a.languageUtils, this.options = s, this.logger = ed.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(a, s.backend, s);
  }
  queueLoad(t, e, a, s) {
    const l = {}, f = {}, h = {}, p = {};
    return t.forEach((y) => {
      let b = !0;
      e.forEach((x) => {
        const w = `${y}|${x}`;
        !a.reload && this.store.hasResourceBundle(y, x) ? this.state[w] = 2 : this.state[w] < 0 || (this.state[w] === 1 ? f[w] === void 0 && (f[w] = !0) : (this.state[w] = 1, b = !1, f[w] === void 0 && (f[w] = !0), l[w] === void 0 && (l[w] = !0), p[x] === void 0 && (p[x] = !0)));
      }), b || (h[y] = !0);
    }), (Object.keys(l).length || Object.keys(f).length) && this.queue.push({
      pending: f,
      pendingCount: Object.keys(f).length,
      loaded: {},
      errors: [],
      callback: s
    }), {
      toLoad: Object.keys(l),
      pending: Object.keys(f),
      toLoadLanguages: Object.keys(h),
      toLoadNamespaces: Object.keys(p)
    };
  }
  loaded(t, e, a) {
    const s = t.split("|"), l = s[0], f = s[1];
    e && this.emit("failedLoading", l, f, e), !e && a && this.store.addResourceBundle(l, f, a, void 0, void 0, {
      skipCopy: !0
    }), this.state[t] = e ? -1 : 2, e && a && (this.state[t] = 0);
    const h = {};
    this.queue.forEach((p) => {
      t7(p.loaded, [l], f), g7(p, t), e && p.errors.push(e), p.pendingCount === 0 && !p.done && (Object.keys(p.loaded).forEach((y) => {
        h[y] || (h[y] = {});
        const b = p.loaded[y];
        b.length && b.forEach((x) => {
          h[y][x] === void 0 && (h[y][x] = !0);
        });
      }), p.done = !0, p.errors.length ? p.callback(p.errors) : p.callback());
    }), this.emit("loaded", h), this.queue = this.queue.filter((p) => !p.done);
  }
  read(t, e, a, s = 0, l = this.retryTimeout, f) {
    if (!t.length) return f(null, {});
    if (this.readingCalls >= this.maxParallelReads) {
      this.waitingReads.push({
        lng: t,
        ns: e,
        fcName: a,
        tried: s,
        wait: l,
        callback: f
      });
      return;
    }
    this.readingCalls++;
    const h = (y, b) => {
      if (this.readingCalls--, this.waitingReads.length > 0) {
        const x = this.waitingReads.shift();
        this.read(x.lng, x.ns, x.fcName, x.tried, x.wait, x.callback);
      }
      if (y && b && s < this.maxRetries) {
        setTimeout(() => {
          this.read.call(this, t, e, a, s + 1, l * 2, f);
        }, l);
        return;
      }
      f(y, b);
    }, p = this.backend[a].bind(this.backend);
    if (p.length === 2) {
      try {
        const y = p(t, e);
        y && typeof y.then == "function" ? y.then((b) => h(null, b)).catch(h) : h(null, y);
      } catch (y) {
        h(y);
      }
      return;
    }
    return p(t, e, h);
  }
  prepareLoading(t, e, a = {}, s) {
    if (!this.backend)
      return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
    Je(t) && (t = this.languageUtils.toResolveHierarchy(t)), Je(e) && (e = [e]);
    const l = this.queueLoad(t, e, a, s);
    if (!l.toLoad.length)
      return l.pending.length || s(), null;
    l.toLoad.forEach((f) => {
      this.loadOne(f);
    });
  }
  load(t, e, a) {
    this.prepareLoading(t, e, {}, a);
  }
  reload(t, e, a) {
    this.prepareLoading(t, e, {
      reload: !0
    }, a);
  }
  loadOne(t, e = "") {
    const a = t.split("|"), s = a[0], l = a[1];
    this.read(s, l, "read", void 0, void 0, (f, h) => {
      f && this.logger.warn(`${e}loading namespace ${l} for language ${s} failed`, f), !f && h && this.logger.log(`${e}loaded namespace ${l} for language ${s}`, h), this.loaded(t, f, h);
    });
  }
  saveMissing(t, e, a, s, l, f = {}, h = () => {
  }) {
    if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(e)) {
      this.logger.warn(`did not save key "${a}" as the namespace "${e}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
      return;
    }
    if (!(a == null || a === "")) {
      if (this.backend?.create) {
        const p = {
          ...f,
          isUpdate: l
        }, y = this.backend.create.bind(this.backend);
        if (y.length < 6)
          try {
            let b;
            y.length === 5 ? b = y(t, e, a, s, p) : b = y(t, e, a, s), b && typeof b.then == "function" ? b.then((x) => h(null, x)).catch(h) : h(null, b);
          } catch (b) {
            h(b);
          }
        else
          y(t, e, a, s, h, p);
      }
      !t || !t[0] || this.store.addResource(t[0], e, a, s);
    }
  }
}
const L3 = () => ({
  debug: !1,
  initAsync: !0,
  ns: ["translation"],
  defaultNS: ["translation"],
  fallbackLng: ["dev"],
  fallbackNS: !1,
  supportedLngs: !1,
  nonExplicitSupportedLngs: !1,
  load: "all",
  preload: !1,
  simplifyPluralSuffix: !0,
  keySeparator: ".",
  nsSeparator: ":",
  pluralSeparator: "_",
  contextSeparator: "_",
  partialBundledLanguages: !1,
  saveMissing: !1,
  updateMissing: !1,
  saveMissingTo: "fallback",
  saveMissingPlurals: !0,
  missingKeyHandler: !1,
  missingInterpolationHandler: !1,
  postProcess: !1,
  postProcessPassResolved: !1,
  returnNull: !1,
  returnEmptyString: !0,
  returnObjects: !1,
  joinArrays: !1,
  returnedObjectHandler: !1,
  parseMissingKeyHandler: !1,
  appendNamespaceToMissingKey: !1,
  appendNamespaceToCIMode: !1,
  overloadTranslationOptionHandler: (n) => {
    let t = {};
    if (typeof n[1] == "object" && (t = n[1]), Je(n[1]) && (t.defaultValue = n[1]), Je(n[2]) && (t.tDescription = n[2]), typeof n[2] == "object" || typeof n[3] == "object") {
      const e = n[3] || n[2];
      Object.keys(e).forEach((a) => {
        t[a] = e[a];
      });
    }
    return t;
  },
  interpolation: {
    escapeValue: !0,
    format: (n) => n,
    prefix: "{{",
    suffix: "}}",
    formatSeparator: ",",
    unescapePrefix: "-",
    nestingPrefix: "$t(",
    nestingSuffix: ")",
    nestingOptionsSeparator: ",",
    maxReplaces: 1e3,
    skipOnVariables: !0
  },
  cacheInBuiltFormats: !0
}), I3 = (n) => (Je(n.ns) && (n.ns = [n.ns]), Je(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), Je(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), n.supportedLngs?.indexOf?.("cimode") < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), typeof n.initImmediate == "boolean" && (n.initAsync = n.initImmediate), n), Px = () => {
}, p7 = (n) => {
  Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e) => {
    typeof n[e] == "function" && (n[e] = n[e].bind(n));
  });
};
class Kb extends sw {
  constructor(t = {}, e) {
    if (super(), this.options = I3(t), this.services = {}, this.logger = ed, this.modules = {
      external: []
    }, p7(this), e && !this.isInitialized && !t.isClone) {
      if (!this.options.initAsync)
        return this.init(t, e), this;
      setTimeout(() => {
        this.init(t, e);
      }, 0);
    }
  }
  init(t = {}, e) {
    this.isInitializing = !0, typeof t == "function" && (e = t, t = {}), t.defaultNS == null && t.ns && (Je(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
    const a = L3();
    this.options = {
      ...a,
      ...this.options,
      ...I3(t)
    }, this.options.interpolation = {
      ...a.interpolation,
      ...this.options.interpolation
    }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
    const s = (y) => y ? typeof y == "function" ? new y() : y : null;
    if (!this.options.isClone) {
      this.modules.logger ? ed.init(s(this.modules.logger), this.options) : ed.init(null, this.options);
      let y;
      this.modules.formatter ? y = this.modules.formatter : y = d7;
      const b = new M3(this.options);
      this.store = new w3(this.options.resources, this.options);
      const x = this.services;
      x.logger = ed, x.resourceStore = this.store, x.languageUtils = b, x.pluralResolver = new u7(b, {
        prepend: this.options.pluralSeparator,
        simplifyPluralSuffix: this.options.simplifyPluralSuffix
      }), this.options.interpolation.format && this.options.interpolation.format !== a.interpolation.format && this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), y && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (x.formatter = s(y), x.formatter.init && x.formatter.init(x, this.options), this.options.interpolation.format = x.formatter.format.bind(x.formatter)), x.interpolator = new c7(this.options), x.utils = {
        hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
      }, x.backendConnector = new m7(s(this.modules.backend), x.resourceStore, x, this.options), x.backendConnector.on("*", (A, ...C) => {
        this.emit(A, ...C);
      }), this.modules.languageDetector && (x.languageDetector = s(this.modules.languageDetector), x.languageDetector.init && x.languageDetector.init(x, this.options.detection, this.options)), this.modules.i18nFormat && (x.i18nFormat = s(this.modules.i18nFormat), x.i18nFormat.init && x.i18nFormat.init(this)), this.translator = new wT(this.services, this.options), this.translator.on("*", (A, ...C) => {
        this.emit(A, ...C);
      }), this.modules.external.forEach((A) => {
        A.init && A.init(this);
      });
    }
    if (this.format = this.options.interpolation.format, e || (e = Px), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
      const y = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      y.length > 0 && y[0] !== "dev" && (this.options.lng = y[0]);
    }
    !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((y) => {
      this[y] = (...b) => this.store[y](...b);
    }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((y) => {
      this[y] = (...b) => (this.store[y](...b), this);
    });
    const h = gb(), p = () => {
      const y = (b, x) => {
        this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), h.resolve(x), e(b, x);
      };
      if (this.languages && !this.isInitialized) return y(null, this.t.bind(this));
      this.changeLanguage(this.options.lng, y);
    };
    return this.options.resources || !this.options.initAsync ? p() : setTimeout(p, 0), h;
  }
  loadResources(t, e = Px) {
    let a = e;
    const s = Je(t) ? t : this.language;
    if (typeof t == "function" && (a = t), !this.options.resources || this.options.partialBundledLanguages) {
      if (s?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return a();
      const l = [], f = (h) => {
        if (!h || h === "cimode") return;
        this.services.languageUtils.toResolveHierarchy(h).forEach((y) => {
          y !== "cimode" && l.indexOf(y) < 0 && l.push(y);
        });
      };
      s ? f(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((p) => f(p)), this.options.preload?.forEach?.((h) => f(h)), this.services.backendConnector.load(l, this.options.ns, (h) => {
        !h && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), a(h);
      });
    } else
      a(null);
  }
  reloadResources(t, e, a) {
    const s = gb();
    return typeof t == "function" && (a = t, t = void 0), typeof e == "function" && (a = e, e = void 0), t || (t = this.languages), e || (e = this.options.ns), a || (a = Px), this.services.backendConnector.reload(t, e, (l) => {
      s.resolve(), a(l);
    }), s;
  }
  use(t) {
    if (!t) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
    if (!t.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
    return t.type === "backend" && (this.modules.backend = t), (t.type === "logger" || t.log && t.warn && t.error) && (this.modules.logger = t), t.type === "languageDetector" && (this.modules.languageDetector = t), t.type === "i18nFormat" && (this.modules.i18nFormat = t), t.type === "postProcessor" && kL.addPostProcessor(t), t.type === "formatter" && (this.modules.formatter = t), t.type === "3rdParty" && this.modules.external.push(t), this;
  }
  setResolvedLanguage(t) {
    if (!(!t || !this.languages) && !(["cimode", "dev"].indexOf(t) > -1)) {
      for (let e = 0; e < this.languages.length; e++) {
        const a = this.languages[e];
        if (!(["cimode", "dev"].indexOf(a) > -1) && this.store.hasLanguageSomeTranslations(a)) {
          this.resolvedLanguage = a;
          break;
        }
      }
      !this.resolvedLanguage && this.languages.indexOf(t) < 0 && this.store.hasLanguageSomeTranslations(t) && (this.resolvedLanguage = t, this.languages.unshift(t));
    }
  }
  changeLanguage(t, e) {
    this.isLanguageChangingTo = t;
    const a = gb();
    this.emit("languageChanging", t);
    const s = (h) => {
      this.language = h, this.languages = this.services.languageUtils.toResolveHierarchy(h), this.resolvedLanguage = void 0, this.setResolvedLanguage(h);
    }, l = (h, p) => {
      p ? this.isLanguageChangingTo === t && (s(p), this.translator.changeLanguage(p), this.isLanguageChangingTo = void 0, this.emit("languageChanged", p), this.logger.log("languageChanged", p)) : this.isLanguageChangingTo = void 0, a.resolve((...y) => this.t(...y)), e && e(h, (...y) => this.t(...y));
    }, f = (h) => {
      !t && !h && this.services.languageDetector && (h = []);
      const p = Je(h) ? h : h && h[0], y = this.store.hasLanguageSomeTranslations(p) ? p : this.services.languageUtils.getBestMatchFromCodes(Je(h) ? [h] : h);
      y && (this.language || s(y), this.translator.language || this.translator.changeLanguage(y), this.services.languageDetector?.cacheUserLanguage?.(y)), this.loadResources(y, (b) => {
        l(b, y);
      });
    };
    return !t && this.services.languageDetector && !this.services.languageDetector.async ? f(this.services.languageDetector.detect()) : !t && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(f) : this.services.languageDetector.detect(f) : f(t), a;
  }
  getFixedT(t, e, a) {
    const s = (l, f, ...h) => {
      let p;
      typeof f != "object" ? p = this.options.overloadTranslationOptionHandler([l, f].concat(h)) : p = {
        ...f
      }, p.lng = p.lng || s.lng, p.lngs = p.lngs || s.lngs, p.ns = p.ns || s.ns, p.keyPrefix !== "" && (p.keyPrefix = p.keyPrefix || a || s.keyPrefix);
      const y = this.options.keySeparator || ".";
      let b;
      return p.keyPrefix && Array.isArray(l) ? b = l.map((x) => `${p.keyPrefix}${y}${x}`) : b = p.keyPrefix ? `${p.keyPrefix}${y}${l}` : l, this.t(b, p);
    };
    return Je(t) ? s.lng = t : s.lngs = t, s.ns = e, s.keyPrefix = a, s;
  }
  t(...t) {
    return this.translator?.translate(...t);
  }
  exists(...t) {
    return this.translator?.exists(...t);
  }
  setDefaultNamespace(t) {
    this.options.defaultNS = t;
  }
  hasLoadedNamespace(t, e = {}) {
    if (!this.isInitialized)
      return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
    if (!this.languages || !this.languages.length)
      return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
    const a = e.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, l = this.languages[this.languages.length - 1];
    if (a.toLowerCase() === "cimode") return !0;
    const f = (h, p) => {
      const y = this.services.backendConnector.state[`${h}|${p}`];
      return y === -1 || y === 0 || y === 2;
    };
    if (e.precheck) {
      const h = e.precheck(this, f);
      if (h !== void 0) return h;
    }
    return !!(this.hasResourceBundle(a, t) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || f(a, t) && (!s || f(l, t)));
  }
  loadNamespaces(t, e) {
    const a = gb();
    return this.options.ns ? (Je(t) && (t = [t]), t.forEach((s) => {
      this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
    }), this.loadResources((s) => {
      a.resolve(), e && e(s);
    }), a) : (e && e(), Promise.resolve());
  }
  loadLanguages(t, e) {
    const a = gb();
    Je(t) && (t = [t]);
    const s = this.options.preload || [], l = t.filter((f) => s.indexOf(f) < 0 && this.services.languageUtils.isSupportedCode(f));
    return l.length ? (this.options.preload = s.concat(l), this.loadResources((f) => {
      a.resolve(), e && e(f);
    }), a) : (e && e(), Promise.resolve());
  }
  dir(t) {
    if (t || (t = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language)), !t) return "rtl";
    try {
      const s = new Intl.Locale(t);
      if (s && s.getTextInfo) {
        const l = s.getTextInfo();
        if (l && l.direction) return l.direction;
      }
    } catch {
    }
    const e = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], a = this.services?.languageUtils || new M3(L3());
    return t.toLowerCase().indexOf("-latn") > 1 ? "ltr" : e.indexOf(a.getLanguagePartFromCode(t)) > -1 || t.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
  }
  static createInstance(t = {}, e) {
    return new Kb(t, e);
  }
  cloneInstance(t = {}, e = Px) {
    const a = t.forkResourceStore;
    a && delete t.forkResourceStore;
    const s = {
      ...this.options,
      ...t,
      isClone: !0
    }, l = new Kb(s);
    if ((t.debug !== void 0 || t.prefix !== void 0) && (l.logger = l.logger.clone(t)), ["store", "services", "language"].forEach((h) => {
      l[h] = this[h];
    }), l.services = {
      ...this.services
    }, l.services.utils = {
      hasLoadedNamespace: l.hasLoadedNamespace.bind(l)
    }, a) {
      const h = Object.keys(this.store.data).reduce((p, y) => (p[y] = {
        ...this.store.data[y]
      }, p[y] = Object.keys(p[y]).reduce((b, x) => (b[x] = {
        ...p[y][x]
      }, b), p[y]), p), {});
      l.store = new w3(h, s), l.services.resourceStore = l.store;
    }
    return l.translator = new wT(l.services, s), l.translator.on("*", (h, ...p) => {
      l.emit(h, ...p);
    }), l.init(s, e), l.translator.options = s, l.translator.backendConnector.services.utils = {
      hasLoadedNamespace: l.hasLoadedNamespace.bind(l)
    }, l;
  }
  toJSON() {
    return {
      options: this.options,
      store: this.store,
      language: this.language,
      languages: this.languages,
      resolvedLanguage: this.resolvedLanguage
    };
  }
}
const os = Kb.createInstance();
os.createInstance = Kb.createInstance;
os.createInstance;
os.dir;
os.init;
os.loadResources;
os.reloadResources;
os.use;
os.changeLanguage;
os.getFixedT;
os.t;
os.exists;
os.setDefaultNamespace;
os.hasLoadedNamespace;
os.loadNamespaces;
os.loadLanguages;
const {
  slice: y7,
  forEach: _7
} = [];
function v7(n) {
  return _7.call(y7.call(arguments, 1), (t) => {
    if (t)
      for (const e in t)
        n[e] === void 0 && (n[e] = t[e]);
  }), n;
}
function E7(n) {
  return typeof n != "string" ? !1 : [/<\s*script.*?>/i, /<\s*\/\s*script\s*>/i, /<\s*img.*?on\w+\s*=/i, /<\s*\w+\s*on\w+\s*=.*?>/i, /javascript\s*:/i, /vbscript\s*:/i, /expression\s*\(/i, /eval\s*\(/i, /alert\s*\(/i, /document\.cookie/i, /document\.write\s*\(/i, /window\.location/i, /innerHTML/i].some((e) => e.test(n));
}
const P3 = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, b7 = function(n, t) {
  const a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
    path: "/"
  }, s = encodeURIComponent(t);
  let l = `${n}=${s}`;
  if (a.maxAge > 0) {
    const f = a.maxAge - 0;
    if (Number.isNaN(f)) throw new Error("maxAge should be a Number");
    l += `; Max-Age=${Math.floor(f)}`;
  }
  if (a.domain) {
    if (!P3.test(a.domain))
      throw new TypeError("option domain is invalid");
    l += `; Domain=${a.domain}`;
  }
  if (a.path) {
    if (!P3.test(a.path))
      throw new TypeError("option path is invalid");
    l += `; Path=${a.path}`;
  }
  if (a.expires) {
    if (typeof a.expires.toUTCString != "function")
      throw new TypeError("option expires is invalid");
    l += `; Expires=${a.expires.toUTCString()}`;
  }
  if (a.httpOnly && (l += "; HttpOnly"), a.secure && (l += "; Secure"), a.sameSite)
    switch (typeof a.sameSite == "string" ? a.sameSite.toLowerCase() : a.sameSite) {
      case !0:
        l += "; SameSite=Strict";
        break;
      case "lax":
        l += "; SameSite=Lax";
        break;
      case "strict":
        l += "; SameSite=Strict";
        break;
      case "none":
        l += "; SameSite=None";
        break;
      default:
        throw new TypeError("option sameSite is invalid");
    }
  return a.partitioned && (l += "; Partitioned"), l;
}, z3 = {
  create(n, t, e, a) {
    let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
      path: "/",
      sameSite: "strict"
    };
    e && (s.expires = /* @__PURE__ */ new Date(), s.expires.setTime(s.expires.getTime() + e * 60 * 1e3)), a && (s.domain = a), document.cookie = b7(n, t, s);
  },
  read(n) {
    const t = `${n}=`, e = document.cookie.split(";");
    for (let a = 0; a < e.length; a++) {
      let s = e[a];
      for (; s.charAt(0) === " "; ) s = s.substring(1, s.length);
      if (s.indexOf(t) === 0) return s.substring(t.length, s.length);
    }
    return null;
  },
  remove(n, t) {
    this.create(n, "", -1, t);
  }
};
var S7 = {
  name: "cookie",
  // Deconstruct the options object and extract the lookupCookie property
  lookup(n) {
    let {
      lookupCookie: t
    } = n;
    if (t && typeof document < "u")
      return z3.read(t) || void 0;
  },
  // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
  cacheUserLanguage(n, t) {
    let {
      lookupCookie: e,
      cookieMinutes: a,
      cookieDomain: s,
      cookieOptions: l
    } = t;
    e && typeof document < "u" && z3.create(e, n, a, s, l);
  }
}, x7 = {
  name: "querystring",
  // Deconstruct the options object and extract the lookupQuerystring property
  lookup(n) {
    let {
      lookupQuerystring: t
    } = n, e;
    if (typeof window < "u") {
      let {
        search: a
      } = window.location;
      !window.location.search && window.location.hash?.indexOf("?") > -1 && (a = window.location.hash.substring(window.location.hash.indexOf("?")));
      const l = a.substring(1).split("&");
      for (let f = 0; f < l.length; f++) {
        const h = l[f].indexOf("=");
        h > 0 && l[f].substring(0, h) === t && (e = l[f].substring(h + 1));
      }
    }
    return e;
  }
}, T7 = {
  name: "hash",
  // Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
  lookup(n) {
    let {
      lookupHash: t,
      lookupFromHashIndex: e
    } = n, a;
    if (typeof window < "u") {
      const {
        hash: s
      } = window.location;
      if (s && s.length > 2) {
        const l = s.substring(1);
        if (t) {
          const f = l.split("&");
          for (let h = 0; h < f.length; h++) {
            const p = f[h].indexOf("=");
            p > 0 && f[h].substring(0, p) === t && (a = f[h].substring(p + 1));
          }
        }
        if (a) return a;
        if (!a && e > -1) {
          const f = s.match(/\/([a-zA-Z-]*)/g);
          return Array.isArray(f) ? f[typeof e == "number" ? e : 0]?.replace("/", "") : void 0;
        }
      }
    }
    return a;
  }
};
let y1 = null;
const G3 = () => {
  if (y1 !== null) return y1;
  try {
    if (y1 = typeof window < "u" && window.localStorage !== null, !y1)
      return !1;
    const n = "i18next.translate.boo";
    window.localStorage.setItem(n, "foo"), window.localStorage.removeItem(n);
  } catch {
    y1 = !1;
  }
  return y1;
};
var w7 = {
  name: "localStorage",
  // Deconstruct the options object and extract the lookupLocalStorage property
  lookup(n) {
    let {
      lookupLocalStorage: t
    } = n;
    if (t && G3())
      return window.localStorage.getItem(t) || void 0;
  },
  // Deconstruct the options object and extract the lookupLocalStorage property
  cacheUserLanguage(n, t) {
    let {
      lookupLocalStorage: e
    } = t;
    e && G3() && window.localStorage.setItem(e, n);
  }
};
let _1 = null;
const U3 = () => {
  if (_1 !== null) return _1;
  try {
    if (_1 = typeof window < "u" && window.sessionStorage !== null, !_1)
      return !1;
    const n = "i18next.translate.boo";
    window.sessionStorage.setItem(n, "foo"), window.sessionStorage.removeItem(n);
  } catch {
    _1 = !1;
  }
  return _1;
};
var R7 = {
  name: "sessionStorage",
  lookup(n) {
    let {
      lookupSessionStorage: t
    } = n;
    if (t && U3())
      return window.sessionStorage.getItem(t) || void 0;
  },
  cacheUserLanguage(n, t) {
    let {
      lookupSessionStorage: e
    } = t;
    e && U3() && window.sessionStorage.setItem(e, n);
  }
}, A7 = {
  name: "navigator",
  lookup(n) {
    const t = [];
    if (typeof navigator < "u") {
      const {
        languages: e,
        userLanguage: a,
        language: s
      } = navigator;
      if (e)
        for (let l = 0; l < e.length; l++)
          t.push(e[l]);
      a && t.push(a), s && t.push(s);
    }
    return t.length > 0 ? t : void 0;
  }
}, M7 = {
  name: "htmlTag",
  // Deconstruct the options object and extract the htmlTag property
  lookup(n) {
    let {
      htmlTag: t
    } = n, e;
    const a = t || (typeof document < "u" ? document.documentElement : null);
    return a && typeof a.getAttribute == "function" && (e = a.getAttribute("lang")), e;
  }
}, C7 = {
  name: "path",
  // Deconstruct the options object and extract the lookupFromPathIndex property
  lookup(n) {
    let {
      lookupFromPathIndex: t
    } = n;
    if (typeof window > "u") return;
    const e = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
    return Array.isArray(e) ? e[typeof t == "number" ? t : 0]?.replace("/", "") : void 0;
  }
}, O7 = {
  name: "subdomain",
  lookup(n) {
    let {
      lookupFromSubdomainIndex: t
    } = n;
    const e = typeof t == "number" ? t + 1 : 1, a = typeof window < "u" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
    if (a)
      return a[e];
  }
};
let HL = !1;
try {
  document.cookie, HL = !0;
} catch {
}
const BL = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
HL || BL.splice(1, 1);
const D7 = () => ({
  order: BL,
  lookupQuerystring: "lng",
  lookupCookie: "i18next",
  lookupLocalStorage: "i18nextLng",
  lookupSessionStorage: "i18nextLng",
  // cache user language
  caches: ["localStorage"],
  excludeCacheFor: ["cimode"],
  // cookieMinutes: 10,
  // cookieDomain: 'myDomain'
  convertDetectedLanguage: (n) => n
});
class qL {
  constructor(t) {
    let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.type = "languageDetector", this.detectors = {}, this.init(t, e);
  }
  init() {
    let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
      languageUtils: {}
    }, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    this.services = t, this.options = v7(e, this.options || {}, D7()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = a, this.addDetector(S7), this.addDetector(x7), this.addDetector(w7), this.addDetector(R7), this.addDetector(A7), this.addDetector(M7), this.addDetector(C7), this.addDetector(O7), this.addDetector(T7);
  }
  addDetector(t) {
    return this.detectors[t.name] = t, this;
  }
  detect() {
    let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, e = [];
    return t.forEach((a) => {
      if (this.detectors[a]) {
        let s = this.detectors[a].lookup(this.options);
        s && typeof s == "string" && (s = [s]), s && (e = e.concat(s));
      }
    }), e = e.filter((a) => a != null && !E7(a)).map((a) => this.options.convertDetectedLanguage(a)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? e : e.length > 0 ? e[0] : null;
  }
  cacheUserLanguage(t) {
    let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
    e && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(t) > -1 || e.forEach((a) => {
      this.detectors[a] && this.detectors[a].cacheUserLanguage(t, this.options);
    }));
  }
}
qL.type = "languageDetector";
function lM(n) {
  "@babel/helpers - typeof";
  return lM = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, lM(n);
}
function VL() {
  return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : lM(XMLHttpRequest)) === "object";
}
function N7(n) {
  return !!n && typeof n.then == "function";
}
function L7(n) {
  return N7(n) ? n : Promise.resolve(n);
}
function j3(n, t) {
  var e = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var a = Object.getOwnPropertySymbols(n);
    t && (a = a.filter(function(s) {
      return Object.getOwnPropertyDescriptor(n, s).enumerable;
    })), e.push.apply(e, a);
  }
  return e;
}
function k3(n) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? j3(Object(e), !0).forEach(function(a) {
      I7(n, a, e[a]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : j3(Object(e)).forEach(function(a) {
      Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(e, a));
    });
  }
  return n;
}
function I7(n, t, e) {
  return (t = P7(t)) in n ? Object.defineProperty(n, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = e, n;
}
function P7(n) {
  var t = z7(n, "string");
  return O_(t) == "symbol" ? t : t + "";
}
function z7(n, t) {
  if (O_(n) != "object" || !n) return n;
  var e = n[Symbol.toPrimitive];
  if (e !== void 0) {
    var a = e.call(n, t);
    if (O_(a) != "object") return a;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(n);
}
function O_(n) {
  "@babel/helpers - typeof";
  return O_ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, O_(n);
}
var b0 = typeof fetch == "function" ? fetch : void 0;
typeof global < "u" && global.fetch ? b0 = global.fetch : typeof window < "u" && window.fetch && (b0 = window.fetch);
var Zb;
VL() && (typeof global < "u" && global.XMLHttpRequest ? Zb = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (Zb = window.XMLHttpRequest));
var RT;
typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? RT = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (RT = window.ActiveXObject));
typeof b0 != "function" && (b0 = void 0);
if (!b0 && !Zb && !RT)
  try {
    import("./browser-ponyfill-dLhjz9fn.js").then((n) => n.b).then(function(n) {
      b0 = n.default;
    }).catch(function() {
    });
  } catch {
  }
var uM = function(t, e) {
  if (e && O_(e) === "object") {
    var a = "";
    for (var s in e)
      a += "&" + encodeURIComponent(s) + "=" + encodeURIComponent(e[s]);
    if (!a) return t;
    t = t + (t.indexOf("?") !== -1 ? "&" : "?") + a.slice(1);
  }
  return t;
}, H3 = function(t, e, a, s) {
  var l = function(p) {
    if (!p.ok) return a(p.statusText || "Error", {
      status: p.status
    });
    p.text().then(function(y) {
      a(null, {
        status: p.status,
        data: y
      });
    }).catch(a);
  };
  if (s) {
    var f = s(t, e);
    if (f instanceof Promise) {
      f.then(l).catch(a);
      return;
    }
  }
  typeof fetch == "function" ? fetch(t, e).then(l).catch(a) : b0(t, e).then(l).catch(a);
}, B3 = !1, G7 = function(t, e, a, s) {
  t.queryStringParams && (e = uM(e, t.queryStringParams));
  var l = k3({}, typeof t.customHeaders == "function" ? t.customHeaders() : t.customHeaders);
  typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (l["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), a && (l["Content-Type"] = "application/json");
  var f = typeof t.requestOptions == "function" ? t.requestOptions(a) : t.requestOptions, h = k3({
    method: a ? "POST" : "GET",
    body: a ? t.stringify(a) : void 0,
    headers: l
  }, B3 ? {} : f), p = typeof t.alternateFetch == "function" && t.alternateFetch.length >= 1 ? t.alternateFetch : void 0;
  try {
    H3(e, h, s, p);
  } catch (y) {
    if (!f || Object.keys(f).length === 0 || !y.message || y.message.indexOf("not implemented") < 0)
      return s(y);
    try {
      Object.keys(f).forEach(function(b) {
        delete h[b];
      }), H3(e, h, s, p), B3 = !0;
    } catch (b) {
      s(b);
    }
  }
}, U7 = function(t, e, a, s) {
  a && O_(a) === "object" && (a = uM("", a).slice(1)), t.queryStringParams && (e = uM(e, t.queryStringParams));
  try {
    var l = Zb ? new Zb() : new RT("MSXML2.XMLHTTP.3.0");
    l.open(a ? "POST" : "GET", e, 1), t.crossDomain || l.setRequestHeader("X-Requested-With", "XMLHttpRequest"), l.withCredentials = !!t.withCredentials, a && l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), l.overrideMimeType && l.overrideMimeType("application/json");
    var f = t.customHeaders;
    if (f = typeof f == "function" ? f() : f, f)
      for (var h in f)
        l.setRequestHeader(h, f[h]);
    l.onreadystatechange = function() {
      l.readyState > 3 && s(l.status >= 400 ? l.statusText : null, {
        status: l.status,
        data: l.responseText
      });
    }, l.send(a);
  } catch (p) {
    console && console.log(p);
  }
}, j7 = function(t, e, a, s) {
  if (typeof a == "function" && (s = a, a = void 0), s = s || function() {
  }, b0 && e.indexOf("file:") !== 0)
    return G7(t, e, a, s);
  if (VL() || typeof ActiveXObject == "function")
    return U7(t, e, a, s);
  s(new Error("No fetch and no xhr implementation found!"));
};
function X1(n) {
  "@babel/helpers - typeof";
  return X1 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, X1(n);
}
function q3(n, t) {
  var e = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var a = Object.getOwnPropertySymbols(n);
    t && (a = a.filter(function(s) {
      return Object.getOwnPropertyDescriptor(n, s).enumerable;
    })), e.push.apply(e, a);
  }
  return e;
}
function WR(n) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? q3(Object(e), !0).forEach(function(a) {
      YL(n, a, e[a]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : q3(Object(e)).forEach(function(a) {
      Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(e, a));
    });
  }
  return n;
}
function k7(n, t) {
  if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function");
}
function H7(n, t) {
  for (var e = 0; e < t.length; e++) {
    var a = t[e];
    a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(n, FL(a.key), a);
  }
}
function B7(n, t, e) {
  return t && H7(n.prototype, t), Object.defineProperty(n, "prototype", { writable: !1 }), n;
}
function YL(n, t, e) {
  return (t = FL(t)) in n ? Object.defineProperty(n, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = e, n;
}
function FL(n) {
  var t = q7(n, "string");
  return X1(t) == "symbol" ? t : t + "";
}
function q7(n, t) {
  if (X1(n) != "object" || !n) return n;
  var e = n[Symbol.toPrimitive];
  if (e !== void 0) {
    var a = e.call(n, t);
    if (X1(a) != "object") return a;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(n);
}
var V7 = function() {
  return {
    loadPath: "/locales/{{lng}}/{{ns}}.json",
    addPath: "/locales/add/{{lng}}/{{ns}}",
    parse: function(e) {
      return JSON.parse(e);
    },
    stringify: JSON.stringify,
    parsePayload: function(e, a, s) {
      return YL({}, a, s || "");
    },
    parseLoadPayload: function(e, a) {
    },
    request: j7,
    reloadInterval: typeof window < "u" ? !1 : 3600 * 1e3,
    customHeaders: {},
    queryStringParams: {},
    crossDomain: !1,
    withCredentials: !1,
    overrideMimeType: !1,
    requestOptions: {
      mode: "cors",
      credentials: "same-origin",
      cache: "default"
    }
  };
}, $L = function() {
  function n(t) {
    var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    k7(this, n), this.services = t, this.options = e, this.allOptions = a, this.type = "backend", this.init(t, e, a);
  }
  return B7(n, [{
    key: "init",
    value: function(e) {
      var a = this, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
      if (this.services = e, this.options = WR(WR(WR({}, V7()), this.options || {}), s), this.allOptions = l, this.services && this.options.reloadInterval) {
        var f = setInterval(function() {
          return a.reload();
        }, this.options.reloadInterval);
        X1(f) === "object" && typeof f.unref == "function" && f.unref();
      }
    }
  }, {
    key: "readMulti",
    value: function(e, a, s) {
      this._readAny(e, e, a, a, s);
    }
  }, {
    key: "read",
    value: function(e, a, s) {
      this._readAny([e], e, [a], a, s);
    }
  }, {
    key: "_readAny",
    value: function(e, a, s, l, f) {
      var h = this, p = this.options.loadPath;
      typeof this.options.loadPath == "function" && (p = this.options.loadPath(e, s)), p = L7(p), p.then(function(y) {
        if (!y) return f(null, {});
        var b = h.services.interpolator.interpolate(y, {
          lng: e.join("+"),
          ns: s.join("+")
        });
        h.loadUrl(b, f, a, l);
      });
    }
  }, {
    key: "loadUrl",
    value: function(e, a, s, l) {
      var f = this, h = typeof s == "string" ? [s] : s, p = typeof l == "string" ? [l] : l, y = this.options.parseLoadPayload(h, p);
      this.options.request(this.options, e, y, function(b, x) {
        if (x && (x.status >= 500 && x.status < 600 || !x.status)) return a("failed loading " + e + "; status code: " + x.status, !0);
        if (x && x.status >= 400 && x.status < 500) return a("failed loading " + e + "; status code: " + x.status, !1);
        if (!x && b && b.message) {
          var w = b.message.toLowerCase(), A = ["failed", "fetch", "network", "load"].find(function(N) {
            return w.indexOf(N) > -1;
          });
          if (A)
            return a("failed loading " + e + ": " + b.message, !0);
        }
        if (b) return a(b, !1);
        var C, L;
        try {
          typeof x.data == "string" ? C = f.options.parse(x.data, s, l) : C = x.data;
        } catch {
          L = "failed parsing " + e + " to json";
        }
        if (L) return a(L, !1);
        a(null, C);
      });
    }
  }, {
    key: "create",
    value: function(e, a, s, l, f) {
      var h = this;
      if (this.options.addPath) {
        typeof e == "string" && (e = [e]);
        var p = this.options.parsePayload(a, s, l), y = 0, b = [], x = [];
        e.forEach(function(w) {
          var A = h.options.addPath;
          typeof h.options.addPath == "function" && (A = h.options.addPath(w, a));
          var C = h.services.interpolator.interpolate(A, {
            lng: w,
            ns: a
          });
          h.options.request(h.options, C, p, function(L, N) {
            y += 1, b.push(L), x.push(N), y === e.length && typeof f == "function" && f(b, x);
          });
        });
      }
    }
  }, {
    key: "reload",
    value: function() {
      var e = this, a = this.services, s = a.backendConnector, l = a.languageUtils, f = a.logger, h = s.language;
      if (!(h && h.toLowerCase() === "cimode")) {
        var p = [], y = function(x) {
          var w = l.toResolveHierarchy(x);
          w.forEach(function(A) {
            p.indexOf(A) < 0 && p.push(A);
          });
        };
        y(h), this.allOptions.preload && this.allOptions.preload.forEach(function(b) {
          return y(b);
        }), p.forEach(function(b) {
          e.allOptions.ns.forEach(function(x) {
            s.read(b, x, "read", null, null, function(w, A) {
              w && f.warn("loading namespace ".concat(x, " for language ").concat(b, " failed"), w), !w && A && f.log("loaded namespace ".concat(x, " for language ").concat(b), A), s.loaded("".concat(b, "|").concat(x), w, A);
            });
          });
        });
      }
    }
  }]);
}();
$L.type = "backend";
var Se = C0();
const Y7 = (n, t, e, a) => {
  const s = [e, {
    code: t,
    ...a || {}
  }];
  if (n?.services?.logger?.forward)
    return n.services.logger.forward(s, "warn", "react-i18next::", !0);
  x_(s[0]) && (s[0] = `react-i18next:: ${s[0]}`), n?.services?.logger?.warn ? n.services.logger.warn(...s) : console?.warn && console.warn(...s);
}, V3 = {}, cM = (n, t, e, a) => {
  x_(e) && V3[e] || (x_(e) && (V3[e] = /* @__PURE__ */ new Date()), Y7(n, t, e, a));
}, XL = (n, t) => () => {
  if (n.isInitialized)
    t();
  else {
    const e = () => {
      setTimeout(() => {
        n.off("initialized", e);
      }, 0), t();
    };
    n.on("initialized", e);
  }
}, fM = (n, t, e) => {
  n.loadNamespaces(t, XL(n, e));
}, Y3 = (n, t, e, a) => {
  if (x_(e) && (e = [e]), n.options.preload && n.options.preload.indexOf(t) > -1) return fM(n, e, a);
  e.forEach((s) => {
    n.options.ns.indexOf(s) < 0 && n.options.ns.push(s);
  }), n.loadLanguages(t, XL(n, a));
}, F7 = (n, t, e = {}) => !t.languages || !t.languages.length ? (cM(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
  languages: t.languages
}), !0) : t.hasLoadedNamespace(n, {
  lng: e.lng,
  precheck: (a, s) => {
    if (e.bindI18n && e.bindI18n.indexOf("languageChanging") > -1 && a.services.backendConnector.backend && a.isLanguageChangingTo && !s(a.isLanguageChangingTo, n)) return !1;
  }
}), x_ = (n) => typeof n == "string", $7 = (n) => typeof n == "object" && n !== null, X7 = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, K7 = {
  "&amp;": "&",
  "&#38;": "&",
  "&lt;": "<",
  "&#60;": "<",
  "&gt;": ">",
  "&#62;": ">",
  "&apos;": "'",
  "&#39;": "'",
  "&quot;": '"',
  "&#34;": '"',
  "&nbsp;": " ",
  "&#160;": " ",
  "&copy;": "©",
  "&#169;": "©",
  "&reg;": "®",
  "&#174;": "®",
  "&hellip;": "…",
  "&#8230;": "…",
  "&#x2F;": "/",
  "&#47;": "/"
}, Z7 = (n) => K7[n], W7 = (n) => n.replace(X7, Z7);
let hM = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: !0,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: !0,
  unescape: W7
};
const Q7 = (n = {}) => {
  hM = {
    ...hM,
    ...n
  };
}, J7 = () => hM;
let KL;
const t9 = (n) => {
  KL = n;
}, e9 = () => KL, n9 = {
  type: "3rdParty",
  init(n) {
    Q7(n.options.react), t9(n);
  }
}, i9 = Se.createContext();
class a9 {
  constructor() {
    this.usedNamespaces = {};
  }
  addUsedNamespaces(t) {
    t.forEach((e) => {
      this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
    });
  }
  getUsedNamespaces() {
    return Object.keys(this.usedNamespaces);
  }
}
const r9 = (n, t) => {
  const e = Se.useRef();
  return Se.useEffect(() => {
    e.current = n;
  }, [n, t]), e.current;
}, ZL = (n, t, e, a) => n.getFixedT(t, e, a), s9 = (n, t, e, a) => Se.useCallback(ZL(n, t, e, a), [n, t, e, a]), gr = (n, t = {}) => {
  const {
    i18n: e
  } = t, {
    i18n: a,
    defaultNS: s
  } = Se.useContext(i9) || {}, l = e || a || e9();
  if (l && !l.reportNamespaces && (l.reportNamespaces = new a9()), !l) {
    cM(l, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
    const B = (Q, et) => x_(et) ? et : $7(et) && x_(et.defaultValue) ? et.defaultValue : Array.isArray(Q) ? Q[Q.length - 1] : Q, z = [B, {}, !1];
    return z.t = B, z.i18n = {}, z.ready = !1, z;
  }
  l.options.react?.wait && cM(l, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
  const f = {
    ...J7(),
    ...l.options.react,
    ...t
  }, {
    useSuspense: h,
    keyPrefix: p
  } = f;
  let y = s || l.options?.defaultNS;
  y = x_(y) ? [y] : y || ["translation"], l.reportNamespaces.addUsedNamespaces?.(y);
  const b = (l.isInitialized || l.initializedStoreOnce) && y.every((B) => F7(B, l, f)), x = s9(l, t.lng || null, f.nsMode === "fallback" ? y : y[0], p), w = () => x, A = () => ZL(l, t.lng || null, f.nsMode === "fallback" ? y : y[0], p), [C, L] = Se.useState(w);
  let N = y.join();
  t.lng && (N = `${t.lng}${N}`);
  const U = r9(N), k = Se.useRef(!0);
  Se.useEffect(() => {
    const {
      bindI18n: B,
      bindI18nStore: z
    } = f;
    k.current = !0, !b && !h && (t.lng ? Y3(l, t.lng, y, () => {
      k.current && L(A);
    }) : fM(l, y, () => {
      k.current && L(A);
    })), b && U && U !== N && k.current && L(A);
    const Q = () => {
      k.current && L(A);
    };
    return B && l?.on(B, Q), z && l?.store.on(z, Q), () => {
      k.current = !1, l && B && B?.split(" ").forEach((et) => l.off(et, Q)), z && l && z.split(" ").forEach((et) => l.store.off(et, Q));
    };
  }, [l, N]), Se.useEffect(() => {
    k.current && b && L(w);
  }, [l, p, b]);
  const H = [C, l, b];
  if (H.t = C, H.i18n = l, H.ready = b, b || !b && !h) return H;
  throw new Promise((B) => {
    t.lng ? Y3(l, t.lng, y, () => B()) : fM(l, y, () => B());
  });
};
os.use(qL).use($L).use(n9).init({
  ns: ["locale"],
  defaultNS: "locale",
  fallbackLng: "en",
  interpolation: {
    escapeValue: !1
  },
  backend: {
    loadPath: window.applicationUrl + "static/i18n/{{lng}}/{{ns}}.json"
  },
  react: {
    useSuspense: !1
  }
});
function WL(...n) {
  console.warn(...n);
}
const rs = {
  UNKNOWN: 0,
  INTERSECTING: 1,
  ABOVE: 2,
  RIGHT: 4,
  BELOW: 8,
  LEFT: 16
};
function AT(n) {
  const t = uu();
  for (let e = 0, a = n.length; e < a; ++e)
    jb(t, n[e]);
  return t;
}
function o9(n, t, e) {
  const a = Math.min.apply(null, n), s = Math.min.apply(null, t), l = Math.max.apply(null, n), f = Math.max.apply(null, t);
  return cm(a, s, l, f, e);
}
function Wb(n, t, e) {
  return e ? (e[0] = n[0] - t, e[1] = n[1] - t, e[2] = n[2] + t, e[3] = n[3] + t, e) : [
    n[0] - t,
    n[1] - t,
    n[2] + t,
    n[3] + t
  ];
}
function QL(n, t) {
  return t ? (t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t) : n.slice();
}
function ow(n, t, e) {
  let a, s;
  return t < n[0] ? a = n[0] - t : n[2] < t ? a = t - n[2] : a = 0, e < n[1] ? s = n[1] - e : n[3] < e ? s = e - n[3] : s = 0, a * a + s * s;
}
function D_(n, t) {
  return rC(n, t[0], t[1]);
}
function nd(n, t) {
  return n[0] <= t[0] && t[2] <= n[2] && n[1] <= t[1] && t[3] <= n[3];
}
function rC(n, t, e) {
  return n[0] <= t && t <= n[2] && n[1] <= e && e <= n[3];
}
function dM(n, t) {
  const e = n[0], a = n[1], s = n[2], l = n[3], f = t[0], h = t[1];
  let p = rs.UNKNOWN;
  return f < e ? p = p | rs.LEFT : f > s && (p = p | rs.RIGHT), h < a ? p = p | rs.BELOW : h > l && (p = p | rs.ABOVE), p === rs.UNKNOWN && (p = rs.INTERSECTING), p;
}
function uu() {
  return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
}
function cm(n, t, e, a, s) {
  return s ? (s[0] = n, s[1] = t, s[2] = e, s[3] = a, s) : [n, t, e, a];
}
function vS(n) {
  return cm(1 / 0, 1 / 0, -1 / 0, -1 / 0, n);
}
function JL(n, t) {
  const e = n[0], a = n[1];
  return cm(e, a, e, a, t);
}
function sC(n, t, e, a, s) {
  const l = vS(s);
  return t8(l, n, t, e, a);
}
function K1(n, t) {
  return n[0] == t[0] && n[2] == t[2] && n[1] == t[1] && n[3] == t[3];
}
function l9(n, t) {
  return t[0] < n[0] && (n[0] = t[0]), t[2] > n[2] && (n[2] = t[2]), t[1] < n[1] && (n[1] = t[1]), t[3] > n[3] && (n[3] = t[3]), n;
}
function jb(n, t) {
  t[0] < n[0] && (n[0] = t[0]), t[0] > n[2] && (n[2] = t[0]), t[1] < n[1] && (n[1] = t[1]), t[1] > n[3] && (n[3] = t[1]);
}
function t8(n, t, e, a, s) {
  for (; e < a; e += s)
    u9(n, t[e], t[e + 1]);
  return n;
}
function u9(n, t, e) {
  n[0] = Math.min(n[0], t), n[1] = Math.min(n[1], e), n[2] = Math.max(n[2], t), n[3] = Math.max(n[3], e);
}
function e8(n, t) {
  let e;
  return e = t(lw(n)), e || (e = t(uw(n)), e) || (e = t(cw(n)), e) || (e = t(Y_(n)), e) ? e : !1;
}
function gM(n) {
  let t = 0;
  return F_(n) || (t = Hn(n) * Ir(n)), t;
}
function lw(n) {
  return [n[0], n[1]];
}
function uw(n) {
  return [n[2], n[1]];
}
function fm(n) {
  return [(n[0] + n[2]) / 2, (n[1] + n[3]) / 2];
}
function c9(n, t) {
  let e;
  if (t === "bottom-left")
    e = lw(n);
  else if (t === "bottom-right")
    e = uw(n);
  else if (t === "top-left")
    e = Y_(n);
  else if (t === "top-right")
    e = cw(n);
  else
    throw new Error("Invalid corner");
  return e;
}
function Qb(n, t, e, a, s) {
  const [l, f, h, p, y, b, x, w] = n8(
    n,
    t,
    e,
    a
  );
  return cm(
    Math.min(l, h, y, x),
    Math.min(f, p, b, w),
    Math.max(l, h, y, x),
    Math.max(f, p, b, w),
    s
  );
}
function n8(n, t, e, a) {
  const s = t * a[0] / 2, l = t * a[1] / 2, f = Math.cos(e), h = Math.sin(e), p = s * f, y = s * h, b = l * f, x = l * h, w = n[0], A = n[1];
  return [
    w - p + x,
    A - y - b,
    w - p - x,
    A - y + b,
    w + p - x,
    A + y + b,
    w + p + x,
    A + y - b,
    w - p + x,
    A - y - b
  ];
}
function Ir(n) {
  return n[3] - n[1];
}
function im(n, t, e) {
  const a = e || uu();
  return Co(n, t) ? (n[0] > t[0] ? a[0] = n[0] : a[0] = t[0], n[1] > t[1] ? a[1] = n[1] : a[1] = t[1], n[2] < t[2] ? a[2] = n[2] : a[2] = t[2], n[3] < t[3] ? a[3] = n[3] : a[3] = t[3]) : vS(a), a;
}
function Y_(n) {
  return [n[0], n[3]];
}
function cw(n) {
  return [n[2], n[3]];
}
function Hn(n) {
  return n[2] - n[0];
}
function Co(n, t) {
  return n[0] <= t[2] && n[2] >= t[0] && n[1] <= t[3] && n[3] >= t[1];
}
function F_(n) {
  return n[2] < n[0] || n[3] < n[1];
}
function f9(n, t) {
  return t ? (t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t) : n;
}
function h9(n, t, e) {
  let a = !1;
  const s = dM(n, t), l = dM(n, e);
  if (s === rs.INTERSECTING || l === rs.INTERSECTING)
    a = !0;
  else {
    const f = n[0], h = n[1], p = n[2], y = n[3], b = t[0], x = t[1], w = e[0], A = e[1], C = (A - x) / (w - b);
    let L, N;
    l & rs.ABOVE && !(s & rs.ABOVE) && (L = w - (A - y) / C, a = L >= f && L <= p), !a && l & rs.RIGHT && !(s & rs.RIGHT) && (N = A - (w - p) * C, a = N >= h && N <= y), !a && l & rs.BELOW && !(s & rs.BELOW) && (L = w - (A - h) / C, a = L >= f && L <= p), !a && l & rs.LEFT && !(s & rs.LEFT) && (N = A - (w - f) * C, a = N >= h && N <= y);
  }
  return a;
}
function d9(n, t, e, a) {
  if (F_(n))
    return vS(e);
  let s = [];
  s = [
    n[0],
    n[1],
    n[2],
    n[1],
    n[2],
    n[3],
    n[0],
    n[3]
  ], t(s, s, 2);
  const l = [], f = [];
  for (let h = 0, p = s.length; h < p; h += 2)
    l.push(s[h]), f.push(s[h + 1]);
  return o9(l, f, e);
}
function i8(n, t) {
  const e = t.getExtent(), a = fm(n);
  if (t.canWrapX() && (a[0] < e[0] || a[0] >= e[2])) {
    const s = Hn(e), f = Math.floor(
      (a[0] - e[0]) / s
    ) * s;
    n[0] -= f, n[2] -= f;
  }
  return n;
}
function a8(n, t, e) {
  if (t.canWrapX()) {
    const a = t.getExtent();
    if (!isFinite(n[0]) || !isFinite(n[2]))
      return [[a[0], n[1], a[2], n[3]]];
    i8(n, t);
    const s = Hn(a);
    if (Hn(n) > s && !e)
      return [[a[0], n[1], a[2], n[3]]];
    if (n[0] < a[0])
      return [
        [n[0] + s, n[1], a[2], n[3]],
        [a[0], n[1], n[2], n[3]]
      ];
    if (n[2] > a[2])
      return [
        [n[0], n[1], a[2], n[3]],
        [a[0], n[1], n[2] - s, n[3]]
      ];
  }
  return [n];
}
function ra(n, t, e) {
  return Math.min(Math.max(n, t), e);
}
function g9(n, t, e, a, s, l) {
  const f = s - e, h = l - a;
  if (f !== 0 || h !== 0) {
    const p = ((n - e) * f + (t - a) * h) / (f * f + h * h);
    p > 1 ? (e = s, a = l) : p > 0 && (e += f * p, a += h * p);
  }
  return T_(n, t, e, a);
}
function T_(n, t, e, a) {
  const s = e - n, l = a - t;
  return s * s + l * l;
}
function m9(n) {
  const t = n.length;
  for (let a = 0; a < t; a++) {
    let s = a, l = Math.abs(n[a][a]);
    for (let h = a + 1; h < t; h++) {
      const p = Math.abs(n[h][a]);
      p > l && (l = p, s = h);
    }
    if (l === 0)
      return null;
    const f = n[s];
    n[s] = n[a], n[a] = f;
    for (let h = a + 1; h < t; h++) {
      const p = -n[h][a] / n[a][a];
      for (let y = a; y < t + 1; y++)
        a == y ? n[h][y] = 0 : n[h][y] += p * n[a][y];
    }
  }
  const e = new Array(t);
  for (let a = t - 1; a >= 0; a--) {
    e[a] = n[a][t] / n[a][a];
    for (let s = a - 1; s >= 0; s--)
      n[s][t] -= n[s][a] * e[a];
  }
  return e;
}
function F3(n) {
  return n * 180 / Math.PI;
}
function y0(n) {
  return n * Math.PI / 180;
}
function w_(n, t) {
  const e = n % t;
  return e * t < 0 ? e + t : e;
}
function Tc(n, t, e) {
  return n + e * (t - n);
}
function ES(n, t) {
  const e = Math.pow(10, t);
  return Math.round(n * e) / e;
}
function $3(n, t) {
  return Math.round(ES(n, t));
}
function z1(n, t) {
  return Math.floor(ES(n, t));
}
function h0(n, t) {
  return Math.ceil(ES(n, t));
}
function mM(n, t, e) {
  if (n >= t && n < e)
    return n;
  const a = e - t;
  return ((n - t) % a + a) % a + t;
}
function oC(n, t) {
  const e = ("" + n).split("."), a = ("" + t).split(".");
  for (let s = 0; s < Math.max(e.length, a.length); s++) {
    const l = parseInt(e[s] || "0", 10), f = parseInt(a[s] || "0", 10);
    if (l > f)
      return 1;
    if (f > l)
      return -1;
  }
  return 0;
}
function p9(n, t) {
  return n[0] += +t[0], n[1] += +t[1], n;
}
function MT(n, t) {
  let e = !0;
  for (let a = n.length - 1; a >= 0; --a)
    if (n[a] != t[a]) {
      e = !1;
      break;
    }
  return e;
}
function lC(n, t) {
  const e = Math.cos(t), a = Math.sin(t), s = n[0] * e - n[1] * a, l = n[1] * e + n[0] * a;
  return n[0] = s, n[1] = l, n;
}
function y9(n, t) {
  return n[0] *= t, n[1] *= t, n;
}
function r8(n, t) {
  if (t.canWrapX()) {
    const e = Hn(t.getExtent()), a = s8(n, t, e);
    a && (n[0] -= a * e);
  }
  return n;
}
function s8(n, t, e) {
  const a = t.getExtent();
  let s = 0;
  return t.canWrapX() && (n[0] < a[0] || n[0] > a[2]) && (e = e || Hn(a), s = Math.floor(
    (n[0] - a[0]) / e
  )), s;
}
const Z1 = {
  // use the radius of the Normal sphere
  radians: 6370997 / (2 * Math.PI),
  degrees: 2 * Math.PI * 6370997 / 360,
  ft: 0.3048,
  m: 1,
  "us-ft": 1200 / 3937
};
let fw = class {
  /**
   * @param {Options} options Projection options.
   */
  constructor(t) {
    this.code_ = t.code, this.units_ = /** @type {import("./Units.js").Units} */
    t.units, this.extent_ = t.extent !== void 0 ? t.extent : null, this.worldExtent_ = t.worldExtent !== void 0 ? t.worldExtent : null, this.axisOrientation_ = t.axisOrientation !== void 0 ? t.axisOrientation : "enu", this.global_ = t.global !== void 0 ? t.global : !1, this.canWrapX_ = !!(this.global_ && this.extent_), this.getPointResolutionFunc_ = t.getPointResolution, this.defaultTileGrid_ = null, this.metersPerUnit_ = t.metersPerUnit;
  }
  /**
   * @return {boolean} The projection is suitable for wrapping the x-axis
   */
  canWrapX() {
    return this.canWrapX_;
  }
  /**
   * Get the code for this projection, e.g. 'EPSG:4326'.
   * @return {string} Code.
   * @api
   */
  getCode() {
    return this.code_;
  }
  /**
   * Get the validity extent for this projection.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getExtent() {
    return this.extent_;
  }
  /**
   * Get the units of this projection.
   * @return {import("./Units.js").Units} Units.
   * @api
   */
  getUnits() {
    return this.units_;
  }
  /**
   * Get the amount of meters per unit of this projection.  If the projection is
   * not configured with `metersPerUnit` or a units identifier, the return is
   * `undefined`.
   * @return {number|undefined} Meters.
   * @api
   */
  getMetersPerUnit() {
    return this.metersPerUnit_ || Z1[this.units_];
  }
  /**
   * Get the world extent for this projection.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getWorldExtent() {
    return this.worldExtent_;
  }
  /**
   * Get the axis orientation of this projection.
   * Example values are:
   * enu - the default easting, northing, elevation.
   * neu - northing, easting, up - useful for "lat/long" geographic coordinates,
   *     or south orientated transverse mercator.
   * wnu - westing, northing, up - some planetary coordinate systems have
   *     "west positive" coordinate systems
   * @return {string} Axis orientation.
   * @api
   */
  getAxisOrientation() {
    return this.axisOrientation_;
  }
  /**
   * Is this projection a global projection which spans the whole world?
   * @return {boolean} Whether the projection is global.
   * @api
   */
  isGlobal() {
    return this.global_;
  }
  /**
   * Set if the projection is a global projection which spans the whole world
   * @param {boolean} global Whether the projection is global.
   * @api
   */
  setGlobal(t) {
    this.global_ = t, this.canWrapX_ = !!(t && this.extent_);
  }
  /**
   * @return {import("../tilegrid/TileGrid.js").default} The default tile grid.
   */
  getDefaultTileGrid() {
    return this.defaultTileGrid_;
  }
  /**
   * @param {import("../tilegrid/TileGrid.js").default} tileGrid The default tile grid.
   */
  setDefaultTileGrid(t) {
    this.defaultTileGrid_ = t;
  }
  /**
   * Set the validity extent for this projection.
   * @param {import("../extent.js").Extent} extent Extent.
   * @api
   */
  setExtent(t) {
    this.extent_ = t, this.canWrapX_ = !!(this.global_ && t);
  }
  /**
   * Set the world extent for this projection.
   * @param {import("../extent.js").Extent} worldExtent World extent
   *     [minlon, minlat, maxlon, maxlat].
   * @api
   */
  setWorldExtent(t) {
    this.worldExtent_ = t;
  }
  /**
   * Set the getPointResolution function (see {@link module:ol/proj.getPointResolution}
   * for this projection.
   * @param {function(number, import("../coordinate.js").Coordinate):number} func Function
   * @api
   */
  setGetPointResolution(t) {
    this.getPointResolutionFunc_ = t;
  }
  /**
   * Get the custom point resolution function for this projection (if set).
   * @return {GetPointResolution|undefined} The custom point
   * resolution function (if set).
   */
  getPointResolutionFunc() {
    return this.getPointResolutionFunc_;
  }
};
const bS = 6378137, G1 = Math.PI * bS, _9 = [-G1, -G1, G1, G1], v9 = [-180, -85, 180, 85], zx = bS * Math.log(Math.tan(Math.PI / 2));
class v1 extends fw {
  /**
   * @param {string} code Code.
   */
  constructor(t) {
    super({
      code: t,
      units: "m",
      extent: _9,
      global: !0,
      worldExtent: v9,
      getPointResolution: function(e, a) {
        return e / Math.cosh(a[1] / bS);
      }
    });
  }
}
const X3 = [
  new v1("EPSG:3857"),
  new v1("EPSG:102100"),
  new v1("EPSG:102113"),
  new v1("EPSG:900913"),
  new v1("http://www.opengis.net/def/crs/EPSG/0/3857"),
  new v1("http://www.opengis.net/gml/srs/epsg.xml#3857")
];
function E9(n, t, e, a) {
  const s = n.length;
  e = e > 1 ? e : 2, a = a ?? e, t === void 0 && (e > 2 ? t = n.slice() : t = new Array(s));
  for (let l = 0; l < s; l += a) {
    t[l] = G1 * n[l] / 180;
    let f = bS * Math.log(Math.tan(Math.PI * (+n[l + 1] + 90) / 360));
    f > zx ? f = zx : f < -zx && (f = -zx), t[l + 1] = f;
  }
  return t;
}
function b9(n, t, e, a) {
  const s = n.length;
  e = e > 1 ? e : 2, a = a ?? e, t === void 0 && (e > 2 ? t = n.slice() : t = new Array(s));
  for (let l = 0; l < s; l += a)
    t[l] = 180 * n[l] / G1, t[l + 1] = 360 * Math.atan(Math.exp(n[l + 1] / bS)) / Math.PI - 90;
  return t;
}
const S9 = 6378137, K3 = [-180, -90, 180, 90], x9 = Math.PI * S9 / 180;
class c_ extends fw {
  /**
   * @param {string} code Code.
   * @param {string} [axisOrientation] Axis orientation.
   */
  constructor(t, e) {
    super({
      code: t,
      units: "degrees",
      extent: K3,
      axisOrientation: e,
      global: !0,
      metersPerUnit: x9,
      worldExtent: K3
    });
  }
}
const Z3 = [
  new c_("CRS:84"),
  new c_("EPSG:4326", "neu"),
  new c_("urn:ogc:def:crs:OGC:1.3:CRS84"),
  new c_("urn:ogc:def:crs:OGC:2:84"),
  new c_("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),
  new c_("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
  new c_("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
];
let pM = {};
function fT(n) {
  return pM[n] || pM[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
}
function T9(n, t) {
  pM[n] = t;
}
function SS(n) {
  for (const t in n)
    delete n[t];
}
function W1(n) {
  let t;
  for (t in n)
    return !1;
  return !t;
}
let q1 = {};
function N_(n, t, e) {
  const a = n.getCode(), s = t.getCode();
  a in q1 || (q1[a] = {}), q1[a][s] = e;
}
function hT(n, t) {
  return n in q1 && t in q1[n] ? q1[n][t] : null;
}
const CT = 0.9996, Ac = 669438e-8, hw = Ac * Ac, dw = hw * Ac, p_ = Ac / (1 - Ac), W3 = Math.sqrt(1 - Ac), Q1 = (1 - W3) / (1 + W3), o8 = Q1 * Q1, uC = o8 * Q1, cC = uC * Q1, l8 = cC * Q1, u8 = 1 - Ac / 4 - 3 * hw / 64 - 5 * dw / 256, w9 = 3 * Ac / 8 + 3 * hw / 32 + 45 * dw / 1024, R9 = 15 * hw / 256 + 45 * dw / 1024, A9 = 35 * dw / 3072, M9 = 3 / 2 * Q1 - 27 / 32 * uC + 269 / 512 * l8, C9 = 21 / 16 * o8 - 55 / 32 * cC, O9 = 151 / 96 * uC - 417 / 128 * l8, D9 = 1097 / 512 * cC, OT = 6378137;
function N9(n, t, e) {
  const a = n - 5e5, f = (e.north ? t : t - 1e7) / CT / (OT * u8), h = f + M9 * Math.sin(2 * f) + C9 * Math.sin(4 * f) + O9 * Math.sin(6 * f) + D9 * Math.sin(8 * f), p = Math.sin(h), y = p * p, b = Math.cos(h), x = p / b, w = x * x, A = w * w, C = 1 - Ac * y, L = Math.sqrt(1 - Ac * y), N = OT / L, U = (1 - Ac) / C, k = p_ * b ** 2, H = k * k, B = a / (N * CT), z = B * B, Q = z * B, et = Q * B, ot = et * B, pt = ot * B, ht = h - x / U * (z / 2 - et / 24 * (5 + 3 * w + 10 * k - 4 * H - 9 * p_)) + pt / 720 * (61 + 90 * w + 298 * k + 45 * A - 252 * p_ - 3 * H);
  let Ct = (B - Q / 6 * (1 + 2 * w + k) + ot / 120 * (5 - 2 * k + 28 * w - 3 * H + 8 * p_ + 24 * A)) / b;
  return Ct = mM(
    Ct + y0(c8(e.number)),
    -Math.PI,
    Math.PI
  ), [F3(Ct), F3(ht)];
}
const Q3 = -80, J3 = 84, L9 = -180, I9 = 180;
function P9(n, t, e) {
  n = mM(n, L9, I9), t < Q3 ? t = Q3 : t > J3 && (t = J3);
  const a = y0(t), s = Math.sin(a), l = Math.cos(a), f = s / l, h = f * f, p = h * h, y = y0(n), b = c8(e.number), x = y0(b), w = OT / Math.sqrt(1 - Ac * s ** 2), A = p_ * l ** 2, C = l * mM(y - x, -Math.PI, Math.PI), L = C * C, N = L * C, U = N * C, k = U * C, H = k * C, B = OT * (u8 * a - w9 * Math.sin(2 * a) + R9 * Math.sin(4 * a) - A9 * Math.sin(6 * a)), z = CT * w * (C + N / 6 * (1 - h + A) + k / 120 * (5 - 18 * h + p + 72 * A - 58 * p_)) + 5e5;
  let Q = CT * (B + w * f * (L / 2 + U / 24 * (5 - h + 9 * A + 4 * A ** 2) + H / 720 * (61 - 58 * h + p + 600 * A - 330 * p_)));
  return e.north || (Q += 1e7), [z, Q];
}
function c8(n) {
  return (n - 1) * 6 - 180 + 3;
}
const z9 = [
  /^EPSG:(\d+)$/,
  /^urn:ogc:def:crs:EPSG::(\d+)$/,
  /^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/
];
function f8(n) {
  let t = 0;
  for (const s of z9) {
    const l = n.match(s);
    if (l) {
      t = parseInt(l[1]);
      break;
    }
  }
  if (!t)
    return null;
  let e = 0, a = !1;
  return t > 32700 && t < 32761 ? e = t - 32700 : t > 32600 && t < 32661 && (a = !0, e = t - 32600), e ? { number: e, north: a } : null;
}
function tD(n, t) {
  return function(e, a, s, l) {
    const f = e.length;
    s = s > 1 ? s : 2, l = l ?? s, a || (s > 2 ? a = e.slice() : a = new Array(f));
    for (let h = 0; h < f; h += l) {
      const p = e[h], y = e[h + 1], b = n(p, y, t);
      a[h] = b[0], a[h + 1] = b[1];
    }
    return a;
  };
}
function G9(n) {
  return f8(n) ? new fw({ code: n, units: "m" }) : null;
}
function U9(n) {
  const t = f8(n.getCode());
  return t ? {
    forward: tD(P9, t),
    inverse: tD(N9, t)
  } : null;
}
const j9 = 63710088e-1;
function eD(n, t, e) {
  e = e || j9;
  const a = y0(n[1]), s = y0(t[1]), l = (s - a) / 2, f = y0(t[0] - n[0]) / 2, h = Math.sin(l) * Math.sin(l) + Math.sin(f) * Math.sin(f) * Math.cos(a) * Math.cos(s);
  return 2 * e * Math.atan2(Math.sqrt(h), Math.sqrt(1 - h));
}
const k9 = [U9], H9 = [G9];
let yM = !0;
function B9(n) {
  yM = !1;
}
function fC(n, t) {
  if (t !== void 0) {
    for (let e = 0, a = n.length; e < a; ++e)
      t[e] = n[e];
    t = t;
  } else
    t = n.slice();
  return t;
}
function DT(n) {
  T9(n.getCode(), n), N_(n, n, fC);
}
function q9(n) {
  n.forEach(DT);
}
function $i(n) {
  if (typeof n != "string")
    return n;
  const t = fT(n);
  if (t)
    return t;
  for (const e of H9) {
    const a = e(n);
    if (a)
      return a;
  }
  return null;
}
function NT(n, t, e, a) {
  n = $i(n);
  let s;
  const l = n.getPointResolutionFunc();
  if (l) {
    if (s = l(t, e), a && a !== n.getUnits()) {
      const f = n.getMetersPerUnit();
      f && (s = s * f / Z1[a]);
    }
  } else {
    const f = n.getUnits();
    if (f == "degrees" && !a || a == "degrees")
      s = t;
    else {
      const h = dC(
        n,
        $i("EPSG:4326")
      );
      if (!h && f !== "degrees")
        s = t * n.getMetersPerUnit();
      else {
        let y = [
          e[0] - t / 2,
          e[1],
          e[0] + t / 2,
          e[1],
          e[0],
          e[1] - t / 2,
          e[0],
          e[1] + t / 2
        ];
        y = h(y, y, 2);
        const b = eD(y.slice(0, 2), y.slice(2, 4)), x = eD(y.slice(4, 6), y.slice(6, 8));
        s = (b + x) / 2;
      }
      const p = a ? Z1[a] : n.getMetersPerUnit();
      p !== void 0 && (s /= p);
    }
  }
  return s;
}
function _M(n) {
  q9(n), n.forEach(function(t) {
    n.forEach(function(e) {
      t !== e && N_(t, e, fC);
    });
  });
}
function V9(n, t, e, a) {
  n.forEach(function(s) {
    t.forEach(function(l) {
      N_(s, l, e), N_(l, s, a);
    });
  });
}
function hC(n, t) {
  return n ? typeof n == "string" ? $i(n) : (
    /** @type {Projection} */
    n
  ) : $i(t);
}
function vM(n) {
  return (
    /**
     * @param {Array<number>} input Input.
     * @param {Array<number>} [output] Output.
     * @param {number} [dimension] Dimensions that should be transformed.
     * @param {number} [stride] Stride.
     * @return {Array<number>} Output.
     */
    function(t, e, a, s) {
      const l = t.length;
      a = a !== void 0 ? a : 2, s = s ?? a, e = e !== void 0 ? e : new Array(l);
      for (let f = 0; f < l; f += s) {
        const h = n(t.slice(f, f + a)), p = h.length;
        for (let y = 0, b = s; y < b; ++y)
          e[f + y] = y >= p ? t[f + y] : h[y];
      }
      return e;
    }
  );
}
function Y9(n, t, e, a) {
  const s = $i(n), l = $i(t);
  N_(
    s,
    l,
    vM(e)
  ), N_(
    l,
    s,
    vM(a)
  );
}
function R_(n, t) {
  if (n === t)
    return !0;
  const e = n.getUnits() === t.getUnits();
  return (n.getCode() === t.getCode() || dC(n, t) === fC) && e;
}
function dC(n, t) {
  const e = n.getCode(), a = t.getCode();
  let s = hT(e, a);
  if (s)
    return s;
  let l = null, f = null;
  for (const p of k9)
    l || (l = p(n)), f || (f = p(t));
  if (!l && !f)
    return null;
  const h = "EPSG:4326";
  if (f)
    if (l)
      s = QR(
        l.inverse,
        f.forward
      );
    else {
      const p = hT(e, h);
      p && (s = QR(
        p,
        f.forward
      ));
    }
  else {
    const p = hT(h, a);
    p && (s = QR(
      l.inverse,
      p
    ));
  }
  return s && (DT(n), DT(t), N_(n, t, s)), s;
}
function QR(n, t) {
  return function(e, a, s, l) {
    return a = n(e, a, s, l), t(a, a, s, l);
  };
}
function Jb(n, t) {
  const e = $i(n), a = $i(t);
  return dC(e, a);
}
function gw(n, t, e) {
  const a = Jb(t, e);
  if (!a) {
    const s = $i(t).getCode(), l = $i(e).getCode();
    throw new Error(
      `No transform available between ${s} and ${l}`
    );
  }
  return a(n, void 0, n.length);
}
function F9(n, t, e, a) {
  const s = Jb(t, e);
  return d9(n, s, void 0);
}
function EM(n, t) {
  return n;
}
function tm(n, t) {
  return yM && !MT(n, [0, 0]) && n[0] >= -180 && n[0] <= 180 && n[1] >= -90 && n[1] <= 90 && (yM = !1, WL(
    "Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates."
  )), n;
}
function h8(n, t) {
  return n;
}
function id(n, t) {
  return n;
}
function nD(n, t, e) {
  return function(a) {
    let s, l;
    if (n.canWrapX()) {
      const f = n.getExtent(), h = Hn(f);
      a = a.slice(0), l = s8(a, n, h), l && (a[0] = a[0] - l * h), a[0] = ra(a[0], f[0], f[2]), a[1] = ra(a[1], f[1], f[3]), s = e(a);
    } else
      s = e(a);
    return l && t.canWrapX() && (s[0] += l * Hn(t.getExtent())), s;
  };
}
function $9() {
  _M(X3), _M(Z3), V9(
    Z3,
    X3,
    E9,
    b9
  );
}
$9();
function X9(n) {
  const t = Object.keys(n.defs), e = t.length;
  let a, s;
  for (a = 0; a < e; ++a) {
    const l = t[a];
    if (!fT(l)) {
      const f = n.defs(l);
      let h = (
        /** @type {import("./Units.js").Units} */
        f.units
      );
      !h && f.projName === "longlat" && (h = "degrees"), DT(
        new fw({
          code: l,
          axisOrientation: f.axis,
          metersPerUnit: f.to_meter,
          units: h
        })
      );
    }
  }
  for (a = 0; a < e; ++a) {
    const l = t[a], f = fT(l);
    for (s = 0; s < e; ++s) {
      const h = t[s], p = fT(h);
      if (!hT(l, h))
        if (n.defs[l] === n.defs[h])
          _M([f, p]);
        else {
          const y = n(l, h);
          Y9(
            f,
            p,
            nD(f, p, y.forward),
            nD(p, f, y.inverse)
          );
        }
    }
  }
}
function K9(n) {
  n("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), n("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), n("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
  for (var t = 1; t <= 60; ++t)
    n("EPSG:" + (32600 + t), "+proj=utm +zone=" + t + " +datum=WGS84 +units=m"), n("EPSG:" + (32700 + t), "+proj=utm +zone=" + t + " +south +datum=WGS84 +units=m");
  n.WGS84 = n["EPSG:4326"], n["EPSG:3785"] = n["EPSG:3857"], n.GOOGLE = n["EPSG:3857"], n["EPSG:900913"] = n["EPSG:3857"], n["EPSG:102113"] = n["EPSG:3857"];
}
var L_ = 1, I_ = 2, V1 = 3, Z9 = 4, bM = 5, iD = 6378137, W9 = 6356752314e-3, aD = 0.0066943799901413165, kb = 484813681109536e-20, Wt = Math.PI / 2, Q9 = 0.16666666666666666, J9 = 0.04722222222222222, tP = 0.022156084656084655, se = 1e-10, Rs = 0.017453292519943295, ad = 57.29577951308232, _i = Math.PI / 4, tS = Math.PI * 2, er = 3.14159265359, pl = {};
pl.greenwich = 0;
pl.lisbon = -9.131906111111;
pl.paris = 2.337229166667;
pl.bogota = -74.080916666667;
pl.madrid = -3.687938888889;
pl.rome = 12.452333333333;
pl.bern = 7.439583333333;
pl.jakarta = 106.807719444444;
pl.ferro = -17.666666666667;
pl.brussels = 4.367975;
pl.stockholm = 18.058277777778;
pl.athens = 23.7163375;
pl.oslo = 10.722916666667;
const eP = {
  mm: { to_meter: 1e-3 },
  cm: { to_meter: 0.01 },
  ft: { to_meter: 0.3048 },
  "us-ft": { to_meter: 1200 / 3937 },
  fath: { to_meter: 1.8288 },
  kmi: { to_meter: 1852 },
  "us-ch": { to_meter: 20.1168402336805 },
  "us-mi": { to_meter: 1609.34721869444 },
  km: { to_meter: 1e3 },
  "ind-ft": { to_meter: 0.30479841 },
  "ind-yd": { to_meter: 0.91439523 },
  mi: { to_meter: 1609.344 },
  yd: { to_meter: 0.9144 },
  ch: { to_meter: 20.1168 },
  link: { to_meter: 0.201168 },
  dm: { to_meter: 0.1 },
  in: { to_meter: 0.0254 },
  "ind-ch": { to_meter: 20.11669506 },
  "us-in": { to_meter: 0.025400050800101 },
  "us-yd": { to_meter: 0.914401828803658 }
};
var rD = /[\s_\-\/\(\)]/g;
function S0(n, t) {
  if (n[t])
    return n[t];
  for (var e = Object.keys(n), a = t.toLowerCase().replace(rD, ""), s = -1, l, f; ++s < e.length; )
    if (l = e[s], f = l.toLowerCase().replace(rD, ""), f === a)
      return n[l];
}
function SM(n) {
  var t = {}, e = n.split("+").map(function(h) {
    return h.trim();
  }).filter(function(h) {
    return h;
  }).reduce(function(h, p) {
    var y = p.split("=");
    return y.push(!0), h[y[0].toLowerCase()] = y[1], h;
  }, {}), a, s, l, f = {
    proj: "projName",
    datum: "datumCode",
    rf: function(h) {
      t.rf = parseFloat(h);
    },
    lat_0: function(h) {
      t.lat0 = h * Rs;
    },
    lat_1: function(h) {
      t.lat1 = h * Rs;
    },
    lat_2: function(h) {
      t.lat2 = h * Rs;
    },
    lat_ts: function(h) {
      t.lat_ts = h * Rs;
    },
    lon_0: function(h) {
      t.long0 = h * Rs;
    },
    lon_1: function(h) {
      t.long1 = h * Rs;
    },
    lon_2: function(h) {
      t.long2 = h * Rs;
    },
    alpha: function(h) {
      t.alpha = parseFloat(h) * Rs;
    },
    gamma: function(h) {
      t.rectified_grid_angle = parseFloat(h) * Rs;
    },
    lonc: function(h) {
      t.longc = h * Rs;
    },
    x_0: function(h) {
      t.x0 = parseFloat(h);
    },
    y_0: function(h) {
      t.y0 = parseFloat(h);
    },
    k_0: function(h) {
      t.k0 = parseFloat(h);
    },
    k: function(h) {
      t.k0 = parseFloat(h);
    },
    a: function(h) {
      t.a = parseFloat(h);
    },
    b: function(h) {
      t.b = parseFloat(h);
    },
    r: function(h) {
      t.a = t.b = parseFloat(h);
    },
    r_a: function() {
      t.R_A = !0;
    },
    zone: function(h) {
      t.zone = parseInt(h, 10);
    },
    south: function() {
      t.utmSouth = !0;
    },
    towgs84: function(h) {
      t.datum_params = h.split(",").map(function(p) {
        return parseFloat(p);
      });
    },
    to_meter: function(h) {
      t.to_meter = parseFloat(h);
    },
    units: function(h) {
      t.units = h;
      var p = S0(eP, h);
      p && (t.to_meter = p.to_meter);
    },
    from_greenwich: function(h) {
      t.from_greenwich = h * Rs;
    },
    pm: function(h) {
      var p = S0(pl, h);
      t.from_greenwich = (p || parseFloat(h)) * Rs;
    },
    nadgrids: function(h) {
      h === "@null" ? t.datumCode = "none" : t.nadgrids = h;
    },
    axis: function(h) {
      var p = "ewnsud";
      h.length === 3 && p.indexOf(h.substr(0, 1)) !== -1 && p.indexOf(h.substr(1, 1)) !== -1 && p.indexOf(h.substr(2, 1)) !== -1 && (t.axis = h);
    },
    approx: function() {
      t.approx = !0;
    }
  };
  for (a in e)
    s = e[a], a in f ? (l = f[a], typeof l == "function" ? l(s) : t[l] = s) : t[a] = s;
  return typeof t.datumCode == "string" && t.datumCode !== "WGS84" && (t.datumCode = t.datumCode.toLowerCase()), t;
}
class d8 {
  static getId(t) {
    const e = t.find((a) => Array.isArray(a) && a[0] === "ID");
    return e && e.length >= 3 ? {
      authority: e[1],
      code: parseInt(e[2], 10)
    } : null;
  }
  static convertUnit(t, e = "unit") {
    if (!t || t.length < 3)
      return { type: e, name: "unknown", conversion_factor: null };
    const a = t[1], s = parseFloat(t[2]) || null, l = t.find((h) => Array.isArray(h) && h[0] === "ID"), f = l ? {
      authority: l[1],
      code: parseInt(l[2], 10)
    } : null;
    return {
      type: e,
      name: a,
      conversion_factor: s,
      id: f
    };
  }
  static convertAxis(t) {
    const e = t[1] || "Unknown";
    let a;
    const s = e.match(/^\((.)\)$/);
    if (s) {
      const y = s[1].toUpperCase();
      if (y === "E") a = "east";
      else if (y === "N") a = "north";
      else if (y === "U") a = "up";
      else throw new Error(`Unknown axis abbreviation: ${y}`);
    } else
      a = t[2] ? t[2].toLowerCase() : "unknown";
    const l = t.find((y) => Array.isArray(y) && y[0] === "ORDER"), f = l ? parseInt(l[1], 10) : null, h = t.find(
      (y) => Array.isArray(y) && (y[0] === "LENGTHUNIT" || y[0] === "ANGLEUNIT" || y[0] === "SCALEUNIT")
    ), p = this.convertUnit(h);
    return {
      name: e,
      direction: a,
      // Use the valid PROJJSON direction value
      unit: p,
      order: f
    };
  }
  static extractAxes(t) {
    return t.filter((e) => Array.isArray(e) && e[0] === "AXIS").map((e) => this.convertAxis(e)).sort((e, a) => (e.order || 0) - (a.order || 0));
  }
  static convert(t, e = {}) {
    switch (t[0]) {
      case "PROJCRS":
        e.type = "ProjectedCRS", e.name = t[1], e.base_crs = t.find((w) => Array.isArray(w) && w[0] === "BASEGEOGCRS") ? this.convert(t.find((w) => Array.isArray(w) && w[0] === "BASEGEOGCRS")) : null, e.conversion = t.find((w) => Array.isArray(w) && w[0] === "CONVERSION") ? this.convert(t.find((w) => Array.isArray(w) && w[0] === "CONVERSION")) : null;
        const a = t.find((w) => Array.isArray(w) && w[0] === "CS");
        a && (e.coordinate_system = {
          type: a[1],
          axis: this.extractAxes(t)
        });
        const s = t.find((w) => Array.isArray(w) && w[0] === "LENGTHUNIT");
        if (s) {
          const w = this.convertUnit(s);
          e.coordinate_system.unit = w;
        }
        e.id = this.getId(t);
        break;
      case "BASEGEOGCRS":
      case "GEOGCRS":
        e.type = "GeographicCRS", e.name = t[1];
        const l = t.find(
          (w) => Array.isArray(w) && (w[0] === "DATUM" || w[0] === "ENSEMBLE")
        );
        if (l) {
          const w = this.convert(l);
          l[0] === "ENSEMBLE" ? e.datum_ensemble = w : e.datum = w;
          const A = t.find((C) => Array.isArray(C) && C[0] === "PRIMEM");
          A && A[1] !== "Greenwich" && (w.prime_meridian = {
            name: A[1],
            longitude: parseFloat(A[2])
          });
        }
        e.coordinate_system = {
          type: "ellipsoidal",
          axis: this.extractAxes(t)
        }, e.id = this.getId(t);
        break;
      case "DATUM":
        e.type = "GeodeticReferenceFrame", e.name = t[1], e.ellipsoid = t.find((w) => Array.isArray(w) && w[0] === "ELLIPSOID") ? this.convert(t.find((w) => Array.isArray(w) && w[0] === "ELLIPSOID")) : null;
        break;
      case "ENSEMBLE":
        e.type = "DatumEnsemble", e.name = t[1], e.members = t.filter((w) => Array.isArray(w) && w[0] === "MEMBER").map((w) => ({
          type: "DatumEnsembleMember",
          name: w[1],
          id: this.getId(w)
          // Extract ID as { authority, code }
        }));
        const f = t.find((w) => Array.isArray(w) && w[0] === "ENSEMBLEACCURACY");
        f && (e.accuracy = parseFloat(f[1]));
        const h = t.find((w) => Array.isArray(w) && w[0] === "ELLIPSOID");
        h && (e.ellipsoid = this.convert(h)), e.id = this.getId(t);
        break;
      case "ELLIPSOID":
        e.type = "Ellipsoid", e.name = t[1], e.semi_major_axis = parseFloat(t[2]), e.inverse_flattening = parseFloat(t[3]), t.find((w) => Array.isArray(w) && w[0] === "LENGTHUNIT") && this.convert(t.find((w) => Array.isArray(w) && w[0] === "LENGTHUNIT"), e);
        break;
      case "CONVERSION":
        e.type = "Conversion", e.name = t[1], e.method = t.find((w) => Array.isArray(w) && w[0] === "METHOD") ? this.convert(t.find((w) => Array.isArray(w) && w[0] === "METHOD")) : null, e.parameters = t.filter((w) => Array.isArray(w) && w[0] === "PARAMETER").map((w) => this.convert(w));
        break;
      case "METHOD":
        e.type = "Method", e.name = t[1], e.id = this.getId(t);
        break;
      case "PARAMETER":
        e.type = "Parameter", e.name = t[1], e.value = parseFloat(t[2]), e.unit = this.convertUnit(
          t.find(
            (w) => Array.isArray(w) && (w[0] === "LENGTHUNIT" || w[0] === "ANGLEUNIT" || w[0] === "SCALEUNIT")
          )
        ), e.id = this.getId(t);
        break;
      case "BOUNDCRS":
        e.type = "BoundCRS";
        const p = t.find((w) => Array.isArray(w) && w[0] === "SOURCECRS");
        if (p) {
          const w = p.find((A) => Array.isArray(A));
          e.source_crs = w ? this.convert(w) : null;
        }
        const y = t.find((w) => Array.isArray(w) && w[0] === "TARGETCRS");
        if (y) {
          const w = y.find((A) => Array.isArray(A));
          e.target_crs = w ? this.convert(w) : null;
        }
        const b = t.find((w) => Array.isArray(w) && w[0] === "ABRIDGEDTRANSFORMATION");
        b ? e.transformation = this.convert(b) : e.transformation = null;
        break;
      case "ABRIDGEDTRANSFORMATION":
        if (e.type = "Transformation", e.name = t[1], e.method = t.find((w) => Array.isArray(w) && w[0] === "METHOD") ? this.convert(t.find((w) => Array.isArray(w) && w[0] === "METHOD")) : null, e.parameters = t.filter((w) => Array.isArray(w) && (w[0] === "PARAMETER" || w[0] === "PARAMETERFILE")).map((w) => {
          if (w[0] === "PARAMETER")
            return this.convert(w);
          if (w[0] === "PARAMETERFILE")
            return {
              name: w[1],
              value: w[2],
              id: {
                authority: "EPSG",
                code: 8656
              }
            };
        }), e.parameters.length === 7) {
          const w = e.parameters[6];
          w.name === "Scale difference" && (w.value = Math.round((w.value - 1) * 1e12) / 1e6);
        }
        e.id = this.getId(t);
        break;
      case "AXIS":
        e.coordinate_system || (e.coordinate_system = { type: "unspecified", axis: [] }), e.coordinate_system.axis.push(this.convertAxis(t));
        break;
      case "LENGTHUNIT":
        const x = this.convertUnit(t, "LinearUnit");
        e.coordinate_system && e.coordinate_system.axis && e.coordinate_system.axis.forEach((w) => {
          w.unit || (w.unit = x);
        }), x.conversion_factor && x.conversion_factor !== 1 && e.semi_major_axis && (e.semi_major_axis = {
          value: e.semi_major_axis,
          unit: x
        });
        break;
      default:
        e.keyword = t[0];
        break;
    }
    return e;
  }
}
class nP extends d8 {
  static convert(t, e = {}) {
    return super.convert(t, e), e.coordinate_system && e.coordinate_system.subtype === "Cartesian" && delete e.coordinate_system, e.usage && delete e.usage, e;
  }
}
class iP extends d8 {
  static convert(t, e = {}) {
    super.convert(t, e);
    const a = t.find((l) => Array.isArray(l) && l[0] === "CS");
    a && (e.coordinate_system = {
      subtype: a[1],
      axis: this.extractAxes(t)
    });
    const s = t.find((l) => Array.isArray(l) && l[0] === "USAGE");
    if (s) {
      const l = s.find((p) => Array.isArray(p) && p[0] === "SCOPE"), f = s.find((p) => Array.isArray(p) && p[0] === "AREA"), h = s.find((p) => Array.isArray(p) && p[0] === "BBOX");
      e.usage = {}, l && (e.usage.scope = l[1]), f && (e.usage.area = f[1]), h && (e.usage.bbox = h.slice(1));
    }
    return e;
  }
}
function aP(n) {
  return n.find((t) => Array.isArray(t) && t[0] === "USAGE") ? "2019" : (n.find((t) => Array.isArray(t) && t[0] === "CS") || n[0] === "BOUNDCRS" || n[0] === "PROJCRS" || n[0] === "GEOGCRS", "2015");
}
function rP(n) {
  return (aP(n) === "2019" ? iP : nP).convert(n);
}
function sP(n) {
  const t = n.toUpperCase();
  return t.includes("PROJCRS") || t.includes("GEOGCRS") || t.includes("BOUNDCRS") || t.includes("VERTCRS") || t.includes("LENGTHUNIT") || t.includes("ANGLEUNIT") || t.includes("SCALEUNIT") ? "WKT2" : (t.includes("PROJCS") || t.includes("GEOGCS") || t.includes("LOCAL_CS") || t.includes("VERT_CS") || t.includes("UNIT"), "WKT1");
}
var eS = 1, g8 = 2, m8 = 3, LT = 4, p8 = 5, gC = -1, oP = /\s/, lP = /[A-Za-z]/, uP = /[A-Za-z84_]/, mw = /[,\]]/, y8 = /[\d\.E\-\+]/;
function gm(n) {
  if (typeof n != "string")
    throw new Error("not a string");
  this.text = n.trim(), this.level = 0, this.place = 0, this.root = null, this.stack = [], this.currentObject = null, this.state = eS;
}
gm.prototype.readCharicter = function() {
  var n = this.text[this.place++];
  if (this.state !== LT)
    for (; oP.test(n); ) {
      if (this.place >= this.text.length)
        return;
      n = this.text[this.place++];
    }
  switch (this.state) {
    case eS:
      return this.neutral(n);
    case g8:
      return this.keyword(n);
    case LT:
      return this.quoted(n);
    case p8:
      return this.afterquote(n);
    case m8:
      return this.number(n);
    case gC:
      return;
  }
};
gm.prototype.afterquote = function(n) {
  if (n === '"') {
    this.word += '"', this.state = LT;
    return;
  }
  if (mw.test(n)) {
    this.word = this.word.trim(), this.afterItem(n);
    return;
  }
  throw new Error(`havn't handled "` + n + '" in afterquote yet, index ' + this.place);
};
gm.prototype.afterItem = function(n) {
  if (n === ",") {
    this.word !== null && this.currentObject.push(this.word), this.word = null, this.state = eS;
    return;
  }
  if (n === "]") {
    this.level--, this.word !== null && (this.currentObject.push(this.word), this.word = null), this.state = eS, this.currentObject = this.stack.pop(), this.currentObject || (this.state = gC);
    return;
  }
};
gm.prototype.number = function(n) {
  if (y8.test(n)) {
    this.word += n;
    return;
  }
  if (mw.test(n)) {
    this.word = parseFloat(this.word), this.afterItem(n);
    return;
  }
  throw new Error(`havn't handled "` + n + '" in number yet, index ' + this.place);
};
gm.prototype.quoted = function(n) {
  if (n === '"') {
    this.state = p8;
    return;
  }
  this.word += n;
};
gm.prototype.keyword = function(n) {
  if (uP.test(n)) {
    this.word += n;
    return;
  }
  if (n === "[") {
    var t = [];
    t.push(this.word), this.level++, this.root === null ? this.root = t : this.currentObject.push(t), this.stack.push(this.currentObject), this.currentObject = t, this.state = eS;
    return;
  }
  if (mw.test(n)) {
    this.afterItem(n);
    return;
  }
  throw new Error(`havn't handled "` + n + '" in keyword yet, index ' + this.place);
};
gm.prototype.neutral = function(n) {
  if (lP.test(n)) {
    this.word = n, this.state = g8;
    return;
  }
  if (n === '"') {
    this.word = "", this.state = LT;
    return;
  }
  if (y8.test(n)) {
    this.word = n, this.state = m8;
    return;
  }
  if (mw.test(n)) {
    this.afterItem(n);
    return;
  }
  throw new Error(`havn't handled "` + n + '" in neutral yet, index ' + this.place);
};
gm.prototype.output = function() {
  for (; this.place < this.text.length; )
    this.readCharicter();
  if (this.state === gC)
    return this.root;
  throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
};
function cP(n) {
  var t = new gm(n);
  return t.output();
}
function JR(n, t, e) {
  Array.isArray(t) && (e.unshift(t), t = null);
  var a = t ? {} : n, s = e.reduce(function(l, f) {
    return U1(f, l), l;
  }, a);
  t && (n[t] = s);
}
function U1(n, t) {
  if (!Array.isArray(n)) {
    t[n] = !0;
    return;
  }
  var e = n.shift();
  if (e === "PARAMETER" && (e = n.shift()), n.length === 1) {
    if (Array.isArray(n[0])) {
      t[e] = {}, U1(n[0], t[e]);
      return;
    }
    t[e] = n[0];
    return;
  }
  if (!n.length) {
    t[e] = !0;
    return;
  }
  if (e === "TOWGS84") {
    t[e] = n;
    return;
  }
  if (e === "AXIS") {
    e in t || (t[e] = []), t[e].push(n);
    return;
  }
  Array.isArray(e) || (t[e] = {});
  var a;
  switch (e) {
    case "UNIT":
    case "PRIMEM":
    case "VERT_DATUM":
      t[e] = {
        name: n[0].toLowerCase(),
        convert: n[1]
      }, n.length === 3 && U1(n[2], t[e]);
      return;
    case "SPHEROID":
    case "ELLIPSOID":
      t[e] = {
        name: n[0],
        a: n[1],
        rf: n[2]
      }, n.length === 4 && U1(n[3], t[e]);
      return;
    case "EDATUM":
    case "ENGINEERINGDATUM":
    case "LOCAL_DATUM":
    case "DATUM":
    case "VERT_CS":
    case "VERTCRS":
    case "VERTICALCRS":
      n[0] = ["name", n[0]], JR(t, e, n);
      return;
    case "COMPD_CS":
    case "COMPOUNDCRS":
    case "FITTED_CS":
    // the followings are the crs defined in
    // https://github.com/proj4js/proj4js/blob/1da4ed0b865d0fcb51c136090569210cdcc9019e/lib/parseCode.js#L11
    case "PROJECTEDCRS":
    case "PROJCRS":
    case "GEOGCS":
    case "GEOCCS":
    case "PROJCS":
    case "LOCAL_CS":
    case "GEODCRS":
    case "GEODETICCRS":
    case "GEODETICDATUM":
    case "ENGCRS":
    case "ENGINEERINGCRS":
      n[0] = ["name", n[0]], JR(t, e, n), t[e].type = e;
      return;
    default:
      for (a = -1; ++a < n.length; )
        if (!Array.isArray(n[a]))
          return U1(n, t[e]);
      return JR(t, e, n);
  }
}
var fP = 0.017453292519943295;
function Cf(n) {
  return n * fP;
}
function _8(n) {
  const t = (n.projName || "").toLowerCase().replace(/_/g, " ");
  !n.long0 && n.longc && (t === "albers conic equal area" || t === "lambert azimuthal equal area") && (n.long0 = n.longc), !n.lat_ts && n.lat1 && (t === "stereographic south pole" || t === "polar stereographic (variant b)") ? (n.lat0 = Cf(n.lat1 > 0 ? 90 : -90), n.lat_ts = n.lat1, delete n.lat1) : !n.lat_ts && n.lat0 && (t === "polar stereographic" || t === "polar stereographic (variant a)") && (n.lat_ts = n.lat0, n.lat0 = Cf(n.lat0 > 0 ? 90 : -90), delete n.lat1);
}
function sD(n) {
  let t = { units: null, to_meter: void 0 };
  return typeof n == "string" ? (t.units = n.toLowerCase(), t.units === "metre" && (t.units = "meter"), t.units === "meter" && (t.to_meter = 1)) : n && n.name && (t.units = n.name.toLowerCase(), t.units === "metre" && (t.units = "meter"), t.to_meter = n.conversion_factor), t;
}
function oD(n) {
  return typeof n == "object" ? n.value * n.unit.conversion_factor : n;
}
function lD(n, t) {
  n.ellipsoid.radius ? (t.a = n.ellipsoid.radius, t.rf = 0) : (t.a = oD(n.ellipsoid.semi_major_axis), n.ellipsoid.inverse_flattening !== void 0 ? t.rf = n.ellipsoid.inverse_flattening : n.ellipsoid.semi_major_axis !== void 0 && n.ellipsoid.semi_minor_axis !== void 0 && (t.rf = t.a / (t.a - oD(n.ellipsoid.semi_minor_axis))));
}
function IT(n, t = {}) {
  return !n || typeof n != "object" ? n : n.type === "BoundCRS" ? (IT(n.source_crs, t), n.transformation && (n.transformation.method && n.transformation.method.name === "NTv2" ? t.nadgrids = n.transformation.parameters[0].value : t.datum_params = n.transformation.parameters.map((e) => e.value)), t) : (Object.keys(n).forEach((e) => {
    const a = n[e];
    if (a !== null)
      switch (e) {
        case "name":
          if (t.srsCode)
            break;
          t.name = a, t.srsCode = a;
          break;
        case "type":
          a === "GeographicCRS" ? t.projName = "longlat" : a === "ProjectedCRS" && n.conversion && n.conversion.method && (t.projName = n.conversion.method.name);
          break;
        case "datum":
        case "datum_ensemble":
          a.ellipsoid && (t.ellps = a.ellipsoid.name, lD(a, t)), a.prime_meridian && (t.from_greenwich = a.prime_meridian.longitude * Math.PI / 180);
          break;
        case "ellipsoid":
          t.ellps = a.name, lD(a, t);
          break;
        case "prime_meridian":
          t.long0 = (a.longitude || 0) * Math.PI / 180;
          break;
        case "coordinate_system":
          if (a.axis) {
            if (t.axis = a.axis.map((s) => {
              const l = s.direction;
              if (l === "east") return "e";
              if (l === "north") return "n";
              if (l === "west") return "w";
              if (l === "south") return "s";
              throw new Error(`Unknown axis direction: ${l}`);
            }).join("") + "u", a.unit) {
              const { units: s, to_meter: l } = sD(a.unit);
              t.units = s, t.to_meter = l;
            } else if (a.axis[0] && a.axis[0].unit) {
              const { units: s, to_meter: l } = sD(a.axis[0].unit);
              t.units = s, t.to_meter = l;
            }
          }
          break;
        case "id":
          a.authority && a.code && (t.title = a.authority + ":" + a.code);
          break;
        case "conversion":
          a.method && a.method.name && (t.projName = a.method.name), a.parameters && a.parameters.forEach((s) => {
            const l = s.name.toLowerCase().replace(/\s+/g, "_"), f = s.value;
            s.unit && s.unit.conversion_factor ? t[l] = f * s.unit.conversion_factor : s.unit === "degree" ? t[l] = f * Math.PI / 180 : t[l] = f;
          });
          break;
        case "unit":
          a.name && (t.units = a.name.toLowerCase(), t.units === "metre" && (t.units = "meter")), a.conversion_factor && (t.to_meter = a.conversion_factor);
          break;
        case "base_crs":
          IT(a, t), t.datumCode = a.id ? a.id.authority + "_" + a.id.code : a.name;
          break;
      }
  }), t.latitude_of_false_origin !== void 0 && (t.lat0 = t.latitude_of_false_origin), t.longitude_of_false_origin !== void 0 && (t.long0 = t.longitude_of_false_origin), t.latitude_of_standard_parallel !== void 0 && (t.lat0 = t.latitude_of_standard_parallel, t.lat1 = t.latitude_of_standard_parallel), t.latitude_of_1st_standard_parallel !== void 0 && (t.lat1 = t.latitude_of_1st_standard_parallel), t.latitude_of_2nd_standard_parallel !== void 0 && (t.lat2 = t.latitude_of_2nd_standard_parallel), t.latitude_of_projection_centre !== void 0 && (t.lat0 = t.latitude_of_projection_centre), t.longitude_of_projection_centre !== void 0 && (t.longc = t.longitude_of_projection_centre), t.easting_at_false_origin !== void 0 && (t.x0 = t.easting_at_false_origin), t.northing_at_false_origin !== void 0 && (t.y0 = t.northing_at_false_origin), t.latitude_of_natural_origin !== void 0 && (t.lat0 = t.latitude_of_natural_origin), t.longitude_of_natural_origin !== void 0 && (t.long0 = t.longitude_of_natural_origin), t.longitude_of_origin !== void 0 && (t.long0 = t.longitude_of_origin), t.false_easting !== void 0 && (t.x0 = t.false_easting), t.easting_at_projection_centre && (t.x0 = t.easting_at_projection_centre), t.false_northing !== void 0 && (t.y0 = t.false_northing), t.northing_at_projection_centre && (t.y0 = t.northing_at_projection_centre), t.standard_parallel_1 !== void 0 && (t.lat1 = t.standard_parallel_1), t.standard_parallel_2 !== void 0 && (t.lat2 = t.standard_parallel_2), t.scale_factor_at_natural_origin !== void 0 && (t.k0 = t.scale_factor_at_natural_origin), t.scale_factor_at_projection_centre !== void 0 && (t.k0 = t.scale_factor_at_projection_centre), t.scale_factor_on_pseudo_standard_parallel !== void 0 && (t.k0 = t.scale_factor_on_pseudo_standard_parallel), t.azimuth !== void 0 && (t.alpha = t.azimuth), t.azimuth_at_projection_centre !== void 0 && (t.alpha = t.azimuth_at_projection_centre), t.angle_from_rectified_to_skew_grid && (t.rectified_grid_angle = t.angle_from_rectified_to_skew_grid), _8(t), t);
}
var hP = [
  "PROJECTEDCRS",
  "PROJCRS",
  "GEOGCS",
  "GEOCCS",
  "PROJCS",
  "LOCAL_CS",
  "GEODCRS",
  "GEODETICCRS",
  "GEODETICDATUM",
  "ENGCRS",
  "ENGINEERINGCRS"
];
function dP(n, t) {
  var e = t[0], a = t[1];
  !(e in n) && a in n && (n[e] = n[a], t.length === 3 && (n[e] = t[2](n[e])));
}
function v8(n) {
  for (var t = Object.keys(n), e = 0, a = t.length; e < a; ++e) {
    var s = t[e];
    hP.indexOf(s) !== -1 && gP(n[s]), typeof n[s] == "object" && v8(n[s]);
  }
}
function gP(n) {
  if (n.AUTHORITY) {
    var t = Object.keys(n.AUTHORITY)[0];
    t && t in n.AUTHORITY && (n.title = t + ":" + n.AUTHORITY[t]);
  }
  if (n.type === "GEOGCS" ? n.projName = "longlat" : n.type === "LOCAL_CS" ? (n.projName = "identity", n.local = !0) : typeof n.PROJECTION == "object" ? n.projName = Object.keys(n.PROJECTION)[0] : n.projName = n.PROJECTION, n.AXIS) {
    for (var e = "", a = 0, s = n.AXIS.length; a < s; ++a) {
      var l = [n.AXIS[a][0].toLowerCase(), n.AXIS[a][1].toLowerCase()];
      l[0].indexOf("north") !== -1 || (l[0] === "y" || l[0] === "lat") && l[1] === "north" ? e += "n" : l[0].indexOf("south") !== -1 || (l[0] === "y" || l[0] === "lat") && l[1] === "south" ? e += "s" : l[0].indexOf("east") !== -1 || (l[0] === "x" || l[0] === "lon") && l[1] === "east" ? e += "e" : (l[0].indexOf("west") !== -1 || (l[0] === "x" || l[0] === "lon") && l[1] === "west") && (e += "w");
    }
    e.length === 2 && (e += "u"), e.length === 3 && (n.axis = e);
  }
  n.UNIT && (n.units = n.UNIT.name.toLowerCase(), n.units === "metre" && (n.units = "meter"), n.UNIT.convert && (n.type === "GEOGCS" ? n.DATUM && n.DATUM.SPHEROID && (n.to_meter = n.UNIT.convert * n.DATUM.SPHEROID.a) : n.to_meter = n.UNIT.convert));
  var f = n.GEOGCS;
  n.type === "GEOGCS" && (f = n), f && (f.DATUM ? n.datumCode = f.DATUM.name.toLowerCase() : n.datumCode = f.name.toLowerCase(), n.datumCode.slice(0, 2) === "d_" && (n.datumCode = n.datumCode.slice(2)), n.datumCode === "new_zealand_1949" && (n.datumCode = "nzgd49"), (n.datumCode === "wgs_1984" || n.datumCode === "world_geodetic_system_1984") && (n.PROJECTION === "Mercator_Auxiliary_Sphere" && (n.sphere = !0), n.datumCode = "wgs84"), n.datumCode === "belge_1972" && (n.datumCode = "rnb72"), f.DATUM && f.DATUM.SPHEROID && (n.ellps = f.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), n.ellps.toLowerCase().slice(0, 13) === "international" && (n.ellps = "intl"), n.a = f.DATUM.SPHEROID.a, n.rf = parseFloat(f.DATUM.SPHEROID.rf, 10)), f.DATUM && f.DATUM.TOWGS84 && (n.datum_params = f.DATUM.TOWGS84), ~n.datumCode.indexOf("osgb_1936") && (n.datumCode = "osgb36"), ~n.datumCode.indexOf("osni_1952") && (n.datumCode = "osni52"), (~n.datumCode.indexOf("tm65") || ~n.datumCode.indexOf("geodetic_datum_of_1965")) && (n.datumCode = "ire65"), n.datumCode === "ch1903+" && (n.datumCode = "ch1903"), ~n.datumCode.indexOf("israel") && (n.datumCode = "isr93")), n.b && !isFinite(n.b) && (n.b = n.a), n.rectified_grid_angle && (n.rectified_grid_angle = Cf(n.rectified_grid_angle));
  function h(b) {
    var x = n.to_meter || 1;
    return b * x;
  }
  var p = function(b) {
    return dP(n, b);
  }, y = [
    ["standard_parallel_1", "Standard_Parallel_1"],
    ["standard_parallel_1", "Latitude of 1st standard parallel"],
    ["standard_parallel_2", "Standard_Parallel_2"],
    ["standard_parallel_2", "Latitude of 2nd standard parallel"],
    ["false_easting", "False_Easting"],
    ["false_easting", "False easting"],
    ["false-easting", "Easting at false origin"],
    ["false_northing", "False_Northing"],
    ["false_northing", "False northing"],
    ["false_northing", "Northing at false origin"],
    ["central_meridian", "Central_Meridian"],
    ["central_meridian", "Longitude of natural origin"],
    ["central_meridian", "Longitude of false origin"],
    ["latitude_of_origin", "Latitude_Of_Origin"],
    ["latitude_of_origin", "Central_Parallel"],
    ["latitude_of_origin", "Latitude of natural origin"],
    ["latitude_of_origin", "Latitude of false origin"],
    ["scale_factor", "Scale_Factor"],
    ["k0", "scale_factor"],
    ["latitude_of_center", "Latitude_Of_Center"],
    ["latitude_of_center", "Latitude_of_center"],
    ["lat0", "latitude_of_center", Cf],
    ["longitude_of_center", "Longitude_Of_Center"],
    ["longitude_of_center", "Longitude_of_center"],
    ["longc", "longitude_of_center", Cf],
    ["x0", "false_easting", h],
    ["y0", "false_northing", h],
    ["long0", "central_meridian", Cf],
    ["lat0", "latitude_of_origin", Cf],
    ["lat0", "standard_parallel_1", Cf],
    ["lat1", "standard_parallel_1", Cf],
    ["lat2", "standard_parallel_2", Cf],
    ["azimuth", "Azimuth"],
    ["alpha", "azimuth", Cf],
    ["srsCode", "name"]
  ];
  y.forEach(p), _8(n);
}
function xM(n) {
  if (typeof n == "object")
    return IT(n);
  const t = sP(n);
  var e = cP(n);
  if (t === "WKT2") {
    const l = rP(e);
    return IT(l);
  }
  var a = e[0], s = {};
  return U1(e, s), v8(s), s[a];
}
function Ao(n) {
  var t = this;
  if (arguments.length === 2) {
    var e = arguments[1];
    typeof e == "string" ? e.charAt(0) === "+" ? Ao[
      /** @type {string} */
      n
    ] = SM(arguments[1]) : Ao[
      /** @type {string} */
      n
    ] = xM(arguments[1]) : Ao[
      /** @type {string} */
      n
    ] = e;
  } else if (arguments.length === 1) {
    if (Array.isArray(n))
      return n.map(function(a) {
        return Array.isArray(a) ? Ao.apply(t, a) : Ao(a);
      });
    if (typeof n == "string") {
      if (n in Ao)
        return Ao[n];
    } else "EPSG" in n ? Ao["EPSG:" + n.EPSG] = n : "ESRI" in n ? Ao["ESRI:" + n.ESRI] = n : "IAU2000" in n ? Ao["IAU2000:" + n.IAU2000] = n : console.log(n);
    return;
  }
}
K9(Ao);
function mP(n) {
  return typeof n == "string";
}
function pP(n) {
  return n in Ao;
}
function yP(n) {
  return n.indexOf("+") !== 0 && n.indexOf("[") !== -1 || typeof n == "object" && !("srsCode" in n);
}
var _P = ["3857", "900913", "3785", "102113"];
function vP(n) {
  var t = S0(n, "authority");
  if (t) {
    var e = S0(t, "epsg");
    return e && _P.indexOf(e) > -1;
  }
}
function EP(n) {
  var t = S0(n, "extension");
  if (t)
    return S0(t, "proj4");
}
function bP(n) {
  return n[0] === "+";
}
function SP(n) {
  if (mP(n)) {
    if (pP(n))
      return Ao[n];
    if (yP(n)) {
      var t = xM(n);
      if (vP(t))
        return Ao["EPSG:3857"];
      var e = EP(t);
      return e ? SM(e) : t;
    }
    if (bP(n))
      return SM(n);
  } else return "projName" in n ? n : xM(n);
}
function uD(n, t) {
  n = n || {};
  var e, a;
  if (!t)
    return n;
  for (a in t)
    e = t[a], e !== void 0 && (n[a] = e);
  return n;
}
function ud(n, t, e) {
  var a = n * t;
  return e / Math.sqrt(1 - a * a);
}
function xS(n) {
  return n < 0 ? -1 : 1;
}
function ue(n) {
  return Math.abs(n) <= er ? n : n - xS(n) * tS;
}
function Lf(n, t, e) {
  var a = n * e, s = 0.5 * n;
  return a = Math.pow((1 - a) / (1 + a), s), Math.tan(0.5 * (Wt - t)) / a;
}
function nS(n, t) {
  for (var e = 0.5 * n, a, s, l = Wt - 2 * Math.atan(t), f = 0; f <= 15; f++)
    if (a = n * Math.sin(l), s = Wt - 2 * Math.atan(t * Math.pow((1 - a) / (1 + a), e)) - l, l += s, Math.abs(s) <= 1e-10)
      return l;
  return -9999;
}
function xP() {
  var n = this.b / this.a;
  this.es = 1 - n * n, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = ud(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
}
function TP(n) {
  var t = n.x, e = n.y;
  if (e * ad > 90 && e * ad < -90 && t * ad > 180 && t * ad < -180)
    return null;
  var a, s;
  if (Math.abs(Math.abs(e) - Wt) <= se)
    return null;
  if (this.sphere)
    a = this.x0 + this.a * this.k0 * ue(t - this.long0), s = this.y0 + this.a * this.k0 * Math.log(Math.tan(_i + 0.5 * e));
  else {
    var l = Math.sin(e), f = Lf(this.e, e, l);
    a = this.x0 + this.a * this.k0 * ue(t - this.long0), s = this.y0 - this.a * this.k0 * Math.log(f);
  }
  return n.x = a, n.y = s, n;
}
function wP(n) {
  var t = n.x - this.x0, e = n.y - this.y0, a, s;
  if (this.sphere)
    s = Wt - 2 * Math.atan(Math.exp(-e / (this.a * this.k0)));
  else {
    var l = Math.exp(-e / (this.a * this.k0));
    if (s = nS(this.e, l), s === -9999)
      return null;
  }
  return a = ue(this.long0 + t / (this.a * this.k0)), n.x = a, n.y = s, n;
}
var RP = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"];
const AP = {
  init: xP,
  forward: TP,
  inverse: wP,
  names: RP
};
function MP() {
}
function cD(n) {
  return n;
}
var CP = ["longlat", "identity"];
const OP = {
  init: MP,
  forward: cD,
  inverse: cD,
  names: CP
};
var DP = [AP, OP], h_ = {}, j1 = [];
function E8(n, t) {
  var e = j1.length;
  return n.names ? (j1[e] = n, n.names.forEach(function(a) {
    h_[a.toLowerCase()] = e;
  }), this) : (console.log(t), !0);
}
function b8(n) {
  return n.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
}
function NP(n) {
  if (!n)
    return !1;
  var t = n.toLowerCase();
  if (typeof h_[t] < "u" && j1[h_[t]] || (t = b8(t), t in h_ && j1[h_[t]]))
    return j1[h_[t]];
}
function LP() {
  DP.forEach(E8);
}
const IP = {
  start: LP,
  add: E8,
  get: NP
};
var S8 = {
  MERIT: {
    a: 6378137,
    rf: 298.257,
    ellipseName: "MERIT 1983"
  },
  SGS85: {
    a: 6378136,
    rf: 298.257,
    ellipseName: "Soviet Geodetic System 85"
  },
  GRS80: {
    a: 6378137,
    rf: 298.257222101,
    ellipseName: "GRS 1980(IUGG, 1980)"
  },
  IAU76: {
    a: 6378140,
    rf: 298.257,
    ellipseName: "IAU 1976"
  },
  airy: {
    a: 6377563396e-3,
    b: 635625691e-2,
    ellipseName: "Airy 1830"
  },
  APL4: {
    a: 6378137,
    rf: 298.25,
    ellipseName: "Appl. Physics. 1965"
  },
  NWL9D: {
    a: 6378145,
    rf: 298.25,
    ellipseName: "Naval Weapons Lab., 1965"
  },
  mod_airy: {
    a: 6377340189e-3,
    b: 6356034446e-3,
    ellipseName: "Modified Airy"
  },
  andrae: {
    a: 637710443e-2,
    rf: 300,
    ellipseName: "Andrae 1876 (Den., Iclnd.)"
  },
  aust_SA: {
    a: 6378160,
    rf: 298.25,
    ellipseName: "Australian Natl & S. Amer. 1969"
  },
  GRS67: {
    a: 6378160,
    rf: 298.247167427,
    ellipseName: "GRS 67(IUGG 1967)"
  },
  bessel: {
    a: 6377397155e-3,
    rf: 299.1528128,
    ellipseName: "Bessel 1841"
  },
  bess_nam: {
    a: 6377483865e-3,
    rf: 299.1528128,
    ellipseName: "Bessel 1841 (Namibia)"
  },
  clrk66: {
    a: 63782064e-1,
    b: 63565838e-1,
    ellipseName: "Clarke 1866"
  },
  clrk80: {
    a: 6378249145e-3,
    rf: 293.4663,
    ellipseName: "Clarke 1880 mod."
  },
  clrk80ign: {
    a: 63782492e-1,
    b: 6356515,
    rf: 293.4660213,
    ellipseName: "Clarke 1880 (IGN)"
  },
  clrk58: {
    a: 6378293645208759e-9,
    rf: 294.2606763692654,
    ellipseName: "Clarke 1858"
  },
  CPM: {
    a: 63757387e-1,
    rf: 334.29,
    ellipseName: "Comm. des Poids et Mesures 1799"
  },
  delmbr: {
    a: 6376428,
    rf: 311.5,
    ellipseName: "Delambre 1810 (Belgium)"
  },
  engelis: {
    a: 637813605e-2,
    rf: 298.2566,
    ellipseName: "Engelis 1985"
  },
  evrst30: {
    a: 6377276345e-3,
    rf: 300.8017,
    ellipseName: "Everest 1830"
  },
  evrst48: {
    a: 6377304063e-3,
    rf: 300.8017,
    ellipseName: "Everest 1948"
  },
  evrst56: {
    a: 6377301243e-3,
    rf: 300.8017,
    ellipseName: "Everest 1956"
  },
  evrst69: {
    a: 6377295664e-3,
    rf: 300.8017,
    ellipseName: "Everest 1969"
  },
  evrstSS: {
    a: 6377298556e-3,
    rf: 300.8017,
    ellipseName: "Everest (Sabah & Sarawak)"
  },
  fschr60: {
    a: 6378166,
    rf: 298.3,
    ellipseName: "Fischer (Mercury Datum) 1960"
  },
  fschr60m: {
    a: 6378155,
    rf: 298.3,
    ellipseName: "Fischer 1960"
  },
  fschr68: {
    a: 6378150,
    rf: 298.3,
    ellipseName: "Fischer 1968"
  },
  helmert: {
    a: 6378200,
    rf: 298.3,
    ellipseName: "Helmert 1906"
  },
  hough: {
    a: 6378270,
    rf: 297,
    ellipseName: "Hough"
  },
  intl: {
    a: 6378388,
    rf: 297,
    ellipseName: "International 1909 (Hayford)"
  },
  kaula: {
    a: 6378163,
    rf: 298.24,
    ellipseName: "Kaula 1961"
  },
  lerch: {
    a: 6378139,
    rf: 298.257,
    ellipseName: "Lerch 1979"
  },
  mprts: {
    a: 6397300,
    rf: 191,
    ellipseName: "Maupertius 1738"
  },
  new_intl: {
    a: 63781575e-1,
    b: 63567722e-1,
    ellipseName: "New International 1967"
  },
  plessis: {
    a: 6376523,
    rf: 6355863,
    ellipseName: "Plessis 1817 (France)"
  },
  krass: {
    a: 6378245,
    rf: 298.3,
    ellipseName: "Krassovsky, 1942"
  },
  SEasia: {
    a: 6378155,
    b: 63567733205e-4,
    ellipseName: "Southeast Asia"
  },
  walbeck: {
    a: 6376896,
    b: 63558348467e-4,
    ellipseName: "Walbeck"
  },
  WGS60: {
    a: 6378165,
    rf: 298.3,
    ellipseName: "WGS 60"
  },
  WGS66: {
    a: 6378145,
    rf: 298.25,
    ellipseName: "WGS 66"
  },
  WGS7: {
    a: 6378135,
    rf: 298.26,
    ellipseName: "WGS 72"
  },
  WGS84: {
    a: 6378137,
    rf: 298.257223563,
    ellipseName: "WGS 84"
  },
  sphere: {
    a: 6370997,
    b: 6370997,
    ellipseName: "Normal Sphere (r=6370997)"
  }
};
const PP = S8.WGS84;
function zP(n, t, e, a) {
  var s = n * n, l = t * t, f = (s - l) / s, h = 0;
  a ? (n *= 1 - f * (Q9 + f * (J9 + f * tP)), s = n * n, f = 0) : h = Math.sqrt(f);
  var p = (s - l) / l;
  return {
    es: f,
    e: h,
    ep2: p
  };
}
function GP(n, t, e, a, s) {
  if (!n) {
    var l = S0(S8, a);
    l || (l = PP), n = l.a, t = l.b, e = l.rf;
  }
  return e && !t && (t = (1 - 1 / e) * n), (e === 0 || Math.abs(n - t) < se) && (s = !0, t = n), {
    a: n,
    b: t,
    rf: e,
    sphere: s
  };
}
var dT = {
  wgs84: {
    towgs84: "0,0,0",
    ellipse: "WGS84",
    datumName: "WGS84"
  },
  ch1903: {
    towgs84: "674.374,15.056,405.346",
    ellipse: "bessel",
    datumName: "swiss"
  },
  ggrs87: {
    towgs84: "-199.87,74.79,246.62",
    ellipse: "GRS80",
    datumName: "Greek_Geodetic_Reference_System_1987"
  },
  nad83: {
    towgs84: "0,0,0",
    ellipse: "GRS80",
    datumName: "North_American_Datum_1983"
  },
  nad27: {
    nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
    ellipse: "clrk66",
    datumName: "North_American_Datum_1927"
  },
  potsdam: {
    towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
    ellipse: "bessel",
    datumName: "Potsdam Rauenberg 1950 DHDN"
  },
  carthage: {
    towgs84: "-263.0,6.0,431.0",
    ellipse: "clark80",
    datumName: "Carthage 1934 Tunisia"
  },
  hermannskogel: {
    towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
    ellipse: "bessel",
    datumName: "Hermannskogel"
  },
  mgi: {
    towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
    ellipse: "bessel",
    datumName: "Militar-Geographische Institut"
  },
  osni52: {
    towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
    ellipse: "airy",
    datumName: "Irish National"
  },
  ire65: {
    towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
    ellipse: "mod_airy",
    datumName: "Ireland 1965"
  },
  rassadiran: {
    towgs84: "-133.63,-157.5,-158.62",
    ellipse: "intl",
    datumName: "Rassadiran"
  },
  nzgd49: {
    towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
    ellipse: "intl",
    datumName: "New Zealand Geodetic Datum 1949"
  },
  osgb36: {
    towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
    ellipse: "airy",
    datumName: "Ordnance Survey of Great Britain 1936"
  },
  s_jtsk: {
    towgs84: "589,76,480",
    ellipse: "bessel",
    datumName: "S-JTSK (Ferro)"
  },
  beduaram: {
    towgs84: "-106,-87,188",
    ellipse: "clrk80",
    datumName: "Beduaram"
  },
  gunung_segara: {
    towgs84: "-403,684,41",
    ellipse: "bessel",
    datumName: "Gunung Segara Jakarta"
  },
  rnb72: {
    towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
    ellipse: "intl",
    datumName: "Reseau National Belge 1972"
  },
  EPSG_5451: {
    towgs84: "6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"
  },
  IGNF_LURESG: {
    towgs84: "-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"
  },
  EPSG_4614: {
    towgs84: "-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"
  },
  EPSG_4615: {
    towgs84: "-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"
  },
  ESRI_37241: {
    towgs84: "-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"
  },
  ESRI_37249: {
    towgs84: "-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"
  },
  ESRI_37245: {
    towgs84: "-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"
  },
  EPSG_4178: {
    towgs84: "24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"
  },
  EPSG_4622: {
    towgs84: "-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"
  },
  EPSG_4625: {
    towgs84: "126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"
  },
  EPSG_5252: {
    towgs84: "0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"
  },
  EPSG_4314: {
    towgs84: "597.1,71.4,412.1,0.894,0.068,-1.563,7.58"
  },
  EPSG_4282: {
    towgs84: "-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"
  },
  EPSG_4231: {
    towgs84: "-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"
  },
  EPSG_4274: {
    towgs84: "-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"
  },
  EPSG_4134: {
    towgs84: "-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"
  },
  EPSG_4254: {
    towgs84: "18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"
  },
  EPSG_4159: {
    towgs84: "-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"
  },
  EPSG_4687: {
    towgs84: "0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"
  },
  EPSG_4227: {
    towgs84: "-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"
  },
  EPSG_4746: {
    towgs84: "599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"
  },
  EPSG_4745: {
    towgs84: "612.4,77,440.2,-0.054,0.057,-2.797,2.55"
  },
  EPSG_6311: {
    towgs84: "8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"
  },
  EPSG_4289: {
    towgs84: "565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"
  },
  EPSG_4230: {
    towgs84: "-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"
  },
  EPSG_4154: {
    towgs84: "-123.02,-158.95,-168.47"
  },
  EPSG_4156: {
    towgs84: "570.8,85.7,462.8,4.998,1.587,5.261,3.56"
  },
  EPSG_4299: {
    towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
  },
  EPSG_4179: {
    towgs84: "33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"
  },
  EPSG_4313: {
    towgs84: "-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"
  },
  EPSG_4194: {
    towgs84: "163.511,127.533,-159.789"
  },
  EPSG_4195: {
    towgs84: "105,326,-102.5"
  },
  EPSG_4196: {
    towgs84: "-45,417,-3.5"
  },
  EPSG_4611: {
    towgs84: "-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"
  },
  EPSG_4633: {
    towgs84: "137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"
  },
  EPSG_4641: {
    towgs84: "-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"
  },
  EPSG_4643: {
    towgs84: "-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"
  },
  EPSG_4300: {
    towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
  },
  EPSG_4188: {
    towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
  },
  EPSG_4660: {
    towgs84: "982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"
  },
  EPSG_4662: {
    towgs84: "97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"
  },
  EPSG_3906: {
    towgs84: "577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"
  },
  EPSG_4307: {
    towgs84: "-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"
  },
  EPSG_6892: {
    towgs84: "-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"
  },
  EPSG_4690: {
    towgs84: "221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"
  },
  EPSG_4691: {
    towgs84: "218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"
  },
  EPSG_4629: {
    towgs84: "72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"
  },
  EPSG_4630: {
    towgs84: "165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"
  },
  EPSG_4692: {
    towgs84: "217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"
  },
  EPSG_9333: {
    towgs84: "0,0,0,-8.393,0.749,-10.276,0"
  },
  EPSG_9059: {
    towgs84: "0,0,0"
  },
  EPSG_4312: {
    towgs84: "601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"
  },
  EPSG_4123: {
    towgs84: "-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"
  },
  EPSG_4309: {
    towgs84: "-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"
  },
  ESRI_104106: {
    towgs84: "-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"
  },
  EPSG_4281: {
    towgs84: "-219.247,-73.802,269.529"
  },
  EPSG_4322: {
    towgs84: "0,0,4.5"
  },
  EPSG_4324: {
    towgs84: "0,0,1.9"
  },
  EPSG_4284: {
    towgs84: "43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"
  },
  EPSG_4277: {
    towgs84: "446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"
  },
  EPSG_4207: {
    towgs84: "-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"
  },
  EPSG_4688: {
    towgs84: "347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"
  },
  EPSG_4689: {
    towgs84: "410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"
  },
  EPSG_4720: {
    towgs84: "0,0,4.5"
  },
  EPSG_4273: {
    towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21"
  },
  EPSG_4240: {
    towgs84: "204.64,834.74,293.8"
  },
  EPSG_4817: {
    towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21"
  },
  ESRI_104131: {
    towgs84: "426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"
  },
  EPSG_4265: {
    towgs84: "-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"
  },
  EPSG_4263: {
    towgs84: "-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"
  },
  EPSG_4298: {
    towgs84: "-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"
  },
  EPSG_4270: {
    towgs84: "-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"
  },
  EPSG_4229: {
    towgs84: "-121.8,98.1,-10.7"
  },
  EPSG_4220: {
    towgs84: "-55.5,-348,-229.2"
  },
  EPSG_4214: {
    towgs84: "12.646,-155.176,-80.863"
  },
  EPSG_4232: {
    towgs84: "-345,3,223"
  },
  EPSG_4238: {
    towgs84: "-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"
  },
  EPSG_4168: {
    towgs84: "-170,33,326"
  },
  EPSG_4131: {
    towgs84: "199,931,318.9"
  },
  EPSG_4152: {
    towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
  },
  EPSG_5228: {
    towgs84: "572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"
  },
  EPSG_8351: {
    towgs84: "485.021,169.465,483.839,7.786342,4.397554,4.102655,0"
  },
  EPSG_4683: {
    towgs84: "-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"
  },
  EPSG_4133: {
    towgs84: "0,0,0"
  },
  EPSG_7373: {
    towgs84: "0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"
  },
  EPSG_9075: {
    towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
  },
  EPSG_9072: {
    towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
  },
  EPSG_9294: {
    towgs84: "1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"
  },
  EPSG_4212: {
    towgs84: "-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"
  },
  EPSG_4191: {
    towgs84: "-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"
  },
  EPSG_4237: {
    towgs84: "52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"
  },
  EPSG_4740: {
    towgs84: "-1.08,-0.27,-0.9"
  },
  EPSG_4124: {
    towgs84: "419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"
  },
  EPSG_5681: {
    towgs84: "584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"
  },
  EPSG_4141: {
    towgs84: "23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"
  },
  EPSG_4204: {
    towgs84: "-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"
  },
  EPSG_4319: {
    towgs84: "226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"
  },
  EPSG_4200: {
    towgs84: "24.82,-131.21,-82.66"
  },
  EPSG_4130: {
    towgs84: "0,0,0"
  },
  EPSG_4127: {
    towgs84: "-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"
  },
  EPSG_4149: {
    towgs84: "674.374,15.056,405.346"
  },
  EPSG_4617: {
    towgs84: "-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"
  },
  EPSG_4663: {
    towgs84: "-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"
  },
  EPSG_4664: {
    towgs84: "-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"
  },
  EPSG_4665: {
    towgs84: "-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"
  },
  EPSG_4666: {
    towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"
  },
  EPSG_4756: {
    towgs84: "-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"
  },
  EPSG_4723: {
    towgs84: "-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"
  },
  EPSG_4726: {
    towgs84: "8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"
  },
  EPSG_4267: {
    towgs84: "-8.0,160.0,176.0"
  },
  EPSG_5365: {
    towgs84: "-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"
  },
  EPSG_4218: {
    towgs84: "304.5,306.5,-318.1"
  },
  EPSG_4242: {
    towgs84: "-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"
  },
  EPSG_4216: {
    towgs84: "-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"
  },
  ESRI_104105: {
    towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"
  },
  ESRI_104129: {
    towgs84: "0,0,0"
  },
  EPSG_4673: {
    towgs84: "174.05,-25.49,112.57"
  },
  EPSG_4202: {
    towgs84: "-124,-60,154"
  },
  EPSG_4203: {
    towgs84: "-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"
  },
  EPSG_3819: {
    towgs84: "595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"
  },
  EPSG_8694: {
    towgs84: "-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"
  },
  EPSG_4145: {
    towgs84: "275.57,676.78,229.6"
  },
  EPSG_4283: {
    towgs84: "61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"
  },
  EPSG_4317: {
    towgs84: "2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"
  },
  EPSG_4272: {
    towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"
  },
  EPSG_4248: {
    towgs84: "-307.7,265.3,-363.5"
  },
  EPSG_5561: {
    towgs84: "24,-121,-76"
  },
  EPSG_5233: {
    towgs84: "-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"
  },
  ESRI_104130: {
    towgs84: "-86,-98,-119"
  },
  ESRI_104102: {
    towgs84: "682,-203,480"
  },
  ESRI_37207: {
    towgs84: "7,-10,-26"
  },
  EPSG_4675: {
    towgs84: "59.935,118.4,-10.871"
  },
  ESRI_104109: {
    towgs84: "-89.121,-348.182,260.871"
  },
  ESRI_104112: {
    towgs84: "-185.583,-230.096,281.361"
  },
  ESRI_104113: {
    towgs84: "25.1,-275.6,222.6"
  },
  IGNF_WGS72G: {
    towgs84: "0,12,6"
  },
  IGNF_NTFG: {
    towgs84: "-168,-60,320"
  },
  IGNF_EFATE57G: {
    towgs84: "-127,-769,472"
  },
  IGNF_PGP50G: {
    towgs84: "324.8,153.6,172.1"
  },
  IGNF_REUN47G: {
    towgs84: "94,-948,-1262"
  },
  IGNF_CSG67G: {
    towgs84: "-186,230,110"
  },
  IGNF_GUAD48G: {
    towgs84: "-467,-16,-300"
  },
  IGNF_TAHI51G: {
    towgs84: "162,117,154"
  },
  IGNF_TAHAAG: {
    towgs84: "65,342,77"
  },
  IGNF_NUKU72G: {
    towgs84: "84,274,65"
  },
  IGNF_PETRELS72G: {
    towgs84: "365,194,166"
  },
  IGNF_WALL78G: {
    towgs84: "253,-133,-127"
  },
  IGNF_MAYO50G: {
    towgs84: "-382,-59,-262"
  },
  IGNF_TANNAG: {
    towgs84: "-139,-967,436"
  },
  IGNF_IGN72G: {
    towgs84: "-13,-348,292"
  },
  IGNF_ATIGG: {
    towgs84: "1118,23,66"
  },
  IGNF_FANGA84G: {
    towgs84: "150.57,158.33,118.32"
  },
  IGNF_RUSAT84G: {
    towgs84: "202.13,174.6,-15.74"
  },
  IGNF_KAUE70G: {
    towgs84: "126.74,300.1,-75.49"
  },
  IGNF_MOP90G: {
    towgs84: "-10.8,-1.8,12.77"
  },
  IGNF_MHPF67G: {
    towgs84: "338.08,212.58,-296.17"
  },
  IGNF_TAHI79G: {
    towgs84: "160.61,116.05,153.69"
  },
  IGNF_ANAA92G: {
    towgs84: "1.5,3.84,4.81"
  },
  IGNF_MARQUI72G: {
    towgs84: "330.91,-13.92,58.56"
  },
  IGNF_APAT86G: {
    towgs84: "143.6,197.82,74.05"
  },
  IGNF_TUBU69G: {
    towgs84: "237.17,171.61,-77.84"
  },
  IGNF_STPM50G: {
    towgs84: "11.363,424.148,373.13"
  },
  EPSG_4150: {
    towgs84: "674.374,15.056,405.346"
  },
  EPSG_4754: {
    towgs84: "-208.4058,-109.8777,-2.5764"
  },
  ESRI_104101: {
    towgs84: "374,150,588"
  },
  EPSG_4693: {
    towgs84: "0,-0.15,0.68"
  },
  EPSG_6207: {
    towgs84: "293.17,726.18,245.36"
  },
  EPSG_4153: {
    towgs84: "-133.63,-157.5,-158.62"
  },
  EPSG_4132: {
    towgs84: "-241.54,-163.64,396.06"
  },
  EPSG_4221: {
    towgs84: "-154.5,150.7,100.4"
  },
  EPSG_4266: {
    towgs84: "-80.7,-132.5,41.1"
  },
  EPSG_4193: {
    towgs84: "-70.9,-151.8,-41.4"
  },
  EPSG_5340: {
    towgs84: "-0.41,0.46,-0.35"
  },
  EPSG_4246: {
    towgs84: "-294.7,-200.1,525.5"
  },
  EPSG_4318: {
    towgs84: "-3.2,-5.7,2.8"
  },
  EPSG_4121: {
    towgs84: "-199.87,74.79,246.62"
  },
  EPSG_4223: {
    towgs84: "-260.1,5.5,432.2"
  },
  EPSG_4158: {
    towgs84: "-0.465,372.095,171.736"
  },
  EPSG_4285: {
    towgs84: "-128.16,-282.42,21.93"
  },
  EPSG_4613: {
    towgs84: "-404.78,685.68,45.47"
  },
  EPSG_4607: {
    towgs84: "195.671,332.517,274.607"
  },
  EPSG_4475: {
    towgs84: "-381.788,-57.501,-256.673"
  },
  EPSG_4208: {
    towgs84: "-157.84,308.54,-146.6"
  },
  EPSG_4743: {
    towgs84: "70.995,-335.916,262.898"
  },
  EPSG_4710: {
    towgs84: "-323.65,551.39,-491.22"
  },
  EPSG_7881: {
    towgs84: "-0.077,0.079,0.086"
  },
  EPSG_4682: {
    towgs84: "283.729,735.942,261.143"
  },
  EPSG_4739: {
    towgs84: "-156,-271,-189"
  },
  EPSG_4679: {
    towgs84: "-80.01,253.26,291.19"
  },
  EPSG_4750: {
    towgs84: "-56.263,16.136,-22.856"
  },
  EPSG_4644: {
    towgs84: "-10.18,-350.43,291.37"
  },
  EPSG_4695: {
    towgs84: "-103.746,-9.614,-255.95"
  },
  EPSG_4292: {
    towgs84: "-355,21,72"
  },
  EPSG_4302: {
    towgs84: "-61.702,284.488,472.052"
  },
  EPSG_4143: {
    towgs84: "-124.76,53,466.79"
  },
  EPSG_4606: {
    towgs84: "-153,153,307"
  },
  EPSG_4699: {
    towgs84: "-770.1,158.4,-498.2"
  },
  EPSG_4247: {
    towgs84: "-273.5,110.6,-357.9"
  },
  EPSG_4160: {
    towgs84: "8.88,184.86,106.69"
  },
  EPSG_4161: {
    towgs84: "-233.43,6.65,173.64"
  },
  EPSG_9251: {
    towgs84: "-9.5,122.9,138.2"
  },
  EPSG_9253: {
    towgs84: "-78.1,101.6,133.3"
  },
  EPSG_4297: {
    towgs84: "-198.383,-240.517,-107.909"
  },
  EPSG_4269: {
    towgs84: "0,0,0"
  },
  EPSG_4301: {
    towgs84: "-147,506,687"
  },
  EPSG_4618: {
    towgs84: "-59,-11,-52"
  },
  EPSG_4612: {
    towgs84: "0,0,0"
  },
  EPSG_4678: {
    towgs84: "44.585,-131.212,-39.544"
  },
  EPSG_4250: {
    towgs84: "-130,29,364"
  },
  EPSG_4144: {
    towgs84: "214,804,268"
  },
  EPSG_4147: {
    towgs84: "-17.51,-108.32,-62.39"
  },
  EPSG_4259: {
    towgs84: "-254.1,-5.36,-100.29"
  },
  EPSG_4164: {
    towgs84: "-76,-138,67"
  },
  EPSG_4211: {
    towgs84: "-378.873,676.002,-46.255"
  },
  EPSG_4182: {
    towgs84: "-422.651,-172.995,84.02"
  },
  EPSG_4224: {
    towgs84: "-143.87,243.37,-33.52"
  },
  EPSG_4225: {
    towgs84: "-205.57,168.77,-4.12"
  },
  EPSG_5527: {
    towgs84: "-67.35,3.88,-38.22"
  },
  EPSG_4752: {
    towgs84: "98,390,-22"
  },
  EPSG_4310: {
    towgs84: "-30,190,89"
  },
  EPSG_9248: {
    towgs84: "-192.26,65.72,132.08"
  },
  EPSG_4680: {
    towgs84: "124.5,-63.5,-281"
  },
  EPSG_4701: {
    towgs84: "-79.9,-158,-168.9"
  },
  EPSG_4706: {
    towgs84: "-146.21,112.63,4.05"
  },
  EPSG_4805: {
    towgs84: "682,-203,480"
  },
  EPSG_4201: {
    towgs84: "-165,-11,206"
  },
  EPSG_4210: {
    towgs84: "-157,-2,-299"
  },
  EPSG_4183: {
    towgs84: "-104,167,-38"
  },
  EPSG_4139: {
    towgs84: "11,72,-101"
  },
  EPSG_4668: {
    towgs84: "-86,-98,-119"
  },
  EPSG_4717: {
    towgs84: "-2,151,181"
  },
  EPSG_4732: {
    towgs84: "102,52,-38"
  },
  EPSG_4280: {
    towgs84: "-377,681,-50"
  },
  EPSG_4209: {
    towgs84: "-138,-105,-289"
  },
  EPSG_4261: {
    towgs84: "31,146,47"
  },
  EPSG_4658: {
    towgs84: "-73,46,-86"
  },
  EPSG_4721: {
    towgs84: "265.025,384.929,-194.046"
  },
  EPSG_4222: {
    towgs84: "-136,-108,-292"
  },
  EPSG_4601: {
    towgs84: "-255,-15,71"
  },
  EPSG_4602: {
    towgs84: "725,685,536"
  },
  EPSG_4603: {
    towgs84: "72,213.7,93"
  },
  EPSG_4605: {
    towgs84: "9,183,236"
  },
  EPSG_4621: {
    towgs84: "137,248,-430"
  },
  EPSG_4657: {
    towgs84: "-28,199,5"
  },
  EPSG_4316: {
    towgs84: "103.25,-100.4,-307.19"
  },
  EPSG_4642: {
    towgs84: "-13,-348,292"
  },
  EPSG_4698: {
    towgs84: "145,-187,103"
  },
  EPSG_4192: {
    towgs84: "-206.1,-174.7,-87.7"
  },
  EPSG_4311: {
    towgs84: "-265,120,-358"
  },
  EPSG_4135: {
    towgs84: "58,-283,-182"
  },
  ESRI_104138: {
    towgs84: "198,-226,-347"
  },
  EPSG_4245: {
    towgs84: "-11,851,5"
  },
  EPSG_4142: {
    towgs84: "-125,53,467"
  },
  EPSG_4213: {
    towgs84: "-106,-87,188"
  },
  EPSG_4253: {
    towgs84: "-133,-77,-51"
  },
  EPSG_4129: {
    towgs84: "-132,-110,-335"
  },
  EPSG_4713: {
    towgs84: "-77,-128,142"
  },
  EPSG_4239: {
    towgs84: "217,823,299"
  },
  EPSG_4146: {
    towgs84: "295,736,257"
  },
  EPSG_4155: {
    towgs84: "-83,37,124"
  },
  EPSG_4165: {
    towgs84: "-173,253,27"
  },
  EPSG_4672: {
    towgs84: "175,-38,113"
  },
  EPSG_4236: {
    towgs84: "-637,-549,-203"
  },
  EPSG_4251: {
    towgs84: "-90,40,88"
  },
  EPSG_4271: {
    towgs84: "-2,374,172"
  },
  EPSG_4175: {
    towgs84: "-88,4,101"
  },
  EPSG_4716: {
    towgs84: "298,-304,-375"
  },
  EPSG_4315: {
    towgs84: "-23,259,-9"
  },
  EPSG_4744: {
    towgs84: "-242.2,-144.9,370.3"
  },
  EPSG_4244: {
    towgs84: "-97,787,86"
  },
  EPSG_4293: {
    towgs84: "616,97,-251"
  },
  EPSG_4714: {
    towgs84: "-127,-769,472"
  },
  EPSG_4736: {
    towgs84: "260,12,-147"
  },
  EPSG_6883: {
    towgs84: "-235,-110,393"
  },
  EPSG_6894: {
    towgs84: "-63,176,185"
  },
  EPSG_4205: {
    towgs84: "-43,-163,45"
  },
  EPSG_4256: {
    towgs84: "41,-220,-134"
  },
  EPSG_4262: {
    towgs84: "639,405,60"
  },
  EPSG_4604: {
    towgs84: "174,359,365"
  },
  EPSG_4169: {
    towgs84: "-115,118,426"
  },
  EPSG_4620: {
    towgs84: "-106,-129,165"
  },
  EPSG_4184: {
    towgs84: "-203,141,53"
  },
  EPSG_4616: {
    towgs84: "-289,-124,60"
  },
  EPSG_9403: {
    towgs84: "-307,-92,127"
  },
  EPSG_4684: {
    towgs84: "-133,-321,50"
  },
  EPSG_4708: {
    towgs84: "-491,-22,435"
  },
  EPSG_4707: {
    towgs84: "114,-116,-333"
  },
  EPSG_4709: {
    towgs84: "145,75,-272"
  },
  EPSG_4712: {
    towgs84: "-205,107,53"
  },
  EPSG_4711: {
    towgs84: "124,-234,-25"
  },
  EPSG_4718: {
    towgs84: "230,-199,-752"
  },
  EPSG_4719: {
    towgs84: "211,147,111"
  },
  EPSG_4724: {
    towgs84: "208,-435,-229"
  },
  EPSG_4725: {
    towgs84: "189,-79,-202"
  },
  EPSG_4735: {
    towgs84: "647,1777,-1124"
  },
  EPSG_4722: {
    towgs84: "-794,119,-298"
  },
  EPSG_4728: {
    towgs84: "-307,-92,127"
  },
  EPSG_4734: {
    towgs84: "-632,438,-609"
  },
  EPSG_4727: {
    towgs84: "912,-58,1227"
  },
  EPSG_4729: {
    towgs84: "185,165,42"
  },
  EPSG_4730: {
    towgs84: "170,42,84"
  },
  EPSG_4733: {
    towgs84: "276,-57,149"
  },
  ESRI_37218: {
    towgs84: "230,-199,-752"
  },
  ESRI_37240: {
    towgs84: "-7,215,225"
  },
  ESRI_37221: {
    towgs84: "252,-209,-751"
  },
  ESRI_4305: {
    towgs84: "-123,-206,219"
  },
  ESRI_104139: {
    towgs84: "-73,-247,227"
  },
  EPSG_4748: {
    towgs84: "51,391,-36"
  },
  EPSG_4219: {
    towgs84: "-384,664,-48"
  },
  EPSG_4255: {
    towgs84: "-333,-222,114"
  },
  EPSG_4257: {
    towgs84: "-587.8,519.75,145.76"
  },
  EPSG_4646: {
    towgs84: "-963,510,-359"
  },
  EPSG_6881: {
    towgs84: "-24,-203,268"
  },
  EPSG_6882: {
    towgs84: "-183,-15,273"
  },
  EPSG_4715: {
    towgs84: "-104,-129,239"
  },
  IGNF_RGF93GDD: {
    towgs84: "0,0,0"
  },
  IGNF_RGM04GDD: {
    towgs84: "0,0,0"
  },
  IGNF_RGSPM06GDD: {
    towgs84: "0,0,0"
  },
  IGNF_RGTAAF07GDD: {
    towgs84: "0,0,0"
  },
  IGNF_RGFG95GDD: {
    towgs84: "0,0,0"
  },
  IGNF_RGNCG: {
    towgs84: "0,0,0"
  },
  IGNF_RGPFGDD: {
    towgs84: "0,0,0"
  },
  IGNF_ETRS89G: {
    towgs84: "0,0,0"
  },
  IGNF_RGR92GDD: {
    towgs84: "0,0,0"
  },
  EPSG_4173: {
    towgs84: "0,0,0"
  },
  EPSG_4180: {
    towgs84: "0,0,0"
  },
  EPSG_4619: {
    towgs84: "0,0,0"
  },
  EPSG_4667: {
    towgs84: "0,0,0"
  },
  EPSG_4075: {
    towgs84: "0,0,0"
  },
  EPSG_6706: {
    towgs84: "0,0,0"
  },
  EPSG_7798: {
    towgs84: "0,0,0"
  },
  EPSG_4661: {
    towgs84: "0,0,0"
  },
  EPSG_4669: {
    towgs84: "0,0,0"
  },
  EPSG_8685: {
    towgs84: "0,0,0"
  },
  EPSG_4151: {
    towgs84: "0,0,0"
  },
  EPSG_9702: {
    towgs84: "0,0,0"
  },
  EPSG_4758: {
    towgs84: "0,0,0"
  },
  EPSG_4761: {
    towgs84: "0,0,0"
  },
  EPSG_4765: {
    towgs84: "0,0,0"
  },
  EPSG_8997: {
    towgs84: "0,0,0"
  },
  EPSG_4023: {
    towgs84: "0,0,0"
  },
  EPSG_4670: {
    towgs84: "0,0,0"
  },
  EPSG_4694: {
    towgs84: "0,0,0"
  },
  EPSG_4148: {
    towgs84: "0,0,0"
  },
  EPSG_4163: {
    towgs84: "0,0,0"
  },
  EPSG_4167: {
    towgs84: "0,0,0"
  },
  EPSG_4189: {
    towgs84: "0,0,0"
  },
  EPSG_4190: {
    towgs84: "0,0,0"
  },
  EPSG_4176: {
    towgs84: "0,0,0"
  },
  EPSG_4659: {
    towgs84: "0,0,0"
  },
  EPSG_3824: {
    towgs84: "0,0,0"
  },
  EPSG_3889: {
    towgs84: "0,0,0"
  },
  EPSG_4046: {
    towgs84: "0,0,0"
  },
  EPSG_4081: {
    towgs84: "0,0,0"
  },
  EPSG_4558: {
    towgs84: "0,0,0"
  },
  EPSG_4483: {
    towgs84: "0,0,0"
  },
  EPSG_5013: {
    towgs84: "0,0,0"
  },
  EPSG_5264: {
    towgs84: "0,0,0"
  },
  EPSG_5324: {
    towgs84: "0,0,0"
  },
  EPSG_5354: {
    towgs84: "0,0,0"
  },
  EPSG_5371: {
    towgs84: "0,0,0"
  },
  EPSG_5373: {
    towgs84: "0,0,0"
  },
  EPSG_5381: {
    towgs84: "0,0,0"
  },
  EPSG_5393: {
    towgs84: "0,0,0"
  },
  EPSG_5489: {
    towgs84: "0,0,0"
  },
  EPSG_5593: {
    towgs84: "0,0,0"
  },
  EPSG_6135: {
    towgs84: "0,0,0"
  },
  EPSG_6365: {
    towgs84: "0,0,0"
  },
  EPSG_5246: {
    towgs84: "0,0,0"
  },
  EPSG_7886: {
    towgs84: "0,0,0"
  },
  EPSG_8431: {
    towgs84: "0,0,0"
  },
  EPSG_8427: {
    towgs84: "0,0,0"
  },
  EPSG_8699: {
    towgs84: "0,0,0"
  },
  EPSG_8818: {
    towgs84: "0,0,0"
  },
  EPSG_4757: {
    towgs84: "0,0,0"
  },
  EPSG_9140: {
    towgs84: "0,0,0"
  },
  EPSG_8086: {
    towgs84: "0,0,0"
  },
  EPSG_4686: {
    towgs84: "0,0,0"
  },
  EPSG_4737: {
    towgs84: "0,0,0"
  },
  EPSG_4702: {
    towgs84: "0,0,0"
  },
  EPSG_4747: {
    towgs84: "0,0,0"
  },
  EPSG_4749: {
    towgs84: "0,0,0"
  },
  EPSG_4674: {
    towgs84: "0,0,0"
  },
  EPSG_4755: {
    towgs84: "0,0,0"
  },
  EPSG_4759: {
    towgs84: "0,0,0"
  },
  EPSG_4762: {
    towgs84: "0,0,0"
  },
  EPSG_4763: {
    towgs84: "0,0,0"
  },
  EPSG_4764: {
    towgs84: "0,0,0"
  },
  EPSG_4166: {
    towgs84: "0,0,0"
  },
  EPSG_4170: {
    towgs84: "0,0,0"
  },
  EPSG_5546: {
    towgs84: "0,0,0"
  },
  EPSG_7844: {
    towgs84: "0,0,0"
  },
  EPSG_4818: {
    towgs84: "589,76,480"
  }
};
for (var UP in dT) {
  var tA = dT[UP];
  tA.datumName && (dT[tA.datumName] = tA);
}
function jP(n, t, e, a, s, l, f) {
  var h = {};
  return n === void 0 || n === "none" ? h.datum_type = bM : h.datum_type = Z9, t && (h.datum_params = t.map(parseFloat), (h.datum_params[0] !== 0 || h.datum_params[1] !== 0 || h.datum_params[2] !== 0) && (h.datum_type = L_), h.datum_params.length > 3 && (h.datum_params[3] !== 0 || h.datum_params[4] !== 0 || h.datum_params[5] !== 0 || h.datum_params[6] !== 0) && (h.datum_type = I_, h.datum_params[3] *= kb, h.datum_params[4] *= kb, h.datum_params[5] *= kb, h.datum_params[6] = h.datum_params[6] / 1e6 + 1)), f && (h.datum_type = V1, h.grids = f), h.a = e, h.b = a, h.es = s, h.ep2 = l, h;
}
var mC = {};
function kP(n, t, e) {
  return t instanceof ArrayBuffer ? HP(n, t, e) : { ready: BP(n, t) };
}
function HP(n, t, e) {
  var a = !0;
  e !== void 0 && e.includeErrorFields === !1 && (a = !1);
  var s = new DataView(t), l = YP(s), f = FP(s, l), h = $P(s, f, l, a), p = { header: f, subgrids: h };
  return mC[n] = p, p;
}
async function BP(n, t) {
  for (var e = [], a = await t.getImageCount(), s = a - 1; s >= 0; s--) {
    var l = await t.getImage(s), f = await l.readRasters(), h = f, p = [l.getWidth(), l.getHeight()], y = l.getBoundingBox().map(fD), b = [l.fileDirectory.ModelPixelScale[0], l.fileDirectory.ModelPixelScale[1]].map(fD), x = y[0] + (p[0] - 1) * b[0], w = y[3] - (p[1] - 1) * b[1], A = h[0], C = h[1], L = [];
    for (let k = p[1] - 1; k >= 0; k--)
      for (let H = p[0] - 1; H >= 0; H--) {
        var N = k * p[0] + H;
        L.push([-d0(C[N]), d0(A[N])]);
      }
    e.push({
      del: b,
      lim: p,
      ll: [-x, w],
      cvs: L
    });
  }
  var U = {
    header: {
      nSubgrids: a
    },
    subgrids: e
  };
  return mC[n] = U, U;
}
function qP(n) {
  if (n === void 0)
    return null;
  var t = n.split(",");
  return t.map(VP);
}
function VP(n) {
  if (n.length === 0)
    return null;
  var t = n[0] === "@";
  return t && (n = n.slice(1)), n === "null" ? { name: "null", mandatory: !t, grid: null, isNull: !0 } : {
    name: n,
    mandatory: !t,
    grid: mC[n] || null,
    isNull: !1
  };
}
function fD(n) {
  return n * Math.PI / 180;
}
function d0(n) {
  return n / 3600 * Math.PI / 180;
}
function YP(n) {
  var t = n.getInt32(8, !1);
  return t === 11 ? !1 : (t = n.getInt32(8, !0), t !== 11 && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !0);
}
function FP(n, t) {
  return {
    nFields: n.getInt32(8, t),
    nSubgridFields: n.getInt32(24, t),
    nSubgrids: n.getInt32(40, t),
    shiftType: TM(n, 56, 64).trim(),
    fromSemiMajorAxis: n.getFloat64(120, t),
    fromSemiMinorAxis: n.getFloat64(136, t),
    toSemiMajorAxis: n.getFloat64(152, t),
    toSemiMinorAxis: n.getFloat64(168, t)
  };
}
function TM(n, t, e) {
  return String.fromCharCode.apply(null, new Uint8Array(n.buffer.slice(t, e)));
}
function $P(n, t, e, a) {
  for (var s = 176, l = [], f = 0; f < t.nSubgrids; f++) {
    var h = KP(n, s, e), p = ZP(n, s, h, e, a), y = Math.round(
      1 + (h.upperLongitude - h.lowerLongitude) / h.longitudeInterval
    ), b = Math.round(
      1 + (h.upperLatitude - h.lowerLatitude) / h.latitudeInterval
    );
    l.push({
      ll: [d0(h.lowerLongitude), d0(h.lowerLatitude)],
      del: [d0(h.longitudeInterval), d0(h.latitudeInterval)],
      lim: [y, b],
      count: h.gridNodeCount,
      cvs: XP(p)
    });
    var x = 16;
    a === !1 && (x = 8), s += 176 + h.gridNodeCount * x;
  }
  return l;
}
function XP(n) {
  return n.map(function(t) {
    return [d0(t.longitudeShift), d0(t.latitudeShift)];
  });
}
function KP(n, t, e) {
  return {
    name: TM(n, t + 8, t + 16).trim(),
    parent: TM(n, t + 24, t + 24 + 8).trim(),
    lowerLatitude: n.getFloat64(t + 72, e),
    upperLatitude: n.getFloat64(t + 88, e),
    lowerLongitude: n.getFloat64(t + 104, e),
    upperLongitude: n.getFloat64(t + 120, e),
    latitudeInterval: n.getFloat64(t + 136, e),
    longitudeInterval: n.getFloat64(t + 152, e),
    gridNodeCount: n.getInt32(t + 168, e)
  };
}
function ZP(n, t, e, a, s) {
  var l = t + 176, f = 16;
  s === !1 && (f = 8);
  for (var h = [], p = 0; p < e.gridNodeCount; p++) {
    var y = {
      latitudeShift: n.getFloat32(l + p * f, a),
      longitudeShift: n.getFloat32(l + p * f + 4, a)
    };
    s !== !1 && (y.latitudeAccuracy = n.getFloat32(l + p * f + 8, a), y.longitudeAccuracy = n.getFloat32(l + p * f + 12, a)), h.push(y);
  }
  return h;
}
function If(n, t) {
  if (!(this instanceof If))
    return new If(n);
  this.forward = null, this.inverse = null, this.init = null, this.name, this.names = null, this.title, t = t || function(y) {
    if (y)
      throw y;
  };
  var e = SP(n);
  if (typeof e != "object") {
    t("Could not parse to valid json: " + n);
    return;
  }
  var a = If.projections.get(e.projName);
  if (!a) {
    t("Could not get projection name from: " + n);
    return;
  }
  if (e.datumCode && e.datumCode !== "none") {
    var s = S0(dT, e.datumCode);
    s && (e.datum_params = e.datum_params || (s.towgs84 ? s.towgs84.split(",") : null), e.ellps = s.ellipse, e.datumName = s.datumName ? s.datumName : e.datumCode);
  }
  e.k0 = e.k0 || 1, e.axis = e.axis || "enu", e.ellps = e.ellps || "wgs84", e.lat1 = e.lat1 || e.lat0;
  var l = GP(e.a, e.b, e.rf, e.ellps, e.sphere), f = zP(l.a, l.b, l.rf, e.R_A), h = qP(e.nadgrids), p = e.datum || jP(
    e.datumCode,
    e.datum_params,
    l.a,
    l.b,
    f.es,
    f.ep2,
    h
  );
  uD(this, e), uD(this, a), this.a = l.a, this.b = l.b, this.rf = l.rf, this.sphere = l.sphere, this.es = f.es, this.e = f.e, this.ep2 = f.ep2, this.datum = p, "init" in this && typeof this.init == "function" && this.init(), t(null, this);
}
If.projections = IP;
If.projections.start();
function WP(n, t) {
  return n.datum_type !== t.datum_type || n.a !== t.a || Math.abs(n.es - t.es) > 5e-11 ? !1 : n.datum_type === L_ ? n.datum_params[0] === t.datum_params[0] && n.datum_params[1] === t.datum_params[1] && n.datum_params[2] === t.datum_params[2] : n.datum_type === I_ ? n.datum_params[0] === t.datum_params[0] && n.datum_params[1] === t.datum_params[1] && n.datum_params[2] === t.datum_params[2] && n.datum_params[3] === t.datum_params[3] && n.datum_params[4] === t.datum_params[4] && n.datum_params[5] === t.datum_params[5] && n.datum_params[6] === t.datum_params[6] : !0;
}
function x8(n, t, e) {
  var a = n.x, s = n.y, l = n.z ? n.z : 0, f, h, p, y;
  if (s < -Wt && s > -1.001 * Wt)
    s = -Wt;
  else if (s > Wt && s < 1.001 * Wt)
    s = Wt;
  else {
    if (s < -Wt)
      return { x: -1 / 0, y: -1 / 0, z: n.z };
    if (s > Wt)
      return { x: 1 / 0, y: 1 / 0, z: n.z };
  }
  return a > Math.PI && (a -= 2 * Math.PI), h = Math.sin(s), y = Math.cos(s), p = h * h, f = e / Math.sqrt(1 - t * p), {
    x: (f + l) * y * Math.cos(a),
    y: (f + l) * y * Math.sin(a),
    z: (f * (1 - t) + l) * h
  };
}
function T8(n, t, e, a) {
  var s = 1e-12, l = s * s, f = 30, h, p, y, b, x, w, A, C, L, N, U, k, H, B = n.x, z = n.y, Q = n.z ? n.z : 0, et, ot, pt;
  if (h = Math.sqrt(B * B + z * z), p = Math.sqrt(B * B + z * z + Q * Q), h / e < s) {
    if (et = 0, p / e < s)
      return ot = Wt, pt = -a, {
        x: n.x,
        y: n.y,
        z: n.z
      };
  } else
    et = Math.atan2(z, B);
  y = Q / p, b = h / p, x = 1 / Math.sqrt(1 - t * (2 - t) * b * b), C = b * (1 - t) * x, L = y * x, H = 0;
  do
    H++, A = e / Math.sqrt(1 - t * L * L), pt = h * C + Q * L - A * (1 - t * L * L), w = t * A / (A + pt), x = 1 / Math.sqrt(1 - w * (2 - w) * b * b), N = b * (1 - w) * x, U = y * x, k = U * C - N * L, C = N, L = U;
  while (k * k > l && H < f);
  return ot = Math.atan(U / Math.abs(N)), {
    x: et,
    y: ot,
    z: pt
  };
}
function QP(n, t, e) {
  if (t === L_)
    return {
      x: n.x + e[0],
      y: n.y + e[1],
      z: n.z + e[2]
    };
  if (t === I_) {
    var a = e[0], s = e[1], l = e[2], f = e[3], h = e[4], p = e[5], y = e[6];
    return {
      x: y * (n.x - p * n.y + h * n.z) + a,
      y: y * (p * n.x + n.y - f * n.z) + s,
      z: y * (-h * n.x + f * n.y + n.z) + l
    };
  }
}
function JP(n, t, e) {
  if (t === L_)
    return {
      x: n.x - e[0],
      y: n.y - e[1],
      z: n.z - e[2]
    };
  if (t === I_) {
    var a = e[0], s = e[1], l = e[2], f = e[3], h = e[4], p = e[5], y = e[6], b = (n.x - a) / y, x = (n.y - s) / y, w = (n.z - l) / y;
    return {
      x: b + p * x - h * w,
      y: -p * b + x + f * w,
      z: h * b - f * x + w
    };
  }
}
function Gx(n) {
  return n === L_ || n === I_;
}
function tz(n, t, e) {
  if (WP(n, t) || n.datum_type === bM || t.datum_type === bM)
    return e;
  var a = n.a, s = n.es;
  if (n.datum_type === V1) {
    var l = hD(n, !1, e);
    if (l !== 0)
      return;
    a = iD, s = aD;
  }
  var f = t.a, h = t.b, p = t.es;
  if (t.datum_type === V1 && (f = iD, h = W9, p = aD), s === p && a === f && !Gx(n.datum_type) && !Gx(t.datum_type))
    return e;
  if (e = x8(e, s, a), Gx(n.datum_type) && (e = QP(e, n.datum_type, n.datum_params)), Gx(t.datum_type) && (e = JP(e, t.datum_type, t.datum_params)), e = T8(e, p, f, h), t.datum_type === V1) {
    var y = hD(t, !0, e);
    if (y !== 0)
      return;
  }
  return e;
}
function hD(n, t, e) {
  if (n.grids === null || n.grids.length === 0)
    return console.log("Grid shift grids not found"), -1;
  var a = { x: -e.x, y: e.y }, s = { x: Number.NaN, y: Number.NaN }, l = [];
  t:
    for (var f = 0; f < n.grids.length; f++) {
      var h = n.grids[f];
      if (l.push(h.name), h.isNull) {
        s = a;
        break;
      }
      if (h.grid === null) {
        if (h.mandatory)
          return console.log("Unable to find mandatory grid '" + h.name + "'"), -1;
        continue;
      }
      for (var p = h.grid.subgrids, y = 0, b = p.length; y < b; y++) {
        var x = p[y], w = (Math.abs(x.del[1]) + Math.abs(x.del[0])) / 1e4, A = x.ll[0] - w, C = x.ll[1] - w, L = x.ll[0] + (x.lim[0] - 1) * x.del[0] + w, N = x.ll[1] + (x.lim[1] - 1) * x.del[1] + w;
        if (!(C > a.y || A > a.x || N < a.y || L < a.x) && (s = ez(a, t, x), !isNaN(s.x)))
          break t;
      }
    }
  return isNaN(s.x) ? (console.log("Failed to find a grid shift table for location '" + -a.x * ad + " " + a.y * ad + " tried: '" + l + "'"), -1) : (e.x = -s.x, e.y = s.y, 0);
}
function ez(n, t, e) {
  var a = { x: Number.NaN, y: Number.NaN };
  if (isNaN(n.x))
    return a;
  var s = { x: n.x, y: n.y };
  s.x -= e.ll[0], s.y -= e.ll[1], s.x = ue(s.x - Math.PI) + Math.PI;
  var l = dD(s, e);
  if (t) {
    if (isNaN(l.x))
      return a;
    l.x = s.x - l.x, l.y = s.y - l.y;
    var f = 9, h = 1e-12, p, y;
    do {
      if (y = dD(l, e), isNaN(y.x)) {
        console.log("Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.");
        break;
      }
      p = { x: s.x - (y.x + l.x), y: s.y - (y.y + l.y) }, l.x += p.x, l.y += p.y;
    } while (f-- && Math.abs(p.x) > h && Math.abs(p.y) > h);
    if (f < 0)
      return console.log("Inverse grid shift iterator failed to converge."), a;
    a.x = ue(l.x + e.ll[0]), a.y = l.y + e.ll[1];
  } else
    isNaN(l.x) || (a.x = n.x + l.x, a.y = n.y + l.y);
  return a;
}
function dD(n, t) {
  var e = { x: n.x / t.del[0], y: n.y / t.del[1] }, a = { x: Math.floor(e.x), y: Math.floor(e.y) }, s = { x: e.x - 1 * a.x, y: e.y - 1 * a.y }, l = { x: Number.NaN, y: Number.NaN }, f;
  if (a.x < 0 || a.x >= t.lim[0] || a.y < 0 || a.y >= t.lim[1])
    return l;
  f = a.y * t.lim[0] + a.x;
  var h = { x: t.cvs[f][0], y: t.cvs[f][1] };
  f++;
  var p = { x: t.cvs[f][0], y: t.cvs[f][1] };
  f += t.lim[0];
  var y = { x: t.cvs[f][0], y: t.cvs[f][1] };
  f--;
  var b = { x: t.cvs[f][0], y: t.cvs[f][1] }, x = s.x * s.y, w = s.x * (1 - s.y), A = (1 - s.x) * (1 - s.y), C = (1 - s.x) * s.y;
  return l.x = A * h.x + w * p.x + C * b.x + x * y.x, l.y = A * h.y + w * p.y + C * b.y + x * y.y, l;
}
function gD(n, t, e) {
  var a = e.x, s = e.y, l = e.z || 0, f, h, p, y = {};
  for (p = 0; p < 3; p++)
    if (!(t && p === 2 && e.z === void 0))
      switch (p === 0 ? (f = a, "ew".indexOf(n.axis[p]) !== -1 ? h = "x" : h = "y") : p === 1 ? (f = s, "ns".indexOf(n.axis[p]) !== -1 ? h = "y" : h = "x") : (f = l, h = "z"), n.axis[p]) {
        case "e":
          y[h] = f;
          break;
        case "w":
          y[h] = -f;
          break;
        case "n":
          y[h] = f;
          break;
        case "s":
          y[h] = -f;
          break;
        case "u":
          e[h] !== void 0 && (y.z = f);
          break;
        case "d":
          e[h] !== void 0 && (y.z = -f);
          break;
        default:
          return null;
      }
  return y;
}
function w8(n) {
  var t = {
    x: n[0],
    y: n[1]
  };
  return n.length > 2 && (t.z = n[2]), n.length > 3 && (t.m = n[3]), t;
}
function nz(n) {
  mD(n.x), mD(n.y);
}
function mD(n) {
  if (typeof Number.isFinite == "function") {
    if (Number.isFinite(n))
      return;
    throw new TypeError("coordinates must be finite numbers");
  }
  if (typeof n != "number" || n !== n || !isFinite(n))
    throw new TypeError("coordinates must be finite numbers");
}
function iz(n, t) {
  return (n.datum.datum_type === L_ || n.datum.datum_type === I_ || n.datum.datum_type === V1) && t.datumCode !== "WGS84" || (t.datum.datum_type === L_ || t.datum.datum_type === I_ || t.datum.datum_type === V1) && n.datumCode !== "WGS84";
}
function PT(n, t, e, a) {
  var s;
  Array.isArray(e) ? e = w8(e) : e = {
    x: e.x,
    y: e.y,
    z: e.z,
    m: e.m
  };
  var l = e.z !== void 0;
  if (nz(e), n.datum && t.datum && iz(n, t) && (s = new If("WGS84"), e = PT(n, s, e, a), n = s), a && n.axis !== "enu" && (e = gD(n, !1, e)), n.projName === "longlat")
    e = {
      x: e.x * Rs,
      y: e.y * Rs,
      z: e.z || 0
    };
  else if (n.to_meter && (e = {
    x: e.x * n.to_meter,
    y: e.y * n.to_meter,
    z: e.z || 0
  }), e = n.inverse(e), !e)
    return;
  if (n.from_greenwich && (e.x += n.from_greenwich), e = tz(n.datum, t.datum, e), !!e)
    return e = /** @type {import('./core').InterfaceCoordinates} */
    e, t.from_greenwich && (e = {
      x: e.x - t.from_greenwich,
      y: e.y,
      z: e.z || 0
    }), t.projName === "longlat" ? e = {
      x: e.x * ad,
      y: e.y * ad,
      z: e.z || 0
    } : (e = t.forward(e), t.to_meter && (e = {
      x: e.x / t.to_meter,
      y: e.y / t.to_meter,
      z: e.z || 0
    })), a && t.axis !== "enu" ? gD(t, !0, e) : (e && !l && delete e.z, e);
}
var pD = If("WGS84");
function eA(n, t, e, a) {
  var s, l, f;
  return Array.isArray(e) ? (s = PT(n, t, e, a) || { x: NaN, y: NaN }, e.length > 2 ? typeof n.name < "u" && n.name === "geocent" || typeof t.name < "u" && t.name === "geocent" ? typeof s.z == "number" ? (
    /** @type {T} */
    [s.x, s.y, s.z].concat(e.slice(3))
  ) : (
    /** @type {T} */
    [s.x, s.y, e[2]].concat(e.slice(3))
  ) : (
    /** @type {T} */
    [s.x, s.y].concat(e.slice(2))
  ) : (
    /** @type {T} */
    [s.x, s.y]
  )) : (l = PT(n, t, e, a), f = Object.keys(e), f.length === 2 || f.forEach(function(h) {
    if (typeof n.name < "u" && n.name === "geocent" || typeof t.name < "u" && t.name === "geocent") {
      if (h === "x" || h === "y" || h === "z")
        return;
    } else if (h === "x" || h === "y")
      return;
    l[h] = e[h];
  }), /** @type {T} */
  l);
}
function Ux(n) {
  return n instanceof If ? n : typeof n == "object" && "oProj" in n ? n.oProj : If(
    /** @type {string | PROJJSONDefinition} */
    n
  );
}
function az(n, t, e) {
  var a, s, l = !1, f;
  return typeof t > "u" ? (s = Ux(n), a = pD, l = !0) : (typeof /** @type {?} */
  t.x < "u" || Array.isArray(t)) && (e = /** @type {T} */
  /** @type {?} */
  t, s = Ux(n), a = pD, l = !0), a || (a = Ux(n)), s || (s = Ux(
    /** @type {string | PROJJSONDefinition | proj } */
    t
  )), e ? eA(a, s, e) : (f = {
    /**
     * @template {TemplateCoordinates} T
     * @param {T} coords
     * @param {boolean=} enforceAxis
     * @returns {T}
     */
    forward: function(h, p) {
      return eA(a, s, h, p);
    },
    /**
     * @template {TemplateCoordinates} T
     * @param {T} coords
     * @param {boolean=} enforceAxis
     * @returns {T}
     */
    inverse: function(h, p) {
      return eA(s, a, h, p);
    }
  }, l && (f.oProj = s), f);
}
var yD = 6, R8 = "AJSAJS", A8 = "AFAFAF", k1 = 65, sl = 73, xc = 79, Ab = 86, Mb = 90;
const rz = {
  forward: M8,
  inverse: sz,
  toPoint: C8
};
function M8(n, t) {
  return t = t || 5, uz(oz({
    lat: n[1],
    lon: n[0]
  }), t);
}
function sz(n) {
  var t = pC(D8(n.toUpperCase()));
  return t.lat && t.lon ? [t.lon, t.lat, t.lon, t.lat] : [t.left, t.bottom, t.right, t.top];
}
function C8(n) {
  var t = pC(D8(n.toUpperCase()));
  return t.lat && t.lon ? [t.lon, t.lat] : [(t.left + t.right) / 2, (t.top + t.bottom) / 2];
}
function nA(n) {
  return n * (Math.PI / 180);
}
function _D(n) {
  return 180 * (n / Math.PI);
}
function oz(n) {
  var t = n.lat, e = n.lon, a = 6378137, s = 669438e-8, l = 0.9996, f, h, p, y, b, x, w, A = nA(t), C = nA(e), L, N;
  N = Math.floor((e + 180) / 6) + 1, e === 180 && (N = 60), t >= 56 && t < 64 && e >= 3 && e < 12 && (N = 32), t >= 72 && t < 84 && (e >= 0 && e < 9 ? N = 31 : e >= 9 && e < 21 ? N = 33 : e >= 21 && e < 33 ? N = 35 : e >= 33 && e < 42 && (N = 37)), f = (N - 1) * 6 - 180 + 3, L = nA(f), h = s / (1 - s), p = a / Math.sqrt(1 - s * Math.sin(A) * Math.sin(A)), y = Math.tan(A) * Math.tan(A), b = h * Math.cos(A) * Math.cos(A), x = Math.cos(A) * (C - L), w = a * ((1 - s / 4 - 3 * s * s / 64 - 5 * s * s * s / 256) * A - (3 * s / 8 + 3 * s * s / 32 + 45 * s * s * s / 1024) * Math.sin(2 * A) + (15 * s * s / 256 + 45 * s * s * s / 1024) * Math.sin(4 * A) - 35 * s * s * s / 3072 * Math.sin(6 * A));
  var U = l * p * (x + (1 - y + b) * x * x * x / 6 + (5 - 18 * y + y * y + 72 * b - 58 * h) * x * x * x * x * x / 120) + 5e5, k = l * (w + p * Math.tan(A) * (x * x / 2 + (5 - y + 9 * b + 4 * b * b) * x * x * x * x / 24 + (61 - 58 * y + y * y + 600 * b - 330 * h) * x * x * x * x * x * x / 720));
  return t < 0 && (k += 1e7), {
    northing: Math.round(k),
    easting: Math.round(U),
    zoneNumber: N,
    zoneLetter: lz(t)
  };
}
function pC(n) {
  var t = n.northing, e = n.easting, a = n.zoneLetter, s = n.zoneNumber;
  if (s < 0 || s > 60)
    return null;
  var l = 0.9996, f = 6378137, h = 669438e-8, p, y = (1 - Math.sqrt(1 - h)) / (1 + Math.sqrt(1 - h)), b, x, w, A, C, L, N, U, k, H = e - 5e5, B = t;
  a < "N" && (B -= 1e7), N = (s - 1) * 6 - 180 + 3, p = h / (1 - h), L = B / l, U = L / (f * (1 - h / 4 - 3 * h * h / 64 - 5 * h * h * h / 256)), k = U + (3 * y / 2 - 27 * y * y * y / 32) * Math.sin(2 * U) + (21 * y * y / 16 - 55 * y * y * y * y / 32) * Math.sin(4 * U) + 151 * y * y * y / 96 * Math.sin(6 * U), b = f / Math.sqrt(1 - h * Math.sin(k) * Math.sin(k)), x = Math.tan(k) * Math.tan(k), w = p * Math.cos(k) * Math.cos(k), A = f * (1 - h) / Math.pow(1 - h * Math.sin(k) * Math.sin(k), 1.5), C = H / (b * l);
  var z = k - b * Math.tan(k) / A * (C * C / 2 - (5 + 3 * x + 10 * w - 4 * w * w - 9 * p) * C * C * C * C / 24 + (61 + 90 * x + 298 * w + 45 * x * x - 252 * p - 3 * w * w) * C * C * C * C * C * C / 720);
  z = _D(z);
  var Q = (C - (1 + 2 * x + w) * C * C * C / 6 + (5 - 2 * w + 28 * x - 3 * w * w + 8 * p + 24 * x * x) * C * C * C * C * C / 120) / Math.cos(k);
  Q = N + _D(Q);
  var et;
  if (n.accuracy) {
    var ot = pC({
      northing: n.northing + n.accuracy,
      easting: n.easting + n.accuracy,
      zoneLetter: n.zoneLetter,
      zoneNumber: n.zoneNumber
    });
    et = {
      top: ot.lat,
      right: ot.lon,
      bottom: z,
      left: Q
    };
  } else
    et = {
      lat: z,
      lon: Q
    };
  return et;
}
function lz(n) {
  var t = "Z";
  return 84 >= n && n >= 72 ? t = "X" : 72 > n && n >= 64 ? t = "W" : 64 > n && n >= 56 ? t = "V" : 56 > n && n >= 48 ? t = "U" : 48 > n && n >= 40 ? t = "T" : 40 > n && n >= 32 ? t = "S" : 32 > n && n >= 24 ? t = "R" : 24 > n && n >= 16 ? t = "Q" : 16 > n && n >= 8 ? t = "P" : 8 > n && n >= 0 ? t = "N" : 0 > n && n >= -8 ? t = "M" : -8 > n && n >= -16 ? t = "L" : -16 > n && n >= -24 ? t = "K" : -24 > n && n >= -32 ? t = "J" : -32 > n && n >= -40 ? t = "H" : -40 > n && n >= -48 ? t = "G" : -48 > n && n >= -56 ? t = "F" : -56 > n && n >= -64 ? t = "E" : -64 > n && n >= -72 ? t = "D" : -72 > n && n >= -80 && (t = "C"), t;
}
function uz(n, t) {
  var e = "00000" + n.easting, a = "00000" + n.northing;
  return n.zoneNumber + n.zoneLetter + cz(n.easting, n.northing, n.zoneNumber) + e.substr(e.length - 5, t) + a.substr(a.length - 5, t);
}
function cz(n, t, e) {
  var a = O8(e), s = Math.floor(n / 1e5), l = Math.floor(t / 1e5) % 20;
  return fz(s, l, a);
}
function O8(n) {
  var t = n % yD;
  return t === 0 && (t = yD), t;
}
function fz(n, t, e) {
  var a = e - 1, s = R8.charCodeAt(a), l = A8.charCodeAt(a), f = s + n - 1, h = l + t, p = !1;
  f > Mb && (f = f - Mb + k1 - 1, p = !0), (f === sl || s < sl && f > sl || (f > sl || s < sl) && p) && f++, (f === xc || s < xc && f > xc || (f > xc || s < xc) && p) && (f++, f === sl && f++), f > Mb && (f = f - Mb + k1 - 1), h > Ab ? (h = h - Ab + k1 - 1, p = !0) : p = !1, (h === sl || l < sl && h > sl || (h > sl || l < sl) && p) && h++, (h === xc || l < xc && h > xc || (h > xc || l < xc) && p) && (h++, h === sl && h++), h > Ab && (h = h - Ab + k1 - 1);
  var y = String.fromCharCode(f) + String.fromCharCode(h);
  return y;
}
function D8(n) {
  if (n && n.length === 0)
    throw "MGRSPoint coverting from nothing";
  for (var t = n.length, e = null, a = "", s, l = 0; !/[A-Z]/.test(s = n.charAt(l)); ) {
    if (l >= 2)
      throw "MGRSPoint bad conversion from: " + n;
    a += s, l++;
  }
  var f = parseInt(a, 10);
  if (l === 0 || l + 3 > t)
    throw "MGRSPoint bad conversion from: " + n;
  var h = n.charAt(l++);
  if (h <= "A" || h === "B" || h === "Y" || h >= "Z" || h === "I" || h === "O")
    throw "MGRSPoint zone letter " + h + " not handled: " + n;
  e = n.substring(l, l += 2);
  for (var p = O8(f), y = hz(e.charAt(0), p), b = dz(e.charAt(1), p); b < gz(h); )
    b += 2e6;
  var x = t - l;
  if (x % 2 !== 0)
    throw `MGRSPoint has to have an even number 
of digits after the zone letter and two 100km letters - front 
half for easting meters, second half for 
northing meters` + n;
  var w = x / 2, A = 0, C = 0, L, N, U, k, H;
  return w > 0 && (L = 1e5 / Math.pow(10, w), N = n.substring(l, l + w), A = parseFloat(N) * L, U = n.substring(l + w), C = parseFloat(U) * L), k = A + y, H = C + b, {
    easting: k,
    northing: H,
    zoneLetter: h,
    zoneNumber: f,
    accuracy: L
  };
}
function hz(n, t) {
  for (var e = R8.charCodeAt(t - 1), a = 1e5, s = !1; e !== n.charCodeAt(0); ) {
    if (e++, e === sl && e++, e === xc && e++, e > Mb) {
      if (s)
        throw "Bad character: " + n;
      e = k1, s = !0;
    }
    a += 1e5;
  }
  return a;
}
function dz(n, t) {
  if (n > "V")
    throw "MGRSPoint given invalid Northing " + n;
  for (var e = A8.charCodeAt(t - 1), a = 0, s = !1; e !== n.charCodeAt(0); ) {
    if (e++, e === sl && e++, e === xc && e++, e > Ab) {
      if (s)
        throw "Bad character: " + n;
      e = k1, s = !0;
    }
    a += 1e5;
  }
  return a;
}
function gz(n) {
  var t;
  switch (n) {
    case "C":
      t = 11e5;
      break;
    case "D":
      t = 2e6;
      break;
    case "E":
      t = 28e5;
      break;
    case "F":
      t = 37e5;
      break;
    case "G":
      t = 46e5;
      break;
    case "H":
      t = 55e5;
      break;
    case "J":
      t = 64e5;
      break;
    case "K":
      t = 73e5;
      break;
    case "L":
      t = 82e5;
      break;
    case "M":
      t = 91e5;
      break;
    case "N":
      t = 0;
      break;
    case "P":
      t = 8e5;
      break;
    case "Q":
      t = 17e5;
      break;
    case "R":
      t = 26e5;
      break;
    case "S":
      t = 35e5;
      break;
    case "T":
      t = 44e5;
      break;
    case "U":
      t = 53e5;
      break;
    case "V":
      t = 62e5;
      break;
    case "W":
      t = 7e6;
      break;
    case "X":
      t = 79e5;
      break;
    default:
      t = -1;
  }
  if (t >= 0)
    return t;
  throw "Invalid zone letter: " + n;
}
function J1(n, t, e) {
  if (!(this instanceof J1))
    return new J1(n, t, e);
  if (Array.isArray(n))
    this.x = n[0], this.y = n[1], this.z = n[2] || 0;
  else if (typeof n == "object")
    this.x = n.x, this.y = n.y, this.z = n.z || 0;
  else if (typeof n == "string" && typeof t > "u") {
    var a = n.split(",");
    this.x = parseFloat(a[0]), this.y = parseFloat(a[1]), this.z = parseFloat(a[2]) || 0;
  } else
    this.x = n, this.y = t, this.z = e || 0;
  console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
}
J1.fromMGRS = function(n) {
  return new J1(C8(n));
};
J1.prototype.toMGRS = function(n) {
  return M8([this.x, this.y], n);
};
var mz = 1, pz = 0.25, vD = 0.046875, ED = 0.01953125, bD = 0.01068115234375, yz = 0.75, _z = 0.46875, vz = 0.013020833333333334, Ez = 0.007120768229166667, bz = 0.3645833333333333, Sz = 0.005696614583333333, xz = 0.3076171875;
function yC(n) {
  var t = [];
  t[0] = mz - n * (pz + n * (vD + n * (ED + n * bD))), t[1] = n * (yz - n * (vD + n * (ED + n * bD)));
  var e = n * n;
  return t[2] = e * (_z - n * (vz + n * Ez)), e *= n, t[3] = e * (bz - n * Sz), t[4] = e * n * xz, t;
}
function gE(n, t, e, a) {
  return e *= t, t *= t, a[0] * n - e * (a[1] + t * (a[2] + t * (a[3] + t * a[4])));
}
var Tz = 20;
function _C(n, t, e) {
  for (var a = 1 / (1 - t), s = n, l = Tz; l; --l) {
    var f = Math.sin(s), h = 1 - t * f * f;
    if (h = (gE(s, f, Math.cos(s), e) - n) * (h * Math.sqrt(h)) * a, s -= h, Math.abs(h) < se)
      return s;
  }
  return s;
}
function wz() {
  this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.es && (this.en = yC(this.es), this.ml0 = gE(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
}
function Rz(n) {
  var t = n.x, e = n.y, a = ue(t - this.long0), s, l, f, h = Math.sin(e), p = Math.cos(e);
  if (this.es) {
    var b = p * a, x = Math.pow(b, 2), w = this.ep2 * Math.pow(p, 2), A = Math.pow(w, 2), C = Math.abs(p) > se ? Math.tan(e) : 0, L = Math.pow(C, 2), N = Math.pow(L, 2);
    s = 1 - this.es * Math.pow(h, 2), b = b / Math.sqrt(s);
    var U = gE(e, h, p, this.en);
    l = this.a * (this.k0 * b * (1 + x / 6 * (1 - L + w + x / 20 * (5 - 18 * L + N + 14 * w - 58 * L * w + x / 42 * (61 + 179 * N - N * L - 479 * L))))) + this.x0, f = this.a * (this.k0 * (U - this.ml0 + h * a * b / 2 * (1 + x / 12 * (5 - L + 9 * w + 4 * A + x / 30 * (61 + N - 58 * L + 270 * w - 330 * L * w + x / 56 * (1385 + 543 * N - N * L - 3111 * L)))))) + this.y0;
  } else {
    var y = p * Math.sin(a);
    if (Math.abs(Math.abs(y) - 1) < se)
      return 93;
    if (l = 0.5 * this.a * this.k0 * Math.log((1 + y) / (1 - y)) + this.x0, f = p * Math.cos(a) / Math.sqrt(1 - Math.pow(y, 2)), y = Math.abs(f), y >= 1) {
      if (y - 1 > se)
        return 93;
      f = 0;
    } else
      f = Math.acos(f);
    e < 0 && (f = -f), f = this.a * this.k0 * (f - this.lat0) + this.y0;
  }
  return n.x = l, n.y = f, n;
}
function Az(n) {
  var t, e, a, s, l = (n.x - this.x0) * (1 / this.a), f = (n.y - this.y0) * (1 / this.a);
  if (this.es)
    if (t = this.ml0 + f / this.k0, e = _C(t, this.es, this.en), Math.abs(e) < Wt) {
      var x = Math.sin(e), w = Math.cos(e), A = Math.abs(w) > se ? Math.tan(e) : 0, C = this.ep2 * Math.pow(w, 2), L = Math.pow(C, 2), N = Math.pow(A, 2), U = Math.pow(N, 2);
      t = 1 - this.es * Math.pow(x, 2);
      var k = l * Math.sqrt(t) / this.k0, H = Math.pow(k, 2);
      t = t * A, a = e - t * H / (1 - this.es) * 0.5 * (1 - H / 12 * (5 + 3 * N - 9 * C * N + C - 4 * L - H / 30 * (61 + 90 * N - 252 * C * N + 45 * U + 46 * C - H / 56 * (1385 + 3633 * N + 4095 * U + 1574 * U * N)))), s = ue(this.long0 + k * (1 - H / 6 * (1 + 2 * N + C - H / 20 * (5 + 28 * N + 24 * U + 8 * C * N + 6 * C - H / 42 * (61 + 662 * N + 1320 * U + 720 * U * N)))) / w);
    } else
      a = Wt * xS(f), s = 0;
  else {
    var h = Math.exp(l / this.k0), p = 0.5 * (h - 1 / h), y = this.lat0 + f / this.k0, b = Math.cos(y);
    t = Math.sqrt((1 - Math.pow(b, 2)) / (1 + Math.pow(p, 2))), a = Math.asin(t), f < 0 && (a = -a), p === 0 && b === 0 ? s = 0 : s = ue(Math.atan2(p, b) + this.long0);
  }
  return n.x = s, n.y = a, n;
}
var Mz = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
const gT = {
  init: wz,
  forward: Rz,
  inverse: Az,
  names: Mz
};
function N8(n) {
  var t = Math.exp(n);
  return t = (t - 1 / t) / 2, t;
}
function fl(n, t) {
  n = Math.abs(n), t = Math.abs(t);
  var e = Math.max(n, t), a = Math.min(n, t) / (e || 1);
  return e * Math.sqrt(1 + Math.pow(a, 2));
}
function Cz(n) {
  var t = 1 + n, e = t - 1;
  return e === 0 ? n : n * Math.log(t) / e;
}
function Oz(n) {
  var t = Math.abs(n);
  return t = Cz(t * (1 + t / (fl(1, t) + 1))), n < 0 ? -t : t;
}
function vC(n, t) {
  for (var e = 2 * Math.cos(2 * t), a = n.length - 1, s = n[a], l = 0, f; --a >= 0; )
    f = -l + e * s + n[a], l = s, s = f;
  return t + f * Math.sin(2 * t);
}
function Dz(n, t) {
  for (var e = 2 * Math.cos(t), a = n.length - 1, s = n[a], l = 0, f; --a >= 0; )
    f = -l + e * s + n[a], l = s, s = f;
  return Math.sin(t) * f;
}
function Nz(n) {
  var t = Math.exp(n);
  return t = (t + 1 / t) / 2, t;
}
function L8(n, t, e) {
  for (var a = Math.sin(t), s = Math.cos(t), l = N8(e), f = Nz(e), h = 2 * s * f, p = -2 * a * l, y = n.length - 1, b = n[y], x = 0, w = 0, A = 0, C, L; --y >= 0; )
    C = w, L = x, w = b, x = A, b = -C + h * w - p * x + n[y], A = -L + p * w + h * x;
  return h = a * f, p = s * l, [h * b - p * A, h * A + p * b];
}
function Lz() {
  if (!this.approx && (isNaN(this.es) || this.es <= 0))
    throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
  this.approx && (gT.init.apply(this), this.forward = gT.forward, this.inverse = gT.inverse), this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
  var n = this.es / (1 + Math.sqrt(1 - this.es)), t = n / (2 - n), e = t;
  this.cgb[0] = t * (2 + t * (-2 / 3 + t * (-2 + t * (116 / 45 + t * (26 / 45 + t * (-2854 / 675)))))), this.cbg[0] = t * (-2 + t * (2 / 3 + t * (4 / 3 + t * (-82 / 45 + t * (32 / 45 + t * (4642 / 4725)))))), e = e * t, this.cgb[1] = e * (7 / 3 + t * (-8 / 5 + t * (-227 / 45 + t * (2704 / 315 + t * (2323 / 945))))), this.cbg[1] = e * (5 / 3 + t * (-16 / 15 + t * (-13 / 9 + t * (904 / 315 + t * (-1522 / 945))))), e = e * t, this.cgb[2] = e * (56 / 15 + t * (-136 / 35 + t * (-1262 / 105 + t * (73814 / 2835)))), this.cbg[2] = e * (-26 / 15 + t * (34 / 21 + t * (8 / 5 + t * (-12686 / 2835)))), e = e * t, this.cgb[3] = e * (4279 / 630 + t * (-332 / 35 + t * (-399572 / 14175))), this.cbg[3] = e * (1237 / 630 + t * (-12 / 5 + t * (-24832 / 14175))), e = e * t, this.cgb[4] = e * (4174 / 315 + t * (-144838 / 6237)), this.cbg[4] = e * (-734 / 315 + t * (109598 / 31185)), e = e * t, this.cgb[5] = e * (601676 / 22275), this.cbg[5] = e * (444337 / 155925), e = Math.pow(t, 2), this.Qn = this.k0 / (1 + t) * (1 + e * (1 / 4 + e * (1 / 64 + e / 256))), this.utg[0] = t * (-0.5 + t * (2 / 3 + t * (-37 / 96 + t * (1 / 360 + t * (81 / 512 + t * (-96199 / 604800)))))), this.gtu[0] = t * (0.5 + t * (-2 / 3 + t * (5 / 16 + t * (41 / 180 + t * (-127 / 288 + t * (7891 / 37800)))))), this.utg[1] = e * (-1 / 48 + t * (-1 / 15 + t * (437 / 1440 + t * (-46 / 105 + t * (1118711 / 3870720))))), this.gtu[1] = e * (13 / 48 + t * (-3 / 5 + t * (557 / 1440 + t * (281 / 630 + t * (-1983433 / 1935360))))), e = e * t, this.utg[2] = e * (-17 / 480 + t * (37 / 840 + t * (209 / 4480 + t * (-5569 / 90720)))), this.gtu[2] = e * (61 / 240 + t * (-103 / 140 + t * (15061 / 26880 + t * (167603 / 181440)))), e = e * t, this.utg[3] = e * (-4397 / 161280 + t * (11 / 504 + t * (830251 / 7257600))), this.gtu[3] = e * (49561 / 161280 + t * (-179 / 168 + t * (6601661 / 7257600))), e = e * t, this.utg[4] = e * (-4583 / 161280 + t * (108847 / 3991680)), this.gtu[4] = e * (34729 / 80640 + t * (-3418889 / 1995840)), e = e * t, this.utg[5] = e * (-20648693 / 638668800), this.gtu[5] = e * (212378941 / 319334400);
  var a = vC(this.cbg, this.lat0);
  this.Zb = -this.Qn * (a + Dz(this.gtu, 2 * a));
}
function Iz(n) {
  var t = ue(n.x - this.long0), e = n.y;
  e = vC(this.cbg, e);
  var a = Math.sin(e), s = Math.cos(e), l = Math.sin(t), f = Math.cos(t);
  e = Math.atan2(a, f * s), t = Math.atan2(l * s, fl(a, s * f)), t = Oz(Math.tan(t));
  var h = L8(this.gtu, 2 * e, 2 * t);
  e = e + h[0], t = t + h[1];
  var p, y;
  return Math.abs(t) <= 2.623395162778 ? (p = this.a * (this.Qn * t) + this.x0, y = this.a * (this.Qn * e + this.Zb) + this.y0) : (p = 1 / 0, y = 1 / 0), n.x = p, n.y = y, n;
}
function Pz(n) {
  var t = (n.x - this.x0) * (1 / this.a), e = (n.y - this.y0) * (1 / this.a);
  e = (e - this.Zb) / this.Qn, t = t / this.Qn;
  var a, s;
  if (Math.abs(t) <= 2.623395162778) {
    var l = L8(this.utg, 2 * e, 2 * t);
    e = e + l[0], t = t + l[1], t = Math.atan(N8(t));
    var f = Math.sin(e), h = Math.cos(e), p = Math.sin(t), y = Math.cos(t);
    e = Math.atan2(f * y, fl(p, y * h)), t = Math.atan2(p, y * h), a = ue(t + this.long0), s = vC(this.cgb, e);
  } else
    a = 1 / 0, s = 1 / 0;
  return n.x = a, n.y = s, n;
}
var zz = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
const mT = {
  init: Lz,
  forward: Iz,
  inverse: Pz,
  names: zz
};
function Gz(n, t) {
  if (n === void 0) {
    if (n = Math.floor((ue(t) + Math.PI) * 30 / Math.PI) + 1, n < 0)
      return 0;
    if (n > 60)
      return 60;
  }
  return n;
}
var Uz = "etmerc";
function jz() {
  var n = Gz(this.zone, this.long0);
  if (n === void 0)
    throw new Error("unknown utm zone");
  this.lat0 = 0, this.long0 = (6 * Math.abs(n) - 183) * Rs, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, mT.init.apply(this), this.forward = mT.forward, this.inverse = mT.inverse;
}
var kz = ["Universal Transverse Mercator System", "utm"];
const Hz = {
  init: jz,
  names: kz,
  dependsOn: Uz
};
function EC(n, t) {
  return Math.pow((1 - n) / (1 + n), t);
}
var Bz = 20;
function qz() {
  var n = Math.sin(this.lat0), t = Math.cos(this.lat0);
  t *= t, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * n * n), this.C = Math.sqrt(1 + this.es * t * t / (1 - this.es)), this.phic0 = Math.asin(n / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + _i) / (Math.pow(Math.tan(0.5 * this.lat0 + _i), this.C) * EC(this.e * n, this.ratexp));
}
function Vz(n) {
  var t = n.x, e = n.y;
  return n.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * e + _i), this.C) * EC(this.e * Math.sin(e), this.ratexp)) - Wt, n.x = this.C * t, n;
}
function Yz(n) {
  for (var t = 1e-14, e = n.x / this.C, a = n.y, s = Math.pow(Math.tan(0.5 * a + _i) / this.K, 1 / this.C), l = Bz; l > 0 && (a = 2 * Math.atan(s * EC(this.e * Math.sin(n.y), -0.5 * this.e)) - Wt, !(Math.abs(a - n.y) < t)); --l)
    n.y = a;
  return l ? (n.x = e, n.y = a, n) : null;
}
const bC = {
  init: qz,
  forward: Vz,
  inverse: Yz
};
function Fz() {
  bC.init.apply(this), this.rc && (this.sinc0 = Math.sin(this.phic0), this.cosc0 = Math.cos(this.phic0), this.R2 = 2 * this.rc, this.title || (this.title = "Oblique Stereographic Alternative"));
}
function $z(n) {
  var t, e, a, s;
  return n.x = ue(n.x - this.long0), bC.forward.apply(this, [n]), t = Math.sin(n.y), e = Math.cos(n.y), a = Math.cos(n.x), s = this.k0 * this.R2 / (1 + this.sinc0 * t + this.cosc0 * e * a), n.x = s * e * Math.sin(n.x), n.y = s * (this.cosc0 * t - this.sinc0 * e * a), n.x = this.a * n.x + this.x0, n.y = this.a * n.y + this.y0, n;
}
function Xz(n) {
  var t, e, a, s, l;
  if (n.x = (n.x - this.x0) / this.a, n.y = (n.y - this.y0) / this.a, n.x /= this.k0, n.y /= this.k0, l = fl(n.x, n.y)) {
    var f = 2 * Math.atan2(l, this.R2);
    t = Math.sin(f), e = Math.cos(f), s = Math.asin(e * this.sinc0 + n.y * t * this.cosc0 / l), a = Math.atan2(n.x * t, l * this.cosc0 * e - n.y * this.sinc0 * t);
  } else
    s = this.phic0, a = 0;
  return n.x = a, n.y = s, bC.inverse.apply(this, [n]), n.x = ue(n.x + this.long0), n;
}
var Kz = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
const Zz = {
  init: Fz,
  forward: $z,
  inverse: Xz,
  names: Kz
};
function SC(n, t, e) {
  return t *= e, Math.tan(0.5 * (Wt + n)) * Math.pow((1 - t) / (1 + t), 0.5 * e);
}
function Wz() {
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= se && (this.k0 = 0.5 * (1 + xS(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= se && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= se && Math.abs(Math.cos(this.lat_ts)) > se && (this.k0 = 0.5 * this.cons * ud(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Lf(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = ud(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(SC(this.lat0, this.sinlat0, this.e)) - Wt, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
}
function Qz(n) {
  var t = n.x, e = n.y, a = Math.sin(e), s = Math.cos(e), l, f, h, p, y, b, x = ue(t - this.long0);
  return Math.abs(Math.abs(t - this.long0) - Math.PI) <= se && Math.abs(e + this.lat0) <= se ? (n.x = NaN, n.y = NaN, n) : this.sphere ? (l = 2 * this.k0 / (1 + this.sinlat0 * a + this.coslat0 * s * Math.cos(x)), n.x = this.a * l * s * Math.sin(x) + this.x0, n.y = this.a * l * (this.coslat0 * a - this.sinlat0 * s * Math.cos(x)) + this.y0, n) : (f = 2 * Math.atan(SC(e, a, this.e)) - Wt, p = Math.cos(f), h = Math.sin(f), Math.abs(this.coslat0) <= se ? (y = Lf(this.e, e * this.con, this.con * a), b = 2 * this.a * this.k0 * y / this.cons, n.x = this.x0 + b * Math.sin(t - this.long0), n.y = this.y0 - this.con * b * Math.cos(t - this.long0), n) : (Math.abs(this.sinlat0) < se ? (l = 2 * this.a * this.k0 / (1 + p * Math.cos(x)), n.y = l * h) : (l = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * h + this.cosX0 * p * Math.cos(x))), n.y = l * (this.cosX0 * h - this.sinX0 * p * Math.cos(x)) + this.y0), n.x = l * p * Math.sin(x) + this.x0, n));
}
function Jz(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t, e, a, s, l, f = Math.sqrt(n.x * n.x + n.y * n.y);
  if (this.sphere) {
    var h = 2 * Math.atan(f / (2 * this.a * this.k0));
    return t = this.long0, e = this.lat0, f <= se ? (n.x = t, n.y = e, n) : (e = Math.asin(Math.cos(h) * this.sinlat0 + n.y * Math.sin(h) * this.coslat0 / f), Math.abs(this.coslat0) < se ? this.lat0 > 0 ? t = ue(this.long0 + Math.atan2(n.x, -1 * n.y)) : t = ue(this.long0 + Math.atan2(n.x, n.y)) : t = ue(this.long0 + Math.atan2(n.x * Math.sin(h), f * this.coslat0 * Math.cos(h) - n.y * this.sinlat0 * Math.sin(h))), n.x = t, n.y = e, n);
  } else if (Math.abs(this.coslat0) <= se) {
    if (f <= se)
      return e = this.lat0, t = this.long0, n.x = t, n.y = e, n;
    n.x *= this.con, n.y *= this.con, a = f * this.cons / (2 * this.a * this.k0), e = this.con * nS(this.e, a), t = this.con * ue(this.con * this.long0 + Math.atan2(n.x, -1 * n.y));
  } else
    s = 2 * Math.atan(f * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), t = this.long0, f <= se ? l = this.X0 : (l = Math.asin(Math.cos(s) * this.sinX0 + n.y * Math.sin(s) * this.cosX0 / f), t = ue(this.long0 + Math.atan2(n.x * Math.sin(s), f * this.cosX0 * Math.cos(s) - n.y * this.sinX0 * Math.sin(s)))), e = -1 * nS(this.e, Math.tan(0.5 * (Wt + l)));
  return n.x = t, n.y = e, n;
}
var tG = ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"];
const eG = {
  init: Wz,
  forward: Qz,
  inverse: Jz,
  names: tG,
  ssfn_: SC
};
function nG() {
  var n = this.lat0;
  this.lambda0 = this.long0;
  var t = Math.sin(n), e = this.a, a = this.rf, s = 1 / a, l = 2 * s - Math.pow(s, 2), f = this.e = Math.sqrt(l);
  this.R = this.k0 * e * Math.sqrt(1 - l) / (1 - l * Math.pow(t, 2)), this.alpha = Math.sqrt(1 + l / (1 - l) * Math.pow(Math.cos(n), 4)), this.b0 = Math.asin(t / this.alpha);
  var h = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)), p = Math.log(Math.tan(Math.PI / 4 + n / 2)), y = Math.log((1 + f * t) / (1 - f * t));
  this.K = h - this.alpha * p + this.alpha * f / 2 * y;
}
function iG(n) {
  var t = Math.log(Math.tan(Math.PI / 4 - n.y / 2)), e = this.e / 2 * Math.log((1 + this.e * Math.sin(n.y)) / (1 - this.e * Math.sin(n.y))), a = -this.alpha * (t + e) + this.K, s = 2 * (Math.atan(Math.exp(a)) - Math.PI / 4), l = this.alpha * (n.x - this.lambda0), f = Math.atan(Math.sin(l) / (Math.sin(this.b0) * Math.tan(s) + Math.cos(this.b0) * Math.cos(l))), h = Math.asin(Math.cos(this.b0) * Math.sin(s) - Math.sin(this.b0) * Math.cos(s) * Math.cos(l));
  return n.y = this.R / 2 * Math.log((1 + Math.sin(h)) / (1 - Math.sin(h))) + this.y0, n.x = this.R * f + this.x0, n;
}
function aG(n) {
  for (var t = n.x - this.x0, e = n.y - this.y0, a = t / this.R, s = 2 * (Math.atan(Math.exp(e / this.R)) - Math.PI / 4), l = Math.asin(Math.cos(this.b0) * Math.sin(s) + Math.sin(this.b0) * Math.cos(s) * Math.cos(a)), f = Math.atan(Math.sin(a) / (Math.cos(this.b0) * Math.cos(a) - Math.sin(this.b0) * Math.tan(s))), h = this.lambda0 + f / this.alpha, p = 0, y = l, b = -1e3, x = 0; Math.abs(y - b) > 1e-7; ) {
    if (++x > 20)
      return;
    p = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + l / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(y)) / 2)), b = y, y = 2 * Math.atan(Math.exp(p)) - Math.PI / 2;
  }
  return n.x = h, n.y = y, n;
}
var rG = ["somerc"];
const sG = {
  init: nG,
  forward: iG,
  inverse: aG,
  names: rG
};
var M1 = 1e-7;
function oG(n) {
  var t = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], e = typeof n.projName == "object" ? Object.keys(n.projName)[0] : n.projName;
  return "no_uoff" in n || "no_off" in n || t.indexOf(e) !== -1 || t.indexOf(b8(e)) !== -1;
}
function lG() {
  var n, t, e, a, s, l, f, h, p, y, b = 0, x, w = 0, A = 0, C = 0, L = 0, N = 0, U = 0;
  this.no_off = oG(this), this.no_rot = "no_rot" in this;
  var k = !1;
  "alpha" in this && (k = !0);
  var H = !1;
  if ("rectified_grid_angle" in this && (H = !0), k && (U = this.alpha), H && (b = this.rectified_grid_angle), k || H)
    w = this.longc;
  else if (A = this.long1, L = this.lat1, C = this.long2, N = this.lat2, Math.abs(L - N) <= M1 || (n = Math.abs(L)) <= M1 || Math.abs(n - Wt) <= M1 || Math.abs(Math.abs(this.lat0) - Wt) <= M1 || Math.abs(Math.abs(N) - Wt) <= M1)
    throw new Error();
  var B = 1 - this.es;
  t = Math.sqrt(B), Math.abs(this.lat0) > se ? (h = Math.sin(this.lat0), e = Math.cos(this.lat0), n = 1 - this.es * h * h, this.B = e * e, this.B = Math.sqrt(1 + this.es * this.B * this.B / B), this.A = this.B * this.k0 * t / n, a = this.B * t / (e * Math.sqrt(n)), s = a * a - 1, s <= 0 ? s = 0 : (s = Math.sqrt(s), this.lat0 < 0 && (s = -s)), this.E = s += a, this.E *= Math.pow(Lf(this.e, this.lat0, h), this.B)) : (this.B = 1 / t, this.A = this.k0, this.E = a = s = 1), k || H ? (k ? (x = Math.asin(Math.sin(U) / a), H || (b = U)) : (x = b, U = Math.asin(a * Math.sin(x))), this.lam0 = w - Math.asin(0.5 * (s - 1 / s) * Math.tan(x)) / this.B) : (l = Math.pow(Lf(this.e, L, Math.sin(L)), this.B), f = Math.pow(Lf(this.e, N, Math.sin(N)), this.B), s = this.E / l, p = (f - l) / (f + l), y = this.E * this.E, y = (y - f * l) / (y + f * l), n = A - C, n < -Math.PI ? C -= tS : n > Math.PI && (C += tS), this.lam0 = ue(0.5 * (A + C) - Math.atan(y * Math.tan(0.5 * this.B * (A - C)) / p) / this.B), x = Math.atan(2 * Math.sin(this.B * ue(A - this.lam0)) / (s - 1 / s)), b = U = Math.asin(a * Math.sin(x))), this.singam = Math.sin(x), this.cosgam = Math.cos(x), this.sinrot = Math.sin(b), this.cosrot = Math.cos(b), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(a * a - 1) / Math.cos(U))), this.lat0 < 0 && (this.u_0 = -this.u_0)), s = 0.5 * x, this.v_pole_n = this.ArB * Math.log(Math.tan(_i - s)), this.v_pole_s = this.ArB * Math.log(Math.tan(_i + s));
}
function uG(n) {
  var t = {}, e, a, s, l, f, h, p, y;
  if (n.x = n.x - this.lam0, Math.abs(Math.abs(n.y) - Wt) > se) {
    if (f = this.E / Math.pow(Lf(this.e, n.y, Math.sin(n.y)), this.B), h = 1 / f, e = 0.5 * (f - h), a = 0.5 * (f + h), l = Math.sin(this.B * n.x), s = (e * this.singam - l * this.cosgam) / a, Math.abs(Math.abs(s) - 1) < se)
      throw new Error();
    y = 0.5 * this.ArB * Math.log((1 - s) / (1 + s)), h = Math.cos(this.B * n.x), Math.abs(h) < M1 ? p = this.A * n.x : p = this.ArB * Math.atan2(e * this.cosgam + l * this.singam, h);
  } else
    y = n.y > 0 ? this.v_pole_n : this.v_pole_s, p = this.ArB * n.y;
  return this.no_rot ? (t.x = p, t.y = y) : (p -= this.u_0, t.x = y * this.cosrot + p * this.sinrot, t.y = p * this.cosrot - y * this.sinrot), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
}
function cG(n) {
  var t, e, a, s, l, f, h, p = {};
  if (n.x = (n.x - this.x0) * (1 / this.a), n.y = (n.y - this.y0) * (1 / this.a), this.no_rot ? (e = n.y, t = n.x) : (e = n.x * this.cosrot - n.y * this.sinrot, t = n.y * this.cosrot + n.x * this.sinrot + this.u_0), a = Math.exp(-this.BrA * e), s = 0.5 * (a - 1 / a), l = 0.5 * (a + 1 / a), f = Math.sin(this.BrA * t), h = (f * this.cosgam + s * this.singam) / l, Math.abs(Math.abs(h) - 1) < se)
    p.x = 0, p.y = h < 0 ? -Wt : Wt;
  else {
    if (p.y = this.E / Math.sqrt((1 + h) / (1 - h)), p.y = nS(this.e, Math.pow(p.y, 1 / this.B)), p.y === 1 / 0)
      throw new Error();
    p.x = -this.rB * Math.atan2(s * this.cosgam - f * this.singam, Math.cos(this.BrA * t));
  }
  return p.x += this.lam0, p;
}
var fG = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
const hG = {
  init: lG,
  forward: uG,
  inverse: cG,
  names: fG
};
function dG() {
  if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < se)) {
    var n = this.b / this.a;
    this.e = Math.sqrt(1 - n * n);
    var t = Math.sin(this.lat1), e = Math.cos(this.lat1), a = ud(this.e, t, e), s = Lf(this.e, this.lat1, t), l = Math.sin(this.lat2), f = Math.cos(this.lat2), h = ud(this.e, l, f), p = Lf(this.e, this.lat2, l), y = Math.abs(Math.abs(this.lat0) - Wt) < se ? 0 : Lf(this.e, this.lat0, Math.sin(this.lat0));
    Math.abs(this.lat1 - this.lat2) > se ? this.ns = Math.log(a / h) / Math.log(s / p) : this.ns = t, isNaN(this.ns) && (this.ns = t), this.f0 = a / (this.ns * Math.pow(s, this.ns)), this.rh = this.a * this.f0 * Math.pow(y, this.ns), this.title || (this.title = "Lambert Conformal Conic");
  }
}
function gG(n) {
  var t = n.x, e = n.y;
  Math.abs(2 * Math.abs(e) - Math.PI) <= se && (e = xS(e) * (Wt - 2 * se));
  var a = Math.abs(Math.abs(e) - Wt), s, l;
  if (a > se)
    s = Lf(this.e, e, Math.sin(e)), l = this.a * this.f0 * Math.pow(s, this.ns);
  else {
    if (a = e * this.ns, a <= 0)
      return null;
    l = 0;
  }
  var f = this.ns * ue(t - this.long0);
  return n.x = this.k0 * (l * Math.sin(f)) + this.x0, n.y = this.k0 * (this.rh - l * Math.cos(f)) + this.y0, n;
}
function mG(n) {
  var t, e, a, s, l, f = (n.x - this.x0) / this.k0, h = this.rh - (n.y - this.y0) / this.k0;
  this.ns > 0 ? (t = Math.sqrt(f * f + h * h), e = 1) : (t = -Math.sqrt(f * f + h * h), e = -1);
  var p = 0;
  if (t !== 0 && (p = Math.atan2(e * f, e * h)), t !== 0 || this.ns > 0) {
    if (e = 1 / this.ns, a = Math.pow(t / (this.a * this.f0), e), s = nS(this.e, a), s === -9999)
      return null;
  } else
    s = -Wt;
  return l = ue(p / this.ns + this.long0), n.x = l, n.y = s, n;
}
var pG = [
  "Lambert Tangential Conformal Conic Projection",
  "Lambert_Conformal_Conic",
  "Lambert_Conformal_Conic_1SP",
  "Lambert_Conformal_Conic_2SP",
  "lcc",
  "Lambert Conic Conformal (1SP)",
  "Lambert Conic Conformal (2SP)"
];
const yG = {
  init: dG,
  forward: gG,
  inverse: mG,
  names: pG
};
function _G() {
  this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.7417649320975901 - 0.308341501185665), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
}
function vG(n) {
  var t, e, a, s, l, f, h, p = n.x, y = n.y, b = ue(p - this.long0);
  return t = Math.pow((1 + this.e * Math.sin(y)) / (1 - this.e * Math.sin(y)), this.alfa * this.e / 2), e = 2 * (Math.atan(this.k * Math.pow(Math.tan(y / 2 + this.s45), this.alfa) / t) - this.s45), a = -b * this.alfa, s = Math.asin(Math.cos(this.ad) * Math.sin(e) + Math.sin(this.ad) * Math.cos(e) * Math.cos(a)), l = Math.asin(Math.cos(e) * Math.sin(a) / Math.cos(s)), f = this.n * l, h = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n), n.y = h * Math.cos(f) / 1, n.x = h * Math.sin(f) / 1, this.czech || (n.y *= -1, n.x *= -1), n;
}
function EG(n) {
  var t, e, a, s, l, f, h, p, y = n.x;
  n.x = n.y, n.y = y, this.czech || (n.y *= -1, n.x *= -1), f = Math.sqrt(n.x * n.x + n.y * n.y), l = Math.atan2(n.y, n.x), s = l / Math.sin(this.s0), a = 2 * (Math.atan(Math.pow(this.ro0 / f, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45), t = Math.asin(Math.cos(this.ad) * Math.sin(a) - Math.sin(this.ad) * Math.cos(a) * Math.cos(s)), e = Math.asin(Math.cos(a) * Math.sin(s) / Math.cos(t)), n.x = this.long0 - e / this.alfa, h = t, p = 0;
  var b = 0;
  do
    n.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(t / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(h)) / (1 - this.e * Math.sin(h)), this.e / 2)) - this.s45), Math.abs(h - n.y) < 1e-10 && (p = 1), h = n.y, b += 1;
  while (p === 0 && b < 15);
  return b >= 15 ? null : n;
}
var bG = ["Krovak", "krovak"];
const SG = {
  init: _G,
  forward: vG,
  inverse: EG,
  names: bG
};
function Oo(n, t, e, a, s) {
  return n * s - t * Math.sin(2 * s) + e * Math.sin(4 * s) - a * Math.sin(6 * s);
}
function TS(n) {
  return 1 - 0.25 * n * (1 + n / 16 * (3 + 1.25 * n));
}
function wS(n) {
  return 0.375 * n * (1 + 0.25 * n * (1 + 0.46875 * n));
}
function RS(n) {
  return 0.05859375 * n * n * (1 + 0.75 * n);
}
function AS(n) {
  return n * n * n * (35 / 3072);
}
function xC(n, t, e) {
  var a = t * e;
  return n / Math.sqrt(1 - a * a);
}
function O0(n) {
  return Math.abs(n) < Wt ? n : n - xS(n) * Math.PI;
}
function zT(n, t, e, a, s) {
  var l, f;
  l = n / t;
  for (var h = 0; h < 15; h++)
    if (f = (n - (t * l - e * Math.sin(2 * l) + a * Math.sin(4 * l) - s * Math.sin(6 * l))) / (t - 2 * e * Math.cos(2 * l) + 4 * a * Math.cos(4 * l) - 6 * s * Math.cos(6 * l)), l += f, Math.abs(f) <= 1e-10)
      return l;
  return NaN;
}
function xG() {
  this.sphere || (this.e0 = TS(this.es), this.e1 = wS(this.es), this.e2 = RS(this.es), this.e3 = AS(this.es), this.ml0 = this.a * Oo(this.e0, this.e1, this.e2, this.e3, this.lat0));
}
function TG(n) {
  var t, e, a = n.x, s = n.y;
  if (a = ue(a - this.long0), this.sphere)
    t = this.a * Math.asin(Math.cos(s) * Math.sin(a)), e = this.a * (Math.atan2(Math.tan(s), Math.cos(a)) - this.lat0);
  else {
    var l = Math.sin(s), f = Math.cos(s), h = xC(this.a, this.e, l), p = Math.tan(s) * Math.tan(s), y = a * Math.cos(s), b = y * y, x = this.es * f * f / (1 - this.es), w = this.a * Oo(this.e0, this.e1, this.e2, this.e3, s);
    t = h * y * (1 - b * p * (1 / 6 - (8 - p + 8 * x) * b / 120)), e = w - this.ml0 + h * l / f * b * (0.5 + (5 - p + 6 * x) * b / 24);
  }
  return n.x = t + this.x0, n.y = e + this.y0, n;
}
function wG(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t = n.x / this.a, e = n.y / this.a, a, s;
  if (this.sphere) {
    var l = e + this.lat0;
    a = Math.asin(Math.sin(l) * Math.cos(t)), s = Math.atan2(Math.tan(t), Math.cos(l));
  } else {
    var f = this.ml0 / this.a + e, h = zT(f, this.e0, this.e1, this.e2, this.e3);
    if (Math.abs(Math.abs(h) - Wt) <= se)
      return n.x = this.long0, n.y = Wt, e < 0 && (n.y *= -1), n;
    var p = xC(this.a, this.e, Math.sin(h)), y = p * p * p / this.a / this.a * (1 - this.es), b = Math.pow(Math.tan(h), 2), x = t * this.a / p, w = x * x;
    a = h - p * Math.tan(h) / y * x * x * (0.5 - (1 + 3 * b) * x * x / 24), s = x * (1 - w * (b / 3 + (1 + 3 * b) * b * w / 15)) / Math.cos(h);
  }
  return n.x = ue(s + this.long0), n.y = O0(a), n;
}
var RG = ["Cassini", "Cassini_Soldner", "cass"];
const AG = {
  init: xG,
  forward: TG,
  inverse: wG,
  names: RG
};
function _0(n, t) {
  var e;
  return n > 1e-7 ? (e = n * t, (1 - n * n) * (t / (1 - e * e) - 0.5 / n * Math.log((1 - e) / (1 + e)))) : 2 * t;
}
var wM = 1, RM = 2, AM = 3, pT = 4;
function MG() {
  var n = Math.abs(this.lat0);
  if (Math.abs(n - Wt) < se ? this.mode = this.lat0 < 0 ? wM : RM : Math.abs(n) < se ? this.mode = AM : this.mode = pT, this.es > 0) {
    var t;
    switch (this.qp = _0(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = GG(this.es), this.mode) {
      case RM:
        this.dd = 1;
        break;
      case wM:
        this.dd = 1;
        break;
      case AM:
        this.rq = Math.sqrt(0.5 * this.qp), this.dd = 1 / this.rq, this.xmf = 1, this.ymf = 0.5 * this.qp;
        break;
      case pT:
        this.rq = Math.sqrt(0.5 * this.qp), t = Math.sin(this.lat0), this.sinb1 = _0(this.e, t) / this.qp, this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1), this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * t * t) * this.rq * this.cosb1), this.ymf = (this.xmf = this.rq) / this.dd, this.xmf *= this.dd;
        break;
    }
  } else
    this.mode === pT && (this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0));
}
function CG(n) {
  var t, e, a, s, l, f, h, p, y, b, x = n.x, w = n.y;
  if (x = ue(x - this.long0), this.sphere) {
    if (l = Math.sin(w), b = Math.cos(w), a = Math.cos(x), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      if (e = this.mode === this.EQUIT ? 1 + b * a : 1 + this.sinph0 * l + this.cosph0 * b * a, e <= se)
        return null;
      e = Math.sqrt(2 / e), t = e * b * Math.sin(x), e *= this.mode === this.EQUIT ? l : this.cosph0 * l - this.sinph0 * b * a;
    } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
      if (this.mode === this.N_POLE && (a = -a), Math.abs(w + this.lat0) < se)
        return null;
      e = _i - w * 0.5, e = 2 * (this.mode === this.S_POLE ? Math.cos(e) : Math.sin(e)), t = e * Math.sin(x), e *= a;
    }
  } else {
    switch (h = 0, p = 0, y = 0, a = Math.cos(x), s = Math.sin(x), l = Math.sin(w), f = _0(this.e, l), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (h = f / this.qp, p = Math.sqrt(1 - h * h)), this.mode) {
      case this.OBLIQ:
        y = 1 + this.sinb1 * h + this.cosb1 * p * a;
        break;
      case this.EQUIT:
        y = 1 + p * a;
        break;
      case this.N_POLE:
        y = Wt + w, f = this.qp - f;
        break;
      case this.S_POLE:
        y = w - Wt, f = this.qp + f;
        break;
    }
    if (Math.abs(y) < se)
      return null;
    switch (this.mode) {
      case this.OBLIQ:
      case this.EQUIT:
        y = Math.sqrt(2 / y), this.mode === this.OBLIQ ? e = this.ymf * y * (this.cosb1 * h - this.sinb1 * p * a) : e = (y = Math.sqrt(2 / (1 + p * a))) * h * this.ymf, t = this.xmf * y * p * s;
        break;
      case this.N_POLE:
      case this.S_POLE:
        f >= 0 ? (t = (y = Math.sqrt(f)) * s, e = a * (this.mode === this.S_POLE ? y : -y)) : t = e = 0;
        break;
    }
  }
  return n.x = this.a * t + this.x0, n.y = this.a * e + this.y0, n;
}
function OG(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t = n.x / this.a, e = n.y / this.a, a, s, l, f, h, p, y;
  if (this.sphere) {
    var b = 0, x, w = 0;
    if (x = Math.sqrt(t * t + e * e), s = x * 0.5, s > 1)
      return null;
    switch (s = 2 * Math.asin(s), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (w = Math.sin(s), b = Math.cos(s)), this.mode) {
      case this.EQUIT:
        s = Math.abs(x) <= se ? 0 : Math.asin(e * w / x), t *= w, e = b * x;
        break;
      case this.OBLIQ:
        s = Math.abs(x) <= se ? this.lat0 : Math.asin(b * this.sinph0 + e * w * this.cosph0 / x), t *= w * this.cosph0, e = (b - Math.sin(s) * this.sinph0) * x;
        break;
      case this.N_POLE:
        e = -e, s = Wt - s;
        break;
      case this.S_POLE:
        s -= Wt;
        break;
    }
    a = e === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(t, e);
  } else {
    if (y = 0, this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      if (t /= this.dd, e *= this.dd, p = Math.sqrt(t * t + e * e), p < se)
        return n.x = this.long0, n.y = this.lat0, n;
      f = 2 * Math.asin(0.5 * p / this.rq), l = Math.cos(f), t *= f = Math.sin(f), this.mode === this.OBLIQ ? (y = l * this.sinb1 + e * f * this.cosb1 / p, h = this.qp * y, e = p * this.cosb1 * l - e * this.sinb1 * f) : (y = e * f / p, h = this.qp * y, e = p * l);
    } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
      if (this.mode === this.N_POLE && (e = -e), h = t * t + e * e, !h)
        return n.x = this.long0, n.y = this.lat0, n;
      y = 1 - h / this.qp, this.mode === this.S_POLE && (y = -y);
    }
    a = Math.atan2(t, e), s = UG(Math.asin(y), this.apa);
  }
  return n.x = ue(this.long0 + a), n.y = s, n;
}
var DG = 0.3333333333333333, NG = 0.17222222222222222, LG = 0.10257936507936508, IG = 0.06388888888888888, PG = 0.0664021164021164, zG = 0.016415012942191543;
function GG(n) {
  var t, e = [];
  return e[0] = n * DG, t = n * n, e[0] += t * NG, e[1] = t * IG, t *= n, e[0] += t * LG, e[1] += t * PG, e[2] = t * zG, e;
}
function UG(n, t) {
  var e = n + n;
  return n + t[0] * Math.sin(e) + t[1] * Math.sin(e + e) + t[2] * Math.sin(e + e + e);
}
var jG = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
const kG = {
  init: MG,
  forward: CG,
  inverse: OG,
  names: jG,
  S_POLE: wM,
  N_POLE: RM,
  EQUIT: AM,
  OBLIQ: pT
};
function x0(n) {
  return Math.abs(n) > 1 && (n = n > 1 ? 1 : -1), Math.asin(n);
}
function HG() {
  Math.abs(this.lat1 + this.lat2) < se || (this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e3 = Math.sqrt(this.es), this.sin_po = Math.sin(this.lat1), this.cos_po = Math.cos(this.lat1), this.t1 = this.sin_po, this.con = this.sin_po, this.ms1 = ud(this.e3, this.sin_po, this.cos_po), this.qs1 = _0(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat2), this.cos_po = Math.cos(this.lat2), this.t2 = this.sin_po, this.ms2 = ud(this.e3, this.sin_po, this.cos_po), this.qs2 = _0(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat0), this.cos_po = Math.cos(this.lat0), this.t3 = this.sin_po, this.qs0 = _0(this.e3, this.sin_po), Math.abs(this.lat1 - this.lat2) > se ? this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1) : this.ns0 = this.con, this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1, this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0);
}
function BG(n) {
  var t = n.x, e = n.y;
  this.sin_phi = Math.sin(e), this.cos_phi = Math.cos(e);
  var a = _0(this.e3, this.sin_phi), s = this.a * Math.sqrt(this.c - this.ns0 * a) / this.ns0, l = this.ns0 * ue(t - this.long0), f = s * Math.sin(l) + this.x0, h = this.rh - s * Math.cos(l) + this.y0;
  return n.x = f, n.y = h, n;
}
function qG(n) {
  var t, e, a, s, l, f;
  return n.x -= this.x0, n.y = this.rh - n.y + this.y0, this.ns0 >= 0 ? (t = Math.sqrt(n.x * n.x + n.y * n.y), a = 1) : (t = -Math.sqrt(n.x * n.x + n.y * n.y), a = -1), s = 0, t !== 0 && (s = Math.atan2(a * n.x, a * n.y)), a = t * this.ns0 / this.a, this.sphere ? f = Math.asin((this.c - a * a) / (2 * this.ns0)) : (e = (this.c - a * a) / this.ns0, f = this.phi1z(this.e3, e)), l = ue(s / this.ns0 + this.long0), n.x = l, n.y = f, n;
}
function VG(n, t) {
  var e, a, s, l, f, h = x0(0.5 * t);
  if (n < se)
    return h;
  for (var p = n * n, y = 1; y <= 25; y++)
    if (e = Math.sin(h), a = Math.cos(h), s = n * e, l = 1 - s * s, f = 0.5 * l * l / a * (t / (1 - p) - e / l + 0.5 / n * Math.log((1 - s) / (1 + s))), h = h + f, Math.abs(f) <= 1e-7)
      return h;
  return null;
}
var YG = ["Albers_Conic_Equal_Area", "Albers_Equal_Area", "Albers", "aea"];
const FG = {
  init: HG,
  forward: BG,
  inverse: qG,
  names: YG,
  phi1z: VG
};
function $G() {
  this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0), this.infinity_dist = 1e3 * this.a, this.rc = 1;
}
function XG(n) {
  var t, e, a, s, l, f, h, p, y = n.x, b = n.y;
  return a = ue(y - this.long0), t = Math.sin(b), e = Math.cos(b), s = Math.cos(a), f = this.sin_p14 * t + this.cos_p14 * e * s, l = 1, f > 0 || Math.abs(f) <= se ? (h = this.x0 + this.a * l * e * Math.sin(a) / f, p = this.y0 + this.a * l * (this.cos_p14 * t - this.sin_p14 * e * s) / f) : (h = this.x0 + this.infinity_dist * e * Math.sin(a), p = this.y0 + this.infinity_dist * (this.cos_p14 * t - this.sin_p14 * e * s)), n.x = h, n.y = p, n;
}
function KG(n) {
  var t, e, a, s, l, f;
  return n.x = (n.x - this.x0) / this.a, n.y = (n.y - this.y0) / this.a, n.x /= this.k0, n.y /= this.k0, (t = Math.sqrt(n.x * n.x + n.y * n.y)) ? (s = Math.atan2(t, this.rc), e = Math.sin(s), a = Math.cos(s), f = x0(a * this.sin_p14 + n.y * e * this.cos_p14 / t), l = Math.atan2(n.x * e, t * this.cos_p14 * a - n.y * this.sin_p14 * e), l = ue(this.long0 + l)) : (f = this.phic0, l = 0), n.x = l, n.y = f, n;
}
var ZG = ["gnom"];
const WG = {
  init: $G,
  forward: XG,
  inverse: KG,
  names: ZG
};
function QG(n, t) {
  var e = 1 - (1 - n * n) / (2 * n) * Math.log((1 - n) / (1 + n));
  if (Math.abs(Math.abs(t) - e) < 1e-6)
    return t < 0 ? -1 * Wt : Wt;
  for (var a = Math.asin(0.5 * t), s, l, f, h, p = 0; p < 30; p++)
    if (l = Math.sin(a), f = Math.cos(a), h = n * l, s = Math.pow(1 - h * h, 2) / (2 * f) * (t / (1 - n * n) - l / (1 - h * h) + 0.5 / n * Math.log((1 - h) / (1 + h))), a += s, Math.abs(s) <= 1e-10)
      return a;
  return NaN;
}
function JG() {
  this.sphere || (this.k0 = ud(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
}
function tU(n) {
  var t = n.x, e = n.y, a, s, l = ue(t - this.long0);
  if (this.sphere)
    a = this.x0 + this.a * l * Math.cos(this.lat_ts), s = this.y0 + this.a * Math.sin(e) / Math.cos(this.lat_ts);
  else {
    var f = _0(this.e, Math.sin(e));
    a = this.x0 + this.a * this.k0 * l, s = this.y0 + this.a * f * 0.5 / this.k0;
  }
  return n.x = a, n.y = s, n;
}
function eU(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t, e;
  return this.sphere ? (t = ue(this.long0 + n.x / this.a / Math.cos(this.lat_ts)), e = Math.asin(n.y / this.a * Math.cos(this.lat_ts))) : (e = QG(this.e, 2 * n.y * this.k0 / this.a), t = ue(this.long0 + n.x / (this.a * this.k0))), n.x = t, n.y = e, n;
}
var nU = ["cea"];
const iU = {
  init: JG,
  forward: tU,
  inverse: eU,
  names: nU
};
function aU() {
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
}
function rU(n) {
  var t = n.x, e = n.y, a = ue(t - this.long0), s = O0(e - this.lat0);
  return n.x = this.x0 + this.a * a * this.rc, n.y = this.y0 + this.a * s, n;
}
function sU(n) {
  var t = n.x, e = n.y;
  return n.x = ue(this.long0 + (t - this.x0) / (this.a * this.rc)), n.y = O0(this.lat0 + (e - this.y0) / this.a), n;
}
var oU = ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"];
const lU = {
  init: aU,
  forward: rU,
  inverse: sU,
  names: oU
};
var SD = 20;
function uU() {
  this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = TS(this.es), this.e1 = wS(this.es), this.e2 = RS(this.es), this.e3 = AS(this.es), this.ml0 = this.a * Oo(this.e0, this.e1, this.e2, this.e3, this.lat0);
}
function cU(n) {
  var t = n.x, e = n.y, a, s, l, f = ue(t - this.long0);
  if (l = f * Math.sin(e), this.sphere)
    Math.abs(e) <= se ? (a = this.a * f, s = -1 * this.a * this.lat0) : (a = this.a * Math.sin(l) / Math.tan(e), s = this.a * (O0(e - this.lat0) + (1 - Math.cos(l)) / Math.tan(e)));
  else if (Math.abs(e) <= se)
    a = this.a * f, s = -1 * this.ml0;
  else {
    var h = xC(this.a, this.e, Math.sin(e)) / Math.tan(e);
    a = h * Math.sin(l), s = this.a * Oo(this.e0, this.e1, this.e2, this.e3, e) - this.ml0 + h * (1 - Math.cos(l));
  }
  return n.x = a + this.x0, n.y = s + this.y0, n;
}
function fU(n) {
  var t, e, a, s, l, f, h, p, y;
  if (a = n.x - this.x0, s = n.y - this.y0, this.sphere)
    if (Math.abs(s + this.a * this.lat0) <= se)
      t = ue(a / this.a + this.long0), e = 0;
    else {
      f = this.lat0 + s / this.a, h = a * a / this.a / this.a + f * f, p = f;
      var b;
      for (l = SD; l; --l)
        if (b = Math.tan(p), y = -1 * (f * (p * b + 1) - p - 0.5 * (p * p + h) * b) / ((p - f) / b - 1), p += y, Math.abs(y) <= se) {
          e = p;
          break;
        }
      t = ue(this.long0 + Math.asin(a * Math.tan(p) / this.a) / Math.sin(e));
    }
  else if (Math.abs(s + this.ml0) <= se)
    e = 0, t = ue(this.long0 + a / this.a);
  else {
    f = (this.ml0 + s) / this.a, h = a * a / this.a / this.a + f * f, p = f;
    var x, w, A, C, L;
    for (l = SD; l; --l)
      if (L = this.e * Math.sin(p), x = Math.sqrt(1 - L * L) * Math.tan(p), w = this.a * Oo(this.e0, this.e1, this.e2, this.e3, p), A = this.e0 - 2 * this.e1 * Math.cos(2 * p) + 4 * this.e2 * Math.cos(4 * p) - 6 * this.e3 * Math.cos(6 * p), C = w / this.a, y = (f * (x * C + 1) - C - 0.5 * x * (C * C + h)) / (this.es * Math.sin(2 * p) * (C * C + h - 2 * f * C) / (4 * x) + (f - C) * (x * A - 2 / Math.sin(2 * p)) - A), p -= y, Math.abs(y) <= se) {
        e = p;
        break;
      }
    x = Math.sqrt(1 - this.es * Math.pow(Math.sin(e), 2)) * Math.tan(e), t = ue(this.long0 + Math.asin(a * x / this.a) / Math.sin(e));
  }
  return n.x = t, n.y = e, n;
}
var hU = ["Polyconic", "American_Polyconic", "poly"];
const dU = {
  init: uU,
  forward: cU,
  inverse: fU,
  names: hU
};
function gU() {
  this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
}
function mU(n) {
  var t, e = n.x, a = n.y, s = a - this.lat0, l = e - this.long0, f = s / kb * 1e-5, h = l, p = 1, y = 0;
  for (t = 1; t <= 10; t++)
    p = p * f, y = y + this.A[t] * p;
  var b = y, x = h, w = 1, A = 0, C, L, N = 0, U = 0;
  for (t = 1; t <= 6; t++)
    C = w * b - A * x, L = A * b + w * x, w = C, A = L, N = N + this.B_re[t] * w - this.B_im[t] * A, U = U + this.B_im[t] * w + this.B_re[t] * A;
  return n.x = U * this.a + this.x0, n.y = N * this.a + this.y0, n;
}
function pU(n) {
  var t, e = n.x, a = n.y, s = e - this.x0, l = a - this.y0, f = l / this.a, h = s / this.a, p = 1, y = 0, b, x, w = 0, A = 0;
  for (t = 1; t <= 6; t++)
    b = p * f - y * h, x = y * f + p * h, p = b, y = x, w = w + this.C_re[t] * p - this.C_im[t] * y, A = A + this.C_im[t] * p + this.C_re[t] * y;
  for (var C = 0; C < this.iterations; C++) {
    var L = w, N = A, U, k, H = f, B = h;
    for (t = 2; t <= 6; t++)
      U = L * w - N * A, k = N * w + L * A, L = U, N = k, H = H + (t - 1) * (this.B_re[t] * L - this.B_im[t] * N), B = B + (t - 1) * (this.B_im[t] * L + this.B_re[t] * N);
    L = 1, N = 0;
    var z = this.B_re[1], Q = this.B_im[1];
    for (t = 2; t <= 6; t++)
      U = L * w - N * A, k = N * w + L * A, L = U, N = k, z = z + t * (this.B_re[t] * L - this.B_im[t] * N), Q = Q + t * (this.B_im[t] * L + this.B_re[t] * N);
    var et = z * z + Q * Q;
    w = (H * z + B * Q) / et, A = (B * z - H * Q) / et;
  }
  var ot = w, pt = A, ht = 1, Ct = 0;
  for (t = 1; t <= 9; t++)
    ht = ht * ot, Ct = Ct + this.D[t] * ht;
  var mt = this.lat0 + Ct * kb * 1e5, St = this.long0 + pt;
  return n.x = St, n.y = mt, n;
}
var yU = ["New_Zealand_Map_Grid", "nzmg"];
const _U = {
  init: gU,
  forward: mU,
  inverse: pU,
  names: yU
};
function vU() {
}
function EU(n) {
  var t = n.x, e = n.y, a = ue(t - this.long0), s = this.x0 + this.a * a, l = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + e / 2.5)) * 1.25;
  return n.x = s, n.y = l, n;
}
function bU(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t = ue(this.long0 + n.x / this.a), e = 2.5 * (Math.atan(Math.exp(0.8 * n.y / this.a)) - Math.PI / 4);
  return n.x = t, n.y = e, n;
}
var SU = ["Miller_Cylindrical", "mill"];
const xU = {
  init: vU,
  forward: EU,
  inverse: bU,
  names: SU
};
var TU = 20;
function wU() {
  this.sphere ? (this.n = 1, this.m = 0, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1)) : this.en = yC(this.es);
}
function RU(n) {
  var t, e, a = n.x, s = n.y;
  if (a = ue(a - this.long0), this.sphere) {
    if (!this.m)
      s = this.n !== 1 ? Math.asin(this.n * Math.sin(s)) : s;
    else
      for (var l = this.n * Math.sin(s), f = TU; f; --f) {
        var h = (this.m * s + Math.sin(s) - l) / (this.m + Math.cos(s));
        if (s -= h, Math.abs(h) < se)
          break;
      }
    t = this.a * this.C_x * a * (this.m + Math.cos(s)), e = this.a * this.C_y * s;
  } else {
    var p = Math.sin(s), y = Math.cos(s);
    e = this.a * gE(s, p, y, this.en), t = this.a * a * y / Math.sqrt(1 - this.es * p * p);
  }
  return n.x = t, n.y = e, n;
}
function AU(n) {
  var t, e, a, s;
  return n.x -= this.x0, a = n.x / this.a, n.y -= this.y0, t = n.y / this.a, this.sphere ? (t /= this.C_y, a = a / (this.C_x * (this.m + Math.cos(t))), this.m ? t = x0((this.m * t + Math.sin(t)) / this.n) : this.n !== 1 && (t = x0(Math.sin(t) / this.n)), a = ue(a + this.long0), t = O0(t)) : (t = _C(n.y / this.a, this.es, this.en), s = Math.abs(t), s < Wt ? (s = Math.sin(t), e = this.long0 + n.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(t)), a = ue(e)) : s - se < Wt && (a = this.long0)), n.x = a, n.y = t, n;
}
var MU = ["Sinusoidal", "sinu"];
const CU = {
  init: wU,
  forward: RU,
  inverse: AU,
  names: MU
};
function OU() {
}
function DU(n) {
  for (var t = n.x, e = n.y, a = ue(t - this.long0), s = e, l = Math.PI * Math.sin(e); ; ) {
    var f = -(s + Math.sin(s) - l) / (1 + Math.cos(s));
    if (s += f, Math.abs(f) < se)
      break;
  }
  s /= 2, Math.PI / 2 - Math.abs(e) < se && (a = 0);
  var h = 0.900316316158 * this.a * a * Math.cos(s) + this.x0, p = 1.4142135623731 * this.a * Math.sin(s) + this.y0;
  return n.x = h, n.y = p, n;
}
function NU(n) {
  var t, e;
  n.x -= this.x0, n.y -= this.y0, e = n.y / (1.4142135623731 * this.a), Math.abs(e) > 0.999999999999 && (e = 0.999999999999), t = Math.asin(e);
  var a = ue(this.long0 + n.x / (0.900316316158 * this.a * Math.cos(t)));
  a < -Math.PI && (a = -Math.PI), a > Math.PI && (a = Math.PI), e = (2 * t + Math.sin(2 * t)) / Math.PI, Math.abs(e) > 1 && (e = 1);
  var s = Math.asin(e);
  return n.x = a, n.y = s, n;
}
var LU = ["Mollweide", "moll"];
const IU = {
  init: OU,
  forward: DU,
  inverse: NU,
  names: LU
};
function PU() {
  Math.abs(this.lat1 + this.lat2) < se || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = TS(this.es), this.e1 = wS(this.es), this.e2 = RS(this.es), this.e3 = AS(this.es), this.sin_phi = Math.sin(this.lat1), this.cos_phi = Math.cos(this.lat1), this.ms1 = ud(this.e, this.sin_phi, this.cos_phi), this.ml1 = Oo(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < se ? this.ns = this.sin_phi : (this.sin_phi = Math.sin(this.lat2), this.cos_phi = Math.cos(this.lat2), this.ms2 = ud(this.e, this.sin_phi, this.cos_phi), this.ml2 = Oo(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = Oo(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
}
function zU(n) {
  var t = n.x, e = n.y, a;
  if (this.sphere)
    a = this.a * (this.g - e);
  else {
    var s = Oo(this.e0, this.e1, this.e2, this.e3, e);
    a = this.a * (this.g - s);
  }
  var l = this.ns * ue(t - this.long0), f = this.x0 + a * Math.sin(l), h = this.y0 + this.rh - a * Math.cos(l);
  return n.x = f, n.y = h, n;
}
function GU(n) {
  n.x -= this.x0, n.y = this.rh - n.y + this.y0;
  var t, e, a, s;
  this.ns >= 0 ? (e = Math.sqrt(n.x * n.x + n.y * n.y), t = 1) : (e = -Math.sqrt(n.x * n.x + n.y * n.y), t = -1);
  var l = 0;
  if (e !== 0 && (l = Math.atan2(t * n.x, t * n.y)), this.sphere)
    return s = ue(this.long0 + l / this.ns), a = O0(this.g - e / this.a), n.x = s, n.y = a, n;
  var f = this.g - e / this.a;
  return a = zT(f, this.e0, this.e1, this.e2, this.e3), s = ue(this.long0 + l / this.ns), n.x = s, n.y = a, n;
}
var UU = ["Equidistant_Conic", "eqdc"];
const jU = {
  init: PU,
  forward: zU,
  inverse: GU,
  names: UU
};
function kU() {
  this.R = this.a;
}
function HU(n) {
  var t = n.x, e = n.y, a = ue(t - this.long0), s, l;
  Math.abs(e) <= se && (s = this.x0 + this.R * a, l = this.y0);
  var f = x0(2 * Math.abs(e / Math.PI));
  (Math.abs(a) <= se || Math.abs(Math.abs(e) - Wt) <= se) && (s = this.x0, e >= 0 ? l = this.y0 + Math.PI * this.R * Math.tan(0.5 * f) : l = this.y0 + Math.PI * this.R * -Math.tan(0.5 * f));
  var h = 0.5 * Math.abs(Math.PI / a - a / Math.PI), p = h * h, y = Math.sin(f), b = Math.cos(f), x = b / (y + b - 1), w = x * x, A = x * (2 / y - 1), C = A * A, L = Math.PI * this.R * (h * (x - C) + Math.sqrt(p * (x - C) * (x - C) - (C + p) * (w - C))) / (C + p);
  a < 0 && (L = -L), s = this.x0 + L;
  var N = p + x;
  return L = Math.PI * this.R * (A * N - h * Math.sqrt((C + p) * (p + 1) - N * N)) / (C + p), e >= 0 ? l = this.y0 + L : l = this.y0 - L, n.x = s, n.y = l, n;
}
function BU(n) {
  var t, e, a, s, l, f, h, p, y, b, x, w, A;
  return n.x -= this.x0, n.y -= this.y0, x = Math.PI * this.R, a = n.x / x, s = n.y / x, l = a * a + s * s, f = -Math.abs(s) * (1 + l), h = f - 2 * s * s + a * a, p = -2 * f + 1 + 2 * s * s + l * l, A = s * s / p + (2 * h * h * h / p / p / p - 9 * f * h / p / p) / 27, y = (f - h * h / 3 / p) / p, b = 2 * Math.sqrt(-y / 3), x = 3 * A / y / b, Math.abs(x) > 1 && (x >= 0 ? x = 1 : x = -1), w = Math.acos(x) / 3, n.y >= 0 ? e = (-b * Math.cos(w + Math.PI / 3) - h / 3 / p) * Math.PI : e = -(-b * Math.cos(w + Math.PI / 3) - h / 3 / p) * Math.PI, Math.abs(a) < se ? t = this.long0 : t = ue(this.long0 + Math.PI * (l - 1 + Math.sqrt(1 + 2 * (a * a - s * s) + l * l)) / 2 / a), n.x = t, n.y = e, n;
}
var qU = ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"];
const VU = {
  init: kU,
  forward: HU,
  inverse: BU,
  names: qU
};
function YU(n, t, e, a, s, l) {
  const f = a - t, h = Math.atan((1 - l) * Math.tan(n)), p = Math.atan((1 - l) * Math.tan(e)), y = Math.sin(h), b = Math.cos(h), x = Math.sin(p), w = Math.cos(p);
  let A = f, C, L = 100, N, U, k, H, B, z, Q, et, ot, pt, ht, Ct, mt, St;
  do {
    if (N = Math.sin(A), U = Math.cos(A), k = Math.sqrt(
      w * N * (w * N) + (b * x - y * w * U) * (b * x - y * w * U)
    ), k === 0)
      return { azi1: 0, s12: 0 };
    H = y * x + b * w * U, B = Math.atan2(k, H), z = b * w * N / k, Q = 1 - z * z, et = Q !== 0 ? H - 2 * y * x / Q : 0, ot = l / 16 * Q * (4 + l * (4 - 3 * Q)), C = A, A = f + (1 - ot) * l * z * (B + ot * k * (et + ot * H * (-1 + 2 * et * et)));
  } while (Math.abs(A - C) > 1e-12 && --L > 0);
  return L === 0 ? { azi1: NaN, s12: NaN } : (pt = Q * (s * s - s * (1 - l) * (s * (1 - l))) / (s * (1 - l) * (s * (1 - l))), ht = 1 + pt / 16384 * (4096 + pt * (-768 + pt * (320 - 175 * pt))), Ct = pt / 1024 * (256 + pt * (-128 + pt * (74 - 47 * pt))), mt = Ct * k * (et + Ct / 4 * (H * (-1 + 2 * et * et) - Ct / 6 * et * (-3 + 4 * k * k) * (-3 + 4 * et * et))), St = s * (1 - l) * ht * (B - mt), { azi1: Math.atan2(w * N, b * x - y * w * U), s12: St });
}
function FU(n, t, e, a, s, l) {
  const f = Math.atan((1 - l) * Math.tan(n)), h = Math.sin(f), p = Math.cos(f), y = Math.sin(e), b = Math.cos(e), x = Math.atan2(h, p * b), w = p * y, A = 1 - w * w, C = A * (s * s - s * (1 - l) * (s * (1 - l))) / (s * (1 - l) * (s * (1 - l))), L = 1 + C / 16384 * (4096 + C * (-768 + C * (320 - 175 * C))), N = C / 1024 * (256 + C * (-128 + C * (74 - 47 * C)));
  let U = a / (s * (1 - l) * L), k, H = 100, B, z, Q, et;
  do
    B = Math.cos(2 * x + U), z = Math.sin(U), Q = Math.cos(U), et = N * z * (B + N / 4 * (Q * (-1 + 2 * B * B) - N / 6 * B * (-3 + 4 * z * z) * (-3 + 4 * B * B))), k = U, U = a / (s * (1 - l) * L) + et;
  while (Math.abs(U - k) > 1e-12 && --H > 0);
  if (H === 0)
    return { lat2: NaN, lon2: NaN };
  const ot = h * z - p * Q * b, pt = Math.atan2(
    h * Q + p * z * b,
    (1 - l) * Math.sqrt(w * w + ot * ot)
  ), ht = Math.atan2(
    z * y,
    p * Q - h * z * b
  ), Ct = l / 16 * A * (4 + l * (4 - 3 * A)), mt = ht - (1 - Ct) * l * w * (U + Ct * z * (B + Ct * Q * (-1 + 2 * B * B))), St = t + mt;
  return { lat2: pt, lon2: St };
}
function $U() {
  this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.f = this.es / (1 + Math.sqrt(1 - this.es));
}
function XU(n) {
  var t = n.x, e = n.y, a = Math.sin(n.y), s = Math.cos(n.y), l = ue(t - this.long0), f, h, p, y, b, x, w, A, C, L, N;
  return this.sphere ? Math.abs(this.sin_p12 - 1) <= se ? (n.x = this.x0 + this.a * (Wt - e) * Math.sin(l), n.y = this.y0 - this.a * (Wt - e) * Math.cos(l), n) : Math.abs(this.sin_p12 + 1) <= se ? (n.x = this.x0 + this.a * (Wt + e) * Math.sin(l), n.y = this.y0 + this.a * (Wt + e) * Math.cos(l), n) : (C = this.sin_p12 * a + this.cos_p12 * s * Math.cos(l), w = Math.acos(C), A = w ? w / Math.sin(w) : 1, n.x = this.x0 + this.a * A * s * Math.sin(l), n.y = this.y0 + this.a * A * (this.cos_p12 * a - this.sin_p12 * s * Math.cos(l)), n) : (f = TS(this.es), h = wS(this.es), p = RS(this.es), y = AS(this.es), Math.abs(this.sin_p12 - 1) <= se ? (b = this.a * Oo(f, h, p, y, Wt), x = this.a * Oo(f, h, p, y, e), n.x = this.x0 + (b - x) * Math.sin(l), n.y = this.y0 - (b - x) * Math.cos(l), n) : Math.abs(this.sin_p12 + 1) <= se ? (b = this.a * Oo(f, h, p, y, Wt), x = this.a * Oo(f, h, p, y, e), n.x = this.x0 + (b + x) * Math.sin(l), n.y = this.y0 + (b + x) * Math.cos(l), n) : Math.abs(t) < se && Math.abs(e - this.lat0) < se ? (n.x = n.y = 0, n) : (L = YU(this.lat0, this.long0, e, t, this.a, this.f), N = L.azi1, n.x = L.s12 * Math.sin(N), n.y = L.s12 * Math.cos(N), n));
}
function KU(n) {
  n.x -= this.x0, n.y -= this.y0;
  var t, e, a, s, l, f, h, p, y, b, x, w, A, C, L, N;
  return this.sphere ? (t = Math.sqrt(n.x * n.x + n.y * n.y), t > 2 * Wt * this.a ? void 0 : (e = t / this.a, a = Math.sin(e), s = Math.cos(e), l = this.long0, Math.abs(t) <= se ? f = this.lat0 : (f = x0(s * this.sin_p12 + n.y * a * this.cos_p12 / t), h = Math.abs(this.lat0) - Wt, Math.abs(h) <= se ? this.lat0 >= 0 ? l = ue(this.long0 + Math.atan2(n.x, -n.y)) : l = ue(this.long0 - Math.atan2(-n.x, n.y)) : l = ue(this.long0 + Math.atan2(n.x * a, t * this.cos_p12 * s - n.y * this.sin_p12 * a))), n.x = l, n.y = f, n)) : (p = TS(this.es), y = wS(this.es), b = RS(this.es), x = AS(this.es), Math.abs(this.sin_p12 - 1) <= se ? (w = this.a * Oo(p, y, b, x, Wt), t = Math.sqrt(n.x * n.x + n.y * n.y), A = w - t, f = zT(A / this.a, p, y, b, x), l = ue(this.long0 + Math.atan2(n.x, -1 * n.y)), n.x = l, n.y = f, n) : Math.abs(this.sin_p12 + 1) <= se ? (w = this.a * Oo(p, y, b, x, Wt), t = Math.sqrt(n.x * n.x + n.y * n.y), A = t - w, f = zT(A / this.a, p, y, b, x), l = ue(this.long0 + Math.atan2(n.x, n.y)), n.x = l, n.y = f, n) : (C = Math.atan2(n.x, n.y), L = Math.sqrt(n.x * n.x + n.y * n.y), N = FU(this.lat0, this.long0, C, L, this.a, this.f), n.x = N.lon2, n.y = N.lat2, n));
}
var ZU = ["Azimuthal_Equidistant", "aeqd"];
const WU = {
  init: $U,
  forward: XU,
  inverse: KU,
  names: ZU
};
function QU() {
  this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0);
}
function JU(n) {
  var t, e, a, s, l, f, h, p, y = n.x, b = n.y;
  return a = ue(y - this.long0), t = Math.sin(b), e = Math.cos(b), s = Math.cos(a), f = this.sin_p14 * t + this.cos_p14 * e * s, l = 1, (f > 0 || Math.abs(f) <= se) && (h = this.a * l * e * Math.sin(a), p = this.y0 + this.a * l * (this.cos_p14 * t - this.sin_p14 * e * s)), n.x = h, n.y = p, n;
}
function tj(n) {
  var t, e, a, s, l, f, h;
  return n.x -= this.x0, n.y -= this.y0, t = Math.sqrt(n.x * n.x + n.y * n.y), e = x0(t / this.a), a = Math.sin(e), s = Math.cos(e), f = this.long0, Math.abs(t) <= se ? (h = this.lat0, n.x = f, n.y = h, n) : (h = x0(s * this.sin_p14 + n.y * a * this.cos_p14 / t), l = Math.abs(this.lat0) - Wt, Math.abs(l) <= se ? (this.lat0 >= 0 ? f = ue(this.long0 + Math.atan2(n.x, -n.y)) : f = ue(this.long0 - Math.atan2(-n.x, n.y)), n.x = f, n.y = h, n) : (f = ue(this.long0 + Math.atan2(n.x * a, t * this.cos_p14 * s - n.y * this.sin_p14 * a)), n.x = f, n.y = h, n));
}
var ej = ["ortho"];
const nj = {
  init: QU,
  forward: JU,
  inverse: tj,
  names: ej
};
var Ta = {
  FRONT: 1,
  RIGHT: 2,
  BACK: 3,
  LEFT: 4,
  TOP: 5,
  BOTTOM: 6
}, vi = {
  AREA_0: 1,
  AREA_1: 2,
  AREA_2: 3,
  AREA_3: 4
};
function ij() {
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Quadrilateralized Spherical Cube", this.lat0 >= Wt - _i / 2 ? this.face = Ta.TOP : this.lat0 <= -(Wt - _i / 2) ? this.face = Ta.BOTTOM : Math.abs(this.long0) <= _i ? this.face = Ta.FRONT : Math.abs(this.long0) <= Wt + _i ? this.face = this.long0 > 0 ? Ta.RIGHT : Ta.LEFT : this.face = Ta.BACK, this.es !== 0 && (this.one_minus_f = 1 - (this.a - this.b) / this.a, this.one_minus_f_squared = this.one_minus_f * this.one_minus_f);
}
function aj(n) {
  var t = { x: 0, y: 0 }, e, a, s, l, f, h, p = { value: 0 };
  if (n.x -= this.long0, this.es !== 0 ? e = Math.atan(this.one_minus_f_squared * Math.tan(n.y)) : e = n.y, a = n.x, this.face === Ta.TOP)
    l = Wt - e, a >= _i && a <= Wt + _i ? (p.value = vi.AREA_0, s = a - Wt) : a > Wt + _i || a <= -(Wt + _i) ? (p.value = vi.AREA_1, s = a > 0 ? a - er : a + er) : a > -(Wt + _i) && a <= -_i ? (p.value = vi.AREA_2, s = a + Wt) : (p.value = vi.AREA_3, s = a);
  else if (this.face === Ta.BOTTOM)
    l = Wt + e, a >= _i && a <= Wt + _i ? (p.value = vi.AREA_0, s = -a + Wt) : a < _i && a >= -_i ? (p.value = vi.AREA_1, s = -a) : a < -_i && a >= -(Wt + _i) ? (p.value = vi.AREA_2, s = -a - Wt) : (p.value = vi.AREA_3, s = a > 0 ? -a + er : -a - er);
  else {
    var y, b, x, w, A, C, L;
    this.face === Ta.RIGHT ? a = Y1(a, +Wt) : this.face === Ta.BACK ? a = Y1(a, +er) : this.face === Ta.LEFT && (a = Y1(a, -Wt)), w = Math.sin(e), A = Math.cos(e), C = Math.sin(a), L = Math.cos(a), y = A * L, b = A * C, x = w, this.face === Ta.FRONT ? (l = Math.acos(y), s = jx(l, x, b, p)) : this.face === Ta.RIGHT ? (l = Math.acos(b), s = jx(l, x, -y, p)) : this.face === Ta.BACK ? (l = Math.acos(-y), s = jx(l, x, -b, p)) : this.face === Ta.LEFT ? (l = Math.acos(-b), s = jx(l, x, y, p)) : (l = s = 0, p.value = vi.AREA_0);
  }
  return h = Math.atan(12 / er * (s + Math.acos(Math.sin(s) * Math.cos(_i)) - Wt)), f = Math.sqrt((1 - Math.cos(l)) / (Math.cos(h) * Math.cos(h)) / (1 - Math.cos(Math.atan(1 / Math.cos(s))))), p.value === vi.AREA_1 ? h += Wt : p.value === vi.AREA_2 ? h += er : p.value === vi.AREA_3 && (h += 1.5 * er), t.x = f * Math.cos(h), t.y = f * Math.sin(h), t.x = t.x * this.a + this.x0, t.y = t.y * this.a + this.y0, n.x = t.x, n.y = t.y, n;
}
function rj(n) {
  var t = { lam: 0, phi: 0 }, e, a, s, l, f, h, p, y, b, x = { value: 0 };
  if (n.x = (n.x - this.x0) / this.a, n.y = (n.y - this.y0) / this.a, a = Math.atan(Math.sqrt(n.x * n.x + n.y * n.y)), e = Math.atan2(n.y, n.x), n.x >= 0 && n.x >= Math.abs(n.y) ? x.value = vi.AREA_0 : n.y >= 0 && n.y >= Math.abs(n.x) ? (x.value = vi.AREA_1, e -= Wt) : n.x < 0 && -n.x >= Math.abs(n.y) ? (x.value = vi.AREA_2, e = e < 0 ? e + er : e - er) : (x.value = vi.AREA_3, e += Wt), b = er / 12 * Math.tan(e), f = Math.sin(b) / (Math.cos(b) - 1 / Math.sqrt(2)), h = Math.atan(f), s = Math.cos(e), l = Math.tan(a), p = 1 - s * s * l * l * (1 - Math.cos(Math.atan(1 / Math.cos(h)))), p < -1 ? p = -1 : p > 1 && (p = 1), this.face === Ta.TOP)
    y = Math.acos(p), t.phi = Wt - y, x.value === vi.AREA_0 ? t.lam = h + Wt : x.value === vi.AREA_1 ? t.lam = h < 0 ? h + er : h - er : x.value === vi.AREA_2 ? t.lam = h - Wt : t.lam = h;
  else if (this.face === Ta.BOTTOM)
    y = Math.acos(p), t.phi = y - Wt, x.value === vi.AREA_0 ? t.lam = -h + Wt : x.value === vi.AREA_1 ? t.lam = -h : x.value === vi.AREA_2 ? t.lam = -h - Wt : t.lam = h < 0 ? -h - er : -h + er;
  else {
    var w, A, C;
    w = p, b = w * w, b >= 1 ? C = 0 : C = Math.sqrt(1 - b) * Math.sin(h), b += C * C, b >= 1 ? A = 0 : A = Math.sqrt(1 - b), x.value === vi.AREA_1 ? (b = A, A = -C, C = b) : x.value === vi.AREA_2 ? (A = -A, C = -C) : x.value === vi.AREA_3 && (b = A, A = C, C = -b), this.face === Ta.RIGHT ? (b = w, w = -A, A = b) : this.face === Ta.BACK ? (w = -w, A = -A) : this.face === Ta.LEFT && (b = w, w = A, A = -b), t.phi = Math.acos(-C) - Wt, t.lam = Math.atan2(A, w), this.face === Ta.RIGHT ? t.lam = Y1(t.lam, -Wt) : this.face === Ta.BACK ? t.lam = Y1(t.lam, -er) : this.face === Ta.LEFT && (t.lam = Y1(t.lam, +Wt));
  }
  if (this.es !== 0) {
    var L, N, U;
    L = t.phi < 0 ? 1 : 0, N = Math.tan(t.phi), U = this.b / Math.sqrt(N * N + this.one_minus_f_squared), t.phi = Math.atan(Math.sqrt(this.a * this.a - U * U) / (this.one_minus_f * U)), L && (t.phi = -t.phi);
  }
  return t.lam += this.long0, n.x = t.lam, n.y = t.phi, n;
}
function jx(n, t, e, a) {
  var s;
  return n < se ? (a.value = vi.AREA_0, s = 0) : (s = Math.atan2(t, e), Math.abs(s) <= _i ? a.value = vi.AREA_0 : s > _i && s <= Wt + _i ? (a.value = vi.AREA_1, s -= Wt) : s > Wt + _i || s <= -(Wt + _i) ? (a.value = vi.AREA_2, s = s >= 0 ? s - er : s + er) : (a.value = vi.AREA_3, s += Wt)), s;
}
function Y1(n, t) {
  var e = n + t;
  return e < -er ? e += tS : e > +er && (e -= tS), e;
}
var sj = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
const oj = {
  init: ij,
  forward: aj,
  inverse: rj,
  names: sj
};
var MM = [
  [1, 22199e-21, -715515e-10, 31103e-10],
  [0.9986, -482243e-9, -24897e-9, -13309e-10],
  [0.9954, -83103e-8, -448605e-10, -986701e-12],
  [0.99, -135364e-8, -59661e-9, 36777e-10],
  [0.9822, -167442e-8, -449547e-11, -572411e-11],
  [0.973, -214868e-8, -903571e-10, 18736e-12],
  [0.96, -305085e-8, -900761e-10, 164917e-11],
  [0.9427, -382792e-8, -653386e-10, -26154e-10],
  [0.9216, -467746e-8, -10457e-8, 481243e-11],
  [0.8962, -536223e-8, -323831e-10, -543432e-11],
  [0.8679, -609363e-8, -113898e-9, 332484e-11],
  [0.835, -698325e-8, -640253e-10, 934959e-12],
  [0.7986, -755338e-8, -500009e-10, 935324e-12],
  [0.7597, -798324e-8, -35971e-9, -227626e-11],
  [0.7186, -851367e-8, -701149e-10, -86303e-10],
  [0.6732, -986209e-8, -199569e-9, 191974e-10],
  [0.6213, -0.010418, 883923e-10, 624051e-11],
  [0.5722, -906601e-8, 182e-6, 624051e-11],
  [0.5322, -677797e-8, 275608e-9, 624051e-11]
], Cb = [
  [-520417e-23, 0.0124, 121431e-23, -845284e-16],
  [0.062, 0.0124, -126793e-14, 422642e-15],
  [0.124, 0.0124, 507171e-14, -160604e-14],
  [0.186, 0.0123999, -190189e-13, 600152e-14],
  [0.248, 0.0124002, 710039e-13, -224e-10],
  [0.31, 0.0123992, -264997e-12, 835986e-13],
  [0.372, 0.0124029, 988983e-12, -311994e-12],
  [0.434, 0.0123893, -369093e-11, -435621e-12],
  [0.4958, 0.0123198, -102252e-10, -345523e-12],
  [0.5571, 0.0121916, -154081e-10, -582288e-12],
  [0.6176, 0.0119938, -241424e-10, -525327e-12],
  [0.6769, 0.011713, -320223e-10, -516405e-12],
  [0.7346, 0.0113541, -397684e-10, -609052e-12],
  [0.7903, 0.0109107, -489042e-10, -104739e-11],
  [0.8435, 0.0103431, -64615e-9, -140374e-14],
  [0.8936, 969686e-8, -64636e-9, -8547e-9],
  [0.9394, 840947e-8, -192841e-9, -42106e-10],
  [0.9761, 616527e-8, -256e-6, -42106e-10],
  [1, 328947e-8, -319159e-9, -42106e-10]
], I8 = 0.8487, P8 = 1.3523, z8 = ad / 5, lj = 1 / z8, H1 = 18, GT = function(n, t) {
  return n[0] + t * (n[1] + t * (n[2] + t * n[3]));
}, uj = function(n, t) {
  return n[1] + t * (2 * n[2] + t * 3 * n[3]);
};
function cj(n, t, e, a) {
  for (var s = t; a; --a) {
    var l = n(s);
    if (s -= l, Math.abs(l) < e)
      break;
  }
  return s;
}
function fj() {
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
}
function hj(n) {
  var t = ue(n.x - this.long0), e = Math.abs(n.y), a = Math.floor(e * z8);
  a < 0 ? a = 0 : a >= H1 && (a = H1 - 1), e = ad * (e - lj * a);
  var s = {
    x: GT(MM[a], e) * t,
    y: GT(Cb[a], e)
  };
  return n.y < 0 && (s.y = -s.y), s.x = s.x * this.a * I8 + this.x0, s.y = s.y * this.a * P8 + this.y0, s;
}
function dj(n) {
  var t = {
    x: (n.x - this.x0) / (this.a * I8),
    y: Math.abs(n.y - this.y0) / (this.a * P8)
  };
  if (t.y >= 1)
    t.x /= MM[H1][0], t.y = n.y < 0 ? -Wt : Wt;
  else {
    var e = Math.floor(t.y * H1);
    for (e < 0 ? e = 0 : e >= H1 && (e = H1 - 1); ; )
      if (Cb[e][0] > t.y)
        --e;
      else if (Cb[e + 1][0] <= t.y)
        ++e;
      else
        break;
    var a = Cb[e], s = 5 * (t.y - a[0]) / (Cb[e + 1][0] - a[0]);
    s = cj(function(l) {
      return (GT(a, l) - t.y) / uj(a, l);
    }, s, se, 100), t.x /= GT(MM[e], s), t.y = (5 * e + s) * Rs, n.y < 0 && (t.y = -t.y);
  }
  return t.x = ue(t.x + this.long0), t;
}
var gj = ["Robinson", "robin"];
const mj = {
  init: fj,
  forward: hj,
  inverse: dj,
  names: gj
};
function pj() {
  this.name = "geocent";
}
function yj(n) {
  var t = x8(n, this.es, this.a);
  return t;
}
function _j(n) {
  var t = T8(n, this.es, this.a, this.b);
  return t;
}
var vj = ["Geocentric", "geocentric", "geocent", "Geocent"];
const Ej = {
  init: pj,
  forward: yj,
  inverse: _j,
  names: vj
};
var to = {
  N_POLE: 0,
  S_POLE: 1,
  EQUIT: 2,
  OBLIQ: 3
}, mb = {
  h: { def: 1e5, num: !0 },
  // default is Karman line, no default in PROJ.7
  azi: { def: 0, num: !0, degrees: !0 },
  // default is North
  tilt: { def: 0, num: !0, degrees: !0 },
  // default is Nadir
  long0: { def: 0, num: !0 },
  // default is Greenwich, conversion to rad is automatic
  lat0: { def: 0, num: !0 }
  // default is Equator, conversion to rad is automatic
};
function bj() {
  if (Object.keys(mb).forEach((function(e) {
    if (typeof this[e] > "u")
      this[e] = mb[e].def;
    else {
      if (mb[e].num && isNaN(this[e]))
        throw new Error("Invalid parameter value, must be numeric " + e + " = " + this[e]);
      mb[e].num && (this[e] = parseFloat(this[e]));
    }
    mb[e].degrees && (this[e] = this[e] * Rs);
  }).bind(this)), Math.abs(Math.abs(this.lat0) - Wt) < se ? this.mode = this.lat0 < 0 ? to.S_POLE : to.N_POLE : Math.abs(this.lat0) < se ? this.mode = to.EQUIT : (this.mode = to.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10)
    throw new Error("Invalid height");
  this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
  var n = this.tilt, t = this.azi;
  this.cg = Math.cos(t), this.sg = Math.sin(t), this.cw = Math.cos(n), this.sw = Math.sin(n);
}
function Sj(n) {
  n.x -= this.long0;
  var t = Math.sin(n.y), e = Math.cos(n.y), a = Math.cos(n.x), s, l;
  switch (this.mode) {
    case to.OBLIQ:
      l = this.sinph0 * t + this.cosph0 * e * a;
      break;
    case to.EQUIT:
      l = e * a;
      break;
    case to.S_POLE:
      l = -t;
      break;
    case to.N_POLE:
      l = t;
      break;
  }
  switch (l = this.pn1 / (this.p - l), s = l * e * Math.sin(n.x), this.mode) {
    case to.OBLIQ:
      l *= this.cosph0 * t - this.sinph0 * e * a;
      break;
    case to.EQUIT:
      l *= t;
      break;
    case to.N_POLE:
      l *= -(e * a);
      break;
    case to.S_POLE:
      l *= e * a;
      break;
  }
  var f, h;
  return f = l * this.cg + s * this.sg, h = 1 / (f * this.sw * this.h1 + this.cw), s = (s * this.cg - l * this.sg) * this.cw * h, l = f * h, n.x = s * this.a, n.y = l * this.a, n;
}
function xj(n) {
  n.x /= this.a, n.y /= this.a;
  var t = { x: n.x, y: n.y }, e, a, s;
  s = 1 / (this.pn1 - n.y * this.sw), e = this.pn1 * n.x * s, a = this.pn1 * n.y * this.cw * s, n.x = e * this.cg + a * this.sg, n.y = a * this.cg - e * this.sg;
  var l = fl(n.x, n.y);
  if (Math.abs(l) < se)
    t.x = 0, t.y = n.y;
  else {
    var f, h;
    switch (h = 1 - l * l * this.pfact, h = (this.p - Math.sqrt(h)) / (this.pn1 / l + l / this.pn1), f = Math.sqrt(1 - h * h), this.mode) {
      case to.OBLIQ:
        t.y = Math.asin(f * this.sinph0 + n.y * h * this.cosph0 / l), n.y = (f - this.sinph0 * Math.sin(t.y)) * l, n.x *= h * this.cosph0;
        break;
      case to.EQUIT:
        t.y = Math.asin(n.y * h / l), n.y = f * l, n.x *= h;
        break;
      case to.N_POLE:
        t.y = Math.asin(f), n.y = -n.y;
        break;
      case to.S_POLE:
        t.y = -Math.asin(f);
        break;
    }
    t.x = Math.atan2(n.x, n.y);
  }
  return n.x = t.x + this.long0, n.y = t.y, n;
}
var Tj = ["Tilted_Perspective", "tpers"];
const wj = {
  init: bj,
  forward: Sj,
  inverse: xj,
  names: Tj
};
function Rj() {
  if (this.flip_axis = this.sweep === "x" ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
    throw new Error();
  if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, this.es !== 0) {
    var n = 1 - this.es, t = 1 / n;
    this.radius_p = Math.sqrt(n), this.radius_p2 = n, this.radius_p_inv2 = t, this.shape = "ellipse";
  } else
    this.radius_p = 1, this.radius_p2 = 1, this.radius_p_inv2 = 1, this.shape = "sphere";
  this.title || (this.title = "Geostationary Satellite View");
}
function Aj(n) {
  var t = n.x, e = n.y, a, s, l, f;
  if (t = t - this.long0, this.shape === "ellipse") {
    e = Math.atan(this.radius_p2 * Math.tan(e));
    var h = this.radius_p / fl(this.radius_p * Math.cos(e), Math.sin(e));
    if (s = h * Math.cos(t) * Math.cos(e), l = h * Math.sin(t) * Math.cos(e), f = h * Math.sin(e), (this.radius_g - s) * s - l * l - f * f * this.radius_p_inv2 < 0)
      return n.x = Number.NaN, n.y = Number.NaN, n;
    a = this.radius_g - s, this.flip_axis ? (n.x = this.radius_g_1 * Math.atan(l / fl(f, a)), n.y = this.radius_g_1 * Math.atan(f / a)) : (n.x = this.radius_g_1 * Math.atan(l / a), n.y = this.radius_g_1 * Math.atan(f / fl(l, a)));
  } else this.shape === "sphere" && (a = Math.cos(e), s = Math.cos(t) * a, l = Math.sin(t) * a, f = Math.sin(e), a = this.radius_g - s, this.flip_axis ? (n.x = this.radius_g_1 * Math.atan(l / fl(f, a)), n.y = this.radius_g_1 * Math.atan(f / a)) : (n.x = this.radius_g_1 * Math.atan(l / a), n.y = this.radius_g_1 * Math.atan(f / fl(l, a))));
  return n.x = n.x * this.a, n.y = n.y * this.a, n;
}
function Mj(n) {
  var t = -1, e = 0, a = 0, s, l, f, h;
  if (n.x = n.x / this.a, n.y = n.y / this.a, this.shape === "ellipse") {
    this.flip_axis ? (a = Math.tan(n.y / this.radius_g_1), e = Math.tan(n.x / this.radius_g_1) * fl(1, a)) : (e = Math.tan(n.x / this.radius_g_1), a = Math.tan(n.y / this.radius_g_1) * fl(1, e));
    var p = a / this.radius_p;
    if (s = e * e + p * p + t * t, l = 2 * this.radius_g * t, f = l * l - 4 * s * this.C, f < 0)
      return n.x = Number.NaN, n.y = Number.NaN, n;
    h = (-l - Math.sqrt(f)) / (2 * s), t = this.radius_g + h * t, e *= h, a *= h, n.x = Math.atan2(e, t), n.y = Math.atan(a * Math.cos(n.x) / t), n.y = Math.atan(this.radius_p_inv2 * Math.tan(n.y));
  } else if (this.shape === "sphere") {
    if (this.flip_axis ? (a = Math.tan(n.y / this.radius_g_1), e = Math.tan(n.x / this.radius_g_1) * Math.sqrt(1 + a * a)) : (e = Math.tan(n.x / this.radius_g_1), a = Math.tan(n.y / this.radius_g_1) * Math.sqrt(1 + e * e)), s = e * e + a * a + t * t, l = 2 * this.radius_g * t, f = l * l - 4 * s * this.C, f < 0)
      return n.x = Number.NaN, n.y = Number.NaN, n;
    h = (-l - Math.sqrt(f)) / (2 * s), t = this.radius_g + h * t, e *= h, a *= h, n.x = Math.atan2(e, t), n.y = Math.atan(a * Math.cos(n.x) / t);
  }
  return n.x = n.x + this.long0, n;
}
var Cj = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
const Oj = {
  init: Rj,
  forward: Aj,
  inverse: Mj,
  names: Cj
};
var Hb = 1.340264, Bb = -0.081106, qb = 893e-6, Vb = 3796e-6, UT = Math.sqrt(3) / 2;
function Dj() {
  this.es = 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0;
}
function Nj(n) {
  var t = ue(n.x - this.long0), e = n.y, a = Math.asin(UT * Math.sin(e)), s = a * a, l = s * s * s;
  return n.x = t * Math.cos(a) / (UT * (Hb + 3 * Bb * s + l * (7 * qb + 9 * Vb * s))), n.y = a * (Hb + Bb * s + l * (qb + Vb * s)), n.x = this.a * n.x + this.x0, n.y = this.a * n.y + this.y0, n;
}
function Lj(n) {
  n.x = (n.x - this.x0) / this.a, n.y = (n.y - this.y0) / this.a;
  var t = 1e-9, e = 12, a = n.y, s, l, f, h, p, y;
  for (y = 0; y < e && (s = a * a, l = s * s * s, f = a * (Hb + Bb * s + l * (qb + Vb * s)) - n.y, h = Hb + 3 * Bb * s + l * (7 * qb + 9 * Vb * s), a -= p = f / h, !(Math.abs(p) < t)); ++y)
    ;
  return s = a * a, l = s * s * s, n.x = UT * n.x * (Hb + 3 * Bb * s + l * (7 * qb + 9 * Vb * s)) / Math.cos(a), n.y = Math.asin(Math.sin(a) / UT), n.x = ue(n.x + this.long0), n;
}
var Ij = ["eqearth", "Equal Earth", "Equal_Earth"];
const Pj = {
  init: Dj,
  forward: Nj,
  inverse: Lj,
  names: Ij
};
var iS = 1e-10;
function zj() {
  var n;
  if (this.phi1 = this.lat1, Math.abs(this.phi1) < iS)
    throw new Error();
  this.es ? (this.en = yC(this.es), this.m1 = gE(
    this.phi1,
    this.am1 = Math.sin(this.phi1),
    n = Math.cos(this.phi1),
    this.en
  ), this.am1 = n / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = Uj, this.forward = Gj) : (Math.abs(this.phi1) + iS >= Wt ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = kj, this.forward = jj);
}
function Gj(n) {
  var t = ue(n.x - (this.long0 || 0)), e = n.y, a, s, l;
  return a = this.am1 + this.m1 - gE(e, s = Math.sin(e), l = Math.cos(e), this.en), s = l * t / (a * Math.sqrt(1 - this.es * s * s)), n.x = a * Math.sin(s), n.y = this.am1 - a * Math.cos(s), n.x = this.a * n.x + (this.x0 || 0), n.y = this.a * n.y + (this.y0 || 0), n;
}
function Uj(n) {
  n.x = (n.x - (this.x0 || 0)) / this.a, n.y = (n.y - (this.y0 || 0)) / this.a;
  var t, e, a, s;
  if (e = fl(n.x, n.y = this.am1 - n.y), s = _C(this.am1 + this.m1 - e, this.es, this.en), (t = Math.abs(s)) < Wt)
    t = Math.sin(s), a = e * Math.atan2(n.x, n.y) * Math.sqrt(1 - this.es * t * t) / Math.cos(s);
  else if (Math.abs(t - Wt) <= iS)
    a = 0;
  else
    throw new Error();
  return n.x = ue(a + (this.long0 || 0)), n.y = O0(s), n;
}
function jj(n) {
  var t = ue(n.x - (this.long0 || 0)), e = n.y, a, s;
  return s = this.cphi1 + this.phi1 - e, Math.abs(s) > iS ? (n.x = s * Math.sin(a = t * Math.cos(e) / s), n.y = this.cphi1 - s * Math.cos(a)) : n.x = n.y = 0, n.x = this.a * n.x + (this.x0 || 0), n.y = this.a * n.y + (this.y0 || 0), n;
}
function kj(n) {
  n.x = (n.x - (this.x0 || 0)) / this.a, n.y = (n.y - (this.y0 || 0)) / this.a;
  var t, e, a = fl(n.x, n.y = this.cphi1 - n.y);
  if (e = this.cphi1 + this.phi1 - a, Math.abs(e) > Wt)
    throw new Error();
  return Math.abs(Math.abs(e) - Wt) <= iS ? t = 0 : t = a * Math.atan2(n.x, n.y) / Math.cos(e), n.x = ue(t + (this.long0 || 0)), n.y = O0(e), n;
}
var Hj = ["bonne", "Bonne (Werner lat_1=90)"];
const Bj = {
  init: zj,
  names: Hj
};
function qj(n) {
  n.Proj.projections.add(gT), n.Proj.projections.add(mT), n.Proj.projections.add(Hz), n.Proj.projections.add(Zz), n.Proj.projections.add(eG), n.Proj.projections.add(sG), n.Proj.projections.add(hG), n.Proj.projections.add(yG), n.Proj.projections.add(SG), n.Proj.projections.add(AG), n.Proj.projections.add(kG), n.Proj.projections.add(FG), n.Proj.projections.add(WG), n.Proj.projections.add(iU), n.Proj.projections.add(lU), n.Proj.projections.add(dU), n.Proj.projections.add(_U), n.Proj.projections.add(xU), n.Proj.projections.add(CU), n.Proj.projections.add(IU), n.Proj.projections.add(jU), n.Proj.projections.add(VU), n.Proj.projections.add(WU), n.Proj.projections.add(nj), n.Proj.projections.add(oj), n.Proj.projections.add(mj), n.Proj.projections.add(Ej), n.Proj.projections.add(wj), n.Proj.projections.add(Oj), n.Proj.projections.add(Pj), n.Proj.projections.add(Bj);
}
const TC = Object.assign(az, {
  defaultDatum: "WGS84",
  Proj: If,
  WGS84: new If("WGS84"),
  Point: J1,
  toPoint: w8,
  defs: Ao,
  nadgrid: kP,
  transform: PT,
  mgrs: rz,
  version: "__VERSION__"
});
qj(TC);
var kx = { exports: {} }, pb = {}, Hx = { exports: {} }, iA = {};
/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var xD;
function Vj() {
  return xD || (xD = 1, function(n) {
    function t(nt, J) {
      var gt = nt.length;
      nt.push(J);
      t: for (; 0 < gt; ) {
        var Ot = gt - 1 >>> 1, W = nt[Ot];
        if (0 < s(W, J))
          nt[Ot] = J, nt[gt] = W, gt = Ot;
        else break t;
      }
    }
    function e(nt) {
      return nt.length === 0 ? null : nt[0];
    }
    function a(nt) {
      if (nt.length === 0) return null;
      var J = nt[0], gt = nt.pop();
      if (gt !== J) {
        nt[0] = gt;
        t: for (var Ot = 0, W = nt.length, j = W >>> 1; Ot < j; ) {
          var X = 2 * (Ot + 1) - 1, st = nt[X], At = X + 1, Dt = nt[At];
          if (0 > s(st, gt))
            At < W && 0 > s(Dt, st) ? (nt[Ot] = Dt, nt[At] = gt, Ot = At) : (nt[Ot] = st, nt[X] = gt, Ot = X);
          else if (At < W && 0 > s(Dt, gt))
            nt[Ot] = Dt, nt[At] = gt, Ot = At;
          else break t;
        }
      }
      return J;
    }
    function s(nt, J) {
      var gt = nt.sortIndex - J.sortIndex;
      return gt !== 0 ? gt : nt.id - J.id;
    }
    if (n.unstable_now = void 0, typeof performance == "object" && typeof performance.now == "function") {
      var l = performance;
      n.unstable_now = function() {
        return l.now();
      };
    } else {
      var f = Date, h = f.now();
      n.unstable_now = function() {
        return f.now() - h;
      };
    }
    var p = [], y = [], b = 1, x = null, w = 3, A = !1, C = !1, L = !1, N = !1, U = typeof setTimeout == "function" ? setTimeout : null, k = typeof clearTimeout == "function" ? clearTimeout : null, H = typeof setImmediate < "u" ? setImmediate : null;
    function B(nt) {
      for (var J = e(y); J !== null; ) {
        if (J.callback === null) a(y);
        else if (J.startTime <= nt)
          a(y), J.sortIndex = J.expirationTime, t(p, J);
        else break;
        J = e(y);
      }
    }
    function z(nt) {
      if (L = !1, B(nt), !C)
        if (e(p) !== null)
          C = !0, Q || (Q = !0, mt());
        else {
          var J = e(y);
          J !== null && Ft(z, J.startTime - nt);
        }
    }
    var Q = !1, et = -1, ot = 5, pt = -1;
    function ht() {
      return N ? !0 : !(n.unstable_now() - pt < ot);
    }
    function Ct() {
      if (N = !1, Q) {
        var nt = n.unstable_now();
        pt = nt;
        var J = !0;
        try {
          t: {
            C = !1, L && (L = !1, k(et), et = -1), A = !0;
            var gt = w;
            try {
              e: {
                for (B(nt), x = e(p); x !== null && !(x.expirationTime > nt && ht()); ) {
                  var Ot = x.callback;
                  if (typeof Ot == "function") {
                    x.callback = null, w = x.priorityLevel;
                    var W = Ot(
                      x.expirationTime <= nt
                    );
                    if (nt = n.unstable_now(), typeof W == "function") {
                      x.callback = W, B(nt), J = !0;
                      break e;
                    }
                    x === e(p) && a(p), B(nt);
                  } else a(p);
                  x = e(p);
                }
                if (x !== null) J = !0;
                else {
                  var j = e(y);
                  j !== null && Ft(
                    z,
                    j.startTime - nt
                  ), J = !1;
                }
              }
              break t;
            } finally {
              x = null, w = gt, A = !1;
            }
            J = void 0;
          }
        } finally {
          J ? mt() : Q = !1;
        }
      }
    }
    var mt;
    if (typeof H == "function")
      mt = function() {
        H(Ct);
      };
    else if (typeof MessageChannel < "u") {
      var St = new MessageChannel(), Ut = St.port2;
      St.port1.onmessage = Ct, mt = function() {
        Ut.postMessage(null);
      };
    } else
      mt = function() {
        U(Ct, 0);
      };
    function Ft(nt, J) {
      et = U(function() {
        nt(n.unstable_now());
      }, J);
    }
    n.unstable_IdlePriority = 5, n.unstable_ImmediatePriority = 1, n.unstable_LowPriority = 4, n.unstable_NormalPriority = 3, n.unstable_Profiling = null, n.unstable_UserBlockingPriority = 2, n.unstable_cancelCallback = function(nt) {
      nt.callback = null;
    }, n.unstable_forceFrameRate = function(nt) {
      0 > nt || 125 < nt ? console.error(
        "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
      ) : ot = 0 < nt ? Math.floor(1e3 / nt) : 5;
    }, n.unstable_getCurrentPriorityLevel = function() {
      return w;
    }, n.unstable_next = function(nt) {
      switch (w) {
        case 1:
        case 2:
        case 3:
          var J = 3;
          break;
        default:
          J = w;
      }
      var gt = w;
      w = J;
      try {
        return nt();
      } finally {
        w = gt;
      }
    }, n.unstable_requestPaint = function() {
      N = !0;
    }, n.unstable_runWithPriority = function(nt, J) {
      switch (nt) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          nt = 3;
      }
      var gt = w;
      w = nt;
      try {
        return J();
      } finally {
        w = gt;
      }
    }, n.unstable_scheduleCallback = function(nt, J, gt) {
      var Ot = n.unstable_now();
      switch (typeof gt == "object" && gt !== null ? (gt = gt.delay, gt = typeof gt == "number" && 0 < gt ? Ot + gt : Ot) : gt = Ot, nt) {
        case 1:
          var W = -1;
          break;
        case 2:
          W = 250;
          break;
        case 5:
          W = 1073741823;
          break;
        case 4:
          W = 1e4;
          break;
        default:
          W = 5e3;
      }
      return W = gt + W, nt = {
        id: b++,
        callback: J,
        priorityLevel: nt,
        startTime: gt,
        expirationTime: W,
        sortIndex: -1
      }, gt > Ot ? (nt.sortIndex = gt, t(y, nt), e(p) === null && nt === e(y) && (L ? (k(et), et = -1) : L = !0, Ft(z, gt - Ot))) : (nt.sortIndex = W, t(p, nt), C || A || (C = !0, Q || (Q = !0, mt()))), nt;
    }, n.unstable_shouldYield = ht, n.unstable_wrapCallback = function(nt) {
      var J = w;
      return function() {
        var gt = w;
        w = J;
        try {
          return nt.apply(this, arguments);
        } finally {
          w = gt;
        }
      };
    };
  }(iA)), iA;
}
var aA = {}, TD;
function Yj() {
  return TD || (TD = 1, function(n) {
    var t = {};
    /**
     * @license React
     * scheduler.development.js
     *
     * Copyright (c) Meta Platforms, Inc. and affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
    t.NODE_ENV !== "production" && function() {
      function e() {
        if (Q = !1, ht) {
          var J = n.unstable_now();
          St = J;
          var gt = !0;
          try {
            t: {
              B = !1, z && (z = !1, ot(Ct), Ct = -1), H = !0;
              var Ot = k;
              try {
                e: {
                  for (h(J), U = s(C); U !== null && !(U.expirationTime > J && y()); ) {
                    var W = U.callback;
                    if (typeof W == "function") {
                      U.callback = null, k = U.priorityLevel;
                      var j = W(
                        U.expirationTime <= J
                      );
                      if (J = n.unstable_now(), typeof j == "function") {
                        U.callback = j, h(J), gt = !0;
                        break e;
                      }
                      U === s(C) && l(C), h(J);
                    } else l(C);
                    U = s(C);
                  }
                  if (U !== null) gt = !0;
                  else {
                    var X = s(L);
                    X !== null && b(
                      p,
                      X.startTime - J
                    ), gt = !1;
                  }
                }
                break t;
              } finally {
                U = null, k = Ot, H = !1;
              }
              gt = void 0;
            }
          } finally {
            gt ? Ut() : ht = !1;
          }
        }
      }
      function a(J, gt) {
        var Ot = J.length;
        J.push(gt);
        t: for (; 0 < Ot; ) {
          var W = Ot - 1 >>> 1, j = J[W];
          if (0 < f(j, gt))
            J[W] = gt, J[Ot] = j, Ot = W;
          else break t;
        }
      }
      function s(J) {
        return J.length === 0 ? null : J[0];
      }
      function l(J) {
        if (J.length === 0) return null;
        var gt = J[0], Ot = J.pop();
        if (Ot !== gt) {
          J[0] = Ot;
          t: for (var W = 0, j = J.length, X = j >>> 1; W < X; ) {
            var st = 2 * (W + 1) - 1, At = J[st], Dt = st + 1, It = J[Dt];
            if (0 > f(At, Ot))
              Dt < j && 0 > f(It, At) ? (J[W] = It, J[Dt] = Ot, W = Dt) : (J[W] = At, J[st] = Ot, W = st);
            else if (Dt < j && 0 > f(It, Ot))
              J[W] = It, J[Dt] = Ot, W = Dt;
            else break t;
          }
        }
        return gt;
      }
      function f(J, gt) {
        var Ot = J.sortIndex - gt.sortIndex;
        return Ot !== 0 ? Ot : J.id - gt.id;
      }
      function h(J) {
        for (var gt = s(L); gt !== null; ) {
          if (gt.callback === null) l(L);
          else if (gt.startTime <= J)
            l(L), gt.sortIndex = gt.expirationTime, a(C, gt);
          else break;
          gt = s(L);
        }
      }
      function p(J) {
        if (z = !1, h(J), !B)
          if (s(C) !== null)
            B = !0, ht || (ht = !0, Ut());
          else {
            var gt = s(L);
            gt !== null && b(
              p,
              gt.startTime - J
            );
          }
      }
      function y() {
        return Q ? !0 : !(n.unstable_now() - St < mt);
      }
      function b(J, gt) {
        Ct = et(function() {
          J(n.unstable_now());
        }, gt);
      }
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()), n.unstable_now = void 0, typeof performance == "object" && typeof performance.now == "function") {
        var x = performance;
        n.unstable_now = function() {
          return x.now();
        };
      } else {
        var w = Date, A = w.now();
        n.unstable_now = function() {
          return w.now() - A;
        };
      }
      var C = [], L = [], N = 1, U = null, k = 3, H = !1, B = !1, z = !1, Q = !1, et = typeof setTimeout == "function" ? setTimeout : null, ot = typeof clearTimeout == "function" ? clearTimeout : null, pt = typeof setImmediate < "u" ? setImmediate : null, ht = !1, Ct = -1, mt = 5, St = -1;
      if (typeof pt == "function")
        var Ut = function() {
          pt(e);
        };
      else if (typeof MessageChannel < "u") {
        var Ft = new MessageChannel(), nt = Ft.port2;
        Ft.port1.onmessage = e, Ut = function() {
          nt.postMessage(null);
        };
      } else
        Ut = function() {
          et(e, 0);
        };
      n.unstable_IdlePriority = 5, n.unstable_ImmediatePriority = 1, n.unstable_LowPriority = 4, n.unstable_NormalPriority = 3, n.unstable_Profiling = null, n.unstable_UserBlockingPriority = 2, n.unstable_cancelCallback = function(J) {
        J.callback = null;
      }, n.unstable_forceFrameRate = function(J) {
        0 > J || 125 < J ? console.error(
          "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
        ) : mt = 0 < J ? Math.floor(1e3 / J) : 5;
      }, n.unstable_getCurrentPriorityLevel = function() {
        return k;
      }, n.unstable_next = function(J) {
        switch (k) {
          case 1:
          case 2:
          case 3:
            var gt = 3;
            break;
          default:
            gt = k;
        }
        var Ot = k;
        k = gt;
        try {
          return J();
        } finally {
          k = Ot;
        }
      }, n.unstable_requestPaint = function() {
        Q = !0;
      }, n.unstable_runWithPriority = function(J, gt) {
        switch (J) {
          case 1:
          case 2:
          case 3:
          case 4:
          case 5:
            break;
          default:
            J = 3;
        }
        var Ot = k;
        k = J;
        try {
          return gt();
        } finally {
          k = Ot;
        }
      }, n.unstable_scheduleCallback = function(J, gt, Ot) {
        var W = n.unstable_now();
        switch (typeof Ot == "object" && Ot !== null ? (Ot = Ot.delay, Ot = typeof Ot == "number" && 0 < Ot ? W + Ot : W) : Ot = W, J) {
          case 1:
            var j = -1;
            break;
          case 2:
            j = 250;
            break;
          case 5:
            j = 1073741823;
            break;
          case 4:
            j = 1e4;
            break;
          default:
            j = 5e3;
        }
        return j = Ot + j, J = {
          id: N++,
          callback: gt,
          priorityLevel: J,
          startTime: Ot,
          expirationTime: j,
          sortIndex: -1
        }, Ot > W ? (J.sortIndex = Ot, a(L, J), s(C) === null && J === s(L) && (z ? (ot(Ct), Ct = -1) : z = !0, b(p, Ot - W))) : (J.sortIndex = j, a(C, J), B || H || (B = !0, ht || (ht = !0, Ut()))), J;
      }, n.unstable_shouldYield = y, n.unstable_wrapCallback = function(J) {
        var gt = k;
        return function() {
          var Ot = k;
          k = gt;
          try {
            return J.apply(this, arguments);
          } finally {
            k = Ot;
          }
        };
      }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
    }();
  }(aA)), aA;
}
var wD;
function G8() {
  if (wD) return Hx.exports;
  wD = 1;
  var n = {};
  return n.NODE_ENV === "production" ? Hx.exports = Vj() : Hx.exports = Yj(), Hx.exports;
}
var Bx = { exports: {} }, Zs = {};
/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var RD;
function Fj() {
  if (RD) return Zs;
  RD = 1;
  var n = C0();
  function t(p) {
    var y = "https://react.dev/errors/" + p;
    if (1 < arguments.length) {
      y += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var b = 2; b < arguments.length; b++)
        y += "&args[]=" + encodeURIComponent(arguments[b]);
    }
    return "Minified React error #" + p + "; visit " + y + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  function e() {
  }
  var a = {
    d: {
      f: e,
      r: function() {
        throw Error(t(522));
      },
      D: e,
      C: e,
      L: e,
      m: e,
      X: e,
      S: e,
      M: e
    },
    p: 0,
    findDOMNode: null
  }, s = Symbol.for("react.portal");
  function l(p, y, b) {
    var x = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return {
      $$typeof: s,
      key: x == null ? null : "" + x,
      children: p,
      containerInfo: y,
      implementation: b
    };
  }
  var f = n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
  function h(p, y) {
    if (p === "font") return "";
    if (typeof y == "string")
      return y === "use-credentials" ? y : "";
  }
  return Zs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = a, Zs.createPortal = function(p, y) {
    var b = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!y || y.nodeType !== 1 && y.nodeType !== 9 && y.nodeType !== 11)
      throw Error(t(299));
    return l(p, y, null, b);
  }, Zs.flushSync = function(p) {
    var y = f.T, b = a.p;
    try {
      if (f.T = null, a.p = 2, p) return p();
    } finally {
      f.T = y, a.p = b, a.d.f();
    }
  }, Zs.preconnect = function(p, y) {
    typeof p == "string" && (y ? (y = y.crossOrigin, y = typeof y == "string" ? y === "use-credentials" ? y : "" : void 0) : y = null, a.d.C(p, y));
  }, Zs.prefetchDNS = function(p) {
    typeof p == "string" && a.d.D(p);
  }, Zs.preinit = function(p, y) {
    if (typeof p == "string" && y && typeof y.as == "string") {
      var b = y.as, x = h(b, y.crossOrigin), w = typeof y.integrity == "string" ? y.integrity : void 0, A = typeof y.fetchPriority == "string" ? y.fetchPriority : void 0;
      b === "style" ? a.d.S(
        p,
        typeof y.precedence == "string" ? y.precedence : void 0,
        {
          crossOrigin: x,
          integrity: w,
          fetchPriority: A
        }
      ) : b === "script" && a.d.X(p, {
        crossOrigin: x,
        integrity: w,
        fetchPriority: A,
        nonce: typeof y.nonce == "string" ? y.nonce : void 0
      });
    }
  }, Zs.preinitModule = function(p, y) {
    if (typeof p == "string")
      if (typeof y == "object" && y !== null) {
        if (y.as == null || y.as === "script") {
          var b = h(
            y.as,
            y.crossOrigin
          );
          a.d.M(p, {
            crossOrigin: b,
            integrity: typeof y.integrity == "string" ? y.integrity : void 0,
            nonce: typeof y.nonce == "string" ? y.nonce : void 0
          });
        }
      } else y == null && a.d.M(p);
  }, Zs.preload = function(p, y) {
    if (typeof p == "string" && typeof y == "object" && y !== null && typeof y.as == "string") {
      var b = y.as, x = h(b, y.crossOrigin);
      a.d.L(p, b, {
        crossOrigin: x,
        integrity: typeof y.integrity == "string" ? y.integrity : void 0,
        nonce: typeof y.nonce == "string" ? y.nonce : void 0,
        type: typeof y.type == "string" ? y.type : void 0,
        fetchPriority: typeof y.fetchPriority == "string" ? y.fetchPriority : void 0,
        referrerPolicy: typeof y.referrerPolicy == "string" ? y.referrerPolicy : void 0,
        imageSrcSet: typeof y.imageSrcSet == "string" ? y.imageSrcSet : void 0,
        imageSizes: typeof y.imageSizes == "string" ? y.imageSizes : void 0,
        media: typeof y.media == "string" ? y.media : void 0
      });
    }
  }, Zs.preloadModule = function(p, y) {
    if (typeof p == "string")
      if (y) {
        var b = h(y.as, y.crossOrigin);
        a.d.m(p, {
          as: typeof y.as == "string" && y.as !== "script" ? y.as : void 0,
          crossOrigin: b,
          integrity: typeof y.integrity == "string" ? y.integrity : void 0
        });
      } else a.d.m(p);
  }, Zs.requestFormReset = function(p) {
    a.d.r(p);
  }, Zs.unstable_batchedUpdates = function(p, y) {
    return p(y);
  }, Zs.useFormState = function(p, y, b) {
    return f.H.useFormState(p, y, b);
  }, Zs.useFormStatus = function() {
    return f.H.useHostTransitionStatus();
  }, Zs.version = "19.1.1", Zs;
}
var Ws = {}, AD;
function $j() {
  if (AD) return Ws;
  AD = 1;
  var n = {};
  /**
   * @license React
   * react-dom.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return n.NODE_ENV !== "production" && function() {
    function t() {
    }
    function e(w) {
      return "" + w;
    }
    function a(w, A, C) {
      var L = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
      try {
        e(L);
        var N = !1;
      } catch {
        N = !0;
      }
      return N && (console.error(
        "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
        typeof Symbol == "function" && Symbol.toStringTag && L[Symbol.toStringTag] || L.constructor.name || "Object"
      ), e(L)), {
        $$typeof: b,
        key: L == null ? null : "" + L,
        children: w,
        containerInfo: A,
        implementation: C
      };
    }
    function s(w, A) {
      if (w === "font") return "";
      if (typeof A == "string")
        return A === "use-credentials" ? A : "";
    }
    function l(w) {
      return w === null ? "`null`" : w === void 0 ? "`undefined`" : w === "" ? "an empty string" : 'something with type "' + typeof w + '"';
    }
    function f(w) {
      return w === null ? "`null`" : w === void 0 ? "`undefined`" : w === "" ? "an empty string" : typeof w == "string" ? JSON.stringify(w) : typeof w == "number" ? "`" + w + "`" : 'something with type "' + typeof w + '"';
    }
    function h() {
      var w = x.H;
      return w === null && console.error(
        `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
      ), w;
    }
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
    var p = C0(), y = {
      d: {
        f: t,
        r: function() {
          throw Error(
            "Invalid form element. requestFormReset must be passed a form that was rendered by React."
          );
        },
        D: t,
        C: t,
        L: t,
        m: t,
        X: t,
        S: t,
        M: t
      },
      p: 0,
      findDOMNode: null
    }, b = Symbol.for("react.portal"), x = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
    typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
      "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
    ), Ws.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = y, Ws.createPortal = function(w, A) {
      var C = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
      if (!A || A.nodeType !== 1 && A.nodeType !== 9 && A.nodeType !== 11)
        throw Error("Target container is not a DOM element.");
      return a(w, A, null, C);
    }, Ws.flushSync = function(w) {
      var A = x.T, C = y.p;
      try {
        if (x.T = null, y.p = 2, w)
          return w();
      } finally {
        x.T = A, y.p = C, y.d.f() && console.error(
          "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
        );
      }
    }, Ws.preconnect = function(w, A) {
      typeof w == "string" && w ? A != null && typeof A != "object" ? console.error(
        "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
        f(A)
      ) : A != null && typeof A.crossOrigin != "string" && console.error(
        "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
        l(A.crossOrigin)
      ) : console.error(
        "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
        l(w)
      ), typeof w == "string" && (A ? (A = A.crossOrigin, A = typeof A == "string" ? A === "use-credentials" ? A : "" : void 0) : A = null, y.d.C(w, A));
    }, Ws.prefetchDNS = function(w) {
      if (typeof w != "string" || !w)
        console.error(
          "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
          l(w)
        );
      else if (1 < arguments.length) {
        var A = arguments[1];
        typeof A == "object" && A.hasOwnProperty("crossOrigin") ? console.error(
          "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
          f(A)
        ) : console.error(
          "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
          f(A)
        );
      }
      typeof w == "string" && y.d.D(w);
    }, Ws.preinit = function(w, A) {
      if (typeof w == "string" && w ? A == null || typeof A != "object" ? console.error(
        "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
        f(A)
      ) : A.as !== "style" && A.as !== "script" && console.error(
        'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
        f(A.as)
      ) : console.error(
        "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
        l(w)
      ), typeof w == "string" && A && typeof A.as == "string") {
        var C = A.as, L = s(C, A.crossOrigin), N = typeof A.integrity == "string" ? A.integrity : void 0, U = typeof A.fetchPriority == "string" ? A.fetchPriority : void 0;
        C === "style" ? y.d.S(
          w,
          typeof A.precedence == "string" ? A.precedence : void 0,
          {
            crossOrigin: L,
            integrity: N,
            fetchPriority: U
          }
        ) : C === "script" && y.d.X(w, {
          crossOrigin: L,
          integrity: N,
          fetchPriority: U,
          nonce: typeof A.nonce == "string" ? A.nonce : void 0
        });
      }
    }, Ws.preinitModule = function(w, A) {
      var C = "";
      if (typeof w == "string" && w || (C += " The `href` argument encountered was " + l(w) + "."), A !== void 0 && typeof A != "object" ? C += " The `options` argument encountered was " + l(A) + "." : A && "as" in A && A.as !== "script" && (C += " The `as` option encountered was " + f(A.as) + "."), C)
        console.error(
          "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
          C
        );
      else
        switch (C = A && typeof A.as == "string" ? A.as : "script", C) {
          case "script":
            break;
          default:
            C = f(C), console.error(
              'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
              C,
              w
            );
        }
      typeof w == "string" && (typeof A == "object" && A !== null ? (A.as == null || A.as === "script") && (C = s(
        A.as,
        A.crossOrigin
      ), y.d.M(w, {
        crossOrigin: C,
        integrity: typeof A.integrity == "string" ? A.integrity : void 0,
        nonce: typeof A.nonce == "string" ? A.nonce : void 0
      })) : A == null && y.d.M(w));
    }, Ws.preload = function(w, A) {
      var C = "";
      if (typeof w == "string" && w || (C += " The `href` argument encountered was " + l(w) + "."), A == null || typeof A != "object" ? C += " The `options` argument encountered was " + l(A) + "." : typeof A.as == "string" && A.as || (C += " The `as` option encountered was " + l(A.as) + "."), C && console.error(
        'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
        C
      ), typeof w == "string" && typeof A == "object" && A !== null && typeof A.as == "string") {
        C = A.as;
        var L = s(
          C,
          A.crossOrigin
        );
        y.d.L(w, C, {
          crossOrigin: L,
          integrity: typeof A.integrity == "string" ? A.integrity : void 0,
          nonce: typeof A.nonce == "string" ? A.nonce : void 0,
          type: typeof A.type == "string" ? A.type : void 0,
          fetchPriority: typeof A.fetchPriority == "string" ? A.fetchPriority : void 0,
          referrerPolicy: typeof A.referrerPolicy == "string" ? A.referrerPolicy : void 0,
          imageSrcSet: typeof A.imageSrcSet == "string" ? A.imageSrcSet : void 0,
          imageSizes: typeof A.imageSizes == "string" ? A.imageSizes : void 0,
          media: typeof A.media == "string" ? A.media : void 0
        });
      }
    }, Ws.preloadModule = function(w, A) {
      var C = "";
      typeof w == "string" && w || (C += " The `href` argument encountered was " + l(w) + "."), A !== void 0 && typeof A != "object" ? C += " The `options` argument encountered was " + l(A) + "." : A && "as" in A && typeof A.as != "string" && (C += " The `as` option encountered was " + l(A.as) + "."), C && console.error(
        'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
        C
      ), typeof w == "string" && (A ? (C = s(
        A.as,
        A.crossOrigin
      ), y.d.m(w, {
        as: typeof A.as == "string" && A.as !== "script" ? A.as : void 0,
        crossOrigin: C,
        integrity: typeof A.integrity == "string" ? A.integrity : void 0
      })) : y.d.m(w));
    }, Ws.requestFormReset = function(w) {
      y.d.r(w);
    }, Ws.unstable_batchedUpdates = function(w, A) {
      return w(A);
    }, Ws.useFormState = function(w, A, C) {
      return h().useFormState(w, A, C);
    }, Ws.useFormStatus = function() {
      return h().useHostTransitionStatus();
    }, Ws.version = "19.1.1", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
  }(), Ws;
}
var MD;
function U8() {
  if (MD) return Bx.exports;
  MD = 1;
  var n = {};
  function t() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
      if (n.NODE_ENV !== "production")
        throw new Error("^_^");
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t);
      } catch (e) {
        console.error(e);
      }
    }
  }
  return n.NODE_ENV === "production" ? (t(), Bx.exports = Fj()) : Bx.exports = $j(), Bx.exports;
}
/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var CD;
function Xj() {
  if (CD) return pb;
  CD = 1;
  var n = G8(), t = C0(), e = U8();
  function a(o) {
    var c = "https://react.dev/errors/" + o;
    if (1 < arguments.length) {
      c += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var d = 2; d < arguments.length; d++)
        c += "&args[]=" + encodeURIComponent(arguments[d]);
    }
    return "Minified React error #" + o + "; visit " + c + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  function s(o) {
    return !(!o || o.nodeType !== 1 && o.nodeType !== 9 && o.nodeType !== 11);
  }
  function l(o) {
    var c = o, d = o;
    if (o.alternate) for (; c.return; ) c = c.return;
    else {
      o = c;
      do
        c = o, (c.flags & 4098) !== 0 && (d = c.return), o = c.return;
      while (o);
    }
    return c.tag === 3 ? d : null;
  }
  function f(o) {
    if (o.tag === 13) {
      var c = o.memoizedState;
      if (c === null && (o = o.alternate, o !== null && (c = o.memoizedState)), c !== null) return c.dehydrated;
    }
    return null;
  }
  function h(o) {
    if (l(o) !== o)
      throw Error(a(188));
  }
  function p(o) {
    var c = o.alternate;
    if (!c) {
      if (c = l(o), c === null) throw Error(a(188));
      return c !== o ? null : o;
    }
    for (var d = o, v = c; ; ) {
      var T = d.return;
      if (T === null) break;
      var M = T.alternate;
      if (M === null) {
        if (v = T.return, v !== null) {
          d = v;
          continue;
        }
        break;
      }
      if (T.child === M.child) {
        for (M = T.child; M; ) {
          if (M === d) return h(T), o;
          if (M === v) return h(T), c;
          M = M.sibling;
        }
        throw Error(a(188));
      }
      if (d.return !== v.return) d = T, v = M;
      else {
        for (var P = !1, q = T.child; q; ) {
          if (q === d) {
            P = !0, d = T, v = M;
            break;
          }
          if (q === v) {
            P = !0, v = T, d = M;
            break;
          }
          q = q.sibling;
        }
        if (!P) {
          for (q = M.child; q; ) {
            if (q === d) {
              P = !0, d = M, v = T;
              break;
            }
            if (q === v) {
              P = !0, v = M, d = T;
              break;
            }
            q = q.sibling;
          }
          if (!P) throw Error(a(189));
        }
      }
      if (d.alternate !== v) throw Error(a(190));
    }
    if (d.tag !== 3) throw Error(a(188));
    return d.stateNode.current === d ? o : c;
  }
  function y(o) {
    var c = o.tag;
    if (c === 5 || c === 26 || c === 27 || c === 6) return o;
    for (o = o.child; o !== null; ) {
      if (c = y(o), c !== null) return c;
      o = o.sibling;
    }
    return null;
  }
  var b = Object.assign, x = Symbol.for("react.element"), w = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), U = Symbol.for("react.provider"), k = Symbol.for("react.consumer"), H = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), et = Symbol.for("react.memo"), ot = Symbol.for("react.lazy"), pt = Symbol.for("react.activity"), ht = Symbol.for("react.memo_cache_sentinel"), Ct = Symbol.iterator;
  function mt(o) {
    return o === null || typeof o != "object" ? null : (o = Ct && o[Ct] || o["@@iterator"], typeof o == "function" ? o : null);
  }
  var St = Symbol.for("react.client.reference");
  function Ut(o) {
    if (o == null) return null;
    if (typeof o == "function")
      return o.$$typeof === St ? null : o.displayName || o.name || null;
    if (typeof o == "string") return o;
    switch (o) {
      case C:
        return "Fragment";
      case N:
        return "Profiler";
      case L:
        return "StrictMode";
      case z:
        return "Suspense";
      case Q:
        return "SuspenseList";
      case pt:
        return "Activity";
    }
    if (typeof o == "object")
      switch (o.$$typeof) {
        case A:
          return "Portal";
        case H:
          return (o.displayName || "Context") + ".Provider";
        case k:
          return (o._context.displayName || "Context") + ".Consumer";
        case B:
          var c = o.render;
          return o = o.displayName, o || (o = c.displayName || c.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
        case et:
          return c = o.displayName || null, c !== null ? c : Ut(o.type) || "Memo";
        case ot:
          c = o._payload, o = o._init;
          try {
            return Ut(o(c));
          } catch {
          }
      }
    return null;
  }
  var Ft = Array.isArray, nt = t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, gt = {
    pending: !1,
    data: null,
    method: null,
    action: null
  }, Ot = [], W = -1;
  function j(o) {
    return { current: o };
  }
  function X(o) {
    0 > W || (o.current = Ot[W], Ot[W] = null, W--);
  }
  function st(o, c) {
    W++, Ot[W] = o.current, o.current = c;
  }
  var At = j(null), Dt = j(null), It = j(null), $t = j(null);
  function Qt(o, c) {
    switch (st(It, c), st(Dt, o), st(At, null), c.nodeType) {
      case 9:
      case 11:
        o = (o = c.documentElement) && (o = o.namespaceURI) ? Pn(o) : 0;
        break;
      default:
        if (o = c.tagName, c = c.namespaceURI)
          c = Pn(c), o = Vn(c, o);
        else
          switch (o) {
            case "svg":
              o = 1;
              break;
            case "math":
              o = 2;
              break;
            default:
              o = 0;
          }
    }
    X(At), st(At, o);
  }
  function ee() {
    X(At), X(Dt), X(It);
  }
  function ce(o) {
    o.memoizedState !== null && st($t, o);
    var c = At.current, d = Vn(c, o.type);
    c !== d && (st(Dt, o), st(At, d));
  }
  function pe(o) {
    Dt.current === o && (X(At), X(Dt)), $t.current === o && (X($t), La._currentValue = gt);
  }
  var Mn = Object.prototype.hasOwnProperty, te = n.unstable_scheduleCallback, tn = n.unstable_cancelCallback, Jn = n.unstable_shouldYield, Pi = n.unstable_requestPaint, Ge = n.unstable_now, pa = n.unstable_getCurrentPriorityLevel, ka = n.unstable_ImmediatePriority, Ai = n.unstable_UserBlockingPriority, fe = n.unstable_NormalPriority, Zi = n.unstable_LowPriority, Dn = n.unstable_IdlePriority, nr = n.log, mr = n.unstable_setDisableYieldValue, Ha = null, ti = null;
  function zi(o) {
    if (typeof nr == "function" && mr(o), ti && typeof ti.setStrictMode == "function")
      try {
        ti.setStrictMode(Ha, o);
      } catch {
      }
  }
  var Gi = Math.clz32 ? Math.clz32 : _l, Io = Math.log, Ms = Math.LN2;
  function _l(o) {
    return o >>>= 0, o === 0 ? 32 : 31 - (Io(o) / Ms | 0) | 0;
  }
  var ls = 256, ir = 4194304;
  function Ui(o) {
    var c = o & 42;
    if (c !== 0) return c;
    switch (o & -o) {
      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:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return o & 4194048;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return o & 62914560;
      case 67108864:
        return 67108864;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 0;
      default:
        return o;
    }
  }
  function sa(o, c, d) {
    var v = o.pendingLanes;
    if (v === 0) return 0;
    var T = 0, M = o.suspendedLanes, P = o.pingedLanes;
    o = o.warmLanes;
    var q = v & 134217727;
    return q !== 0 ? (v = q & ~M, v !== 0 ? T = Ui(v) : (P &= q, P !== 0 ? T = Ui(P) : d || (d = q & ~o, d !== 0 && (T = Ui(d))))) : (q = v & ~M, q !== 0 ? T = Ui(q) : P !== 0 ? T = Ui(P) : d || (d = v & ~o, d !== 0 && (T = Ui(d)))), T === 0 ? 0 : c !== 0 && c !== T && (c & M) === 0 && (M = T & -T, d = c & -c, M >= d || M === 32 && (d & 4194048) !== 0) ? c : T;
  }
  function Ba(o, c) {
    return (o.pendingLanes & ~(o.suspendedLanes & ~o.pingedLanes) & c) === 0;
  }
  function Y(o, c) {
    switch (o) {
      case 1:
      case 2:
      case 4:
      case 8:
      case 64:
        return c + 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 c + 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 dt() {
    var o = ls;
    return ls <<= 1, (ls & 4194048) === 0 && (ls = 256), o;
  }
  function Kt() {
    var o = ir;
    return ir <<= 1, (ir & 62914560) === 0 && (ir = 4194304), o;
  }
  function Jt(o) {
    for (var c = [], d = 0; 31 > d; d++) c.push(o);
    return c;
  }
  function oe(o, c) {
    o.pendingLanes |= c, c !== 268435456 && (o.suspendedLanes = 0, o.pingedLanes = 0, o.warmLanes = 0);
  }
  function Be(o, c, d, v, T, M) {
    var P = o.pendingLanes;
    o.pendingLanes = d, o.suspendedLanes = 0, o.pingedLanes = 0, o.warmLanes = 0, o.expiredLanes &= d, o.entangledLanes &= d, o.errorRecoveryDisabledLanes &= d, o.shellSuspendCounter = 0;
    var q = o.entanglements, it = o.expirationTimes, vt = o.hiddenUpdates;
    for (d = P & ~d; 0 < d; ) {
      var jt = 31 - Gi(d), Bt = 1 << jt;
      q[jt] = 0, it[jt] = -1;
      var xt = vt[jt];
      if (xt !== null)
        for (vt[jt] = null, jt = 0; jt < xt.length; jt++) {
          var bt = xt[jt];
          bt !== null && (bt.lane &= -536870913);
        }
      d &= ~Bt;
    }
    v !== 0 && Ue(o, v, 0), M !== 0 && T === 0 && o.tag !== 0 && (o.suspendedLanes |= M & ~(P & ~c));
  }
  function Ue(o, c, d) {
    o.pendingLanes |= c, o.suspendedLanes &= ~c;
    var v = 31 - Gi(c);
    o.entangledLanes |= c, o.entanglements[v] = o.entanglements[v] | 1073741824 | d & 4194090;
  }
  function Pe(o, c) {
    var d = o.entangledLanes |= c;
    for (o = o.entanglements; d; ) {
      var v = 31 - Gi(d), T = 1 << v;
      T & c | o[v] & c && (o[v] |= c), d &= ~T;
    }
  }
  function Ae(o) {
    switch (o) {
      case 2:
        o = 1;
        break;
      case 8:
        o = 4;
        break;
      case 32:
        o = 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:
        o = 128;
        break;
      case 268435456:
        o = 134217728;
        break;
      default:
        o = 0;
    }
    return o;
  }
  function xn(o) {
    return o &= -o, 2 < o ? 8 < o ? (o & 134217727) !== 0 ? 32 : 268435456 : 8 : 2;
  }
  function Wi() {
    var o = J.p;
    return o !== 0 ? o : (o = window.event, o === void 0 ? 32 : Hv(o.type));
  }
  function ar(o, c) {
    var d = J.p;
    try {
      return J.p = o, c();
    } finally {
      J.p = d;
    }
  }
  var oa = Math.random().toString(36).slice(2), un = "__reactFiber$" + oa, cn = "__reactProps$" + oa, Si = "__reactContainer$" + oa, us = "__reactEvents$" + oa, ym = "__reactListeners$" + oa, W_ = "__reactHandles$" + oa, md = "__reactResources$" + oa, pd = "__reactMarker$" + oa;
  function de(o) {
    delete o[un], delete o[cn], delete o[us], delete o[ym], delete o[W_];
  }
  function mu(o) {
    var c = o[un];
    if (c) return c;
    for (var d = o.parentNode; d; ) {
      if (c = d[Si] || d[un]) {
        if (d = c.alternate, c.child !== null || d !== null && d.child !== null)
          for (o = pf(o); o !== null; ) {
            if (d = o[un]) return d;
            o = pf(o);
          }
        return c;
      }
      o = d, d = o.parentNode;
    }
    return null;
  }
  function qa(o) {
    if (o = o[un] || o[Si]) {
      var c = o.tag;
      if (c === 5 || c === 6 || c === 13 || c === 26 || c === 27 || c === 3)
        return o;
    }
    return null;
  }
  function Nc(o) {
    var c = o.tag;
    if (c === 5 || c === 26 || c === 27 || c === 6) return o.stateNode;
    throw Error(a(33));
  }
  function jf(o) {
    var c = o[md];
    return c || (c = o[md] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }), c;
  }
  function Qi(o) {
    o[pd] = !0;
  }
  var z0 = /* @__PURE__ */ new Set(), yd = {};
  function Ra(o, c) {
    Lc(o, c), Lc(o + "Capture", c);
  }
  function Lc(o, c) {
    for (yd[o] = c, o = 0; o < c.length; o++)
      z0.add(c[o]);
  }
  var kf = 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]*$"
  ), G0 = {}, Ic = {};
  function Q_(o) {
    return Mn.call(Ic, o) ? !0 : Mn.call(G0, o) ? !1 : kf.test(o) ? Ic[o] = !0 : (G0[o] = !0, !1);
  }
  function _d(o, c, d) {
    if (Q_(c))
      if (d === null) o.removeAttribute(c);
      else {
        switch (typeof d) {
          case "undefined":
          case "function":
          case "symbol":
            o.removeAttribute(c);
            return;
          case "boolean":
            var v = c.toLowerCase().slice(0, 5);
            if (v !== "data-" && v !== "aria-") {
              o.removeAttribute(c);
              return;
            }
        }
        o.setAttribute(c, "" + d);
      }
  }
  function vl(o, c, d) {
    if (d === null) o.removeAttribute(c);
    else {
      switch (typeof d) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          o.removeAttribute(c);
          return;
      }
      o.setAttribute(c, "" + d);
    }
  }
  function eo(o, c, d, v) {
    if (v === null) o.removeAttribute(d);
    else {
      switch (typeof v) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          o.removeAttribute(d);
          return;
      }
      o.setAttributeNS(c, d, "" + v);
    }
  }
  var vd, _m;
  function Pc(o) {
    if (vd === void 0)
      try {
        throw Error();
      } catch (d) {
        var c = d.stack.trim().match(/\n( *(at )?)/);
        vd = c && c[1] || "", _m = -1 < d.stack.indexOf(`
    at`) ? " (<anonymous>)" : -1 < d.stack.indexOf("@") ? "@unknown:0:0" : "";
      }
    return `
` + vd + o + _m;
  }
  var vm = !1;
  function pr(o, c) {
    if (!o || vm) return "";
    vm = !0;
    var d = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      var v = {
        DetermineComponentFrameRoot: function() {
          try {
            if (c) {
              var Bt = function() {
                throw Error();
              };
              if (Object.defineProperty(Bt.prototype, "props", {
                set: function() {
                  throw Error();
                }
              }), typeof Reflect == "object" && Reflect.construct) {
                try {
                  Reflect.construct(Bt, []);
                } catch (bt) {
                  var xt = bt;
                }
                Reflect.construct(o, [], Bt);
              } else {
                try {
                  Bt.call();
                } catch (bt) {
                  xt = bt;
                }
                o.call(Bt.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (bt) {
                xt = bt;
              }
              (Bt = o()) && typeof Bt.catch == "function" && Bt.catch(function() {
              });
            }
          } catch (bt) {
            if (bt && xt && typeof bt.stack == "string")
              return [bt.stack, xt.stack];
          }
          return [null, null];
        }
      };
      v.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
      var T = Object.getOwnPropertyDescriptor(
        v.DetermineComponentFrameRoot,
        "name"
      );
      T && T.configurable && Object.defineProperty(
        v.DetermineComponentFrameRoot,
        "name",
        { value: "DetermineComponentFrameRoot" }
      );
      var M = v.DetermineComponentFrameRoot(), P = M[0], q = M[1];
      if (P && q) {
        var it = P.split(`
`), vt = q.split(`
`);
        for (T = v = 0; v < it.length && !it[v].includes("DetermineComponentFrameRoot"); )
          v++;
        for (; T < vt.length && !vt[T].includes(
          "DetermineComponentFrameRoot"
        ); )
          T++;
        if (v === it.length || T === vt.length)
          for (v = it.length - 1, T = vt.length - 1; 1 <= v && 0 <= T && it[v] !== vt[T]; )
            T--;
        for (; 1 <= v && 0 <= T; v--, T--)
          if (it[v] !== vt[T]) {
            if (v !== 1 || T !== 1)
              do
                if (v--, T--, 0 > T || it[v] !== vt[T]) {
                  var jt = `
` + it[v].replace(" at new ", " at ");
                  return o.displayName && jt.includes("<anonymous>") && (jt = jt.replace("<anonymous>", o.displayName)), jt;
                }
              while (1 <= v && 0 <= T);
            break;
          }
      }
    } finally {
      vm = !1, Error.prepareStackTrace = d;
    }
    return (d = o ? o.displayName || o.name : "") ? Pc(d) : "";
  }
  function Hf(o) {
    switch (o.tag) {
      case 26:
      case 27:
      case 5:
        return Pc(o.type);
      case 16:
        return Pc("Lazy");
      case 13:
        return Pc("Suspense");
      case 19:
        return Pc("SuspenseList");
      case 0:
      case 15:
        return pr(o.type, !1);
      case 11:
        return pr(o.type.render, !1);
      case 1:
        return pr(o.type, !0);
      case 31:
        return Pc("Activity");
      default:
        return "";
    }
  }
  function El(o) {
    try {
      var c = "";
      do
        c += Hf(o), o = o.return;
      while (o);
      return c;
    } catch (d) {
      return `
Error generating stack: ` + d.message + `
` + d.stack;
    }
  }
  function zr(o) {
    switch (typeof o) {
      case "bigint":
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return o;
      case "object":
        return o;
      default:
        return "";
    }
  }
  function zc(o) {
    var c = o.type;
    return (o = o.nodeName) && o.toLowerCase() === "input" && (c === "checkbox" || c === "radio");
  }
  function Bf(o) {
    var c = zc(o) ? "checked" : "value", d = Object.getOwnPropertyDescriptor(
      o.constructor.prototype,
      c
    ), v = "" + o[c];
    if (!o.hasOwnProperty(c) && typeof d < "u" && typeof d.get == "function" && typeof d.set == "function") {
      var T = d.get, M = d.set;
      return Object.defineProperty(o, c, {
        configurable: !0,
        get: function() {
          return T.call(this);
        },
        set: function(P) {
          v = "" + P, M.call(this, P);
        }
      }), Object.defineProperty(o, c, {
        enumerable: d.enumerable
      }), {
        getValue: function() {
          return v;
        },
        setValue: function(P) {
          v = "" + P;
        },
        stopTracking: function() {
          o._valueTracker = null, delete o[c];
        }
      };
    }
  }
  function qf(o) {
    o._valueTracker || (o._valueTracker = Bf(o));
  }
  function Gc(o) {
    if (!o) return !1;
    var c = o._valueTracker;
    if (!c) return !0;
    var d = c.getValue(), v = "";
    return o && (v = zc(o) ? o.checked ? "true" : "false" : o.value), o = v, o !== d ? (c.setValue(o), !0) : !1;
  }
  function Cs(o) {
    if (o = o || (typeof document < "u" ? document : void 0), typeof o > "u") return null;
    try {
      return o.activeElement || o.body;
    } catch {
      return o.body;
    }
  }
  var Em = /[\n"\\]/g;
  function Os(o) {
    return o.replace(
      Em,
      function(c) {
        return "\\" + c.charCodeAt(0).toString(16) + " ";
      }
    );
  }
  function bm(o, c, d, v, T, M, P, q) {
    o.name = "", P != null && typeof P != "function" && typeof P != "symbol" && typeof P != "boolean" ? o.type = P : o.removeAttribute("type"), c != null ? P === "number" ? (c === 0 && o.value === "" || o.value != c) && (o.value = "" + zr(c)) : o.value !== "" + zr(c) && (o.value = "" + zr(c)) : P !== "submit" && P !== "reset" || o.removeAttribute("value"), c != null ? Uc(o, P, zr(c)) : d != null ? Uc(o, P, zr(d)) : v != null && o.removeAttribute("value"), T == null && M != null && (o.defaultChecked = !!M), T != null && (o.checked = T && typeof T != "function" && typeof T != "symbol"), q != null && typeof q != "function" && typeof q != "symbol" && typeof q != "boolean" ? o.name = "" + zr(q) : o.removeAttribute("name");
  }
  function Sm(o, c, d, v, T, M, P, q) {
    if (M != null && typeof M != "function" && typeof M != "symbol" && typeof M != "boolean" && (o.type = M), c != null || d != null) {
      if (!(M !== "submit" && M !== "reset" || c != null))
        return;
      d = d != null ? "" + zr(d) : "", c = c != null ? "" + zr(c) : d, q || c === o.value || (o.value = c), o.defaultValue = c;
    }
    v = v ?? T, v = typeof v != "function" && typeof v != "symbol" && !!v, o.checked = q ? o.checked : !!v, o.defaultChecked = !!v, P != null && typeof P != "function" && typeof P != "symbol" && typeof P != "boolean" && (o.name = P);
  }
  function Uc(o, c, d) {
    c === "number" && Cs(o.ownerDocument) === o || o.defaultValue === "" + d || (o.defaultValue = "" + d);
  }
  function pu(o, c, d, v) {
    if (o = o.options, c) {
      c = {};
      for (var T = 0; T < d.length; T++)
        c["$" + d[T]] = !0;
      for (d = 0; d < o.length; d++)
        T = c.hasOwnProperty("$" + o[d].value), o[d].selected !== T && (o[d].selected = T), T && v && (o[d].defaultSelected = !0);
    } else {
      for (d = "" + zr(d), c = null, T = 0; T < o.length; T++) {
        if (o[T].value === d) {
          o[T].selected = !0, v && (o[T].defaultSelected = !0);
          return;
        }
        c !== null || o[T].disabled || (c = o[T]);
      }
      c !== null && (c.selected = !0);
    }
  }
  function xm(o, c, d) {
    if (c != null && (c = "" + zr(c), c !== o.value && (o.value = c), d == null)) {
      o.defaultValue !== c && (o.defaultValue = c);
      return;
    }
    o.defaultValue = d != null ? "" + zr(d) : "";
  }
  function Ed(o, c, d, v) {
    if (c == null) {
      if (v != null) {
        if (d != null) throw Error(a(92));
        if (Ft(v)) {
          if (1 < v.length) throw Error(a(93));
          v = v[0];
        }
        d = v;
      }
      d == null && (d = ""), c = d;
    }
    d = zr(c), o.defaultValue = d, v = o.textContent, v === d && v !== "" && v !== null && (o.value = v);
  }
  function bl(o, c) {
    if (c) {
      var d = o.firstChild;
      if (d && d === o.lastChild && d.nodeType === 3) {
        d.nodeValue = c;
        return;
      }
    }
    o.textContent = c;
  }
  var Vf = 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 Tm(o, c, d) {
    var v = c.indexOf("--") === 0;
    d == null || typeof d == "boolean" || d === "" ? v ? o.setProperty(c, "") : c === "float" ? o.cssFloat = "" : o[c] = "" : v ? o.setProperty(c, d) : typeof d != "number" || d === 0 || Vf.has(c) ? c === "float" ? o.cssFloat = d : o[c] = ("" + d).trim() : o[c] = d + "px";
  }
  function bd(o, c, d) {
    if (c != null && typeof c != "object")
      throw Error(a(62));
    if (o = o.style, d != null) {
      for (var v in d)
        !d.hasOwnProperty(v) || c != null && c.hasOwnProperty(v) || (v.indexOf("--") === 0 ? o.setProperty(v, "") : v === "float" ? o.cssFloat = "" : o[v] = "");
      for (var T in c)
        v = c[T], c.hasOwnProperty(T) && d[T] !== v && Tm(o, T, v);
    } else
      for (var M in c)
        c.hasOwnProperty(M) && Tm(o, M, c[M]);
  }
  function Yf(o) {
    if (o.indexOf("-") === -1) return !1;
    switch (o) {
      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 Ff = /* @__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"]
  ]), J_ = /^[\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 $f(o) {
    return J_.test("" + o) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : o;
  }
  var Sd = null;
  function jc(o) {
    return o = o.target || o.srcElement || window, o.correspondingUseElement && (o = o.correspondingUseElement), o.nodeType === 3 ? o.parentNode : o;
  }
  var kc = null, Xf = null;
  function U0(o) {
    var c = qa(o);
    if (c && (o = c.stateNode)) {
      var d = o[cn] || null;
      t: switch (o = c.stateNode, c.type) {
        case "input":
          if (bm(
            o,
            d.value,
            d.defaultValue,
            d.defaultValue,
            d.checked,
            d.defaultChecked,
            d.type,
            d.name
          ), c = d.name, d.type === "radio" && c != null) {
            for (d = o; d.parentNode; ) d = d.parentNode;
            for (d = d.querySelectorAll(
              'input[name="' + Os(
                "" + c
              ) + '"][type="radio"]'
            ), c = 0; c < d.length; c++) {
              var v = d[c];
              if (v !== o && v.form === o.form) {
                var T = v[cn] || null;
                if (!T) throw Error(a(90));
                bm(
                  v,
                  T.value,
                  T.defaultValue,
                  T.defaultValue,
                  T.checked,
                  T.defaultChecked,
                  T.type,
                  T.name
                );
              }
            }
            for (c = 0; c < d.length; c++)
              v = d[c], v.form === o.form && Gc(v);
          }
          break t;
        case "textarea":
          xm(o, d.value, d.defaultValue);
          break t;
        case "select":
          c = d.value, c != null && pu(o, !!d.multiple, c, !1);
      }
    }
  }
  var j0 = !1;
  function tv(o, c, d) {
    if (j0) return o(c, d);
    j0 = !0;
    try {
      var v = o(c);
      return v;
    } finally {
      if (j0 = !1, (kc !== null || Xf !== null) && (yg(), kc && (c = kc, o = Xf, Xf = kc = null, U0(c), o)))
        for (c = 0; c < o.length; c++) U0(o[c]);
    }
  }
  function Sl(o, c) {
    var d = o.stateNode;
    if (d === null) return null;
    var v = d[cn] || null;
    if (v === null) return null;
    d = v[c];
    t: switch (c) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (v = !v.disabled) || (o = o.type, v = !(o === "button" || o === "input" || o === "select" || o === "textarea")), o = !v;
        break t;
      default:
        o = !1;
    }
    if (o) return null;
    if (d && typeof d != "function")
      throw Error(
        a(231, c, typeof d)
      );
    return d;
  }
  var no = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), Kf = !1;
  if (no)
    try {
      var Zf = {};
      Object.defineProperty(Zf, "passive", {
        get: function() {
          Kf = !0;
        }
      }), window.addEventListener("test", Zf, Zf), window.removeEventListener("test", Zf, Zf);
    } catch {
      Kf = !1;
    }
  var Ds = null, wm = null, Hc = null;
  function xd() {
    if (Hc) return Hc;
    var o, c = wm, d = c.length, v, T = "value" in Ds ? Ds.value : Ds.textContent, M = T.length;
    for (o = 0; o < d && c[o] === T[o]; o++) ;
    var P = d - o;
    for (v = 1; v <= P && c[d - v] === T[M - v]; v++) ;
    return Hc = T.slice(o, 1 < v ? 1 - v : void 0);
  }
  function Xn(o) {
    var c = o.keyCode;
    return "charCode" in o ? (o = o.charCode, o === 0 && c === 13 && (o = 13)) : o = c, o === 10 && (o = 13), 32 <= o || o === 13 ? o : 0;
  }
  function $e() {
    return !0;
  }
  function ev() {
    return !1;
  }
  function rr(o) {
    function c(d, v, T, M, P) {
      this._reactName = d, this._targetInst = T, this.type = v, this.nativeEvent = M, this.target = P, this.currentTarget = null;
      for (var q in o)
        o.hasOwnProperty(q) && (d = o[q], this[q] = d ? d(M) : M[q]);
      return this.isDefaultPrevented = (M.defaultPrevented != null ? M.defaultPrevented : M.returnValue === !1) ? $e : ev, this.isPropagationStopped = ev, this;
    }
    return b(c.prototype, {
      preventDefault: function() {
        this.defaultPrevented = !0;
        var d = this.nativeEvent;
        d && (d.preventDefault ? d.preventDefault() : typeof d.returnValue != "unknown" && (d.returnValue = !1), this.isDefaultPrevented = $e);
      },
      stopPropagation: function() {
        var d = this.nativeEvent;
        d && (d.stopPropagation ? d.stopPropagation() : typeof d.cancelBubble != "unknown" && (d.cancelBubble = !0), this.isPropagationStopped = $e);
      },
      persist: function() {
      },
      isPersistent: $e
    }), c;
  }
  var yu = {
    eventPhase: 0,
    bubbles: 0,
    cancelable: 0,
    timeStamp: function(o) {
      return o.timeStamp || Date.now();
    },
    defaultPrevented: 0,
    isTrusted: 0
  }, Td = rr(yu), wd = b({}, yu, { view: 0, detail: 0 }), wE = rr(wd), Rd, k0, ji, Wf = b({}, wd, {
    screenX: 0,
    screenY: 0,
    clientX: 0,
    clientY: 0,
    pageX: 0,
    pageY: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    getModifierState: ao,
    button: 0,
    buttons: 0,
    relatedTarget: function(o) {
      return o.relatedTarget === void 0 ? o.fromElement === o.srcElement ? o.toElement : o.fromElement : o.relatedTarget;
    },
    movementX: function(o) {
      return "movementX" in o ? o.movementX : (o !== ji && (ji && o.type === "mousemove" ? (Rd = o.screenX - ji.screenX, k0 = o.screenY - ji.screenY) : k0 = Rd = 0, ji = o), Rd);
    },
    movementY: function(o) {
      return "movementY" in o ? o.movementY : k0;
    }
  }), io = rr(Wf), H0 = b({}, Wf, { dataTransfer: 0 }), Rm = rr(H0), cs = b({}, wd, { relatedTarget: 0 }), Am = rr(cs), nv = b({}, yu, {
    animationName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), iv = rr(nv), av = b({}, yu, {
    clipboardData: function(o) {
      return "clipboardData" in o ? o.clipboardData : window.clipboardData;
    }
  }), rv = rr(av), Qf = b({}, yu, { data: 0 }), yr = rr(Qf), sv = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, fs = {
    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"
  }, ov = {
    Alt: "altKey",
    Control: "ctrlKey",
    Meta: "metaKey",
    Shift: "shiftKey"
  };
  function Mm(o) {
    var c = this.nativeEvent;
    return c.getModifierState ? c.getModifierState(o) : (o = ov[o]) ? !!c[o] : !1;
  }
  function ao() {
    return Mm;
  }
  var Po = b({}, wd, {
    key: function(o) {
      if (o.key) {
        var c = sv[o.key] || o.key;
        if (c !== "Unidentified") return c;
      }
      return o.type === "keypress" ? (o = Xn(o), o === 13 ? "Enter" : String.fromCharCode(o)) : o.type === "keydown" || o.type === "keyup" ? fs[o.keyCode] || "Unidentified" : "";
    },
    code: 0,
    location: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    repeat: 0,
    locale: 0,
    getModifierState: ao,
    charCode: function(o) {
      return o.type === "keypress" ? Xn(o) : 0;
    },
    keyCode: function(o) {
      return o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0;
    },
    which: function(o) {
      return o.type === "keypress" ? Xn(o) : o.type === "keydown" || o.type === "keyup" ? o.keyCode : 0;
    }
  }), xl = rr(Po), Tn = b({}, Wf, {
    pointerId: 0,
    width: 0,
    height: 0,
    pressure: 0,
    tangentialPressure: 0,
    tiltX: 0,
    tiltY: 0,
    twist: 0,
    pointerType: 0,
    isPrimary: 0
  }), Ji = rr(Tn), Jf = b({}, wd, {
    touches: 0,
    targetTouches: 0,
    changedTouches: 0,
    altKey: 0,
    metaKey: 0,
    ctrlKey: 0,
    shiftKey: 0,
    getModifierState: ao
  }), Cm = rr(Jf), Ad = b({}, yu, {
    propertyName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), Gr = rr(Ad), lv = b({}, Wf, {
    deltaX: function(o) {
      return "deltaX" in o ? o.deltaX : "wheelDeltaX" in o ? -o.wheelDeltaX : 0;
    },
    deltaY: function(o) {
      return "deltaY" in o ? o.deltaY : "wheelDeltaY" in o ? -o.wheelDeltaY : "wheelDelta" in o ? -o.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), Om = rr(lv), _u = b({}, yu, {
    newState: 0,
    oldState: 0
  }), th = rr(_u), Bc = [9, 13, 27, 32], Dm = no && "CompositionEvent" in window, vu = null;
  no && "documentMode" in document && (vu = document.documentMode);
  var uv = no && "TextEvent" in window && !vu, eh = no && (!Dm || vu && 8 < vu && 11 >= vu), Ns = " ", Nm = !1;
  function Lm(o, c) {
    switch (o) {
      case "keyup":
        return Bc.indexOf(c.keyCode) !== -1;
      case "keydown":
        return c.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function qc(o) {
    return o = o.detail, typeof o == "object" && "data" in o ? o.data : null;
  }
  var Ur = !1;
  function B0(o, c) {
    switch (o) {
      case "compositionend":
        return qc(c);
      case "keypress":
        return c.which !== 32 ? null : (Nm = !0, Ns);
      case "textInput":
        return o = c.data, o === Ns && Nm ? null : o;
      default:
        return null;
    }
  }
  function Im(o, c) {
    if (Ur)
      return o === "compositionend" || !Dm && Lm(o, c) ? (o = xd(), Hc = wm = Ds = null, Ur = !1, o) : null;
    switch (o) {
      case "paste":
        return null;
      case "keypress":
        if (!(c.ctrlKey || c.altKey || c.metaKey) || c.ctrlKey && c.altKey) {
          if (c.char && 1 < c.char.length)
            return c.char;
          if (c.which) return String.fromCharCode(c.which);
        }
        return null;
      case "compositionend":
        return eh && c.locale !== "ko" ? null : c.data;
      default:
        return null;
    }
  }
  var ya = {
    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 Md(o) {
    var c = o && o.nodeName && o.nodeName.toLowerCase();
    return c === "input" ? !!ya[o.type] : c === "textarea";
  }
  function Eu(o, c, d, v) {
    kc ? Xf ? Xf.push(v) : Xf = [v] : kc = v, c = ac(c, "onChange"), 0 < c.length && (d = new Td(
      "onChange",
      "change",
      null,
      d,
      v
    ), o.push({ event: d, listeners: c }));
  }
  var bu = null, Ls = null;
  function Vc(o) {
    Jl(o, 0);
  }
  function nh(o) {
    var c = Nc(o);
    if (Gc(c)) return o;
  }
  function Su(o, c) {
    if (o === "change") return c;
  }
  var q0 = !1;
  if (no) {
    var Pm;
    if (no) {
      var Is = "oninput" in document;
      if (!Is) {
        var ih = document.createElement("div");
        ih.setAttribute("oninput", "return;"), Is = typeof ih.oninput == "function";
      }
      Pm = Is;
    } else Pm = !1;
    q0 = Pm && (!document.documentMode || 9 < document.documentMode);
  }
  function V0() {
    bu && (bu.detachEvent("onpropertychange", xu), Ls = bu = null);
  }
  function xu(o) {
    if (o.propertyName === "value" && nh(Ls)) {
      var c = [];
      Eu(
        c,
        Ls,
        o,
        jc(o)
      ), tv(Vc, c);
    }
  }
  function Y0(o, c, d) {
    o === "focusin" ? (V0(), bu = c, Ls = d, bu.attachEvent("onpropertychange", xu)) : o === "focusout" && V0();
  }
  function ro(o) {
    if (o === "selectionchange" || o === "keyup" || o === "keydown")
      return nh(Ls);
  }
  function so(o, c) {
    if (o === "click") return nh(c);
  }
  function Tl(o, c) {
    if (o === "input" || o === "change")
      return nh(c);
  }
  function F0(o, c) {
    return o === c && (o !== 0 || 1 / o === 1 / c) || o !== o && c !== c;
  }
  var _r = typeof Object.is == "function" ? Object.is : F0;
  function jr(o, c) {
    if (_r(o, c)) return !0;
    if (typeof o != "object" || o === null || typeof c != "object" || c === null)
      return !1;
    var d = Object.keys(o), v = Object.keys(c);
    if (d.length !== v.length) return !1;
    for (v = 0; v < d.length; v++) {
      var T = d[v];
      if (!Mn.call(c, T) || !_r(o[T], c[T]))
        return !1;
    }
    return !0;
  }
  function vr(o) {
    for (; o && o.firstChild; ) o = o.firstChild;
    return o;
  }
  function wl(o, c) {
    var d = vr(o);
    o = 0;
    for (var v; d; ) {
      if (d.nodeType === 3) {
        if (v = o + d.textContent.length, o <= c && v >= c)
          return { node: d, offset: c - o };
        o = v;
      }
      t: {
        for (; d; ) {
          if (d.nextSibling) {
            d = d.nextSibling;
            break t;
          }
          d = d.parentNode;
        }
        d = void 0;
      }
      d = vr(d);
    }
  }
  function xi(o, c) {
    return o && c ? o === c ? !0 : o && o.nodeType === 3 ? !1 : c && c.nodeType === 3 ? xi(o, c.parentNode) : "contains" in o ? o.contains(c) : o.compareDocumentPosition ? !!(o.compareDocumentPosition(c) & 16) : !1 : !1;
  }
  function Cd(o) {
    o = o != null && o.ownerDocument != null && o.ownerDocument.defaultView != null ? o.ownerDocument.defaultView : window;
    for (var c = Cs(o.document); c instanceof o.HTMLIFrameElement; ) {
      try {
        var d = typeof c.contentWindow.location.href == "string";
      } catch {
        d = !1;
      }
      if (d) o = c.contentWindow;
      else break;
      c = Cs(o.document);
    }
    return c;
  }
  function zm(o) {
    var c = o && o.nodeName && o.nodeName.toLowerCase();
    return c && (c === "input" && (o.type === "text" || o.type === "search" || o.type === "tel" || o.type === "url" || o.type === "password") || c === "textarea" || o.contentEditable === "true");
  }
  var $0 = no && "documentMode" in document && 11 >= document.documentMode, Ps = null, zs = null, ft = null, Pt = !1;
  function Mt(o, c, d) {
    var v = d.window === d ? d.document : d.nodeType === 9 ? d : d.ownerDocument;
    Pt || Ps == null || Ps !== Cs(v) || (v = Ps, "selectionStart" in v && zm(v) ? v = { start: v.selectionStart, end: v.selectionEnd } : (v = (v.ownerDocument && v.ownerDocument.defaultView || window).getSelection(), v = {
      anchorNode: v.anchorNode,
      anchorOffset: v.anchorOffset,
      focusNode: v.focusNode,
      focusOffset: v.focusOffset
    }), ft && jr(ft, v) || (ft = v, v = ac(zs, "onSelect"), 0 < v.length && (c = new Td(
      "onSelect",
      "select",
      null,
      c,
      d
    ), o.push({ event: c, listeners: v }), c.target = Ps)));
  }
  function ae(o, c) {
    var d = {};
    return d[o.toLowerCase()] = c.toLowerCase(), d["Webkit" + o] = "webkit" + c, d["Moz" + o] = "moz" + c, d;
  }
  var Me = {
    animationend: ae("Animation", "AnimationEnd"),
    animationiteration: ae("Animation", "AnimationIteration"),
    animationstart: ae("Animation", "AnimationStart"),
    transitionrun: ae("Transition", "TransitionRun"),
    transitionstart: ae("Transition", "TransitionStart"),
    transitioncancel: ae("Transition", "TransitionCancel"),
    transitionend: ae("Transition", "TransitionEnd")
  }, wn = {}, Kn = {};
  no && (Kn = document.createElement("div").style, "AnimationEvent" in window || (delete Me.animationend.animation, delete Me.animationiteration.animation, delete Me.animationstart.animation), "TransitionEvent" in window || delete Me.transitionend.transition);
  function Xe(o) {
    if (wn[o]) return wn[o];
    if (!Me[o]) return o;
    var c = Me[o], d;
    for (d in c)
      if (c.hasOwnProperty(d) && d in Kn)
        return wn[o] = c[d];
    return o;
  }
  var Yc = Xe("animationend"), cv = Xe("animationiteration"), kr = Xe("animationstart"), Gm = Xe("transitionrun"), X0 = Xe("transitionstart"), Rl = Xe("transitioncancel"), ah = Xe("transitionend"), rh = /* @__PURE__ */ new Map(), Nn = "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(
    " "
  );
  Nn.push("scrollEnd");
  function Hr(o, c) {
    rh.set(o, c), Ra(c, [o]);
  }
  var Um = /* @__PURE__ */ new WeakMap();
  function sr(o, c) {
    if (typeof o == "object" && o !== null) {
      var d = Um.get(o);
      return d !== void 0 ? d : (c = {
        value: o,
        source: c,
        stack: El(c)
      }, Um.set(o, c), c);
    }
    return {
      value: o,
      source: c,
      stack: El(c)
    };
  }
  var hs = [], Tu = 0, Od = 0;
  function Br() {
    for (var o = Tu, c = Od = Tu = 0; c < o; ) {
      var d = hs[c];
      hs[c++] = null;
      var v = hs[c];
      hs[c++] = null;
      var T = hs[c];
      hs[c++] = null;
      var M = hs[c];
      if (hs[c++] = null, v !== null && T !== null) {
        var P = v.pending;
        P === null ? T.next = T : (T.next = P.next, P.next = T), v.pending = T;
      }
      M !== 0 && Al(d, T, M);
    }
  }
  function Aa(o, c, d, v) {
    hs[Tu++] = o, hs[Tu++] = c, hs[Tu++] = d, hs[Tu++] = v, Od |= v, o.lanes |= v, o = o.alternate, o !== null && (o.lanes |= v);
  }
  function zo(o, c, d, v) {
    return Aa(o, c, d, v), Ml(o);
  }
  function Go(o, c) {
    return Aa(o, null, null, c), Ml(o);
  }
  function Al(o, c, d) {
    o.lanes |= d;
    var v = o.alternate;
    v !== null && (v.lanes |= d);
    for (var T = !1, M = o.return; M !== null; )
      M.childLanes |= d, v = M.alternate, v !== null && (v.childLanes |= d), M.tag === 22 && (o = M.stateNode, o === null || o._visibility & 1 || (T = !0)), o = M, M = M.return;
    return o.tag === 3 ? (M = o.stateNode, T && c !== null && (T = 31 - Gi(d), o = M.hiddenUpdates, v = o[T], v === null ? o[T] = [c] : v.push(c), c.lane = d | 536870912), M) : null;
  }
  function Ml(o) {
    if (50 < hf)
      throw hf = 0, mp = null, Error(a(185));
    for (var c = o.return; c !== null; )
      o = c, c = o.return;
    return o.tag === 3 ? o.stateNode : null;
  }
  var wu = {};
  function jm(o, c, d, v) {
    this.tag = o, this.key = d, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.refCleanup = this.ref = null, this.pendingProps = c, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = v, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function Er(o, c, d, v) {
    return new jm(o, c, d, v);
  }
  function Ru(o) {
    return o = o.prototype, !(!o || !o.isReactComponent);
  }
  function Va(o, c) {
    var d = o.alternate;
    return d === null ? (d = Er(
      o.tag,
      c,
      o.key,
      o.mode
    ), d.elementType = o.elementType, d.type = o.type, d.stateNode = o.stateNode, d.alternate = o, o.alternate = d) : (d.pendingProps = c, d.type = o.type, d.flags = 0, d.subtreeFlags = 0, d.deletions = null), d.flags = o.flags & 65011712, d.childLanes = o.childLanes, d.lanes = o.lanes, d.child = o.child, d.memoizedProps = o.memoizedProps, d.memoizedState = o.memoizedState, d.updateQueue = o.updateQueue, c = o.dependencies, d.dependencies = c === null ? null : { lanes: c.lanes, firstContext: c.firstContext }, d.sibling = o.sibling, d.index = o.index, d.ref = o.ref, d.refCleanup = o.refCleanup, d;
  }
  function Fc(o, c) {
    o.flags &= 65011714;
    var d = o.alternate;
    return d === null ? (o.childLanes = 0, o.lanes = c, o.child = null, o.subtreeFlags = 0, o.memoizedProps = null, o.memoizedState = null, o.updateQueue = null, o.dependencies = null, o.stateNode = null) : (o.childLanes = d.childLanes, o.lanes = d.lanes, o.child = d.child, o.subtreeFlags = 0, o.deletions = null, o.memoizedProps = d.memoizedProps, o.memoizedState = d.memoizedState, o.updateQueue = d.updateQueue, o.type = d.type, c = d.dependencies, o.dependencies = c === null ? null : {
      lanes: c.lanes,
      firstContext: c.firstContext
    }), o;
  }
  function en(o, c, d, v, T, M) {
    var P = 0;
    if (v = o, typeof o == "function") Ru(o) && (P = 1);
    else if (typeof o == "string")
      P = Pv(
        o,
        d,
        At.current
      ) ? 26 : o === "html" || o === "head" || o === "body" ? 27 : 5;
    else
      t: switch (o) {
        case pt:
          return o = Er(31, d, c, T), o.elementType = pt, o.lanes = M, o;
        case C:
          return Xt(d.children, T, M, c);
        case L:
          P = 8, T |= 24;
          break;
        case N:
          return o = Er(12, d, c, T | 2), o.elementType = N, o.lanes = M, o;
        case z:
          return o = Er(13, d, c, T), o.elementType = z, o.lanes = M, o;
        case Q:
          return o = Er(19, d, c, T), o.elementType = Q, o.lanes = M, o;
        default:
          if (typeof o == "object" && o !== null)
            switch (o.$$typeof) {
              case U:
              case H:
                P = 10;
                break t;
              case k:
                P = 9;
                break t;
              case B:
                P = 11;
                break t;
              case et:
                P = 14;
                break t;
              case ot:
                P = 16, v = null;
                break t;
            }
          P = 29, d = Error(
            a(130, o === null ? "null" : typeof o, "")
          ), v = null;
      }
    return c = Er(P, d, c, T), c.elementType = o, c.type = v, c.lanes = M, c;
  }
  function Xt(o, c, d, v) {
    return o = Er(7, o, v, c), o.lanes = d, o;
  }
  function Au(o, c, d) {
    return o = Er(6, o, null, c), o.lanes = d, o;
  }
  function Cl(o, c, d) {
    return c = Er(
      4,
      o.children !== null ? o.children : [],
      o.key,
      c
    ), c.lanes = d, c.stateNode = {
      containerInfo: o.containerInfo,
      pendingChildren: null,
      implementation: o.implementation
    }, c;
  }
  var Zn = [], Uo = 0, sh = null, oh = 0, qr = [], Gs = 0, oi = null, fi = 1, oo = "";
  function la(o, c) {
    Zn[Uo++] = oh, Zn[Uo++] = sh, sh = o, oh = c;
  }
  function zn(o, c, d) {
    qr[Gs++] = fi, qr[Gs++] = oo, qr[Gs++] = oi, oi = o;
    var v = fi;
    o = oo;
    var T = 32 - Gi(v) - 1;
    v &= ~(1 << T), d += 1;
    var M = 32 - Gi(c) + T;
    if (30 < M) {
      var P = T - T % 5;
      M = (v & (1 << P) - 1).toString(32), v >>= P, T -= P, fi = 1 << 32 - Gi(c) + T | d << T | v, oo = M + o;
    } else
      fi = 1 << M | d << T | v, oo = o;
  }
  function Dd(o) {
    o.return !== null && (la(o, 1), zn(o, 1, 0));
  }
  function Ol(o) {
    for (; o === sh; )
      sh = Zn[--Uo], Zn[Uo] = null, oh = Zn[--Uo], Zn[Uo] = null;
    for (; o === oi; )
      oi = qr[--Gs], qr[Gs] = null, oo = qr[--Gs], qr[Gs] = null, fi = qr[--Gs], qr[Gs] = null;
  }
  var hi = null, Bn = null, je = !1, ds = null, _a = !1, Mu = Error(a(519));
  function or(o) {
    var c = Error(a(418, ""));
    throw Dl(sr(c, o)), Mu;
  }
  function km(o) {
    var c = o.stateNode, d = o.type, v = o.memoizedProps;
    switch (c[un] = o, c[cn] = v, d) {
      case "dialog":
        Ke("cancel", c), Ke("close", c);
        break;
      case "iframe":
      case "object":
      case "embed":
        Ke("load", c);
        break;
      case "video":
      case "audio":
        for (d = 0; d < He.length; d++)
          Ke(He[d], c);
        break;
      case "source":
        Ke("error", c);
        break;
      case "img":
      case "image":
      case "link":
        Ke("error", c), Ke("load", c);
        break;
      case "details":
        Ke("toggle", c);
        break;
      case "input":
        Ke("invalid", c), Sm(
          c,
          v.value,
          v.defaultValue,
          v.checked,
          v.defaultChecked,
          v.type,
          v.name,
          !0
        ), qf(c);
        break;
      case "select":
        Ke("invalid", c);
        break;
      case "textarea":
        Ke("invalid", c), Ed(c, v.value, v.defaultValue, v.children), qf(c);
    }
    d = v.children, typeof d != "string" && typeof d != "number" && typeof d != "bigint" || c.textContent === "" + d || v.suppressHydrationWarning === !0 || Nv(c.textContent, d) ? (v.popover != null && (Ke("beforetoggle", c), Ke("toggle", c)), v.onScroll != null && Ke("scroll", c), v.onScrollEnd != null && Ke("scrollend", c), v.onClick != null && (c.onclick = Rg), c = !0) : c = !1, c || or(o);
  }
  function Nd(o) {
    for (hi = o.return; hi; )
      switch (hi.tag) {
        case 5:
        case 13:
          _a = !1;
          return;
        case 27:
        case 3:
          _a = !0;
          return;
        default:
          hi = hi.return;
      }
  }
  function lh(o) {
    if (o !== hi) return !1;
    if (!je) return Nd(o), je = !0, !1;
    var c = o.tag, d;
    if ((d = c !== 3 && c !== 27) && ((d = c === 5) && (d = o.type, d = !(d !== "form" && d !== "button") || rc(o.type, o.memoizedProps)), d = !d), d && Bn && or(o), Nd(o), c === 13) {
      if (o = o.memoizedState, o = o !== null ? o.dehydrated : null, !o) throw Error(a(317));
      t: {
        for (o = o.nextSibling, c = 0; o; ) {
          if (o.nodeType === 8)
            if (d = o.data, d === "/$") {
              if (c === 0) {
                Bn = bo(o.nextSibling);
                break t;
              }
              c--;
            } else
              d !== "$" && d !== "$!" && d !== "$?" || c++;
          o = o.nextSibling;
        }
        Bn = null;
      }
    } else
      c === 27 ? (c = Bn, aa(o.type) ? (o = Iy, Iy = null, Bn = o) : Bn = c) : Bn = hi ? bo(o.stateNode.nextSibling) : null;
    return !0;
  }
  function uh() {
    Bn = hi = null, je = !1;
  }
  function K0() {
    var o = ds;
    return o !== null && (Ar === null ? Ar = o : Ar.push.apply(
      Ar,
      o
    ), ds = null), o;
  }
  function Dl(o) {
    ds === null ? ds = [o] : ds.push(o);
  }
  var Cu = j(null), jo = null, V = null;
  function br(o, c, d) {
    st(Cu, c._currentValue), c._currentValue = d;
  }
  function gs(o) {
    o._currentValue = Cu.current, X(Cu);
  }
  function Sr(o, c, d) {
    for (; o !== null; ) {
      var v = o.alternate;
      if ((o.childLanes & c) !== c ? (o.childLanes |= c, v !== null && (v.childLanes |= c)) : v !== null && (v.childLanes & c) !== c && (v.childLanes |= c), o === d) break;
      o = o.return;
    }
  }
  function fn(o, c, d, v) {
    var T = o.child;
    for (T !== null && (T.return = o); T !== null; ) {
      var M = T.dependencies;
      if (M !== null) {
        var P = T.child;
        M = M.firstContext;
        t: for (; M !== null; ) {
          var q = M;
          M = T;
          for (var it = 0; it < c.length; it++)
            if (q.context === c[it]) {
              M.lanes |= d, q = M.alternate, q !== null && (q.lanes |= d), Sr(
                M.return,
                d,
                o
              ), v || (P = null);
              break t;
            }
          M = q.next;
        }
      } else if (T.tag === 18) {
        if (P = T.return, P === null) throw Error(a(341));
        P.lanes |= d, M = P.alternate, M !== null && (M.lanes |= d), Sr(P, d, o), P = null;
      } else P = T.child;
      if (P !== null) P.return = T;
      else
        for (P = T; P !== null; ) {
          if (P === o) {
            P = null;
            break;
          }
          if (T = P.sibling, T !== null) {
            T.return = P.return, P = T;
            break;
          }
          P = P.return;
        }
      T = P;
    }
  }
  function Ld(o, c, d, v) {
    o = null;
    for (var T = c, M = !1; T !== null; ) {
      if (!M) {
        if ((T.flags & 524288) !== 0) M = !0;
        else if ((T.flags & 262144) !== 0) break;
      }
      if (T.tag === 10) {
        var P = T.alternate;
        if (P === null) throw Error(a(387));
        if (P = P.memoizedProps, P !== null) {
          var q = T.type;
          _r(T.pendingProps.value, P.value) || (o !== null ? o.push(q) : o = [q]);
        }
      } else if (T === $t.current) {
        if (P = T.alternate, P === null) throw Error(a(387));
        P.memoizedState.memoizedState !== T.memoizedState.memoizedState && (o !== null ? o.push(La) : o = [La]);
      }
      T = T.return;
    }
    o !== null && fn(
      c,
      o,
      d,
      v
    ), c.flags |= 262144;
  }
  function Id(o) {
    for (o = o.firstContext; o !== null; ) {
      if (!_r(
        o.context._currentValue,
        o.memoizedValue
      ))
        return !0;
      o = o.next;
    }
    return !1;
  }
  function Ou(o) {
    jo = o, V = null, o = o.dependencies, o !== null && (o.firstContext = null);
  }
  function Di(o) {
    return Z0(jo, o);
  }
  function ch(o, c) {
    return jo === null && Ou(o), Z0(o, c);
  }
  function Z0(o, c) {
    var d = c._currentValue;
    if (c = { context: c, memoizedValue: d, next: null }, V === null) {
      if (o === null) throw Error(a(308));
      V = c, o.dependencies = { lanes: 0, firstContext: c }, o.flags |= 524288;
    } else V = V.next = c;
    return d;
  }
  var fv = typeof AbortController < "u" ? AbortController : function() {
    var o = [], c = this.signal = {
      aborted: !1,
      addEventListener: function(d, v) {
        o.push(v);
      }
    };
    this.abort = function() {
      c.aborted = !0, o.forEach(function(d) {
        return d();
      });
    };
  }, fh = n.unstable_scheduleCallback, Hm = n.unstable_NormalPriority, ei = {
    $$typeof: H,
    Consumer: null,
    Provider: null,
    _currentValue: null,
    _currentValue2: null,
    _threadCount: 0
  };
  function W0() {
    return {
      controller: new fv(),
      data: /* @__PURE__ */ new Map(),
      refCount: 0
    };
  }
  function Du(o) {
    o.refCount--, o.refCount === 0 && fh(Hm, function() {
      o.controller.abort();
    });
  }
  var ko = null, hh = 0, Nu = 0, ua = null;
  function Vr(o, c) {
    if (ko === null) {
      var d = ko = [];
      hh = 0, Nu = Tg(), ua = {
        status: "pending",
        value: void 0,
        then: function(v) {
          d.push(v);
        }
      };
    }
    return hh++, c.then(Pd, Pd), c;
  }
  function Pd() {
    if (--hh === 0 && ko !== null) {
      ua !== null && (ua.status = "fulfilled");
      var o = ko;
      ko = null, Nu = 0, ua = null;
      for (var c = 0; c < o.length; c++) (0, o[c])();
    }
  }
  function Q0(o, c) {
    var d = [], v = {
      status: "pending",
      value: null,
      reason: null,
      then: function(T) {
        d.push(T);
      }
    };
    return o.then(
      function() {
        v.status = "fulfilled", v.value = c;
        for (var T = 0; T < d.length; T++) (0, d[T])(c);
      },
      function(T) {
        for (v.status = "rejected", v.reason = T, T = 0; T < d.length; T++)
          (0, d[T])(void 0);
      }
    ), v;
  }
  var J0 = nt.S;
  nt.S = function(o, c) {
    typeof c == "object" && c !== null && typeof c.then == "function" && Vr(o, c), J0 !== null && J0(o, c);
  };
  var Nl = j(null);
  function Us() {
    var o = Nl.current;
    return o !== null ? o : ii.pooledCache;
  }
  function dh(o, c) {
    c === null ? st(Nl, Nl.current) : st(Nl, c.pool);
  }
  function zd() {
    var o = Us();
    return o === null ? null : { parent: ei._currentValue, pool: o };
  }
  var Ya = Error(a(460)), Gd = Error(a(474)), gh = Error(a(542)), Bm = { then: function() {
  } };
  function ty(o) {
    return o = o.status, o === "fulfilled" || o === "rejected";
  }
  function mh() {
  }
  function qm(o, c, d) {
    switch (d = o[d], d === void 0 ? o.push(c) : d !== c && (c.then(mh, mh), c = d), c.status) {
      case "fulfilled":
        return c.value;
      case "rejected":
        throw o = c.reason, ey(o), o;
      default:
        if (typeof c.status == "string") c.then(mh, mh);
        else {
          if (o = ii, o !== null && 100 < o.shellSuspendCounter)
            throw Error(a(482));
          o = c, o.status = "pending", o.then(
            function(v) {
              if (c.status === "pending") {
                var T = c;
                T.status = "fulfilled", T.value = v;
              }
            },
            function(v) {
              if (c.status === "pending") {
                var T = c;
                T.status = "rejected", T.reason = v;
              }
            }
          );
        }
        switch (c.status) {
          case "fulfilled":
            return c.value;
          case "rejected":
            throw o = c.reason, ey(o), o;
        }
        throw $c = c, Ya;
    }
  }
  var $c = null;
  function Vm() {
    if ($c === null) throw Error(a(459));
    var o = $c;
    return $c = null, o;
  }
  function ey(o) {
    if (o === Ya || o === gh)
      throw Error(a(483));
  }
  var lo = !1;
  function Ll(o) {
    o.updateQueue = {
      baseState: o.memoizedState,
      firstBaseUpdate: null,
      lastBaseUpdate: null,
      shared: { pending: null, lanes: 0, hiddenCallbacks: null },
      callbacks: null
    };
  }
  function Xc(o, c) {
    o = o.updateQueue, c.updateQueue === o && (c.updateQueue = {
      baseState: o.baseState,
      firstBaseUpdate: o.firstBaseUpdate,
      lastBaseUpdate: o.lastBaseUpdate,
      shared: o.shared,
      callbacks: null
    });
  }
  function Il(o) {
    return { lane: o, tag: 0, payload: null, callback: null, next: null };
  }
  function xr(o, c, d) {
    var v = o.updateQueue;
    if (v === null) return null;
    if (v = v.shared, (qn & 2) !== 0) {
      var T = v.pending;
      return T === null ? c.next = c : (c.next = T.next, T.next = c), v.pending = c, c = Ml(o), Al(o, null, d), c;
    }
    return Aa(o, v, c, d), Ml(o);
  }
  function Kc(o, c, d) {
    if (c = c.updateQueue, c !== null && (c = c.shared, (d & 4194048) !== 0)) {
      var v = c.lanes;
      v &= o.pendingLanes, d |= v, c.lanes = d, Pe(o, d);
    }
  }
  function ms(o, c) {
    var d = o.updateQueue, v = o.alternate;
    if (v !== null && (v = v.updateQueue, d === v)) {
      var T = null, M = null;
      if (d = d.firstBaseUpdate, d !== null) {
        do {
          var P = {
            lane: d.lane,
            tag: d.tag,
            payload: d.payload,
            callback: null,
            next: null
          };
          M === null ? T = M = P : M = M.next = P, d = d.next;
        } while (d !== null);
        M === null ? T = M = c : M = M.next = c;
      } else T = M = c;
      d = {
        baseState: v.baseState,
        firstBaseUpdate: T,
        lastBaseUpdate: M,
        shared: v.shared,
        callbacks: v.callbacks
      }, o.updateQueue = d;
      return;
    }
    o = d.lastBaseUpdate, o === null ? d.firstBaseUpdate = c : o.next = c, d.lastBaseUpdate = c;
  }
  var Ud = !1;
  function uo() {
    if (Ud) {
      var o = ua;
      if (o !== null) throw o;
    }
  }
  function Fa(o, c, d, v) {
    Ud = !1;
    var T = o.updateQueue;
    lo = !1;
    var M = T.firstBaseUpdate, P = T.lastBaseUpdate, q = T.shared.pending;
    if (q !== null) {
      T.shared.pending = null;
      var it = q, vt = it.next;
      it.next = null, P === null ? M = vt : P.next = vt, P = it;
      var jt = o.alternate;
      jt !== null && (jt = jt.updateQueue, q = jt.lastBaseUpdate, q !== P && (q === null ? jt.firstBaseUpdate = vt : q.next = vt, jt.lastBaseUpdate = it));
    }
    if (M !== null) {
      var Bt = T.baseState;
      P = 0, jt = vt = it = null, q = M;
      do {
        var xt = q.lane & -536870913, bt = xt !== q.lane;
        if (bt ? (Rn & xt) === xt : (v & xt) === xt) {
          xt !== 0 && xt === Nu && (Ud = !0), jt !== null && (jt = jt.next = {
            lane: 0,
            tag: q.tag,
            payload: q.payload,
            callback: null,
            next: null
          });
          t: {
            var we = o, Ee = q;
            xt = c;
            var jn = d;
            switch (Ee.tag) {
              case 1:
                if (we = Ee.payload, typeof we == "function") {
                  Bt = we.call(jn, Bt, xt);
                  break t;
                }
                Bt = we;
                break t;
              case 3:
                we.flags = we.flags & -65537 | 128;
              case 0:
                if (we = Ee.payload, xt = typeof we == "function" ? we.call(jn, Bt, xt) : we, xt == null) break t;
                Bt = b({}, Bt, xt);
                break t;
              case 2:
                lo = !0;
            }
          }
          xt = q.callback, xt !== null && (o.flags |= 64, bt && (o.flags |= 8192), bt = T.callbacks, bt === null ? T.callbacks = [xt] : bt.push(xt));
        } else
          bt = {
            lane: xt,
            tag: q.tag,
            payload: q.payload,
            callback: q.callback,
            next: null
          }, jt === null ? (vt = jt = bt, it = Bt) : jt = jt.next = bt, P |= xt;
        if (q = q.next, q === null) {
          if (q = T.shared.pending, q === null)
            break;
          bt = q, q = bt.next, bt.next = null, T.lastBaseUpdate = bt, T.shared.pending = null;
        }
      } while (!0);
      jt === null && (it = Bt), T.baseState = it, T.firstBaseUpdate = vt, T.lastBaseUpdate = jt, M === null && (T.shared.lanes = 0), Zu |= P, o.lanes = P, o.memoizedState = Bt;
    }
  }
  function ph(o, c) {
    if (typeof o != "function")
      throw Error(a(191, o));
    o.call(c);
  }
  function jd(o, c) {
    var d = o.callbacks;
    if (d !== null)
      for (o.callbacks = null, o = 0; o < d.length; o++)
        ph(d[o], c);
  }
  var Ho = j(null), Pl = j(0);
  function Bo(o, c) {
    o = Kl, st(Pl, o), st(Ho, c), Kl = o | c.baseLanes;
  }
  function ca() {
    st(Pl, Kl), st(Ho, Ho.current);
  }
  function yh() {
    Kl = Pl.current, X(Ho), X(Pl);
  }
  var Yr = 0, qe = null, Ln = null, hn = null, zl = !1, Lu = !1, Ni = !1, Zc = 0, Tr = 0, fa = null, kd = 0;
  function yn() {
    throw Error(a(321));
  }
  function Wc(o, c) {
    if (c === null) return !1;
    for (var d = 0; d < c.length && d < o.length; d++)
      if (!_r(o[d], c[d])) return !1;
    return !0;
  }
  function Ym(o, c, d, v, T, M) {
    return Yr = M, qe = c, c.memoizedState = null, c.updateQueue = null, c.lanes = 0, nt.H = o === null || o.memoizedState === null ? gv : rp, Ni = !1, M = d(v, T), Ni = !1, Lu && (M = Iu(
      c,
      d,
      v,
      T
    )), ny(o), M;
  }
  function ny(o) {
    nt.H = wh;
    var c = Ln !== null && Ln.next !== null;
    if (Yr = 0, hn = Ln = qe = null, zl = !1, Tr = 0, fa = null, c) throw Error(a(300));
    o === null || gn || (o = o.dependencies, o !== null && Id(o) && (gn = !0));
  }
  function Iu(o, c, d, v) {
    qe = o;
    var T = 0;
    do {
      if (Lu && (fa = null), Tr = 0, Lu = !1, 25 <= T) throw Error(a(301));
      if (T += 1, hn = Ln = null, o.updateQueue != null) {
        var M = o.updateQueue;
        M.lastEffect = null, M.events = null, M.stores = null, M.memoCache != null && (M.memoCache.index = 0);
      }
      nt.H = ly, M = c(d, v);
    } while (Lu);
    return M;
  }
  function Fm() {
    var o = nt.H, c = o.useState()[0];
    return c = typeof c.then == "function" ? Jc(c) : c, o = o.useState()[0], (Ln !== null ? Ln.memoizedState : null) !== o && (qe.flags |= 1024), c;
  }
  function $m() {
    var o = Zc !== 0;
    return Zc = 0, o;
  }
  function Pu(o, c, d) {
    c.updateQueue = o.updateQueue, c.flags &= -2053, o.lanes &= ~d;
  }
  function Qc(o) {
    if (zl) {
      for (o = o.memoizedState; o !== null; ) {
        var c = o.queue;
        c !== null && (c.pending = null), o = o.next;
      }
      zl = !1;
    }
    Yr = 0, hn = Ln = qe = null, Lu = !1, Tr = Zc = 0, fa = null;
  }
  function wr() {
    var o = {
      memoizedState: null,
      baseState: null,
      baseQueue: null,
      queue: null,
      next: null
    };
    return hn === null ? qe.memoizedState = hn = o : hn = hn.next = o, hn;
  }
  function ki() {
    if (Ln === null) {
      var o = qe.alternate;
      o = o !== null ? o.memoizedState : null;
    } else o = Ln.next;
    var c = hn === null ? qe.memoizedState : hn.next;
    if (c !== null)
      hn = c, Ln = o;
    else {
      if (o === null)
        throw qe.alternate === null ? Error(a(467)) : Error(a(310));
      Ln = o, o = {
        memoizedState: Ln.memoizedState,
        baseState: Ln.baseState,
        baseQueue: Ln.baseQueue,
        queue: Ln.queue,
        next: null
      }, hn === null ? qe.memoizedState = hn = o : hn = hn.next = o;
    }
    return hn;
  }
  function Gl() {
    return { lastEffect: null, events: null, stores: null, memoCache: null };
  }
  function Jc(o) {
    var c = Tr;
    return Tr += 1, fa === null && (fa = []), o = qm(fa, o, c), c = qe, (hn === null ? c.memoizedState : hn.next) === null && (c = c.alternate, nt.H = c === null || c.memoizedState === null ? gv : rp), o;
  }
  function Xm(o) {
    if (o !== null && typeof o == "object") {
      if (typeof o.then == "function") return Jc(o);
      if (o.$$typeof === H) return Di(o);
    }
    throw Error(a(438, String(o)));
  }
  function ta(o) {
    var c = null, d = qe.updateQueue;
    if (d !== null && (c = d.memoCache), c == null) {
      var v = qe.alternate;
      v !== null && (v = v.updateQueue, v !== null && (v = v.memoCache, v != null && (c = {
        data: v.data.map(function(T) {
          return T.slice();
        }),
        index: 0
      })));
    }
    if (c == null && (c = { data: [], index: 0 }), d === null && (d = Gl(), qe.updateQueue = d), d.memoCache = c, d = c.data[c.index], d === void 0)
      for (d = c.data[c.index] = Array(o), v = 0; v < o; v++)
        d[v] = ht;
    return c.index++, d;
  }
  function co(o, c) {
    return typeof c == "function" ? c(o) : c;
  }
  function Hd(o) {
    var c = ki();
    return Km(c, Ln, o);
  }
  function Km(o, c, d) {
    var v = o.queue;
    if (v === null) throw Error(a(311));
    v.lastRenderedReducer = d;
    var T = o.baseQueue, M = v.pending;
    if (M !== null) {
      if (T !== null) {
        var P = T.next;
        T.next = M.next, M.next = P;
      }
      c.baseQueue = T = M, v.pending = null;
    }
    if (M = o.baseState, T === null) o.memoizedState = M;
    else {
      c = T.next;
      var q = P = null, it = null, vt = c, jt = !1;
      do {
        var Bt = vt.lane & -536870913;
        if (Bt !== vt.lane ? (Rn & Bt) === Bt : (Yr & Bt) === Bt) {
          var xt = vt.revertLane;
          if (xt === 0)
            it !== null && (it = it.next = {
              lane: 0,
              revertLane: 0,
              action: vt.action,
              hasEagerState: vt.hasEagerState,
              eagerState: vt.eagerState,
              next: null
            }), Bt === Nu && (jt = !0);
          else if ((Yr & xt) === xt) {
            vt = vt.next, xt === Nu && (jt = !0);
            continue;
          } else
            Bt = {
              lane: 0,
              revertLane: vt.revertLane,
              action: vt.action,
              hasEagerState: vt.hasEagerState,
              eagerState: vt.eagerState,
              next: null
            }, it === null ? (q = it = Bt, P = M) : it = it.next = Bt, qe.lanes |= xt, Zu |= xt;
          Bt = vt.action, Ni && d(M, Bt), M = vt.hasEagerState ? vt.eagerState : d(M, Bt);
        } else
          xt = {
            lane: Bt,
            revertLane: vt.revertLane,
            action: vt.action,
            hasEagerState: vt.hasEagerState,
            eagerState: vt.eagerState,
            next: null
          }, it === null ? (q = it = xt, P = M) : it = it.next = xt, qe.lanes |= Bt, Zu |= Bt;
        vt = vt.next;
      } while (vt !== null && vt !== c);
      if (it === null ? P = M : it.next = q, !_r(M, o.memoizedState) && (gn = !0, jt && (d = ua, d !== null)))
        throw d;
      o.memoizedState = M, o.baseState = P, o.baseQueue = it, v.lastRenderedState = M;
    }
    return T === null && (v.lanes = 0), [o.memoizedState, v.dispatch];
  }
  function Zm(o) {
    var c = ki(), d = c.queue;
    if (d === null) throw Error(a(311));
    d.lastRenderedReducer = o;
    var v = d.dispatch, T = d.pending, M = c.memoizedState;
    if (T !== null) {
      d.pending = null;
      var P = T = T.next;
      do
        M = o(M, P.action), P = P.next;
      while (P !== T);
      _r(M, c.memoizedState) || (gn = !0), c.memoizedState = M, c.baseQueue === null && (c.baseState = M), d.lastRenderedState = M;
    }
    return [M, v];
  }
  function Wm(o, c, d) {
    var v = qe, T = ki(), M = je;
    if (M) {
      if (d === void 0) throw Error(a(407));
      d = d();
    } else d = c();
    var P = !_r(
      (Ln || T).memoizedState,
      d
    );
    P && (T.memoizedState = d, gn = !0), T = T.queue;
    var q = Bd.bind(null, v, T, o);
    if (Ul(2048, 8, q, [o]), T.getSnapshot !== c || P || hn !== null && hn.memoizedState.tag & 1) {
      if (v.flags |= 2048, zu(
        9,
        js(),
        Qm.bind(
          null,
          v,
          T,
          d,
          c
        ),
        null
      ), ii === null) throw Error(a(349));
      M || (Yr & 124) !== 0 || tf(v, c, d);
    }
    return d;
  }
  function tf(o, c, d) {
    o.flags |= 16384, o = { getSnapshot: c, value: d }, c = qe.updateQueue, c === null ? (c = Gl(), qe.updateQueue = c, c.stores = [o]) : (d = c.stores, d === null ? c.stores = [o] : d.push(o));
  }
  function Qm(o, c, d, v) {
    c.value = d, c.getSnapshot = v, Jm(c) && tp(o);
  }
  function Bd(o, c, d) {
    return d(function() {
      Jm(c) && tp(o);
    });
  }
  function Jm(o) {
    var c = o.getSnapshot;
    o = o.value;
    try {
      var d = c();
      return !_r(o, d);
    } catch {
      return !0;
    }
  }
  function tp(o) {
    var c = Go(o, 2);
    c !== null && ts(c, o, 2);
  }
  function _h(o) {
    var c = wr();
    if (typeof o == "function") {
      var d = o;
      if (o = d(), Ni) {
        zi(!0);
        try {
          d();
        } finally {
          zi(!1);
        }
      }
    }
    return c.memoizedState = c.baseState = o, c.queue = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: co,
      lastRenderedState: o
    }, c;
  }
  function ef(o, c, d, v) {
    return o.baseState = d, Km(
      o,
      Ln,
      typeof v == "function" ? v : co
    );
  }
  function iy(o, c, d, v, T) {
    if (Th(o)) throw Error(a(485));
    if (o = c.action, o !== null) {
      var M = {
        payload: T,
        action: o,
        next: null,
        isTransition: !0,
        status: "pending",
        value: null,
        reason: null,
        listeners: [],
        then: function(P) {
          M.listeners.push(P);
        }
      };
      nt.T !== null ? d(!0) : M.isTransition = !1, v(M), d = c.pending, d === null ? (M.next = c.pending = M, ep(c, M)) : (M.next = d.next, c.pending = d.next = M);
    }
  }
  function ep(o, c) {
    var d = c.action, v = c.payload, T = o.state;
    if (c.isTransition) {
      var M = nt.T, P = {};
      nt.T = P;
      try {
        var q = d(T, v), it = nt.S;
        it !== null && it(P, q), qd(o, c, q);
      } catch (vt) {
        vh(o, c, vt);
      } finally {
        nt.T = M;
      }
    } else
      try {
        M = d(T, v), qd(o, c, M);
      } catch (vt) {
        vh(o, c, vt);
      }
  }
  function qd(o, c, d) {
    d !== null && typeof d == "object" && typeof d.then == "function" ? d.then(
      function(v) {
        Vd(o, c, v);
      },
      function(v) {
        return vh(o, c, v);
      }
    ) : Vd(o, c, d);
  }
  function Vd(o, c, d) {
    c.status = "fulfilled", c.value = d, ay(c), o.state = d, c = o.pending, c !== null && (d = c.next, d === c ? o.pending = null : (d = d.next, c.next = d, ep(o, d)));
  }
  function vh(o, c, d) {
    var v = o.pending;
    if (o.pending = null, v !== null) {
      v = v.next;
      do
        c.status = "rejected", c.reason = d, ay(c), c = c.next;
      while (c !== v);
    }
    o.action = null;
  }
  function ay(o) {
    o = o.listeners;
    for (var c = 0; c < o.length; c++) (0, o[c])();
  }
  function Yd(o, c) {
    return c;
  }
  function Fd(o, c) {
    if (je) {
      var d = ii.formState;
      if (d !== null) {
        t: {
          var v = qe;
          if (je) {
            if (Bn) {
              e: {
                for (var T = Bn, M = _a; T.nodeType !== 8; ) {
                  if (!M) {
                    T = null;
                    break e;
                  }
                  if (T = bo(
                    T.nextSibling
                  ), T === null) {
                    T = null;
                    break e;
                  }
                }
                M = T.data, T = M === "F!" || M === "F" ? T : null;
              }
              if (T) {
                Bn = bo(
                  T.nextSibling
                ), v = T.data === "F!";
                break t;
              }
            }
            or(v);
          }
          v = !1;
        }
        v && (c = d[0]);
      }
    }
    return d = wr(), d.memoizedState = d.baseState = c, v = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: Yd,
      lastRenderedState: c
    }, d.queue = v, d = Wd.bind(
      null,
      qe,
      v
    ), v.dispatch = d, v = _h(!1), M = Qd.bind(
      null,
      qe,
      !1,
      v.queue
    ), v = wr(), T = {
      state: c,
      dispatch: null,
      action: o,
      pending: null
    }, v.queue = T, d = iy.bind(
      null,
      qe,
      T,
      M,
      d
    ), T.dispatch = d, v.memoizedState = o, [c, d, !1];
  }
  function $d(o) {
    var c = ki();
    return qo(c, Ln, o);
  }
  function qo(o, c, d) {
    if (c = Km(
      o,
      c,
      Yd
    )[0], o = Hd(co)[0], typeof c == "object" && c !== null && typeof c.then == "function")
      try {
        var v = Jc(c);
      } catch (P) {
        throw P === Ya ? gh : P;
      }
    else v = c;
    c = ki();
    var T = c.queue, M = T.dispatch;
    return d !== c.memoizedState && (qe.flags |= 2048, zu(
      9,
      js(),
      Xd.bind(null, T, d),
      null
    )), [v, M, o];
  }
  function Xd(o, c) {
    o.action = c;
  }
  function an(o) {
    var c = ki(), d = Ln;
    if (d !== null)
      return qo(c, d, o);
    ki(), c = c.memoizedState, d = ki();
    var v = d.queue.dispatch;
    return d.memoizedState = o, [c, v, !1];
  }
  function zu(o, c, d, v) {
    return o = { tag: o, create: d, deps: v, inst: c, next: null }, c = qe.updateQueue, c === null && (c = Gl(), qe.updateQueue = c), d = c.lastEffect, d === null ? c.lastEffect = o.next = o : (v = d.next, d.next = o, o.next = v, c.lastEffect = o), o;
  }
  function js() {
    return { destroy: void 0, resource: void 0 };
  }
  function nf() {
    return ki().memoizedState;
  }
  function Gu(o, c, d, v) {
    var T = wr();
    v = v === void 0 ? null : v, qe.flags |= o, T.memoizedState = zu(
      1 | c,
      js(),
      d,
      v
    );
  }
  function Ul(o, c, d, v) {
    var T = ki();
    v = v === void 0 ? null : v;
    var M = T.memoizedState.inst;
    Ln !== null && v !== null && Wc(v, Ln.memoizedState.deps) ? T.memoizedState = zu(c, M, d, v) : (qe.flags |= o, T.memoizedState = zu(
      1 | c,
      M,
      d,
      v
    ));
  }
  function Ti(o, c) {
    Gu(8390656, 8, o, c);
  }
  function ps(o, c) {
    Ul(2048, 8, o, c);
  }
  function hv(o, c) {
    return Ul(4, 2, o, c);
  }
  function Eh(o, c) {
    return Ul(4, 4, o, c);
  }
  function ys(o, c) {
    if (typeof c == "function") {
      o = o();
      var d = c(o);
      return function() {
        typeof d == "function" ? d() : c(null);
      };
    }
    if (c != null)
      return o = o(), c.current = o, function() {
        c.current = null;
      };
  }
  function np(o, c, d) {
    d = d != null ? d.concat([o]) : null, Ul(4, 4, ys.bind(null, c, o), d);
  }
  function bh() {
  }
  function Ma(o, c) {
    var d = ki();
    c = c === void 0 ? null : c;
    var v = d.memoizedState;
    return c !== null && Wc(c, v[1]) ? v[0] : (d.memoizedState = [o, c], o);
  }
  function Fr(o, c) {
    var d = ki();
    c = c === void 0 ? null : c;
    var v = d.memoizedState;
    if (c !== null && Wc(c, v[1]))
      return v[0];
    if (v = o(), Ni) {
      zi(!0);
      try {
        o();
      } finally {
        zi(!1);
      }
    }
    return d.memoizedState = [v, c], v;
  }
  function Sh(o, c, d) {
    return d === void 0 || (Yr & 1073741824) !== 0 ? o.memoizedState = c : (o.memoizedState = d, o = bv(), qe.lanes |= o, Zu |= o, d);
  }
  function Kd(o, c, d, v) {
    return _r(d, c) ? d : Ho.current !== null ? (o = Sh(o, d, v), _r(o, c) || (gn = !0), o) : (Yr & 42) === 0 ? (gn = !0, o.memoizedState = d) : (o = bv(), qe.lanes |= o, Zu |= o, c);
  }
  function xh(o, c, d, v, T) {
    var M = J.p;
    J.p = M !== 0 && 8 > M ? M : 8;
    var P = nt.T, q = {};
    nt.T = q, Qd(o, !1, c, d);
    try {
      var it = T(), vt = nt.S;
      if (vt !== null && vt(q, it), it !== null && typeof it == "object" && typeof it.then == "function") {
        var jt = Q0(
          it,
          v
        );
        ju(
          o,
          c,
          jt,
          cr(o)
        );
      } else
        ju(
          o,
          c,
          v,
          cr(o)
        );
    } catch (Bt) {
      ju(
        o,
        c,
        { then: function() {
        }, status: "rejected", reason: Bt },
        cr()
      );
    } finally {
      J.p = M, nt.T = P;
    }
  }
  function dv() {
  }
  function Zd(o, c, d, v) {
    if (o.tag !== 5) throw Error(a(476));
    var T = ip(o).queue;
    xh(
      o,
      T,
      c,
      gt,
      d === null ? dv : function() {
        return ap(o), d(v);
      }
    );
  }
  function ip(o) {
    var c = o.memoizedState;
    if (c !== null) return c;
    c = {
      memoizedState: gt,
      baseState: gt,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: co,
        lastRenderedState: gt
      },
      next: null
    };
    var d = {};
    return c.next = {
      memoizedState: d,
      baseState: d,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: co,
        lastRenderedState: d
      },
      next: null
    }, o.memoizedState = c, o = o.alternate, o !== null && (o.memoizedState = c), c;
  }
  function ap(o) {
    var c = ip(o).next.queue;
    ju(o, c, {}, cr());
  }
  function jl() {
    return Di(La);
  }
  function Ca() {
    return ki().memoizedState;
  }
  function ry() {
    return ki().memoizedState;
  }
  function Uu(o) {
    for (var c = o.return; c !== null; ) {
      switch (c.tag) {
        case 24:
        case 3:
          var d = cr();
          o = Il(d);
          var v = xr(c, o, d);
          v !== null && (ts(v, c, d), Kc(v, c, d)), c = { cache: W0() }, o.payload = c;
          return;
      }
      c = c.return;
    }
  }
  function sy(o, c, d) {
    var v = cr();
    d = {
      lane: v,
      revertLane: 0,
      action: d,
      hasEagerState: !1,
      eagerState: null,
      next: null
    }, Th(o) ? Jd(c, d) : (d = zo(o, c, d, v), d !== null && (ts(d, o, v), oy(d, c, v)));
  }
  function Wd(o, c, d) {
    var v = cr();
    ju(o, c, d, v);
  }
  function ju(o, c, d, v) {
    var T = {
      lane: v,
      revertLane: 0,
      action: d,
      hasEagerState: !1,
      eagerState: null,
      next: null
    };
    if (Th(o)) Jd(c, T);
    else {
      var M = o.alternate;
      if (o.lanes === 0 && (M === null || M.lanes === 0) && (M = c.lastRenderedReducer, M !== null))
        try {
          var P = c.lastRenderedState, q = M(P, d);
          if (T.hasEagerState = !0, T.eagerState = q, _r(q, P))
            return Aa(o, c, T, 0), ii === null && Br(), !1;
        } catch {
        } finally {
        }
      if (d = zo(o, c, T, v), d !== null)
        return ts(d, o, v), oy(d, c, v), !0;
    }
    return !1;
  }
  function Qd(o, c, d, v) {
    if (v = {
      lane: 2,
      revertLane: Tg(),
      action: v,
      hasEagerState: !1,
      eagerState: null,
      next: null
    }, Th(o)) {
      if (c) throw Error(a(479));
    } else
      c = zo(
        o,
        d,
        v,
        2
      ), c !== null && ts(c, o, 2);
  }
  function Th(o) {
    var c = o.alternate;
    return o === qe || c !== null && c === qe;
  }
  function Jd(o, c) {
    Lu = zl = !0;
    var d = o.pending;
    d === null ? c.next = c : (c.next = d.next, d.next = c), o.pending = c;
  }
  function oy(o, c, d) {
    if ((d & 4194048) !== 0) {
      var v = c.lanes;
      v &= o.pendingLanes, d |= v, c.lanes = d, Pe(o, d);
    }
  }
  var wh = {
    readContext: Di,
    use: Xm,
    useCallback: yn,
    useContext: yn,
    useEffect: yn,
    useImperativeHandle: yn,
    useLayoutEffect: yn,
    useInsertionEffect: yn,
    useMemo: yn,
    useReducer: yn,
    useRef: yn,
    useState: yn,
    useDebugValue: yn,
    useDeferredValue: yn,
    useTransition: yn,
    useSyncExternalStore: yn,
    useId: yn,
    useHostTransitionStatus: yn,
    useFormState: yn,
    useActionState: yn,
    useOptimistic: yn,
    useMemoCache: yn,
    useCacheRefresh: yn
  }, gv = {
    readContext: Di,
    use: Xm,
    useCallback: function(o, c) {
      return wr().memoizedState = [
        o,
        c === void 0 ? null : c
      ], o;
    },
    useContext: Di,
    useEffect: Ti,
    useImperativeHandle: function(o, c, d) {
      d = d != null ? d.concat([o]) : null, Gu(
        4194308,
        4,
        ys.bind(null, c, o),
        d
      );
    },
    useLayoutEffect: function(o, c) {
      return Gu(4194308, 4, o, c);
    },
    useInsertionEffect: function(o, c) {
      Gu(4, 2, o, c);
    },
    useMemo: function(o, c) {
      var d = wr();
      c = c === void 0 ? null : c;
      var v = o();
      if (Ni) {
        zi(!0);
        try {
          o();
        } finally {
          zi(!1);
        }
      }
      return d.memoizedState = [v, c], v;
    },
    useReducer: function(o, c, d) {
      var v = wr();
      if (d !== void 0) {
        var T = d(c);
        if (Ni) {
          zi(!0);
          try {
            d(c);
          } finally {
            zi(!1);
          }
        }
      } else T = c;
      return v.memoizedState = v.baseState = T, o = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: o,
        lastRenderedState: T
      }, v.queue = o, o = o.dispatch = sy.bind(
        null,
        qe,
        o
      ), [v.memoizedState, o];
    },
    useRef: function(o) {
      var c = wr();
      return o = { current: o }, c.memoizedState = o;
    },
    useState: function(o) {
      o = _h(o);
      var c = o.queue, d = Wd.bind(null, qe, c);
      return c.dispatch = d, [o.memoizedState, d];
    },
    useDebugValue: bh,
    useDeferredValue: function(o, c) {
      var d = wr();
      return Sh(d, o, c);
    },
    useTransition: function() {
      var o = _h(!1);
      return o = xh.bind(
        null,
        qe,
        o.queue,
        !0,
        !1
      ), wr().memoizedState = o, [!1, o];
    },
    useSyncExternalStore: function(o, c, d) {
      var v = qe, T = wr();
      if (je) {
        if (d === void 0)
          throw Error(a(407));
        d = d();
      } else {
        if (d = c(), ii === null)
          throw Error(a(349));
        (Rn & 124) !== 0 || tf(v, c, d);
      }
      T.memoizedState = d;
      var M = { value: d, getSnapshot: c };
      return T.queue = M, Ti(Bd.bind(null, v, M, o), [
        o
      ]), v.flags |= 2048, zu(
        9,
        js(),
        Qm.bind(
          null,
          v,
          M,
          d,
          c
        ),
        null
      ), d;
    },
    useId: function() {
      var o = wr(), c = ii.identifierPrefix;
      if (je) {
        var d = oo, v = fi;
        d = (v & ~(1 << 32 - Gi(v) - 1)).toString(32) + d, c = "«" + c + "R" + d, d = Zc++, 0 < d && (c += "H" + d.toString(32)), c += "»";
      } else
        d = kd++, c = "«" + c + "r" + d.toString(32) + "»";
      return o.memoizedState = c;
    },
    useHostTransitionStatus: jl,
    useFormState: Fd,
    useActionState: Fd,
    useOptimistic: function(o) {
      var c = wr();
      c.memoizedState = c.baseState = o;
      var d = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: null,
        lastRenderedState: null
      };
      return c.queue = d, c = Qd.bind(
        null,
        qe,
        !0,
        d
      ), d.dispatch = c, [o, c];
    },
    useMemoCache: ta,
    useCacheRefresh: function() {
      return wr().memoizedState = Uu.bind(
        null,
        qe
      );
    }
  }, rp = {
    readContext: Di,
    use: Xm,
    useCallback: Ma,
    useContext: Di,
    useEffect: ps,
    useImperativeHandle: np,
    useInsertionEffect: hv,
    useLayoutEffect: Eh,
    useMemo: Fr,
    useReducer: Hd,
    useRef: nf,
    useState: function() {
      return Hd(co);
    },
    useDebugValue: bh,
    useDeferredValue: function(o, c) {
      var d = ki();
      return Kd(
        d,
        Ln.memoizedState,
        o,
        c
      );
    },
    useTransition: function() {
      var o = Hd(co)[0], c = ki().memoizedState;
      return [
        typeof o == "boolean" ? o : Jc(o),
        c
      ];
    },
    useSyncExternalStore: Wm,
    useId: Ca,
    useHostTransitionStatus: jl,
    useFormState: $d,
    useActionState: $d,
    useOptimistic: function(o, c) {
      var d = ki();
      return ef(d, Ln, o, c);
    },
    useMemoCache: ta,
    useCacheRefresh: ry
  }, ly = {
    readContext: Di,
    use: Xm,
    useCallback: Ma,
    useContext: Di,
    useEffect: ps,
    useImperativeHandle: np,
    useInsertionEffect: hv,
    useLayoutEffect: Eh,
    useMemo: Fr,
    useReducer: Zm,
    useRef: nf,
    useState: function() {
      return Zm(co);
    },
    useDebugValue: bh,
    useDeferredValue: function(o, c) {
      var d = ki();
      return Ln === null ? Sh(d, o, c) : Kd(
        d,
        Ln.memoizedState,
        o,
        c
      );
    },
    useTransition: function() {
      var o = Zm(co)[0], c = ki().memoizedState;
      return [
        typeof o == "boolean" ? o : Jc(o),
        c
      ];
    },
    useSyncExternalStore: Wm,
    useId: Ca,
    useHostTransitionStatus: jl,
    useFormState: an,
    useActionState: an,
    useOptimistic: function(o, c) {
      var d = ki();
      return Ln !== null ? ef(d, Ln, o, c) : (d.baseState = o, [o, d.queue.dispatch]);
    },
    useMemoCache: ta,
    useCacheRefresh: ry
  }, li = null, Rr = 0;
  function tg(o) {
    var c = Rr;
    return Rr += 1, li === null && (li = []), qm(li, o, c);
  }
  function eg(o, c) {
    c = c.props.ref, o.ref = c !== void 0 ? c : null;
  }
  function kl(o, c) {
    throw c.$$typeof === x ? Error(a(525)) : (o = Object.prototype.toString.call(c), Error(
      a(
        31,
        o === "[object Object]" ? "object with keys {" + Object.keys(c).join(", ") + "}" : o
      )
    ));
  }
  function va(o) {
    var c = o._init;
    return c(o._payload);
  }
  function sp(o) {
    function c(yt, ct) {
      if (o) {
        var Et = yt.deletions;
        Et === null ? (yt.deletions = [ct], yt.flags |= 16) : Et.push(ct);
      }
    }
    function d(yt, ct) {
      if (!o) return null;
      for (; ct !== null; )
        c(yt, ct), ct = ct.sibling;
      return null;
    }
    function v(yt) {
      for (var ct = /* @__PURE__ */ new Map(); yt !== null; )
        yt.key !== null ? ct.set(yt.key, yt) : ct.set(yt.index, yt), yt = yt.sibling;
      return ct;
    }
    function T(yt, ct) {
      return yt = Va(yt, ct), yt.index = 0, yt.sibling = null, yt;
    }
    function M(yt, ct, Et) {
      return yt.index = Et, o ? (Et = yt.alternate, Et !== null ? (Et = Et.index, Et < ct ? (yt.flags |= 67108866, ct) : Et) : (yt.flags |= 67108866, ct)) : (yt.flags |= 1048576, ct);
    }
    function P(yt) {
      return o && yt.alternate === null && (yt.flags |= 67108866), yt;
    }
    function q(yt, ct, Et, kt) {
      return ct === null || ct.tag !== 6 ? (ct = Au(Et, yt.mode, kt), ct.return = yt, ct) : (ct = T(ct, Et), ct.return = yt, ct);
    }
    function it(yt, ct, Et, kt) {
      var le = Et.type;
      return le === C ? jt(
        yt,
        ct,
        Et.props.children,
        kt,
        Et.key
      ) : ct !== null && (ct.elementType === le || typeof le == "object" && le !== null && le.$$typeof === ot && va(le) === ct.type) ? (ct = T(ct, Et.props), eg(ct, Et), ct.return = yt, ct) : (ct = en(
        Et.type,
        Et.key,
        Et.props,
        null,
        yt.mode,
        kt
      ), eg(ct, Et), ct.return = yt, ct);
    }
    function vt(yt, ct, Et, kt) {
      return ct === null || ct.tag !== 4 || ct.stateNode.containerInfo !== Et.containerInfo || ct.stateNode.implementation !== Et.implementation ? (ct = Cl(Et, yt.mode, kt), ct.return = yt, ct) : (ct = T(ct, Et.children || []), ct.return = yt, ct);
    }
    function jt(yt, ct, Et, kt, le) {
      return ct === null || ct.tag !== 7 ? (ct = Xt(
        Et,
        yt.mode,
        kt,
        le
      ), ct.return = yt, ct) : (ct = T(ct, Et), ct.return = yt, ct);
    }
    function Bt(yt, ct, Et) {
      if (typeof ct == "string" && ct !== "" || typeof ct == "number" || typeof ct == "bigint")
        return ct = Au(
          "" + ct,
          yt.mode,
          Et
        ), ct.return = yt, ct;
      if (typeof ct == "object" && ct !== null) {
        switch (ct.$$typeof) {
          case w:
            return Et = en(
              ct.type,
              ct.key,
              ct.props,
              null,
              yt.mode,
              Et
            ), eg(Et, ct), Et.return = yt, Et;
          case A:
            return ct = Cl(
              ct,
              yt.mode,
              Et
            ), ct.return = yt, ct;
          case ot:
            var kt = ct._init;
            return ct = kt(ct._payload), Bt(yt, ct, Et);
        }
        if (Ft(ct) || mt(ct))
          return ct = Xt(
            ct,
            yt.mode,
            Et,
            null
          ), ct.return = yt, ct;
        if (typeof ct.then == "function")
          return Bt(yt, tg(ct), Et);
        if (ct.$$typeof === H)
          return Bt(
            yt,
            ch(yt, ct),
            Et
          );
        kl(yt, ct);
      }
      return null;
    }
    function xt(yt, ct, Et, kt) {
      var le = ct !== null ? ct.key : null;
      if (typeof Et == "string" && Et !== "" || typeof Et == "number" || typeof Et == "bigint")
        return le !== null ? null : q(yt, ct, "" + Et, kt);
      if (typeof Et == "object" && Et !== null) {
        switch (Et.$$typeof) {
          case w:
            return Et.key === le ? it(yt, ct, Et, kt) : null;
          case A:
            return Et.key === le ? vt(yt, ct, Et, kt) : null;
          case ot:
            return le = Et._init, Et = le(Et._payload), xt(yt, ct, Et, kt);
        }
        if (Ft(Et) || mt(Et))
          return le !== null ? null : jt(yt, ct, Et, kt, null);
        if (typeof Et.then == "function")
          return xt(
            yt,
            ct,
            tg(Et),
            kt
          );
        if (Et.$$typeof === H)
          return xt(
            yt,
            ct,
            ch(yt, Et),
            kt
          );
        kl(yt, Et);
      }
      return null;
    }
    function bt(yt, ct, Et, kt, le) {
      if (typeof kt == "string" && kt !== "" || typeof kt == "number" || typeof kt == "bigint")
        return yt = yt.get(Et) || null, q(ct, yt, "" + kt, le);
      if (typeof kt == "object" && kt !== null) {
        switch (kt.$$typeof) {
          case w:
            return yt = yt.get(
              kt.key === null ? Et : kt.key
            ) || null, it(ct, yt, kt, le);
          case A:
            return yt = yt.get(
              kt.key === null ? Et : kt.key
            ) || null, vt(ct, yt, kt, le);
          case ot:
            var nn = kt._init;
            return kt = nn(kt._payload), bt(
              yt,
              ct,
              Et,
              kt,
              le
            );
        }
        if (Ft(kt) || mt(kt))
          return yt = yt.get(Et) || null, jt(ct, yt, kt, le, null);
        if (typeof kt.then == "function")
          return bt(
            yt,
            ct,
            Et,
            tg(kt),
            le
          );
        if (kt.$$typeof === H)
          return bt(
            yt,
            ct,
            Et,
            ch(ct, kt),
            le
          );
        kl(ct, kt);
      }
      return null;
    }
    function we(yt, ct, Et, kt) {
      for (var le = null, nn = null, ve = ct, Oe = ct = 0, Pa = null; ve !== null && Oe < Et.length; Oe++) {
        ve.index > Oe ? (Pa = ve, ve = null) : Pa = ve.sibling;
        var Cn = xt(
          yt,
          ve,
          Et[Oe],
          kt
        );
        if (Cn === null) {
          ve === null && (ve = Pa);
          break;
        }
        o && ve && Cn.alternate === null && c(yt, ve), ct = M(Cn, ct, Oe), nn === null ? le = Cn : nn.sibling = Cn, nn = Cn, ve = Pa;
      }
      if (Oe === Et.length)
        return d(yt, ve), je && la(yt, Oe), le;
      if (ve === null) {
        for (; Oe < Et.length; Oe++)
          ve = Bt(yt, Et[Oe], kt), ve !== null && (ct = M(
            ve,
            ct,
            Oe
          ), nn === null ? le = ve : nn.sibling = ve, nn = ve);
        return je && la(yt, Oe), le;
      }
      for (ve = v(ve); Oe < Et.length; Oe++)
        Pa = bt(
          ve,
          yt,
          Oe,
          Et[Oe],
          kt
        ), Pa !== null && (o && Pa.alternate !== null && ve.delete(
          Pa.key === null ? Oe : Pa.key
        ), ct = M(
          Pa,
          ct,
          Oe
        ), nn === null ? le = Pa : nn.sibling = Pa, nn = Pa);
      return o && ve.forEach(function(nl) {
        return c(yt, nl);
      }), je && la(yt, Oe), le;
    }
    function Ee(yt, ct, Et, kt) {
      if (Et == null) throw Error(a(151));
      for (var le = null, nn = null, ve = ct, Oe = ct = 0, Pa = null, Cn = Et.next(); ve !== null && !Cn.done; Oe++, Cn = Et.next()) {
        ve.index > Oe ? (Pa = ve, ve = null) : Pa = ve.sibling;
        var nl = xt(yt, ve, Cn.value, kt);
        if (nl === null) {
          ve === null && (ve = Pa);
          break;
        }
        o && ve && nl.alternate === null && c(yt, ve), ct = M(nl, ct, Oe), nn === null ? le = nl : nn.sibling = nl, nn = nl, ve = Pa;
      }
      if (Cn.done)
        return d(yt, ve), je && la(yt, Oe), le;
      if (ve === null) {
        for (; !Cn.done; Oe++, Cn = Et.next())
          Cn = Bt(yt, Cn.value, kt), Cn !== null && (ct = M(Cn, ct, Oe), nn === null ? le = Cn : nn.sibling = Cn, nn = Cn);
        return je && la(yt, Oe), le;
      }
      for (ve = v(ve); !Cn.done; Oe++, Cn = Et.next())
        Cn = bt(ve, yt, Oe, Cn.value, kt), Cn !== null && (o && Cn.alternate !== null && ve.delete(Cn.key === null ? Oe : Cn.key), ct = M(Cn, ct, Oe), nn === null ? le = Cn : nn.sibling = Cn, nn = Cn);
      return o && ve.forEach(function(NE) {
        return c(yt, NE);
      }), je && la(yt, Oe), le;
    }
    function jn(yt, ct, Et, kt) {
      if (typeof Et == "object" && Et !== null && Et.type === C && Et.key === null && (Et = Et.props.children), typeof Et == "object" && Et !== null) {
        switch (Et.$$typeof) {
          case w:
            t: {
              for (var le = Et.key; ct !== null; ) {
                if (ct.key === le) {
                  if (le = Et.type, le === C) {
                    if (ct.tag === 7) {
                      d(
                        yt,
                        ct.sibling
                      ), kt = T(
                        ct,
                        Et.props.children
                      ), kt.return = yt, yt = kt;
                      break t;
                    }
                  } else if (ct.elementType === le || typeof le == "object" && le !== null && le.$$typeof === ot && va(le) === ct.type) {
                    d(
                      yt,
                      ct.sibling
                    ), kt = T(ct, Et.props), eg(kt, Et), kt.return = yt, yt = kt;
                    break t;
                  }
                  d(yt, ct);
                  break;
                } else c(yt, ct);
                ct = ct.sibling;
              }
              Et.type === C ? (kt = Xt(
                Et.props.children,
                yt.mode,
                kt,
                Et.key
              ), kt.return = yt, yt = kt) : (kt = en(
                Et.type,
                Et.key,
                Et.props,
                null,
                yt.mode,
                kt
              ), eg(kt, Et), kt.return = yt, yt = kt);
            }
            return P(yt);
          case A:
            t: {
              for (le = Et.key; ct !== null; ) {
                if (ct.key === le)
                  if (ct.tag === 4 && ct.stateNode.containerInfo === Et.containerInfo && ct.stateNode.implementation === Et.implementation) {
                    d(
                      yt,
                      ct.sibling
                    ), kt = T(ct, Et.children || []), kt.return = yt, yt = kt;
                    break t;
                  } else {
                    d(yt, ct);
                    break;
                  }
                else c(yt, ct);
                ct = ct.sibling;
              }
              kt = Cl(Et, yt.mode, kt), kt.return = yt, yt = kt;
            }
            return P(yt);
          case ot:
            return le = Et._init, Et = le(Et._payload), jn(
              yt,
              ct,
              Et,
              kt
            );
        }
        if (Ft(Et))
          return we(
            yt,
            ct,
            Et,
            kt
          );
        if (mt(Et)) {
          if (le = mt(Et), typeof le != "function") throw Error(a(150));
          return Et = le.call(Et), Ee(
            yt,
            ct,
            Et,
            kt
          );
        }
        if (typeof Et.then == "function")
          return jn(
            yt,
            ct,
            tg(Et),
            kt
          );
        if (Et.$$typeof === H)
          return jn(
            yt,
            ct,
            ch(yt, Et),
            kt
          );
        kl(yt, Et);
      }
      return typeof Et == "string" && Et !== "" || typeof Et == "number" || typeof Et == "bigint" ? (Et = "" + Et, ct !== null && ct.tag === 6 ? (d(yt, ct.sibling), kt = T(ct, Et), kt.return = yt, yt = kt) : (d(yt, ct), kt = Au(Et, yt.mode, kt), kt.return = yt, yt = kt), P(yt)) : d(yt, ct);
    }
    return function(yt, ct, Et, kt) {
      try {
        Rr = 0;
        var le = jn(
          yt,
          ct,
          Et,
          kt
        );
        return li = null, le;
      } catch (ve) {
        if (ve === Ya || ve === gh) throw ve;
        var nn = Er(29, ve, null, yt.mode);
        return nn.lanes = kt, nn.return = yt, nn;
      } finally {
      }
    };
  }
  var Ea = sp(!0), uy = sp(!1), ea = j(null), lr = null;
  function Oa(o) {
    var c = o.alternate;
    st(Mi, Mi.current & 1), st(ea, o), lr === null && (c === null || Ho.current !== null || c.memoizedState !== null) && (lr = o);
  }
  function cy(o) {
    if (o.tag === 22) {
      if (st(Mi, Mi.current), st(ea, o), lr === null) {
        var c = o.alternate;
        c !== null && c.memoizedState !== null && (lr = o);
      }
    } else $a();
  }
  function $a() {
    st(Mi, Mi.current), st(ea, ea.current);
  }
  function ks(o) {
    X(ea), lr === o && (lr = null), X(Mi);
  }
  var Mi = j(0);
  function $r(o) {
    for (var c = o; c !== null; ) {
      if (c.tag === 13) {
        var d = c.memoizedState;
        if (d !== null && (d = d.dehydrated, d === null || d.data === "$?" || Mr(d)))
          return c;
      } else if (c.tag === 19 && c.memoizedProps.revealOrder !== void 0) {
        if ((c.flags & 128) !== 0) return c;
      } else if (c.child !== null) {
        c.child.return = c, c = c.child;
        continue;
      }
      if (c === o) break;
      for (; c.sibling === null; ) {
        if (c.return === null || c.return === o) return null;
        c = c.return;
      }
      c.sibling.return = c.return, c = c.sibling;
    }
    return null;
  }
  function af(o, c, d, v) {
    c = o.memoizedState, d = d(v, c), d = d == null ? c : b({}, c, d), o.memoizedState = d, o.lanes === 0 && (o.updateQueue.baseState = d);
  }
  var Vo = {
    enqueueSetState: function(o, c, d) {
      o = o._reactInternals;
      var v = cr(), T = Il(v);
      T.payload = c, d != null && (T.callback = d), c = xr(o, T, v), c !== null && (ts(c, o, v), Kc(c, o, v));
    },
    enqueueReplaceState: function(o, c, d) {
      o = o._reactInternals;
      var v = cr(), T = Il(v);
      T.tag = 1, T.payload = c, d != null && (T.callback = d), c = xr(o, T, v), c !== null && (ts(c, o, v), Kc(c, o, v));
    },
    enqueueForceUpdate: function(o, c) {
      o = o._reactInternals;
      var d = cr(), v = Il(d);
      v.tag = 2, c != null && (v.callback = c), c = xr(o, v, d), c !== null && (ts(c, o, d), Kc(c, o, d));
    }
  };
  function Rh(o, c, d, v, T, M, P) {
    return o = o.stateNode, typeof o.shouldComponentUpdate == "function" ? o.shouldComponentUpdate(v, M, P) : c.prototype && c.prototype.isPureReactComponent ? !jr(d, v) || !jr(T, M) : !0;
  }
  function Ah(o, c, d, v) {
    o = c.state, typeof c.componentWillReceiveProps == "function" && c.componentWillReceiveProps(d, v), typeof c.UNSAFE_componentWillReceiveProps == "function" && c.UNSAFE_componentWillReceiveProps(d, v), c.state !== o && Vo.enqueueReplaceState(c, c.state, null);
  }
  function _s(o, c) {
    var d = c;
    if ("ref" in c) {
      d = {};
      for (var v in c)
        v !== "ref" && (d[v] = c[v]);
    }
    if (o = o.defaultProps) {
      d === c && (d = b({}, d));
      for (var T in o)
        d[T] === void 0 && (d[T] = o[T]);
    }
    return d;
  }
  var ku = typeof reportError == "function" ? reportError : function(o) {
    if (typeof window == "object" && typeof window.ErrorEvent == "function") {
      var c = new window.ErrorEvent("error", {
        bubbles: !0,
        cancelable: !0,
        message: typeof o == "object" && o !== null && typeof o.message == "string" ? String(o.message) : String(o),
        error: o
      });
      if (!window.dispatchEvent(c)) return;
    } else if (typeof process == "object" && typeof process.emit == "function") {
      process.emit("uncaughtException", o);
      return;
    }
    console.error(o);
  };
  function op(o) {
    ku(o);
  }
  function Hu(o) {
    console.error(o);
  }
  function fy(o) {
    ku(o);
  }
  function Bu(o, c) {
    try {
      var d = o.onUncaughtError;
      d(c.value, { componentStack: c.stack });
    } catch (v) {
      setTimeout(function() {
        throw v;
      });
    }
  }
  function fo(o, c, d) {
    try {
      var v = o.onCaughtError;
      v(d.value, {
        componentStack: d.stack,
        errorBoundary: c.tag === 1 ? c.stateNode : null
      });
    } catch (T) {
      setTimeout(function() {
        throw T;
      });
    }
  }
  function ng(o, c, d) {
    return d = Il(d), d.tag = 3, d.payload = { element: null }, d.callback = function() {
      Bu(o, c);
    }, d;
  }
  function hy(o) {
    return o = Il(o), o.tag = 3, o;
  }
  function dy(o, c, d, v) {
    var T = d.type.getDerivedStateFromError;
    if (typeof T == "function") {
      var M = v.value;
      o.payload = function() {
        return T(M);
      }, o.callback = function() {
        fo(c, d, v);
      };
    }
    var P = d.stateNode;
    P !== null && typeof P.componentDidCatch == "function" && (o.callback = function() {
      fo(c, d, v), typeof T != "function" && ($o === null ? $o = /* @__PURE__ */ new Set([this]) : $o.add(this));
      var q = v.stack;
      this.componentDidCatch(v.value, {
        componentStack: q !== null ? q : ""
      });
    });
  }
  function Xr(o, c, d, v, T) {
    if (d.flags |= 32768, v !== null && typeof v == "object" && typeof v.then == "function") {
      if (c = d.alternate, c !== null && Ld(
        c,
        d,
        T,
        !0
      ), d = ea.current, d !== null) {
        switch (d.tag) {
          case 13:
            return lr === null ? tc() : d.alternate === null && Hi === 0 && (Hi = 3), d.flags &= -257, d.flags |= 65536, d.lanes = T, v === Bm ? d.flags |= 16384 : (c = d.updateQueue, c === null ? d.updateQueue = /* @__PURE__ */ new Set([v]) : c.add(v), bg(o, v, T)), !1;
          case 22:
            return d.flags |= 65536, v === Bm ? d.flags |= 16384 : (c = d.updateQueue, c === null ? (c = {
              transitions: null,
              markerInstances: null,
              retryQueue: /* @__PURE__ */ new Set([v])
            }, d.updateQueue = c) : (d = c.retryQueue, d === null ? c.retryQueue = /* @__PURE__ */ new Set([v]) : d.add(v)), bg(o, v, T)), !1;
        }
        throw Error(a(435, d.tag));
      }
      return bg(o, v, T), tc(), !1;
    }
    if (je)
      return c = ea.current, c !== null ? ((c.flags & 65536) === 0 && (c.flags |= 256), c.flags |= 65536, c.lanes = T, v !== Mu && (o = Error(a(422), { cause: v }), Dl(sr(o, d)))) : (v !== Mu && (c = Error(a(423), {
        cause: v
      }), Dl(
        sr(c, d)
      )), o = o.current.alternate, o.flags |= 65536, T &= -T, o.lanes |= T, v = sr(v, d), T = ng(
        o.stateNode,
        v,
        T
      ), ms(o, T), Hi !== 4 && (Hi = 2)), !1;
    var M = Error(a(520), { cause: v });
    if (M = sr(M, d), mg === null ? mg = [M] : mg.push(M), Hi !== 4 && (Hi = 2), c === null) return !0;
    v = sr(v, d), d = c;
    do {
      switch (d.tag) {
        case 3:
          return d.flags |= 65536, o = T & -T, d.lanes |= o, o = ng(d.stateNode, v, o), ms(d, o), !1;
        case 1:
          if (c = d.type, M = d.stateNode, (d.flags & 128) === 0 && (typeof c.getDerivedStateFromError == "function" || M !== null && typeof M.componentDidCatch == "function" && ($o === null || !$o.has(M))))
            return d.flags |= 65536, T &= -T, d.lanes |= T, T = hy(T), dy(
              T,
              o,
              d,
              v
            ), ms(d, T), !1;
      }
      d = d.return;
    } while (d !== null);
    return !1;
  }
  var gy = Error(a(461)), gn = !1;
  function di(o, c, d, v) {
    c.child = o === null ? uy(c, null, d, v) : Ea(
      c,
      o.child,
      d,
      v
    );
  }
  function ig(o, c, d, v, T) {
    d = d.render;
    var M = c.ref;
    if ("ref" in v) {
      var P = {};
      for (var q in v)
        q !== "ref" && (P[q] = v[q]);
    } else P = v;
    return Ou(c), v = Ym(
      o,
      c,
      d,
      P,
      M,
      T
    ), q = $m(), o !== null && !gn ? (Pu(o, c, T), go(o, c, T)) : (je && q && Dd(c), c.flags |= 1, di(o, c, v, T), c.child);
  }
  function lp(o, c, d, v, T) {
    if (o === null) {
      var M = d.type;
      return typeof M == "function" && !Ru(M) && M.defaultProps === void 0 && d.compare === null ? (c.tag = 15, c.type = M, ho(
        o,
        c,
        M,
        v,
        T
      )) : (o = en(
        d.type,
        null,
        v,
        c,
        c.mode,
        T
      ), o.ref = c.ref, o.return = c, c.child = o);
    }
    if (M = o.child, !Hs(o, T)) {
      var P = M.memoizedProps;
      if (d = d.compare, d = d !== null ? d : jr, d(P, v) && o.ref === c.ref)
        return go(o, c, T);
    }
    return c.flags |= 1, o = Va(M, v), o.ref = c.ref, o.return = c, c.child = o;
  }
  function ho(o, c, d, v, T) {
    if (o !== null) {
      var M = o.memoizedProps;
      if (jr(M, v) && o.ref === c.ref)
        if (gn = !1, c.pendingProps = v = M, Hs(o, T))
          (o.flags & 131072) !== 0 && (gn = !0);
        else
          return c.lanes = o.lanes, go(o, c, T);
    }
    return rf(
      o,
      c,
      d,
      v,
      T
    );
  }
  function Yo(o, c, d) {
    var v = c.pendingProps, T = v.children, M = o !== null ? o.memoizedState : null;
    if (v.mode === "hidden") {
      if ((c.flags & 128) !== 0) {
        if (v = M !== null ? M.baseLanes | d : d, o !== null) {
          for (T = c.child = o.child, M = 0; T !== null; )
            M = M | T.lanes | T.childLanes, T = T.sibling;
          c.childLanes = M & ~v;
        } else c.childLanes = 0, c.child = null;
        return Hl(
          o,
          c,
          v,
          d
        );
      }
      if ((d & 536870912) !== 0)
        c.memoizedState = { baseLanes: 0, cachePool: null }, o !== null && dh(
          c,
          M !== null ? M.cachePool : null
        ), M !== null ? Bo(c, M) : ca(), cy(c);
      else
        return c.lanes = c.childLanes = 536870912, Hl(
          o,
          c,
          M !== null ? M.baseLanes | d : d,
          d
        );
    } else
      M !== null ? (dh(c, M.cachePool), Bo(c, M), $a(), c.memoizedState = null) : (o !== null && dh(c, null), ca(), $a());
    return di(o, c, T, d), c.child;
  }
  function Hl(o, c, d, v) {
    var T = Us();
    return T = T === null ? null : { parent: ei._currentValue, pool: T }, c.memoizedState = {
      baseLanes: d,
      cachePool: T
    }, o !== null && dh(c, null), ca(), cy(c), o !== null && Ld(o, c, v, !0), null;
  }
  function ye(o, c) {
    var d = c.ref;
    if (d === null)
      o !== null && o.ref !== null && (c.flags |= 4194816);
    else {
      if (typeof d != "function" && typeof d != "object")
        throw Error(a(284));
      (o === null || o.ref !== d) && (c.flags |= 4194816);
    }
  }
  function rf(o, c, d, v, T) {
    return Ou(c), d = Ym(
      o,
      c,
      d,
      v,
      void 0,
      T
    ), v = $m(), o !== null && !gn ? (Pu(o, c, T), go(o, c, T)) : (je && v && Dd(c), c.flags |= 1, di(o, c, d, T), c.child);
  }
  function ag(o, c, d, v, T, M) {
    return Ou(c), c.updateQueue = null, d = Iu(
      c,
      v,
      d,
      T
    ), ny(o), v = $m(), o !== null && !gn ? (Pu(o, c, M), go(o, c, M)) : (je && v && Dd(c), c.flags |= 1, di(o, c, d, M), c.child);
  }
  function Bl(o, c, d, v, T) {
    if (Ou(c), c.stateNode === null) {
      var M = wu, P = d.contextType;
      typeof P == "object" && P !== null && (M = Di(P)), M = new d(v, M), c.memoizedState = M.state !== null && M.state !== void 0 ? M.state : null, M.updater = Vo, c.stateNode = M, M._reactInternals = c, M = c.stateNode, M.props = v, M.state = c.memoizedState, M.refs = {}, Ll(c), P = d.contextType, M.context = typeof P == "object" && P !== null ? Di(P) : wu, M.state = c.memoizedState, P = d.getDerivedStateFromProps, typeof P == "function" && (af(
        c,
        d,
        P,
        v
      ), M.state = c.memoizedState), typeof d.getDerivedStateFromProps == "function" || typeof M.getSnapshotBeforeUpdate == "function" || typeof M.UNSAFE_componentWillMount != "function" && typeof M.componentWillMount != "function" || (P = M.state, typeof M.componentWillMount == "function" && M.componentWillMount(), typeof M.UNSAFE_componentWillMount == "function" && M.UNSAFE_componentWillMount(), P !== M.state && Vo.enqueueReplaceState(M, M.state, null), Fa(c, v, M, T), uo(), M.state = c.memoizedState), typeof M.componentDidMount == "function" && (c.flags |= 4194308), v = !0;
    } else if (o === null) {
      M = c.stateNode;
      var q = c.memoizedProps, it = _s(d, q);
      M.props = it;
      var vt = M.context, jt = d.contextType;
      P = wu, typeof jt == "object" && jt !== null && (P = Di(jt));
      var Bt = d.getDerivedStateFromProps;
      jt = typeof Bt == "function" || typeof M.getSnapshotBeforeUpdate == "function", q = c.pendingProps !== q, jt || typeof M.UNSAFE_componentWillReceiveProps != "function" && typeof M.componentWillReceiveProps != "function" || (q || vt !== P) && Ah(
        c,
        M,
        v,
        P
      ), lo = !1;
      var xt = c.memoizedState;
      M.state = xt, Fa(c, v, M, T), uo(), vt = c.memoizedState, q || xt !== vt || lo ? (typeof Bt == "function" && (af(
        c,
        d,
        Bt,
        v
      ), vt = c.memoizedState), (it = lo || Rh(
        c,
        d,
        it,
        v,
        xt,
        vt,
        P
      )) ? (jt || 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" && (c.flags |= 4194308)) : (typeof M.componentDidMount == "function" && (c.flags |= 4194308), c.memoizedProps = v, c.memoizedState = vt), M.props = v, M.state = vt, M.context = P, v = it) : (typeof M.componentDidMount == "function" && (c.flags |= 4194308), v = !1);
    } else {
      M = c.stateNode, Xc(o, c), P = c.memoizedProps, jt = _s(d, P), M.props = jt, Bt = c.pendingProps, xt = M.context, vt = d.contextType, it = wu, typeof vt == "object" && vt !== null && (it = Di(vt)), q = d.getDerivedStateFromProps, (vt = typeof q == "function" || typeof M.getSnapshotBeforeUpdate == "function") || typeof M.UNSAFE_componentWillReceiveProps != "function" && typeof M.componentWillReceiveProps != "function" || (P !== Bt || xt !== it) && Ah(
        c,
        M,
        v,
        it
      ), lo = !1, xt = c.memoizedState, M.state = xt, Fa(c, v, M, T), uo();
      var bt = c.memoizedState;
      P !== Bt || xt !== bt || lo || o !== null && o.dependencies !== null && Id(o.dependencies) ? (typeof q == "function" && (af(
        c,
        d,
        q,
        v
      ), bt = c.memoizedState), (jt = lo || Rh(
        c,
        d,
        jt,
        v,
        xt,
        bt,
        it
      ) || o !== null && o.dependencies !== null && Id(o.dependencies)) ? (vt || typeof M.UNSAFE_componentWillUpdate != "function" && typeof M.componentWillUpdate != "function" || (typeof M.componentWillUpdate == "function" && M.componentWillUpdate(v, bt, it), typeof M.UNSAFE_componentWillUpdate == "function" && M.UNSAFE_componentWillUpdate(
        v,
        bt,
        it
      )), typeof M.componentDidUpdate == "function" && (c.flags |= 4), typeof M.getSnapshotBeforeUpdate == "function" && (c.flags |= 1024)) : (typeof M.componentDidUpdate != "function" || P === o.memoizedProps && xt === o.memoizedState || (c.flags |= 4), typeof M.getSnapshotBeforeUpdate != "function" || P === o.memoizedProps && xt === o.memoizedState || (c.flags |= 1024), c.memoizedProps = v, c.memoizedState = bt), M.props = v, M.state = bt, M.context = it, v = jt) : (typeof M.componentDidUpdate != "function" || P === o.memoizedProps && xt === o.memoizedState || (c.flags |= 4), typeof M.getSnapshotBeforeUpdate != "function" || P === o.memoizedProps && xt === o.memoizedState || (c.flags |= 1024), v = !1);
    }
    return M = v, ye(o, c), v = (c.flags & 128) !== 0, M || v ? (M = c.stateNode, d = v && typeof d.getDerivedStateFromError != "function" ? null : M.render(), c.flags |= 1, o !== null && v ? (c.child = Ea(
      c,
      o.child,
      null,
      T
    ), c.child = Ea(
      c,
      null,
      d,
      T
    )) : di(o, c, d, T), c.memoizedState = M.state, o = c.child) : o = go(
      o,
      c,
      T
    ), o;
  }
  function up(o, c, d, v) {
    return uh(), c.flags |= 256, di(o, c, d, v), c.child;
  }
  var sf = {
    dehydrated: null,
    treeContext: null,
    retryLane: 0,
    hydrationErrors: null
  };
  function rg(o) {
    return { baseLanes: o, cachePool: zd() };
  }
  function Da(o, c, d) {
    return o = o !== null ? o.childLanes & ~d : 0, c && (o |= ba), o;
  }
  function mv(o, c, d) {
    var v = c.pendingProps, T = !1, M = (c.flags & 128) !== 0, P;
    if ((P = M) || (P = o !== null && o.memoizedState === null ? !1 : (Mi.current & 2) !== 0), P && (T = !0, c.flags &= -129), P = (c.flags & 32) !== 0, c.flags &= -33, o === null) {
      if (je) {
        if (T ? Oa(c) : $a(), je) {
          var q = Bn, it;
          if (it = q) {
            t: {
              for (it = q, q = _a; it.nodeType !== 8; ) {
                if (!q) {
                  q = null;
                  break t;
                }
                if (it = bo(
                  it.nextSibling
                ), it === null) {
                  q = null;
                  break t;
                }
              }
              q = it;
            }
            q !== null ? (c.memoizedState = {
              dehydrated: q,
              treeContext: oi !== null ? { id: fi, overflow: oo } : null,
              retryLane: 536870912,
              hydrationErrors: null
            }, it = Er(
              18,
              null,
              null,
              0
            ), it.stateNode = q, it.return = c, c.child = it, hi = c, Bn = null, it = !0) : it = !1;
          }
          it || or(c);
        }
        if (q = c.memoizedState, q !== null && (q = q.dehydrated, q !== null))
          return Mr(q) ? c.lanes = 32 : c.lanes = 536870912, null;
        ks(c);
      }
      return q = v.children, v = v.fallback, T ? ($a(), T = c.mode, q = Mh(
        { mode: "hidden", children: q },
        T
      ), v = Xt(
        v,
        T,
        d,
        null
      ), q.return = c, v.return = c, q.sibling = v, c.child = q, T = c.child, T.memoizedState = rg(d), T.childLanes = Da(
        o,
        P,
        d
      ), c.memoizedState = sf, v) : (Oa(c), cp(c, q));
    }
    if (it = o.memoizedState, it !== null && (q = it.dehydrated, q !== null)) {
      if (M)
        c.flags & 256 ? (Oa(c), c.flags &= -257, c = my(
          o,
          c,
          d
        )) : c.memoizedState !== null ? ($a(), c.child = o.child, c.flags |= 128, c = null) : ($a(), T = v.fallback, q = c.mode, v = Mh(
          { mode: "visible", children: v.children },
          q
        ), T = Xt(
          T,
          q,
          d,
          null
        ), T.flags |= 2, v.return = c, T.return = c, v.sibling = T, c.child = v, Ea(
          c,
          o.child,
          null,
          d
        ), v = c.child, v.memoizedState = rg(d), v.childLanes = Da(
          o,
          P,
          d
        ), c.memoizedState = sf, c = T);
      else if (Oa(c), Mr(q)) {
        if (P = q.nextSibling && q.nextSibling.dataset, P) var vt = P.dgst;
        P = vt, v = Error(a(419)), v.stack = "", v.digest = P, Dl({ value: v, source: null, stack: null }), c = my(
          o,
          c,
          d
        );
      } else if (gn || Ld(o, c, d, !1), P = (d & o.childLanes) !== 0, gn || P) {
        if (P = ii, P !== null && (v = d & -d, v = (v & 42) !== 0 ? 1 : Ae(v), v = (v & (P.suspendedLanes | d)) !== 0 ? 0 : v, v !== 0 && v !== it.retryLane))
          throw it.retryLane = v, Go(o, v), ts(P, o, v), gy;
        q.data === "$?" || tc(), c = my(
          o,
          c,
          d
        );
      } else
        q.data === "$?" ? (c.flags |= 192, c.child = o.child, c = null) : (o = it.treeContext, Bn = bo(
          q.nextSibling
        ), hi = c, je = !0, ds = null, _a = !1, o !== null && (qr[Gs++] = fi, qr[Gs++] = oo, qr[Gs++] = oi, fi = o.id, oo = o.overflow, oi = c), c = cp(
          c,
          v.children
        ), c.flags |= 4096);
      return c;
    }
    return T ? ($a(), T = v.fallback, q = c.mode, it = o.child, vt = it.sibling, v = Va(it, {
      mode: "hidden",
      children: v.children
    }), v.subtreeFlags = it.subtreeFlags & 65011712, vt !== null ? T = Va(vt, T) : (T = Xt(
      T,
      q,
      d,
      null
    ), T.flags |= 2), T.return = c, v.return = c, v.sibling = T, c.child = v, v = T, T = c.child, q = o.child.memoizedState, q === null ? q = rg(d) : (it = q.cachePool, it !== null ? (vt = ei._currentValue, it = it.parent !== vt ? { parent: vt, pool: vt } : it) : it = zd(), q = {
      baseLanes: q.baseLanes | d,
      cachePool: it
    }), T.memoizedState = q, T.childLanes = Da(
      o,
      P,
      d
    ), c.memoizedState = sf, v) : (Oa(c), d = o.child, o = d.sibling, d = Va(d, {
      mode: "visible",
      children: v.children
    }), d.return = c, d.sibling = null, o !== null && (P = c.deletions, P === null ? (c.deletions = [o], c.flags |= 16) : P.push(o)), c.child = d, c.memoizedState = null, d);
  }
  function cp(o, c) {
    return c = Mh(
      { mode: "visible", children: c },
      o.mode
    ), c.return = o, o.child = c;
  }
  function Mh(o, c) {
    return o = Er(22, o, null, c), o.lanes = 0, o.stateNode = {
      _visibility: 1,
      _pendingMarkers: null,
      _retryCache: null,
      _transitions: null
    }, o;
  }
  function my(o, c, d) {
    return Ea(c, o.child, null, d), o = cp(
      c,
      c.pendingProps.children
    ), o.flags |= 2, c.memoizedState = null, o;
  }
  function qu(o, c, d) {
    o.lanes |= c;
    var v = o.alternate;
    v !== null && (v.lanes |= c), Sr(o.return, c, d);
  }
  function Ch(o, c, d, v, T) {
    var M = o.memoizedState;
    M === null ? o.memoizedState = {
      isBackwards: c,
      rendering: null,
      renderingStartTime: 0,
      last: v,
      tail: d,
      tailMode: T
    } : (M.isBackwards = c, M.rendering = null, M.renderingStartTime = 0, M.last = v, M.tail = d, M.tailMode = T);
  }
  function py(o, c, d) {
    var v = c.pendingProps, T = v.revealOrder, M = v.tail;
    if (di(o, c, v.children, d), v = Mi.current, (v & 2) !== 0)
      v = v & 1 | 2, c.flags |= 128;
    else {
      if (o !== null && (o.flags & 128) !== 0)
        t: for (o = c.child; o !== null; ) {
          if (o.tag === 13)
            o.memoizedState !== null && qu(o, d, c);
          else if (o.tag === 19)
            qu(o, d, c);
          else if (o.child !== null) {
            o.child.return = o, o = o.child;
            continue;
          }
          if (o === c) break t;
          for (; o.sibling === null; ) {
            if (o.return === null || o.return === c)
              break t;
            o = o.return;
          }
          o.sibling.return = o.return, o = o.sibling;
        }
      v &= 1;
    }
    switch (st(Mi, v), T) {
      case "forwards":
        for (d = c.child, T = null; d !== null; )
          o = d.alternate, o !== null && $r(o) === null && (T = d), d = d.sibling;
        d = T, d === null ? (T = c.child, c.child = null) : (T = d.sibling, d.sibling = null), Ch(
          c,
          !1,
          T,
          d,
          M
        );
        break;
      case "backwards":
        for (d = null, T = c.child, c.child = null; T !== null; ) {
          if (o = T.alternate, o !== null && $r(o) === null) {
            c.child = T;
            break;
          }
          o = T.sibling, T.sibling = d, d = T, T = o;
        }
        Ch(
          c,
          !0,
          d,
          null,
          M
        );
        break;
      case "together":
        Ch(c, !1, null, null, void 0);
        break;
      default:
        c.memoizedState = null;
    }
    return c.child;
  }
  function go(o, c, d) {
    if (o !== null && (c.dependencies = o.dependencies), Zu |= c.lanes, (d & c.childLanes) === 0)
      if (o !== null) {
        if (Ld(
          o,
          c,
          d,
          !1
        ), (d & c.childLanes) === 0)
          return null;
      } else return null;
    if (o !== null && c.child !== o.child)
      throw Error(a(153));
    if (c.child !== null) {
      for (o = c.child, d = Va(o, o.pendingProps), c.child = d, d.return = c; o.sibling !== null; )
        o = o.sibling, d = d.sibling = Va(o, o.pendingProps), d.return = c;
      d.sibling = null;
    }
    return c.child;
  }
  function Hs(o, c) {
    return (o.lanes & c) !== 0 ? !0 : (o = o.dependencies, !!(o !== null && Id(o)));
  }
  function ur(o, c, d) {
    switch (c.tag) {
      case 3:
        Qt(c, c.stateNode.containerInfo), br(c, ei, o.memoizedState.cache), uh();
        break;
      case 27:
      case 5:
        ce(c);
        break;
      case 4:
        Qt(c, c.stateNode.containerInfo);
        break;
      case 10:
        br(
          c,
          c.type,
          c.memoizedProps.value
        );
        break;
      case 13:
        var v = c.memoizedState;
        if (v !== null)
          return v.dehydrated !== null ? (Oa(c), c.flags |= 128, null) : (d & c.child.childLanes) !== 0 ? mv(o, c, d) : (Oa(c), o = go(
            o,
            c,
            d
          ), o !== null ? o.sibling : null);
        Oa(c);
        break;
      case 19:
        var T = (o.flags & 128) !== 0;
        if (v = (d & c.childLanes) !== 0, v || (Ld(
          o,
          c,
          d,
          !1
        ), v = (d & c.childLanes) !== 0), T) {
          if (v)
            return py(
              o,
              c,
              d
            );
          c.flags |= 128;
        }
        if (T = c.memoizedState, T !== null && (T.rendering = null, T.tail = null, T.lastEffect = null), st(Mi, Mi.current), v) break;
        return null;
      case 22:
      case 23:
        return c.lanes = 0, Yo(o, c, d);
      case 24:
        br(c, ei, o.memoizedState.cache);
    }
    return go(o, c, d);
  }
  function sg(o, c, d) {
    if (o !== null)
      if (o.memoizedProps !== c.pendingProps)
        gn = !0;
      else {
        if (!Hs(o, d) && (c.flags & 128) === 0)
          return gn = !1, ur(
            o,
            c,
            d
          );
        gn = (o.flags & 131072) !== 0;
      }
    else
      gn = !1, je && (c.flags & 1048576) !== 0 && zn(c, oh, c.index);
    switch (c.lanes = 0, c.tag) {
      case 16:
        t: {
          o = c.pendingProps;
          var v = c.elementType, T = v._init;
          if (v = T(v._payload), c.type = v, typeof v == "function")
            Ru(v) ? (o = _s(v, o), c.tag = 1, c = Bl(
              null,
              c,
              v,
              o,
              d
            )) : (c.tag = 0, c = rf(
              null,
              c,
              v,
              o,
              d
            ));
          else {
            if (v != null) {
              if (T = v.$$typeof, T === B) {
                c.tag = 11, c = ig(
                  null,
                  c,
                  v,
                  o,
                  d
                );
                break t;
              } else if (T === et) {
                c.tag = 14, c = lp(
                  null,
                  c,
                  v,
                  o,
                  d
                );
                break t;
              }
            }
            throw c = Ut(v) || v, Error(a(306, c, ""));
          }
        }
        return c;
      case 0:
        return rf(
          o,
          c,
          c.type,
          c.pendingProps,
          d
        );
      case 1:
        return v = c.type, T = _s(
          v,
          c.pendingProps
        ), Bl(
          o,
          c,
          v,
          T,
          d
        );
      case 3:
        t: {
          if (Qt(
            c,
            c.stateNode.containerInfo
          ), o === null) throw Error(a(387));
          v = c.pendingProps;
          var M = c.memoizedState;
          T = M.element, Xc(o, c), Fa(c, v, null, d);
          var P = c.memoizedState;
          if (v = P.cache, br(c, ei, v), v !== M.cache && fn(
            c,
            [ei],
            d,
            !0
          ), uo(), v = P.element, M.isDehydrated)
            if (M = {
              element: v,
              isDehydrated: !1,
              cache: P.cache
            }, c.updateQueue.baseState = M, c.memoizedState = M, c.flags & 256) {
              c = up(
                o,
                c,
                v,
                d
              );
              break t;
            } else if (v !== T) {
              T = sr(
                Error(a(424)),
                c
              ), Dl(T), c = up(
                o,
                c,
                v,
                d
              );
              break t;
            } else {
              switch (o = c.stateNode.containerInfo, o.nodeType) {
                case 9:
                  o = o.body;
                  break;
                default:
                  o = o.nodeName === "HTML" ? o.ownerDocument.body : o;
              }
              for (Bn = bo(o.firstChild), hi = c, je = !0, ds = null, _a = !0, d = uy(
                c,
                null,
                v,
                d
              ), c.child = d; d; )
                d.flags = d.flags & -3 | 4096, d = d.sibling;
            }
          else {
            if (uh(), v === T) {
              c = go(
                o,
                c,
                d
              );
              break t;
            }
            di(
              o,
              c,
              v,
              d
            );
          }
          c = c.child;
        }
        return c;
      case 26:
        return ye(o, c), o === null ? (d = Dp(
          c.type,
          null,
          c.pendingProps,
          null
        )) ? c.memoizedState = d : je || (d = c.type, o = c.pendingProps, v = tu(
          It.current
        ).createElement(d), v[un] = c, v[cn] = o, Tt(v, d, o), Qi(v), c.stateNode = v) : c.memoizedState = Dp(
          c.type,
          o.memoizedProps,
          c.pendingProps,
          o.memoizedState
        ), null;
      case 27:
        return ce(c), o === null && je && (v = c.stateNode = Wa(
          c.type,
          c.pendingProps,
          It.current
        ), hi = c, _a = !0, T = Bn, aa(c.type) ? (Iy = T, Bn = bo(
          v.firstChild
        )) : Bn = T), di(
          o,
          c,
          c.pendingProps.children,
          d
        ), ye(o, c), o === null && (c.flags |= 4194304), c.child;
      case 5:
        return o === null && je && ((T = v = Bn) && (v = Op(
          v,
          c.type,
          c.pendingProps,
          _a
        ), v !== null ? (c.stateNode = v, hi = c, Bn = bo(
          v.firstChild
        ), _a = !1, T = !0) : T = !1), T || or(c)), ce(c), T = c.type, M = c.pendingProps, P = o !== null ? o.memoizedProps : null, v = M.children, rc(T, M) ? v = null : P !== null && rc(T, P) && (c.flags |= 32), c.memoizedState !== null && (T = Ym(
          o,
          c,
          Fm,
          null,
          null,
          d
        ), La._currentValue = T), ye(o, c), di(o, c, v, d), c.child;
      case 6:
        return o === null && je && ((o = d = Bn) && (d = eu(
          d,
          c.pendingProps,
          _a
        ), d !== null ? (c.stateNode = d, hi = c, Bn = null, o = !0) : o = !1), o || or(c)), null;
      case 13:
        return mv(o, c, d);
      case 4:
        return Qt(
          c,
          c.stateNode.containerInfo
        ), v = c.pendingProps, o === null ? c.child = Ea(
          c,
          null,
          v,
          d
        ) : di(
          o,
          c,
          v,
          d
        ), c.child;
      case 11:
        return ig(
          o,
          c,
          c.type,
          c.pendingProps,
          d
        );
      case 7:
        return di(
          o,
          c,
          c.pendingProps,
          d
        ), c.child;
      case 8:
        return di(
          o,
          c,
          c.pendingProps.children,
          d
        ), c.child;
      case 12:
        return di(
          o,
          c,
          c.pendingProps.children,
          d
        ), c.child;
      case 10:
        return v = c.pendingProps, br(c, c.type, v.value), di(
          o,
          c,
          v.children,
          d
        ), c.child;
      case 9:
        return T = c.type._context, v = c.pendingProps.children, Ou(c), T = Di(T), v = v(T), c.flags |= 1, di(o, c, v, d), c.child;
      case 14:
        return lp(
          o,
          c,
          c.type,
          c.pendingProps,
          d
        );
      case 15:
        return ho(
          o,
          c,
          c.type,
          c.pendingProps,
          d
        );
      case 19:
        return py(o, c, d);
      case 31:
        return v = c.pendingProps, d = c.mode, v = {
          mode: v.mode,
          children: v.children
        }, o === null ? (d = Mh(
          v,
          d
        ), d.ref = c.ref, c.child = d, d.return = c, c = d) : (d = Va(o.child, v), d.ref = c.ref, c.child = d, d.return = c, c = d), c;
      case 22:
        return Yo(o, c, d);
      case 24:
        return Ou(c), v = Di(ei), o === null ? (T = Us(), T === null && (T = ii, M = W0(), T.pooledCache = M, M.refCount++, M !== null && (T.pooledCacheLanes |= d), T = M), c.memoizedState = {
          parent: v,
          cache: T
        }, Ll(c), br(c, ei, T)) : ((o.lanes & d) !== 0 && (Xc(o, c), Fa(c, null, null, d), uo()), T = o.memoizedState, M = c.memoizedState, T.parent !== v ? (T = { parent: v, cache: v }, c.memoizedState = T, c.lanes === 0 && (c.memoizedState = c.updateQueue.baseState = T), br(c, ei, v)) : (v = M.cache, br(c, ei, v), v !== T.cache && fn(
          c,
          [ei],
          d,
          !0
        ))), di(
          o,
          c,
          c.pendingProps.children,
          d
        ), c.child;
      case 29:
        throw c.pendingProps;
    }
    throw Error(a(156, c.tag));
  }
  function ql(o) {
    o.flags |= 4;
  }
  function og(o, c) {
    if (c.type !== "stylesheet" || (c.state.loading & 4) !== 0)
      o.flags &= -16777217;
    else if (o.flags |= 16777216, !ga(c)) {
      if (c = ea.current, c !== null && ((Rn & 4194048) === Rn ? lr !== null : (Rn & 62914560) !== Rn && (Rn & 536870912) === 0 || c !== lr))
        throw $c = Bm, Gd;
      o.flags |= 8192;
    }
  }
  function Vu(o, c) {
    c !== null && (o.flags |= 4), o.flags & 16384 && (c = o.tag !== 22 ? Kt() : 536870912, o.lanes |= c, Lh |= c);
  }
  function Oh(o, c) {
    if (!je)
      switch (o.tailMode) {
        case "hidden":
          c = o.tail;
          for (var d = null; c !== null; )
            c.alternate !== null && (d = c), c = c.sibling;
          d === null ? o.tail = null : d.sibling = null;
          break;
        case "collapsed":
          d = o.tail;
          for (var v = null; d !== null; )
            d.alternate !== null && (v = d), d = d.sibling;
          v === null ? c || o.tail === null ? o.tail = null : o.tail.sibling = null : v.sibling = null;
      }
  }
  function ni(o) {
    var c = o.alternate !== null && o.alternate.child === o.child, d = 0, v = 0;
    if (c)
      for (var T = o.child; T !== null; )
        d |= T.lanes | T.childLanes, v |= T.subtreeFlags & 65011712, v |= T.flags & 65011712, T.return = o, T = T.sibling;
    else
      for (T = o.child; T !== null; )
        d |= T.lanes | T.childLanes, v |= T.subtreeFlags, v |= T.flags, T.return = o, T = T.sibling;
    return o.subtreeFlags |= v, o.childLanes = d, c;
  }
  function Wn(o, c, d) {
    var v = c.pendingProps;
    switch (Ol(c), c.tag) {
      case 31:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return ni(c), null;
      case 1:
        return ni(c), null;
      case 3:
        return d = c.stateNode, v = null, o !== null && (v = o.memoizedState.cache), c.memoizedState.cache !== v && (c.flags |= 2048), gs(ei), ee(), d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null), (o === null || o.child === null) && (lh(c) ? ql(c) : o === null || o.memoizedState.isDehydrated && (c.flags & 256) === 0 || (c.flags |= 1024, K0())), ni(c), null;
      case 26:
        return d = c.memoizedState, o === null ? (ql(c), d !== null ? (ni(c), og(c, d)) : (ni(c), c.flags &= -16777217)) : d ? d !== o.memoizedState ? (ql(c), ni(c), og(c, d)) : (ni(c), c.flags &= -16777217) : (o.memoizedProps !== v && ql(c), ni(c), c.flags &= -16777217), null;
      case 27:
        pe(c), d = It.current;
        var T = c.type;
        if (o !== null && c.stateNode != null)
          o.memoizedProps !== v && ql(c);
        else {
          if (!v) {
            if (c.stateNode === null)
              throw Error(a(166));
            return ni(c), null;
          }
          o = At.current, lh(c) ? km(c) : (o = Wa(T, v, d), c.stateNode = o, ql(c));
        }
        return ni(c), null;
      case 5:
        if (pe(c), d = c.type, o !== null && c.stateNode != null)
          o.memoizedProps !== v && ql(c);
        else {
          if (!v) {
            if (c.stateNode === null)
              throw Error(a(166));
            return ni(c), null;
          }
          if (o = At.current, lh(c))
            km(c);
          else {
            switch (T = tu(
              It.current
            ), o) {
              case 1:
                o = T.createElementNS(
                  "http://www.w3.org/2000/svg",
                  d
                );
                break;
              case 2:
                o = T.createElementNS(
                  "http://www.w3.org/1998/Math/MathML",
                  d
                );
                break;
              default:
                switch (d) {
                  case "svg":
                    o = T.createElementNS(
                      "http://www.w3.org/2000/svg",
                      d
                    );
                    break;
                  case "math":
                    o = T.createElementNS(
                      "http://www.w3.org/1998/Math/MathML",
                      d
                    );
                    break;
                  case "script":
                    o = T.createElement("div"), o.innerHTML = "<script><\/script>", o = o.removeChild(o.firstChild);
                    break;
                  case "select":
                    o = typeof v.is == "string" ? T.createElement("select", { is: v.is }) : T.createElement("select"), v.multiple ? o.multiple = !0 : v.size && (o.size = v.size);
                    break;
                  default:
                    o = typeof v.is == "string" ? T.createElement(d, { is: v.is }) : T.createElement(d);
                }
            }
            o[un] = c, o[cn] = v;
            t: for (T = c.child; T !== null; ) {
              if (T.tag === 5 || T.tag === 6)
                o.appendChild(T.stateNode);
              else if (T.tag !== 4 && T.tag !== 27 && T.child !== null) {
                T.child.return = T, T = T.child;
                continue;
              }
              if (T === c) break t;
              for (; T.sibling === null; ) {
                if (T.return === null || T.return === c)
                  break t;
                T = T.return;
              }
              T.sibling.return = T.return, T = T.sibling;
            }
            c.stateNode = o;
            t: switch (Tt(o, d, v), d) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                o = !!v.autoFocus;
                break t;
              case "img":
                o = !0;
                break t;
              default:
                o = !1;
            }
            o && ql(c);
          }
        }
        return ni(c), c.flags &= -16777217, null;
      case 6:
        if (o && c.stateNode != null)
          o.memoizedProps !== v && ql(c);
        else {
          if (typeof v != "string" && c.stateNode === null)
            throw Error(a(166));
          if (o = It.current, lh(c)) {
            if (o = c.stateNode, d = c.memoizedProps, v = null, T = hi, T !== null)
              switch (T.tag) {
                case 27:
                case 5:
                  v = T.memoizedProps;
              }
            o[un] = c, o = !!(o.nodeValue === d || v !== null && v.suppressHydrationWarning === !0 || Nv(o.nodeValue, d)), o || or(c);
          } else
            o = tu(o).createTextNode(
              v
            ), o[un] = c, c.stateNode = o;
        }
        return ni(c), null;
      case 13:
        if (v = c.memoizedState, o === null || o.memoizedState !== null && o.memoizedState.dehydrated !== null) {
          if (T = lh(c), v !== null && v.dehydrated !== null) {
            if (o === null) {
              if (!T) throw Error(a(318));
              if (T = c.memoizedState, T = T !== null ? T.dehydrated : null, !T) throw Error(a(317));
              T[un] = c;
            } else
              uh(), (c.flags & 128) === 0 && (c.memoizedState = null), c.flags |= 4;
            ni(c), T = !1;
          } else
            T = K0(), o !== null && o.memoizedState !== null && (o.memoizedState.hydrationErrors = T), T = !0;
          if (!T)
            return c.flags & 256 ? (ks(c), c) : (ks(c), null);
        }
        if (ks(c), (c.flags & 128) !== 0)
          return c.lanes = d, c;
        if (d = v !== null, o = o !== null && o.memoizedState !== null, d) {
          v = c.child, T = null, v.alternate !== null && v.alternate.memoizedState !== null && v.alternate.memoizedState.cachePool !== null && (T = v.alternate.memoizedState.cachePool.pool);
          var M = null;
          v.memoizedState !== null && v.memoizedState.cachePool !== null && (M = v.memoizedState.cachePool.pool), M !== T && (v.flags |= 2048);
        }
        return d !== o && d && (c.child.flags |= 8192), Vu(c, c.updateQueue), ni(c), null;
      case 4:
        return ee(), o === null && wg(c.stateNode.containerInfo), ni(c), null;
      case 10:
        return gs(c.type), ni(c), null;
      case 19:
        if (X(Mi), T = c.memoizedState, T === null) return ni(c), null;
        if (v = (c.flags & 128) !== 0, M = T.rendering, M === null)
          if (v) Oh(T, !1);
          else {
            if (Hi !== 0 || o !== null && (o.flags & 128) !== 0)
              for (o = c.child; o !== null; ) {
                if (M = $r(o), M !== null) {
                  for (c.flags |= 128, Oh(T, !1), o = M.updateQueue, c.updateQueue = o, Vu(c, o), c.subtreeFlags = 0, o = d, d = c.child; d !== null; )
                    Fc(d, o), d = d.sibling;
                  return st(
                    Mi,
                    Mi.current & 1 | 2
                  ), c.child;
                }
                o = o.sibling;
              }
            T.tail !== null && Ge() > Ih && (c.flags |= 128, v = !0, Oh(T, !1), c.lanes = 4194304);
          }
        else {
          if (!v)
            if (o = $r(M), o !== null) {
              if (c.flags |= 128, v = !0, o = o.updateQueue, c.updateQueue = o, Vu(c, o), Oh(T, !0), T.tail === null && T.tailMode === "hidden" && !M.alternate && !je)
                return ni(c), null;
            } else
              2 * Ge() - T.renderingStartTime > Ih && d !== 536870912 && (c.flags |= 128, v = !0, Oh(T, !1), c.lanes = 4194304);
          T.isBackwards ? (M.sibling = c.child, c.child = M) : (o = T.last, o !== null ? o.sibling = M : c.child = M, T.last = M);
        }
        return T.tail !== null ? (c = T.tail, T.rendering = c, T.tail = c.sibling, T.renderingStartTime = Ge(), c.sibling = null, o = Mi.current, st(Mi, v ? o & 1 | 2 : o & 1), c) : (ni(c), null);
      case 22:
      case 23:
        return ks(c), yh(), v = c.memoizedState !== null, o !== null ? o.memoizedState !== null !== v && (c.flags |= 8192) : v && (c.flags |= 8192), v ? (d & 536870912) !== 0 && (c.flags & 128) === 0 && (ni(c), c.subtreeFlags & 6 && (c.flags |= 8192)) : ni(c), d = c.updateQueue, d !== null && Vu(c, d.retryQueue), d = null, o !== null && o.memoizedState !== null && o.memoizedState.cachePool !== null && (d = o.memoizedState.cachePool.pool), v = null, c.memoizedState !== null && c.memoizedState.cachePool !== null && (v = c.memoizedState.cachePool.pool), v !== d && (c.flags |= 2048), o !== null && X(Nl), null;
      case 24:
        return d = null, o !== null && (d = o.memoizedState.cache), c.memoizedState.cache !== d && (c.flags |= 2048), gs(ei), ni(c), null;
      case 25:
        return null;
      case 30:
        return null;
    }
    throw Error(a(156, c.tag));
  }
  function fp(o, c) {
    switch (Ol(c), c.tag) {
      case 1:
        return o = c.flags, o & 65536 ? (c.flags = o & -65537 | 128, c) : null;
      case 3:
        return gs(ei), ee(), o = c.flags, (o & 65536) !== 0 && (o & 128) === 0 ? (c.flags = o & -65537 | 128, c) : null;
      case 26:
      case 27:
      case 5:
        return pe(c), null;
      case 13:
        if (ks(c), o = c.memoizedState, o !== null && o.dehydrated !== null) {
          if (c.alternate === null)
            throw Error(a(340));
          uh();
        }
        return o = c.flags, o & 65536 ? (c.flags = o & -65537 | 128, c) : null;
      case 19:
        return X(Mi), null;
      case 4:
        return ee(), null;
      case 10:
        return gs(c.type), null;
      case 22:
      case 23:
        return ks(c), yh(), o !== null && X(Nl), o = c.flags, o & 65536 ? (c.flags = o & -65537 | 128, c) : null;
      case 24:
        return gs(ei), null;
      case 25:
        return null;
      default:
        return null;
    }
  }
  function pv(o, c) {
    switch (Ol(c), c.tag) {
      case 3:
        gs(ei), ee();
        break;
      case 26:
      case 27:
      case 5:
        pe(c);
        break;
      case 4:
        ee();
        break;
      case 13:
        ks(c);
        break;
      case 19:
        X(Mi);
        break;
      case 10:
        gs(c.type);
        break;
      case 22:
      case 23:
        ks(c), yh(), o !== null && X(Nl);
        break;
      case 24:
        gs(ei);
    }
  }
  function Dh(o, c) {
    try {
      var d = c.updateQueue, v = d !== null ? d.lastEffect : null;
      if (v !== null) {
        var T = v.next;
        d = T;
        do {
          if ((d.tag & o) === o) {
            v = void 0;
            var M = d.create, P = d.inst;
            v = M(), P.destroy = v;
          }
          d = d.next;
        } while (d !== T);
      }
    } catch (q) {
      ai(c, c.return, q);
    }
  }
  function Yu(o, c, d) {
    try {
      var v = c.updateQueue, T = v !== null ? v.lastEffect : null;
      if (T !== null) {
        var M = T.next;
        v = M;
        do {
          if ((v.tag & o) === o) {
            var P = v.inst, q = P.destroy;
            if (q !== void 0) {
              P.destroy = void 0, T = c;
              var it = d, vt = q;
              try {
                vt();
              } catch (jt) {
                ai(
                  T,
                  it,
                  jt
                );
              }
            }
          }
          v = v.next;
        } while (v !== M);
      }
    } catch (jt) {
      ai(c, c.return, jt);
    }
  }
  function yv(o) {
    var c = o.updateQueue;
    if (c !== null) {
      var d = o.stateNode;
      try {
        jd(c, d);
      } catch (v) {
        ai(o, o.return, v);
      }
    }
  }
  function lg(o, c, d) {
    d.props = _s(
      o.type,
      o.memoizedProps
    ), d.state = o.memoizedState;
    try {
      d.componentWillUnmount();
    } catch (v) {
      ai(o, c, v);
    }
  }
  function of(o, c) {
    try {
      var d = o.ref;
      if (d !== null) {
        switch (o.tag) {
          case 26:
          case 27:
          case 5:
            var v = o.stateNode;
            break;
          case 30:
            v = o.stateNode;
            break;
          default:
            v = o.stateNode;
        }
        typeof d == "function" ? o.refCleanup = d(v) : d.current = v;
      }
    } catch (T) {
      ai(o, c, T);
    }
  }
  function mo(o, c) {
    var d = o.ref, v = o.refCleanup;
    if (d !== null)
      if (typeof v == "function")
        try {
          v();
        } catch (T) {
          ai(o, c, T);
        } finally {
          o.refCleanup = null, o = o.alternate, o != null && (o.refCleanup = null);
        }
      else if (typeof d == "function")
        try {
          d(null);
        } catch (T) {
          ai(o, c, T);
        }
      else d.current = null;
  }
  function ug(o) {
    var c = o.type, d = o.memoizedProps, v = o.stateNode;
    try {
      t: switch (c) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          d.autoFocus && v.focus();
          break t;
        case "img":
          d.src ? v.src = d.src : d.srcSet && (v.srcset = d.srcSet);
      }
    } catch (T) {
      ai(o, o.return, T);
    }
  }
  function Fu(o, c, d) {
    try {
      var v = o.stateNode;
      Un(v, o.type, d, c), v[cn] = c;
    } catch (T) {
      ai(o, o.return, T);
    }
  }
  function Nh(o) {
    return o.tag === 5 || o.tag === 3 || o.tag === 26 || o.tag === 27 && aa(o.type) || o.tag === 4;
  }
  function cg(o) {
    t: for (; ; ) {
      for (; o.sibling === null; ) {
        if (o.return === null || Nh(o.return)) return null;
        o = o.return;
      }
      for (o.sibling.return = o.return, o = o.sibling; o.tag !== 5 && o.tag !== 6 && o.tag !== 18; ) {
        if (o.tag === 27 && aa(o.type) || o.flags & 2 || o.child === null || o.tag === 4) continue t;
        o.child.return = o, o = o.child;
      }
      if (!(o.flags & 2)) return o.stateNode;
    }
  }
  function vs(o, c, d) {
    var v = o.tag;
    if (v === 5 || v === 6)
      o = o.stateNode, c ? (d.nodeType === 9 ? d.body : d.nodeName === "HTML" ? d.ownerDocument.body : d).insertBefore(o, c) : (c = d.nodeType === 9 ? d.body : d.nodeName === "HTML" ? d.ownerDocument.body : d, c.appendChild(o), d = d._reactRootContainer, d != null || c.onclick !== null || (c.onclick = Rg));
    else if (v !== 4 && (v === 27 && aa(o.type) && (d = o.stateNode, c = null), o = o.child, o !== null))
      for (vs(o, c, d), o = o.sibling; o !== null; )
        vs(o, c, d), o = o.sibling;
  }
  function Vl(o, c, d) {
    var v = o.tag;
    if (v === 5 || v === 6)
      o = o.stateNode, c ? d.insertBefore(o, c) : d.appendChild(o);
    else if (v !== 4 && (v === 27 && aa(o.type) && (d = o.stateNode), o = o.child, o !== null))
      for (Vl(o, c, d), o = o.sibling; o !== null; )
        Vl(o, c, d), o = o.sibling;
  }
  function fg(o) {
    var c = o.stateNode, d = o.memoizedProps;
    try {
      for (var v = o.type, T = c.attributes; T.length; )
        c.removeAttributeNode(T[0]);
      Tt(c, v, d), c[un] = o, c[cn] = d;
    } catch (M) {
      ai(o, o.return, M);
    }
  }
  var Bs = !1, Gn = !1, Fo = !1, yy = typeof WeakSet == "function" ? WeakSet : Set, na = null;
  function _v(o, c) {
    if (o = o.containerInfo, Eo = Ig, o = Cd(o), zm(o)) {
      if ("selectionStart" in o)
        var d = {
          start: o.selectionStart,
          end: o.selectionEnd
        };
      else
        t: {
          d = (d = o.ownerDocument) && d.defaultView || window;
          var v = d.getSelection && d.getSelection();
          if (v && v.rangeCount !== 0) {
            d = v.anchorNode;
            var T = v.anchorOffset, M = v.focusNode;
            v = v.focusOffset;
            try {
              d.nodeType, M.nodeType;
            } catch {
              d = null;
              break t;
            }
            var P = 0, q = -1, it = -1, vt = 0, jt = 0, Bt = o, xt = null;
            e: for (; ; ) {
              for (var bt; Bt !== d || T !== 0 && Bt.nodeType !== 3 || (q = P + T), Bt !== M || v !== 0 && Bt.nodeType !== 3 || (it = P + v), Bt.nodeType === 3 && (P += Bt.nodeValue.length), (bt = Bt.firstChild) !== null; )
                xt = Bt, Bt = bt;
              for (; ; ) {
                if (Bt === o) break e;
                if (xt === d && ++vt === T && (q = P), xt === M && ++jt === v && (it = P), (bt = Bt.nextSibling) !== null) break;
                Bt = xt, xt = Bt.parentNode;
              }
              Bt = bt;
            }
            d = q === -1 || it === -1 ? null : { start: q, end: it };
          } else d = null;
        }
      d = d || { start: 0, end: 0 };
    } else d = null;
    for (Vh = { focusedElem: o, selectionRange: d }, Ig = !1, na = c; na !== null; )
      if (c = na, o = c.child, (c.subtreeFlags & 1024) !== 0 && o !== null)
        o.return = c, na = o;
      else
        for (; na !== null; ) {
          switch (c = na, M = c.alternate, o = c.flags, c.tag) {
            case 0:
              break;
            case 11:
            case 15:
              break;
            case 1:
              if ((o & 1024) !== 0 && M !== null) {
                o = void 0, d = c, T = M.memoizedProps, M = M.memoizedState, v = d.stateNode;
                try {
                  var we = _s(
                    d.type,
                    T,
                    d.elementType === d.type
                  );
                  o = v.getSnapshotBeforeUpdate(
                    we,
                    M
                  ), v.__reactInternalSnapshotBeforeUpdate = o;
                } catch (Ee) {
                  ai(
                    d,
                    d.return,
                    Ee
                  );
                }
              }
              break;
            case 3:
              if ((o & 1024) !== 0) {
                if (o = c.stateNode.containerInfo, d = o.nodeType, d === 9)
                  Ag(o);
                else if (d === 1)
                  switch (o.nodeName) {
                    case "HEAD":
                    case "HTML":
                    case "BODY":
                      Ag(o);
                      break;
                    default:
                      o.textContent = "";
                  }
              }
              break;
            case 5:
            case 26:
            case 27:
            case 6:
            case 4:
            case 17:
              break;
            default:
              if ((o & 1024) !== 0) throw Error(a(163));
          }
          if (o = c.sibling, o !== null) {
            o.return = c.return, na = o;
            break;
          }
          na = c.return;
        }
  }
  function hp(o, c, d) {
    var v = d.flags;
    switch (d.tag) {
      case 0:
      case 11:
      case 15:
        Yl(o, d), v & 4 && Dh(5, d);
        break;
      case 1:
        if (Yl(o, d), v & 4)
          if (o = d.stateNode, c === null)
            try {
              o.componentDidMount();
            } catch (P) {
              ai(d, d.return, P);
            }
          else {
            var T = _s(
              d.type,
              c.memoizedProps
            );
            c = c.memoizedState;
            try {
              o.componentDidUpdate(
                T,
                c,
                o.__reactInternalSnapshotBeforeUpdate
              );
            } catch (P) {
              ai(
                d,
                d.return,
                P
              );
            }
          }
        v & 64 && yv(d), v & 512 && of(d, d.return);
        break;
      case 3:
        if (Yl(o, d), v & 64 && (o = d.updateQueue, o !== null)) {
          if (c = null, d.child !== null)
            switch (d.child.tag) {
              case 27:
              case 5:
                c = d.child.stateNode;
                break;
              case 1:
                c = d.child.stateNode;
            }
          try {
            jd(o, c);
          } catch (P) {
            ai(d, d.return, P);
          }
        }
        break;
      case 27:
        c === null && v & 4 && fg(d);
      case 26:
      case 5:
        Yl(o, d), c === null && v & 4 && ug(d), v & 512 && of(d, d.return);
        break;
      case 12:
        Yl(o, d);
        break;
      case 13:
        Yl(o, d), v & 4 && mn(o, d), v & 64 && (o = d.memoizedState, o !== null && (o = o.dehydrated, o !== null && (d = Sg.bind(
          null,
          d
        ), sc(o, d))));
        break;
      case 22:
        if (v = d.memoizedState !== null || Bs, !v) {
          c = c !== null && c.memoizedState !== null || Gn, T = Bs;
          var M = Gn;
          Bs = v, (Gn = c) && !M ? gi(
            o,
            d,
            (d.subtreeFlags & 8772) !== 0
          ) : Yl(o, d), Bs = T, Gn = M;
        }
        break;
      case 30:
        break;
      default:
        Yl(o, d);
    }
  }
  function _y(o) {
    var c = o.alternate;
    c !== null && (o.alternate = null, _y(c)), o.child = null, o.deletions = null, o.sibling = null, o.tag === 5 && (c = o.stateNode, c !== null && de(c)), o.stateNode = null, o.return = null, o.dependencies = null, o.memoizedProps = null, o.memoizedState = null, o.pendingProps = null, o.stateNode = null, o.updateQueue = null;
  }
  var wi = null, Kr = !1;
  function qs(o, c, d) {
    for (d = d.child; d !== null; )
      vy(o, c, d), d = d.sibling;
  }
  function vy(o, c, d) {
    if (ti && typeof ti.onCommitFiberUnmount == "function")
      try {
        ti.onCommitFiberUnmount(Ha, d);
      } catch {
      }
    switch (d.tag) {
      case 26:
        Gn || mo(d, c), qs(
          o,
          c,
          d
        ), d.memoizedState ? d.memoizedState.count-- : d.stateNode && (d = d.stateNode, d.parentNode.removeChild(d));
        break;
      case 27:
        Gn || mo(d, c);
        var v = wi, T = Kr;
        aa(d.type) && (wi = d.stateNode, Kr = !1), qs(
          o,
          c,
          d
        ), ie(d.stateNode), wi = v, Kr = T;
        break;
      case 5:
        Gn || mo(d, c);
      case 6:
        if (v = wi, T = Kr, wi = null, qs(
          o,
          c,
          d
        ), wi = v, Kr = T, wi !== null)
          if (Kr)
            try {
              (wi.nodeType === 9 ? wi.body : wi.nodeName === "HTML" ? wi.ownerDocument.body : wi).removeChild(d.stateNode);
            } catch (M) {
              ai(
                d,
                c,
                M
              );
            }
          else
            try {
              wi.removeChild(d.stateNode);
            } catch (M) {
              ai(
                d,
                c,
                M
              );
            }
        break;
      case 18:
        wi !== null && (Kr ? (o = wi, Cp(
          o.nodeType === 9 ? o.body : o.nodeName === "HTML" ? o.ownerDocument.body : o,
          d.stateNode
        ), Xh(o)) : Cp(wi, d.stateNode));
        break;
      case 4:
        v = wi, T = Kr, wi = d.stateNode.containerInfo, Kr = !0, qs(
          o,
          c,
          d
        ), wi = v, Kr = T;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        Gn || Yu(2, d, c), Gn || Yu(4, d, c), qs(
          o,
          c,
          d
        );
        break;
      case 1:
        Gn || (mo(d, c), v = d.stateNode, typeof v.componentWillUnmount == "function" && lg(
          d,
          c,
          v
        )), qs(
          o,
          c,
          d
        );
        break;
      case 21:
        qs(
          o,
          c,
          d
        );
        break;
      case 22:
        Gn = (v = Gn) || d.memoizedState !== null, qs(
          o,
          c,
          d
        ), Gn = v;
        break;
      default:
        qs(
          o,
          c,
          d
        );
    }
  }
  function mn(o, c) {
    if (c.memoizedState === null && (o = c.alternate, o !== null && (o = o.memoizedState, o !== null && (o = o.dehydrated, o !== null))))
      try {
        Xh(o);
      } catch (d) {
        ai(c, c.return, d);
      }
  }
  function Ey(o) {
    switch (o.tag) {
      case 13:
      case 19:
        var c = o.stateNode;
        return c === null && (c = o.stateNode = new yy()), c;
      case 22:
        return o = o.stateNode, c = o._retryCache, c === null && (c = o._retryCache = new yy()), c;
      default:
        throw Error(a(435, o.tag));
    }
  }
  function hg(o, c) {
    var d = Ey(o);
    c.forEach(function(v) {
      var T = RE.bind(null, o, v);
      d.has(v) || (d.add(v), v.then(T, T));
    });
  }
  function Zr(o, c) {
    var d = c.deletions;
    if (d !== null)
      for (var v = 0; v < d.length; v++) {
        var T = d[v], M = o, P = c, q = P;
        t: for (; q !== null; ) {
          switch (q.tag) {
            case 27:
              if (aa(q.type)) {
                wi = q.stateNode, Kr = !1;
                break t;
              }
              break;
            case 5:
              wi = q.stateNode, Kr = !1;
              break t;
            case 3:
            case 4:
              wi = q.stateNode.containerInfo, Kr = !0;
              break t;
          }
          q = q.return;
        }
        if (wi === null) throw Error(a(160));
        vy(M, P, T), wi = null, Kr = !1, M = T.alternate, M !== null && (M.return = null), T.return = null;
      }
    if (c.subtreeFlags & 13878)
      for (c = c.child; c !== null; )
        lf(c, o), c = c.sibling;
  }
  var Wr = null;
  function lf(o, c) {
    var d = o.alternate, v = o.flags;
    switch (o.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        Zr(c, o), Xa(o), v & 4 && (Yu(3, o, o.return), Dh(3, o), Yu(5, o, o.return));
        break;
      case 1:
        Zr(c, o), Xa(o), v & 512 && (Gn || d === null || mo(d, d.return)), v & 64 && Bs && (o = o.updateQueue, o !== null && (v = o.callbacks, v !== null && (d = o.shared.hiddenCallbacks, o.shared.hiddenCallbacks = d === null ? v : d.concat(v))));
        break;
      case 26:
        var T = Wr;
        if (Zr(c, o), Xa(o), v & 512 && (Gn || d === null || mo(d, d.return)), v & 4) {
          var M = d !== null ? d.memoizedState : null;
          if (v = o.memoizedState, d === null)
            if (v === null)
              if (o.stateNode === null) {
                t: {
                  v = o.type, d = o.memoizedProps, T = T.ownerDocument || T;
                  e: switch (v) {
                    case "title":
                      M = T.getElementsByTagName("title")[0], (!M || M[pd] || M[un] || M.namespaceURI === "http://www.w3.org/2000/svg" || M.hasAttribute("itemprop")) && (M = T.createElement(v), T.head.insertBefore(
                        M,
                        T.querySelector("head > title")
                      )), Tt(M, v, d), M[un] = o, Qi(M), v = M;
                      break t;
                    case "link":
                      var P = Fh(
                        "link",
                        "href",
                        T
                      ).get(v + (d.href || ""));
                      if (P) {
                        for (var q = 0; q < P.length; q++)
                          if (M = P[q], M.getAttribute("href") === (d.href == null || d.href === "" ? null : d.href) && M.getAttribute("rel") === (d.rel == null ? null : d.rel) && M.getAttribute("title") === (d.title == null ? null : d.title) && M.getAttribute("crossorigin") === (d.crossOrigin == null ? null : d.crossOrigin)) {
                            P.splice(q, 1);
                            break e;
                          }
                      }
                      M = T.createElement(v), Tt(M, v, d), T.head.appendChild(M);
                      break;
                    case "meta":
                      if (P = Fh(
                        "meta",
                        "content",
                        T
                      ).get(v + (d.content || ""))) {
                        for (q = 0; q < P.length; q++)
                          if (M = P[q], M.getAttribute("content") === (d.content == null ? null : "" + d.content) && M.getAttribute("name") === (d.name == null ? null : d.name) && M.getAttribute("property") === (d.property == null ? null : d.property) && M.getAttribute("http-equiv") === (d.httpEquiv == null ? null : d.httpEquiv) && M.getAttribute("charset") === (d.charSet == null ? null : d.charSet)) {
                            P.splice(q, 1);
                            break e;
                          }
                      }
                      M = T.createElement(v), Tt(M, v, d), T.head.appendChild(M);
                      break;
                    default:
                      throw Error(a(468, v));
                  }
                  M[un] = o, Qi(M), v = M;
                }
                o.stateNode = v;
              } else
                zy(
                  T,
                  o.type,
                  o.stateNode
                );
            else
              o.stateNode = Np(
                T,
                v,
                o.memoizedProps
              );
          else
            M !== v ? (M === null ? d.stateNode !== null && (d = d.stateNode, d.parentNode.removeChild(d)) : M.count--, v === null ? zy(
              T,
              o.type,
              o.stateNode
            ) : Np(
              T,
              v,
              o.memoizedProps
            )) : v === null && o.stateNode !== null && Fu(
              o,
              o.memoizedProps,
              d.memoizedProps
            );
        }
        break;
      case 27:
        Zr(c, o), Xa(o), v & 512 && (Gn || d === null || mo(d, d.return)), d !== null && v & 4 && Fu(
          o,
          o.memoizedProps,
          d.memoizedProps
        );
        break;
      case 5:
        if (Zr(c, o), Xa(o), v & 512 && (Gn || d === null || mo(d, d.return)), o.flags & 32) {
          T = o.stateNode;
          try {
            bl(T, "");
          } catch (bt) {
            ai(o, o.return, bt);
          }
        }
        v & 4 && o.stateNode != null && (T = o.memoizedProps, Fu(
          o,
          T,
          d !== null ? d.memoizedProps : T
        )), v & 1024 && (Fo = !0);
        break;
      case 6:
        if (Zr(c, o), Xa(o), v & 4) {
          if (o.stateNode === null)
            throw Error(a(162));
          v = o.memoizedProps, d = o.stateNode;
          try {
            d.nodeValue = v;
          } catch (bt) {
            ai(o, o.return, bt);
          }
        }
        break;
      case 3:
        if (vf = null, T = Wr, Wr = _e(c.containerInfo), Zr(c, o), Wr = T, Xa(o), v & 4 && d !== null && d.memoizedState.isDehydrated)
          try {
            Xh(c.containerInfo);
          } catch (bt) {
            ai(o, o.return, bt);
          }
        Fo && (Fo = !1, uf(o));
        break;
      case 4:
        v = Wr, Wr = _e(
          o.stateNode.containerInfo
        ), Zr(c, o), Xa(o), Wr = v;
        break;
      case 12:
        Zr(c, o), Xa(o);
        break;
      case 13:
        Zr(c, o), Xa(o), o.child.flags & 8192 && o.memoizedState !== null != (d !== null && d.memoizedState !== null) && (wy = Ge()), v & 4 && (v = o.updateQueue, v !== null && (o.updateQueue = null, hg(o, v)));
        break;
      case 22:
        T = o.memoizedState !== null;
        var it = d !== null && d.memoizedState !== null, vt = Bs, jt = Gn;
        if (Bs = vt || T, Gn = jt || it, Zr(c, o), Gn = jt, Bs = vt, Xa(o), v & 8192)
          t: for (c = o.stateNode, c._visibility = T ? c._visibility & -2 : c._visibility | 1, T && (d === null || it || Bs || Gn || Fl(o)), d = null, c = o; ; ) {
            if (c.tag === 5 || c.tag === 26) {
              if (d === null) {
                it = d = c;
                try {
                  if (M = it.stateNode, T)
                    P = M.style, typeof P.setProperty == "function" ? P.setProperty("display", "none", "important") : P.display = "none";
                  else {
                    q = it.stateNode;
                    var Bt = it.memoizedProps.style, xt = Bt != null && Bt.hasOwnProperty("display") ? Bt.display : null;
                    q.style.display = xt == null || typeof xt == "boolean" ? "" : ("" + xt).trim();
                  }
                } catch (bt) {
                  ai(it, it.return, bt);
                }
              }
            } else if (c.tag === 6) {
              if (d === null) {
                it = c;
                try {
                  it.stateNode.nodeValue = T ? "" : it.memoizedProps;
                } catch (bt) {
                  ai(it, it.return, bt);
                }
              }
            } else if ((c.tag !== 22 && c.tag !== 23 || c.memoizedState === null || c === o) && c.child !== null) {
              c.child.return = c, c = c.child;
              continue;
            }
            if (c === o) break t;
            for (; c.sibling === null; ) {
              if (c.return === null || c.return === o) break t;
              d === c && (d = null), c = c.return;
            }
            d === c && (d = null), c.sibling.return = c.return, c = c.sibling;
          }
        v & 4 && (v = o.updateQueue, v !== null && (d = v.retryQueue, d !== null && (v.retryQueue = null, hg(o, d))));
        break;
      case 19:
        Zr(c, o), Xa(o), v & 4 && (v = o.updateQueue, v !== null && (o.updateQueue = null, hg(o, v)));
        break;
      case 30:
        break;
      case 21:
        break;
      default:
        Zr(c, o), Xa(o);
    }
  }
  function Xa(o) {
    var c = o.flags;
    if (c & 2) {
      try {
        for (var d, v = o.return; v !== null; ) {
          if (Nh(v)) {
            d = v;
            break;
          }
          v = v.return;
        }
        if (d == null) throw Error(a(160));
        switch (d.tag) {
          case 27:
            var T = d.stateNode, M = cg(o);
            Vl(o, M, T);
            break;
          case 5:
            var P = d.stateNode;
            d.flags & 32 && (bl(P, ""), d.flags &= -33);
            var q = cg(o);
            Vl(o, q, P);
            break;
          case 3:
          case 4:
            var it = d.stateNode.containerInfo, vt = cg(o);
            vs(
              o,
              vt,
              it
            );
            break;
          default:
            throw Error(a(161));
        }
      } catch (jt) {
        ai(o, o.return, jt);
      }
      o.flags &= -3;
    }
    c & 4096 && (o.flags &= -4097);
  }
  function uf(o) {
    if (o.subtreeFlags & 1024)
      for (o = o.child; o !== null; ) {
        var c = o;
        uf(c), c.tag === 5 && c.flags & 1024 && c.stateNode.reset(), o = o.sibling;
      }
  }
  function Yl(o, c) {
    if (c.subtreeFlags & 8772)
      for (c = c.child; c !== null; )
        hp(o, c.alternate, c), c = c.sibling;
  }
  function Fl(o) {
    for (o = o.child; o !== null; ) {
      var c = o;
      switch (c.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          Yu(4, c, c.return), Fl(c);
          break;
        case 1:
          mo(c, c.return);
          var d = c.stateNode;
          typeof d.componentWillUnmount == "function" && lg(
            c,
            c.return,
            d
          ), Fl(c);
          break;
        case 27:
          ie(c.stateNode);
        case 26:
        case 5:
          mo(c, c.return), Fl(c);
          break;
        case 22:
          c.memoizedState === null && Fl(c);
          break;
        case 30:
          Fl(c);
          break;
        default:
          Fl(c);
      }
      o = o.sibling;
    }
  }
  function gi(o, c, d) {
    for (d = d && (c.subtreeFlags & 8772) !== 0, c = c.child; c !== null; ) {
      var v = c.alternate, T = o, M = c, P = M.flags;
      switch (M.tag) {
        case 0:
        case 11:
        case 15:
          gi(
            T,
            M,
            d
          ), Dh(4, M);
          break;
        case 1:
          if (gi(
            T,
            M,
            d
          ), v = M, T = v.stateNode, typeof T.componentDidMount == "function")
            try {
              T.componentDidMount();
            } catch (vt) {
              ai(v, v.return, vt);
            }
          if (v = M, T = v.updateQueue, T !== null) {
            var q = v.stateNode;
            try {
              var it = T.shared.hiddenCallbacks;
              if (it !== null)
                for (T.shared.hiddenCallbacks = null, T = 0; T < it.length; T++)
                  ph(it[T], q);
            } catch (vt) {
              ai(v, v.return, vt);
            }
          }
          d && P & 64 && yv(M), of(M, M.return);
          break;
        case 27:
          fg(M);
        case 26:
        case 5:
          gi(
            T,
            M,
            d
          ), d && v === null && P & 4 && ug(M), of(M, M.return);
          break;
        case 12:
          gi(
            T,
            M,
            d
          );
          break;
        case 13:
          gi(
            T,
            M,
            d
          ), d && P & 4 && mn(T, M);
          break;
        case 22:
          M.memoizedState === null && gi(
            T,
            M,
            d
          ), of(M, M.return);
          break;
        case 30:
          break;
        default:
          gi(
            T,
            M,
            d
          );
      }
      c = c.sibling;
    }
  }
  function by(o, c) {
    var d = null;
    o !== null && o.memoizedState !== null && o.memoizedState.cachePool !== null && (d = o.memoizedState.cachePool.pool), o = null, c.memoizedState !== null && c.memoizedState.cachePool !== null && (o = c.memoizedState.cachePool.pool), o !== d && (o != null && o.refCount++, d != null && Du(d));
  }
  function Vs(o, c) {
    o = null, c.alternate !== null && (o = c.alternate.memoizedState.cache), c = c.memoizedState.cache, c !== o && (c.refCount++, o != null && Du(o));
  }
  function po(o, c, d, v) {
    if (c.subtreeFlags & 10256)
      for (c = c.child; c !== null; )
        $l(
          o,
          c,
          d,
          v
        ), c = c.sibling;
  }
  function $l(o, c, d, v) {
    var T = c.flags;
    switch (c.tag) {
      case 0:
      case 11:
      case 15:
        po(
          o,
          c,
          d,
          v
        ), T & 2048 && Dh(9, c);
        break;
      case 1:
        po(
          o,
          c,
          d,
          v
        );
        break;
      case 3:
        po(
          o,
          c,
          d,
          v
        ), T & 2048 && (o = null, c.alternate !== null && (o = c.alternate.memoizedState.cache), c = c.memoizedState.cache, c !== o && (c.refCount++, o != null && Du(o)));
        break;
      case 12:
        if (T & 2048) {
          po(
            o,
            c,
            d,
            v
          ), o = c.stateNode;
          try {
            var M = c.memoizedProps, P = M.id, q = M.onPostCommit;
            typeof q == "function" && q(
              P,
              c.alternate === null ? "mount" : "update",
              o.passiveEffectDuration,
              -0
            );
          } catch (it) {
            ai(c, c.return, it);
          }
        } else
          po(
            o,
            c,
            d,
            v
          );
        break;
      case 13:
        po(
          o,
          c,
          d,
          v
        );
        break;
      case 23:
        break;
      case 22:
        M = c.stateNode, P = c.alternate, c.memoizedState !== null ? M._visibility & 2 ? po(
          o,
          c,
          d,
          v
        ) : $u(o, c) : M._visibility & 2 ? po(
          o,
          c,
          d,
          v
        ) : (M._visibility |= 2, cf(
          o,
          c,
          d,
          v,
          (c.subtreeFlags & 10256) !== 0
        )), T & 2048 && by(P, c);
        break;
      case 24:
        po(
          o,
          c,
          d,
          v
        ), T & 2048 && Vs(c.alternate, c);
        break;
      default:
        po(
          o,
          c,
          d,
          v
        );
    }
  }
  function cf(o, c, d, v, T) {
    for (T = T && (c.subtreeFlags & 10256) !== 0, c = c.child; c !== null; ) {
      var M = o, P = c, q = d, it = v, vt = P.flags;
      switch (P.tag) {
        case 0:
        case 11:
        case 15:
          cf(
            M,
            P,
            q,
            it,
            T
          ), Dh(8, P);
          break;
        case 23:
          break;
        case 22:
          var jt = P.stateNode;
          P.memoizedState !== null ? jt._visibility & 2 ? cf(
            M,
            P,
            q,
            it,
            T
          ) : $u(
            M,
            P
          ) : (jt._visibility |= 2, cf(
            M,
            P,
            q,
            it,
            T
          )), T && vt & 2048 && by(
            P.alternate,
            P
          );
          break;
        case 24:
          cf(
            M,
            P,
            q,
            it,
            T
          ), T && vt & 2048 && Vs(P.alternate, P);
          break;
        default:
          cf(
            M,
            P,
            q,
            it,
            T
          );
      }
      c = c.sibling;
    }
  }
  function $u(o, c) {
    if (c.subtreeFlags & 10256)
      for (c = c.child; c !== null; ) {
        var d = o, v = c, T = v.flags;
        switch (v.tag) {
          case 22:
            $u(d, v), T & 2048 && by(
              v.alternate,
              v
            );
            break;
          case 24:
            $u(d, v), T & 2048 && Vs(v.alternate, v);
            break;
          default:
            $u(d, v);
        }
        c = c.sibling;
      }
  }
  var Ve = 8192;
  function Xu(o) {
    if (o.subtreeFlags & Ve)
      for (o = o.child; o !== null; )
        Na(o), o = o.sibling;
  }
  function Na(o) {
    switch (o.tag) {
      case 26:
        Xu(o), o.flags & Ve && o.memoizedState !== null && Gv(
          Wr,
          o.memoizedState,
          o.memoizedProps
        );
        break;
      case 5:
        Xu(o);
        break;
      case 3:
      case 4:
        var c = Wr;
        Wr = _e(o.stateNode.containerInfo), Xu(o), Wr = c;
        break;
      case 22:
        o.memoizedState === null && (c = o.alternate, c !== null && c.memoizedState !== null ? (c = Ve, Ve = 16777216, Xu(o), Ve = c) : Xu(o));
        break;
      default:
        Xu(o);
    }
  }
  function vv(o) {
    var c = o.alternate;
    if (c !== null && (o = c.child, o !== null)) {
      c.child = null;
      do
        c = o.sibling, o.sibling = null, o = c;
      while (o !== null);
    }
  }
  function ff(o) {
    var c = o.deletions;
    if ((o.flags & 16) !== 0) {
      if (c !== null)
        for (var d = 0; d < c.length; d++) {
          var v = c[d];
          na = v, Es(
            v,
            o
          );
        }
      vv(o);
    }
    if (o.subtreeFlags & 10256)
      for (o = o.child; o !== null; )
        dp(o), o = o.sibling;
  }
  function dp(o) {
    switch (o.tag) {
      case 0:
      case 11:
      case 15:
        ff(o), o.flags & 2048 && Yu(9, o, o.return);
        break;
      case 3:
        ff(o);
        break;
      case 12:
        ff(o);
        break;
      case 22:
        var c = o.stateNode;
        o.memoizedState !== null && c._visibility & 2 && (o.return === null || o.return.tag !== 13) ? (c._visibility &= -3, dg(o)) : ff(o);
        break;
      default:
        ff(o);
    }
  }
  function dg(o) {
    var c = o.deletions;
    if ((o.flags & 16) !== 0) {
      if (c !== null)
        for (var d = 0; d < c.length; d++) {
          var v = c[d];
          na = v, Es(
            v,
            o
          );
        }
      vv(o);
    }
    for (o = o.child; o !== null; ) {
      switch (c = o, c.tag) {
        case 0:
        case 11:
        case 15:
          Yu(8, c, c.return), dg(c);
          break;
        case 22:
          d = c.stateNode, d._visibility & 2 && (d._visibility &= -3, dg(c));
          break;
        default:
          dg(c);
      }
      o = o.sibling;
    }
  }
  function Es(o, c) {
    for (; na !== null; ) {
      var d = na;
      switch (d.tag) {
        case 0:
        case 11:
        case 15:
          Yu(8, d, c);
          break;
        case 23:
        case 22:
          if (d.memoizedState !== null && d.memoizedState.cachePool !== null) {
            var v = d.memoizedState.cachePool.pool;
            v != null && v.refCount++;
          }
          break;
        case 24:
          Du(d.memoizedState.cache);
      }
      if (v = d.child, v !== null) v.return = d, na = v;
      else
        t: for (d = o; na !== null; ) {
          v = na;
          var T = v.sibling, M = v.return;
          if (_y(v), v === d) {
            na = null;
            break t;
          }
          if (T !== null) {
            T.return = M, na = T;
            break t;
          }
          na = M;
        }
    }
  }
  var Ev = {
    getCacheForType: function(o) {
      var c = Di(ei), d = c.data.get(o);
      return d === void 0 && (d = o(), c.data.set(o, d)), d;
    }
  }, gg = typeof WeakMap == "function" ? WeakMap : Map, qn = 0, ii = null, pn = null, Rn = 0, In = 0, Qr = null, Xl = !1, Ku = !1, Sy = !1, Kl = 0, Hi = 0, Zu = 0, Wu = 0, xy = 0, ba = 0, Lh = 0, mg = null, Ar = null, Ty = !1, wy = 0, Ih = 1 / 0, pg = null, $o = null, Ka = 0, Qu = null, Ju = null, Ph = 0, Jr = 0, gp = null, Ry = null, hf = 0, mp = null;
  function cr() {
    if ((qn & 2) !== 0 && Rn !== 0)
      return Rn & -Rn;
    if (nt.T !== null) {
      var o = Nu;
      return o !== 0 ? o : Tg();
    }
    return Wi();
  }
  function bv() {
    ba === 0 && (ba = (Rn & 536870912) === 0 || je ? dt() : 536870912);
    var o = ea.current;
    return o !== null && (o.flags |= 32), ba;
  }
  function ts(o, c, d) {
    (o === ii && (In === 2 || In === 9) || o.cancelPendingCommit !== null) && (yo(o, 0), Zl(
      o,
      Rn,
      ba,
      !1
    )), oe(o, d), ((qn & 2) === 0 || o !== ii) && (o === ii && ((qn & 2) === 0 && (Wu |= d), Hi === 4 && Zl(
      o,
      Rn,
      ba,
      !1
    )), _o(o));
  }
  function Sv(o, c, d) {
    if ((qn & 6) !== 0) throw Error(a(327));
    var v = !d && (c & 124) === 0 && (c & o.expiredLanes) === 0 || Ba(o, c), T = v ? yp(o, c) : df(o, c, !0), M = v;
    do {
      if (T === 0) {
        Ku && !v && Zl(o, c, 0, !1);
        break;
      } else {
        if (d = o.current.alternate, M && !pp(d)) {
          T = df(o, c, !1), M = !1;
          continue;
        }
        if (T === 2) {
          if (M = c, o.errorRecoveryDisabledLanes & M)
            var P = 0;
          else
            P = o.pendingLanes & -536870913, P = P !== 0 ? P : P & 536870912 ? 536870912 : 0;
          if (P !== 0) {
            c = P;
            t: {
              var q = o;
              T = mg;
              var it = q.current.memoizedState.isDehydrated;
              if (it && (yo(q, P).flags |= 256), P = df(
                q,
                P,
                !1
              ), P !== 2) {
                if (Sy && !it) {
                  q.errorRecoveryDisabledLanes |= M, Wu |= M, T = 4;
                  break t;
                }
                M = Ar, Ar = T, M !== null && (Ar === null ? Ar = M : Ar.push.apply(
                  Ar,
                  M
                ));
              }
              T = P;
            }
            if (M = !1, T !== 2) continue;
          }
        }
        if (T === 1) {
          yo(o, 0), Zl(o, c, 0, !0);
          break;
        }
        t: {
          switch (v = o, M = T, M) {
            case 0:
            case 1:
              throw Error(a(345));
            case 4:
              if ((c & 4194048) !== c) break;
            case 6:
              Zl(
                v,
                c,
                ba,
                !Xl
              );
              break t;
            case 2:
              Ar = null;
              break;
            case 3:
            case 5:
              break;
            default:
              throw Error(a(329));
          }
          if ((c & 62914560) === c && (T = wy + 300 - Ge(), 10 < T)) {
            if (Zl(
              v,
              c,
              ba,
              !Xl
            ), sa(v, 0, !0) !== 0) break t;
            v.timeoutHandle = Ko(
              zh.bind(
                null,
                v,
                d,
                Ar,
                pg,
                Ty,
                c,
                ba,
                Wu,
                Lh,
                Xl,
                M,
                2,
                -0,
                0
              ),
              T
            );
            break t;
          }
          zh(
            v,
            d,
            Ar,
            pg,
            Ty,
            c,
            ba,
            Wu,
            Lh,
            Xl,
            M,
            0,
            -0,
            0
          );
        }
      }
      break;
    } while (!0);
    _o(o);
  }
  function zh(o, c, d, v, T, M, P, q, it, vt, jt, Bt, xt, bt) {
    if (o.timeoutHandle = -1, Bt = c.subtreeFlags, (Bt & 8192 || (Bt & 16785408) === 16785408) && (xa = { stylesheets: null, count: 0, unsuspend: zv }, Na(c), Bt = Uv(), Bt !== null)) {
      o.cancelPendingCommit = Bt(
        vg.bind(
          null,
          o,
          c,
          M,
          d,
          v,
          T,
          P,
          q,
          it,
          jt,
          1,
          xt,
          bt
        )
      ), Zl(o, M, P, !vt);
      return;
    }
    vg(
      o,
      c,
      M,
      d,
      v,
      T,
      P,
      q,
      it
    );
  }
  function pp(o) {
    for (var c = o; ; ) {
      var d = c.tag;
      if ((d === 0 || d === 11 || d === 15) && c.flags & 16384 && (d = c.updateQueue, d !== null && (d = d.stores, d !== null)))
        for (var v = 0; v < d.length; v++) {
          var T = d[v], M = T.getSnapshot;
          T = T.value;
          try {
            if (!_r(M(), T)) return !1;
          } catch {
            return !1;
          }
        }
      if (d = c.child, c.subtreeFlags & 16384 && d !== null)
        d.return = c, c = d;
      else {
        if (c === o) break;
        for (; c.sibling === null; ) {
          if (c.return === null || c.return === o) return !0;
          c = c.return;
        }
        c.sibling.return = c.return, c = c.sibling;
      }
    }
    return !0;
  }
  function Zl(o, c, d, v) {
    c &= ~xy, c &= ~Wu, o.suspendedLanes |= c, o.pingedLanes &= ~c, v && (o.warmLanes |= c), v = o.expirationTimes;
    for (var T = c; 0 < T; ) {
      var M = 31 - Gi(T), P = 1 << M;
      v[M] = -1, T &= ~P;
    }
    d !== 0 && Ue(o, d, c);
  }
  function yg() {
    return (qn & 6) === 0 ? (Ql(0), !1) : !0;
  }
  function Gh() {
    if (pn !== null) {
      if (In === 0)
        var o = pn.return;
      else
        o = pn, V = jo = null, Qc(o), li = null, Rr = 0, o = pn;
      for (; o !== null; )
        pv(o.alternate, o), o = o.return;
      pn = null;
    }
  }
  function yo(o, c) {
    var d = o.timeoutHandle;
    d !== -1 && (o.timeoutHandle = -1, Ly(d)), d = o.cancelPendingCommit, d !== null && (o.cancelPendingCommit = null, d()), Gh(), ii = o, pn = d = Va(o.current, null), Rn = c, In = 0, Qr = null, Xl = !1, Ku = Ba(o, c), Sy = !1, Lh = ba = xy = Wu = Zu = Hi = 0, Ar = mg = null, Ty = !1, (c & 8) !== 0 && (c |= c & 32);
    var v = o.entangledLanes;
    if (v !== 0)
      for (o = o.entanglements, v &= c; 0 < v; ) {
        var T = 31 - Gi(v), M = 1 << T;
        c |= o[T], v &= ~M;
      }
    return Kl = c, Br(), d;
  }
  function Uh(o, c) {
    qe = null, nt.H = wh, c === Ya || c === gh ? (c = Vm(), In = 3) : c === Gd ? (c = Vm(), In = 4) : In = c === gy ? 8 : c !== null && typeof c == "object" && typeof c.then == "function" ? 6 : 1, Qr = c, pn === null && (Hi = 1, Bu(
      o,
      sr(c, o.current)
    ));
  }
  function Ay() {
    var o = nt.H;
    return nt.H = wh, o === null ? wh : o;
  }
  function xv() {
    var o = nt.A;
    return nt.A = Ev, o;
  }
  function tc() {
    Hi = 4, Xl || (Rn & 4194048) !== Rn && ea.current !== null || (Ku = !0), (Zu & 134217727) === 0 && (Wu & 134217727) === 0 || ii === null || Zl(
      ii,
      Rn,
      ba,
      !1
    );
  }
  function df(o, c, d) {
    var v = qn;
    qn |= 2;
    var T = Ay(), M = xv();
    (ii !== o || Rn !== c) && (pg = null, yo(o, c)), c = !1;
    var P = Hi;
    t: do
      try {
        if (In !== 0 && pn !== null) {
          var q = pn, it = Qr;
          switch (In) {
            case 8:
              Gh(), P = 6;
              break t;
            case 3:
            case 2:
            case 9:
            case 6:
              ea.current === null && (c = !0);
              var vt = In;
              if (In = 0, Qr = null, gf(o, q, it, vt), d && Ku) {
                P = 0;
                break t;
              }
              break;
            default:
              vt = In, In = 0, Qr = null, gf(o, q, it, vt);
          }
        }
        Tv(), P = Hi;
        break;
      } catch (jt) {
        Uh(o, jt);
      }
    while (!0);
    return c && o.shellSuspendCounter++, V = jo = null, qn = v, nt.H = T, nt.A = M, pn === null && (ii = null, Rn = 0, Br()), P;
  }
  function Tv() {
    for (; pn !== null; ) _g(pn);
  }
  function yp(o, c) {
    var d = qn;
    qn |= 2;
    var v = Ay(), T = xv();
    ii !== o || Rn !== c ? (pg = null, Ih = Ge() + 500, yo(o, c)) : Ku = Ba(
      o,
      c
    );
    t: do
      try {
        if (In !== 0 && pn !== null) {
          c = pn;
          var M = Qr;
          e: switch (In) {
            case 1:
              In = 0, Qr = null, gf(o, c, M, 1);
              break;
            case 2:
            case 9:
              if (ty(M)) {
                In = 0, Qr = null, My(c);
                break;
              }
              c = function() {
                In !== 2 && In !== 9 || ii !== o || (In = 7), _o(o);
              }, M.then(c, c);
              break t;
            case 3:
              In = 7;
              break t;
            case 4:
              In = 5;
              break t;
            case 7:
              ty(M) ? (In = 0, Qr = null, My(c)) : (In = 0, Qr = null, gf(o, c, M, 7));
              break;
            case 5:
              var P = null;
              switch (pn.tag) {
                case 26:
                  P = pn.memoizedState;
                case 5:
                case 27:
                  var q = pn;
                  if (!P || ga(P)) {
                    In = 0, Qr = null;
                    var it = q.sibling;
                    if (it !== null) pn = it;
                    else {
                      var vt = q.return;
                      vt !== null ? (pn = vt, vp(vt)) : pn = null;
                    }
                    break e;
                  }
              }
              In = 0, Qr = null, gf(o, c, M, 5);
              break;
            case 6:
              In = 0, Qr = null, gf(o, c, M, 6);
              break;
            case 8:
              Gh(), Hi = 6;
              break t;
            default:
              throw Error(a(462));
          }
        }
        _p();
        break;
      } catch (jt) {
        Uh(o, jt);
      }
    while (!0);
    return V = jo = null, nt.H = v, nt.A = T, qn = d, pn !== null ? 0 : (ii = null, Rn = 0, Br(), Hi);
  }
  function _p() {
    for (; pn !== null && !Jn(); )
      _g(pn);
  }
  function _g(o) {
    var c = sg(o.alternate, o, Kl);
    o.memoizedProps = o.pendingProps, c === null ? vp(o) : pn = c;
  }
  function My(o) {
    var c = o, d = c.alternate;
    switch (c.tag) {
      case 15:
      case 0:
        c = ag(
          d,
          c,
          c.pendingProps,
          c.type,
          void 0,
          Rn
        );
        break;
      case 11:
        c = ag(
          d,
          c,
          c.pendingProps,
          c.type.render,
          c.ref,
          Rn
        );
        break;
      case 5:
        Qc(c);
      default:
        pv(d, c), c = pn = Fc(c, Kl), c = sg(d, c, Kl);
    }
    o.memoizedProps = o.pendingProps, c === null ? vp(o) : pn = c;
  }
  function gf(o, c, d, v) {
    V = jo = null, Qc(c), li = null, Rr = 0;
    var T = c.return;
    try {
      if (Xr(
        o,
        T,
        c,
        d,
        Rn
      )) {
        Hi = 1, Bu(
          o,
          sr(d, o.current)
        ), pn = null;
        return;
      }
    } catch (M) {
      if (T !== null) throw pn = T, M;
      Hi = 1, Bu(
        o,
        sr(d, o.current)
      ), pn = null;
      return;
    }
    c.flags & 32768 ? (je || v === 1 ? o = !0 : Ku || (Rn & 536870912) !== 0 ? o = !1 : (Xl = o = !0, (v === 2 || v === 9 || v === 3 || v === 6) && (v = ea.current, v !== null && v.tag === 13 && (v.flags |= 16384))), Cy(c, o)) : vp(c);
  }
  function vp(o) {
    var c = o;
    do {
      if ((c.flags & 32768) !== 0) {
        Cy(
          c,
          Xl
        );
        return;
      }
      o = c.return;
      var d = Wn(
        c.alternate,
        c,
        Kl
      );
      if (d !== null) {
        pn = d;
        return;
      }
      if (c = c.sibling, c !== null) {
        pn = c;
        return;
      }
      pn = c = o;
    } while (c !== null);
    Hi === 0 && (Hi = 5);
  }
  function Cy(o, c) {
    do {
      var d = fp(o.alternate, o);
      if (d !== null) {
        d.flags &= 32767, pn = d;
        return;
      }
      if (d = o.return, d !== null && (d.flags |= 32768, d.subtreeFlags = 0, d.deletions = null), !c && (o = o.sibling, o !== null)) {
        pn = o;
        return;
      }
      pn = o = d;
    } while (o !== null);
    Hi = 6, pn = null;
  }
  function vg(o, c, d, v, T, M, P, q, it) {
    o.cancelPendingCommit = null;
    do
      bp();
    while (Ka !== 0);
    if ((qn & 6) !== 0) throw Error(a(327));
    if (c !== null) {
      if (c === o.current) throw Error(a(177));
      if (M = c.lanes | c.childLanes, M |= Od, Be(
        o,
        d,
        M,
        P,
        q,
        it
      ), o === ii && (pn = ii = null, Rn = 0), Ju = c, Qu = o, Ph = d, Jr = M, gp = T, Ry = v, (c.subtreeFlags & 10256) !== 0 || (c.flags & 10256) !== 0 ? (o.callbackNode = null, o.callbackPriority = 0, Cv(fe, function() {
        return Av(), null;
      })) : (o.callbackNode = null, o.callbackPriority = 0), v = (c.flags & 13878) !== 0, (c.subtreeFlags & 13878) !== 0 || v) {
        v = nt.T, nt.T = null, T = J.p, J.p = 2, P = qn, qn |= 4;
        try {
          _v(o, c, d);
        } finally {
          qn = P, J.p = T, nt.T = v;
        }
      }
      Ka = 1, wv(), Rv(), Eg();
    }
  }
  function wv() {
    if (Ka === 1) {
      Ka = 0;
      var o = Qu, c = Ju, d = (c.flags & 13878) !== 0;
      if ((c.subtreeFlags & 13878) !== 0 || d) {
        d = nt.T, nt.T = null;
        var v = J.p;
        J.p = 2;
        var T = qn;
        qn |= 4;
        try {
          lf(c, o);
          var M = Vh, P = Cd(o.containerInfo), q = M.focusedElem, it = M.selectionRange;
          if (P !== q && q && q.ownerDocument && xi(
            q.ownerDocument.documentElement,
            q
          )) {
            if (it !== null && zm(q)) {
              var vt = it.start, jt = it.end;
              if (jt === void 0 && (jt = vt), "selectionStart" in q)
                q.selectionStart = vt, q.selectionEnd = Math.min(
                  jt,
                  q.value.length
                );
              else {
                var Bt = q.ownerDocument || document, xt = Bt && Bt.defaultView || window;
                if (xt.getSelection) {
                  var bt = xt.getSelection(), we = q.textContent.length, Ee = Math.min(it.start, we), jn = it.end === void 0 ? Ee : Math.min(it.end, we);
                  !bt.extend && Ee > jn && (P = jn, jn = Ee, Ee = P);
                  var yt = wl(
                    q,
                    Ee
                  ), ct = wl(
                    q,
                    jn
                  );
                  if (yt && ct && (bt.rangeCount !== 1 || bt.anchorNode !== yt.node || bt.anchorOffset !== yt.offset || bt.focusNode !== ct.node || bt.focusOffset !== ct.offset)) {
                    var Et = Bt.createRange();
                    Et.setStart(yt.node, yt.offset), bt.removeAllRanges(), Ee > jn ? (bt.addRange(Et), bt.extend(ct.node, ct.offset)) : (Et.setEnd(ct.node, ct.offset), bt.addRange(Et));
                  }
                }
              }
            }
            for (Bt = [], bt = q; bt = bt.parentNode; )
              bt.nodeType === 1 && Bt.push({
                element: bt,
                left: bt.scrollLeft,
                top: bt.scrollTop
              });
            for (typeof q.focus == "function" && q.focus(), q = 0; q < Bt.length; q++) {
              var kt = Bt[q];
              kt.element.scrollLeft = kt.left, kt.element.scrollTop = kt.top;
            }
          }
          Ig = !!Eo, Vh = Eo = null;
        } finally {
          qn = T, J.p = v, nt.T = d;
        }
      }
      o.current = c, Ka = 2;
    }
  }
  function Rv() {
    if (Ka === 2) {
      Ka = 0;
      var o = Qu, c = Ju, d = (c.flags & 8772) !== 0;
      if ((c.subtreeFlags & 8772) !== 0 || d) {
        d = nt.T, nt.T = null;
        var v = J.p;
        J.p = 2;
        var T = qn;
        qn |= 4;
        try {
          hp(o, c.alternate, c);
        } finally {
          qn = T, J.p = v, nt.T = d;
        }
      }
      Ka = 3;
    }
  }
  function Eg() {
    if (Ka === 4 || Ka === 3) {
      Ka = 0, Pi();
      var o = Qu, c = Ju, d = Ph, v = Ry;
      (c.subtreeFlags & 10256) !== 0 || (c.flags & 10256) !== 0 ? Ka = 5 : (Ka = 0, Ju = Qu = null, Ep(o, o.pendingLanes));
      var T = o.pendingLanes;
      if (T === 0 && ($o = null), xn(d), c = c.stateNode, ti && typeof ti.onCommitFiberRoot == "function")
        try {
          ti.onCommitFiberRoot(
            Ha,
            c,
            void 0,
            (c.current.flags & 128) === 128
          );
        } catch {
        }
      if (v !== null) {
        c = nt.T, T = J.p, J.p = 2, nt.T = null;
        try {
          for (var M = o.onRecoverableError, P = 0; P < v.length; P++) {
            var q = v[P];
            M(q.value, {
              componentStack: q.stack
            });
          }
        } finally {
          nt.T = c, J.p = T;
        }
      }
      (Ph & 3) !== 0 && bp(), _o(o), T = o.pendingLanes, (d & 4194090) !== 0 && (T & 42) !== 0 ? o === mp ? hf++ : (hf = 0, mp = o) : hf = 0, Ql(0);
    }
  }
  function Ep(o, c) {
    (o.pooledCacheLanes &= c) === 0 && (c = o.pooledCache, c != null && (o.pooledCache = null, Du(c)));
  }
  function bp(o) {
    return wv(), Rv(), Eg(), Av();
  }
  function Av() {
    if (Ka !== 5) return !1;
    var o = Qu, c = Jr;
    Jr = 0;
    var d = xn(Ph), v = nt.T, T = J.p;
    try {
      J.p = 32 > d ? 32 : d, nt.T = null, d = gp, gp = null;
      var M = Qu, P = Ph;
      if (Ka = 0, Ju = Qu = null, Ph = 0, (qn & 6) !== 0) throw Error(a(331));
      var q = qn;
      if (qn |= 4, dp(M.current), $l(
        M,
        M.current,
        P,
        d
      ), qn = q, Ql(0, !1), ti && typeof ti.onPostCommitFiberRoot == "function")
        try {
          ti.onPostCommitFiberRoot(Ha, M);
        } catch {
        }
      return !0;
    } finally {
      J.p = T, nt.T = v, Ep(o, c);
    }
  }
  function Oy(o, c, d) {
    c = sr(d, c), c = ng(o.stateNode, c, 2), o = xr(o, c, 2), o !== null && (oe(o, 2), _o(o));
  }
  function ai(o, c, d) {
    if (o.tag === 3)
      Oy(o, o, d);
    else
      for (; c !== null; ) {
        if (c.tag === 3) {
          Oy(
            c,
            o,
            d
          );
          break;
        } else if (c.tag === 1) {
          var v = c.stateNode;
          if (typeof c.type.getDerivedStateFromError == "function" || typeof v.componentDidCatch == "function" && ($o === null || !$o.has(v))) {
            o = sr(d, o), d = hy(2), v = xr(c, d, 2), v !== null && (dy(
              d,
              v,
              c,
              o
            ), oe(v, 2), _o(v));
            break;
          }
        }
        c = c.return;
      }
  }
  function bg(o, c, d) {
    var v = o.pingCache;
    if (v === null) {
      v = o.pingCache = new gg();
      var T = /* @__PURE__ */ new Set();
      v.set(c, T);
    } else
      T = v.get(c), T === void 0 && (T = /* @__PURE__ */ new Set(), v.set(c, T));
    T.has(d) || (Sy = !0, T.add(d), o = Mv.bind(null, o, c, d), c.then(o, o));
  }
  function Mv(o, c, d) {
    var v = o.pingCache;
    v !== null && v.delete(c), o.pingedLanes |= o.suspendedLanes & d, o.warmLanes &= ~d, ii === o && (Rn & d) === d && (Hi === 4 || Hi === 3 && (Rn & 62914560) === Rn && 300 > Ge() - wy ? (qn & 2) === 0 && yo(o, 0) : xy |= d, Lh === Rn && (Lh = 0)), _o(o);
  }
  function Sp(o, c) {
    c === 0 && (c = Kt()), o = Go(o, c), o !== null && (oe(o, c), _o(o));
  }
  function Sg(o) {
    var c = o.memoizedState, d = 0;
    c !== null && (d = c.retryLane), Sp(o, d);
  }
  function RE(o, c) {
    var d = 0;
    switch (o.tag) {
      case 13:
        var v = o.stateNode, T = o.memoizedState;
        T !== null && (d = T.retryLane);
        break;
      case 19:
        v = o.stateNode;
        break;
      case 22:
        v = o.stateNode._retryCache;
        break;
      default:
        throw Error(a(314));
    }
    v !== null && v.delete(c), Sp(o, d);
  }
  function Cv(o, c) {
    return te(o, c);
  }
  var xg = null, ec = null, jh = !1, mf = !1, kh = !1, Wl = 0;
  function _o(o) {
    o !== ec && o.next === null && (ec === null ? xg = ec = o : ec = ec.next = o), mf = !0, jh || (jh = !0, Bh());
  }
  function Ql(o, c) {
    if (!kh && mf) {
      kh = !0;
      do
        for (var d = !1, v = xg; v !== null; ) {
          if (o !== 0) {
            var T = v.pendingLanes;
            if (T === 0) var M = 0;
            else {
              var P = v.suspendedLanes, q = v.pingedLanes;
              M = (1 << 31 - Gi(42 | o) + 1) - 1, M &= T & ~(P & ~q), M = M & 201326741 ? M & 201326741 | 1 : M ? M | 2 : 0;
            }
            M !== 0 && (d = !0, Ov(v, M));
          } else
            M = Rn, M = sa(
              v,
              v === ii ? M : 0,
              v.cancelPendingCommit !== null || v.timeoutHandle !== -1
            ), (M & 3) === 0 || Ba(v, M) || (d = !0, Ov(v, M));
          v = v.next;
        }
      while (d);
      kh = !1;
    }
  }
  function AE() {
    Hh();
  }
  function Hh() {
    mf = jh = !1;
    var o = 0;
    Wl !== 0 && (Mp() && (o = Wl), Wl = 0);
    for (var c = Ge(), d = null, v = xg; v !== null; ) {
      var T = v.next, M = nc(v, c);
      M === 0 ? (v.next = null, d === null ? xg = T : d.next = T, T === null && (ec = d)) : (d = v, (o !== 0 || (M & 3) !== 0) && (mf = !0)), v = T;
    }
    Ql(o);
  }
  function nc(o, c) {
    for (var d = o.suspendedLanes, v = o.pingedLanes, T = o.expirationTimes, M = o.pendingLanes & -62914561; 0 < M; ) {
      var P = 31 - Gi(M), q = 1 << P, it = T[P];
      it === -1 ? ((q & d) === 0 || (q & v) !== 0) && (T[P] = Y(q, c)) : it <= c && (o.expiredLanes |= q), M &= ~q;
    }
    if (c = ii, d = Rn, d = sa(
      o,
      o === c ? d : 0,
      o.cancelPendingCommit !== null || o.timeoutHandle !== -1
    ), v = o.callbackNode, d === 0 || o === c && (In === 2 || In === 9) || o.cancelPendingCommit !== null)
      return v !== null && v !== null && tn(v), o.callbackNode = null, o.callbackPriority = 0;
    if ((d & 3) === 0 || Ba(o, d)) {
      if (c = d & -d, c === o.callbackPriority) return c;
      switch (v !== null && tn(v), xn(d)) {
        case 2:
        case 8:
          d = Ai;
          break;
        case 32:
          d = fe;
          break;
        case 268435456:
          d = Dn;
          break;
        default:
          d = fe;
      }
      return v = Dy.bind(null, o), d = te(d, v), o.callbackPriority = c, o.callbackNode = d, c;
    }
    return v !== null && v !== null && tn(v), o.callbackPriority = 2, o.callbackNode = null, 2;
  }
  function Dy(o, c) {
    if (Ka !== 0 && Ka !== 5)
      return o.callbackNode = null, o.callbackPriority = 0, null;
    var d = o.callbackNode;
    if (bp() && o.callbackNode !== d)
      return null;
    var v = Rn;
    return v = sa(
      o,
      o === ii ? v : 0,
      o.cancelPendingCommit !== null || o.timeoutHandle !== -1
    ), v === 0 ? null : (Sv(o, v, c), nc(o, Ge()), o.callbackNode != null && o.callbackNode === d ? Dy.bind(null, o) : null);
  }
  function Ov(o, c) {
    if (bp()) return null;
    Sv(o, c, !0);
  }
  function Bh() {
    OE(function() {
      (qn & 6) !== 0 ? te(
        ka,
        AE
      ) : Hh();
    });
  }
  function Tg() {
    return Wl === 0 && (Wl = dt()), Wl;
  }
  function qh(o) {
    return o == null || typeof o == "symbol" || typeof o == "boolean" ? null : typeof o == "function" ? o : $f("" + o);
  }
  function xp(o, c) {
    var d = c.ownerDocument.createElement("input");
    return d.name = c.name, d.value = c.value, o.id && d.setAttribute("form", o.id), c.parentNode.insertBefore(d, c), o = new FormData(o), d.parentNode.removeChild(d), o;
  }
  function Tp(o, c, d, v, T) {
    if (c === "submit" && d && d.stateNode === T) {
      var M = qh(
        (T[cn] || null).action
      ), P = v.submitter;
      P && (c = (c = P[cn] || null) ? qh(c.formAction) : P.getAttribute("formAction"), c !== null && (M = c, P = null));
      var q = new Td(
        "action",
        "action",
        null,
        v,
        T
      );
      o.push({
        event: q,
        listeners: [
          {
            instance: null,
            listener: function() {
              if (v.defaultPrevented) {
                if (Wl !== 0) {
                  var it = P ? xp(T, P) : new FormData(T);
                  Zd(
                    d,
                    {
                      pending: !0,
                      data: it,
                      method: T.method,
                      action: M
                    },
                    null,
                    it
                  );
                }
              } else
                typeof M == "function" && (q.preventDefault(), it = P ? xp(T, P) : new FormData(T), Zd(
                  d,
                  {
                    pending: !0,
                    data: it,
                    method: T.method,
                    action: M
                  },
                  M,
                  it
                ));
            },
            currentTarget: T
          }
        ]
      });
    }
  }
  for (var wp = 0; wp < Nn.length; wp++) {
    var Bi = Nn[wp], Ny = Bi.toLowerCase(), ME = Bi[0].toUpperCase() + Bi.slice(1);
    Hr(
      Ny,
      "on" + ME
    );
  }
  Hr(Yc, "onAnimationEnd"), Hr(cv, "onAnimationIteration"), Hr(kr, "onAnimationStart"), Hr("dblclick", "onDoubleClick"), Hr("focusin", "onFocus"), Hr("focusout", "onBlur"), Hr(Gm, "onTransitionRun"), Hr(X0, "onTransitionStart"), Hr(Rl, "onTransitionCancel"), Hr(ah, "onTransitionEnd"), Lc("onMouseEnter", ["mouseout", "mouseover"]), Lc("onMouseLeave", ["mouseout", "mouseover"]), Lc("onPointerEnter", ["pointerout", "pointerover"]), Lc("onPointerLeave", ["pointerout", "pointerover"]), Ra(
    "onChange",
    "change click focusin focusout input keydown keyup selectionchange".split(" ")
  ), Ra(
    "onSelect",
    "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
      " "
    )
  ), Ra("onBeforeInput", [
    "compositionend",
    "keypress",
    "textInput",
    "paste"
  ]), Ra(
    "onCompositionEnd",
    "compositionend focusout keydown keypress keyup mousedown".split(" ")
  ), Ra(
    "onCompositionStart",
    "compositionstart focusout keydown keypress keyup mousedown".split(" ")
  ), Ra(
    "onCompositionUpdate",
    "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
  );
  var He = "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(
    " "
  ), CE = new Set(
    "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(He)
  );
  function Jl(o, c) {
    c = (c & 4) !== 0;
    for (var d = 0; d < o.length; d++) {
      var v = o[d], T = v.event;
      v = v.listeners;
      t: {
        var M = void 0;
        if (c)
          for (var P = v.length - 1; 0 <= P; P--) {
            var q = v[P], it = q.instance, vt = q.currentTarget;
            if (q = q.listener, it !== M && T.isPropagationStopped())
              break t;
            M = q, T.currentTarget = vt;
            try {
              M(T);
            } catch (jt) {
              ku(jt);
            }
            T.currentTarget = null, M = it;
          }
        else
          for (P = 0; P < v.length; P++) {
            if (q = v[P], it = q.instance, vt = q.currentTarget, q = q.listener, it !== M && T.isPropagationStopped())
              break t;
            M = q, T.currentTarget = vt;
            try {
              M(T);
            } catch (jt) {
              ku(jt);
            }
            T.currentTarget = null, M = it;
          }
      }
    }
  }
  function Ke(o, c) {
    var d = c[us];
    d === void 0 && (d = c[us] = /* @__PURE__ */ new Set());
    var v = o + "__bubble";
    d.has(v) || (Dv(c, o, 2, !1), d.add(v));
  }
  function ic(o, c, d) {
    var v = 0;
    c && (v |= 4), Dv(
      d,
      o,
      v,
      c
    );
  }
  var Za = "_reactListening" + Math.random().toString(36).slice(2);
  function wg(o) {
    if (!o[Za]) {
      o[Za] = !0, z0.forEach(function(d) {
        d !== "selectionchange" && (CE.has(d) || ic(d, !1, o), ic(d, !0, o));
      });
      var c = o.nodeType === 9 ? o : o.ownerDocument;
      c === null || c[Za] || (c[Za] = !0, ic("selectionchange", !1, c));
    }
  }
  function Dv(o, c, d, v) {
    switch (Hv(c)) {
      case 2:
        var T = kv;
        break;
      case 8:
        T = bf;
        break;
      default:
        T = Up;
    }
    d = T.bind(
      null,
      c,
      d,
      o
    ), T = void 0, !Kf || c !== "touchstart" && c !== "touchmove" && c !== "wheel" || (T = !0), v ? T !== void 0 ? o.addEventListener(c, d, {
      capture: !0,
      passive: T
    }) : o.addEventListener(c, d, !0) : T !== void 0 ? o.addEventListener(c, d, {
      passive: T
    }) : o.addEventListener(c, d, !1);
  }
  function vo(o, c, d, v, T) {
    var M = v;
    if ((c & 1) === 0 && (c & 2) === 0 && v !== null)
      t: for (; ; ) {
        if (v === null) return;
        var P = v.tag;
        if (P === 3 || P === 4) {
          var q = v.stateNode.containerInfo;
          if (q === T) break;
          if (P === 4)
            for (P = v.return; P !== null; ) {
              var it = P.tag;
              if ((it === 3 || it === 4) && P.stateNode.containerInfo === T)
                return;
              P = P.return;
            }
          for (; q !== null; ) {
            if (P = mu(q), P === null) return;
            if (it = P.tag, it === 5 || it === 6 || it === 26 || it === 27) {
              v = M = P;
              continue t;
            }
            q = q.parentNode;
          }
        }
        v = v.return;
      }
    tv(function() {
      var vt = M, jt = jc(d), Bt = [];
      t: {
        var xt = rh.get(o);
        if (xt !== void 0) {
          var bt = Td, we = o;
          switch (o) {
            case "keypress":
              if (Xn(d) === 0) break t;
            case "keydown":
            case "keyup":
              bt = xl;
              break;
            case "focusin":
              we = "focus", bt = Am;
              break;
            case "focusout":
              we = "blur", bt = Am;
              break;
            case "beforeblur":
            case "afterblur":
              bt = Am;
              break;
            case "click":
              if (d.button === 2) break t;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              bt = io;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              bt = Rm;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              bt = Cm;
              break;
            case Yc:
            case cv:
            case kr:
              bt = iv;
              break;
            case ah:
              bt = Gr;
              break;
            case "scroll":
            case "scrollend":
              bt = wE;
              break;
            case "wheel":
              bt = Om;
              break;
            case "copy":
            case "cut":
            case "paste":
              bt = rv;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              bt = Ji;
              break;
            case "toggle":
            case "beforetoggle":
              bt = th;
          }
          var Ee = (c & 4) !== 0, jn = !Ee && (o === "scroll" || o === "scrollend"), yt = Ee ? xt !== null ? xt + "Capture" : null : xt;
          Ee = [];
          for (var ct = vt, Et; ct !== null; ) {
            var kt = ct;
            if (Et = kt.stateNode, kt = kt.tag, kt !== 5 && kt !== 26 && kt !== 27 || Et === null || yt === null || (kt = Sl(ct, yt), kt != null && Ee.push(
              be(ct, kt, Et)
            )), jn) break;
            ct = ct.return;
          }
          0 < Ee.length && (xt = new bt(
            xt,
            we,
            null,
            d,
            jt
          ), Bt.push({ event: xt, listeners: Ee }));
        }
      }
      if ((c & 7) === 0) {
        t: {
          if (xt = o === "mouseover" || o === "pointerover", bt = o === "mouseout" || o === "pointerout", xt && d !== Sd && (we = d.relatedTarget || d.fromElement) && (mu(we) || we[Si]))
            break t;
          if ((bt || xt) && (xt = jt.window === jt ? jt : (xt = jt.ownerDocument) ? xt.defaultView || xt.parentWindow : window, bt ? (we = d.relatedTarget || d.toElement, bt = vt, we = we ? mu(we) : null, we !== null && (jn = l(we), Ee = we.tag, we !== jn || Ee !== 5 && Ee !== 27 && Ee !== 6) && (we = null)) : (bt = null, we = vt), bt !== we)) {
            if (Ee = io, kt = "onMouseLeave", yt = "onMouseEnter", ct = "mouse", (o === "pointerout" || o === "pointerover") && (Ee = Ji, kt = "onPointerLeave", yt = "onPointerEnter", ct = "pointer"), jn = bt == null ? xt : Nc(bt), Et = we == null ? xt : Nc(we), xt = new Ee(
              kt,
              ct + "leave",
              bt,
              d,
              jt
            ), xt.target = jn, xt.relatedTarget = Et, kt = null, mu(jt) === vt && (Ee = new Ee(
              yt,
              ct + "enter",
              we,
              d,
              jt
            ), Ee.target = Et, Ee.relatedTarget = jn, kt = Ee), jn = kt, bt && we)
              e: {
                for (Ee = bt, yt = we, ct = 0, Et = Ee; Et; Et = ia(Et))
                  ct++;
                for (Et = 0, kt = yt; kt; kt = ia(kt))
                  Et++;
                for (; 0 < ct - Et; )
                  Ee = ia(Ee), ct--;
                for (; 0 < Et - ct; )
                  yt = ia(yt), Et--;
                for (; ct--; ) {
                  if (Ee === yt || yt !== null && Ee === yt.alternate)
                    break e;
                  Ee = ia(Ee), yt = ia(yt);
                }
                Ee = null;
              }
            else Ee = null;
            bt !== null && Ci(
              Bt,
              xt,
              bt,
              Ee,
              !1
            ), we !== null && jn !== null && Ci(
              Bt,
              jn,
              we,
              Ee,
              !0
            );
          }
        }
        t: {
          if (xt = vt ? Nc(vt) : window, bt = xt.nodeName && xt.nodeName.toLowerCase(), bt === "select" || bt === "input" && xt.type === "file")
            var le = Su;
          else if (Md(xt))
            if (q0)
              le = Tl;
            else {
              le = ro;
              var nn = Y0;
            }
          else
            bt = xt.nodeName, !bt || bt.toLowerCase() !== "input" || xt.type !== "checkbox" && xt.type !== "radio" ? vt && Yf(vt.elementType) && (le = Su) : le = so;
          if (le && (le = le(o, vt))) {
            Eu(
              Bt,
              le,
              d,
              jt
            );
            break t;
          }
          nn && nn(o, xt, vt), o === "focusout" && vt && xt.type === "number" && vt.memoizedProps.value != null && Uc(xt, "number", xt.value);
        }
        switch (nn = vt ? Nc(vt) : window, o) {
          case "focusin":
            (Md(nn) || nn.contentEditable === "true") && (Ps = nn, zs = vt, ft = null);
            break;
          case "focusout":
            ft = zs = Ps = null;
            break;
          case "mousedown":
            Pt = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            Pt = !1, Mt(Bt, d, jt);
            break;
          case "selectionchange":
            if ($0) break;
          case "keydown":
          case "keyup":
            Mt(Bt, d, jt);
        }
        var ve;
        if (Dm)
          t: {
            switch (o) {
              case "compositionstart":
                var Oe = "onCompositionStart";
                break t;
              case "compositionend":
                Oe = "onCompositionEnd";
                break t;
              case "compositionupdate":
                Oe = "onCompositionUpdate";
                break t;
            }
            Oe = void 0;
          }
        else
          Ur ? Lm(o, d) && (Oe = "onCompositionEnd") : o === "keydown" && d.keyCode === 229 && (Oe = "onCompositionStart");
        Oe && (eh && d.locale !== "ko" && (Ur || Oe !== "onCompositionStart" ? Oe === "onCompositionEnd" && Ur && (ve = xd()) : (Ds = jt, wm = "value" in Ds ? Ds.value : Ds.textContent, Ur = !0)), nn = ac(vt, Oe), 0 < nn.length && (Oe = new yr(
          Oe,
          o,
          null,
          d,
          jt
        ), Bt.push({ event: Oe, listeners: nn }), ve ? Oe.data = ve : (ve = qc(d), ve !== null && (Oe.data = ve)))), (ve = uv ? B0(o, d) : Im(o, d)) && (Oe = ac(vt, "onBeforeInput"), 0 < Oe.length && (nn = new yr(
          "onBeforeInput",
          "beforeinput",
          null,
          d,
          jt
        ), Bt.push({
          event: nn,
          listeners: Oe
        }), nn.data = ve)), Tp(
          Bt,
          o,
          vt,
          d,
          jt
        );
      }
      Jl(Bt, c);
    });
  }
  function be(o, c, d) {
    return {
      instance: o,
      listener: c,
      currentTarget: d
    };
  }
  function ac(o, c) {
    for (var d = c + "Capture", v = []; o !== null; ) {
      var T = o, M = T.stateNode;
      if (T = T.tag, T !== 5 && T !== 26 && T !== 27 || M === null || (T = Sl(o, d), T != null && v.unshift(
        be(o, T, M)
      ), T = Sl(o, c), T != null && v.push(
        be(o, T, M)
      )), o.tag === 3) return v;
      o = o.return;
    }
    return [];
  }
  function ia(o) {
    if (o === null) return null;
    do
      o = o.return;
    while (o && o.tag !== 5 && o.tag !== 27);
    return o || null;
  }
  function Ci(o, c, d, v, T) {
    for (var M = c._reactName, P = []; d !== null && d !== v; ) {
      var q = d, it = q.alternate, vt = q.stateNode;
      if (q = q.tag, it !== null && it === v) break;
      q !== 5 && q !== 26 && q !== 27 || vt === null || (it = vt, T ? (vt = Sl(d, M), vt != null && P.unshift(
        be(d, vt, it)
      )) : T || (vt = Sl(d, M), vt != null && P.push(
        be(d, vt, it)
      ))), d = d.return;
    }
    P.length !== 0 && o.push({ event: c, listeners: P });
  }
  var Rp = /\r\n?/g, ha = /\u0000|\uFFFD/g;
  function Ap(o) {
    return (typeof o == "string" ? o : "" + o).replace(Rp, `
`).replace(ha, "");
  }
  function Nv(o, c) {
    return c = Ap(c), Ap(o) === c;
  }
  function Rg() {
  }
  function ri(o, c, d, v, T, M) {
    switch (d) {
      case "children":
        typeof v == "string" ? c === "body" || c === "textarea" && v === "" || bl(o, v) : (typeof v == "number" || typeof v == "bigint") && c !== "body" && bl(o, "" + v);
        break;
      case "className":
        vl(o, "class", v);
        break;
      case "tabIndex":
        vl(o, "tabindex", v);
        break;
      case "dir":
      case "role":
      case "viewBox":
      case "width":
      case "height":
        vl(o, d, v);
        break;
      case "style":
        bd(o, v, M);
        break;
      case "data":
        if (c !== "object") {
          vl(o, "data", v);
          break;
        }
      case "src":
      case "href":
        if (v === "" && (c !== "a" || d !== "href")) {
          o.removeAttribute(d);
          break;
        }
        if (v == null || typeof v == "function" || typeof v == "symbol" || typeof v == "boolean") {
          o.removeAttribute(d);
          break;
        }
        v = $f("" + v), o.setAttribute(d, v);
        break;
      case "action":
      case "formAction":
        if (typeof v == "function") {
          o.setAttribute(
            d,
            "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" && (d === "formAction" ? (c !== "input" && ri(o, c, "name", T.name, T, null), ri(
            o,
            c,
            "formEncType",
            T.formEncType,
            T,
            null
          ), ri(
            o,
            c,
            "formMethod",
            T.formMethod,
            T,
            null
          ), ri(
            o,
            c,
            "formTarget",
            T.formTarget,
            T,
            null
          )) : (ri(o, c, "encType", T.encType, T, null), ri(o, c, "method", T.method, T, null), ri(o, c, "target", T.target, T, null)));
        if (v == null || typeof v == "symbol" || typeof v == "boolean") {
          o.removeAttribute(d);
          break;
        }
        v = $f("" + v), o.setAttribute(d, v);
        break;
      case "onClick":
        v != null && (o.onclick = Rg);
        break;
      case "onScroll":
        v != null && Ke("scroll", o);
        break;
      case "onScrollEnd":
        v != null && Ke("scrollend", o);
        break;
      case "dangerouslySetInnerHTML":
        if (v != null) {
          if (typeof v != "object" || !("__html" in v))
            throw Error(a(61));
          if (d = v.__html, d != null) {
            if (T.children != null) throw Error(a(60));
            o.innerHTML = d;
          }
        }
        break;
      case "multiple":
        o.multiple = v && typeof v != "function" && typeof v != "symbol";
        break;
      case "muted":
        o.muted = v && typeof v != "function" && typeof v != "symbol";
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "ref":
        break;
      case "autoFocus":
        break;
      case "xlinkHref":
        if (v == null || typeof v == "function" || typeof v == "boolean" || typeof v == "symbol") {
          o.removeAttribute("xlink:href");
          break;
        }
        d = $f("" + v), o.setAttributeNS(
          "http://www.w3.org/1999/xlink",
          "xlink:href",
          d
        );
        break;
      case "contentEditable":
      case "spellCheck":
      case "draggable":
      case "value":
      case "autoReverse":
      case "externalResourcesRequired":
      case "focusable":
      case "preserveAlpha":
        v != null && typeof v != "function" && typeof v != "symbol" ? o.setAttribute(d, "" + v) : o.removeAttribute(d);
        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":
        v && typeof v != "function" && typeof v != "symbol" ? o.setAttribute(d, "") : o.removeAttribute(d);
        break;
      case "capture":
      case "download":
        v === !0 ? o.setAttribute(d, "") : v !== !1 && v != null && typeof v != "function" && typeof v != "symbol" ? o.setAttribute(d, v) : o.removeAttribute(d);
        break;
      case "cols":
      case "rows":
      case "size":
      case "span":
        v != null && typeof v != "function" && typeof v != "symbol" && !isNaN(v) && 1 <= v ? o.setAttribute(d, v) : o.removeAttribute(d);
        break;
      case "rowSpan":
      case "start":
        v == null || typeof v == "function" || typeof v == "symbol" || isNaN(v) ? o.removeAttribute(d) : o.setAttribute(d, v);
        break;
      case "popover":
        Ke("beforetoggle", o), Ke("toggle", o), _d(o, "popover", v);
        break;
      case "xlinkActuate":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:actuate",
          v
        );
        break;
      case "xlinkArcrole":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:arcrole",
          v
        );
        break;
      case "xlinkRole":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:role",
          v
        );
        break;
      case "xlinkShow":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:show",
          v
        );
        break;
      case "xlinkTitle":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:title",
          v
        );
        break;
      case "xlinkType":
        eo(
          o,
          "http://www.w3.org/1999/xlink",
          "xlink:type",
          v
        );
        break;
      case "xmlBase":
        eo(
          o,
          "http://www.w3.org/XML/1998/namespace",
          "xml:base",
          v
        );
        break;
      case "xmlLang":
        eo(
          o,
          "http://www.w3.org/XML/1998/namespace",
          "xml:lang",
          v
        );
        break;
      case "xmlSpace":
        eo(
          o,
          "http://www.w3.org/XML/1998/namespace",
          "xml:space",
          v
        );
        break;
      case "is":
        _d(o, "is", v);
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        (!(2 < d.length) || d[0] !== "o" && d[0] !== "O" || d[1] !== "n" && d[1] !== "N") && (d = Ff.get(d) || d, _d(o, d, v));
    }
  }
  function Sa(o, c, d, v, T, M) {
    switch (d) {
      case "style":
        bd(o, v, M);
        break;
      case "dangerouslySetInnerHTML":
        if (v != null) {
          if (typeof v != "object" || !("__html" in v))
            throw Error(a(61));
          if (d = v.__html, d != null) {
            if (T.children != null) throw Error(a(60));
            o.innerHTML = d;
          }
        }
        break;
      case "children":
        typeof v == "string" ? bl(o, v) : (typeof v == "number" || typeof v == "bigint") && bl(o, "" + v);
        break;
      case "onScroll":
        v != null && Ke("scroll", o);
        break;
      case "onScrollEnd":
        v != null && Ke("scrollend", o);
        break;
      case "onClick":
        v != null && (o.onclick = Rg);
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "innerHTML":
      case "ref":
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        if (!yd.hasOwnProperty(d))
          t: {
            if (d[0] === "o" && d[1] === "n" && (T = d.endsWith("Capture"), c = d.slice(2, T ? d.length - 7 : void 0), M = o[cn] || null, M = M != null ? M[d] : null, typeof M == "function" && o.removeEventListener(c, M, T), typeof v == "function")) {
              typeof M != "function" && M !== null && (d in o ? o[d] = null : o.hasAttribute(d) && o.removeAttribute(d)), o.addEventListener(c, v, T);
              break t;
            }
            d in o ? o[d] = v : v === !0 ? o.setAttribute(d, "") : _d(o, d, v);
          }
    }
  }
  function Tt(o, c, d) {
    switch (c) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "img":
        Ke("error", o), Ke("load", o);
        var v = !1, T = !1, M;
        for (M in d)
          if (d.hasOwnProperty(M)) {
            var P = d[M];
            if (P != null)
              switch (M) {
                case "src":
                  v = !0;
                  break;
                case "srcSet":
                  T = !0;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(a(137, c));
                default:
                  ri(o, c, M, P, d, null);
              }
          }
        T && ri(o, c, "srcSet", d.srcSet, d, null), v && ri(o, c, "src", d.src, d, null);
        return;
      case "input":
        Ke("invalid", o);
        var q = M = P = T = null, it = null, vt = null;
        for (v in d)
          if (d.hasOwnProperty(v)) {
            var jt = d[v];
            if (jt != null)
              switch (v) {
                case "name":
                  T = jt;
                  break;
                case "type":
                  P = jt;
                  break;
                case "checked":
                  it = jt;
                  break;
                case "defaultChecked":
                  vt = jt;
                  break;
                case "value":
                  M = jt;
                  break;
                case "defaultValue":
                  q = jt;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (jt != null)
                    throw Error(a(137, c));
                  break;
                default:
                  ri(o, c, v, jt, d, null);
              }
          }
        Sm(
          o,
          M,
          q,
          it,
          vt,
          P,
          T,
          !1
        ), qf(o);
        return;
      case "select":
        Ke("invalid", o), v = P = M = null;
        for (T in d)
          if (d.hasOwnProperty(T) && (q = d[T], q != null))
            switch (T) {
              case "value":
                M = q;
                break;
              case "defaultValue":
                P = q;
                break;
              case "multiple":
                v = q;
              default:
                ri(o, c, T, q, d, null);
            }
        c = M, d = P, o.multiple = !!v, c != null ? pu(o, !!v, c, !1) : d != null && pu(o, !!v, d, !0);
        return;
      case "textarea":
        Ke("invalid", o), M = T = v = null;
        for (P in d)
          if (d.hasOwnProperty(P) && (q = d[P], q != null))
            switch (P) {
              case "value":
                v = q;
                break;
              case "defaultValue":
                T = q;
                break;
              case "children":
                M = q;
                break;
              case "dangerouslySetInnerHTML":
                if (q != null) throw Error(a(91));
                break;
              default:
                ri(o, c, P, q, d, null);
            }
        Ed(o, v, T, M), qf(o);
        return;
      case "option":
        for (it in d)
          if (d.hasOwnProperty(it) && (v = d[it], v != null))
            switch (it) {
              case "selected":
                o.selected = v && typeof v != "function" && typeof v != "symbol";
                break;
              default:
                ri(o, c, it, v, d, null);
            }
        return;
      case "dialog":
        Ke("beforetoggle", o), Ke("toggle", o), Ke("cancel", o), Ke("close", o);
        break;
      case "iframe":
      case "object":
        Ke("load", o);
        break;
      case "video":
      case "audio":
        for (v = 0; v < He.length; v++)
          Ke(He[v], o);
        break;
      case "image":
        Ke("error", o), Ke("load", o);
        break;
      case "details":
        Ke("toggle", o);
        break;
      case "embed":
      case "source":
      case "link":
        Ke("error", o), Ke("load", o);
      case "area":
      case "base":
      case "br":
      case "col":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "track":
      case "wbr":
      case "menuitem":
        for (vt in d)
          if (d.hasOwnProperty(vt) && (v = d[vt], v != null))
            switch (vt) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(a(137, c));
              default:
                ri(o, c, vt, v, d, null);
            }
        return;
      default:
        if (Yf(c)) {
          for (jt in d)
            d.hasOwnProperty(jt) && (v = d[jt], v !== void 0 && Sa(
              o,
              c,
              jt,
              v,
              d,
              void 0
            ));
          return;
        }
    }
    for (q in d)
      d.hasOwnProperty(q) && (v = d[q], v != null && ri(o, c, q, v, d, null));
  }
  function Un(o, c, d, v) {
    switch (c) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "input":
        var T = null, M = null, P = null, q = null, it = null, vt = null, jt = null;
        for (bt in d) {
          var Bt = d[bt];
          if (d.hasOwnProperty(bt) && Bt != null)
            switch (bt) {
              case "checked":
                break;
              case "value":
                break;
              case "defaultValue":
                it = Bt;
              default:
                v.hasOwnProperty(bt) || ri(o, c, bt, null, v, Bt);
            }
        }
        for (var xt in v) {
          var bt = v[xt];
          if (Bt = d[xt], v.hasOwnProperty(xt) && (bt != null || Bt != null))
            switch (xt) {
              case "type":
                M = bt;
                break;
              case "name":
                T = bt;
                break;
              case "checked":
                vt = bt;
                break;
              case "defaultChecked":
                jt = bt;
                break;
              case "value":
                P = bt;
                break;
              case "defaultValue":
                q = bt;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                if (bt != null)
                  throw Error(a(137, c));
                break;
              default:
                bt !== Bt && ri(
                  o,
                  c,
                  xt,
                  bt,
                  v,
                  Bt
                );
            }
        }
        bm(
          o,
          P,
          q,
          it,
          vt,
          jt,
          M,
          T
        );
        return;
      case "select":
        bt = P = q = xt = null;
        for (M in d)
          if (it = d[M], d.hasOwnProperty(M) && it != null)
            switch (M) {
              case "value":
                break;
              case "multiple":
                bt = it;
              default:
                v.hasOwnProperty(M) || ri(
                  o,
                  c,
                  M,
                  null,
                  v,
                  it
                );
            }
        for (T in v)
          if (M = v[T], it = d[T], v.hasOwnProperty(T) && (M != null || it != null))
            switch (T) {
              case "value":
                xt = M;
                break;
              case "defaultValue":
                q = M;
                break;
              case "multiple":
                P = M;
              default:
                M !== it && ri(
                  o,
                  c,
                  T,
                  M,
                  v,
                  it
                );
            }
        c = q, d = P, v = bt, xt != null ? pu(o, !!d, xt, !1) : !!v != !!d && (c != null ? pu(o, !!d, c, !0) : pu(o, !!d, d ? [] : "", !1));
        return;
      case "textarea":
        bt = xt = null;
        for (q in d)
          if (T = d[q], d.hasOwnProperty(q) && T != null && !v.hasOwnProperty(q))
            switch (q) {
              case "value":
                break;
              case "children":
                break;
              default:
                ri(o, c, q, null, v, T);
            }
        for (P in v)
          if (T = v[P], M = d[P], v.hasOwnProperty(P) && (T != null || M != null))
            switch (P) {
              case "value":
                xt = T;
                break;
              case "defaultValue":
                bt = T;
                break;
              case "children":
                break;
              case "dangerouslySetInnerHTML":
                if (T != null) throw Error(a(91));
                break;
              default:
                T !== M && ri(o, c, P, T, v, M);
            }
        xm(o, xt, bt);
        return;
      case "option":
        for (var we in d)
          if (xt = d[we], d.hasOwnProperty(we) && xt != null && !v.hasOwnProperty(we))
            switch (we) {
              case "selected":
                o.selected = !1;
                break;
              default:
                ri(
                  o,
                  c,
                  we,
                  null,
                  v,
                  xt
                );
            }
        for (it in v)
          if (xt = v[it], bt = d[it], v.hasOwnProperty(it) && xt !== bt && (xt != null || bt != null))
            switch (it) {
              case "selected":
                o.selected = xt && typeof xt != "function" && typeof xt != "symbol";
                break;
              default:
                ri(
                  o,
                  c,
                  it,
                  xt,
                  v,
                  bt
                );
            }
        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 Ee in d)
          xt = d[Ee], d.hasOwnProperty(Ee) && xt != null && !v.hasOwnProperty(Ee) && ri(o, c, Ee, null, v, xt);
        for (vt in v)
          if (xt = v[vt], bt = d[vt], v.hasOwnProperty(vt) && xt !== bt && (xt != null || bt != null))
            switch (vt) {
              case "children":
              case "dangerouslySetInnerHTML":
                if (xt != null)
                  throw Error(a(137, c));
                break;
              default:
                ri(
                  o,
                  c,
                  vt,
                  xt,
                  v,
                  bt
                );
            }
        return;
      default:
        if (Yf(c)) {
          for (var jn in d)
            xt = d[jn], d.hasOwnProperty(jn) && xt !== void 0 && !v.hasOwnProperty(jn) && Sa(
              o,
              c,
              jn,
              void 0,
              v,
              xt
            );
          for (jt in v)
            xt = v[jt], bt = d[jt], !v.hasOwnProperty(jt) || xt === bt || xt === void 0 && bt === void 0 || Sa(
              o,
              c,
              jt,
              xt,
              v,
              bt
            );
          return;
        }
    }
    for (var yt in d)
      xt = d[yt], d.hasOwnProperty(yt) && xt != null && !v.hasOwnProperty(yt) && ri(o, c, yt, null, v, xt);
    for (Bt in v)
      xt = v[Bt], bt = d[Bt], !v.hasOwnProperty(Bt) || xt === bt || xt == null && bt == null || ri(o, c, Bt, xt, v, bt);
  }
  var Eo = null, Vh = null;
  function tu(o) {
    return o.nodeType === 9 ? o : o.ownerDocument;
  }
  function Pn(o) {
    switch (o) {
      case "http://www.w3.org/2000/svg":
        return 1;
      case "http://www.w3.org/1998/Math/MathML":
        return 2;
      default:
        return 0;
    }
  }
  function Vn(o, c) {
    if (o === 0)
      switch (c) {
        case "svg":
          return 1;
        case "math":
          return 2;
        default:
          return 0;
      }
    return o === 1 && c === "foreignObject" ? 0 : o;
  }
  function rc(o, c) {
    return o === "textarea" || o === "noscript" || typeof c.children == "string" || typeof c.children == "number" || typeof c.children == "bigint" || typeof c.dangerouslySetInnerHTML == "object" && c.dangerouslySetInnerHTML !== null && c.dangerouslySetInnerHTML.__html != null;
  }
  var Xo = null;
  function Mp() {
    var o = window.event;
    return o && o.type === "popstate" ? o === Xo ? !1 : (Xo = o, !0) : (Xo = null, !1);
  }
  var Ko = typeof setTimeout == "function" ? setTimeout : void 0, Ly = typeof clearTimeout == "function" ? clearTimeout : void 0, Lv = typeof Promise == "function" ? Promise : void 0, OE = typeof queueMicrotask == "function" ? queueMicrotask : typeof Lv < "u" ? function(o) {
    return Lv.resolve(null).then(o).catch(Iv);
  } : Ko;
  function Iv(o) {
    setTimeout(function() {
      throw o;
    });
  }
  function aa(o) {
    return o === "head";
  }
  function Cp(o, c) {
    var d = c, v = 0, T = 0;
    do {
      var M = d.nextSibling;
      if (o.removeChild(d), M && M.nodeType === 8)
        if (d = M.data, d === "/$") {
          if (0 < v && 8 > v) {
            d = v;
            var P = o.ownerDocument;
            if (d & 1 && ie(P.documentElement), d & 2 && ie(P.body), d & 4)
              for (d = P.head, ie(d), P = d.firstChild; P; ) {
                var q = P.nextSibling, it = P.nodeName;
                P[pd] || it === "SCRIPT" || it === "STYLE" || it === "LINK" && P.rel.toLowerCase() === "stylesheet" || d.removeChild(P), P = q;
              }
          }
          if (T === 0) {
            o.removeChild(M), Xh(c);
            return;
          }
          T--;
        } else
          d === "$" || d === "$?" || d === "$!" ? T++ : v = d.charCodeAt(0) - 48;
      else v = 0;
      d = M;
    } while (d);
    Xh(c);
  }
  function Ag(o) {
    var c = o.firstChild;
    for (c && c.nodeType === 10 && (c = c.nextSibling); c; ) {
      var d = c;
      switch (c = c.nextSibling, d.nodeName) {
        case "HTML":
        case "HEAD":
        case "BODY":
          Ag(d), de(d);
          continue;
        case "SCRIPT":
        case "STYLE":
          continue;
        case "LINK":
          if (d.rel.toLowerCase() === "stylesheet") continue;
      }
      o.removeChild(d);
    }
  }
  function Op(o, c, d, v) {
    for (; o.nodeType === 1; ) {
      var T = d;
      if (o.nodeName.toLowerCase() !== c.toLowerCase()) {
        if (!v && (o.nodeName !== "INPUT" || o.type !== "hidden"))
          break;
      } else if (v) {
        if (!o[pd])
          switch (c) {
            case "meta":
              if (!o.hasAttribute("itemprop")) break;
              return o;
            case "link":
              if (M = o.getAttribute("rel"), M === "stylesheet" && o.hasAttribute("data-precedence"))
                break;
              if (M !== T.rel || o.getAttribute("href") !== (T.href == null || T.href === "" ? null : T.href) || o.getAttribute("crossorigin") !== (T.crossOrigin == null ? null : T.crossOrigin) || o.getAttribute("title") !== (T.title == null ? null : T.title))
                break;
              return o;
            case "style":
              if (o.hasAttribute("data-precedence")) break;
              return o;
            case "script":
              if (M = o.getAttribute("src"), (M !== (T.src == null ? null : T.src) || o.getAttribute("type") !== (T.type == null ? null : T.type) || o.getAttribute("crossorigin") !== (T.crossOrigin == null ? null : T.crossOrigin)) && M && o.hasAttribute("async") && !o.hasAttribute("itemprop"))
                break;
              return o;
            default:
              return o;
          }
      } else if (c === "input" && o.type === "hidden") {
        var M = T.name == null ? null : "" + T.name;
        if (T.type === "hidden" && o.getAttribute("name") === M)
          return o;
      } else return o;
      if (o = bo(o.nextSibling), o === null) break;
    }
    return null;
  }
  function eu(o, c, d) {
    if (c === "") return null;
    for (; o.nodeType !== 3; )
      if ((o.nodeType !== 1 || o.nodeName !== "INPUT" || o.type !== "hidden") && !d || (o = bo(o.nextSibling), o === null)) return null;
    return o;
  }
  function Mr(o) {
    return o.data === "$!" || o.data === "$?" && o.ownerDocument.readyState === "complete";
  }
  function sc(o, c) {
    var d = o.ownerDocument;
    if (o.data !== "$?" || d.readyState === "complete")
      c();
    else {
      var v = function() {
        c(), d.removeEventListener("DOMContentLoaded", v);
      };
      d.addEventListener("DOMContentLoaded", v), o._reactRetry = v;
    }
  }
  function bo(o) {
    for (; o != null; o = o.nextSibling) {
      var c = o.nodeType;
      if (c === 1 || c === 3) break;
      if (c === 8) {
        if (c = o.data, c === "$" || c === "$!" || c === "$?" || c === "F!" || c === "F")
          break;
        if (c === "/$") return null;
      }
    }
    return o;
  }
  var Iy = null;
  function pf(o) {
    o = o.previousSibling;
    for (var c = 0; o; ) {
      if (o.nodeType === 8) {
        var d = o.data;
        if (d === "$" || d === "$!" || d === "$?") {
          if (c === 0) return o;
          c--;
        } else d === "/$" && c++;
      }
      o = o.previousSibling;
    }
    return null;
  }
  function Wa(o, c, d) {
    switch (c = tu(d), o) {
      case "html":
        if (o = c.documentElement, !o) throw Error(a(452));
        return o;
      case "head":
        if (o = c.head, !o) throw Error(a(453));
        return o;
      case "body":
        if (o = c.body, !o) throw Error(a(454));
        return o;
      default:
        throw Error(a(451));
    }
  }
  function ie(o) {
    for (var c = o.attributes; c.length; )
      o.removeAttributeNode(c[0]);
    de(o);
  }
  var qi = /* @__PURE__ */ new Map(), da = /* @__PURE__ */ new Set();
  function _e(o) {
    return typeof o.getRootNode == "function" ? o.getRootNode() : o.nodeType === 9 ? o : o.ownerDocument;
  }
  var Zo = J.d;
  J.d = {
    f: Ys,
    r: Mg,
    D: Wo,
    C: Qo,
    L: yf,
    m: oc,
    X: es,
    S: fr,
    M: lc
  };
  function Ys() {
    var o = Zo.f(), c = yg();
    return o || c;
  }
  function Mg(o) {
    var c = qa(o);
    c !== null && c.tag === 5 && c.type === "form" ? ap(c) : Zo.r(o);
  }
  var nu = typeof document > "u" ? null : document;
  function Ze(o, c, d) {
    var v = nu;
    if (v && typeof c == "string" && c) {
      var T = Os(c);
      T = 'link[rel="' + o + '"][href="' + T + '"]', typeof d == "string" && (T += '[crossorigin="' + d + '"]'), da.has(T) || (da.add(T), o = { rel: o, crossOrigin: d, href: c }, v.querySelector(T) === null && (c = v.createElement("link"), Tt(c, "link", o), Qi(c), v.head.appendChild(c)));
    }
  }
  function Wo(o) {
    Zo.D(o), Ze("dns-prefetch", o, null);
  }
  function Qo(o, c) {
    Zo.C(o, c), Ze("preconnect", o, c);
  }
  function yf(o, c, d) {
    Zo.L(o, c, d);
    var v = nu;
    if (v && o && c) {
      var T = 'link[rel="preload"][as="' + Os(c) + '"]';
      c === "image" && d && d.imageSrcSet ? (T += '[imagesrcset="' + Os(
        d.imageSrcSet
      ) + '"]', typeof d.imageSizes == "string" && (T += '[imagesizes="' + Os(
        d.imageSizes
      ) + '"]')) : T += '[href="' + Os(o) + '"]';
      var M = T;
      switch (c) {
        case "style":
          M = Yh(o);
          break;
        case "script":
          M = _f(o);
      }
      qi.has(M) || (o = b(
        {
          rel: "preload",
          href: c === "image" && d && d.imageSrcSet ? void 0 : o,
          as: c
        },
        d
      ), qi.set(M, o), v.querySelector(T) !== null || c === "style" && v.querySelector(Cg(M)) || c === "script" && v.querySelector(So(M)) || (c = v.createElement("link"), Tt(c, "link", o), Qi(c), v.head.appendChild(c)));
    }
  }
  function oc(o, c) {
    Zo.m(o, c);
    var d = nu;
    if (d && o) {
      var v = c && typeof c.as == "string" ? c.as : "script", T = 'link[rel="modulepreload"][as="' + Os(v) + '"][href="' + Os(o) + '"]', M = T;
      switch (v) {
        case "audioworklet":
        case "paintworklet":
        case "serviceworker":
        case "sharedworker":
        case "worker":
        case "script":
          M = _f(o);
      }
      if (!qi.has(M) && (o = b({ rel: "modulepreload", href: o }, c), qi.set(M, o), d.querySelector(T) === null)) {
        switch (v) {
          case "audioworklet":
          case "paintworklet":
          case "serviceworker":
          case "sharedworker":
          case "worker":
          case "script":
            if (d.querySelector(So(M)))
              return;
        }
        v = d.createElement("link"), Tt(v, "link", o), Qi(v), d.head.appendChild(v);
      }
    }
  }
  function fr(o, c, d) {
    Zo.S(o, c, d);
    var v = nu;
    if (v && o) {
      var T = jf(v).hoistableStyles, M = Yh(o);
      c = c || "default";
      var P = T.get(M);
      if (!P) {
        var q = { loading: 0, preload: null };
        if (P = v.querySelector(
          Cg(M)
        ))
          q.loading = 5;
        else {
          o = b(
            { rel: "stylesheet", href: o, "data-precedence": c },
            d
          ), (d = qi.get(M)) && Dg(o, d);
          var it = P = v.createElement("link");
          Qi(it), Tt(it, "link", o), it._p = new Promise(function(vt, jt) {
            it.onload = vt, it.onerror = jt;
          }), it.addEventListener("load", function() {
            q.loading |= 1;
          }), it.addEventListener("error", function() {
            q.loading |= 2;
          }), q.loading |= 4, Lp(P, c, v);
        }
        P = {
          type: "stylesheet",
          instance: P,
          count: 1,
          state: q
        }, T.set(M, P);
      }
    }
  }
  function es(o, c) {
    Zo.X(o, c);
    var d = nu;
    if (d && o) {
      var v = jf(d).hoistableScripts, T = _f(o), M = v.get(T);
      M || (M = d.querySelector(So(T)), M || (o = b({ src: o, async: !0 }, c), (c = qi.get(T)) && Ip(o, c), M = d.createElement("script"), Qi(M), Tt(M, "link", o), d.head.appendChild(M)), M = {
        type: "script",
        instance: M,
        count: 1,
        state: null
      }, v.set(T, M));
    }
  }
  function lc(o, c) {
    Zo.M(o, c);
    var d = nu;
    if (d && o) {
      var v = jf(d).hoistableScripts, T = _f(o), M = v.get(T);
      M || (M = d.querySelector(So(T)), M || (o = b({ src: o, async: !0, type: "module" }, c), (c = qi.get(T)) && Ip(o, c), M = d.createElement("script"), Qi(M), Tt(M, "link", o), d.head.appendChild(M)), M = {
        type: "script",
        instance: M,
        count: 1,
        state: null
      }, v.set(T, M));
    }
  }
  function Dp(o, c, d, v) {
    var T = (T = It.current) ? _e(T) : null;
    if (!T) throw Error(a(446));
    switch (o) {
      case "meta":
      case "title":
        return null;
      case "style":
        return typeof d.precedence == "string" && typeof d.href == "string" ? (c = Yh(d.href), d = jf(
          T
        ).hoistableStyles, v = d.get(c), v || (v = {
          type: "style",
          instance: null,
          count: 0,
          state: null
        }, d.set(c, v)), v) : { type: "void", instance: null, count: 0, state: null };
      case "link":
        if (d.rel === "stylesheet" && typeof d.href == "string" && typeof d.precedence == "string") {
          o = Yh(d.href);
          var M = jf(
            T
          ).hoistableStyles, P = M.get(o);
          if (P || (T = T.ownerDocument || T, P = {
            type: "stylesheet",
            instance: null,
            count: 0,
            state: { loading: 0, preload: null }
          }, M.set(o, P), (M = T.querySelector(
            Cg(o)
          )) && !M._p && (P.instance = M, P.state.loading = 5), qi.has(o) || (d = {
            rel: "preload",
            as: "style",
            href: d.href,
            crossOrigin: d.crossOrigin,
            integrity: d.integrity,
            media: d.media,
            hrefLang: d.hrefLang,
            referrerPolicy: d.referrerPolicy
          }, qi.set(o, d), M || Og(
            T,
            o,
            d,
            P.state
          ))), c && v === null)
            throw Error(a(528, ""));
          return P;
        }
        if (c && v !== null)
          throw Error(a(529, ""));
        return null;
      case "script":
        return c = d.async, d = d.src, typeof d == "string" && c && typeof c != "function" && typeof c != "symbol" ? (c = _f(d), d = jf(
          T
        ).hoistableScripts, v = d.get(c), v || (v = {
          type: "script",
          instance: null,
          count: 0,
          state: null
        }, d.set(c, v)), v) : { type: "void", instance: null, count: 0, state: null };
      default:
        throw Error(a(444, o));
    }
  }
  function Yh(o) {
    return 'href="' + Os(o) + '"';
  }
  function Cg(o) {
    return 'link[rel="stylesheet"][' + o + "]";
  }
  function Py(o) {
    return b({}, o, {
      "data-precedence": o.precedence,
      precedence: null
    });
  }
  function Og(o, c, d, v) {
    o.querySelector('link[rel="preload"][as="style"][' + c + "]") ? v.loading = 1 : (c = o.createElement("link"), v.preload = c, c.addEventListener("load", function() {
      return v.loading |= 1;
    }), c.addEventListener("error", function() {
      return v.loading |= 2;
    }), Tt(c, "link", d), Qi(c), o.head.appendChild(c));
  }
  function _f(o) {
    return '[src="' + Os(o) + '"]';
  }
  function So(o) {
    return "script[async]" + o;
  }
  function Np(o, c, d) {
    if (c.count++, c.instance === null)
      switch (c.type) {
        case "style":
          var v = o.querySelector(
            'style[data-href~="' + Os(d.href) + '"]'
          );
          if (v)
            return c.instance = v, Qi(v), v;
          var T = b({}, d, {
            "data-href": d.href,
            "data-precedence": d.precedence,
            href: null,
            precedence: null
          });
          return v = (o.ownerDocument || o).createElement(
            "style"
          ), Qi(v), Tt(v, "style", T), Lp(v, d.precedence, o), c.instance = v;
        case "stylesheet":
          T = Yh(d.href);
          var M = o.querySelector(
            Cg(T)
          );
          if (M)
            return c.state.loading |= 4, c.instance = M, Qi(M), M;
          v = Py(d), (T = qi.get(T)) && Dg(v, T), M = (o.ownerDocument || o).createElement("link"), Qi(M);
          var P = M;
          return P._p = new Promise(function(q, it) {
            P.onload = q, P.onerror = it;
          }), Tt(M, "link", v), c.state.loading |= 4, Lp(M, d.precedence, o), c.instance = M;
        case "script":
          return M = _f(d.src), (T = o.querySelector(
            So(M)
          )) ? (c.instance = T, Qi(T), T) : (v = d, (T = qi.get(M)) && (v = b({}, d), Ip(v, T)), o = o.ownerDocument || o, T = o.createElement("script"), Qi(T), Tt(T, "link", v), o.head.appendChild(T), c.instance = T);
        case "void":
          return null;
        default:
          throw Error(a(443, c.type));
      }
    else
      c.type === "stylesheet" && (c.state.loading & 4) === 0 && (v = c.instance, c.state.loading |= 4, Lp(v, d.precedence, o));
    return c.instance;
  }
  function Lp(o, c, d) {
    for (var v = d.querySelectorAll(
      'link[rel="stylesheet"][data-precedence],style[data-precedence]'
    ), T = v.length ? v[v.length - 1] : null, M = T, P = 0; P < v.length; P++) {
      var q = v[P];
      if (q.dataset.precedence === c) M = q;
      else if (M !== T) break;
    }
    M ? M.parentNode.insertBefore(o, M.nextSibling) : (c = d.nodeType === 9 ? d.head : d, c.insertBefore(o, c.firstChild));
  }
  function Dg(o, c) {
    o.crossOrigin == null && (o.crossOrigin = c.crossOrigin), o.referrerPolicy == null && (o.referrerPolicy = c.referrerPolicy), o.title == null && (o.title = c.title);
  }
  function Ip(o, c) {
    o.crossOrigin == null && (o.crossOrigin = c.crossOrigin), o.referrerPolicy == null && (o.referrerPolicy = c.referrerPolicy), o.integrity == null && (o.integrity = c.integrity);
  }
  var vf = null;
  function Fh(o, c, d) {
    if (vf === null) {
      var v = /* @__PURE__ */ new Map(), T = vf = /* @__PURE__ */ new Map();
      T.set(d, v);
    } else
      T = vf, v = T.get(d), v || (v = /* @__PURE__ */ new Map(), T.set(d, v));
    if (v.has(o)) return v;
    for (v.set(o, null), d = d.getElementsByTagName(o), T = 0; T < d.length; T++) {
      var M = d[T];
      if (!(M[pd] || M[un] || o === "link" && M.getAttribute("rel") === "stylesheet") && M.namespaceURI !== "http://www.w3.org/2000/svg") {
        var P = M.getAttribute(c) || "";
        P = o + P;
        var q = v.get(P);
        q ? q.push(M) : v.set(P, [M]);
      }
    }
    return v;
  }
  function zy(o, c, d) {
    o = o.ownerDocument || o, o.head.insertBefore(
      d,
      c === "title" ? o.querySelector("head > title") : null
    );
  }
  function Pv(o, c, d) {
    if (d === 1 || c.itemProp != null) return !1;
    switch (o) {
      case "meta":
      case "title":
        return !0;
      case "style":
        if (typeof c.precedence != "string" || typeof c.href != "string" || c.href === "")
          break;
        return !0;
      case "link":
        if (typeof c.rel != "string" || typeof c.href != "string" || c.href === "" || c.onLoad || c.onError)
          break;
        switch (c.rel) {
          case "stylesheet":
            return o = c.disabled, typeof c.precedence == "string" && o == null;
          default:
            return !0;
        }
      case "script":
        if (c.async && typeof c.async != "function" && typeof c.async != "symbol" && !c.onLoad && !c.onError && c.src && typeof c.src == "string")
          return !0;
    }
    return !1;
  }
  function ga(o) {
    return !(o.type === "stylesheet" && (o.state.loading & 3) === 0);
  }
  var xa = null;
  function zv() {
  }
  function Gv(o, c, d) {
    if (xa === null) throw Error(a(475));
    var v = xa;
    if (c.type === "stylesheet" && (typeof d.media != "string" || matchMedia(d.media).matches !== !1) && (c.state.loading & 4) === 0) {
      if (c.instance === null) {
        var T = Yh(d.href), M = o.querySelector(
          Cg(T)
        );
        if (M) {
          o = M._p, o !== null && typeof o == "object" && typeof o.then == "function" && (v.count++, v = Ef.bind(v), o.then(v, v)), c.state.loading |= 4, c.instance = M, Qi(M);
          return;
        }
        M = o.ownerDocument || o, d = Py(d), (T = qi.get(T)) && Dg(d, T), M = M.createElement("link"), Qi(M);
        var P = M;
        P._p = new Promise(function(q, it) {
          P.onload = q, P.onerror = it;
        }), Tt(M, "link", d), c.instance = M;
      }
      v.stylesheets === null && (v.stylesheets = /* @__PURE__ */ new Map()), v.stylesheets.set(c, o), (o = c.state.preload) && (c.state.loading & 3) === 0 && (v.count++, c = Ef.bind(v), o.addEventListener("load", c), o.addEventListener("error", c));
    }
  }
  function Uv() {
    if (xa === null) throw Error(a(475));
    var o = xa;
    return o.stylesheets && o.count === 0 && Lg(o, o.stylesheets), 0 < o.count ? function(c) {
      var d = setTimeout(function() {
        if (o.stylesheets && Lg(o, o.stylesheets), o.unsuspend) {
          var v = o.unsuspend;
          o.unsuspend = null, v();
        }
      }, 6e4);
      return o.unsuspend = c, function() {
        o.unsuspend = null, clearTimeout(d);
      };
    } : null;
  }
  function Ef() {
    if (this.count--, this.count === 0) {
      if (this.stylesheets) Lg(this, this.stylesheets);
      else if (this.unsuspend) {
        var o = this.unsuspend;
        this.unsuspend = null, o();
      }
    }
  }
  var Ng = null;
  function Lg(o, c) {
    o.stylesheets = null, o.unsuspend !== null && (o.count++, Ng = /* @__PURE__ */ new Map(), c.forEach(Gy, o), Ng = null, Ef.call(o));
  }
  function Gy(o, c) {
    if (!(c.state.loading & 4)) {
      var d = Ng.get(o);
      if (d) var v = d.get(null);
      else {
        d = /* @__PURE__ */ new Map(), Ng.set(o, d);
        for (var T = o.querySelectorAll(
          "link[data-precedence],style[data-precedence]"
        ), M = 0; M < T.length; M++) {
          var P = T[M];
          (P.nodeName === "LINK" || P.getAttribute("media") !== "not all") && (d.set(P.dataset.precedence, P), v = P);
        }
        v && d.set(null, v);
      }
      T = c.instance, P = T.getAttribute("data-precedence"), M = d.get(P) || v, M === v && d.set(null, T), d.set(P, T), this.count++, v = Ef.bind(this), T.addEventListener("load", v), T.addEventListener("error", v), M ? M.parentNode.insertBefore(T, M.nextSibling) : (o = o.nodeType === 9 ? o.head : o, o.insertBefore(T, o.firstChild)), c.state.loading |= 4;
    }
  }
  var La = {
    $$typeof: H,
    Provider: null,
    Consumer: null,
    _currentValue: gt,
    _currentValue2: gt,
    _threadCount: 0
  };
  function Jo(o, c, d, v, T, M, P, q) {
    this.tag = 1, this.containerInfo = o, 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 = Jt(-1), this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = Jt(0), this.hiddenUpdates = Jt(null), this.identifierPrefix = v, this.onUncaughtError = T, this.onCaughtError = M, this.onRecoverableError = P, this.pooledCache = null, this.pooledCacheLanes = 0, this.formState = q, this.incompleteTransitions = /* @__PURE__ */ new Map();
  }
  function jv(o, c, d, v, T, M, P, q, it, vt, jt, Bt) {
    return o = new Jo(
      o,
      c,
      d,
      P,
      q,
      it,
      vt,
      Bt
    ), c = 1, M === !0 && (c |= 24), M = Er(3, null, null, c), o.current = M, M.stateNode = o, c = W0(), c.refCount++, o.pooledCache = c, c.refCount++, M.memoizedState = {
      element: v,
      isDehydrated: d,
      cache: c
    }, Ll(M), o;
  }
  function Uy(o) {
    return o ? (o = wu, o) : wu;
  }
  function Pp(o, c, d, v, T, M) {
    T = Uy(T), v.context === null ? v.context = T : v.pendingContext = T, v = Il(c), v.payload = { element: d }, M = M === void 0 ? null : M, M !== null && (v.callback = M), d = xr(o, v, c), d !== null && (ts(d, o, c), Kc(d, o, c));
  }
  function zp(o, c) {
    if (o = o.memoizedState, o !== null && o.dehydrated !== null) {
      var d = o.retryLane;
      o.retryLane = d !== 0 && d < c ? d : c;
    }
  }
  function Gp(o, c) {
    zp(o, c), (o = o.alternate) && zp(o, c);
  }
  function jy(o) {
    if (o.tag === 13) {
      var c = Go(o, 67108864);
      c !== null && ts(c, o, 67108864), Gp(o, 67108864);
    }
  }
  var Ig = !0;
  function kv(o, c, d, v) {
    var T = nt.T;
    nt.T = null;
    var M = J.p;
    try {
      J.p = 2, Up(o, c, d, v);
    } finally {
      J.p = M, nt.T = T;
    }
  }
  function bf(o, c, d, v) {
    var T = nt.T;
    nt.T = null;
    var M = J.p;
    try {
      J.p = 8, Up(o, c, d, v);
    } finally {
      J.p = M, nt.T = T;
    }
  }
  function Up(o, c, d, v) {
    if (Ig) {
      var T = ky(v);
      if (T === null)
        vo(
          o,
          c,
          v,
          Pg,
          d
        ), By(o, v);
      else if (qy(
        T,
        o,
        c,
        d,
        v
      ))
        v.stopPropagation();
      else if (By(o, v), c & 4 && -1 < DE.indexOf(o)) {
        for (; T !== null; ) {
          var M = qa(T);
          if (M !== null)
            switch (M.tag) {
              case 3:
                if (M = M.stateNode, M.current.memoizedState.isDehydrated) {
                  var P = Ui(M.pendingLanes);
                  if (P !== 0) {
                    var q = M;
                    for (q.pendingLanes |= 2, q.entangledLanes |= 2; P; ) {
                      var it = 1 << 31 - Gi(P);
                      q.entanglements[1] |= it, P &= ~it;
                    }
                    _o(M), (qn & 6) === 0 && (Ih = Ge() + 500, Ql(0));
                  }
                }
                break;
              case 13:
                q = Go(M, 2), q !== null && ts(q, M, 2), yg(), Gp(M, 2);
            }
          if (M = ky(v), M === null && vo(
            o,
            c,
            v,
            Pg,
            d
          ), M === T) break;
          T = M;
        }
        T !== null && v.stopPropagation();
      } else
        vo(
          o,
          c,
          v,
          null,
          d
        );
    }
  }
  function ky(o) {
    return o = jc(o), Hy(o);
  }
  var Pg = null;
  function Hy(o) {
    if (Pg = null, o = mu(o), o !== null) {
      var c = l(o);
      if (c === null) o = null;
      else {
        var d = c.tag;
        if (d === 13) {
          if (o = f(c), o !== null) return o;
          o = null;
        } else if (d === 3) {
          if (c.stateNode.current.memoizedState.isDehydrated)
            return c.tag === 3 ? c.stateNode.containerInfo : null;
          o = null;
        } else c !== o && (o = null);
      }
    }
    return Pg = o, null;
  }
  function Hv(o) {
    switch (o) {
      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 (pa()) {
          case ka:
            return 2;
          case Ai:
            return 8;
          case fe:
          case Zi:
            return 32;
          case Dn:
            return 268435456;
          default:
            return 32;
        }
      default:
        return 32;
    }
  }
  var zg = !1, Fs = null, tl = null, iu = null, $h = /* @__PURE__ */ new Map(), Gg = /* @__PURE__ */ new Map(), uc = [], DE = "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 By(o, c) {
    switch (o) {
      case "focusin":
      case "focusout":
        Fs = null;
        break;
      case "dragenter":
      case "dragleave":
        tl = null;
        break;
      case "mouseover":
      case "mouseout":
        iu = null;
        break;
      case "pointerover":
      case "pointerout":
        $h.delete(c.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        Gg.delete(c.pointerId);
    }
  }
  function el(o, c, d, v, T, M) {
    return o === null || o.nativeEvent !== M ? (o = {
      blockedOn: c,
      domEventName: d,
      eventSystemFlags: v,
      nativeEvent: M,
      targetContainers: [T]
    }, c !== null && (c = qa(c), c !== null && jy(c)), o) : (o.eventSystemFlags |= v, c = o.targetContainers, T !== null && c.indexOf(T) === -1 && c.push(T), o);
  }
  function qy(o, c, d, v, T) {
    switch (c) {
      case "focusin":
        return Fs = el(
          Fs,
          o,
          c,
          d,
          v,
          T
        ), !0;
      case "dragenter":
        return tl = el(
          tl,
          o,
          c,
          d,
          v,
          T
        ), !0;
      case "mouseover":
        return iu = el(
          iu,
          o,
          c,
          d,
          v,
          T
        ), !0;
      case "pointerover":
        var M = T.pointerId;
        return $h.set(
          M,
          el(
            $h.get(M) || null,
            o,
            c,
            d,
            v,
            T
          )
        ), !0;
      case "gotpointercapture":
        return M = T.pointerId, Gg.set(
          M,
          el(
            Gg.get(M) || null,
            o,
            c,
            d,
            v,
            T
          )
        ), !0;
    }
    return !1;
  }
  function Vy(o) {
    var c = mu(o.target);
    if (c !== null) {
      var d = l(c);
      if (d !== null) {
        if (c = d.tag, c === 13) {
          if (c = f(d), c !== null) {
            o.blockedOn = c, ar(o.priority, function() {
              if (d.tag === 13) {
                var v = cr();
                v = Ae(v);
                var T = Go(d, v);
                T !== null && ts(T, d, v), Gp(d, v);
              }
            });
            return;
          }
        } else if (c === 3 && d.stateNode.current.memoizedState.isDehydrated) {
          o.blockedOn = d.tag === 3 ? d.stateNode.containerInfo : null;
          return;
        }
      }
    }
    o.blockedOn = null;
  }
  function Ug(o) {
    if (o.blockedOn !== null) return !1;
    for (var c = o.targetContainers; 0 < c.length; ) {
      var d = ky(o.nativeEvent);
      if (d === null) {
        d = o.nativeEvent;
        var v = new d.constructor(
          d.type,
          d
        );
        Sd = v, d.target.dispatchEvent(v), Sd = null;
      } else
        return c = qa(d), c !== null && jy(c), o.blockedOn = d, !1;
      c.shift();
    }
    return !0;
  }
  function Yy(o, c, d) {
    Ug(o) && d.delete(c);
  }
  function jp() {
    zg = !1, Fs !== null && Ug(Fs) && (Fs = null), tl !== null && Ug(tl) && (tl = null), iu !== null && Ug(iu) && (iu = null), $h.forEach(Yy), Gg.forEach(Yy);
  }
  function au(o, c) {
    o.blockedOn === c && (o.blockedOn = null, zg || (zg = !0, n.unstable_scheduleCallback(
      n.unstable_NormalPriority,
      jp
    )));
  }
  var kp = null;
  function jg(o) {
    kp !== o && (kp = o, n.unstable_scheduleCallback(
      n.unstable_NormalPriority,
      function() {
        kp === o && (kp = null);
        for (var c = 0; c < o.length; c += 3) {
          var d = o[c], v = o[c + 1], T = o[c + 2];
          if (typeof v != "function") {
            if (Hy(v || d) === null)
              continue;
            break;
          }
          var M = qa(d);
          M !== null && (o.splice(c, 3), c -= 3, Zd(
            M,
            {
              pending: !0,
              data: T,
              method: d.method,
              action: v
            },
            v,
            T
          ));
        }
      }
    ));
  }
  function Xh(o) {
    function c(it) {
      return au(it, o);
    }
    Fs !== null && au(Fs, o), tl !== null && au(tl, o), iu !== null && au(iu, o), $h.forEach(c), Gg.forEach(c);
    for (var d = 0; d < uc.length; d++) {
      var v = uc[d];
      v.blockedOn === o && (v.blockedOn = null);
    }
    for (; 0 < uc.length && (d = uc[0], d.blockedOn === null); )
      Vy(d), d.blockedOn === null && uc.shift();
    if (d = (o.ownerDocument || o).$$reactFormReplay, d != null)
      for (v = 0; v < d.length; v += 3) {
        var T = d[v], M = d[v + 1], P = T[cn] || null;
        if (typeof M == "function")
          P || jg(d);
        else if (P) {
          var q = null;
          if (M && M.hasAttribute("formAction")) {
            if (T = M, P = M[cn] || null)
              q = P.formAction;
            else if (Hy(T) !== null) continue;
          } else q = P.action;
          typeof q == "function" ? d[v + 1] = q : (d.splice(v, 3), v -= 3), jg(d);
        }
      }
  }
  function cc(o) {
    this._internalRoot = o;
  }
  Hp.prototype.render = cc.prototype.render = function(o) {
    var c = this._internalRoot;
    if (c === null) throw Error(a(409));
    var d = c.current, v = cr();
    Pp(d, v, o, c, null, null);
  }, Hp.prototype.unmount = cc.prototype.unmount = function() {
    var o = this._internalRoot;
    if (o !== null) {
      this._internalRoot = null;
      var c = o.containerInfo;
      Pp(o.current, 2, null, o, null, null), yg(), c[Si] = null;
    }
  };
  function Hp(o) {
    this._internalRoot = o;
  }
  Hp.prototype.unstable_scheduleHydration = function(o) {
    if (o) {
      var c = Wi();
      o = { blockedOn: null, target: o, priority: c };
      for (var d = 0; d < uc.length && c !== 0 && c < uc[d].priority; d++) ;
      uc.splice(d, 0, o), d === 0 && Vy(o);
    }
  };
  var Bv = t.version;
  if (Bv !== "19.1.1")
    throw Error(
      a(
        527,
        Bv,
        "19.1.1"
      )
    );
  J.findDOMNode = function(o) {
    var c = o._reactInternals;
    if (c === void 0)
      throw typeof o.render == "function" ? Error(a(188)) : (o = Object.keys(o).join(","), Error(a(268, o)));
    return o = p(c), o = o !== null ? y(o) : null, o = o === null ? null : o.stateNode, o;
  };
  var qv = {
    bundleType: 0,
    version: "19.1.1",
    rendererPackageName: "react-dom",
    currentDispatcherRef: nt,
    reconcilerVersion: "19.1.1"
  };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var Ia = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!Ia.isDisabled && Ia.supportsFiber)
      try {
        Ha = Ia.inject(
          qv
        ), ti = Ia;
      } catch {
      }
  }
  return pb.createRoot = function(o, c) {
    if (!s(o)) throw Error(a(299));
    var d = !1, v = "", T = op, M = Hu, P = fy, q = null;
    return c != null && (c.unstable_strictMode === !0 && (d = !0), c.identifierPrefix !== void 0 && (v = c.identifierPrefix), c.onUncaughtError !== void 0 && (T = c.onUncaughtError), c.onCaughtError !== void 0 && (M = c.onCaughtError), c.onRecoverableError !== void 0 && (P = c.onRecoverableError), c.unstable_transitionCallbacks !== void 0 && (q = c.unstable_transitionCallbacks)), c = jv(
      o,
      1,
      !1,
      null,
      null,
      d,
      v,
      T,
      M,
      P,
      q,
      null
    ), o[Si] = c.current, wg(o), new cc(c);
  }, pb.hydrateRoot = function(o, c, d) {
    if (!s(o)) throw Error(a(299));
    var v = !1, T = "", M = op, P = Hu, q = fy, it = null, vt = null;
    return d != null && (d.unstable_strictMode === !0 && (v = !0), d.identifierPrefix !== void 0 && (T = d.identifierPrefix), d.onUncaughtError !== void 0 && (M = d.onUncaughtError), d.onCaughtError !== void 0 && (P = d.onCaughtError), d.onRecoverableError !== void 0 && (q = d.onRecoverableError), d.unstable_transitionCallbacks !== void 0 && (it = d.unstable_transitionCallbacks), d.formState !== void 0 && (vt = d.formState)), c = jv(
      o,
      1,
      !0,
      c,
      d ?? null,
      v,
      T,
      M,
      P,
      q,
      it,
      vt
    ), c.context = Uy(null), d = c.current, v = cr(), v = Ae(v), T = Il(v), T.callback = null, xr(d, T, v), d = v, c.current.lanes = d, oe(c, d), _o(c), o[Si] = c.current, wg(o), new Hp(c);
  }, pb.version = "19.1.1", pb;
}
var yb = {}, OD;
function Kj() {
  if (OD) return yb;
  OD = 1;
  var n = {};
  /**
   * @license React
   * react-dom-client.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return n.NODE_ENV !== "production" && function() {
    function t(i, r) {
      for (i = i.memoizedState; i !== null && 0 < r; )
        i = i.next, r--;
      return i;
    }
    function e(i, r, u, m) {
      if (u >= r.length) return m;
      var E = r[u], S = Sa(i) ? i.slice() : He({}, i);
      return S[E] = e(i[E], r, u + 1, m), S;
    }
    function a(i, r, u) {
      if (r.length !== u.length)
        console.warn("copyWithRename() expects paths of the same length");
      else {
        for (var m = 0; m < u.length - 1; m++)
          if (r[m] !== u[m]) {
            console.warn(
              "copyWithRename() expects paths to be the same except for the deepest key"
            );
            return;
          }
        return s(i, r, u, 0);
      }
    }
    function s(i, r, u, m) {
      var E = r[m], S = Sa(i) ? i.slice() : He({}, i);
      return m + 1 === r.length ? (S[u[m]] = S[E], Sa(S) ? S.splice(E, 1) : delete S[E]) : S[E] = s(
        i[E],
        r,
        u,
        m + 1
      ), S;
    }
    function l(i, r, u) {
      var m = r[u], E = Sa(i) ? i.slice() : He({}, i);
      return u + 1 === r.length ? (Sa(E) ? E.splice(m, 1) : delete E[m], E) : (E[m] = l(i[m], r, u + 1), E);
    }
    function f() {
      return !1;
    }
    function h() {
      return null;
    }
    function p() {
    }
    function y() {
      console.error(
        "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks"
      );
    }
    function b() {
      console.error(
        "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
      );
    }
    function x() {
    }
    function w(i) {
      var r = [];
      return i.forEach(function(u) {
        r.push(u);
      }), r.sort().join(", ");
    }
    function A(i, r, u, m) {
      return new uv(i, r, u, m);
    }
    function C(i, r) {
      i.context === Bp && (bg(i.current, 2, r, i, null, null), Yo());
    }
    function L(i, r) {
      if (hc !== null) {
        var u = r.staleFamilies;
        r = r.updatedFamilies, Vu(), vu(
          i.current,
          r,
          u
        ), Yo();
      }
    }
    function N(i) {
      hc = i;
    }
    function U(i) {
      return !(!i || i.nodeType !== 1 && i.nodeType !== 9 && i.nodeType !== 11);
    }
    function k(i) {
      var r = i, u = i;
      if (i.alternate) for (; r.return; ) r = r.return;
      else {
        i = r;
        do
          r = i, (r.flags & 4098) !== 0 && (u = r.return), i = r.return;
        while (i);
      }
      return r.tag === 3 ? u : null;
    }
    function H(i) {
      if (i.tag === 13) {
        var r = i.memoizedState;
        if (r === null && (i = i.alternate, i !== null && (r = i.memoizedState)), r !== null) return r.dehydrated;
      }
      return null;
    }
    function B(i) {
      if (k(i) !== i)
        throw Error("Unable to find node on an unmounted component.");
    }
    function z(i) {
      var r = i.alternate;
      if (!r) {
        if (r = k(i), r === null)
          throw Error("Unable to find node on an unmounted component.");
        return r !== i ? null : i;
      }
      for (var u = i, m = r; ; ) {
        var E = u.return;
        if (E === null) break;
        var S = E.alternate;
        if (S === null) {
          if (m = E.return, m !== null) {
            u = m;
            continue;
          }
          break;
        }
        if (E.child === S.child) {
          for (S = E.child; S; ) {
            if (S === u) return B(E), i;
            if (S === m) return B(E), r;
            S = S.sibling;
          }
          throw Error("Unable to find node on an unmounted component.");
        }
        if (u.return !== m.return) u = E, m = S;
        else {
          for (var O = !1, I = E.child; I; ) {
            if (I === u) {
              O = !0, u = E, m = S;
              break;
            }
            if (I === m) {
              O = !0, m = E, u = S;
              break;
            }
            I = I.sibling;
          }
          if (!O) {
            for (I = S.child; I; ) {
              if (I === u) {
                O = !0, u = S, m = E;
                break;
              }
              if (I === m) {
                O = !0, m = S, u = E;
                break;
              }
              I = I.sibling;
            }
            if (!O)
              throw Error(
                "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
              );
          }
        }
        if (u.alternate !== m)
          throw Error(
            "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
          );
      }
      if (u.tag !== 3)
        throw Error("Unable to find node on an unmounted component.");
      return u.stateNode.current === u ? i : r;
    }
    function Q(i) {
      var r = i.tag;
      if (r === 5 || r === 26 || r === 27 || r === 6) return i;
      for (i = i.child; i !== null; ) {
        if (r = Q(i), r !== null) return r;
        i = i.sibling;
      }
      return null;
    }
    function et(i) {
      return i === null || typeof i != "object" ? null : (i = Rg && i[Rg] || i["@@iterator"], typeof i == "function" ? i : null);
    }
    function ot(i) {
      if (i == null) return null;
      if (typeof i == "function")
        return i.$$typeof === ri ? null : i.displayName || i.name || null;
      if (typeof i == "string") return i;
      switch (i) {
        case ic:
          return "Fragment";
        case wg:
          return "Profiler";
        case Za:
          return "StrictMode";
        case ia:
          return "Suspense";
        case Ci:
          return "SuspenseList";
        case Ap:
          return "Activity";
      }
      if (typeof i == "object")
        switch (typeof i.tag == "number" && console.error(
          "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
        ), i.$$typeof) {
          case Ke:
            return "Portal";
          case be:
            return (i.displayName || "Context") + ".Provider";
          case vo:
            return (i._context.displayName || "Context") + ".Consumer";
          case ac:
            var r = i.render;
            return i = i.displayName, i || (i = r.displayName || r.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
          case Rp:
            return r = i.displayName || null, r !== null ? r : ot(i.type) || "Memo";
          case ha:
            r = i._payload, i = i._init;
            try {
              return ot(i(r));
            } catch {
            }
        }
      return null;
    }
    function pt(i) {
      return typeof i.tag == "number" ? ht(i) : typeof i.name == "string" ? i.name : null;
    }
    function ht(i) {
      var r = i.type;
      switch (i.tag) {
        case 31:
          return "Activity";
        case 24:
          return "Cache";
        case 9:
          return (r._context.displayName || "Context") + ".Consumer";
        case 10:
          return (r.displayName || "Context") + ".Provider";
        case 18:
          return "DehydratedFragment";
        case 11:
          return i = r.render, i = i.displayName || i.name || "", r.displayName || (i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef");
        case 7:
          return "Fragment";
        case 26:
        case 27:
        case 5:
          return r;
        case 4:
          return "Portal";
        case 3:
          return "Root";
        case 6:
          return "Text";
        case 16:
          return ot(r);
        case 8:
          return r === Za ? "StrictMode" : "Mode";
        case 22:
          return "Offscreen";
        case 12:
          return "Profiler";
        case 21:
          return "Scope";
        case 13:
          return "Suspense";
        case 19:
          return "SuspenseList";
        case 25:
          return "TracingMarker";
        case 1:
        case 0:
        case 14:
        case 15:
          if (typeof r == "function")
            return r.displayName || r.name || null;
          if (typeof r == "string") return r;
          break;
        case 29:
          if (r = i._debugInfo, r != null) {
            for (var u = r.length - 1; 0 <= u; u--)
              if (typeof r[u].name == "string") return r[u].name;
          }
          if (i.return !== null)
            return ht(i.return);
      }
      return null;
    }
    function Ct(i) {
      return { current: i };
    }
    function mt(i, r) {
      0 > Pn ? console.error("Unexpected pop.") : (r !== tu[Pn] && console.error("Unexpected Fiber popped."), i.current = Vh[Pn], Vh[Pn] = null, tu[Pn] = null, Pn--);
    }
    function St(i, r, u) {
      Pn++, Vh[Pn] = i.current, tu[Pn] = u, i.current = r;
    }
    function Ut(i) {
      return i === null && console.error(
        "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
      ), i;
    }
    function Ft(i, r) {
      St(Xo, r, i), St(rc, i, i), St(Vn, null, i);
      var u = r.nodeType;
      switch (u) {
        case 9:
        case 11:
          u = u === 9 ? "#document" : "#fragment", r = (r = r.documentElement) && (r = r.namespaceURI) ? Qr(r) : Kg;
          break;
        default:
          if (u = r.tagName, r = r.namespaceURI)
            r = Qr(r), r = Xl(
              r,
              u
            );
          else
            switch (u) {
              case "svg":
                r = g1;
                break;
              case "math":
                r = Rx;
                break;
              default:
                r = Kg;
            }
      }
      u = u.toLowerCase(), u = Ed(null, u), u = {
        context: r,
        ancestorInfo: u
      }, mt(Vn, i), St(Vn, u, i);
    }
    function nt(i) {
      mt(Vn, i), mt(rc, i), mt(Xo, i);
    }
    function J() {
      return Ut(Vn.current);
    }
    function gt(i) {
      i.memoizedState !== null && St(Mp, i, i);
      var r = Ut(Vn.current), u = i.type, m = Xl(r.context, u);
      u = Ed(r.ancestorInfo, u), m = { context: m, ancestorInfo: u }, r !== m && (St(rc, i, i), St(Vn, m, i));
    }
    function Ot(i) {
      rc.current === i && (mt(Vn, i), mt(rc, i)), Mp.current === i && (mt(Mp, i), ub._currentValue = u_);
    }
    function W(i) {
      return typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
    }
    function j(i) {
      try {
        return X(i), !1;
      } catch {
        return !0;
      }
    }
    function X(i) {
      return "" + i;
    }
    function st(i, r) {
      if (j(i))
        return console.error(
          "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",
          r,
          W(i)
        ), X(i);
    }
    function At(i, r) {
      if (j(i))
        return console.error(
          "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",
          r,
          W(i)
        ), X(i);
    }
    function Dt(i) {
      if (j(i))
        return console.error(
          "Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",
          W(i)
        ), X(i);
    }
    function It(i) {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u") return !1;
      var r = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (r.isDisabled) return !0;
      if (!r.supportsFiber)
        return console.error(
          "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"
        ), !0;
      try {
        pf = r.inject(i), Wa = r;
      } catch (u) {
        console.error("React instrumentation encountered an error: %s.", u);
      }
      return !!r.checkDCE;
    }
    function $t(i) {
      if (typeof bo == "function" && Iy(i), Wa && typeof Wa.setStrictMode == "function")
        try {
          Wa.setStrictMode(pf, i);
        } catch (r) {
          qi || (qi = !0, console.error(
            "React instrumentation encountered an error: %s",
            r
          ));
        }
    }
    function Qt(i) {
      ie = i;
    }
    function ee() {
      ie !== null && typeof ie.markCommitStopped == "function" && ie.markCommitStopped();
    }
    function ce(i) {
      ie !== null && typeof ie.markComponentRenderStarted == "function" && ie.markComponentRenderStarted(i);
    }
    function pe() {
      ie !== null && typeof ie.markComponentRenderStopped == "function" && ie.markComponentRenderStopped();
    }
    function Mn(i) {
      ie !== null && typeof ie.markRenderStarted == "function" && ie.markRenderStarted(i);
    }
    function te() {
      ie !== null && typeof ie.markRenderStopped == "function" && ie.markRenderStopped();
    }
    function tn(i, r) {
      ie !== null && typeof ie.markStateUpdateScheduled == "function" && ie.markStateUpdateScheduled(i, r);
    }
    function Jn(i) {
      return i >>>= 0, i === 0 ? 32 : 31 - (Zo(i) / Ys | 0) | 0;
    }
    function Pi(i) {
      if (i & 1) return "SyncHydrationLane";
      if (i & 2) return "Sync";
      if (i & 4) return "InputContinuousHydration";
      if (i & 8) return "InputContinuous";
      if (i & 16) return "DefaultHydration";
      if (i & 32) return "Default";
      if (i & 128) return "TransitionHydration";
      if (i & 4194048) return "Transition";
      if (i & 62914560) return "Retry";
      if (i & 67108864) return "SelectiveHydration";
      if (i & 134217728) return "IdleHydration";
      if (i & 268435456) return "Idle";
      if (i & 536870912) return "Offscreen";
      if (i & 1073741824) return "Deferred";
    }
    function Ge(i) {
      var r = i & 42;
      if (r !== 0) return r;
      switch (i & -i) {
        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:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
          return i & 4194048;
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
          return i & 62914560;
        case 67108864:
          return 67108864;
        case 134217728:
          return 134217728;
        case 268435456:
          return 268435456;
        case 536870912:
          return 536870912;
        case 1073741824:
          return 0;
        default:
          return console.error(
            "Should have found matching lanes. This is a bug in React."
          ), i;
      }
    }
    function pa(i, r, u) {
      var m = i.pendingLanes;
      if (m === 0) return 0;
      var E = 0, S = i.suspendedLanes, O = i.pingedLanes;
      i = i.warmLanes;
      var I = m & 134217727;
      return I !== 0 ? (m = I & ~S, m !== 0 ? E = Ge(m) : (O &= I, O !== 0 ? E = Ge(O) : u || (u = I & ~i, u !== 0 && (E = Ge(u))))) : (I = m & ~S, I !== 0 ? E = Ge(I) : O !== 0 ? E = Ge(O) : u || (u = m & ~i, u !== 0 && (E = Ge(u)))), E === 0 ? 0 : r !== 0 && r !== E && (r & S) === 0 && (S = E & -E, u = r & -r, S >= u || S === 32 && (u & 4194048) !== 0) ? r : E;
    }
    function ka(i, r) {
      return (i.pendingLanes & ~(i.suspendedLanes & ~i.pingedLanes) & r) === 0;
    }
    function Ai(i, r) {
      switch (i) {
        case 1:
        case 2:
        case 4:
        case 8:
        case 64:
          return r + 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 r + 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 console.error(
            "Should have found matching lanes. This is a bug in React."
          ), -1;
      }
    }
    function fe() {
      var i = Mg;
      return Mg <<= 1, (Mg & 4194048) === 0 && (Mg = 256), i;
    }
    function Zi() {
      var i = nu;
      return nu <<= 1, (nu & 62914560) === 0 && (nu = 4194304), i;
    }
    function Dn(i) {
      for (var r = [], u = 0; 31 > u; u++) r.push(i);
      return r;
    }
    function nr(i, r) {
      i.pendingLanes |= r, r !== 268435456 && (i.suspendedLanes = 0, i.pingedLanes = 0, i.warmLanes = 0);
    }
    function mr(i, r, u, m, E, S) {
      var O = i.pendingLanes;
      i.pendingLanes = u, i.suspendedLanes = 0, i.pingedLanes = 0, i.warmLanes = 0, i.expiredLanes &= u, i.entangledLanes &= u, i.errorRecoveryDisabledLanes &= u, i.shellSuspendCounter = 0;
      var I = i.entanglements, F = i.expirationTimes, K = i.hiddenUpdates;
      for (u = O & ~u; 0 < u; ) {
        var Rt = 31 - _e(u), Lt = 1 << Rt;
        I[Rt] = 0, F[Rt] = -1;
        var wt = K[Rt];
        if (wt !== null)
          for (K[Rt] = null, Rt = 0; Rt < wt.length; Rt++) {
            var zt = wt[Rt];
            zt !== null && (zt.lane &= -536870913);
          }
        u &= ~Lt;
      }
      m !== 0 && Ha(i, m, 0), S !== 0 && E === 0 && i.tag !== 0 && (i.suspendedLanes |= S & ~(O & ~r));
    }
    function Ha(i, r, u) {
      i.pendingLanes |= r, i.suspendedLanes &= ~r;
      var m = 31 - _e(r);
      i.entangledLanes |= r, i.entanglements[m] = i.entanglements[m] | 1073741824 | u & 4194090;
    }
    function ti(i, r) {
      var u = i.entangledLanes |= r;
      for (i = i.entanglements; u; ) {
        var m = 31 - _e(u), E = 1 << m;
        E & r | i[m] & r && (i[m] |= r), u &= ~E;
      }
    }
    function zi(i) {
      switch (i) {
        case 2:
          i = 1;
          break;
        case 8:
          i = 4;
          break;
        case 32:
          i = 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:
          i = 128;
          break;
        case 268435456:
          i = 134217728;
          break;
        default:
          i = 0;
      }
      return i;
    }
    function Gi(i, r, u) {
      if (da)
        for (i = i.pendingUpdatersLaneMap; 0 < u; ) {
          var m = 31 - _e(u), E = 1 << m;
          i[m].add(r), u &= ~E;
        }
    }
    function Io(i, r) {
      if (da)
        for (var u = i.pendingUpdatersLaneMap, m = i.memoizedUpdaters; 0 < r; ) {
          var E = 31 - _e(r);
          i = 1 << E, E = u[E], 0 < E.size && (E.forEach(function(S) {
            var O = S.alternate;
            O !== null && m.has(O) || m.add(S);
          }), E.clear()), r &= ~i;
        }
    }
    function Ms(i) {
      return i &= -i, Ze < i ? Wo < i ? (i & 134217727) !== 0 ? Qo : yf : Wo : Ze;
    }
    function _l() {
      var i = Un.p;
      return i !== 0 ? i : (i = window.event, i === void 0 ? Qo : Wl(i.type));
    }
    function ls(i, r) {
      var u = Un.p;
      try {
        return Un.p = i, r();
      } finally {
        Un.p = u;
      }
    }
    function ir(i) {
      delete i[fr], delete i[es], delete i[Dp], delete i[Yh], delete i[Cg];
    }
    function Ui(i) {
      var r = i[fr];
      if (r) return r;
      for (var u = i.parentNode; u; ) {
        if (r = u[lc] || u[fr]) {
          if (u = r.alternate, r.child !== null || u !== null && u.child !== null)
            for (i = mp(i); i !== null; ) {
              if (u = i[fr])
                return u;
              i = mp(i);
            }
          return r;
        }
        i = u, u = i.parentNode;
      }
      return null;
    }
    function sa(i) {
      if (i = i[fr] || i[lc]) {
        var r = i.tag;
        if (r === 5 || r === 6 || r === 13 || r === 26 || r === 27 || r === 3)
          return i;
      }
      return null;
    }
    function Ba(i) {
      var r = i.tag;
      if (r === 5 || r === 26 || r === 27 || r === 6)
        return i.stateNode;
      throw Error("getNodeFromInstance: Invalid argument.");
    }
    function Y(i) {
      var r = i[Py];
      return r || (r = i[Py] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }), r;
    }
    function dt(i) {
      i[Og] = !0;
    }
    function Kt(i, r) {
      Jt(i, r), Jt(i + "Capture", r);
    }
    function Jt(i, r) {
      So[i] && console.error(
        "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",
        i
      ), So[i] = r;
      var u = i.toLowerCase();
      for (Np[u] = i, i === "onDoubleClick" && (Np.ondblclick = i), i = 0; i < r.length; i++)
        _f.add(r[i]);
    }
    function oe(i, r) {
      Lp[r.type] || r.onChange || r.onInput || r.readOnly || r.disabled || r.value == null || console.error(
        i === "select" ? "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`." : "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."
      ), r.onChange || r.readOnly || r.disabled || r.checked == null || console.error(
        "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."
      );
    }
    function Be(i) {
      return Ko.call(vf, i) ? !0 : Ko.call(Ip, i) ? !1 : Dg.test(i) ? vf[i] = !0 : (Ip[i] = !0, console.error("Invalid attribute name: `%s`", i), !1);
    }
    function Ue(i, r, u) {
      if (Be(r)) {
        if (!i.hasAttribute(r)) {
          switch (typeof u) {
            case "symbol":
            case "object":
              return u;
            case "function":
              return u;
            case "boolean":
              if (u === !1) return u;
          }
          return u === void 0 ? void 0 : null;
        }
        return i = i.getAttribute(r), i === "" && u === !0 ? !0 : (st(u, r), i === "" + u ? u : i);
      }
    }
    function Pe(i, r, u) {
      if (Be(r))
        if (u === null) i.removeAttribute(r);
        else {
          switch (typeof u) {
            case "undefined":
            case "function":
            case "symbol":
              i.removeAttribute(r);
              return;
            case "boolean":
              var m = r.toLowerCase().slice(0, 5);
              if (m !== "data-" && m !== "aria-") {
                i.removeAttribute(r);
                return;
              }
          }
          st(u, r), i.setAttribute(r, "" + u);
        }
    }
    function Ae(i, r, u) {
      if (u === null) i.removeAttribute(r);
      else {
        switch (typeof u) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            i.removeAttribute(r);
            return;
        }
        st(u, r), i.setAttribute(r, "" + u);
      }
    }
    function xn(i, r, u, m) {
      if (m === null) i.removeAttribute(u);
      else {
        switch (typeof m) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            i.removeAttribute(u);
            return;
        }
        st(m, u), i.setAttributeNS(r, u, "" + m);
      }
    }
    function Wi() {
    }
    function ar() {
      if (Fh === 0) {
        zy = console.log, Pv = console.info, ga = console.warn, xa = console.error, zv = console.group, Gv = console.groupCollapsed, Uv = console.groupEnd;
        var i = {
          configurable: !0,
          enumerable: !0,
          value: Wi,
          writable: !0
        };
        Object.defineProperties(console, {
          info: i,
          log: i,
          warn: i,
          error: i,
          group: i,
          groupCollapsed: i,
          groupEnd: i
        });
      }
      Fh++;
    }
    function oa() {
      if (Fh--, Fh === 0) {
        var i = { configurable: !0, enumerable: !0, writable: !0 };
        Object.defineProperties(console, {
          log: He({}, i, { value: zy }),
          info: He({}, i, { value: Pv }),
          warn: He({}, i, { value: ga }),
          error: He({}, i, { value: xa }),
          group: He({}, i, { value: zv }),
          groupCollapsed: He({}, i, { value: Gv }),
          groupEnd: He({}, i, { value: Uv })
        });
      }
      0 > Fh && console.error(
        "disabledDepth fell below zero. This is a bug in React. Please file an issue."
      );
    }
    function un(i) {
      if (Ef === void 0)
        try {
          throw Error();
        } catch (u) {
          var r = u.stack.trim().match(/\n( *(at )?)/);
          Ef = r && r[1] || "", Ng = -1 < u.stack.indexOf(`
    at`) ? " (<anonymous>)" : -1 < u.stack.indexOf("@") ? "@unknown:0:0" : "";
        }
      return `
` + Ef + i + Ng;
    }
    function cn(i, r) {
      if (!i || Lg) return "";
      var u = Gy.get(i);
      if (u !== void 0) return u;
      Lg = !0, u = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
      var m = null;
      m = Tt.H, Tt.H = null, ar();
      try {
        var E = {
          DetermineComponentFrameRoot: function() {
            try {
              if (r) {
                var wt = function() {
                  throw Error();
                };
                if (Object.defineProperty(wt.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                }), typeof Reflect == "object" && Reflect.construct) {
                  try {
                    Reflect.construct(wt, []);
                  } catch (ge) {
                    var zt = ge;
                  }
                  Reflect.construct(i, [], wt);
                } else {
                  try {
                    wt.call();
                  } catch (ge) {
                    zt = ge;
                  }
                  i.call(wt.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (ge) {
                  zt = ge;
                }
                (wt = i()) && typeof wt.catch == "function" && wt.catch(function() {
                });
              }
            } catch (ge) {
              if (ge && zt && typeof ge.stack == "string")
                return [ge.stack, zt.stack];
            }
            return [null, null];
          }
        };
        E.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
        var S = Object.getOwnPropertyDescriptor(
          E.DetermineComponentFrameRoot,
          "name"
        );
        S && S.configurable && Object.defineProperty(
          E.DetermineComponentFrameRoot,
          "name",
          { value: "DetermineComponentFrameRoot" }
        );
        var O = E.DetermineComponentFrameRoot(), I = O[0], F = O[1];
        if (I && F) {
          var K = I.split(`
`), Rt = F.split(`
`);
          for (O = S = 0; S < K.length && !K[S].includes(
            "DetermineComponentFrameRoot"
          ); )
            S++;
          for (; O < Rt.length && !Rt[O].includes(
            "DetermineComponentFrameRoot"
          ); )
            O++;
          if (S === K.length || O === Rt.length)
            for (S = K.length - 1, O = Rt.length - 1; 1 <= S && 0 <= O && K[S] !== Rt[O]; )
              O--;
          for (; 1 <= S && 0 <= O; S--, O--)
            if (K[S] !== Rt[O]) {
              if (S !== 1 || O !== 1)
                do
                  if (S--, O--, 0 > O || K[S] !== Rt[O]) {
                    var Lt = `
` + K[S].replace(
                      " at new ",
                      " at "
                    );
                    return i.displayName && Lt.includes("<anonymous>") && (Lt = Lt.replace("<anonymous>", i.displayName)), typeof i == "function" && Gy.set(i, Lt), Lt;
                  }
                while (1 <= S && 0 <= O);
              break;
            }
        }
      } finally {
        Lg = !1, Tt.H = m, oa(), Error.prepareStackTrace = u;
      }
      return K = (K = i ? i.displayName || i.name : "") ? un(K) : "", typeof i == "function" && Gy.set(i, K), K;
    }
    function Si(i) {
      var r = Error.prepareStackTrace;
      if (Error.prepareStackTrace = void 0, i = i.stack, Error.prepareStackTrace = r, i.startsWith(`Error: react-stack-top-frame
`) && (i = i.slice(29)), r = i.indexOf(`
`), r !== -1 && (i = i.slice(r + 1)), r = i.indexOf("react_stack_bottom_frame"), r !== -1 && (r = i.lastIndexOf(
        `
`,
        r
      )), r !== -1)
        i = i.slice(0, r);
      else return "";
      return i;
    }
    function us(i) {
      switch (i.tag) {
        case 26:
        case 27:
        case 5:
          return un(i.type);
        case 16:
          return un("Lazy");
        case 13:
          return un("Suspense");
        case 19:
          return un("SuspenseList");
        case 0:
        case 15:
          return cn(i.type, !1);
        case 11:
          return cn(i.type.render, !1);
        case 1:
          return cn(i.type, !0);
        case 31:
          return un("Activity");
        default:
          return "";
      }
    }
    function ym(i) {
      try {
        var r = "";
        do {
          r += us(i);
          var u = i._debugInfo;
          if (u)
            for (var m = u.length - 1; 0 <= m; m--) {
              var E = u[m];
              if (typeof E.name == "string") {
                var S = r, O = E.env, I = un(
                  E.name + (O ? " [" + O + "]" : "")
                );
                r = S + I;
              }
            }
          i = i.return;
        } while (i);
        return r;
      } catch (F) {
        return `
Error generating stack: ` + F.message + `
` + F.stack;
      }
    }
    function W_(i) {
      return (i = i ? i.displayName || i.name : "") ? un(i) : "";
    }
    function md() {
      if (La === null) return null;
      var i = La._debugOwner;
      return i != null ? pt(i) : null;
    }
    function pd() {
      if (La === null) return "";
      var i = La;
      try {
        var r = "";
        switch (i.tag === 6 && (i = i.return), i.tag) {
          case 26:
          case 27:
          case 5:
            r += un(i.type);
            break;
          case 13:
            r += un("Suspense");
            break;
          case 19:
            r += un("SuspenseList");
            break;
          case 31:
            r += un("Activity");
            break;
          case 30:
          case 0:
          case 15:
          case 1:
            i._debugOwner || r !== "" || (r += W_(
              i.type
            ));
            break;
          case 11:
            i._debugOwner || r !== "" || (r += W_(
              i.type.render
            ));
        }
        for (; i; )
          if (typeof i.tag == "number") {
            var u = i;
            i = u._debugOwner;
            var m = u._debugStack;
            i && m && (typeof m != "string" && (u._debugStack = m = Si(m)), m !== "" && (r += `
` + m));
          } else if (i.debugStack != null) {
            var E = i.debugStack;
            (i = i.owner) && E && (r += `
` + Si(E));
          } else break;
        var S = r;
      } catch (O) {
        S = `
Error generating stack: ` + O.message + `
` + O.stack;
      }
      return S;
    }
    function de(i, r, u, m, E, S, O) {
      var I = La;
      mu(i);
      try {
        return i !== null && i._debugTask ? i._debugTask.run(
          r.bind(null, u, m, E, S, O)
        ) : r(u, m, E, S, O);
      } finally {
        mu(I);
      }
      throw Error(
        "runWithFiberInDEV should never be called in production. This is a bug in React."
      );
    }
    function mu(i) {
      Tt.getCurrentStack = i === null ? null : pd, Jo = !1, La = i;
    }
    function qa(i) {
      switch (typeof i) {
        case "bigint":
        case "boolean":
        case "number":
        case "string":
        case "undefined":
          return i;
        case "object":
          return Dt(i), i;
        default:
          return "";
      }
    }
    function Nc(i) {
      var r = i.type;
      return (i = i.nodeName) && i.toLowerCase() === "input" && (r === "checkbox" || r === "radio");
    }
    function jf(i) {
      var r = Nc(i) ? "checked" : "value", u = Object.getOwnPropertyDescriptor(
        i.constructor.prototype,
        r
      );
      Dt(i[r]);
      var m = "" + i[r];
      if (!i.hasOwnProperty(r) && typeof u < "u" && typeof u.get == "function" && typeof u.set == "function") {
        var E = u.get, S = u.set;
        return Object.defineProperty(i, r, {
          configurable: !0,
          get: function() {
            return E.call(this);
          },
          set: function(O) {
            Dt(O), m = "" + O, S.call(this, O);
          }
        }), Object.defineProperty(i, r, {
          enumerable: u.enumerable
        }), {
          getValue: function() {
            return m;
          },
          setValue: function(O) {
            Dt(O), m = "" + O;
          },
          stopTracking: function() {
            i._valueTracker = null, delete i[r];
          }
        };
      }
    }
    function Qi(i) {
      i._valueTracker || (i._valueTracker = jf(i));
    }
    function z0(i) {
      if (!i) return !1;
      var r = i._valueTracker;
      if (!r) return !0;
      var u = r.getValue(), m = "";
      return i && (m = Nc(i) ? i.checked ? "true" : "false" : i.value), i = m, i !== u ? (r.setValue(i), !0) : !1;
    }
    function yd(i) {
      if (i = i || (typeof document < "u" ? document : void 0), typeof i > "u") return null;
      try {
        return i.activeElement || i.body;
      } catch {
        return i.body;
      }
    }
    function Ra(i) {
      return i.replace(
        jv,
        function(r) {
          return "\\" + r.charCodeAt(0).toString(16) + " ";
        }
      );
    }
    function Lc(i, r) {
      r.checked === void 0 || r.defaultChecked === void 0 || Pp || (console.error(
        "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",
        md() || "A component",
        r.type
      ), Pp = !0), r.value === void 0 || r.defaultValue === void 0 || Uy || (console.error(
        "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",
        md() || "A component",
        r.type
      ), Uy = !0);
    }
    function kf(i, r, u, m, E, S, O, I) {
      i.name = "", O != null && typeof O != "function" && typeof O != "symbol" && typeof O != "boolean" ? (st(O, "type"), i.type = O) : i.removeAttribute("type"), r != null ? O === "number" ? (r === 0 && i.value === "" || i.value != r) && (i.value = "" + qa(r)) : i.value !== "" + qa(r) && (i.value = "" + qa(r)) : O !== "submit" && O !== "reset" || i.removeAttribute("value"), r != null ? Ic(i, O, qa(r)) : u != null ? Ic(i, O, qa(u)) : m != null && i.removeAttribute("value"), E == null && S != null && (i.defaultChecked = !!S), E != null && (i.checked = E && typeof E != "function" && typeof E != "symbol"), I != null && typeof I != "function" && typeof I != "symbol" && typeof I != "boolean" ? (st(I, "name"), i.name = "" + qa(I)) : i.removeAttribute("name");
    }
    function G0(i, r, u, m, E, S, O, I) {
      if (S != null && typeof S != "function" && typeof S != "symbol" && typeof S != "boolean" && (st(S, "type"), i.type = S), r != null || u != null) {
        if (!(S !== "submit" && S !== "reset" || r != null))
          return;
        u = u != null ? "" + qa(u) : "", r = r != null ? "" + qa(r) : u, I || r === i.value || (i.value = r), i.defaultValue = r;
      }
      m = m ?? E, m = typeof m != "function" && typeof m != "symbol" && !!m, i.checked = I ? i.checked : !!m, i.defaultChecked = !!m, O != null && typeof O != "function" && typeof O != "symbol" && typeof O != "boolean" && (st(O, "name"), i.name = O);
    }
    function Ic(i, r, u) {
      r === "number" && yd(i.ownerDocument) === i || i.defaultValue === "" + u || (i.defaultValue = "" + u);
    }
    function Q_(i, r) {
      r.value == null && (typeof r.children == "object" && r.children !== null ? Ny.Children.forEach(r.children, function(u) {
        u == null || typeof u == "string" || typeof u == "number" || typeof u == "bigint" || Gp || (Gp = !0, console.error(
          "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."
        ));
      }) : r.dangerouslySetInnerHTML == null || jy || (jy = !0, console.error(
        "Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."
      ))), r.selected == null || zp || (console.error(
        "Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."
      ), zp = !0);
    }
    function _d() {
      var i = md();
      return i ? `

Check the render method of \`` + i + "`." : "";
    }
    function vl(i, r, u, m) {
      if (i = i.options, r) {
        r = {};
        for (var E = 0; E < u.length; E++)
          r["$" + u[E]] = !0;
        for (u = 0; u < i.length; u++)
          E = r.hasOwnProperty("$" + i[u].value), i[u].selected !== E && (i[u].selected = E), E && m && (i[u].defaultSelected = !0);
      } else {
        for (u = "" + qa(u), r = null, E = 0; E < i.length; E++) {
          if (i[E].value === u) {
            i[E].selected = !0, m && (i[E].defaultSelected = !0);
            return;
          }
          r !== null || i[E].disabled || (r = i[E]);
        }
        r !== null && (r.selected = !0);
      }
    }
    function eo(i, r) {
      for (i = 0; i < kv.length; i++) {
        var u = kv[i];
        if (r[u] != null) {
          var m = Sa(r[u]);
          r.multiple && !m ? console.error(
            "The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",
            u,
            _d()
          ) : !r.multiple && m && console.error(
            "The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",
            u,
            _d()
          );
        }
      }
      r.value === void 0 || r.defaultValue === void 0 || Ig || (console.error(
        "Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"
      ), Ig = !0);
    }
    function vd(i, r) {
      r.value === void 0 || r.defaultValue === void 0 || bf || (console.error(
        "%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",
        md() || "A component"
      ), bf = !0), r.children != null && r.value == null && console.error(
        "Use the `defaultValue` or `value` props instead of setting children on <textarea>."
      );
    }
    function _m(i, r, u) {
      if (r != null && (r = "" + qa(r), r !== i.value && (i.value = r), u == null)) {
        i.defaultValue !== r && (i.defaultValue = r);
        return;
      }
      i.defaultValue = u != null ? "" + qa(u) : "";
    }
    function Pc(i, r, u, m) {
      if (r == null) {
        if (m != null) {
          if (u != null)
            throw Error(
              "If you supply `defaultValue` on a <textarea>, do not pass children."
            );
          if (Sa(m)) {
            if (1 < m.length)
              throw Error("<textarea> can only have at most one child.");
            m = m[0];
          }
          u = m;
        }
        u == null && (u = ""), r = u;
      }
      u = qa(r), i.defaultValue = u, m = i.textContent, m === u && m !== "" && m !== null && (i.value = m);
    }
    function vm(i, r) {
      return i.serverProps === void 0 && i.serverTail.length === 0 && i.children.length === 1 && 3 < i.distanceFromLeaf && i.distanceFromLeaf > 15 - r ? vm(i.children[0], r) : i;
    }
    function pr(i) {
      return "  " + "  ".repeat(i);
    }
    function Hf(i) {
      return "+ " + "  ".repeat(i);
    }
    function El(i) {
      return "- " + "  ".repeat(i);
    }
    function zr(i) {
      switch (i.tag) {
        case 26:
        case 27:
        case 5:
          return i.type;
        case 16:
          return "Lazy";
        case 13:
          return "Suspense";
        case 19:
          return "SuspenseList";
        case 0:
        case 15:
          return i = i.type, i.displayName || i.name || null;
        case 11:
          return i = i.type.render, i.displayName || i.name || null;
        case 1:
          return i = i.type, i.displayName || i.name || null;
        default:
          return null;
      }
    }
    function zc(i, r) {
      return Up.test(i) ? (i = JSON.stringify(i), i.length > r - 2 ? 8 > r ? '{"..."}' : "{" + i.slice(0, r - 7) + '..."}' : "{" + i + "}") : i.length > r ? 5 > r ? '{"..."}' : i.slice(0, r - 3) + "..." : i;
    }
    function Bf(i, r, u) {
      var m = 120 - 2 * u;
      if (r === null)
        return Hf(u) + zc(i, m) + `
`;
      if (typeof r == "string") {
        for (var E = 0; E < r.length && E < i.length && r.charCodeAt(E) === i.charCodeAt(E); E++) ;
        return E > m - 8 && 10 < E && (i = "..." + i.slice(E - 8), r = "..." + r.slice(E - 8)), Hf(u) + zc(i, m) + `
` + El(u) + zc(r, m) + `
`;
      }
      return pr(u) + zc(i, m) + `
`;
    }
    function qf(i) {
      return Object.prototype.toString.call(i).replace(/^\[object (.*)\]$/, function(r, u) {
        return u;
      });
    }
    function Gc(i, r) {
      switch (typeof i) {
        case "string":
          return i = JSON.stringify(i), i.length > r ? 5 > r ? '"..."' : i.slice(0, r - 4) + '..."' : i;
        case "object":
          if (i === null) return "null";
          if (Sa(i)) return "[...]";
          if (i.$$typeof === Jl)
            return (r = ot(i.type)) ? "<" + r + ">" : "<...>";
          var u = qf(i);
          if (u === "Object") {
            u = "", r -= 2;
            for (var m in i)
              if (i.hasOwnProperty(m)) {
                var E = JSON.stringify(m);
                if (E !== '"' + m + '"' && (m = E), r -= m.length - 2, E = Gc(
                  i[m],
                  15 > r ? r : 15
                ), r -= E.length, 0 > r) {
                  u += u === "" ? "..." : ", ...";
                  break;
                }
                u += (u === "" ? "" : ",") + m + ":" + E;
              }
            return "{" + u + "}";
          }
          return u;
        case "function":
          return (r = i.displayName || i.name) ? "function " + r : "function";
        default:
          return String(i);
      }
    }
    function Cs(i, r) {
      return typeof i != "string" || Up.test(i) ? "{" + Gc(i, r - 2) + "}" : i.length > r - 2 ? 5 > r ? '"..."' : '"' + i.slice(0, r - 5) + '..."' : '"' + i + '"';
    }
    function Em(i, r, u) {
      var m = 120 - u.length - i.length, E = [], S;
      for (S in r)
        if (r.hasOwnProperty(S) && S !== "children") {
          var O = Cs(
            r[S],
            120 - u.length - S.length - 1
          );
          m -= S.length + O.length + 2, E.push(S + "=" + O);
        }
      return E.length === 0 ? u + "<" + i + `>
` : 0 < m ? u + "<" + i + " " + E.join(" ") + `>
` : u + "<" + i + `
` + u + "  " + E.join(`
` + u + "  ") + `
` + u + `>
`;
    }
    function Os(i, r, u) {
      var m = "", E = He({}, r), S;
      for (S in i)
        if (i.hasOwnProperty(S)) {
          delete E[S];
          var O = 120 - 2 * u - S.length - 2, I = Gc(i[S], O);
          r.hasOwnProperty(S) ? (O = Gc(r[S], O), m += Hf(u) + S + ": " + I + `
`, m += El(u) + S + ": " + O + `
`) : m += Hf(u) + S + ": " + I + `
`;
        }
      for (var F in E)
        E.hasOwnProperty(F) && (i = Gc(
          E[F],
          120 - 2 * u - F.length - 2
        ), m += El(u) + F + ": " + i + `
`);
      return m;
    }
    function bm(i, r, u, m) {
      var E = "", S = /* @__PURE__ */ new Map();
      for (K in u)
        u.hasOwnProperty(K) && S.set(
          K.toLowerCase(),
          K
        );
      if (S.size === 1 && S.has("children"))
        E += Em(
          i,
          r,
          pr(m)
        );
      else {
        for (var O in r)
          if (r.hasOwnProperty(O) && O !== "children") {
            var I = 120 - 2 * (m + 1) - O.length - 1, F = S.get(O.toLowerCase());
            if (F !== void 0) {
              S.delete(O.toLowerCase());
              var K = r[O];
              F = u[F];
              var Rt = Cs(
                K,
                I
              );
              I = Cs(
                F,
                I
              ), typeof K == "object" && K !== null && typeof F == "object" && F !== null && qf(K) === "Object" && qf(F) === "Object" && (2 < Object.keys(K).length || 2 < Object.keys(F).length || -1 < Rt.indexOf("...") || -1 < I.indexOf("...")) ? E += pr(m + 1) + O + `={{
` + Os(
                K,
                F,
                m + 2
              ) + pr(m + 1) + `}}
` : (E += Hf(m + 1) + O + "=" + Rt + `
`, E += El(m + 1) + O + "=" + I + `
`);
            } else
              E += pr(m + 1) + O + "=" + Cs(r[O], I) + `
`;
          }
        S.forEach(function(Lt) {
          if (Lt !== "children") {
            var wt = 120 - 2 * (m + 1) - Lt.length - 1;
            E += El(m + 1) + Lt + "=" + Cs(u[Lt], wt) + `
`;
          }
        }), E = E === "" ? pr(m) + "<" + i + `>
` : pr(m) + "<" + i + `
` + E + pr(m) + `>
`;
      }
      return i = u.children, r = r.children, typeof i == "string" || typeof i == "number" || typeof i == "bigint" ? (S = "", (typeof r == "string" || typeof r == "number" || typeof r == "bigint") && (S = "" + r), E += Bf(S, "" + i, m + 1)) : (typeof r == "string" || typeof r == "number" || typeof r == "bigint") && (E = i == null ? E + Bf("" + r, null, m + 1) : E + Bf("" + r, void 0, m + 1)), E;
    }
    function Sm(i, r) {
      var u = zr(i);
      if (u === null) {
        for (u = "", i = i.child; i; )
          u += Sm(i, r), i = i.sibling;
        return u;
      }
      return pr(r) + "<" + u + `>
`;
    }
    function Uc(i, r) {
      var u = vm(i, r);
      if (u !== i && (i.children.length !== 1 || i.children[0] !== u))
        return pr(r) + `...
` + Uc(u, r + 1);
      u = "";
      var m = i.fiber._debugInfo;
      if (m)
        for (var E = 0; E < m.length; E++) {
          var S = m[E].name;
          typeof S == "string" && (u += pr(r) + "<" + S + `>
`, r++);
        }
      if (m = "", E = i.fiber.pendingProps, i.fiber.tag === 6)
        m = Bf(E, i.serverProps, r), r++;
      else if (S = zr(i.fiber), S !== null)
        if (i.serverProps === void 0) {
          m = r;
          var O = 120 - 2 * m - S.length - 2, I = "";
          for (K in E)
            if (E.hasOwnProperty(K) && K !== "children") {
              var F = Cs(E[K], 15);
              if (O -= K.length + F.length + 2, 0 > O) {
                I += " ...";
                break;
              }
              I += " " + K + "=" + F;
            }
          m = pr(m) + "<" + S + I + `>
`, r++;
        } else
          i.serverProps === null ? (m = Em(
            S,
            E,
            Hf(r)
          ), r++) : typeof i.serverProps == "string" ? console.error(
            "Should not have matched a non HostText fiber to a Text node. This is a bug in React."
          ) : (m = bm(
            S,
            E,
            i.serverProps,
            r
          ), r++);
      var K = "";
      for (E = i.fiber.child, S = 0; E && S < i.children.length; )
        O = i.children[S], O.fiber === E ? (K += Uc(O, r), S++) : K += Sm(E, r), E = E.sibling;
      for (E && 0 < i.children.length && (K += pr(r) + `...
`), E = i.serverTail, i.serverProps === null && r--, i = 0; i < E.length; i++)
        S = E[i], K = typeof S == "string" ? K + (El(r) + zc(S, 120 - 2 * r) + `
`) : K + Em(
          S.type,
          S.props,
          El(r)
        );
      return u + m + K;
    }
    function pu(i) {
      try {
        return `

` + Uc(i, 0);
      } catch {
        return "";
      }
    }
    function xm(i, r, u) {
      for (var m = r, E = null, S = 0; m; )
        m === i && (S = 0), E = {
          fiber: m,
          children: E !== null ? [E] : [],
          serverProps: m === r ? u : m === i ? null : void 0,
          serverTail: [],
          distanceFromLeaf: S
        }, S++, m = m.return;
      return E !== null ? pu(E).replaceAll(/^[+-]/gm, ">") : "";
    }
    function Ed(i, r) {
      var u = He({}, i || zg), m = { tag: r };
      return Pg.indexOf(r) !== -1 && (u.aTagInScope = null, u.buttonTagInScope = null, u.nobrTagInScope = null), Hy.indexOf(r) !== -1 && (u.pTagInButtonScope = null), ky.indexOf(r) !== -1 && r !== "address" && r !== "div" && r !== "p" && (u.listItemTagAutoclosing = null, u.dlItemTagAutoclosing = null), u.current = m, r === "form" && (u.formTag = m), r === "a" && (u.aTagInScope = m), r === "button" && (u.buttonTagInScope = m), r === "nobr" && (u.nobrTagInScope = m), r === "p" && (u.pTagInButtonScope = m), r === "li" && (u.listItemTagAutoclosing = m), (r === "dd" || r === "dt") && (u.dlItemTagAutoclosing = m), r === "#document" || r === "html" ? u.containerTagInScope = null : u.containerTagInScope || (u.containerTagInScope = m), i !== null || r !== "#document" && r !== "html" && r !== "body" ? u.implicitRootScope === !0 && (u.implicitRootScope = !1) : u.implicitRootScope = !0, u;
    }
    function bl(i, r, u) {
      switch (r) {
        case "select":
          return i === "hr" || i === "option" || i === "optgroup" || i === "script" || i === "template" || i === "#text";
        case "optgroup":
          return i === "option" || i === "#text";
        case "option":
          return i === "#text";
        case "tr":
          return i === "th" || i === "td" || i === "style" || i === "script" || i === "template";
        case "tbody":
        case "thead":
        case "tfoot":
          return i === "tr" || i === "style" || i === "script" || i === "template";
        case "colgroup":
          return i === "col" || i === "template";
        case "table":
          return i === "caption" || i === "colgroup" || i === "tbody" || i === "tfoot" || i === "thead" || i === "style" || i === "script" || i === "template";
        case "head":
          return i === "base" || i === "basefont" || i === "bgsound" || i === "link" || i === "meta" || i === "title" || i === "noscript" || i === "noframes" || i === "style" || i === "script" || i === "template";
        case "html":
          if (u) break;
          return i === "head" || i === "body" || i === "frameset";
        case "frameset":
          return i === "frame";
        case "#document":
          if (!u) return i === "html";
      }
      switch (i) {
        case "h1":
        case "h2":
        case "h3":
        case "h4":
        case "h5":
        case "h6":
          return r !== "h1" && r !== "h2" && r !== "h3" && r !== "h4" && r !== "h5" && r !== "h6";
        case "rp":
        case "rt":
          return Hv.indexOf(r) === -1;
        case "caption":
        case "col":
        case "colgroup":
        case "frameset":
        case "frame":
        case "tbody":
        case "td":
        case "tfoot":
        case "th":
        case "thead":
        case "tr":
          return r == null;
        case "head":
          return u || r === null;
        case "html":
          return u && r === "#document" || r === null;
        case "body":
          return u && (r === "#document" || r === "html") || r === null;
      }
      return !0;
    }
    function Vf(i, r) {
      switch (i) {
        case "address":
        case "article":
        case "aside":
        case "blockquote":
        case "center":
        case "details":
        case "dialog":
        case "dir":
        case "div":
        case "dl":
        case "fieldset":
        case "figcaption":
        case "figure":
        case "footer":
        case "header":
        case "hgroup":
        case "main":
        case "menu":
        case "nav":
        case "ol":
        case "p":
        case "section":
        case "summary":
        case "ul":
        case "pre":
        case "listing":
        case "table":
        case "hr":
        case "xmp":
        case "h1":
        case "h2":
        case "h3":
        case "h4":
        case "h5":
        case "h6":
          return r.pTagInButtonScope;
        case "form":
          return r.formTag || r.pTagInButtonScope;
        case "li":
          return r.listItemTagAutoclosing;
        case "dd":
        case "dt":
          return r.dlItemTagAutoclosing;
        case "button":
          return r.buttonTagInScope;
        case "a":
          return r.aTagInScope;
        case "nobr":
          return r.nobrTagInScope;
      }
      return null;
    }
    function Tm(i, r) {
      for (; i; ) {
        switch (i.tag) {
          case 5:
          case 26:
          case 27:
            if (i.type === r) return i;
        }
        i = i.return;
      }
      return null;
    }
    function bd(i, r) {
      r = r || zg;
      var u = r.current;
      if (r = (u = bl(
        i,
        u && u.tag,
        r.implicitRootScope
      ) ? null : u) ? null : Vf(i, r), r = u || r, !r) return !0;
      var m = r.tag;
      if (r = String(!!u) + "|" + i + "|" + m, Fs[r]) return !1;
      Fs[r] = !0;
      var E = (r = La) ? Tm(r.return, m) : null, S = r !== null && E !== null ? xm(E, r, null) : "", O = "<" + i + ">";
      return u ? (u = "", m === "table" && i === "tr" && (u += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), console.error(
        `In HTML, %s cannot be a child of <%s>.%s
This will cause a hydration error.%s`,
        O,
        m,
        u,
        S
      )) : console.error(
        `In HTML, %s cannot be a descendant of <%s>.
This will cause a hydration error.%s`,
        O,
        m,
        S
      ), r && (i = r.return, E === null || i === null || E === i && i._debugOwner === r._debugOwner || de(E, function() {
        console.error(
          `<%s> cannot contain a nested %s.
See this log for the ancestor stack trace.`,
          m,
          O
        );
      })), !1;
    }
    function Yf(i, r, u) {
      if (u || bl("#text", r, !1))
        return !0;
      if (u = "#text|" + r, Fs[u]) return !1;
      Fs[u] = !0;
      var m = (u = La) ? Tm(u, r) : null;
      return u = u !== null && m !== null ? xm(
        m,
        u,
        u.tag !== 6 ? { children: null } : null
      ) : "", /\S/.test(i) ? console.error(
        `In HTML, text nodes cannot be a child of <%s>.
This will cause a hydration error.%s`,
        r,
        u
      ) : console.error(
        `In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
This will cause a hydration error.%s`,
        r,
        u
      ), !1;
    }
    function Ff(i, r) {
      if (r) {
        var u = i.firstChild;
        if (u && u === i.lastChild && u.nodeType === 3) {
          u.nodeValue = r;
          return;
        }
      }
      i.textContent = r;
    }
    function J_(i) {
      return i.replace(DE, function(r, u) {
        return u.toUpperCase();
      });
    }
    function $f(i, r, u) {
      var m = r.indexOf("--") === 0;
      m || (-1 < r.indexOf("-") ? el.hasOwnProperty(r) && el[r] || (el[r] = !0, console.error(
        "Unsupported style property %s. Did you mean %s?",
        r,
        J_(r.replace(uc, "ms-"))
      )) : Gg.test(r) ? el.hasOwnProperty(r) && el[r] || (el[r] = !0, console.error(
        "Unsupported vendor-prefixed style property %s. Did you mean %s?",
        r,
        r.charAt(0).toUpperCase() + r.slice(1)
      )) : !By.test(u) || qy.hasOwnProperty(u) && qy[u] || (qy[u] = !0, console.error(
        `Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,
        r,
        u.replace(By, "")
      )), typeof u == "number" && (isNaN(u) ? Vy || (Vy = !0, console.error(
        "`NaN` is an invalid value for the `%s` css style property.",
        r
      )) : isFinite(u) || Ug || (Ug = !0, console.error(
        "`Infinity` is an invalid value for the `%s` css style property.",
        r
      )))), u == null || typeof u == "boolean" || u === "" ? m ? i.setProperty(r, "") : r === "float" ? i.cssFloat = "" : i[r] = "" : m ? i.setProperty(r, u) : typeof u != "number" || u === 0 || Yy.has(r) ? r === "float" ? i.cssFloat = u : (At(u, r), i[r] = ("" + u).trim()) : i[r] = u + "px";
    }
    function Sd(i, r, u) {
      if (r != null && typeof r != "object")
        throw Error(
          "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
        );
      if (r && Object.freeze(r), i = i.style, u != null) {
        if (r) {
          var m = {};
          if (u) {
            for (var E in u)
              if (u.hasOwnProperty(E) && !r.hasOwnProperty(E))
                for (var S = tl[E] || [E], O = 0; O < S.length; O++)
                  m[S[O]] = E;
          }
          for (var I in r)
            if (r.hasOwnProperty(I) && (!u || u[I] !== r[I]))
              for (E = tl[I] || [I], S = 0; S < E.length; S++)
                m[E[S]] = I;
          I = {};
          for (var F in r)
            for (E = tl[F] || [F], S = 0; S < E.length; S++)
              I[E[S]] = F;
          F = {};
          for (var K in m)
            if (E = m[K], (S = I[K]) && E !== S && (O = E + "," + S, !F[O])) {
              F[O] = !0, O = console;
              var Rt = r[E];
              O.error.call(
                O,
                "%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",
                Rt == null || typeof Rt == "boolean" || Rt === "" ? "Removing" : "Updating",
                E,
                S
              );
            }
        }
        for (var Lt in u)
          !u.hasOwnProperty(Lt) || r != null && r.hasOwnProperty(Lt) || (Lt.indexOf("--") === 0 ? i.setProperty(Lt, "") : Lt === "float" ? i.cssFloat = "" : i[Lt] = "");
        for (var wt in r)
          K = r[wt], r.hasOwnProperty(wt) && u[wt] !== K && $f(i, wt, K);
      } else
        for (m in r)
          r.hasOwnProperty(m) && $f(i, m, r[m]);
    }
    function jc(i) {
      if (i.indexOf("-") === -1) return !1;
      switch (i) {
        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;
      }
    }
    function kc(i) {
      return kp.get(i) || i;
    }
    function Xf(i, r) {
      if (Ko.call(cc, r) && cc[r])
        return !0;
      if (Bv.test(r)) {
        if (i = "aria-" + r.slice(4).toLowerCase(), i = Xh.hasOwnProperty(i) ? i : null, i == null)
          return console.error(
            "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",
            r
          ), cc[r] = !0;
        if (r !== i)
          return console.error(
            "Invalid ARIA attribute `%s`. Did you mean `%s`?",
            r,
            i
          ), cc[r] = !0;
      }
      if (Hp.test(r)) {
        if (i = r.toLowerCase(), i = Xh.hasOwnProperty(i) ? i : null, i == null) return cc[r] = !0, !1;
        r !== i && (console.error(
          "Unknown ARIA attribute `%s`. Did you mean `%s`?",
          r,
          i
        ), cc[r] = !0);
      }
      return !0;
    }
    function U0(i, r) {
      var u = [], m;
      for (m in r)
        Xf(i, m) || u.push(m);
      r = u.map(function(E) {
        return "`" + E + "`";
      }).join(", "), u.length === 1 ? console.error(
        "Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",
        r,
        i
      ) : 1 < u.length && console.error(
        "Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",
        r,
        i
      );
    }
    function j0(i, r, u, m) {
      if (Ko.call(Ia, r) && Ia[r])
        return !0;
      var E = r.toLowerCase();
      if (E === "onfocusin" || E === "onfocusout")
        return console.error(
          "React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."
        ), Ia[r] = !0;
      if (typeof u == "function" && (i === "form" && r === "action" || i === "input" && r === "formAction" || i === "button" && r === "formAction"))
        return !0;
      if (m != null) {
        if (i = m.possibleRegistrationNames, m.registrationNameDependencies.hasOwnProperty(r))
          return !0;
        if (m = i.hasOwnProperty(E) ? i[E] : null, m != null)
          return console.error(
            "Invalid event handler property `%s`. Did you mean `%s`?",
            r,
            m
          ), Ia[r] = !0;
        if (o.test(r))
          return console.error(
            "Unknown event handler property `%s`. It will be ignored.",
            r
          ), Ia[r] = !0;
      } else if (o.test(r))
        return c.test(r) && console.error(
          "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",
          r
        ), Ia[r] = !0;
      if (d.test(r) || v.test(r)) return !0;
      if (E === "innerhtml")
        return console.error(
          "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."
        ), Ia[r] = !0;
      if (E === "aria")
        return console.error(
          "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."
        ), Ia[r] = !0;
      if (E === "is" && u !== null && u !== void 0 && typeof u != "string")
        return console.error(
          "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",
          typeof u
        ), Ia[r] = !0;
      if (typeof u == "number" && isNaN(u))
        return console.error(
          "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",
          r
        ), Ia[r] = !0;
      if (jg.hasOwnProperty(E)) {
        if (E = jg[E], E !== r)
          return console.error(
            "Invalid DOM property `%s`. Did you mean `%s`?",
            r,
            E
          ), Ia[r] = !0;
      } else if (r !== E)
        return console.error(
          "React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",
          r,
          E
        ), Ia[r] = !0;
      switch (r) {
        case "dangerouslySetInnerHTML":
        case "children":
        case "style":
        case "suppressContentEditableWarning":
        case "suppressHydrationWarning":
        case "defaultValue":
        case "defaultChecked":
        case "innerHTML":
        case "ref":
          return !0;
        case "innerText":
        case "textContent":
          return !0;
      }
      switch (typeof u) {
        case "boolean":
          switch (r) {
            case "autoFocus":
            case "checked":
            case "multiple":
            case "muted":
            case "selected":
            case "contentEditable":
            case "spellCheck":
            case "draggable":
            case "value":
            case "autoReverse":
            case "externalResourcesRequired":
            case "focusable":
            case "preserveAlpha":
            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":
            case "capture":
            case "download":
            case "inert":
              return !0;
            default:
              return E = r.toLowerCase().slice(0, 5), E === "data-" || E === "aria-" ? !0 : (u ? console.error(
                'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',
                u,
                r,
                r,
                u,
                r
              ) : console.error(
                'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',
                u,
                r,
                r,
                u,
                r,
                r,
                r
              ), Ia[r] = !0);
          }
        case "function":
        case "symbol":
          return Ia[r] = !0, !1;
        case "string":
          if (u === "false" || u === "true") {
            switch (r) {
              case "checked":
              case "selected":
              case "multiple":
              case "muted":
              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":
              case "inert":
                break;
              default:
                return !0;
            }
            console.error(
              "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",
              u,
              r,
              u === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".',
              r,
              u
            ), Ia[r] = !0;
          }
      }
      return !0;
    }
    function tv(i, r, u) {
      var m = [], E;
      for (E in r)
        j0(i, E, r[E], u) || m.push(E);
      r = m.map(function(S) {
        return "`" + S + "`";
      }).join(", "), m.length === 1 ? console.error(
        "Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",
        r,
        i
      ) : 1 < m.length && console.error(
        "Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",
        r,
        i
      );
    }
    function Sl(i) {
      return T.test("" + i) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : i;
    }
    function no(i) {
      return i = i.target || i.srcElement || window, i.correspondingUseElement && (i = i.correspondingUseElement), i.nodeType === 3 ? i.parentNode : i;
    }
    function Kf(i) {
      var r = sa(i);
      if (r && (i = r.stateNode)) {
        var u = i[es] || null;
        t: switch (i = r.stateNode, r.type) {
          case "input":
            if (kf(
              i,
              u.value,
              u.defaultValue,
              u.defaultValue,
              u.checked,
              u.defaultChecked,
              u.type,
              u.name
            ), r = u.name, u.type === "radio" && r != null) {
              for (u = i; u.parentNode; ) u = u.parentNode;
              for (st(r, "name"), u = u.querySelectorAll(
                'input[name="' + Ra(
                  "" + r
                ) + '"][type="radio"]'
              ), r = 0; r < u.length; r++) {
                var m = u[r];
                if (m !== i && m.form === i.form) {
                  var E = m[es] || null;
                  if (!E)
                    throw Error(
                      "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."
                    );
                  kf(
                    m,
                    E.value,
                    E.defaultValue,
                    E.defaultValue,
                    E.checked,
                    E.defaultChecked,
                    E.type,
                    E.name
                  );
                }
              }
              for (r = 0; r < u.length; r++)
                m = u[r], m.form === i.form && z0(m);
            }
            break t;
          case "textarea":
            _m(i, u.value, u.defaultValue);
            break t;
          case "select":
            r = u.value, r != null && vl(i, !!u.multiple, r, !1);
        }
      }
    }
    function Zf(i, r, u) {
      if (it) return i(r, u);
      it = !0;
      try {
        var m = i(r);
        return m;
      } finally {
        if (it = !1, (P !== null || q !== null) && (Yo(), P && (r = P, i = q, q = P = null, Kf(r), i)))
          for (r = 0; r < i.length; r++) Kf(i[r]);
      }
    }
    function Ds(i, r) {
      var u = i.stateNode;
      if (u === null) return null;
      var m = u[es] || null;
      if (m === null) return null;
      u = m[r];
      t: switch (r) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          (m = !m.disabled) || (i = i.type, m = !(i === "button" || i === "input" || i === "select" || i === "textarea")), i = !m;
          break t;
        default:
          i = !1;
      }
      if (i) return null;
      if (u && typeof u != "function")
        throw Error(
          "Expected `" + r + "` listener to be a function, instead got a value of `" + typeof u + "` type."
        );
      return u;
    }
    function wm() {
      if (we) return we;
      var i, r = bt, u = r.length, m, E = "value" in xt ? xt.value : xt.textContent, S = E.length;
      for (i = 0; i < u && r[i] === E[i]; i++) ;
      var O = u - i;
      for (m = 1; m <= O && r[u - m] === E[S - m]; m++) ;
      return we = E.slice(i, 1 < m ? 1 - m : void 0);
    }
    function Hc(i) {
      var r = i.keyCode;
      return "charCode" in i ? (i = i.charCode, i === 0 && r === 13 && (i = 13)) : i = r, i === 10 && (i = 13), 32 <= i || i === 13 ? i : 0;
    }
    function xd() {
      return !0;
    }
    function Xn() {
      return !1;
    }
    function $e(i) {
      function r(u, m, E, S, O) {
        this._reactName = u, this._targetInst = E, this.type = m, this.nativeEvent = S, this.target = O, this.currentTarget = null;
        for (var I in i)
          i.hasOwnProperty(I) && (u = i[I], this[I] = u ? u(S) : S[I]);
        return this.isDefaultPrevented = (S.defaultPrevented != null ? S.defaultPrevented : S.returnValue === !1) ? xd : Xn, this.isPropagationStopped = Xn, this;
      }
      return He(r.prototype, {
        preventDefault: function() {
          this.defaultPrevented = !0;
          var u = this.nativeEvent;
          u && (u.preventDefault ? u.preventDefault() : typeof u.returnValue != "unknown" && (u.returnValue = !1), this.isDefaultPrevented = xd);
        },
        stopPropagation: function() {
          var u = this.nativeEvent;
          u && (u.stopPropagation ? u.stopPropagation() : typeof u.cancelBubble != "unknown" && (u.cancelBubble = !0), this.isPropagationStopped = xd);
        },
        persist: function() {
        },
        isPersistent: xd
      }), r;
    }
    function ev(i) {
      var r = this.nativeEvent;
      return r.getModifierState ? r.getModifierState(i) : (i = Vw[i]) ? !!r[i] : !1;
    }
    function rr() {
      return ev;
    }
    function yu(i, r) {
      switch (i) {
        case "keyup":
          return nR.indexOf(r.keyCode) !== -1;
        case "keydown":
          return r.keyCode !== KS;
        case "keypress":
        case "mousedown":
        case "focusout":
          return !0;
        default:
          return !1;
      }
    }
    function Td(i) {
      return i = i.detail, typeof i == "object" && "data" in i ? i.data : null;
    }
    function wd(i, r) {
      switch (i) {
        case "compositionend":
          return Td(r);
        case "keypress":
          return r.which !== D ? null : ($ = !0, G);
        case "textInput":
          return i = r.data, i === G && $ ? null : i;
        default:
          return null;
      }
    }
    function wE(i, r) {
      if (tt)
        return i === "compositionend" || !PE && yu(i, r) ? (i = wm(), we = bt = xt = null, tt = !1, i) : null;
      switch (i) {
        case "paste":
          return null;
        case "keypress":
          if (!(r.ctrlKey || r.altKey || r.metaKey) || r.ctrlKey && r.altKey) {
            if (r.char && 1 < r.char.length)
              return r.char;
            if (r.which)
              return String.fromCharCode(r.which);
          }
          return null;
        case "compositionend":
          return R && r.locale !== "ko" ? null : r.data;
        default:
          return null;
      }
    }
    function Rd(i) {
      var r = i && i.nodeName && i.nodeName.toLowerCase();
      return r === "input" ? !!lt[i.type] : r === "textarea";
    }
    function k0(i) {
      if (!vt) return !1;
      i = "on" + i;
      var r = i in document;
      return r || (r = document.createElement("div"), r.setAttribute(i, "return;"), r = typeof r[i] == "function"), r;
    }
    function ji(i, r, u, m) {
      P ? q ? q.push(m) : q = [m] : P = m, r = Xa(r, "onChange"), 0 < r.length && (u = new jn(
        "onChange",
        "change",
        null,
        u,
        m
      ), i.push({ event: u, listeners: r }));
    }
    function Wf(i) {
      vy(i, 0);
    }
    function io(i) {
      var r = Ba(i);
      if (z0(r)) return i;
    }
    function H0(i, r) {
      if (i === "change") return r;
    }
    function Rm() {
      _t && (_t.detachEvent("onpropertychange", cs), Ht = _t = null);
    }
    function cs(i) {
      if (i.propertyName === "value" && io(Ht)) {
        var r = [];
        ji(
          r,
          Ht,
          i,
          no(i)
        ), Zf(Wf, r);
      }
    }
    function Am(i, r, u) {
      i === "focusin" ? (Rm(), _t = r, Ht = u, _t.attachEvent("onpropertychange", cs)) : i === "focusout" && Rm();
    }
    function nv(i) {
      if (i === "selectionchange" || i === "keyup" || i === "keydown")
        return io(Ht);
    }
    function iv(i, r) {
      if (i === "click") return io(r);
    }
    function av(i, r) {
      if (i === "input" || i === "change")
        return io(r);
    }
    function rv(i, r) {
      return i === r && (i !== 0 || 1 / i === 1 / r) || i !== i && r !== r;
    }
    function Qf(i, r) {
      if (Vt(i, r)) return !0;
      if (typeof i != "object" || i === null || typeof r != "object" || r === null)
        return !1;
      var u = Object.keys(i), m = Object.keys(r);
      if (u.length !== m.length) return !1;
      for (m = 0; m < u.length; m++) {
        var E = u[m];
        if (!Ko.call(r, E) || !Vt(i[E], r[E]))
          return !1;
      }
      return !0;
    }
    function yr(i) {
      for (; i && i.firstChild; ) i = i.firstChild;
      return i;
    }
    function sv(i, r) {
      var u = yr(i);
      i = 0;
      for (var m; u; ) {
        if (u.nodeType === 3) {
          if (m = i + u.textContent.length, i <= r && m >= r)
            return { node: u, offset: r - i };
          i = m;
        }
        t: {
          for (; u; ) {
            if (u.nextSibling) {
              u = u.nextSibling;
              break t;
            }
            u = u.parentNode;
          }
          u = void 0;
        }
        u = yr(u);
      }
    }
    function fs(i, r) {
      return i && r ? i === r ? !0 : i && i.nodeType === 3 ? !1 : r && r.nodeType === 3 ? fs(i, r.parentNode) : "contains" in i ? i.contains(r) : i.compareDocumentPosition ? !!(i.compareDocumentPosition(r) & 16) : !1 : !1;
    }
    function ov(i) {
      i = i != null && i.ownerDocument != null && i.ownerDocument.defaultView != null ? i.ownerDocument.defaultView : window;
      for (var r = yd(i.document); r instanceof i.HTMLIFrameElement; ) {
        try {
          var u = typeof r.contentWindow.location.href == "string";
        } catch {
          u = !1;
        }
        if (u) i = r.contentWindow;
        else break;
        r = yd(i.document);
      }
      return r;
    }
    function Mm(i) {
      var r = i && i.nodeName && i.nodeName.toLowerCase();
      return r && (r === "input" && (i.type === "text" || i.type === "search" || i.type === "tel" || i.type === "url" || i.type === "password") || r === "textarea" || i.contentEditable === "true");
    }
    function ao(i, r, u) {
      var m = u.window === u ? u.document : u.nodeType === 9 ? u : u.ownerDocument;
      Ne || he == null || he !== yd(m) || (m = he, "selectionStart" in m && Mm(m) ? m = { start: m.selectionStart, end: m.selectionEnd } : (m = (m.ownerDocument && m.ownerDocument.defaultView || window).getSelection(), m = {
        anchorNode: m.anchorNode,
        anchorOffset: m.anchorOffset,
        focusNode: m.focusNode,
        focusOffset: m.focusOffset
      }), We && Qf(We, m) || (We = m, m = Xa(De, "onSelect"), 0 < m.length && (r = new jn(
        "onSelect",
        "select",
        null,
        r,
        u
      ), i.push({ event: r, listeners: m }), r.target = he)));
    }
    function Po(i, r) {
      var u = {};
      return u[i.toLowerCase()] = r.toLowerCase(), u["Webkit" + i] = "webkit" + r, u["Moz" + i] = "moz" + r, u;
    }
    function xl(i) {
      if (bn[i]) return bn[i];
      if (!rn[i]) return i;
      var r = rn[i], u;
      for (u in r)
        if (r.hasOwnProperty(u) && u in $s)
          return bn[i] = r[u];
      return i;
    }
    function Tn(i, r) {
      OO.set(i, r), Kt(r, [i]);
    }
    function Ji(i, r) {
      if (typeof i == "object" && i !== null) {
        var u = aR.get(i);
        return u !== void 0 ? u : (r = {
          value: i,
          source: r,
          stack: ym(r)
        }, aR.set(i, r), r);
      }
      return {
        value: i,
        source: r,
        stack: ym(r)
      };
    }
    function Jf() {
      for (var i = Vv, r = rR = Vv = 0; r < i; ) {
        var u = fc[r];
        fc[r++] = null;
        var m = fc[r];
        fc[r++] = null;
        var E = fc[r];
        fc[r++] = null;
        var S = fc[r];
        if (fc[r++] = null, m !== null && E !== null) {
          var O = m.pending;
          O === null ? E.next = E : (E.next = O.next, O.next = E), m.pending = E;
        }
        S !== 0 && lv(u, E, S);
      }
    }
    function Cm(i, r, u, m) {
      fc[Vv++] = i, fc[Vv++] = r, fc[Vv++] = u, fc[Vv++] = m, rR |= m, i.lanes |= m, i = i.alternate, i !== null && (i.lanes |= m);
    }
    function Ad(i, r, u, m) {
      return Cm(i, r, u, m), Om(i);
    }
    function Gr(i, r) {
      return Cm(i, null, null, r), Om(i);
    }
    function lv(i, r, u) {
      i.lanes |= u;
      var m = i.alternate;
      m !== null && (m.lanes |= u);
      for (var E = !1, S = i.return; S !== null; )
        S.childLanes |= u, m = S.alternate, m !== null && (m.childLanes |= u), S.tag === 22 && (i = S.stateNode, i === null || i._visibility & WS || (E = !0)), i = S, S = S.return;
      return i.tag === 3 ? (S = i.stateNode, E && r !== null && (E = 31 - _e(u), i = S.hiddenUpdates, m = i[E], m === null ? i[E] = [r] : m.push(r), r.lane = u | 536870912), S) : null;
    }
    function Om(i) {
      if (ib > OI)
        throw a_ = ib = 0, ab = PR = null, Error(
          "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
        );
      a_ > DI && (a_ = 0, ab = null, console.error(
        "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."
      )), i.alternate === null && (i.flags & 4098) !== 0 && ug(i);
      for (var r = i, u = r.return; u !== null; )
        r.alternate === null && (r.flags & 4098) !== 0 && ug(i), r = u, u = r.return;
      return r.tag === 3 ? r.stateNode : null;
    }
    function _u(i) {
      if (hc === null) return i;
      var r = hc(i);
      return r === void 0 ? i : r.current;
    }
    function th(i) {
      if (hc === null) return i;
      var r = hc(i);
      return r === void 0 ? i != null && typeof i.render == "function" && (r = _u(i.render), i.render !== r) ? (r = { $$typeof: ac, render: r }, i.displayName !== void 0 && (r.displayName = i.displayName), r) : i : r.current;
    }
    function Bc(i, r) {
      if (hc === null) return !1;
      var u = i.elementType;
      r = r.type;
      var m = !1, E = typeof r == "object" && r !== null ? r.$$typeof : null;
      switch (i.tag) {
        case 1:
          typeof r == "function" && (m = !0);
          break;
        case 0:
          (typeof r == "function" || E === ha) && (m = !0);
          break;
        case 11:
          (E === ac || E === ha) && (m = !0);
          break;
        case 14:
        case 15:
          (E === Rp || E === ha) && (m = !0);
          break;
        default:
          return !1;
      }
      return !!(m && (i = hc(u), i !== void 0 && i === hc(r)));
    }
    function Dm(i) {
      hc !== null && typeof WeakSet == "function" && (Yv === null && (Yv = /* @__PURE__ */ new WeakSet()), Yv.add(i));
    }
    function vu(i, r, u) {
      var m = i.alternate, E = i.child, S = i.sibling, O = i.tag, I = i.type, F = null;
      switch (O) {
        case 0:
        case 15:
        case 1:
          F = I;
          break;
        case 11:
          F = I.render;
      }
      if (hc === null)
        throw Error("Expected resolveFamily to be set during hot reload.");
      var K = !1;
      I = !1, F !== null && (F = hc(F), F !== void 0 && (u.has(F) ? I = !0 : r.has(F) && (O === 1 ? I = !0 : K = !0))), Yv !== null && (Yv.has(i) || m !== null && Yv.has(m)) && (I = !0), I && (i._debugNeedsRemount = !0), (I || K) && (m = Gr(i, 2), m !== null && gn(m, i, 2)), E === null || I || vu(
        E,
        r,
        u
      ), S !== null && vu(
        S,
        r,
        u
      );
    }
    function uv(i, r, u, m) {
      this.tag = i, this.key = u, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.refCleanup = this.ref = null, this.pendingProps = r, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = m, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null, this.actualDuration = -0, this.actualStartTime = -1.1, this.treeBaseDuration = this.selfBaseDuration = -0, this._debugTask = this._debugStack = this._debugOwner = this._debugInfo = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, NO || typeof Object.preventExtensions != "function" || Object.preventExtensions(this);
    }
    function eh(i) {
      return i = i.prototype, !(!i || !i.isReactComponent);
    }
    function Ns(i, r) {
      var u = i.alternate;
      switch (u === null ? (u = A(
        i.tag,
        r,
        i.key,
        i.mode
      ), u.elementType = i.elementType, u.type = i.type, u.stateNode = i.stateNode, u._debugOwner = i._debugOwner, u._debugStack = i._debugStack, u._debugTask = i._debugTask, u._debugHookTypes = i._debugHookTypes, u.alternate = i, i.alternate = u) : (u.pendingProps = r, u.type = i.type, u.flags = 0, u.subtreeFlags = 0, u.deletions = null, u.actualDuration = -0, u.actualStartTime = -1.1), u.flags = i.flags & 65011712, u.childLanes = i.childLanes, u.lanes = i.lanes, u.child = i.child, u.memoizedProps = i.memoizedProps, u.memoizedState = i.memoizedState, u.updateQueue = i.updateQueue, r = i.dependencies, u.dependencies = r === null ? null : {
        lanes: r.lanes,
        firstContext: r.firstContext,
        _debugThenableState: r._debugThenableState
      }, u.sibling = i.sibling, u.index = i.index, u.ref = i.ref, u.refCleanup = i.refCleanup, u.selfBaseDuration = i.selfBaseDuration, u.treeBaseDuration = i.treeBaseDuration, u._debugInfo = i._debugInfo, u._debugNeedsRemount = i._debugNeedsRemount, u.tag) {
        case 0:
        case 15:
          u.type = _u(i.type);
          break;
        case 1:
          u.type = _u(i.type);
          break;
        case 11:
          u.type = th(i.type);
      }
      return u;
    }
    function Nm(i, r) {
      i.flags &= 65011714;
      var u = i.alternate;
      return u === null ? (i.childLanes = 0, i.lanes = r, i.child = null, i.subtreeFlags = 0, i.memoizedProps = null, i.memoizedState = null, i.updateQueue = null, i.dependencies = null, i.stateNode = null, i.selfBaseDuration = 0, i.treeBaseDuration = 0) : (i.childLanes = u.childLanes, i.lanes = u.lanes, i.child = u.child, i.subtreeFlags = 0, i.deletions = null, i.memoizedProps = u.memoizedProps, i.memoizedState = u.memoizedState, i.updateQueue = u.updateQueue, i.type = u.type, r = u.dependencies, i.dependencies = r === null ? null : {
        lanes: r.lanes,
        firstContext: r.firstContext,
        _debugThenableState: r._debugThenableState
      }, i.selfBaseDuration = u.selfBaseDuration, i.treeBaseDuration = u.treeBaseDuration), i;
    }
    function Lm(i, r, u, m, E, S) {
      var O = 0, I = i;
      if (typeof i == "function")
        eh(i) && (O = 1), I = _u(I);
      else if (typeof i == "string")
        O = J(), O = vp(i, u, O) ? 26 : i === "html" || i === "head" || i === "body" ? 27 : 5;
      else
        t: switch (i) {
          case Ap:
            return r = A(31, u, r, E), r.elementType = Ap, r.lanes = S, r;
          case ic:
            return Ur(
              u.children,
              E,
              S,
              r
            );
          case Za:
            O = 8, E |= Ks, E |= xf;
            break;
          case wg:
            return i = u, m = E, typeof i.id != "string" && console.error(
              'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
              typeof i.id
            ), r = A(12, i, r, m | bs), r.elementType = wg, r.lanes = S, r.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }, r;
          case ia:
            return r = A(13, u, r, E), r.elementType = ia, r.lanes = S, r;
          case Ci:
            return r = A(19, u, r, E), r.elementType = Ci, r.lanes = S, r;
          default:
            if (typeof i == "object" && i !== null)
              switch (i.$$typeof) {
                case Dv:
                case be:
                  O = 10;
                  break t;
                case vo:
                  O = 9;
                  break t;
                case ac:
                  O = 11, I = th(I);
                  break t;
                case Rp:
                  O = 14;
                  break t;
                case ha:
                  O = 16, I = null;
                  break t;
              }
            I = "", (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (I += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), i === null ? u = "null" : Sa(i) ? u = "array" : i !== void 0 && i.$$typeof === Jl ? (u = "<" + (ot(i.type) || "Unknown") + " />", I = " Did you accidentally export a JSX literal instead of a component?") : u = typeof i, (O = m ? pt(m) : null) && (I += `

Check the render method of \`` + O + "`."), O = 29, u = Error(
              "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (u + "." + I)
            ), I = null;
        }
      return r = A(O, u, r, E), r.elementType = i, r.type = I, r.lanes = S, r._debugOwner = m, r;
    }
    function qc(i, r, u) {
      return r = Lm(
        i.type,
        i.key,
        i.props,
        i._owner,
        r,
        u
      ), r._debugOwner = i._owner, r._debugStack = i._debugStack, r._debugTask = i._debugTask, r;
    }
    function Ur(i, r, u, m) {
      return i = A(7, i, m, r), i.lanes = u, i;
    }
    function B0(i, r, u) {
      return i = A(6, i, null, r), i.lanes = u, i;
    }
    function Im(i, r, u) {
      return r = A(
        4,
        i.children !== null ? i.children : [],
        i.key,
        r
      ), r.lanes = u, r.stateNode = {
        containerInfo: i.containerInfo,
        pendingChildren: null,
        implementation: i.implementation
      }, r;
    }
    function ya(i, r) {
      Ls(), Fv[$v++] = JS, Fv[$v++] = QS, QS = i, JS = r;
    }
    function Md(i, r, u) {
      Ls(), dc[gc++] = Hg, dc[gc++] = Bg, dc[gc++] = Fy, Fy = i;
      var m = Hg;
      i = Bg;
      var E = 32 - _e(m) - 1;
      m &= ~(1 << E), u += 1;
      var S = 32 - _e(r) + E;
      if (30 < S) {
        var O = E - E % 5;
        S = (m & (1 << O) - 1).toString(32), m >>= O, E -= O, Hg = 1 << 32 - _e(r) + E | u << E | m, Bg = S + i;
      } else
        Hg = 1 << S | u << E | m, Bg = i;
    }
    function Eu(i) {
      Ls(), i.return !== null && (ya(i, 1), Md(i, 1, 0));
    }
    function bu(i) {
      for (; i === QS; )
        QS = Fv[--$v], Fv[$v] = null, JS = Fv[--$v], Fv[$v] = null;
      for (; i === Fy; )
        Fy = dc[--gc], dc[gc] = null, Bg = dc[--gc], dc[gc] = null, Hg = dc[--gc], dc[gc] = null;
    }
    function Ls() {
      Yn || console.error(
        "Expected to be hydrating. This is a bug in React. Please file an issue."
      );
    }
    function Vc(i, r) {
      if (i.return === null) {
        if (mc === null)
          mc = {
            fiber: i,
            children: [],
            serverProps: void 0,
            serverTail: [],
            distanceFromLeaf: r
          };
        else {
          if (mc.fiber !== i)
            throw Error(
              "Saw multiple hydration diff roots in a pass. This is a bug in React."
            );
          mc.distanceFromLeaf > r && (mc.distanceFromLeaf = r);
        }
        return mc;
      }
      var u = Vc(
        i.return,
        r + 1
      ).children;
      return 0 < u.length && u[u.length - 1].fiber === i ? (u = u[u.length - 1], u.distanceFromLeaf > r && (u.distanceFromLeaf = r), u) : (r = {
        fiber: i,
        children: [],
        serverProps: void 0,
        serverTail: [],
        distanceFromLeaf: r
      }, u.push(r), r);
    }
    function nh(i, r) {
      qg || (i = Vc(i, 0), i.serverProps = null, r !== null && (r = gp(r), i.serverTail.push(r)));
    }
    function Su(i) {
      var r = "", u = mc;
      throw u !== null && (mc = null, r = pu(u)), xu(
        Ji(
          Error(
            `Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch` + r
          ),
          i
        )
      ), sR;
    }
    function q0(i) {
      var r = i.stateNode, u = i.type, m = i.memoizedProps;
      switch (r[fr] = i, r[es] = m, Fl(u, m), u) {
        case "dialog":
          mn("cancel", r), mn("close", r);
          break;
        case "iframe":
        case "object":
        case "embed":
          mn("load", r);
          break;
        case "video":
        case "audio":
          for (u = 0; u < rb.length; u++)
            mn(rb[u], r);
          break;
        case "source":
          mn("error", r);
          break;
        case "img":
        case "image":
        case "link":
          mn("error", r), mn("load", r);
          break;
        case "details":
          mn("toggle", r);
          break;
        case "input":
          oe("input", m), mn("invalid", r), Lc(r, m), G0(
            r,
            m.value,
            m.defaultValue,
            m.checked,
            m.defaultChecked,
            m.type,
            m.name,
            !0
          ), Qi(r);
          break;
        case "option":
          Q_(r, m);
          break;
        case "select":
          oe("select", m), mn("invalid", r), eo(r, m);
          break;
        case "textarea":
          oe("textarea", m), mn("invalid", r), vd(r, m), Pc(
            r,
            m.value,
            m.defaultValue,
            m.children
          ), Qi(r);
      }
      u = m.children, typeof u != "string" && typeof u != "number" && typeof u != "bigint" || r.textContent === "" + u || m.suppressHydrationWarning === !0 || cf(r.textContent, u) ? (m.popover != null && (mn("beforetoggle", r), mn("toggle", r)), m.onScroll != null && mn("scroll", r), m.onScrollEnd != null && mn("scrollend", r), m.onClick != null && (r.onclick = $u), r = !0) : r = !1, r || Su(i);
    }
    function Pm(i) {
      for (xo = i.return; xo; )
        switch (xo.tag) {
          case 5:
          case 13:
            Kh = !1;
            return;
          case 27:
          case 3:
            Kh = !0;
            return;
          default:
            xo = xo.return;
        }
    }
    function Is(i) {
      if (i !== xo) return !1;
      if (!Yn)
        return Pm(i), Yn = !0, !1;
      var r = i.tag, u;
      if ((u = r !== 3 && r !== 27) && ((u = r === 5) && (u = i.type, u = !(u !== "form" && u !== "button") || Ku(i.type, i.memoizedProps)), u = !u), u && za) {
        for (u = za; u; ) {
          var m = Vc(i, 0), E = gp(u);
          m.serverTail.push(E), u = E.type === "Suspense" ? hf(u) : Jr(u.nextSibling);
        }
        Su(i);
      }
      if (Pm(i), r === 13) {
        if (i = i.memoizedState, i = i !== null ? i.dehydrated : null, !i)
          throw Error(
            "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
          );
        za = hf(i);
      } else
        r === 27 ? (r = za, ba(i.type) ? (i = $R, $R = null, za = i) : za = r) : za = xo ? Jr(i.stateNode.nextSibling) : null;
      return !0;
    }
    function ih() {
      za = xo = null, qg = Yn = !1;
    }
    function V0() {
      var i = $y;
      return i !== null && (Ro === null ? Ro = i : Ro.push.apply(
        Ro,
        i
      ), $y = null), i;
    }
    function xu(i) {
      $y === null ? $y = [i] : $y.push(i);
    }
    function Y0() {
      var i = mc;
      if (i !== null) {
        mc = null;
        for (var r = pu(i); 0 < i.children.length; )
          i = i.children[0];
        de(i.fiber, function() {
          console.error(
            `A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

%s%s`,
            "https://react.dev/link/hydration-mismatch",
            r
          );
        });
      }
    }
    function ro() {
      Xv = tx = null, Kv = !1;
    }
    function so(i, r, u) {
      St(oR, r._currentValue, i), r._currentValue = u, St(lR, r._currentRenderer, i), r._currentRenderer !== void 0 && r._currentRenderer !== null && r._currentRenderer !== zO && console.error(
        "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
      ), r._currentRenderer = zO;
    }
    function Tl(i, r) {
      i._currentValue = oR.current;
      var u = lR.current;
      mt(lR, r), i._currentRenderer = u, mt(oR, r);
    }
    function F0(i, r, u) {
      for (; i !== null; ) {
        var m = i.alternate;
        if ((i.childLanes & r) !== r ? (i.childLanes |= r, m !== null && (m.childLanes |= r)) : m !== null && (m.childLanes & r) !== r && (m.childLanes |= r), i === u) break;
        i = i.return;
      }
      i !== u && console.error(
        "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
      );
    }
    function _r(i, r, u, m) {
      var E = i.child;
      for (E !== null && (E.return = i); E !== null; ) {
        var S = E.dependencies;
        if (S !== null) {
          var O = E.child;
          S = S.firstContext;
          t: for (; S !== null; ) {
            var I = S;
            S = E;
            for (var F = 0; F < r.length; F++)
              if (I.context === r[F]) {
                S.lanes |= u, I = S.alternate, I !== null && (I.lanes |= u), F0(
                  S.return,
                  u,
                  i
                ), m || (O = null);
                break t;
              }
            S = I.next;
          }
        } else if (E.tag === 18) {
          if (O = E.return, O === null)
            throw Error(
              "We just came from a parent so we must have had a parent. This is a bug in React."
            );
          O.lanes |= u, S = O.alternate, S !== null && (S.lanes |= u), F0(
            O,
            u,
            i
          ), O = null;
        } else O = E.child;
        if (O !== null) O.return = E;
        else
          for (O = E; O !== null; ) {
            if (O === i) {
              O = null;
              break;
            }
            if (E = O.sibling, E !== null) {
              E.return = O.return, O = E;
              break;
            }
            O = O.return;
          }
        E = O;
      }
    }
    function jr(i, r, u, m) {
      i = null;
      for (var E = r, S = !1; E !== null; ) {
        if (!S) {
          if ((E.flags & 524288) !== 0) S = !0;
          else if ((E.flags & 262144) !== 0) break;
        }
        if (E.tag === 10) {
          var O = E.alternate;
          if (O === null)
            throw Error("Should have a current fiber. This is a bug in React.");
          if (O = O.memoizedProps, O !== null) {
            var I = E.type;
            Vt(E.pendingProps.value, O.value) || (i !== null ? i.push(I) : i = [I]);
          }
        } else if (E === Mp.current) {
          if (O = E.alternate, O === null)
            throw Error("Should have a current fiber. This is a bug in React.");
          O.memoizedState.memoizedState !== E.memoizedState.memoizedState && (i !== null ? i.push(ub) : i = [ub]);
        }
        E = E.return;
      }
      i !== null && _r(
        r,
        i,
        u,
        m
      ), r.flags |= 262144;
    }
    function vr(i) {
      for (i = i.firstContext; i !== null; ) {
        if (!Vt(
          i.context._currentValue,
          i.memoizedValue
        ))
          return !0;
        i = i.next;
      }
      return !1;
    }
    function wl(i) {
      tx = i, Xv = null, i = i.dependencies, i !== null && (i.firstContext = null);
    }
    function xi(i) {
      return Kv && console.error(
        "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
      ), zm(tx, i);
    }
    function Cd(i, r) {
      return tx === null && wl(i), zm(i, r);
    }
    function zm(i, r) {
      var u = r._currentValue;
      if (r = { context: r, memoizedValue: u, next: null }, Xv === null) {
        if (i === null)
          throw Error(
            "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
          );
        Xv = r, i.dependencies = {
          lanes: 0,
          firstContext: r,
          _debugThenableState: null
        }, i.flags |= 524288;
      } else Xv = Xv.next = r;
      return u;
    }
    function $0() {
      return {
        controller: new mI(),
        data: /* @__PURE__ */ new Map(),
        refCount: 0
      };
    }
    function Ps(i) {
      i.controller.signal.aborted && console.warn(
        "A cache instance was retained after it was already freed. This likely indicates a bug in React."
      ), i.refCount++;
    }
    function zs(i) {
      i.refCount--, 0 > i.refCount && console.warn(
        "A cache instance was released after it was already freed. This likely indicates a bug in React."
      ), i.refCount === 0 && pI(yI, function() {
        i.controller.abort();
      });
    }
    function ft() {
      var i = Xy;
      return Xy = 0, i;
    }
    function Pt(i) {
      var r = Xy;
      return Xy = i, r;
    }
    function Mt(i) {
      var r = Xy;
      return Xy += i, r;
    }
    function ae(i) {
      il = Zv(), 0 > i.actualStartTime && (i.actualStartTime = il);
    }
    function Me(i) {
      if (0 <= il) {
        var r = Zv() - il;
        i.actualDuration += r, i.selfBaseDuration = r, il = -1;
      }
    }
    function wn(i) {
      if (0 <= il) {
        var r = Zv() - il;
        i.actualDuration += r, il = -1;
      }
    }
    function Kn() {
      if (0 <= il) {
        var i = Zv() - il;
        il = -1, Xy += i;
      }
    }
    function Xe() {
      il = Zv();
    }
    function Yc(i) {
      for (var r = i.child; r; )
        i.actualDuration += r.actualDuration, r = r.sibling;
    }
    function cv(i, r) {
      if (zE === null) {
        var u = zE = [];
        uR = 0, Ky = hp(), Wv = {
          status: "pending",
          value: void 0,
          then: function(m) {
            u.push(m);
          }
        };
      }
      return uR++, r.then(kr, kr), r;
    }
    function kr() {
      if (--uR === 0 && zE !== null) {
        Wv !== null && (Wv.status = "fulfilled");
        var i = zE;
        zE = null, Ky = 0, Wv = null;
        for (var r = 0; r < i.length; r++) (0, i[r])();
      }
    }
    function Gm(i, r) {
      var u = [], m = {
        status: "pending",
        value: null,
        reason: null,
        then: function(E) {
          u.push(E);
        }
      };
      return i.then(
        function() {
          m.status = "fulfilled", m.value = r;
          for (var E = 0; E < u.length; E++) (0, u[E])(r);
        },
        function(E) {
          for (m.status = "rejected", m.reason = E, E = 0; E < u.length; E++)
            (0, u[E])(void 0);
        }
      ), m;
    }
    function X0() {
      var i = Zy.current;
      return i !== null ? i : Li.pooledCache;
    }
    function Rl(i, r) {
      r === null ? St(Zy, Zy.current, i) : St(Zy, r.pool, i);
    }
    function ah() {
      var i = X0();
      return i === null ? null : { parent: Cr._currentValue, pool: i };
    }
    function rh() {
      return { didWarnAboutUncachedPromise: !1, thenables: [] };
    }
    function Nn(i) {
      return i = i.status, i === "fulfilled" || i === "rejected";
    }
    function Hr() {
    }
    function Um(i, r, u) {
      Tt.actQueue !== null && (Tt.didUsePromise = !0);
      var m = i.thenables;
      switch (u = m[u], u === void 0 ? m.push(r) : u !== r && (i.didWarnAboutUncachedPromise || (i.didWarnAboutUncachedPromise = !0, console.error(
        "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
      )), r.then(Hr, Hr), r = u), r.status) {
        case "fulfilled":
          return r.value;
        case "rejected":
          throw i = r.reason, hs(i), i;
        default:
          if (typeof r.status == "string")
            r.then(Hr, Hr);
          else {
            if (i = Li, i !== null && 100 < i.shellSuspendCounter)
              throw Error(
                "An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
              );
            i = r, i.status = "pending", i.then(
              function(E) {
                if (r.status === "pending") {
                  var S = r;
                  S.status = "fulfilled", S.value = E;
                }
              },
              function(E) {
                if (r.status === "pending") {
                  var S = r;
                  S.status = "rejected", S.reason = E;
                }
              }
            );
          }
          switch (r.status) {
            case "fulfilled":
              return r.value;
            case "rejected":
              throw i = r.reason, hs(i), i;
          }
          throw VE = r, sx = !0, qE;
      }
    }
    function sr() {
      if (VE === null)
        throw Error(
          "Expected a suspended thenable. This is a bug in React. Please file an issue."
        );
      var i = VE;
      return VE = null, sx = !1, i;
    }
    function hs(i) {
      if (i === qE || i === rx)
        throw Error(
          "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
        );
    }
    function Tu(i) {
      i.updateQueue = {
        baseState: i.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: { pending: null, lanes: 0, hiddenCallbacks: null },
        callbacks: null
      };
    }
    function Od(i, r) {
      i = i.updateQueue, r.updateQueue === i && (r.updateQueue = {
        baseState: i.baseState,
        firstBaseUpdate: i.firstBaseUpdate,
        lastBaseUpdate: i.lastBaseUpdate,
        shared: i.shared,
        callbacks: null
      });
    }
    function Br(i) {
      return {
        lane: i,
        tag: HO,
        payload: null,
        callback: null,
        next: null
      };
    }
    function Aa(i, r, u) {
      var m = i.updateQueue;
      if (m === null) return null;
      if (m = m.shared, hR === m && !VO) {
        var E = ht(i);
        console.error(
          `An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Please update the following component: %s`,
          E
        ), VO = !0;
      }
      return (ui & wo) !== su ? (E = m.pending, E === null ? r.next = r : (r.next = E.next, E.next = r), m.pending = r, r = Om(i), lv(i, null, u), r) : (Cm(i, m, r, u), Om(i));
    }
    function zo(i, r, u) {
      if (r = r.updateQueue, r !== null && (r = r.shared, (u & 4194048) !== 0)) {
        var m = r.lanes;
        m &= i.pendingLanes, u |= m, r.lanes = u, ti(i, u);
      }
    }
    function Go(i, r) {
      var u = i.updateQueue, m = i.alternate;
      if (m !== null && (m = m.updateQueue, u === m)) {
        var E = null, S = null;
        if (u = u.firstBaseUpdate, u !== null) {
          do {
            var O = {
              lane: u.lane,
              tag: u.tag,
              payload: u.payload,
              callback: null,
              next: null
            };
            S === null ? E = S = O : S = S.next = O, u = u.next;
          } while (u !== null);
          S === null ? E = S = r : S = S.next = r;
        } else E = S = r;
        u = {
          baseState: m.baseState,
          firstBaseUpdate: E,
          lastBaseUpdate: S,
          shared: m.shared,
          callbacks: m.callbacks
        }, i.updateQueue = u;
        return;
      }
      i = u.lastBaseUpdate, i === null ? u.firstBaseUpdate = r : i.next = r, u.lastBaseUpdate = r;
    }
    function Al() {
      if (dR) {
        var i = Wv;
        if (i !== null) throw i;
      }
    }
    function Ml(i, r, u, m) {
      dR = !1;
      var E = i.updateQueue;
      qp = !1, hR = E.shared;
      var S = E.firstBaseUpdate, O = E.lastBaseUpdate, I = E.shared.pending;
      if (I !== null) {
        E.shared.pending = null;
        var F = I, K = F.next;
        F.next = null, O === null ? S = K : O.next = K, O = F;
        var Rt = i.alternate;
        Rt !== null && (Rt = Rt.updateQueue, I = Rt.lastBaseUpdate, I !== O && (I === null ? Rt.firstBaseUpdate = K : I.next = K, Rt.lastBaseUpdate = F));
      }
      if (S !== null) {
        var Lt = E.baseState;
        O = 0, Rt = K = F = null, I = S;
        do {
          var wt = I.lane & -536870913, zt = wt !== I.lane;
          if (zt ? (An & wt) === wt : (m & wt) === wt) {
            wt !== 0 && wt === Ky && (dR = !0), Rt !== null && (Rt = Rt.next = {
              lane: 0,
              tag: I.tag,
              payload: I.payload,
              callback: null,
              next: null
            });
            t: {
              wt = i;
              var ge = I, ke = r, Ii = u;
              switch (ge.tag) {
                case BO:
                  if (ge = ge.payload, typeof ge == "function") {
                    Kv = !0;
                    var On = ge.call(
                      Ii,
                      Lt,
                      ke
                    );
                    if (wt.mode & Ks) {
                      $t(!0);
                      try {
                        ge.call(Ii, Lt, ke);
                      } finally {
                        $t(!1);
                      }
                    }
                    Kv = !1, Lt = On;
                    break t;
                  }
                  Lt = ge;
                  break t;
                case fR:
                  wt.flags = wt.flags & -65537 | 128;
                case HO:
                  if (On = ge.payload, typeof On == "function") {
                    if (Kv = !0, ge = On.call(
                      Ii,
                      Lt,
                      ke
                    ), wt.mode & Ks) {
                      $t(!0);
                      try {
                        On.call(Ii, Lt, ke);
                      } finally {
                        $t(!1);
                      }
                    }
                    Kv = !1;
                  } else ge = On;
                  if (ge == null) break t;
                  Lt = He({}, Lt, ge);
                  break t;
                case qO:
                  qp = !0;
              }
            }
            wt = I.callback, wt !== null && (i.flags |= 64, zt && (i.flags |= 8192), zt = E.callbacks, zt === null ? E.callbacks = [wt] : zt.push(wt));
          } else
            zt = {
              lane: wt,
              tag: I.tag,
              payload: I.payload,
              callback: I.callback,
              next: null
            }, Rt === null ? (K = Rt = zt, F = Lt) : Rt = Rt.next = zt, O |= wt;
          if (I = I.next, I === null) {
            if (I = E.shared.pending, I === null)
              break;
            zt = I, I = zt.next, zt.next = null, E.lastBaseUpdate = zt, E.shared.pending = null;
          }
        } while (!0);
        Rt === null && (F = Lt), E.baseState = F, E.firstBaseUpdate = K, E.lastBaseUpdate = Rt, S === null && (E.shared.lanes = 0), $p |= O, i.lanes = O, i.memoizedState = Lt;
      }
      hR = null;
    }
    function wu(i, r) {
      if (typeof i != "function")
        throw Error(
          "Invalid argument passed as callback. Expected a function. Instead received: " + i
        );
      i.call(r);
    }
    function jm(i, r) {
      var u = i.shared.hiddenCallbacks;
      if (u !== null)
        for (i.shared.hiddenCallbacks = null, i = 0; i < u.length; i++)
          wu(u[i], r);
    }
    function Er(i, r) {
      var u = i.callbacks;
      if (u !== null)
        for (i.callbacks = null, i = 0; i < u.length; i++)
          wu(u[i], r);
    }
    function Ru(i, r) {
      var u = Qh;
      St(ox, u, i), St(Qv, r, i), Qh = u | r.baseLanes;
    }
    function Va(i) {
      St(ox, Qh, i), St(
        Qv,
        Qv.current,
        i
      );
    }
    function Fc(i) {
      Qh = ox.current, mt(Qv, i), mt(ox, i);
    }
    function en() {
      var i = Nt;
      _c === null ? _c = [i] : _c.push(i);
    }
    function Xt() {
      var i = Nt;
      if (_c !== null && (Yg++, _c[Yg] !== i)) {
        var r = ht(Qe);
        if (!YO.has(r) && (YO.add(r), _c !== null)) {
          for (var u = "", m = 0; m <= Yg; m++) {
            var E = _c[m], S = m === Yg ? i : E;
            for (E = m + 1 + ". " + E; 30 > E.length; )
              E += " ";
            E += S + `
`, u += E;
          }
          console.error(
            `React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`,
            r,
            u
          );
        }
      }
    }
    function Au(i) {
      i == null || Sa(i) || console.error(
        "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
        Nt,
        typeof i
      );
    }
    function Cl() {
      var i = ht(Qe);
      $O.has(i) || ($O.add(i), console.error(
        "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
        i
      ));
    }
    function Zn() {
      throw Error(
        `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
      );
    }
    function Uo(i, r) {
      if (FE) return !1;
      if (r === null)
        return console.error(
          "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
          Nt
        ), !1;
      i.length !== r.length && console.error(
        `The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`,
        Nt,
        "[" + r.join(", ") + "]",
        "[" + i.join(", ") + "]"
      );
      for (var u = 0; u < r.length && u < i.length; u++)
        if (!Vt(i[u], r[u])) return !1;
      return !0;
    }
    function sh(i, r, u, m, E, S) {
      Vp = S, Qe = r, _c = i !== null ? i._debugHookTypes : null, Yg = -1, FE = i !== null && i.type !== r.type, (Object.prototype.toString.call(u) === "[object AsyncFunction]" || Object.prototype.toString.call(u) === "[object AsyncGeneratorFunction]") && (S = ht(Qe), gR.has(S) || (gR.add(S), console.error(
        "%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",
        S === null ? "An unknown Component" : "<" + S + ">"
      ))), r.memoizedState = null, r.updateQueue = null, r.lanes = 0, Tt.H = i !== null && i.memoizedState !== null ? pR : _c !== null ? XO : mR, Qy = S = (r.mode & Ks) !== Vi;
      var O = yR(u, m, E);
      if (Qy = !1, t1 && (O = qr(
        r,
        u,
        m,
        E
      )), S) {
        $t(!0);
        try {
          O = qr(
            r,
            u,
            m,
            E
          );
        } finally {
          $t(!1);
        }
      }
      return oh(i, r), O;
    }
    function oh(i, r) {
      r._debugHookTypes = _c, r.dependencies === null ? Vg !== null && (r.dependencies = {
        lanes: 0,
        firstContext: null,
        _debugThenableState: Vg
      }) : r.dependencies._debugThenableState = Vg, Tt.H = cx;
      var u = Oi !== null && Oi.next !== null;
      if (Vp = 0, _c = Nt = hr = Oi = Qe = null, Yg = -1, i !== null && (i.flags & 65011712) !== (r.flags & 65011712) && console.error(
        "Internal React error: Expected static flag was missing. Please notify the React team."
      ), lx = !1, YE = 0, Vg = null, u)
        throw Error(
          "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
        );
      i === null || is || (i = i.dependencies, i !== null && vr(i) && (is = !0)), sx ? (sx = !1, i = !0) : i = !1, i && (r = ht(r) || "Unknown", FO.has(r) || gR.has(r) || (FO.add(r), console.error(
        "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
      )));
    }
    function qr(i, r, u, m) {
      Qe = i;
      var E = 0;
      do {
        if (t1 && (Vg = null), YE = 0, t1 = !1, E >= vI)
          throw Error(
            "Too many re-renders. React limits the number of renders to prevent an infinite loop."
          );
        if (E += 1, FE = !1, hr = Oi = null, i.updateQueue != null) {
          var S = i.updateQueue;
          S.lastEffect = null, S.events = null, S.stores = null, S.memoCache != null && (S.memoCache.index = 0);
        }
        Yg = -1, Tt.H = KO, S = yR(r, u, m);
      } while (t1);
      return S;
    }
    function Gs() {
      var i = Tt.H, r = i.useState()[0];
      return r = typeof r.then == "function" ? Ol(r) : r, i = i.useState()[0], (Oi !== null ? Oi.memoizedState : null) !== i && (Qe.flags |= 1024), r;
    }
    function oi() {
      var i = ux !== 0;
      return ux = 0, i;
    }
    function fi(i, r, u) {
      r.updateQueue = i.updateQueue, r.flags = (r.mode & xf) !== Vi ? r.flags & -402655237 : r.flags & -2053, i.lanes &= ~u;
    }
    function oo(i) {
      if (lx) {
        for (i = i.memoizedState; i !== null; ) {
          var r = i.queue;
          r !== null && (r.pending = null), i = i.next;
        }
        lx = !1;
      }
      Vp = 0, _c = hr = Oi = Qe = null, Yg = -1, Nt = null, t1 = !1, YE = ux = 0, Vg = null;
    }
    function la() {
      var i = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      return hr === null ? Qe.memoizedState = hr = i : hr = hr.next = i, hr;
    }
    function zn() {
      if (Oi === null) {
        var i = Qe.alternate;
        i = i !== null ? i.memoizedState : null;
      } else i = Oi.next;
      var r = hr === null ? Qe.memoizedState : hr.next;
      if (r !== null)
        hr = r, Oi = i;
      else {
        if (i === null)
          throw Qe.alternate === null ? Error(
            "Update hook called on initial render. This is likely a bug in React. Please file an issue."
          ) : Error("Rendered more hooks than during the previous render.");
        Oi = i, i = {
          memoizedState: Oi.memoizedState,
          baseState: Oi.baseState,
          baseQueue: Oi.baseQueue,
          queue: Oi.queue,
          next: null
        }, hr === null ? Qe.memoizedState = hr = i : hr = hr.next = i;
      }
      return hr;
    }
    function Dd() {
      return { lastEffect: null, events: null, stores: null, memoCache: null };
    }
    function Ol(i) {
      var r = YE;
      return YE += 1, Vg === null && (Vg = rh()), i = Um(Vg, i, r), r = Qe, (hr === null ? r.memoizedState : hr.next) === null && (r = r.alternate, Tt.H = r !== null && r.memoizedState !== null ? pR : mR), i;
    }
    function hi(i) {
      if (i !== null && typeof i == "object") {
        if (typeof i.then == "function") return Ol(i);
        if (i.$$typeof === be) return xi(i);
      }
      throw Error("An unsupported type was passed to use(): " + String(i));
    }
    function Bn(i) {
      var r = null, u = Qe.updateQueue;
      if (u !== null && (r = u.memoCache), r == null) {
        var m = Qe.alternate;
        m !== null && (m = m.updateQueue, m !== null && (m = m.memoCache, m != null && (r = {
          data: m.data.map(function(E) {
            return E.slice();
          }),
          index: 0
        })));
      }
      if (r == null && (r = { data: [], index: 0 }), u === null && (u = Dd(), Qe.updateQueue = u), u.memoCache = r, u = r.data[r.index], u === void 0 || FE)
        for (u = r.data[r.index] = Array(i), m = 0; m < i; m++)
          u[m] = Nv;
      else
        u.length !== i && console.error(
          "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
          u.length,
          i
        );
      return r.index++, u;
    }
    function je(i, r) {
      return typeof r == "function" ? r(i) : r;
    }
    function ds(i, r, u) {
      var m = la();
      if (u !== void 0) {
        var E = u(r);
        if (Qy) {
          $t(!0);
          try {
            u(r);
          } finally {
            $t(!1);
          }
        }
      } else E = r;
      return m.memoizedState = m.baseState = E, i = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: i,
        lastRenderedState: E
      }, m.queue = i, i = i.dispatch = uo.bind(
        null,
        Qe,
        i
      ), [m.memoizedState, i];
    }
    function _a(i) {
      var r = zn();
      return Mu(r, Oi, i);
    }
    function Mu(i, r, u) {
      var m = i.queue;
      if (m === null)
        throw Error(
          "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
        );
      m.lastRenderedReducer = u;
      var E = i.baseQueue, S = m.pending;
      if (S !== null) {
        if (E !== null) {
          var O = E.next;
          E.next = S.next, S.next = O;
        }
        r.baseQueue !== E && console.error(
          "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
        ), r.baseQueue = E = S, m.pending = null;
      }
      if (S = i.baseState, E === null) i.memoizedState = S;
      else {
        r = E.next;
        var I = O = null, F = null, K = r, Rt = !1;
        do {
          var Lt = K.lane & -536870913;
          if (Lt !== K.lane ? (An & Lt) === Lt : (Vp & Lt) === Lt) {
            var wt = K.revertLane;
            if (wt === 0)
              F !== null && (F = F.next = {
                lane: 0,
                revertLane: 0,
                action: K.action,
                hasEagerState: K.hasEagerState,
                eagerState: K.eagerState,
                next: null
              }), Lt === Ky && (Rt = !0);
            else if ((Vp & wt) === wt) {
              K = K.next, wt === Ky && (Rt = !0);
              continue;
            } else
              Lt = {
                lane: 0,
                revertLane: K.revertLane,
                action: K.action,
                hasEagerState: K.hasEagerState,
                eagerState: K.eagerState,
                next: null
              }, F === null ? (I = F = Lt, O = S) : F = F.next = Lt, Qe.lanes |= wt, $p |= wt;
            Lt = K.action, Qy && u(S, Lt), S = K.hasEagerState ? K.eagerState : u(S, Lt);
          } else
            wt = {
              lane: Lt,
              revertLane: K.revertLane,
              action: K.action,
              hasEagerState: K.hasEagerState,
              eagerState: K.eagerState,
              next: null
            }, F === null ? (I = F = wt, O = S) : F = F.next = wt, Qe.lanes |= Lt, $p |= Lt;
          K = K.next;
        } while (K !== null && K !== r);
        if (F === null ? O = S : F.next = I, !Vt(S, i.memoizedState) && (is = !0, Rt && (u = Wv, u !== null)))
          throw u;
        i.memoizedState = S, i.baseState = O, i.baseQueue = F, m.lastRenderedState = S;
      }
      return E === null && (m.lanes = 0), [i.memoizedState, m.dispatch];
    }
    function or(i) {
      var r = zn(), u = r.queue;
      if (u === null)
        throw Error(
          "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
        );
      u.lastRenderedReducer = i;
      var m = u.dispatch, E = u.pending, S = r.memoizedState;
      if (E !== null) {
        u.pending = null;
        var O = E = E.next;
        do
          S = i(S, O.action), O = O.next;
        while (O !== E);
        Vt(S, r.memoizedState) || (is = !0), r.memoizedState = S, r.baseQueue === null && (r.baseState = S), u.lastRenderedState = S;
      }
      return [S, m];
    }
    function km(i, r, u) {
      var m = Qe, E = la();
      if (Yn) {
        if (u === void 0)
          throw Error(
            "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
          );
        var S = u();
        Jv || S === u() || (console.error(
          "The result of getServerSnapshot should be cached to avoid an infinite loop"
        ), Jv = !0);
      } else {
        if (S = r(), Jv || (u = r(), Vt(S, u) || (console.error(
          "The result of getSnapshot should be cached to avoid an infinite loop"
        ), Jv = !0)), Li === null)
          throw Error(
            "Expected a work-in-progress root. This is a bug in React. Please file an issue."
          );
        (An & 124) !== 0 || lh(m, r, S);
      }
      return E.memoizedState = S, u = { value: S, getSnapshot: r }, E.queue = u, Pd(
        K0.bind(null, m, u, i),
        [i]
      ), m.flags |= 2048, ko(
        yc | Or,
        hh(),
        uh.bind(
          null,
          m,
          u,
          S,
          r
        ),
        null
      ), S;
    }
    function Nd(i, r, u) {
      var m = Qe, E = zn(), S = Yn;
      if (S) {
        if (u === void 0)
          throw Error(
            "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
          );
        u = u();
      } else if (u = r(), !Jv) {
        var O = r();
        Vt(u, O) || (console.error(
          "The result of getSnapshot should be cached to avoid an infinite loop"
        ), Jv = !0);
      }
      (O = !Vt(
        (Oi || E).memoizedState,
        u
      )) && (E.memoizedState = u, is = !0), E = E.queue;
      var I = K0.bind(null, m, E, i);
      if (Vr(2048, Or, I, [i]), E.getSnapshot !== r || O || hr !== null && hr.memoizedState.tag & yc) {
        if (m.flags |= 2048, ko(
          yc | Or,
          hh(),
          uh.bind(
            null,
            m,
            E,
            u,
            r
          ),
          null
        ), Li === null)
          throw Error(
            "Expected a work-in-progress root. This is a bug in React. Please file an issue."
          );
        S || (Vp & 124) !== 0 || lh(m, r, u);
      }
      return u;
    }
    function lh(i, r, u) {
      i.flags |= 16384, i = { getSnapshot: r, value: u }, r = Qe.updateQueue, r === null ? (r = Dd(), Qe.updateQueue = r, r.stores = [i]) : (u = r.stores, u === null ? r.stores = [i] : u.push(i));
    }
    function uh(i, r, u, m) {
      r.value = u, r.getSnapshot = m, Dl(r) && Cu(i);
    }
    function K0(i, r, u) {
      return u(function() {
        Dl(r) && Cu(i);
      });
    }
    function Dl(i) {
      var r = i.getSnapshot;
      i = i.value;
      try {
        var u = r();
        return !Vt(i, u);
      } catch {
        return !0;
      }
    }
    function Cu(i) {
      var r = Gr(i, 2);
      r !== null && gn(r, i, 2);
    }
    function jo(i) {
      var r = la();
      if (typeof i == "function") {
        var u = i;
        if (i = u(), Qy) {
          $t(!0);
          try {
            u();
          } finally {
            $t(!1);
          }
        }
      }
      return r.memoizedState = r.baseState = i, r.queue = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: je,
        lastRenderedState: i
      }, r;
    }
    function V(i) {
      i = jo(i);
      var r = i.queue, u = Fa.bind(null, Qe, r);
      return r.dispatch = u, [i.memoizedState, u];
    }
    function br(i) {
      var r = la();
      r.memoizedState = r.baseState = i;
      var u = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: null,
        lastRenderedState: null
      };
      return r.queue = u, r = jd.bind(
        null,
        Qe,
        !0,
        u
      ), u.dispatch = r, [i, r];
    }
    function gs(i, r) {
      var u = zn();
      return Sr(u, Oi, i, r);
    }
    function Sr(i, r, u, m) {
      return i.baseState = u, Mu(
        i,
        Oi,
        typeof m == "function" ? m : je
      );
    }
    function fn(i, r) {
      var u = zn();
      return Oi !== null ? Sr(u, Oi, i, r) : (u.baseState = i, [i, u.queue.dispatch]);
    }
    function Ld(i, r, u, m, E) {
      if (Ho(i))
        throw Error("Cannot update form state while rendering.");
      if (i = r.action, i !== null) {
        var S = {
          payload: E,
          action: i,
          next: null,
          isTransition: !0,
          status: "pending",
          value: null,
          reason: null,
          listeners: [],
          then: function(O) {
            S.listeners.push(O);
          }
        };
        Tt.T !== null ? u(!0) : S.isTransition = !1, m(S), u = r.pending, u === null ? (S.next = r.pending = S, Id(r, S)) : (S.next = u.next, r.pending = u.next = S);
      }
    }
    function Id(i, r) {
      var u = r.action, m = r.payload, E = i.state;
      if (r.isTransition) {
        var S = Tt.T, O = {};
        Tt.T = O, Tt.T._updatedFibers = /* @__PURE__ */ new Set();
        try {
          var I = u(E, m), F = Tt.S;
          F !== null && F(O, I), Ou(i, r, I);
        } catch (K) {
          ch(i, r, K);
        } finally {
          Tt.T = S, S === null && O._updatedFibers && (i = O._updatedFibers.size, O._updatedFibers.clear(), 10 < i && console.warn(
            "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
          ));
        }
      } else
        try {
          O = u(E, m), Ou(i, r, O);
        } catch (K) {
          ch(i, r, K);
        }
    }
    function Ou(i, r, u) {
      u !== null && typeof u == "object" && typeof u.then == "function" ? (u.then(
        function(m) {
          Di(i, r, m);
        },
        function(m) {
          return ch(i, r, m);
        }
      ), r.isTransition || console.error(
        "An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop."
      )) : Di(i, r, u);
    }
    function Di(i, r, u) {
      r.status = "fulfilled", r.value = u, Z0(r), i.state = u, r = i.pending, r !== null && (u = r.next, u === r ? i.pending = null : (u = u.next, r.next = u, Id(i, u)));
    }
    function ch(i, r, u) {
      var m = i.pending;
      if (i.pending = null, m !== null) {
        m = m.next;
        do
          r.status = "rejected", r.reason = u, Z0(r), r = r.next;
        while (r !== m);
      }
      i.action = null;
    }
    function Z0(i) {
      i = i.listeners;
      for (var r = 0; r < i.length; r++) (0, i[r])();
    }
    function fv(i, r) {
      return r;
    }
    function fh(i, r) {
      if (Yn) {
        var u = Li.formState;
        if (u !== null) {
          t: {
            var m = Qe;
            if (Yn) {
              if (za) {
                e: {
                  for (var E = za, S = Kh; E.nodeType !== 8; ) {
                    if (!S) {
                      E = null;
                      break e;
                    }
                    if (E = Jr(
                      E.nextSibling
                    ), E === null) {
                      E = null;
                      break e;
                    }
                  }
                  S = E.data, E = S === qR || S === $4 ? E : null;
                }
                if (E) {
                  za = Jr(
                    E.nextSibling
                  ), m = E.data === qR;
                  break t;
                }
              }
              Su(m);
            }
            m = !1;
          }
          m && (r = u[0]);
        }
      }
      return u = la(), u.memoizedState = u.baseState = r, m = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: fv,
        lastRenderedState: r
      }, u.queue = m, u = Fa.bind(
        null,
        Qe,
        m
      ), m.dispatch = u, m = jo(!1), S = jd.bind(
        null,
        Qe,
        !1,
        m.queue
      ), m = la(), E = {
        state: r,
        dispatch: null,
        action: i,
        pending: null
      }, m.queue = E, u = Ld.bind(
        null,
        Qe,
        E,
        S,
        u
      ), E.dispatch = u, m.memoizedState = i, [r, u, !1];
    }
    function Hm(i) {
      var r = zn();
      return ei(r, Oi, i);
    }
    function ei(i, r, u) {
      if (r = Mu(
        i,
        r,
        fv
      )[0], i = _a(je)[0], typeof r == "object" && r !== null && typeof r.then == "function")
        try {
          var m = Ol(r);
        } catch (O) {
          throw O === qE ? rx : O;
        }
      else m = r;
      r = zn();
      var E = r.queue, S = E.dispatch;
      return u !== r.memoizedState && (Qe.flags |= 2048, ko(
        yc | Or,
        hh(),
        W0.bind(null, E, u),
        null
      )), [m, S, i];
    }
    function W0(i, r) {
      i.action = r;
    }
    function Du(i) {
      var r = zn(), u = Oi;
      if (u !== null)
        return ei(r, u, i);
      zn(), r = r.memoizedState, u = zn();
      var m = u.queue.dispatch;
      return u.memoizedState = i, [r, m, !1];
    }
    function ko(i, r, u, m) {
      return i = {
        tag: i,
        create: u,
        deps: m,
        inst: r,
        next: null
      }, r = Qe.updateQueue, r === null && (r = Dd(), Qe.updateQueue = r), u = r.lastEffect, u === null ? r.lastEffect = i.next = i : (m = u.next, u.next = i, i.next = m, r.lastEffect = i), i;
    }
    function hh() {
      return { destroy: void 0, resource: void 0 };
    }
    function Nu(i) {
      var r = la();
      return i = { current: i }, r.memoizedState = i;
    }
    function ua(i, r, u, m) {
      var E = la();
      m = m === void 0 ? null : m, Qe.flags |= i, E.memoizedState = ko(
        yc | r,
        hh(),
        u,
        m
      );
    }
    function Vr(i, r, u, m) {
      var E = zn();
      m = m === void 0 ? null : m;
      var S = E.memoizedState.inst;
      Oi !== null && m !== null && Uo(m, Oi.memoizedState.deps) ? E.memoizedState = ko(r, S, u, m) : (Qe.flags |= i, E.memoizedState = ko(
        yc | r,
        S,
        u,
        m
      ));
    }
    function Pd(i, r) {
      (Qe.mode & xf) !== Vi && (Qe.mode & DO) === Vi ? ua(276826112, Or, i, r) : ua(8390656, Or, i, r);
    }
    function Q0(i, r) {
      var u = 4194308;
      return (Qe.mode & xf) !== Vi && (u |= 134217728), ua(u, Ss, i, r);
    }
    function J0(i, r) {
      if (typeof r == "function") {
        i = i();
        var u = r(i);
        return function() {
          typeof u == "function" ? u() : r(null);
        };
      }
      if (r != null)
        return r.hasOwnProperty("current") || console.error(
          "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
          "an object with keys {" + Object.keys(r).join(", ") + "}"
        ), i = i(), r.current = i, function() {
          r.current = null;
        };
    }
    function Nl(i, r, u) {
      typeof r != "function" && console.error(
        "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
        r !== null ? typeof r : "null"
      ), u = u != null ? u.concat([i]) : null;
      var m = 4194308;
      (Qe.mode & xf) !== Vi && (m |= 134217728), ua(
        m,
        Ss,
        J0.bind(null, r, i),
        u
      );
    }
    function Us(i, r, u) {
      typeof r != "function" && console.error(
        "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
        r !== null ? typeof r : "null"
      ), u = u != null ? u.concat([i]) : null, Vr(
        4,
        Ss,
        J0.bind(null, r, i),
        u
      );
    }
    function dh(i, r) {
      return la().memoizedState = [
        i,
        r === void 0 ? null : r
      ], i;
    }
    function zd(i, r) {
      var u = zn();
      r = r === void 0 ? null : r;
      var m = u.memoizedState;
      return r !== null && Uo(r, m[1]) ? m[0] : (u.memoizedState = [i, r], i);
    }
    function Ya(i, r) {
      var u = la();
      r = r === void 0 ? null : r;
      var m = i();
      if (Qy) {
        $t(!0);
        try {
          i();
        } finally {
          $t(!1);
        }
      }
      return u.memoizedState = [m, r], m;
    }
    function Gd(i, r) {
      var u = zn();
      r = r === void 0 ? null : r;
      var m = u.memoizedState;
      if (r !== null && Uo(r, m[1]))
        return m[0];
      if (m = i(), Qy) {
        $t(!0);
        try {
          i();
        } finally {
          $t(!1);
        }
      }
      return u.memoizedState = [m, r], m;
    }
    function gh(i, r) {
      var u = la();
      return mh(u, i, r);
    }
    function Bm(i, r) {
      var u = zn();
      return qm(
        u,
        Oi.memoizedState,
        i,
        r
      );
    }
    function ty(i, r) {
      var u = zn();
      return Oi === null ? mh(u, i, r) : qm(
        u,
        Oi.memoizedState,
        i,
        r
      );
    }
    function mh(i, r, u) {
      return u === void 0 || (Vp & 1073741824) !== 0 ? i.memoizedState = r : (i.memoizedState = u, i = gy(), Qe.lanes |= i, $p |= i, u);
    }
    function qm(i, r, u, m) {
      return Vt(u, r) ? u : Qv.current !== null ? (i = mh(i, u, m), Vt(i, r) || (is = !0), i) : (Vp & 42) === 0 ? (is = !0, i.memoizedState = u) : (i = gy(), Qe.lanes |= i, $p |= i, r);
    }
    function $c(i, r, u, m, E) {
      var S = Un.p;
      Un.p = S !== 0 && S < Wo ? S : Wo;
      var O = Tt.T, I = {};
      Tt.T = I, jd(i, !1, r, u), I._updatedFibers = /* @__PURE__ */ new Set();
      try {
        var F = E(), K = Tt.S;
        if (K !== null && K(I, F), F !== null && typeof F == "object" && typeof F.then == "function") {
          var Rt = Gm(
            F,
            m
          );
          ph(
            i,
            r,
            Rt,
            Xr(i)
          );
        } else
          ph(
            i,
            r,
            m,
            Xr(i)
          );
      } catch (Lt) {
        ph(
          i,
          r,
          { then: function() {
          }, status: "rejected", reason: Lt },
          Xr(i)
        );
      } finally {
        Un.p = S, Tt.T = O, O === null && I._updatedFibers && (i = I._updatedFibers.size, I._updatedFibers.clear(), 10 < i && console.warn(
          "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
        ));
      }
    }
    function Vm(i, r, u, m) {
      if (i.tag !== 5)
        throw Error(
          "Expected the form instance to be a HostComponent. This is a bug in React."
        );
      var E = ey(i).queue;
      $c(
        i,
        E,
        r,
        u_,
        u === null ? x : function() {
          return lo(i), u(m);
        }
      );
    }
    function ey(i) {
      var r = i.memoizedState;
      if (r !== null) return r;
      r = {
        memoizedState: u_,
        baseState: u_,
        baseQueue: null,
        queue: {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: je,
          lastRenderedState: u_
        },
        next: null
      };
      var u = {};
      return r.next = {
        memoizedState: u,
        baseState: u,
        baseQueue: null,
        queue: {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: je,
          lastRenderedState: u
        },
        next: null
      }, i.memoizedState = r, i = i.alternate, i !== null && (i.memoizedState = r), r;
    }
    function lo(i) {
      Tt.T === null && console.error(
        "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
      );
      var r = ey(i).next.queue;
      ph(
        i,
        r,
        {},
        Xr(i)
      );
    }
    function Ll() {
      var i = jo(!1);
      return i = $c.bind(
        null,
        Qe,
        i.queue,
        !0,
        !1
      ), la().memoizedState = i, [!1, i];
    }
    function Xc() {
      var i = _a(je)[0], r = zn().memoizedState;
      return [
        typeof i == "boolean" ? i : Ol(i),
        r
      ];
    }
    function Il() {
      var i = or(je)[0], r = zn().memoizedState;
      return [
        typeof i == "boolean" ? i : Ol(i),
        r
      ];
    }
    function xr() {
      return xi(ub);
    }
    function Kc() {
      var i = la(), r = Li.identifierPrefix;
      if (Yn) {
        var u = Bg, m = Hg;
        u = (m & ~(1 << 32 - _e(m) - 1)).toString(32) + u, r = "«" + r + "R" + u, u = ux++, 0 < u && (r += "H" + u.toString(32)), r += "»";
      } else
        u = _I++, r = "«" + r + "r" + u.toString(32) + "»";
      return i.memoizedState = r;
    }
    function ms() {
      return la().memoizedState = Ud.bind(
        null,
        Qe
      );
    }
    function Ud(i, r) {
      for (var u = i.return; u !== null; ) {
        switch (u.tag) {
          case 24:
          case 3:
            var m = Xr(u);
            i = Br(m);
            var E = Aa(u, i, m);
            E !== null && (gn(E, u, m), zo(E, u, m)), u = $0(), r != null && E !== null && console.error(
              "The seed argument is not enabled outside experimental channels."
            ), i.payload = { cache: u };
            return;
        }
        u = u.return;
      }
    }
    function uo(i, r, u) {
      var m = arguments;
      typeof m[3] == "function" && console.error(
        "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
      ), m = Xr(i);
      var E = {
        lane: m,
        revertLane: 0,
        action: u,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      Ho(i) ? Pl(r, E) : (E = Ad(i, r, E, m), E !== null && (gn(E, i, m), Bo(E, r, m))), tn(i, m);
    }
    function Fa(i, r, u) {
      var m = arguments;
      typeof m[3] == "function" && console.error(
        "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
      ), m = Xr(i), ph(i, r, u, m), tn(i, m);
    }
    function ph(i, r, u, m) {
      var E = {
        lane: m,
        revertLane: 0,
        action: u,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      if (Ho(i)) Pl(r, E);
      else {
        var S = i.alternate;
        if (i.lanes === 0 && (S === null || S.lanes === 0) && (S = r.lastRenderedReducer, S !== null)) {
          var O = Tt.H;
          Tt.H = wf;
          try {
            var I = r.lastRenderedState, F = S(I, u);
            if (E.hasEagerState = !0, E.eagerState = F, Vt(F, I))
              return Cm(i, r, E, 0), Li === null && Jf(), !1;
          } catch {
          } finally {
            Tt.H = O;
          }
        }
        if (u = Ad(i, r, E, m), u !== null)
          return gn(u, i, m), Bo(u, r, m), !0;
      }
      return !1;
    }
    function jd(i, r, u, m) {
      if (Tt.T === null && Ky === 0 && console.error(
        "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
      ), m = {
        lane: 2,
        revertLane: hp(),
        action: m,
        hasEagerState: !1,
        eagerState: null,
        next: null
      }, Ho(i)) {
        if (r)
          throw Error("Cannot update optimistic state while rendering.");
        console.error("Cannot call startTransition while rendering.");
      } else
        r = Ad(
          i,
          u,
          m,
          2
        ), r !== null && gn(r, i, 2);
      tn(i, 2);
    }
    function Ho(i) {
      var r = i.alternate;
      return i === Qe || r !== null && r === Qe;
    }
    function Pl(i, r) {
      t1 = lx = !0;
      var u = i.pending;
      u === null ? r.next = r : (r.next = u.next, u.next = r), i.pending = r;
    }
    function Bo(i, r, u) {
      if ((u & 4194048) !== 0) {
        var m = r.lanes;
        m &= i.pendingLanes, u |= m, r.lanes = u, ti(i, u);
      }
    }
    function ca(i) {
      var r = _n;
      return i != null && (_n = r === null ? i : r.concat(i)), r;
    }
    function yh(i, r, u) {
      for (var m = Object.keys(i.props), E = 0; E < m.length; E++) {
        var S = m[E];
        if (S !== "children" && S !== "key") {
          r === null && (r = qc(i, u.mode, 0), r._debugInfo = _n, r.return = u), de(
            r,
            function(O) {
              console.error(
                "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
                O
              );
            },
            S
          );
          break;
        }
      }
    }
    function Yr(i) {
      var r = $E;
      return $E += 1, e1 === null && (e1 = rh()), Um(e1, i, r);
    }
    function qe(i, r) {
      r = r.props.ref, i.ref = r !== void 0 ? r : null;
    }
    function Ln(i, r) {
      throw r.$$typeof === CE ? Error(
        `A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.`
      ) : (i = Object.prototype.toString.call(r), Error(
        "Objects are not valid as a React child (found: " + (i === "[object Object]" ? "object with keys {" + Object.keys(r).join(", ") + "}" : i) + "). If you meant to render a collection of children, use an array instead."
      ));
    }
    function hn(i, r) {
      var u = ht(i) || "Component";
      c4[u] || (c4[u] = !0, r = r.displayName || r.name || "Component", i.tag === 3 ? console.error(
        `Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  root.render(%s)`,
        r,
        r,
        r
      ) : console.error(
        `Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  <%s>{%s}</%s>`,
        r,
        r,
        u,
        r,
        u
      ));
    }
    function zl(i, r) {
      var u = ht(i) || "Component";
      f4[u] || (f4[u] = !0, r = String(r), i.tag === 3 ? console.error(
        `Symbols are not valid as a React child.
  root.render(%s)`,
        r
      ) : console.error(
        `Symbols are not valid as a React child.
  <%s>%s</%s>`,
        u,
        r,
        u
      ));
    }
    function Lu(i) {
      function r(at, rt) {
        if (i) {
          var ut = at.deletions;
          ut === null ? (at.deletions = [rt], at.flags |= 16) : ut.push(rt);
        }
      }
      function u(at, rt) {
        if (!i) return null;
        for (; rt !== null; )
          r(at, rt), rt = rt.sibling;
        return null;
      }
      function m(at) {
        for (var rt = /* @__PURE__ */ new Map(); at !== null; )
          at.key !== null ? rt.set(at.key, at) : rt.set(at.index, at), at = at.sibling;
        return rt;
      }
      function E(at, rt) {
        return at = Ns(at, rt), at.index = 0, at.sibling = null, at;
      }
      function S(at, rt, ut) {
        return at.index = ut, i ? (ut = at.alternate, ut !== null ? (ut = ut.index, ut < rt ? (at.flags |= 67108866, rt) : ut) : (at.flags |= 67108866, rt)) : (at.flags |= 1048576, rt);
      }
      function O(at) {
        return i && at.alternate === null && (at.flags |= 67108866), at;
      }
      function I(at, rt, ut, Gt) {
        return rt === null || rt.tag !== 6 ? (rt = B0(
          ut,
          at.mode,
          Gt
        ), rt.return = at, rt._debugOwner = at, rt._debugTask = at._debugTask, rt._debugInfo = _n, rt) : (rt = E(rt, ut), rt.return = at, rt._debugInfo = _n, rt);
      }
      function F(at, rt, ut, Gt) {
        var ne = ut.type;
        return ne === ic ? (rt = Rt(
          at,
          rt,
          ut.props.children,
          Gt,
          ut.key
        ), yh(ut, rt, at), rt) : rt !== null && (rt.elementType === ne || Bc(rt, ut) || typeof ne == "object" && ne !== null && ne.$$typeof === ha && Yp(ne) === rt.type) ? (rt = E(rt, ut.props), qe(rt, ut), rt.return = at, rt._debugOwner = ut._owner, rt._debugInfo = _n, rt) : (rt = qc(ut, at.mode, Gt), qe(rt, ut), rt.return = at, rt._debugInfo = _n, rt);
      }
      function K(at, rt, ut, Gt) {
        return rt === null || rt.tag !== 4 || rt.stateNode.containerInfo !== ut.containerInfo || rt.stateNode.implementation !== ut.implementation ? (rt = Im(ut, at.mode, Gt), rt.return = at, rt._debugInfo = _n, rt) : (rt = E(rt, ut.children || []), rt.return = at, rt._debugInfo = _n, rt);
      }
      function Rt(at, rt, ut, Gt, ne) {
        return rt === null || rt.tag !== 7 ? (rt = Ur(
          ut,
          at.mode,
          Gt,
          ne
        ), rt.return = at, rt._debugOwner = at, rt._debugTask = at._debugTask, rt._debugInfo = _n, rt) : (rt = E(rt, ut), rt.return = at, rt._debugInfo = _n, rt);
      }
      function Lt(at, rt, ut) {
        if (typeof rt == "string" && rt !== "" || typeof rt == "number" || typeof rt == "bigint")
          return rt = B0(
            "" + rt,
            at.mode,
            ut
          ), rt.return = at, rt._debugOwner = at, rt._debugTask = at._debugTask, rt._debugInfo = _n, rt;
        if (typeof rt == "object" && rt !== null) {
          switch (rt.$$typeof) {
            case Jl:
              return ut = qc(
                rt,
                at.mode,
                ut
              ), qe(ut, rt), ut.return = at, at = ca(rt._debugInfo), ut._debugInfo = _n, _n = at, ut;
            case Ke:
              return rt = Im(
                rt,
                at.mode,
                ut
              ), rt.return = at, rt._debugInfo = _n, rt;
            case ha:
              var Gt = ca(rt._debugInfo);
              return rt = Yp(rt), at = Lt(at, rt, ut), _n = Gt, at;
          }
          if (Sa(rt) || et(rt))
            return ut = Ur(
              rt,
              at.mode,
              ut,
              null
            ), ut.return = at, ut._debugOwner = at, ut._debugTask = at._debugTask, at = ca(rt._debugInfo), ut._debugInfo = _n, _n = at, ut;
          if (typeof rt.then == "function")
            return Gt = ca(rt._debugInfo), at = Lt(
              at,
              Yr(rt),
              ut
            ), _n = Gt, at;
          if (rt.$$typeof === be)
            return Lt(
              at,
              Cd(at, rt),
              ut
            );
          Ln(at, rt);
        }
        return typeof rt == "function" && hn(at, rt), typeof rt == "symbol" && zl(at, rt), null;
      }
      function wt(at, rt, ut, Gt) {
        var ne = rt !== null ? rt.key : null;
        if (typeof ut == "string" && ut !== "" || typeof ut == "number" || typeof ut == "bigint")
          return ne !== null ? null : I(at, rt, "" + ut, Gt);
        if (typeof ut == "object" && ut !== null) {
          switch (ut.$$typeof) {
            case Jl:
              return ut.key === ne ? (ne = ca(ut._debugInfo), at = F(
                at,
                rt,
                ut,
                Gt
              ), _n = ne, at) : null;
            case Ke:
              return ut.key === ne ? K(at, rt, ut, Gt) : null;
            case ha:
              return ne = ca(ut._debugInfo), ut = Yp(ut), at = wt(
                at,
                rt,
                ut,
                Gt
              ), _n = ne, at;
          }
          if (Sa(ut) || et(ut))
            return ne !== null ? null : (ne = ca(ut._debugInfo), at = Rt(
              at,
              rt,
              ut,
              Gt,
              null
            ), _n = ne, at);
          if (typeof ut.then == "function")
            return ne = ca(ut._debugInfo), at = wt(
              at,
              rt,
              Yr(ut),
              Gt
            ), _n = ne, at;
          if (ut.$$typeof === be)
            return wt(
              at,
              rt,
              Cd(at, ut),
              Gt
            );
          Ln(at, ut);
        }
        return typeof ut == "function" && hn(at, ut), typeof ut == "symbol" && zl(at, ut), null;
      }
      function zt(at, rt, ut, Gt, ne) {
        if (typeof Gt == "string" && Gt !== "" || typeof Gt == "number" || typeof Gt == "bigint")
          return at = at.get(ut) || null, I(rt, at, "" + Gt, ne);
        if (typeof Gt == "object" && Gt !== null) {
          switch (Gt.$$typeof) {
            case Jl:
              return ut = at.get(
                Gt.key === null ? ut : Gt.key
              ) || null, at = ca(Gt._debugInfo), rt = F(
                rt,
                ut,
                Gt,
                ne
              ), _n = at, rt;
            case Ke:
              return at = at.get(
                Gt.key === null ? ut : Gt.key
              ) || null, K(rt, at, Gt, ne);
            case ha:
              var sn = ca(Gt._debugInfo);
              return Gt = Yp(Gt), rt = zt(
                at,
                rt,
                ut,
                Gt,
                ne
              ), _n = sn, rt;
          }
          if (Sa(Gt) || et(Gt))
            return ut = at.get(ut) || null, at = ca(Gt._debugInfo), rt = Rt(
              rt,
              ut,
              Gt,
              ne,
              null
            ), _n = at, rt;
          if (typeof Gt.then == "function")
            return sn = ca(Gt._debugInfo), rt = zt(
              at,
              rt,
              ut,
              Yr(Gt),
              ne
            ), _n = sn, rt;
          if (Gt.$$typeof === be)
            return zt(
              at,
              rt,
              ut,
              Cd(rt, Gt),
              ne
            );
          Ln(rt, Gt);
        }
        return typeof Gt == "function" && hn(rt, Gt), typeof Gt == "symbol" && zl(rt, Gt), null;
      }
      function ge(at, rt, ut, Gt) {
        if (typeof ut != "object" || ut === null) return Gt;
        switch (ut.$$typeof) {
          case Jl:
          case Ke:
            p(at, rt, ut);
            var ne = ut.key;
            if (typeof ne != "string") break;
            if (Gt === null) {
              Gt = /* @__PURE__ */ new Set(), Gt.add(ne);
              break;
            }
            if (!Gt.has(ne)) {
              Gt.add(ne);
              break;
            }
            de(rt, function() {
              console.error(
                "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",
                ne
              );
            });
            break;
          case ha:
            ut = Yp(ut), ge(at, rt, ut, Gt);
        }
        return Gt;
      }
      function ke(at, rt, ut, Gt) {
        for (var ne = null, sn = null, me = null, on = rt, dn = rt = 0, Yi = null; on !== null && dn < ut.length; dn++) {
          on.index > dn ? (Yi = on, on = null) : Yi = on.sibling;
          var Ja = wt(
            at,
            on,
            ut[dn],
            Gt
          );
          if (Ja === null) {
            on === null && (on = Yi);
            break;
          }
          ne = ge(
            at,
            Ja,
            ut[dn],
            ne
          ), i && on && Ja.alternate === null && r(at, on), rt = S(Ja, rt, dn), me === null ? sn = Ja : me.sibling = Ja, me = Ja, on = Yi;
        }
        if (dn === ut.length)
          return u(at, on), Yn && ya(at, dn), sn;
        if (on === null) {
          for (; dn < ut.length; dn++)
            on = Lt(at, ut[dn], Gt), on !== null && (ne = ge(
              at,
              on,
              ut[dn],
              ne
            ), rt = S(
              on,
              rt,
              dn
            ), me === null ? sn = on : me.sibling = on, me = on);
          return Yn && ya(at, dn), sn;
        }
        for (on = m(on); dn < ut.length; dn++)
          Yi = zt(
            on,
            at,
            dn,
            ut[dn],
            Gt
          ), Yi !== null && (ne = ge(
            at,
            Yi,
            ut[dn],
            ne
          ), i && Yi.alternate !== null && on.delete(
            Yi.key === null ? dn : Yi.key
          ), rt = S(
            Yi,
            rt,
            dn
          ), me === null ? sn = Yi : me.sibling = Yi, me = Yi);
        return i && on.forEach(function(Wg) {
          return r(at, Wg);
        }), Yn && ya(at, dn), sn;
      }
      function Ii(at, rt, ut, Gt) {
        if (ut == null)
          throw Error("An iterable object provided no iterator.");
        for (var ne = null, sn = null, me = rt, on = rt = 0, dn = null, Yi = null, Ja = ut.next(); me !== null && !Ja.done; on++, Ja = ut.next()) {
          me.index > on ? (dn = me, me = null) : dn = me.sibling;
          var Wg = wt(at, me, Ja.value, Gt);
          if (Wg === null) {
            me === null && (me = dn);
            break;
          }
          Yi = ge(
            at,
            Wg,
            Ja.value,
            Yi
          ), i && me && Wg.alternate === null && r(at, me), rt = S(Wg, rt, on), sn === null ? ne = Wg : sn.sibling = Wg, sn = Wg, me = dn;
        }
        if (Ja.done)
          return u(at, me), Yn && ya(at, on), ne;
        if (me === null) {
          for (; !Ja.done; on++, Ja = ut.next())
            me = Lt(at, Ja.value, Gt), me !== null && (Yi = ge(
              at,
              me,
              Ja.value,
              Yi
            ), rt = S(
              me,
              rt,
              on
            ), sn === null ? ne = me : sn.sibling = me, sn = me);
          return Yn && ya(at, on), ne;
        }
        for (me = m(me); !Ja.done; on++, Ja = ut.next())
          dn = zt(
            me,
            at,
            on,
            Ja.value,
            Gt
          ), dn !== null && (Yi = ge(
            at,
            dn,
            Ja.value,
            Yi
          ), i && dn.alternate !== null && me.delete(
            dn.key === null ? on : dn.key
          ), rt = S(
            dn,
            rt,
            on
          ), sn === null ? ne = dn : sn.sibling = dn, sn = dn);
        return i && me.forEach(function(YI) {
          return r(at, YI);
        }), Yn && ya(at, on), ne;
      }
      function On(at, rt, ut, Gt) {
        if (typeof ut == "object" && ut !== null && ut.type === ic && ut.key === null && (yh(ut, null, at), ut = ut.props.children), typeof ut == "object" && ut !== null) {
          switch (ut.$$typeof) {
            case Jl:
              var ne = ca(ut._debugInfo);
              t: {
                for (var sn = ut.key; rt !== null; ) {
                  if (rt.key === sn) {
                    if (sn = ut.type, sn === ic) {
                      if (rt.tag === 7) {
                        u(
                          at,
                          rt.sibling
                        ), Gt = E(
                          rt,
                          ut.props.children
                        ), Gt.return = at, Gt._debugOwner = ut._owner, Gt._debugInfo = _n, yh(ut, Gt, at), at = Gt;
                        break t;
                      }
                    } else if (rt.elementType === sn || Bc(
                      rt,
                      ut
                    ) || typeof sn == "object" && sn !== null && sn.$$typeof === ha && Yp(sn) === rt.type) {
                      u(
                        at,
                        rt.sibling
                      ), Gt = E(rt, ut.props), qe(Gt, ut), Gt.return = at, Gt._debugOwner = ut._owner, Gt._debugInfo = _n, at = Gt;
                      break t;
                    }
                    u(at, rt);
                    break;
                  } else r(at, rt);
                  rt = rt.sibling;
                }
                ut.type === ic ? (Gt = Ur(
                  ut.props.children,
                  at.mode,
                  Gt,
                  ut.key
                ), Gt.return = at, Gt._debugOwner = at, Gt._debugTask = at._debugTask, Gt._debugInfo = _n, yh(ut, Gt, at), at = Gt) : (Gt = qc(
                  ut,
                  at.mode,
                  Gt
                ), qe(Gt, ut), Gt.return = at, Gt._debugInfo = _n, at = Gt);
              }
              return at = O(at), _n = ne, at;
            case Ke:
              t: {
                for (ne = ut, ut = ne.key; rt !== null; ) {
                  if (rt.key === ut)
                    if (rt.tag === 4 && rt.stateNode.containerInfo === ne.containerInfo && rt.stateNode.implementation === ne.implementation) {
                      u(
                        at,
                        rt.sibling
                      ), Gt = E(
                        rt,
                        ne.children || []
                      ), Gt.return = at, at = Gt;
                      break t;
                    } else {
                      u(at, rt);
                      break;
                    }
                  else r(at, rt);
                  rt = rt.sibling;
                }
                Gt = Im(
                  ne,
                  at.mode,
                  Gt
                ), Gt.return = at, at = Gt;
              }
              return O(at);
            case ha:
              return ne = ca(ut._debugInfo), ut = Yp(ut), at = On(
                at,
                rt,
                ut,
                Gt
              ), _n = ne, at;
          }
          if (Sa(ut))
            return ne = ca(ut._debugInfo), at = ke(
              at,
              rt,
              ut,
              Gt
            ), _n = ne, at;
          if (et(ut)) {
            if (ne = ca(ut._debugInfo), sn = et(ut), typeof sn != "function")
              throw Error(
                "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
              );
            var me = sn.call(ut);
            return me === ut ? (at.tag !== 0 || Object.prototype.toString.call(at.type) !== "[object GeneratorFunction]" || Object.prototype.toString.call(me) !== "[object Generator]") && (l4 || console.error(
              "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
            ), l4 = !0) : ut.entries !== sn || vR || (console.error(
              "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
            ), vR = !0), at = Ii(
              at,
              rt,
              me,
              Gt
            ), _n = ne, at;
          }
          if (typeof ut.then == "function")
            return ne = ca(ut._debugInfo), at = On(
              at,
              rt,
              Yr(ut),
              Gt
            ), _n = ne, at;
          if (ut.$$typeof === be)
            return On(
              at,
              rt,
              Cd(at, ut),
              Gt
            );
          Ln(at, ut);
        }
        return typeof ut == "string" && ut !== "" || typeof ut == "number" || typeof ut == "bigint" ? (ne = "" + ut, rt !== null && rt.tag === 6 ? (u(
          at,
          rt.sibling
        ), Gt = E(rt, ne), Gt.return = at, at = Gt) : (u(at, rt), Gt = B0(
          ne,
          at.mode,
          Gt
        ), Gt.return = at, Gt._debugOwner = at, Gt._debugTask = at._debugTask, Gt._debugInfo = _n, at = Gt), O(at)) : (typeof ut == "function" && hn(at, ut), typeof ut == "symbol" && zl(at, ut), u(at, rt));
      }
      return function(at, rt, ut, Gt) {
        var ne = _n;
        _n = null;
        try {
          $E = 0;
          var sn = On(
            at,
            rt,
            ut,
            Gt
          );
          return e1 = null, sn;
        } catch (Yi) {
          if (Yi === qE || Yi === rx) throw Yi;
          var me = A(29, Yi, null, at.mode);
          me.lanes = Gt, me.return = at;
          var on = me._debugInfo = _n;
          if (me._debugOwner = at._debugOwner, me._debugTask = at._debugTask, on != null) {
            for (var dn = on.length - 1; 0 <= dn; dn--)
              if (typeof on[dn].stack == "string") {
                me._debugOwner = on[dn], me._debugTask = on[dn].debugTask;
                break;
              }
          }
          return me;
        } finally {
          _n = ne;
        }
      };
    }
    function Ni(i) {
      var r = i.alternate;
      St(
        Dr,
        Dr.current & i1,
        i
      ), St(vc, i, i), Wh === null && (r === null || Qv.current !== null || r.memoizedState !== null) && (Wh = i);
    }
    function Zc(i) {
      if (i.tag === 22) {
        if (St(Dr, Dr.current, i), St(vc, i, i), Wh === null) {
          var r = i.alternate;
          r !== null && r.memoizedState !== null && (Wh = i);
        }
      } else Tr(i);
    }
    function Tr(i) {
      St(Dr, Dr.current, i), St(
        vc,
        vc.current,
        i
      );
    }
    function fa(i) {
      mt(vc, i), Wh === i && (Wh = null), mt(Dr, i);
    }
    function kd(i) {
      for (var r = i; r !== null; ) {
        if (r.tag === 13) {
          var u = r.memoizedState;
          if (u !== null && (u = u.dehydrated, u === null || u.data === Xg || Ju(u)))
            return r;
        } else if (r.tag === 19 && r.memoizedProps.revealOrder !== void 0) {
          if ((r.flags & 128) !== 0) return r;
        } else if (r.child !== null) {
          r.child.return = r, r = r.child;
          continue;
        }
        if (r === i) break;
        for (; r.sibling === null; ) {
          if (r.return === null || r.return === i) return null;
          r = r.return;
        }
        r.sibling.return = r.return, r = r.sibling;
      }
      return null;
    }
    function yn(i) {
      if (i !== null && typeof i != "function") {
        var r = String(i);
        x4.has(r) || (x4.add(r), console.error(
          "Expected the last optional `callback` argument to be a function. Instead received: %s.",
          i
        ));
      }
    }
    function Wc(i, r, u, m) {
      var E = i.memoizedState, S = u(m, E);
      if (i.mode & Ks) {
        $t(!0);
        try {
          S = u(m, E);
        } finally {
          $t(!1);
        }
      }
      S === void 0 && (r = ot(r) || "Component", v4.has(r) || (v4.add(r), console.error(
        "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
        r
      ))), E = S == null ? E : He({}, E, S), i.memoizedState = E, i.lanes === 0 && (i.updateQueue.baseState = E);
    }
    function Ym(i, r, u, m, E, S, O) {
      var I = i.stateNode;
      if (typeof I.shouldComponentUpdate == "function") {
        if (u = I.shouldComponentUpdate(
          m,
          S,
          O
        ), i.mode & Ks) {
          $t(!0);
          try {
            u = I.shouldComponentUpdate(
              m,
              S,
              O
            );
          } finally {
            $t(!1);
          }
        }
        return u === void 0 && console.error(
          "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
          ot(r) || "Component"
        ), u;
      }
      return r.prototype && r.prototype.isPureReactComponent ? !Qf(u, m) || !Qf(E, S) : !0;
    }
    function ny(i, r, u, m) {
      var E = r.state;
      typeof r.componentWillReceiveProps == "function" && r.componentWillReceiveProps(u, m), typeof r.UNSAFE_componentWillReceiveProps == "function" && r.UNSAFE_componentWillReceiveProps(u, m), r.state !== E && (i = ht(i) || "Component", g4.has(i) || (g4.add(i), console.error(
        "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
        i
      )), ER.enqueueReplaceState(
        r,
        r.state,
        null
      ));
    }
    function Iu(i, r) {
      var u = r;
      if ("ref" in r) {
        u = {};
        for (var m in r)
          m !== "ref" && (u[m] = r[m]);
      }
      if (i = i.defaultProps) {
        u === r && (u = He({}, u));
        for (var E in i)
          u[E] === void 0 && (u[E] = i[E]);
      }
      return u;
    }
    function Fm(i) {
      bR(i), console.warn(
        `%s

%s
`,
        a1 ? "An error occurred in the <" + a1 + "> component." : "An error occurred in one of your React components.",
        `Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`
      );
    }
    function $m(i) {
      var r = a1 ? "The above error occurred in the <" + a1 + "> component." : "The above error occurred in one of your React components.", u = "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((SR || "Anonymous") + ".");
      if (typeof i == "object" && i !== null && typeof i.environmentName == "string") {
        var m = i.environmentName;
        i = [
          `%o

%s

%s
`,
          i,
          r,
          u
        ].slice(0), typeof i[0] == "string" ? i.splice(
          0,
          1,
          e3 + i[0],
          n3,
          Cx + m + Cx,
          i3
        ) : i.splice(
          0,
          0,
          e3,
          n3,
          Cx + m + Cx,
          i3
        ), i.unshift(console), m = qI.apply(console.error, i), m();
      } else
        console.error(
          `%o

%s

%s
`,
          i,
          r,
          u
        );
    }
    function Pu(i) {
      bR(i);
    }
    function Qc(i, r) {
      try {
        a1 = r.source ? ht(r.source) : null, SR = null;
        var u = r.value;
        if (Tt.actQueue !== null)
          Tt.thrownErrors.push(u);
        else {
          var m = i.onUncaughtError;
          m(u, { componentStack: r.stack });
        }
      } catch (E) {
        setTimeout(function() {
          throw E;
        });
      }
    }
    function wr(i, r, u) {
      try {
        a1 = u.source ? ht(u.source) : null, SR = ht(r);
        var m = i.onCaughtError;
        m(u.value, {
          componentStack: u.stack,
          errorBoundary: r.tag === 1 ? r.stateNode : null
        });
      } catch (E) {
        setTimeout(function() {
          throw E;
        });
      }
    }
    function ki(i, r, u) {
      return u = Br(u), u.tag = fR, u.payload = { element: null }, u.callback = function() {
        de(r.source, Qc, i, r);
      }, u;
    }
    function Gl(i) {
      return i = Br(i), i.tag = fR, i;
    }
    function Jc(i, r, u, m) {
      var E = u.type.getDerivedStateFromError;
      if (typeof E == "function") {
        var S = m.value;
        i.payload = function() {
          return E(S);
        }, i.callback = function() {
          Dm(u), de(
            m.source,
            wr,
            r,
            u,
            m
          );
        };
      }
      var O = u.stateNode;
      O !== null && typeof O.componentDidCatch == "function" && (i.callback = function() {
        Dm(u), de(
          m.source,
          wr,
          r,
          u,
          m
        ), typeof E != "function" && (Kp === null ? Kp = /* @__PURE__ */ new Set([this]) : Kp.add(this)), EI(this, m), typeof E == "function" || (u.lanes & 2) === 0 && console.error(
          "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
          ht(u) || "Unknown"
        );
      });
    }
    function Xm(i, r, u, m, E) {
      if (u.flags |= 32768, da && Fu(i, E), m !== null && typeof m == "object" && typeof m.then == "function") {
        if (r = u.alternate, r !== null && jr(
          r,
          u,
          E,
          !0
        ), Yn && (qg = !0), u = vc.current, u !== null) {
          switch (u.tag) {
            case 13:
              return Wh === null ? up() : u.alternate === null && Ga === $g && (Ga = RR), u.flags &= -257, u.flags |= 65536, u.lanes = E, m === cR ? u.flags |= 16384 : (r = u.updateQueue, r === null ? u.updateQueue = /* @__PURE__ */ new Set([m]) : r.add(m), fp(i, m, E)), !1;
            case 22:
              return u.flags |= 65536, m === cR ? u.flags |= 16384 : (r = u.updateQueue, r === null ? (r = {
                transitions: null,
                markerInstances: null,
                retryQueue: /* @__PURE__ */ new Set([m])
              }, u.updateQueue = r) : (u = r.retryQueue, u === null ? r.retryQueue = /* @__PURE__ */ new Set([m]) : u.add(m)), fp(i, m, E)), !1;
          }
          throw Error(
            "Unexpected Suspense handler tag (" + u.tag + "). This is a bug in React."
          );
        }
        return fp(i, m, E), up(), !1;
      }
      if (Yn)
        return qg = !0, r = vc.current, r !== null ? ((r.flags & 65536) === 0 && (r.flags |= 256), r.flags |= 65536, r.lanes = E, m !== sR && xu(
          Ji(
            Error(
              "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
              { cause: m }
            ),
            u
          )
        )) : (m !== sR && xu(
          Ji(
            Error(
              "There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
              { cause: m }
            ),
            u
          )
        ), i = i.current.alternate, i.flags |= 65536, E &= -E, i.lanes |= E, m = Ji(m, u), E = ki(
          i.stateNode,
          m,
          E
        ), Go(i, E), Ga !== Jy && (Ga = l1)), !1;
      var S = Ji(
        Error(
          "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
          { cause: m }
        ),
        u
      );
      if (eb === null ? eb = [S] : eb.push(S), Ga !== Jy && (Ga = l1), r === null) return !0;
      m = Ji(m, u), u = r;
      do {
        switch (u.tag) {
          case 3:
            return u.flags |= 65536, i = E & -E, u.lanes |= i, i = ki(
              u.stateNode,
              m,
              i
            ), Go(u, i), !1;
          case 1:
            if (r = u.type, S = u.stateNode, (u.flags & 128) === 0 && (typeof r.getDerivedStateFromError == "function" || S !== null && typeof S.componentDidCatch == "function" && (Kp === null || !Kp.has(S))))
              return u.flags |= 65536, E &= -E, u.lanes |= E, E = Gl(E), Jc(
                E,
                i,
                u,
                m
              ), Go(u, E), !1;
        }
        u = u.return;
      } while (u !== null);
      return !1;
    }
    function ta(i, r, u, m) {
      r.child = i === null ? h4(r, null, u, m) : n1(
        r,
        i.child,
        u,
        m
      );
    }
    function co(i, r, u, m, E) {
      u = u.render;
      var S = r.ref;
      if ("ref" in m) {
        var O = {};
        for (var I in m)
          I !== "ref" && (O[I] = m[I]);
      } else O = m;
      return wl(r), ce(r), m = sh(
        i,
        r,
        u,
        O,
        S,
        E
      ), I = oi(), pe(), i !== null && !is ? (fi(i, r, E), qo(i, r, E)) : (Yn && I && Eu(r), r.flags |= 1, ta(i, r, m, E), r.child);
    }
    function Hd(i, r, u, m, E) {
      if (i === null) {
        var S = u.type;
        return typeof S == "function" && !eh(S) && S.defaultProps === void 0 && u.compare === null ? (u = _u(S), r.tag = 15, r.type = u, _h(r, S), Km(
          i,
          r,
          u,
          m,
          E
        )) : (i = Lm(
          u.type,
          null,
          m,
          r,
          r.mode,
          E
        ), i.ref = r.ref, i.return = r, r.child = i);
      }
      if (S = i.child, !Xd(i, E)) {
        var O = S.memoizedProps;
        if (u = u.compare, u = u !== null ? u : Qf, u(O, m) && i.ref === r.ref)
          return qo(
            i,
            r,
            E
          );
      }
      return r.flags |= 1, i = Ns(S, m), i.ref = r.ref, i.return = r, r.child = i;
    }
    function Km(i, r, u, m, E) {
      if (i !== null) {
        var S = i.memoizedProps;
        if (Qf(S, m) && i.ref === r.ref && r.type === i.type)
          if (is = !1, r.pendingProps = m = S, Xd(i, E))
            (i.flags & 131072) !== 0 && (is = !0);
          else
            return r.lanes = i.lanes, qo(i, r, E);
      }
      return Qm(
        i,
        r,
        u,
        m,
        E
      );
    }
    function Zm(i, r, u) {
      var m = r.pendingProps, E = m.children, S = i !== null ? i.memoizedState : null;
      if (m.mode === "hidden") {
        if ((r.flags & 128) !== 0) {
          if (m = S !== null ? S.baseLanes | u : u, i !== null) {
            for (E = r.child = i.child, S = 0; E !== null; )
              S = S | E.lanes | E.childLanes, E = E.sibling;
            r.childLanes = S & ~m;
          } else r.childLanes = 0, r.child = null;
          return Wm(
            i,
            r,
            m,
            u
          );
        }
        if ((u & 536870912) !== 0)
          r.memoizedState = { baseLanes: 0, cachePool: null }, i !== null && Rl(
            r,
            S !== null ? S.cachePool : null
          ), S !== null ? Ru(r, S) : Va(r), Zc(r);
        else
          return r.lanes = r.childLanes = 536870912, Wm(
            i,
            r,
            S !== null ? S.baseLanes | u : u,
            u
          );
      } else
        S !== null ? (Rl(r, S.cachePool), Ru(r, S), Tr(r), r.memoizedState = null) : (i !== null && Rl(r, null), Va(r), Tr(r));
      return ta(i, r, E, u), r.child;
    }
    function Wm(i, r, u, m) {
      var E = X0();
      return E = E === null ? null : {
        parent: Cr._currentValue,
        pool: E
      }, r.memoizedState = {
        baseLanes: u,
        cachePool: E
      }, i !== null && Rl(r, null), Va(r), Zc(r), i !== null && jr(i, r, m, !0), null;
    }
    function tf(i, r) {
      var u = r.ref;
      if (u === null)
        i !== null && i.ref !== null && (r.flags |= 4194816);
      else {
        if (typeof u != "function" && typeof u != "object")
          throw Error(
            "Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
          );
        (i === null || i.ref !== u) && (r.flags |= 4194816);
      }
    }
    function Qm(i, r, u, m, E) {
      if (u.prototype && typeof u.prototype.render == "function") {
        var S = ot(u) || "Unknown";
        w4[S] || (console.error(
          "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
          S,
          S
        ), w4[S] = !0);
      }
      return r.mode & Ks && Tf.recordLegacyContextWarning(
        r,
        null
      ), i === null && (_h(r, r.type), u.contextTypes && (S = ot(u) || "Unknown", A4[S] || (A4[S] = !0, console.error(
        "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
        S
      )))), wl(r), ce(r), u = sh(
        i,
        r,
        u,
        m,
        void 0,
        E
      ), m = oi(), pe(), i !== null && !is ? (fi(i, r, E), qo(i, r, E)) : (Yn && m && Eu(r), r.flags |= 1, ta(i, r, u, E), r.child);
    }
    function Bd(i, r, u, m, E, S) {
      return wl(r), ce(r), Yg = -1, FE = i !== null && i.type !== r.type, r.updateQueue = null, u = qr(
        r,
        m,
        u,
        E
      ), oh(i, r), m = oi(), pe(), i !== null && !is ? (fi(i, r, S), qo(i, r, S)) : (Yn && m && Eu(r), r.flags |= 1, ta(i, r, u, S), r.child);
    }
    function Jm(i, r, u, m, E) {
      switch (h(r)) {
        case !1:
          var S = r.stateNode, O = new r.type(
            r.memoizedProps,
            S.context
          ).state;
          S.updater.enqueueSetState(S, O, null);
          break;
        case !0:
          r.flags |= 128, r.flags |= 65536, S = Error("Simulated error coming from DevTools");
          var I = E & -E;
          if (r.lanes |= I, O = Li, O === null)
            throw Error(
              "Expected a work-in-progress root. This is a bug in React. Please file an issue."
            );
          I = Gl(I), Jc(
            I,
            O,
            r,
            Ji(S, r)
          ), Go(r, I);
      }
      if (wl(r), r.stateNode === null) {
        if (O = Bp, S = u.contextType, "contextType" in u && S !== null && (S === void 0 || S.$$typeof !== be) && !S4.has(u) && (S4.add(u), I = S === void 0 ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof S != "object" ? " However, it is set to a " + typeof S + "." : S.$$typeof === vo ? " Did you accidentally pass the Context.Consumer instead?" : " However, it is set to an object with keys {" + Object.keys(S).join(", ") + "}.", console.error(
          "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
          ot(u) || "Component",
          I
        )), typeof S == "object" && S !== null && (O = xi(S)), S = new u(m, O), r.mode & Ks) {
          $t(!0);
          try {
            S = new u(m, O);
          } finally {
            $t(!1);
          }
        }
        if (O = r.memoizedState = S.state !== null && S.state !== void 0 ? S.state : null, S.updater = ER, r.stateNode = S, S._reactInternals = r, S._reactInternalInstance = d4, typeof u.getDerivedStateFromProps == "function" && O === null && (O = ot(u) || "Component", m4.has(O) || (m4.add(O), console.error(
          "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
          O,
          S.state === null ? "null" : "undefined",
          O
        ))), typeof u.getDerivedStateFromProps == "function" || typeof S.getSnapshotBeforeUpdate == "function") {
          var F = I = O = null;
          if (typeof S.componentWillMount == "function" && S.componentWillMount.__suppressDeprecationWarning !== !0 ? O = "componentWillMount" : typeof S.UNSAFE_componentWillMount == "function" && (O = "UNSAFE_componentWillMount"), typeof S.componentWillReceiveProps == "function" && S.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? I = "componentWillReceiveProps" : typeof S.UNSAFE_componentWillReceiveProps == "function" && (I = "UNSAFE_componentWillReceiveProps"), typeof S.componentWillUpdate == "function" && S.componentWillUpdate.__suppressDeprecationWarning !== !0 ? F = "componentWillUpdate" : typeof S.UNSAFE_componentWillUpdate == "function" && (F = "UNSAFE_componentWillUpdate"), O !== null || I !== null || F !== null) {
            S = ot(u) || "Component";
            var K = typeof u.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
            y4.has(S) || (y4.add(S), console.error(
              `Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://react.dev/link/unsafe-component-lifecycles`,
              S,
              K,
              O !== null ? `
  ` + O : "",
              I !== null ? `
  ` + I : "",
              F !== null ? `
  ` + F : ""
            ));
          }
        }
        S = r.stateNode, O = ot(u) || "Component", S.render || (u.prototype && typeof u.prototype.render == "function" ? console.error(
          "No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
          O
        ) : console.error(
          "No `render` method found on the %s instance: you may have forgotten to define `render`.",
          O
        )), !S.getInitialState || S.getInitialState.isReactClassApproved || S.state || console.error(
          "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
          O
        ), S.getDefaultProps && !S.getDefaultProps.isReactClassApproved && console.error(
          "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
          O
        ), S.contextType && console.error(
          "contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
          O
        ), u.childContextTypes && !b4.has(u) && (b4.add(u), console.error(
          "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
          O
        )), u.contextTypes && !E4.has(u) && (E4.add(u), console.error(
          "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
          O
        )), typeof S.componentShouldUpdate == "function" && console.error(
          "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
          O
        ), u.prototype && u.prototype.isPureReactComponent && typeof S.shouldComponentUpdate < "u" && console.error(
          "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
          ot(u) || "A pure component"
        ), typeof S.componentDidUnmount == "function" && console.error(
          "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
          O
        ), typeof S.componentDidReceiveProps == "function" && console.error(
          "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
          O
        ), typeof S.componentWillRecieveProps == "function" && console.error(
          "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
          O
        ), typeof S.UNSAFE_componentWillRecieveProps == "function" && console.error(
          "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
          O
        ), I = S.props !== m, S.props !== void 0 && I && console.error(
          "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
          O
        ), S.defaultProps && console.error(
          "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
          O,
          O
        ), typeof S.getSnapshotBeforeUpdate != "function" || typeof S.componentDidUpdate == "function" || p4.has(u) || (p4.add(u), console.error(
          "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
          ot(u)
        )), typeof S.getDerivedStateFromProps == "function" && console.error(
          "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
          O
        ), typeof S.getDerivedStateFromError == "function" && console.error(
          "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
          O
        ), typeof u.getSnapshotBeforeUpdate == "function" && console.error(
          "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
          O
        ), (I = S.state) && (typeof I != "object" || Sa(I)) && console.error("%s.state: must be set to an object or null", O), typeof S.getChildContext == "function" && typeof u.childContextTypes != "object" && console.error(
          "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
          O
        ), S = r.stateNode, S.props = m, S.state = r.memoizedState, S.refs = {}, Tu(r), O = u.contextType, S.context = typeof O == "object" && O !== null ? xi(O) : Bp, S.state === m && (O = ot(u) || "Component", _4.has(O) || (_4.add(O), console.error(
          "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
          O
        ))), r.mode & Ks && Tf.recordLegacyContextWarning(
          r,
          S
        ), Tf.recordUnsafeLifecycleWarnings(
          r,
          S
        ), S.state = r.memoizedState, O = u.getDerivedStateFromProps, typeof O == "function" && (Wc(
          r,
          u,
          O,
          m
        ), S.state = r.memoizedState), typeof u.getDerivedStateFromProps == "function" || typeof S.getSnapshotBeforeUpdate == "function" || typeof S.UNSAFE_componentWillMount != "function" && typeof S.componentWillMount != "function" || (O = S.state, typeof S.componentWillMount == "function" && S.componentWillMount(), typeof S.UNSAFE_componentWillMount == "function" && S.UNSAFE_componentWillMount(), O !== S.state && (console.error(
          "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
          ht(r) || "Component"
        ), ER.enqueueReplaceState(
          S,
          S.state,
          null
        )), Ml(r, m, S, E), Al(), S.state = r.memoizedState), typeof S.componentDidMount == "function" && (r.flags |= 4194308), (r.mode & xf) !== Vi && (r.flags |= 134217728), S = !0;
      } else if (i === null) {
        S = r.stateNode;
        var Rt = r.memoizedProps;
        I = Iu(u, Rt), S.props = I;
        var Lt = S.context;
        F = u.contextType, O = Bp, typeof F == "object" && F !== null && (O = xi(F)), K = u.getDerivedStateFromProps, F = typeof K == "function" || typeof S.getSnapshotBeforeUpdate == "function", Rt = r.pendingProps !== Rt, F || typeof S.UNSAFE_componentWillReceiveProps != "function" && typeof S.componentWillReceiveProps != "function" || (Rt || Lt !== O) && ny(
          r,
          S,
          m,
          O
        ), qp = !1;
        var wt = r.memoizedState;
        S.state = wt, Ml(r, m, S, E), Al(), Lt = r.memoizedState, Rt || wt !== Lt || qp ? (typeof K == "function" && (Wc(
          r,
          u,
          K,
          m
        ), Lt = r.memoizedState), (I = qp || Ym(
          r,
          u,
          I,
          m,
          wt,
          Lt,
          O
        )) ? (F || typeof S.UNSAFE_componentWillMount != "function" && typeof S.componentWillMount != "function" || (typeof S.componentWillMount == "function" && S.componentWillMount(), typeof S.UNSAFE_componentWillMount == "function" && S.UNSAFE_componentWillMount()), typeof S.componentDidMount == "function" && (r.flags |= 4194308), (r.mode & xf) !== Vi && (r.flags |= 134217728)) : (typeof S.componentDidMount == "function" && (r.flags |= 4194308), (r.mode & xf) !== Vi && (r.flags |= 134217728), r.memoizedProps = m, r.memoizedState = Lt), S.props = m, S.state = Lt, S.context = O, S = I) : (typeof S.componentDidMount == "function" && (r.flags |= 4194308), (r.mode & xf) !== Vi && (r.flags |= 134217728), S = !1);
      } else {
        S = r.stateNode, Od(i, r), O = r.memoizedProps, F = Iu(u, O), S.props = F, K = r.pendingProps, wt = S.context, Lt = u.contextType, I = Bp, typeof Lt == "object" && Lt !== null && (I = xi(Lt)), Rt = u.getDerivedStateFromProps, (Lt = typeof Rt == "function" || typeof S.getSnapshotBeforeUpdate == "function") || typeof S.UNSAFE_componentWillReceiveProps != "function" && typeof S.componentWillReceiveProps != "function" || (O !== K || wt !== I) && ny(
          r,
          S,
          m,
          I
        ), qp = !1, wt = r.memoizedState, S.state = wt, Ml(r, m, S, E), Al();
        var zt = r.memoizedState;
        O !== K || wt !== zt || qp || i !== null && i.dependencies !== null && vr(i.dependencies) ? (typeof Rt == "function" && (Wc(
          r,
          u,
          Rt,
          m
        ), zt = r.memoizedState), (F = qp || Ym(
          r,
          u,
          F,
          m,
          wt,
          zt,
          I
        ) || i !== null && i.dependencies !== null && vr(i.dependencies)) ? (Lt || typeof S.UNSAFE_componentWillUpdate != "function" && typeof S.componentWillUpdate != "function" || (typeof S.componentWillUpdate == "function" && S.componentWillUpdate(m, zt, I), typeof S.UNSAFE_componentWillUpdate == "function" && S.UNSAFE_componentWillUpdate(
          m,
          zt,
          I
        )), typeof S.componentDidUpdate == "function" && (r.flags |= 4), typeof S.getSnapshotBeforeUpdate == "function" && (r.flags |= 1024)) : (typeof S.componentDidUpdate != "function" || O === i.memoizedProps && wt === i.memoizedState || (r.flags |= 4), typeof S.getSnapshotBeforeUpdate != "function" || O === i.memoizedProps && wt === i.memoizedState || (r.flags |= 1024), r.memoizedProps = m, r.memoizedState = zt), S.props = m, S.state = zt, S.context = I, S = F) : (typeof S.componentDidUpdate != "function" || O === i.memoizedProps && wt === i.memoizedState || (r.flags |= 4), typeof S.getSnapshotBeforeUpdate != "function" || O === i.memoizedProps && wt === i.memoizedState || (r.flags |= 1024), S = !1);
      }
      if (I = S, tf(i, r), O = (r.flags & 128) !== 0, I || O) {
        if (I = r.stateNode, mu(r), O && typeof u.getDerivedStateFromError != "function")
          u = null, il = -1;
        else {
          if (ce(r), u = QO(I), r.mode & Ks) {
            $t(!0);
            try {
              QO(I);
            } finally {
              $t(!1);
            }
          }
          pe();
        }
        r.flags |= 1, i !== null && O ? (r.child = n1(
          r,
          i.child,
          null,
          E
        ), r.child = n1(
          r,
          null,
          u,
          E
        )) : ta(i, r, u, E), r.memoizedState = I.state, i = r.child;
      } else
        i = qo(
          i,
          r,
          E
        );
      return E = r.stateNode, S && E.props !== m && (r1 || console.error(
        "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
        ht(r) || "a component"
      ), r1 = !0), i;
    }
    function tp(i, r, u, m) {
      return ih(), r.flags |= 256, ta(i, r, u, m), r.child;
    }
    function _h(i, r) {
      r && r.childContextTypes && console.error(
        `childContextTypes cannot be defined on a function component.
  %s.childContextTypes = ...`,
        r.displayName || r.name || "Component"
      ), typeof r.getDerivedStateFromProps == "function" && (i = ot(r) || "Unknown", M4[i] || (console.error(
        "%s: Function components do not support getDerivedStateFromProps.",
        i
      ), M4[i] = !0)), typeof r.contextType == "object" && r.contextType !== null && (r = ot(r) || "Unknown", R4[r] || (console.error(
        "%s: Function components do not support contextType.",
        r
      ), R4[r] = !0));
    }
    function ef(i) {
      return { baseLanes: i, cachePool: ah() };
    }
    function iy(i, r, u) {
      return i = i !== null ? i.childLanes & ~u : 0, r && (i |= lu), i;
    }
    function ep(i, r, u) {
      var m, E = r.pendingProps;
      f(r) && (r.flags |= 128);
      var S = !1, O = (r.flags & 128) !== 0;
      if ((m = O) || (m = i !== null && i.memoizedState === null ? !1 : (Dr.current & XE) !== 0), m && (S = !0, r.flags &= -129), m = (r.flags & 32) !== 0, r.flags &= -33, i === null) {
        if (Yn) {
          if (S ? Ni(r) : Tr(r), Yn) {
            var I = za, F;
            if (!(F = !I)) {
              t: {
                var K = I;
                for (F = Kh; K.nodeType !== 8; ) {
                  if (!F) {
                    F = null;
                    break t;
                  }
                  if (K = Jr(K.nextSibling), K === null) {
                    F = null;
                    break t;
                  }
                }
                F = K;
              }
              F !== null ? (Ls(), r.memoizedState = {
                dehydrated: F,
                treeContext: Fy !== null ? { id: Hg, overflow: Bg } : null,
                retryLane: 536870912,
                hydrationErrors: null
              }, K = A(18, null, null, Vi), K.stateNode = F, K.return = r, r.child = K, xo = r, za = null, F = !0) : F = !1, F = !F;
            }
            F && (nh(
              r,
              I
            ), Su(r));
          }
          if (I = r.memoizedState, I !== null && (I = I.dehydrated, I !== null))
            return Ju(I) ? r.lanes = 32 : r.lanes = 536870912, null;
          fa(r);
        }
        return I = E.children, E = E.fallback, S ? (Tr(r), S = r.mode, I = Vd(
          {
            mode: "hidden",
            children: I
          },
          S
        ), E = Ur(
          E,
          S,
          u,
          null
        ), I.return = r, E.return = r, I.sibling = E, r.child = I, S = r.child, S.memoizedState = ef(u), S.childLanes = iy(
          i,
          m,
          u
        ), r.memoizedState = TR, E) : (Ni(r), qd(
          r,
          I
        ));
      }
      var Rt = i.memoizedState;
      if (Rt !== null && (I = Rt.dehydrated, I !== null)) {
        if (O)
          r.flags & 256 ? (Ni(r), r.flags &= -257, r = vh(
            i,
            r,
            u
          )) : r.memoizedState !== null ? (Tr(r), r.child = i.child, r.flags |= 128, r = null) : (Tr(r), S = E.fallback, I = r.mode, E = Vd(
            {
              mode: "visible",
              children: E.children
            },
            I
          ), S = Ur(
            S,
            I,
            u,
            null
          ), S.flags |= 2, E.return = r, S.return = r, E.sibling = S, r.child = E, n1(
            r,
            i.child,
            null,
            u
          ), E = r.child, E.memoizedState = ef(u), E.childLanes = iy(
            i,
            m,
            u
          ), r.memoizedState = TR, r = S);
        else if (Ni(r), Yn && console.error(
          "We should not be hydrating here. This is a bug in React. Please file a bug."
        ), Ju(I)) {
          if (m = I.nextSibling && I.nextSibling.dataset, m) {
            F = m.dgst;
            var Lt = m.msg;
            K = m.stck;
            var wt = m.cstck;
          }
          I = Lt, m = F, E = K, F = S = wt, S = Error(I || "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."), S.stack = E || "", S.digest = m, m = F === void 0 ? null : F, E = {
            value: S,
            source: null,
            stack: m
          }, typeof m == "string" && aR.set(
            S,
            E
          ), xu(E), r = vh(
            i,
            r,
            u
          );
        } else if (is || jr(
          i,
          r,
          u,
          !1
        ), m = (u & i.childLanes) !== 0, is || m) {
          if (m = Li, m !== null && (E = u & -u, E = (E & 42) !== 0 ? 1 : zi(
            E
          ), E = (E & (m.suspendedLanes | u)) !== 0 ? 0 : E, E !== 0 && E !== Rt.retryLane))
            throw Rt.retryLane = E, Gr(
              i,
              E
            ), gn(
              m,
              i,
              E
            ), T4;
          I.data === Xg || up(), r = vh(
            i,
            r,
            u
          );
        } else
          I.data === Xg ? (r.flags |= 192, r.child = i.child, r = null) : (i = Rt.treeContext, za = Jr(
            I.nextSibling
          ), xo = r, Yn = !0, $y = null, qg = !1, mc = null, Kh = !1, i !== null && (Ls(), dc[gc++] = Hg, dc[gc++] = Bg, dc[gc++] = Fy, Hg = i.id, Bg = i.overflow, Fy = r), r = qd(
            r,
            E.children
          ), r.flags |= 4096);
        return r;
      }
      return S ? (Tr(r), S = E.fallback, I = r.mode, F = i.child, K = F.sibling, E = Ns(
        F,
        {
          mode: "hidden",
          children: E.children
        }
      ), E.subtreeFlags = F.subtreeFlags & 65011712, K !== null ? S = Ns(
        K,
        S
      ) : (S = Ur(
        S,
        I,
        u,
        null
      ), S.flags |= 2), S.return = r, E.return = r, E.sibling = S, r.child = E, E = S, S = r.child, I = i.child.memoizedState, I === null ? I = ef(u) : (F = I.cachePool, F !== null ? (K = Cr._currentValue, F = F.parent !== K ? { parent: K, pool: K } : F) : F = ah(), I = {
        baseLanes: I.baseLanes | u,
        cachePool: F
      }), S.memoizedState = I, S.childLanes = iy(
        i,
        m,
        u
      ), r.memoizedState = TR, E) : (Ni(r), u = i.child, i = u.sibling, u = Ns(u, {
        mode: "visible",
        children: E.children
      }), u.return = r, u.sibling = null, i !== null && (m = r.deletions, m === null ? (r.deletions = [i], r.flags |= 16) : m.push(i)), r.child = u, r.memoizedState = null, u);
    }
    function qd(i, r) {
      return r = Vd(
        { mode: "visible", children: r },
        i.mode
      ), r.return = i, i.child = r;
    }
    function Vd(i, r) {
      return i = A(22, i, null, r), i.lanes = 0, i.stateNode = {
        _visibility: WS,
        _pendingMarkers: null,
        _retryCache: null,
        _transitions: null
      }, i;
    }
    function vh(i, r, u) {
      return n1(r, i.child, null, u), i = qd(
        r,
        r.pendingProps.children
      ), i.flags |= 2, r.memoizedState = null, i;
    }
    function ay(i, r, u) {
      i.lanes |= r;
      var m = i.alternate;
      m !== null && (m.lanes |= r), F0(
        i.return,
        r,
        u
      );
    }
    function Yd(i, r) {
      var u = Sa(i);
      return i = !u && typeof et(i) == "function", u || i ? (u = u ? "array" : "iterable", console.error(
        "A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",
        u,
        r,
        u
      ), !1) : !0;
    }
    function Fd(i, r, u, m, E) {
      var S = i.memoizedState;
      S === null ? i.memoizedState = {
        isBackwards: r,
        rendering: null,
        renderingStartTime: 0,
        last: m,
        tail: u,
        tailMode: E
      } : (S.isBackwards = r, S.rendering = null, S.renderingStartTime = 0, S.last = m, S.tail = u, S.tailMode = E);
    }
    function $d(i, r, u) {
      var m = r.pendingProps, E = m.revealOrder, S = m.tail;
      if (m = m.children, E !== void 0 && E !== "forwards" && E !== "backwards" && E !== "together" && !C4[E])
        if (C4[E] = !0, typeof E == "string")
          switch (E.toLowerCase()) {
            case "together":
            case "forwards":
            case "backwards":
              console.error(
                '"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',
                E,
                E.toLowerCase()
              );
              break;
            case "forward":
            case "backward":
              console.error(
                '"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',
                E,
                E.toLowerCase()
              );
              break;
            default:
              console.error(
                '"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
                E
              );
          }
        else
          console.error(
            '%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',
            E
          );
      S === void 0 || xR[S] || (S !== "collapsed" && S !== "hidden" ? (xR[S] = !0, console.error(
        '"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',
        S
      )) : E !== "forwards" && E !== "backwards" && (xR[S] = !0, console.error(
        '<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
        S
      )));
      t: if ((E === "forwards" || E === "backwards") && m !== void 0 && m !== null && m !== !1)
        if (Sa(m)) {
          for (var O = 0; O < m.length; O++)
            if (!Yd(m[O], O)) break t;
        } else if (O = et(m), typeof O == "function") {
          if (O = O.call(m))
            for (var I = O.next(), F = 0; !I.done; I = O.next()) {
              if (!Yd(I.value, F)) break t;
              F++;
            }
        } else
          console.error(
            'A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
            E
          );
      if (ta(i, r, m, u), m = Dr.current, (m & XE) !== 0)
        m = m & i1 | XE, r.flags |= 128;
      else {
        if (i !== null && (i.flags & 128) !== 0)
          t: for (i = r.child; i !== null; ) {
            if (i.tag === 13)
              i.memoizedState !== null && ay(
                i,
                u,
                r
              );
            else if (i.tag === 19)
              ay(i, u, r);
            else if (i.child !== null) {
              i.child.return = i, i = i.child;
              continue;
            }
            if (i === r) break t;
            for (; i.sibling === null; ) {
              if (i.return === null || i.return === r)
                break t;
              i = i.return;
            }
            i.sibling.return = i.return, i = i.sibling;
          }
        m &= i1;
      }
      switch (St(Dr, m, r), E) {
        case "forwards":
          for (u = r.child, E = null; u !== null; )
            i = u.alternate, i !== null && kd(i) === null && (E = u), u = u.sibling;
          u = E, u === null ? (E = r.child, r.child = null) : (E = u.sibling, u.sibling = null), Fd(
            r,
            !1,
            E,
            u,
            S
          );
          break;
        case "backwards":
          for (u = null, E = r.child, r.child = null; E !== null; ) {
            if (i = E.alternate, i !== null && kd(i) === null) {
              r.child = E;
              break;
            }
            i = E.sibling, E.sibling = u, u = E, E = i;
          }
          Fd(
            r,
            !0,
            u,
            null,
            S
          );
          break;
        case "together":
          Fd(r, !1, null, null, void 0);
          break;
        default:
          r.memoizedState = null;
      }
      return r.child;
    }
    function qo(i, r, u) {
      if (i !== null && (r.dependencies = i.dependencies), il = -1, $p |= r.lanes, (u & r.childLanes) === 0)
        if (i !== null) {
          if (jr(
            i,
            r,
            u,
            !1
          ), (u & r.childLanes) === 0)
            return null;
        } else return null;
      if (i !== null && r.child !== i.child)
        throw Error("Resuming work not yet implemented.");
      if (r.child !== null) {
        for (i = r.child, u = Ns(i, i.pendingProps), r.child = u, u.return = r; i.sibling !== null; )
          i = i.sibling, u = u.sibling = Ns(i, i.pendingProps), u.return = r;
        u.sibling = null;
      }
      return r.child;
    }
    function Xd(i, r) {
      return (i.lanes & r) !== 0 ? !0 : (i = i.dependencies, !!(i !== null && vr(i)));
    }
    function an(i, r, u) {
      switch (r.tag) {
        case 3:
          Ft(
            r,
            r.stateNode.containerInfo
          ), so(
            r,
            Cr,
            i.memoizedState.cache
          ), ih();
          break;
        case 27:
        case 5:
          gt(r);
          break;
        case 4:
          Ft(
            r,
            r.stateNode.containerInfo
          );
          break;
        case 10:
          so(
            r,
            r.type,
            r.memoizedProps.value
          );
          break;
        case 12:
          (u & r.childLanes) !== 0 && (r.flags |= 4), r.flags |= 2048;
          var m = r.stateNode;
          m.effectDuration = -0, m.passiveEffectDuration = -0;
          break;
        case 13:
          if (m = r.memoizedState, m !== null)
            return m.dehydrated !== null ? (Ni(r), r.flags |= 128, null) : (u & r.child.childLanes) !== 0 ? ep(
              i,
              r,
              u
            ) : (Ni(r), i = qo(
              i,
              r,
              u
            ), i !== null ? i.sibling : null);
          Ni(r);
          break;
        case 19:
          var E = (i.flags & 128) !== 0;
          if (m = (u & r.childLanes) !== 0, m || (jr(
            i,
            r,
            u,
            !1
          ), m = (u & r.childLanes) !== 0), E) {
            if (m)
              return $d(
                i,
                r,
                u
              );
            r.flags |= 128;
          }
          if (E = r.memoizedState, E !== null && (E.rendering = null, E.tail = null, E.lastEffect = null), St(
            Dr,
            Dr.current,
            r
          ), m) break;
          return null;
        case 22:
        case 23:
          return r.lanes = 0, Zm(i, r, u);
        case 24:
          so(
            r,
            Cr,
            i.memoizedState.cache
          );
      }
      return qo(i, r, u);
    }
    function zu(i, r, u) {
      if (r._debugNeedsRemount && i !== null) {
        u = Lm(
          r.type,
          r.key,
          r.pendingProps,
          r._debugOwner || null,
          r.mode,
          r.lanes
        ), u._debugStack = r._debugStack, u._debugTask = r._debugTask;
        var m = r.return;
        if (m === null) throw Error("Cannot swap the root fiber.");
        if (i.alternate = null, r.alternate = null, u.index = r.index, u.sibling = r.sibling, u.return = r.return, u.ref = r.ref, u._debugInfo = r._debugInfo, r === m.child)
          m.child = u;
        else {
          var E = m.child;
          if (E === null)
            throw Error("Expected parent to have a child.");
          for (; E.sibling !== r; )
            if (E = E.sibling, E === null)
              throw Error("Expected to find the previous sibling.");
          E.sibling = u;
        }
        return r = m.deletions, r === null ? (m.deletions = [i], m.flags |= 16) : r.push(i), u.flags |= 2, u;
      }
      if (i !== null)
        if (i.memoizedProps !== r.pendingProps || r.type !== i.type)
          is = !0;
        else {
          if (!Xd(i, u) && (r.flags & 128) === 0)
            return is = !1, an(
              i,
              r,
              u
            );
          is = (i.flags & 131072) !== 0;
        }
      else
        is = !1, (m = Yn) && (Ls(), m = (r.flags & 1048576) !== 0), m && (m = r.index, Ls(), Md(r, JS, m));
      switch (r.lanes = 0, r.tag) {
        case 16:
          t: if (m = r.pendingProps, i = Yp(r.elementType), r.type = i, typeof i == "function")
            eh(i) ? (m = Iu(
              i,
              m
            ), r.tag = 1, r.type = i = _u(i), r = Jm(
              null,
              r,
              i,
              m,
              u
            )) : (r.tag = 0, _h(r, i), r.type = i = _u(i), r = Qm(
              null,
              r,
              i,
              m,
              u
            ));
          else {
            if (i != null) {
              if (E = i.$$typeof, E === ac) {
                r.tag = 11, r.type = i = th(i), r = co(
                  null,
                  r,
                  i,
                  m,
                  u
                );
                break t;
              } else if (E === Rp) {
                r.tag = 14, r = Hd(
                  null,
                  r,
                  i,
                  m,
                  u
                );
                break t;
              }
            }
            throw r = "", i !== null && typeof i == "object" && i.$$typeof === ha && (r = " Did you wrap a component in React.lazy() more than once?"), i = ot(i) || i, Error(
              "Element type is invalid. Received a promise that resolves to: " + i + ". Lazy element type must resolve to a class or function." + r
            );
          }
          return r;
        case 0:
          return Qm(
            i,
            r,
            r.type,
            r.pendingProps,
            u
          );
        case 1:
          return m = r.type, E = Iu(
            m,
            r.pendingProps
          ), Jm(
            i,
            r,
            m,
            E,
            u
          );
        case 3:
          t: {
            if (Ft(
              r,
              r.stateNode.containerInfo
            ), i === null)
              throw Error(
                "Should have a current fiber. This is a bug in React."
              );
            m = r.pendingProps;
            var S = r.memoizedState;
            E = S.element, Od(i, r), Ml(r, m, null, u);
            var O = r.memoizedState;
            if (m = O.cache, so(r, Cr, m), m !== S.cache && _r(
              r,
              [Cr],
              u,
              !0
            ), Al(), m = O.element, S.isDehydrated)
              if (S = {
                element: m,
                isDehydrated: !1,
                cache: O.cache
              }, r.updateQueue.baseState = S, r.memoizedState = S, r.flags & 256) {
                r = tp(
                  i,
                  r,
                  m,
                  u
                );
                break t;
              } else if (m !== E) {
                E = Ji(
                  Error(
                    "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
                  ),
                  r
                ), xu(E), r = tp(
                  i,
                  r,
                  m,
                  u
                );
                break t;
              } else {
                switch (i = r.stateNode.containerInfo, i.nodeType) {
                  case 9:
                    i = i.body;
                    break;
                  default:
                    i = i.nodeName === "HTML" ? i.ownerDocument.body : i;
                }
                for (za = Jr(i.firstChild), xo = r, Yn = !0, $y = null, qg = !1, mc = null, Kh = !0, i = h4(
                  r,
                  null,
                  m,
                  u
                ), r.child = i; i; )
                  i.flags = i.flags & -3 | 4096, i = i.sibling;
              }
            else {
              if (ih(), m === E) {
                r = qo(
                  i,
                  r,
                  u
                );
                break t;
              }
              ta(
                i,
                r,
                m,
                u
              );
            }
            r = r.child;
          }
          return r;
        case 26:
          return tf(i, r), i === null ? (i = yg(
            r.type,
            null,
            r.pendingProps,
            null
          )) ? r.memoizedState = i : Yn || (i = r.type, u = r.pendingProps, m = Ut(
            Xo.current
          ), m = In(
            m
          ).createElement(i), m[fr] = r, m[es] = u, Na(m, i, u), dt(m), r.stateNode = m) : r.memoizedState = yg(
            r.type,
            i.memoizedProps,
            r.pendingProps,
            i.memoizedState
          ), null;
        case 27:
          return gt(r), i === null && Yn && (m = Ut(Xo.current), E = J(), m = r.stateNode = ts(
            r.type,
            r.pendingProps,
            m,
            E,
            !1
          ), qg || (E = pn(
            m,
            r.type,
            r.pendingProps,
            E
          ), E !== null && (Vc(r, 0).serverProps = E)), xo = r, Kh = !0, E = za, ba(r.type) ? ($R = E, za = Jr(
            m.firstChild
          )) : za = E), ta(
            i,
            r,
            r.pendingProps.children,
            u
          ), tf(i, r), i === null && (r.flags |= 4194304), r.child;
        case 5:
          return i === null && Yn && (S = J(), m = bd(
            r.type,
            S.ancestorInfo
          ), E = za, (O = !E) || (O = Ka(
            E,
            r.type,
            r.pendingProps,
            Kh
          ), O !== null ? (r.stateNode = O, qg || (S = pn(
            O,
            r.type,
            r.pendingProps,
            S
          ), S !== null && (Vc(r, 0).serverProps = S)), xo = r, za = Jr(
            O.firstChild
          ), Kh = !1, S = !0) : S = !1, O = !S), O && (m && nh(r, E), Su(r))), gt(r), E = r.type, S = r.pendingProps, O = i !== null ? i.memoizedProps : null, m = S.children, Ku(E, S) ? m = null : O !== null && Ku(E, O) && (r.flags |= 32), r.memoizedState !== null && (E = sh(
            i,
            r,
            Gs,
            null,
            null,
            u
          ), ub._currentValue = E), tf(i, r), ta(
            i,
            r,
            m,
            u
          ), r.child;
        case 6:
          return i === null && Yn && (i = r.pendingProps, u = J(), m = u.ancestorInfo.current, i = m != null ? Yf(
            i,
            m.tag,
            u.ancestorInfo.implicitRootScope
          ) : !0, u = za, (m = !u) || (m = Qu(
            u,
            r.pendingProps,
            Kh
          ), m !== null ? (r.stateNode = m, xo = r, za = null, m = !0) : m = !1, m = !m), m && (i && nh(r, u), Su(r))), null;
        case 13:
          return ep(i, r, u);
        case 4:
          return Ft(
            r,
            r.stateNode.containerInfo
          ), m = r.pendingProps, i === null ? r.child = n1(
            r,
            null,
            m,
            u
          ) : ta(
            i,
            r,
            m,
            u
          ), r.child;
        case 11:
          return co(
            i,
            r,
            r.type,
            r.pendingProps,
            u
          );
        case 7:
          return ta(
            i,
            r,
            r.pendingProps,
            u
          ), r.child;
        case 8:
          return ta(
            i,
            r,
            r.pendingProps.children,
            u
          ), r.child;
        case 12:
          return r.flags |= 4, r.flags |= 2048, m = r.stateNode, m.effectDuration = -0, m.passiveEffectDuration = -0, ta(
            i,
            r,
            r.pendingProps.children,
            u
          ), r.child;
        case 10:
          return m = r.type, E = r.pendingProps, S = E.value, "value" in E || O4 || (O4 = !0, console.error(
            "The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"
          )), so(r, m, S), ta(
            i,
            r,
            E.children,
            u
          ), r.child;
        case 9:
          return E = r.type._context, m = r.pendingProps.children, typeof m != "function" && console.error(
            "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
          ), wl(r), E = xi(E), ce(r), m = yR(
            m,
            E,
            void 0
          ), pe(), r.flags |= 1, ta(
            i,
            r,
            m,
            u
          ), r.child;
        case 14:
          return Hd(
            i,
            r,
            r.type,
            r.pendingProps,
            u
          );
        case 15:
          return Km(
            i,
            r,
            r.type,
            r.pendingProps,
            u
          );
        case 19:
          return $d(
            i,
            r,
            u
          );
        case 31:
          return m = r.pendingProps, u = r.mode, m = {
            mode: m.mode,
            children: m.children
          }, i === null ? (i = Vd(
            m,
            u
          ), i.ref = r.ref, r.child = i, i.return = r, r = i) : (i = Ns(i.child, m), i.ref = r.ref, r.child = i, i.return = r, r = i), r;
        case 22:
          return Zm(i, r, u);
        case 24:
          return wl(r), m = xi(Cr), i === null ? (E = X0(), E === null && (E = Li, S = $0(), E.pooledCache = S, Ps(S), S !== null && (E.pooledCacheLanes |= u), E = S), r.memoizedState = {
            parent: m,
            cache: E
          }, Tu(r), so(r, Cr, E)) : ((i.lanes & u) !== 0 && (Od(i, r), Ml(r, null, null, u), Al()), E = i.memoizedState, S = r.memoizedState, E.parent !== m ? (E = {
            parent: m,
            cache: m
          }, r.memoizedState = E, r.lanes === 0 && (r.memoizedState = r.updateQueue.baseState = E), so(r, Cr, m)) : (m = S.cache, so(r, Cr, m), m !== E.cache && _r(
            r,
            [Cr],
            u,
            !0
          ))), ta(
            i,
            r,
            r.pendingProps.children,
            u
          ), r.child;
        case 29:
          throw r.pendingProps;
      }
      throw Error(
        "Unknown unit of work tag (" + r.tag + "). This error is likely caused by a bug in React. Please file an issue."
      );
    }
    function js(i) {
      i.flags |= 4;
    }
    function nf(i, r) {
      if (r.type !== "stylesheet" || (r.state.loading & Ec) !== l_)
        i.flags &= -16777217;
      else if (i.flags |= 16777216, !Cy(r)) {
        if (r = vc.current, r !== null && ((An & 4194048) === An ? Wh !== null : (An & 62914560) !== An && (An & 536870912) === 0 || r !== Wh))
          throw VE = cR, kO;
        i.flags |= 8192;
      }
    }
    function Gu(i, r) {
      r !== null && (i.flags |= 4), i.flags & 16384 && (r = i.tag !== 22 ? Zi() : 536870912, i.lanes |= r, n_ |= r);
    }
    function Ul(i, r) {
      if (!Yn)
        switch (i.tailMode) {
          case "hidden":
            r = i.tail;
            for (var u = null; r !== null; )
              r.alternate !== null && (u = r), r = r.sibling;
            u === null ? i.tail = null : u.sibling = null;
            break;
          case "collapsed":
            u = i.tail;
            for (var m = null; u !== null; )
              u.alternate !== null && (m = u), u = u.sibling;
            m === null ? r || i.tail === null ? i.tail = null : i.tail.sibling = null : m.sibling = null;
        }
    }
    function Ti(i) {
      var r = i.alternate !== null && i.alternate.child === i.child, u = 0, m = 0;
      if (r)
        if ((i.mode & bs) !== Vi) {
          for (var E = i.selfBaseDuration, S = i.child; S !== null; )
            u |= S.lanes | S.childLanes, m |= S.subtreeFlags & 65011712, m |= S.flags & 65011712, E += S.treeBaseDuration, S = S.sibling;
          i.treeBaseDuration = E;
        } else
          for (E = i.child; E !== null; )
            u |= E.lanes | E.childLanes, m |= E.subtreeFlags & 65011712, m |= E.flags & 65011712, E.return = i, E = E.sibling;
      else if ((i.mode & bs) !== Vi) {
        E = i.actualDuration, S = i.selfBaseDuration;
        for (var O = i.child; O !== null; )
          u |= O.lanes | O.childLanes, m |= O.subtreeFlags, m |= O.flags, E += O.actualDuration, S += O.treeBaseDuration, O = O.sibling;
        i.actualDuration = E, i.treeBaseDuration = S;
      } else
        for (E = i.child; E !== null; )
          u |= E.lanes | E.childLanes, m |= E.subtreeFlags, m |= E.flags, E.return = i, E = E.sibling;
      return i.subtreeFlags |= m, i.childLanes = u, r;
    }
    function ps(i, r, u) {
      var m = r.pendingProps;
      switch (bu(r), r.tag) {
        case 31:
        case 16:
        case 15:
        case 0:
        case 11:
        case 7:
        case 8:
        case 12:
        case 9:
        case 14:
          return Ti(r), null;
        case 1:
          return Ti(r), null;
        case 3:
          return u = r.stateNode, m = null, i !== null && (m = i.memoizedState.cache), r.memoizedState.cache !== m && (r.flags |= 2048), Tl(Cr, r), nt(r), u.pendingContext && (u.context = u.pendingContext, u.pendingContext = null), (i === null || i.child === null) && (Is(r) ? (Y0(), js(r)) : i === null || i.memoizedState.isDehydrated && (r.flags & 256) === 0 || (r.flags |= 1024, V0())), Ti(r), null;
        case 26:
          return u = r.memoizedState, i === null ? (js(r), u !== null ? (Ti(r), nf(
            r,
            u
          )) : (Ti(r), r.flags &= -16777217)) : u ? u !== i.memoizedState ? (js(r), Ti(r), nf(
            r,
            u
          )) : (Ti(r), r.flags &= -16777217) : (i.memoizedProps !== m && js(r), Ti(r), r.flags &= -16777217), null;
        case 27:
          Ot(r), u = Ut(Xo.current);
          var E = r.type;
          if (i !== null && r.stateNode != null)
            i.memoizedProps !== m && js(r);
          else {
            if (!m) {
              if (r.stateNode === null)
                throw Error(
                  "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
                );
              return Ti(r), null;
            }
            i = J(), Is(r) ? q0(r) : (i = ts(
              E,
              m,
              u,
              i,
              !0
            ), r.stateNode = i, js(r));
          }
          return Ti(r), null;
        case 5:
          if (Ot(r), u = r.type, i !== null && r.stateNode != null)
            i.memoizedProps !== m && js(r);
          else {
            if (!m) {
              if (r.stateNode === null)
                throw Error(
                  "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
                );
              return Ti(r), null;
            }
            if (E = J(), Is(r))
              q0(r);
            else {
              switch (i = Ut(Xo.current), bd(u, E.ancestorInfo), E = E.context, i = In(i), E) {
                case g1:
                  i = i.createElementNS(au, u);
                  break;
                case Rx:
                  i = i.createElementNS(
                    jp,
                    u
                  );
                  break;
                default:
                  switch (u) {
                    case "svg":
                      i = i.createElementNS(
                        au,
                        u
                      );
                      break;
                    case "math":
                      i = i.createElementNS(
                        jp,
                        u
                      );
                      break;
                    case "script":
                      i = i.createElement("div"), i.innerHTML = "<script><\/script>", i = i.removeChild(i.firstChild);
                      break;
                    case "select":
                      i = typeof m.is == "string" ? i.createElement("select", { is: m.is }) : i.createElement("select"), m.multiple ? i.multiple = !0 : m.size && (i.size = m.size);
                      break;
                    default:
                      i = typeof m.is == "string" ? i.createElement(u, {
                        is: m.is
                      }) : i.createElement(u), u.indexOf("-") === -1 && (u !== u.toLowerCase() && console.error(
                        "<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",
                        u
                      ), Object.prototype.toString.call(i) !== "[object HTMLUnknownElement]" || Ko.call(
                        K4,
                        u
                      ) || (K4[u] = !0, console.error(
                        "The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",
                        u
                      )));
                  }
              }
              i[fr] = r, i[es] = m;
              t: for (E = r.child; E !== null; ) {
                if (E.tag === 5 || E.tag === 6)
                  i.appendChild(E.stateNode);
                else if (E.tag !== 4 && E.tag !== 27 && E.child !== null) {
                  E.child.return = E, E = E.child;
                  continue;
                }
                if (E === r) break t;
                for (; E.sibling === null; ) {
                  if (E.return === null || E.return === r)
                    break t;
                  E = E.return;
                }
                E.sibling.return = E.return, E = E.sibling;
              }
              r.stateNode = i;
              t: switch (Na(i, u, m), u) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  i = !!m.autoFocus;
                  break t;
                case "img":
                  i = !0;
                  break t;
                default:
                  i = !1;
              }
              i && js(r);
            }
          }
          return Ti(r), r.flags &= -16777217, null;
        case 6:
          if (i && r.stateNode != null)
            i.memoizedProps !== m && js(r);
          else {
            if (typeof m != "string" && r.stateNode === null)
              throw Error(
                "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
              );
            if (i = Ut(Xo.current), u = J(), Is(r)) {
              i = r.stateNode, u = r.memoizedProps, E = !qg, m = null;
              var S = xo;
              if (S !== null)
                switch (S.tag) {
                  case 3:
                    E && (E = Ry(
                      i,
                      u,
                      m
                    ), E !== null && (Vc(r, 0).serverProps = E));
                    break;
                  case 27:
                  case 5:
                    m = S.memoizedProps, E && (E = Ry(
                      i,
                      u,
                      m
                    ), E !== null && (Vc(
                      r,
                      0
                    ).serverProps = E));
                }
              i[fr] = r, i = !!(i.nodeValue === u || m !== null && m.suppressHydrationWarning === !0 || cf(i.nodeValue, u)), i || Su(r);
            } else
              E = u.ancestorInfo.current, E != null && Yf(
                m,
                E.tag,
                u.ancestorInfo.implicitRootScope
              ), i = In(i).createTextNode(
                m
              ), i[fr] = r, r.stateNode = i;
          }
          return Ti(r), null;
        case 13:
          if (m = r.memoizedState, i === null || i.memoizedState !== null && i.memoizedState.dehydrated !== null) {
            if (E = Is(r), m !== null && m.dehydrated !== null) {
              if (i === null) {
                if (!E)
                  throw Error(
                    "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."
                  );
                if (E = r.memoizedState, E = E !== null ? E.dehydrated : null, !E)
                  throw Error(
                    "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
                  );
                E[fr] = r, Ti(r), (r.mode & bs) !== Vi && m !== null && (E = r.child, E !== null && (r.treeBaseDuration -= E.treeBaseDuration));
              } else
                Y0(), ih(), (r.flags & 128) === 0 && (r.memoizedState = null), r.flags |= 4, Ti(r), (r.mode & bs) !== Vi && m !== null && (E = r.child, E !== null && (r.treeBaseDuration -= E.treeBaseDuration));
              E = !1;
            } else
              E = V0(), i !== null && i.memoizedState !== null && (i.memoizedState.hydrationErrors = E), E = !0;
            if (!E)
              return r.flags & 256 ? (fa(r), r) : (fa(r), null);
          }
          return fa(r), (r.flags & 128) !== 0 ? (r.lanes = u, (r.mode & bs) !== Vi && Yc(r), r) : (u = m !== null, i = i !== null && i.memoizedState !== null, u && (m = r.child, E = null, m.alternate !== null && m.alternate.memoizedState !== null && m.alternate.memoizedState.cachePool !== null && (E = m.alternate.memoizedState.cachePool.pool), S = null, m.memoizedState !== null && m.memoizedState.cachePool !== null && (S = m.memoizedState.cachePool.pool), S !== E && (m.flags |= 2048)), u !== i && u && (r.child.flags |= 8192), Gu(r, r.updateQueue), Ti(r), (r.mode & bs) !== Vi && u && (i = r.child, i !== null && (r.treeBaseDuration -= i.treeBaseDuration)), null);
        case 4:
          return nt(r), i === null && hg(
            r.stateNode.containerInfo
          ), Ti(r), null;
        case 10:
          return Tl(r.type, r), Ti(r), null;
        case 19:
          if (mt(Dr, r), E = r.memoizedState, E === null) return Ti(r), null;
          if (m = (r.flags & 128) !== 0, S = E.rendering, S === null)
            if (m) Ul(E, !1);
            else {
              if (Ga !== $g || i !== null && (i.flags & 128) !== 0)
                for (i = r.child; i !== null; ) {
                  if (S = kd(i), S !== null) {
                    for (r.flags |= 128, Ul(E, !1), i = S.updateQueue, r.updateQueue = i, Gu(r, i), r.subtreeFlags = 0, i = u, u = r.child; u !== null; )
                      Nm(u, i), u = u.sibling;
                    return St(
                      Dr,
                      Dr.current & i1 | XE,
                      r
                    ), r.child;
                  }
                  i = i.sibling;
                }
              E.tail !== null && aa() > gx && (r.flags |= 128, m = !0, Ul(E, !1), r.lanes = 4194304);
            }
          else {
            if (!m)
              if (i = kd(S), i !== null) {
                if (r.flags |= 128, m = !0, i = i.updateQueue, r.updateQueue = i, Gu(r, i), Ul(E, !0), E.tail === null && E.tailMode === "hidden" && !S.alternate && !Yn)
                  return Ti(r), null;
              } else
                2 * aa() - E.renderingStartTime > gx && u !== 536870912 && (r.flags |= 128, m = !0, Ul(E, !1), r.lanes = 4194304);
            E.isBackwards ? (S.sibling = r.child, r.child = S) : (i = E.last, i !== null ? i.sibling = S : r.child = S, E.last = S);
          }
          return E.tail !== null ? (i = E.tail, E.rendering = i, E.tail = i.sibling, E.renderingStartTime = aa(), i.sibling = null, u = Dr.current, u = m ? u & i1 | XE : u & i1, St(Dr, u, r), i) : (Ti(r), null);
        case 22:
        case 23:
          return fa(r), Fc(r), m = r.memoizedState !== null, i !== null ? i.memoizedState !== null !== m && (r.flags |= 8192) : m && (r.flags |= 8192), m ? (u & 536870912) !== 0 && (r.flags & 128) === 0 && (Ti(r), r.subtreeFlags & 6 && (r.flags |= 8192)) : Ti(r), u = r.updateQueue, u !== null && Gu(r, u.retryQueue), u = null, i !== null && i.memoizedState !== null && i.memoizedState.cachePool !== null && (u = i.memoizedState.cachePool.pool), m = null, r.memoizedState !== null && r.memoizedState.cachePool !== null && (m = r.memoizedState.cachePool.pool), m !== u && (r.flags |= 2048), i !== null && mt(Zy, r), null;
        case 24:
          return u = null, i !== null && (u = i.memoizedState.cache), r.memoizedState.cache !== u && (r.flags |= 2048), Tl(Cr, r), Ti(r), null;
        case 25:
          return null;
        case 30:
          return null;
      }
      throw Error(
        "Unknown unit of work tag (" + r.tag + "). This error is likely caused by a bug in React. Please file an issue."
      );
    }
    function hv(i, r) {
      switch (bu(r), r.tag) {
        case 1:
          return i = r.flags, i & 65536 ? (r.flags = i & -65537 | 128, (r.mode & bs) !== Vi && Yc(r), r) : null;
        case 3:
          return Tl(Cr, r), nt(r), i = r.flags, (i & 65536) !== 0 && (i & 128) === 0 ? (r.flags = i & -65537 | 128, r) : null;
        case 26:
        case 27:
        case 5:
          return Ot(r), null;
        case 13:
          if (fa(r), i = r.memoizedState, i !== null && i.dehydrated !== null) {
            if (r.alternate === null)
              throw Error(
                "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."
              );
            ih();
          }
          return i = r.flags, i & 65536 ? (r.flags = i & -65537 | 128, (r.mode & bs) !== Vi && Yc(r), r) : null;
        case 19:
          return mt(Dr, r), null;
        case 4:
          return nt(r), null;
        case 10:
          return Tl(r.type, r), null;
        case 22:
        case 23:
          return fa(r), Fc(r), i !== null && mt(Zy, r), i = r.flags, i & 65536 ? (r.flags = i & -65537 | 128, (r.mode & bs) !== Vi && Yc(r), r) : null;
        case 24:
          return Tl(Cr, r), null;
        case 25:
          return null;
        default:
          return null;
      }
    }
    function Eh(i, r) {
      switch (bu(r), r.tag) {
        case 3:
          Tl(Cr, r), nt(r);
          break;
        case 26:
        case 27:
        case 5:
          Ot(r);
          break;
        case 4:
          nt(r);
          break;
        case 13:
          fa(r);
          break;
        case 19:
          mt(Dr, r);
          break;
        case 10:
          Tl(r.type, r);
          break;
        case 22:
        case 23:
          fa(r), Fc(r), i !== null && mt(Zy, r);
          break;
        case 24:
          Tl(Cr, r);
      }
    }
    function ys(i) {
      return (i.mode & bs) !== Vi;
    }
    function np(i, r) {
      ys(i) ? (Xe(), Ma(r, i), Kn()) : Ma(r, i);
    }
    function bh(i, r, u) {
      ys(i) ? (Xe(), Fr(
        u,
        i,
        r
      ), Kn()) : Fr(
        u,
        i,
        r
      );
    }
    function Ma(i, r) {
      try {
        var u = r.updateQueue, m = u !== null ? u.lastEffect : null;
        if (m !== null) {
          var E = m.next;
          u = E;
          do {
            if ((u.tag & i) === i && ((i & Or) !== pc ? ie !== null && typeof ie.markComponentPassiveEffectMountStarted == "function" && ie.markComponentPassiveEffectMountStarted(
              r
            ) : (i & Ss) !== pc && ie !== null && typeof ie.markComponentLayoutEffectMountStarted == "function" && ie.markComponentLayoutEffectMountStarted(
              r
            ), m = void 0, (i & To) !== pc && (h1 = !0), m = de(
              r,
              bI,
              u
            ), (i & To) !== pc && (h1 = !1), (i & Or) !== pc ? ie !== null && typeof ie.markComponentPassiveEffectMountStopped == "function" && ie.markComponentPassiveEffectMountStopped() : (i & Ss) !== pc && ie !== null && typeof ie.markComponentLayoutEffectMountStopped == "function" && ie.markComponentLayoutEffectMountStopped(), m !== void 0 && typeof m != "function")) {
              var S = void 0;
              S = (u.tag & Ss) !== 0 ? "useLayoutEffect" : (u.tag & To) !== 0 ? "useInsertionEffect" : "useEffect";
              var O = void 0;
              O = m === null ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof m.then == "function" ? `

It looks like you wrote ` + S + `(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

` + S + `(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching` : " You returned: " + m, de(
                r,
                function(I, F) {
                  console.error(
                    "%s must not return anything besides a function, which is used for clean-up.%s",
                    I,
                    F
                  );
                },
                S,
                O
              );
            }
            u = u.next;
          } while (u !== E);
        }
      } catch (I) {
        Wn(r, r.return, I);
      }
    }
    function Fr(i, r, u) {
      try {
        var m = r.updateQueue, E = m !== null ? m.lastEffect : null;
        if (E !== null) {
          var S = E.next;
          m = S;
          do {
            if ((m.tag & i) === i) {
              var O = m.inst, I = O.destroy;
              I !== void 0 && (O.destroy = void 0, (i & Or) !== pc ? ie !== null && typeof ie.markComponentPassiveEffectUnmountStarted == "function" && ie.markComponentPassiveEffectUnmountStarted(
                r
              ) : (i & Ss) !== pc && ie !== null && typeof ie.markComponentLayoutEffectUnmountStarted == "function" && ie.markComponentLayoutEffectUnmountStarted(
                r
              ), (i & To) !== pc && (h1 = !0), E = r, de(
                E,
                SI,
                E,
                u,
                I
              ), (i & To) !== pc && (h1 = !1), (i & Or) !== pc ? ie !== null && typeof ie.markComponentPassiveEffectUnmountStopped == "function" && ie.markComponentPassiveEffectUnmountStopped() : (i & Ss) !== pc && ie !== null && typeof ie.markComponentLayoutEffectUnmountStopped == "function" && ie.markComponentLayoutEffectUnmountStopped());
            }
            m = m.next;
          } while (m !== S);
        }
      } catch (F) {
        Wn(r, r.return, F);
      }
    }
    function Sh(i, r) {
      ys(i) ? (Xe(), Ma(r, i), Kn()) : Ma(r, i);
    }
    function Kd(i, r, u) {
      ys(i) ? (Xe(), Fr(
        u,
        i,
        r
      ), Kn()) : Fr(
        u,
        i,
        r
      );
    }
    function xh(i) {
      var r = i.updateQueue;
      if (r !== null) {
        var u = i.stateNode;
        i.type.defaultProps || "ref" in i.memoizedProps || r1 || (u.props !== i.memoizedProps && console.error(
          "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",
          ht(i) || "instance"
        ), u.state !== i.memoizedState && console.error(
          "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",
          ht(i) || "instance"
        ));
        try {
          de(
            i,
            Er,
            r,
            u
          );
        } catch (m) {
          Wn(i, i.return, m);
        }
      }
    }
    function dv(i, r, u) {
      return i.getSnapshotBeforeUpdate(r, u);
    }
    function Zd(i, r) {
      var u = r.memoizedProps, m = r.memoizedState;
      r = i.stateNode, i.type.defaultProps || "ref" in i.memoizedProps || r1 || (r.props !== i.memoizedProps && console.error(
        "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",
        ht(i) || "instance"
      ), r.state !== i.memoizedState && console.error(
        "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",
        ht(i) || "instance"
      ));
      try {
        var E = Iu(
          i.type,
          u,
          i.elementType === i.type
        ), S = de(
          i,
          dv,
          r,
          E,
          m
        );
        u = D4, S !== void 0 || u.has(i.type) || (u.add(i.type), de(i, function() {
          console.error(
            "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",
            ht(i)
          );
        })), r.__reactInternalSnapshotBeforeUpdate = S;
      } catch (O) {
        Wn(i, i.return, O);
      }
    }
    function ip(i, r, u) {
      u.props = Iu(
        i.type,
        i.memoizedProps
      ), u.state = i.memoizedState, ys(i) ? (Xe(), de(
        i,
        a4,
        i,
        r,
        u
      ), Kn()) : de(
        i,
        a4,
        i,
        r,
        u
      );
    }
    function ap(i) {
      var r = i.ref;
      if (r !== null) {
        switch (i.tag) {
          case 26:
          case 27:
          case 5:
            var u = i.stateNode;
            break;
          case 30:
            u = i.stateNode;
            break;
          default:
            u = i.stateNode;
        }
        if (typeof r == "function")
          if (ys(i))
            try {
              Xe(), i.refCleanup = r(u);
            } finally {
              Kn();
            }
          else i.refCleanup = r(u);
        else
          typeof r == "string" ? console.error("String refs are no longer supported.") : r.hasOwnProperty("current") || console.error(
            "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",
            ht(i)
          ), r.current = u;
      }
    }
    function jl(i, r) {
      try {
        de(i, ap, i);
      } catch (u) {
        Wn(i, r, u);
      }
    }
    function Ca(i, r) {
      var u = i.ref, m = i.refCleanup;
      if (u !== null)
        if (typeof m == "function")
          try {
            if (ys(i))
              try {
                Xe(), de(i, m);
              } finally {
                Kn(i);
              }
            else de(i, m);
          } catch (E) {
            Wn(i, r, E);
          } finally {
            i.refCleanup = null, i = i.alternate, i != null && (i.refCleanup = null);
          }
        else if (typeof u == "function")
          try {
            if (ys(i))
              try {
                Xe(), de(i, u, null);
              } finally {
                Kn(i);
              }
            else de(i, u, null);
          } catch (E) {
            Wn(i, r, E);
          }
        else u.current = null;
    }
    function ry(i, r, u, m) {
      var E = i.memoizedProps, S = E.id, O = E.onCommit;
      E = E.onRender, r = r === null ? "mount" : "update", nx && (r = "nested-update"), typeof E == "function" && E(
        S,
        r,
        i.actualDuration,
        i.treeBaseDuration,
        i.actualStartTime,
        u
      ), typeof O == "function" && O(
        i.memoizedProps.id,
        r,
        m,
        u
      );
    }
    function Uu(i, r, u, m) {
      var E = i.memoizedProps;
      i = E.id, E = E.onPostCommit, r = r === null ? "mount" : "update", nx && (r = "nested-update"), typeof E == "function" && E(
        i,
        r,
        m,
        u
      );
    }
    function sy(i) {
      var r = i.type, u = i.memoizedProps, m = i.stateNode;
      try {
        de(
          i,
          Hi,
          m,
          r,
          u,
          i
        );
      } catch (E) {
        Wn(i, i.return, E);
      }
    }
    function Wd(i, r, u) {
      try {
        de(
          i,
          Zu,
          i.stateNode,
          i.type,
          u,
          r,
          i
        );
      } catch (m) {
        Wn(i, i.return, m);
      }
    }
    function ju(i) {
      return i.tag === 5 || i.tag === 3 || i.tag === 26 || i.tag === 27 && ba(i.type) || i.tag === 4;
    }
    function Qd(i) {
      t: for (; ; ) {
        for (; i.sibling === null; ) {
          if (i.return === null || ju(i.return)) return null;
          i = i.return;
        }
        for (i.sibling.return = i.return, i = i.sibling; i.tag !== 5 && i.tag !== 6 && i.tag !== 18; ) {
          if (i.tag === 27 && ba(i.type) || i.flags & 2 || i.child === null || i.tag === 4) continue t;
          i.child.return = i, i = i.child;
        }
        if (!(i.flags & 2)) return i.stateNode;
      }
    }
    function Th(i, r, u) {
      var m = i.tag;
      if (m === 5 || m === 6)
        i = i.stateNode, r ? (u.nodeType === 9 ? u.body : u.nodeName === "HTML" ? u.ownerDocument.body : u).insertBefore(i, r) : (r = u.nodeType === 9 ? u.body : u.nodeName === "HTML" ? u.ownerDocument.body : u, r.appendChild(i), u = u._reactRootContainer, u != null || r.onclick !== null || (r.onclick = $u));
      else if (m !== 4 && (m === 27 && ba(i.type) && (u = i.stateNode, r = null), i = i.child, i !== null))
        for (Th(i, r, u), i = i.sibling; i !== null; )
          Th(i, r, u), i = i.sibling;
    }
    function Jd(i, r, u) {
      var m = i.tag;
      if (m === 5 || m === 6)
        i = i.stateNode, r ? u.insertBefore(i, r) : u.appendChild(i);
      else if (m !== 4 && (m === 27 && ba(i.type) && (u = i.stateNode), i = i.child, i !== null))
        for (Jd(i, r, u), i = i.sibling; i !== null; )
          Jd(i, r, u), i = i.sibling;
    }
    function oy(i) {
      for (var r, u = i.return; u !== null; ) {
        if (ju(u)) {
          r = u;
          break;
        }
        u = u.return;
      }
      if (r == null)
        throw Error(
          "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
        );
      switch (r.tag) {
        case 27:
          r = r.stateNode, u = Qd(i), Jd(
            i,
            u,
            r
          );
          break;
        case 5:
          u = r.stateNode, r.flags & 32 && (Wu(u), r.flags &= -33), r = Qd(i), Jd(
            i,
            r,
            u
          );
          break;
        case 3:
        case 4:
          r = r.stateNode.containerInfo, u = Qd(i), Th(
            i,
            u,
            r
          );
          break;
        default:
          throw Error(
            "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
          );
      }
    }
    function wh(i) {
      var r = i.stateNode, u = i.memoizedProps;
      try {
        de(
          i,
          Sv,
          i.type,
          u,
          r,
          i
        );
      } catch (m) {
        Wn(i, i.return, m);
      }
    }
    function gv(i, r) {
      if (i = i.containerInfo, VR = Ox, i = ov(i), Mm(i)) {
        if ("selectionStart" in i)
          var u = {
            start: i.selectionStart,
            end: i.selectionEnd
          };
        else
          t: {
            u = (u = i.ownerDocument) && u.defaultView || window;
            var m = u.getSelection && u.getSelection();
            if (m && m.rangeCount !== 0) {
              u = m.anchorNode;
              var E = m.anchorOffset, S = m.focusNode;
              m = m.focusOffset;
              try {
                u.nodeType, S.nodeType;
              } catch {
                u = null;
                break t;
              }
              var O = 0, I = -1, F = -1, K = 0, Rt = 0, Lt = i, wt = null;
              e: for (; ; ) {
                for (var zt; Lt !== u || E !== 0 && Lt.nodeType !== 3 || (I = O + E), Lt !== S || m !== 0 && Lt.nodeType !== 3 || (F = O + m), Lt.nodeType === 3 && (O += Lt.nodeValue.length), (zt = Lt.firstChild) !== null; )
                  wt = Lt, Lt = zt;
                for (; ; ) {
                  if (Lt === i) break e;
                  if (wt === u && ++K === E && (I = O), wt === S && ++Rt === m && (F = O), (zt = Lt.nextSibling) !== null) break;
                  Lt = wt, wt = Lt.parentNode;
                }
                Lt = zt;
              }
              u = I === -1 || F === -1 ? null : { start: I, end: F };
            } else u = null;
          }
        u = u || { start: 0, end: 0 };
      } else u = null;
      for (YR = {
        focusedElem: i,
        selectionRange: u
      }, Ox = !1, as = r; as !== null; )
        if (r = as, i = r.child, (r.subtreeFlags & 1024) !== 0 && i !== null)
          i.return = r, as = i;
        else
          for (; as !== null; ) {
            switch (i = r = as, u = i.alternate, E = i.flags, i.tag) {
              case 0:
                break;
              case 11:
              case 15:
                break;
              case 1:
                (E & 1024) !== 0 && u !== null && Zd(i, u);
                break;
              case 3:
                if ((E & 1024) !== 0) {
                  if (i = i.stateNode.containerInfo, u = i.nodeType, u === 9)
                    $o(i);
                  else if (u === 1)
                    switch (i.nodeName) {
                      case "HEAD":
                      case "HTML":
                      case "BODY":
                        $o(i);
                        break;
                      default:
                        i.textContent = "";
                    }
                }
                break;
              case 5:
              case 26:
              case 27:
              case 6:
              case 4:
              case 17:
                break;
              default:
                if ((E & 1024) !== 0)
                  throw Error(
                    "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
                  );
            }
            if (i = r.sibling, i !== null) {
              i.return = r.return, as = i;
              break;
            }
            as = r.return;
          }
    }
    function rp(i, r, u) {
      var m = u.flags;
      switch (u.tag) {
        case 0:
        case 11:
        case 15:
          ea(i, u), m & 4 && np(u, Ss | yc);
          break;
        case 1:
          if (ea(i, u), m & 4)
            if (i = u.stateNode, r === null)
              u.type.defaultProps || "ref" in u.memoizedProps || r1 || (i.props !== u.memoizedProps && console.error(
                "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",
                ht(u) || "instance"
              ), i.state !== u.memoizedState && console.error(
                "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",
                ht(u) || "instance"
              )), ys(u) ? (Xe(), de(
                u,
                _R,
                u,
                i
              ), Kn()) : de(
                u,
                _R,
                u,
                i
              );
            else {
              var E = Iu(
                u.type,
                r.memoizedProps
              );
              r = r.memoizedState, u.type.defaultProps || "ref" in u.memoizedProps || r1 || (i.props !== u.memoizedProps && console.error(
                "Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",
                ht(u) || "instance"
              ), i.state !== u.memoizedState && console.error(
                "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",
                ht(u) || "instance"
              )), ys(u) ? (Xe(), de(
                u,
                e4,
                u,
                i,
                E,
                r,
                i.__reactInternalSnapshotBeforeUpdate
              ), Kn()) : de(
                u,
                e4,
                u,
                i,
                E,
                r,
                i.__reactInternalSnapshotBeforeUpdate
              );
            }
          m & 64 && xh(u), m & 512 && jl(u, u.return);
          break;
        case 3:
          if (r = ft(), ea(i, u), m & 64 && (m = u.updateQueue, m !== null)) {
            if (E = null, u.child !== null)
              switch (u.child.tag) {
                case 27:
                case 5:
                  E = u.child.stateNode;
                  break;
                case 1:
                  E = u.child.stateNode;
              }
            try {
              de(
                u,
                Er,
                m,
                E
              );
            } catch (O) {
              Wn(u, u.return, O);
            }
          }
          i.effectDuration += Pt(r);
          break;
        case 27:
          r === null && m & 4 && wh(u);
        case 26:
        case 5:
          ea(i, u), r === null && m & 4 && sy(u), m & 512 && jl(u, u.return);
          break;
        case 12:
          if (m & 4) {
            m = ft(), ea(i, u), i = u.stateNode, i.effectDuration += Mt(m);
            try {
              de(
                u,
                ry,
                u,
                r,
                ex,
                i.effectDuration
              );
            } catch (O) {
              Wn(u, u.return, O);
            }
          } else ea(i, u);
          break;
        case 13:
          ea(i, u), m & 4 && tg(i, u), m & 64 && (i = u.memoizedState, i !== null && (i = i.dehydrated, i !== null && (u = Yu.bind(
            null,
            u
          ), Ph(i, u))));
          break;
        case 22:
          if (m = u.memoizedState !== null || Fg, !m) {
            r = r !== null && r.memoizedState !== null || Qa, E = Fg;
            var S = Qa;
            Fg = m, (Qa = r) && !S ? $a(
              i,
              u,
              (u.subtreeFlags & 8772) !== 0
            ) : ea(i, u), Fg = E, Qa = S;
          }
          break;
        case 30:
          break;
        default:
          ea(i, u);
      }
    }
    function ly(i) {
      var r = i.alternate;
      r !== null && (i.alternate = null, ly(r)), i.child = null, i.deletions = null, i.sibling = null, i.tag === 5 && (r = i.stateNode, r !== null && ir(r)), i.stateNode = null, i._debugOwner = null, i.return = null, i.dependencies = null, i.memoizedProps = null, i.memoizedState = null, i.pendingProps = null, i.stateNode = null, i.updateQueue = null;
    }
    function li(i, r, u) {
      for (u = u.child; u !== null; )
        Rr(
          i,
          r,
          u
        ), u = u.sibling;
    }
    function Rr(i, r, u) {
      if (Wa && typeof Wa.onCommitFiberUnmount == "function")
        try {
          Wa.onCommitFiberUnmount(pf, u);
        } catch (S) {
          qi || (qi = !0, console.error(
            "React instrumentation encountered an error: %s",
            S
          ));
        }
      switch (u.tag) {
        case 26:
          Qa || Ca(u, r), li(
            i,
            r,
            u
          ), u.memoizedState ? u.memoizedState.count-- : u.stateNode && (u = u.stateNode, u.parentNode.removeChild(u));
          break;
        case 27:
          Qa || Ca(u, r);
          var m = dr, E = al;
          ba(u.type) && (dr = u.stateNode, al = !1), li(
            i,
            r,
            u
          ), de(
            u,
            zh,
            u.stateNode
          ), dr = m, al = E;
          break;
        case 5:
          Qa || Ca(u, r);
        case 6:
          if (m = dr, E = al, dr = null, li(
            i,
            r,
            u
          ), dr = m, al = E, dr !== null)
            if (al)
              try {
                de(
                  u,
                  mg,
                  dr,
                  u.stateNode
                );
              } catch (S) {
                Wn(
                  u,
                  r,
                  S
                );
              }
            else
              try {
                de(
                  u,
                  Lh,
                  dr,
                  u.stateNode
                );
              } catch (S) {
                Wn(
                  u,
                  r,
                  S
                );
              }
          break;
        case 18:
          dr !== null && (al ? (i = dr, Ar(
            i.nodeType === 9 ? i.body : i.nodeName === "HTML" ? i.ownerDocument.body : i,
            u.stateNode
          ), qh(i)) : Ar(dr, u.stateNode));
          break;
        case 4:
          m = dr, E = al, dr = u.stateNode.containerInfo, al = !0, li(
            i,
            r,
            u
          ), dr = m, al = E;
          break;
        case 0:
        case 11:
        case 14:
        case 15:
          Qa || Fr(
            To,
            u,
            r
          ), Qa || bh(
            u,
            r,
            Ss
          ), li(
            i,
            r,
            u
          );
          break;
        case 1:
          Qa || (Ca(u, r), m = u.stateNode, typeof m.componentWillUnmount == "function" && ip(
            u,
            r,
            m
          )), li(
            i,
            r,
            u
          );
          break;
        case 21:
          li(
            i,
            r,
            u
          );
          break;
        case 22:
          Qa = (m = Qa) || u.memoizedState !== null, li(
            i,
            r,
            u
          ), Qa = m;
          break;
        default:
          li(
            i,
            r,
            u
          );
      }
    }
    function tg(i, r) {
      if (r.memoizedState === null && (i = r.alternate, i !== null && (i = i.memoizedState, i !== null && (i = i.dehydrated, i !== null))))
        try {
          de(
            r,
            bv,
            i
          );
        } catch (u) {
          Wn(r, r.return, u);
        }
    }
    function eg(i) {
      switch (i.tag) {
        case 13:
        case 19:
          var r = i.stateNode;
          return r === null && (r = i.stateNode = new N4()), r;
        case 22:
          return i = i.stateNode, r = i._retryCache, r === null && (r = i._retryCache = new N4()), r;
        default:
          throw Error(
            "Unexpected Suspense handler tag (" + i.tag + "). This is a bug in React."
          );
      }
    }
    function kl(i, r) {
      var u = eg(i);
      r.forEach(function(m) {
        var E = yv.bind(null, i, m);
        if (!u.has(m)) {
          if (u.add(m), da)
            if (s1 !== null && o1 !== null)
              Fu(o1, s1);
            else
              throw Error(
                "Expected finished root and lanes to be set. This is a bug in React."
              );
          m.then(E, E);
        }
      });
    }
    function va(i, r) {
      var u = r.deletions;
      if (u !== null)
        for (var m = 0; m < u.length; m++) {
          var E = i, S = r, O = u[m], I = S;
          t: for (; I !== null; ) {
            switch (I.tag) {
              case 27:
                if (ba(I.type)) {
                  dr = I.stateNode, al = !1;
                  break t;
                }
                break;
              case 5:
                dr = I.stateNode, al = !1;
                break t;
              case 3:
              case 4:
                dr = I.stateNode.containerInfo, al = !0;
                break t;
            }
            I = I.return;
          }
          if (dr === null)
            throw Error(
              "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
            );
          Rr(E, S, O), dr = null, al = !1, E = O, S = E.alternate, S !== null && (S.return = null), E.return = null;
        }
      if (r.subtreeFlags & 13878)
        for (r = r.child; r !== null; )
          sp(r, i), r = r.sibling;
    }
    function sp(i, r) {
      var u = i.alternate, m = i.flags;
      switch (i.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          va(r, i), Ea(i), m & 4 && (Fr(
            To | yc,
            i,
            i.return
          ), Ma(To | yc, i), bh(
            i,
            i.return,
            Ss | yc
          ));
          break;
        case 1:
          va(r, i), Ea(i), m & 512 && (Qa || u === null || Ca(u, u.return)), m & 64 && Fg && (i = i.updateQueue, i !== null && (m = i.callbacks, m !== null && (u = i.shared.hiddenCallbacks, i.shared.hiddenCallbacks = u === null ? m : u.concat(m))));
          break;
        case 26:
          var E = Rf;
          if (va(r, i), Ea(i), m & 512 && (Qa || u === null || Ca(u, u.return)), m & 4)
            if (r = u !== null ? u.memoizedState : null, m = i.memoizedState, u === null)
              if (m === null)
                if (i.stateNode === null) {
                  t: {
                    m = i.type, u = i.memoizedProps, r = E.ownerDocument || E;
                    e: switch (m) {
                      case "title":
                        E = r.getElementsByTagName("title")[0], (!E || E[Og] || E[fr] || E.namespaceURI === au || E.hasAttribute("itemprop")) && (E = r.createElement(m), r.head.insertBefore(
                          E,
                          r.querySelector("head > title")
                        )), Na(E, m, u), E[fr] = i, dt(E), m = E;
                        break t;
                      case "link":
                        var S = My(
                          "link",
                          "href",
                          r
                        ).get(m + (u.href || ""));
                        if (S) {
                          for (var O = 0; O < S.length; O++)
                            if (E = S[O], E.getAttribute("href") === (u.href == null || u.href === "" ? null : u.href) && E.getAttribute("rel") === (u.rel == null ? null : u.rel) && E.getAttribute("title") === (u.title == null ? null : u.title) && E.getAttribute("crossorigin") === (u.crossOrigin == null ? null : u.crossOrigin)) {
                              S.splice(O, 1);
                              break e;
                            }
                        }
                        E = r.createElement(m), Na(E, m, u), r.head.appendChild(E);
                        break;
                      case "meta":
                        if (S = My(
                          "meta",
                          "content",
                          r
                        ).get(m + (u.content || ""))) {
                          for (O = 0; O < S.length; O++)
                            if (E = S[O], st(
                              u.content,
                              "content"
                            ), E.getAttribute("content") === (u.content == null ? null : "" + u.content) && E.getAttribute("name") === (u.name == null ? null : u.name) && E.getAttribute("property") === (u.property == null ? null : u.property) && E.getAttribute("http-equiv") === (u.httpEquiv == null ? null : u.httpEquiv) && E.getAttribute("charset") === (u.charSet == null ? null : u.charSet)) {
                              S.splice(O, 1);
                              break e;
                            }
                        }
                        E = r.createElement(m), Na(E, m, u), r.head.appendChild(E);
                        break;
                      default:
                        throw Error(
                          'getNodesForType encountered a type it did not expect: "' + m + '". This is a bug in React.'
                        );
                    }
                    E[fr] = i, dt(E), m = E;
                  }
                  i.stateNode = m;
                } else
                  gf(
                    E,
                    i.type,
                    i.stateNode
                  );
              else
                i.stateNode = Tv(
                  E,
                  m,
                  i.memoizedProps
                );
            else
              r !== m ? (r === null ? u.stateNode !== null && (u = u.stateNode, u.parentNode.removeChild(u)) : r.count--, m === null ? gf(
                E,
                i.type,
                i.stateNode
              ) : Tv(
                E,
                m,
                i.memoizedProps
              )) : m === null && i.stateNode !== null && Wd(
                i,
                i.memoizedProps,
                u.memoizedProps
              );
          break;
        case 27:
          va(r, i), Ea(i), m & 512 && (Qa || u === null || Ca(u, u.return)), u !== null && m & 4 && Wd(
            i,
            i.memoizedProps,
            u.memoizedProps
          );
          break;
        case 5:
          if (va(r, i), Ea(i), m & 512 && (Qa || u === null || Ca(u, u.return)), i.flags & 32) {
            r = i.stateNode;
            try {
              de(i, Wu, r);
            } catch (Rt) {
              Wn(i, i.return, Rt);
            }
          }
          m & 4 && i.stateNode != null && (r = i.memoizedProps, Wd(
            i,
            r,
            u !== null ? u.memoizedProps : r
          )), m & 1024 && (wR = !0, i.type !== "form" && console.error(
            "Unexpected host component type. Expected a form. This is a bug in React."
          ));
          break;
        case 6:
          if (va(r, i), Ea(i), m & 4) {
            if (i.stateNode === null)
              throw Error(
                "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."
              );
            m = i.memoizedProps, u = u !== null ? u.memoizedProps : m, r = i.stateNode;
            try {
              de(
                i,
                xy,
                r,
                u,
                m
              );
            } catch (Rt) {
              Wn(i, i.return, Rt);
            }
          }
          break;
        case 3:
          if (E = ft(), Ax = null, S = Rf, Rf = pp(r.containerInfo), va(r, i), Rf = S, Ea(i), m & 4 && u !== null && u.memoizedState.isDehydrated)
            try {
              de(
                i,
                cr,
                r.containerInfo
              );
            } catch (Rt) {
              Wn(i, i.return, Rt);
            }
          wR && (wR = !1, uy(i)), r.effectDuration += Pt(E);
          break;
        case 4:
          m = Rf, Rf = pp(
            i.stateNode.containerInfo
          ), va(r, i), Ea(i), Rf = m;
          break;
        case 12:
          m = ft(), va(r, i), Ea(i), i.stateNode.effectDuration += Mt(m);
          break;
        case 13:
          va(r, i), Ea(i), i.child.flags & 8192 && i.memoizedState !== null != (u !== null && u.memoizedState !== null) && (DR = aa()), m & 4 && (m = i.updateQueue, m !== null && (i.updateQueue = null, kl(i, m)));
          break;
        case 22:
          E = i.memoizedState !== null;
          var I = u !== null && u.memoizedState !== null, F = Fg, K = Qa;
          if (Fg = F || E, Qa = K || I, va(r, i), Qa = K, Fg = F, Ea(i), m & 8192)
            t: for (r = i.stateNode, r._visibility = E ? r._visibility & ~WS : r._visibility | WS, E && (u === null || I || Fg || Qa || Oa(i)), u = null, r = i; ; ) {
              if (r.tag === 5 || r.tag === 26) {
                if (u === null) {
                  I = u = r;
                  try {
                    S = I.stateNode, E ? de(I, Ty, S) : de(
                      I,
                      Ih,
                      I.stateNode,
                      I.memoizedProps
                    );
                  } catch (Rt) {
                    Wn(I, I.return, Rt);
                  }
                }
              } else if (r.tag === 6) {
                if (u === null) {
                  I = r;
                  try {
                    O = I.stateNode, E ? de(I, wy, O) : de(
                      I,
                      pg,
                      O,
                      I.memoizedProps
                    );
                  } catch (Rt) {
                    Wn(I, I.return, Rt);
                  }
                }
              } else if ((r.tag !== 22 && r.tag !== 23 || r.memoizedState === null || r === i) && r.child !== null) {
                r.child.return = r, r = r.child;
                continue;
              }
              if (r === i) break t;
              for (; r.sibling === null; ) {
                if (r.return === null || r.return === i)
                  break t;
                u === r && (u = null), r = r.return;
              }
              u === r && (u = null), r.sibling.return = r.return, r = r.sibling;
            }
          m & 4 && (m = i.updateQueue, m !== null && (u = m.retryQueue, u !== null && (m.retryQueue = null, kl(i, u))));
          break;
        case 19:
          va(r, i), Ea(i), m & 4 && (m = i.updateQueue, m !== null && (i.updateQueue = null, kl(i, m)));
          break;
        case 30:
          break;
        case 21:
          break;
        default:
          va(r, i), Ea(i);
      }
    }
    function Ea(i) {
      var r = i.flags;
      if (r & 2) {
        try {
          de(i, oy, i);
        } catch (u) {
          Wn(i, i.return, u);
        }
        i.flags &= -3;
      }
      r & 4096 && (i.flags &= -4097);
    }
    function uy(i) {
      if (i.subtreeFlags & 1024)
        for (i = i.child; i !== null; ) {
          var r = i;
          uy(r), r.tag === 5 && r.flags & 1024 && r.stateNode.reset(), i = i.sibling;
        }
    }
    function ea(i, r) {
      if (r.subtreeFlags & 8772)
        for (r = r.child; r !== null; )
          rp(i, r.alternate, r), r = r.sibling;
    }
    function lr(i) {
      switch (i.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          bh(
            i,
            i.return,
            Ss
          ), Oa(i);
          break;
        case 1:
          Ca(i, i.return);
          var r = i.stateNode;
          typeof r.componentWillUnmount == "function" && ip(
            i,
            i.return,
            r
          ), Oa(i);
          break;
        case 27:
          de(
            i,
            zh,
            i.stateNode
          );
        case 26:
        case 5:
          Ca(i, i.return), Oa(i);
          break;
        case 22:
          i.memoizedState === null && Oa(i);
          break;
        case 30:
          Oa(i);
          break;
        default:
          Oa(i);
      }
    }
    function Oa(i) {
      for (i = i.child; i !== null; )
        lr(i), i = i.sibling;
    }
    function cy(i, r, u, m) {
      var E = u.flags;
      switch (u.tag) {
        case 0:
        case 11:
        case 15:
          $a(
            i,
            u,
            m
          ), np(u, Ss);
          break;
        case 1:
          if ($a(
            i,
            u,
            m
          ), r = u.stateNode, typeof r.componentDidMount == "function" && de(
            u,
            _R,
            u,
            r
          ), r = u.updateQueue, r !== null) {
            i = u.stateNode;
            try {
              de(
                u,
                jm,
                r,
                i
              );
            } catch (S) {
              Wn(u, u.return, S);
            }
          }
          m && E & 64 && xh(u), jl(u, u.return);
          break;
        case 27:
          wh(u);
        case 26:
        case 5:
          $a(
            i,
            u,
            m
          ), m && r === null && E & 4 && sy(u), jl(u, u.return);
          break;
        case 12:
          if (m && E & 4) {
            E = ft(), $a(
              i,
              u,
              m
            ), m = u.stateNode, m.effectDuration += Mt(E);
            try {
              de(
                u,
                ry,
                u,
                r,
                ex,
                m.effectDuration
              );
            } catch (S) {
              Wn(u, u.return, S);
            }
          } else
            $a(
              i,
              u,
              m
            );
          break;
        case 13:
          $a(
            i,
            u,
            m
          ), m && E & 4 && tg(i, u);
          break;
        case 22:
          u.memoizedState === null && $a(
            i,
            u,
            m
          ), jl(u, u.return);
          break;
        case 30:
          break;
        default:
          $a(
            i,
            u,
            m
          );
      }
    }
    function $a(i, r, u) {
      for (u = u && (r.subtreeFlags & 8772) !== 0, r = r.child; r !== null; )
        cy(
          i,
          r.alternate,
          r,
          u
        ), r = r.sibling;
    }
    function ks(i, r) {
      var u = null;
      i !== null && i.memoizedState !== null && i.memoizedState.cachePool !== null && (u = i.memoizedState.cachePool.pool), i = null, r.memoizedState !== null && r.memoizedState.cachePool !== null && (i = r.memoizedState.cachePool.pool), i !== u && (i != null && Ps(i), u != null && zs(u));
    }
    function Mi(i, r) {
      i = null, r.alternate !== null && (i = r.alternate.memoizedState.cache), r = r.memoizedState.cache, r !== i && (Ps(r), i != null && zs(i));
    }
    function $r(i, r, u, m) {
      if (r.subtreeFlags & 10256)
        for (r = r.child; r !== null; )
          af(
            i,
            r,
            u,
            m
          ), r = r.sibling;
    }
    function af(i, r, u, m) {
      var E = r.flags;
      switch (r.tag) {
        case 0:
        case 11:
        case 15:
          $r(
            i,
            r,
            u,
            m
          ), E & 2048 && Sh(r, Or | yc);
          break;
        case 1:
          $r(
            i,
            r,
            u,
            m
          );
          break;
        case 3:
          var S = ft();
          $r(
            i,
            r,
            u,
            m
          ), E & 2048 && (u = null, r.alternate !== null && (u = r.alternate.memoizedState.cache), r = r.memoizedState.cache, r !== u && (Ps(r), u != null && zs(u))), i.passiveEffectDuration += Pt(S);
          break;
        case 12:
          if (E & 2048) {
            E = ft(), $r(
              i,
              r,
              u,
              m
            ), i = r.stateNode, i.passiveEffectDuration += Mt(E);
            try {
              de(
                r,
                Uu,
                r,
                r.alternate,
                ex,
                i.passiveEffectDuration
              );
            } catch (I) {
              Wn(r, r.return, I);
            }
          } else
            $r(
              i,
              r,
              u,
              m
            );
          break;
        case 13:
          $r(
            i,
            r,
            u,
            m
          );
          break;
        case 23:
          break;
        case 22:
          S = r.stateNode;
          var O = r.alternate;
          r.memoizedState !== null ? S._visibility & kg ? $r(
            i,
            r,
            u,
            m
          ) : Ah(
            i,
            r
          ) : S._visibility & kg ? $r(
            i,
            r,
            u,
            m
          ) : (S._visibility |= kg, Vo(
            i,
            r,
            u,
            m,
            (r.subtreeFlags & 10256) !== 0
          )), E & 2048 && ks(O, r);
          break;
        case 24:
          $r(
            i,
            r,
            u,
            m
          ), E & 2048 && Mi(r.alternate, r);
          break;
        default:
          $r(
            i,
            r,
            u,
            m
          );
      }
    }
    function Vo(i, r, u, m, E) {
      for (E = E && (r.subtreeFlags & 10256) !== 0, r = r.child; r !== null; )
        Rh(
          i,
          r,
          u,
          m,
          E
        ), r = r.sibling;
    }
    function Rh(i, r, u, m, E) {
      var S = r.flags;
      switch (r.tag) {
        case 0:
        case 11:
        case 15:
          Vo(
            i,
            r,
            u,
            m,
            E
          ), Sh(r, Or);
          break;
        case 23:
          break;
        case 22:
          var O = r.stateNode;
          r.memoizedState !== null ? O._visibility & kg ? Vo(
            i,
            r,
            u,
            m,
            E
          ) : Ah(
            i,
            r
          ) : (O._visibility |= kg, Vo(
            i,
            r,
            u,
            m,
            E
          )), E && S & 2048 && ks(
            r.alternate,
            r
          );
          break;
        case 24:
          Vo(
            i,
            r,
            u,
            m,
            E
          ), E && S & 2048 && Mi(r.alternate, r);
          break;
        default:
          Vo(
            i,
            r,
            u,
            m,
            E
          );
      }
    }
    function Ah(i, r) {
      if (r.subtreeFlags & 10256)
        for (r = r.child; r !== null; ) {
          var u = i, m = r, E = m.flags;
          switch (m.tag) {
            case 22:
              Ah(
                u,
                m
              ), E & 2048 && ks(
                m.alternate,
                m
              );
              break;
            case 24:
              Ah(
                u,
                m
              ), E & 2048 && Mi(
                m.alternate,
                m
              );
              break;
            default:
              Ah(
                u,
                m
              );
          }
          r = r.sibling;
        }
    }
    function _s(i) {
      if (i.subtreeFlags & KE)
        for (i = i.child; i !== null; )
          ku(i), i = i.sibling;
    }
    function ku(i) {
      switch (i.tag) {
        case 26:
          _s(i), i.flags & KE && i.memoizedState !== null && wv(
            Rf,
            i.memoizedState,
            i.memoizedProps
          );
          break;
        case 5:
          _s(i);
          break;
        case 3:
        case 4:
          var r = Rf;
          Rf = pp(
            i.stateNode.containerInfo
          ), _s(i), Rf = r;
          break;
        case 22:
          i.memoizedState === null && (r = i.alternate, r !== null && r.memoizedState !== null ? (r = KE, KE = 16777216, _s(i), KE = r) : _s(i));
          break;
        default:
          _s(i);
      }
    }
    function op(i) {
      var r = i.alternate;
      if (r !== null && (i = r.child, i !== null)) {
        r.child = null;
        do
          r = i.sibling, i.sibling = null, i = r;
        while (i !== null);
      }
    }
    function Hu(i) {
      var r = i.deletions;
      if ((i.flags & 16) !== 0) {
        if (r !== null)
          for (var u = 0; u < r.length; u++) {
            var m = r[u];
            as = m, ng(
              m,
              i
            );
          }
        op(i);
      }
      if (i.subtreeFlags & 10256)
        for (i = i.child; i !== null; )
          fy(i), i = i.sibling;
    }
    function fy(i) {
      switch (i.tag) {
        case 0:
        case 11:
        case 15:
          Hu(i), i.flags & 2048 && Kd(
            i,
            i.return,
            Or | yc
          );
          break;
        case 3:
          var r = ft();
          Hu(i), i.stateNode.passiveEffectDuration += Pt(r);
          break;
        case 12:
          r = ft(), Hu(i), i.stateNode.passiveEffectDuration += Mt(r);
          break;
        case 22:
          r = i.stateNode, i.memoizedState !== null && r._visibility & kg && (i.return === null || i.return.tag !== 13) ? (r._visibility &= ~kg, Bu(i)) : Hu(i);
          break;
        default:
          Hu(i);
      }
    }
    function Bu(i) {
      var r = i.deletions;
      if ((i.flags & 16) !== 0) {
        if (r !== null)
          for (var u = 0; u < r.length; u++) {
            var m = r[u];
            as = m, ng(
              m,
              i
            );
          }
        op(i);
      }
      for (i = i.child; i !== null; )
        fo(i), i = i.sibling;
    }
    function fo(i) {
      switch (i.tag) {
        case 0:
        case 11:
        case 15:
          Kd(
            i,
            i.return,
            Or
          ), Bu(i);
          break;
        case 22:
          var r = i.stateNode;
          r._visibility & kg && (r._visibility &= ~kg, Bu(i));
          break;
        default:
          Bu(i);
      }
    }
    function ng(i, r) {
      for (; as !== null; ) {
        var u = as, m = u;
        switch (m.tag) {
          case 0:
          case 11:
          case 15:
            Kd(
              m,
              r,
              Or
            );
            break;
          case 23:
          case 22:
            m.memoizedState !== null && m.memoizedState.cachePool !== null && (m = m.memoizedState.cachePool.pool, m != null && Ps(m));
            break;
          case 24:
            zs(m.memoizedState.cache);
        }
        if (m = u.child, m !== null) m.return = u, as = m;
        else
          t: for (u = i; as !== null; ) {
            m = as;
            var E = m.sibling, S = m.return;
            if (ly(m), m === u) {
              as = null;
              break t;
            }
            if (E !== null) {
              E.return = S, as = E;
              break t;
            }
            as = S;
          }
      }
    }
    function hy() {
      TI.forEach(function(i) {
        return i();
      });
    }
    function dy() {
      var i = typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0;
      return i || Tt.actQueue === null || console.error(
        "The current testing environment is not configured to support act(...)"
      ), i;
    }
    function Xr(i) {
      if ((ui & wo) !== su && An !== 0)
        return An & -An;
      var r = Tt.T;
      return r !== null ? (r._updatedFibers || (r._updatedFibers = /* @__PURE__ */ new Set()), r._updatedFibers.add(i), i = Ky, i !== 0 ? i : hp()) : _l();
    }
    function gy() {
      lu === 0 && (lu = (An & 536870912) === 0 || Yn ? fe() : 536870912);
      var i = vc.current;
      return i !== null && (i.flags |= 32), lu;
    }
    function gn(i, r, u) {
      if (h1 && console.error("useInsertionEffect must not schedule updates."), zR && (mx = !0), (i === Li && (mi === t_ || mi === e_) || i.cancelPendingCommit !== null) && (ye(i, 0), ho(
        i,
        An,
        lu,
        !1
      )), nr(i, u), (ui & wo) !== 0 && i === Li) {
        if (Jo)
          switch (r.tag) {
            case 0:
            case 11:
            case 15:
              i = Sn && ht(Sn) || "Unknown", B4.has(i) || (B4.add(i), r = ht(r) || "Unknown", console.error(
                "Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",
                r,
                i,
                i
              ));
              break;
            case 1:
              H4 || (console.error(
                "Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."
              ), H4 = !0);
          }
      } else
        da && Gi(i, r, u), cg(r), i === Li && ((ui & wo) === su && (Xp |= u), Ga === Jy && ho(
          i,
          An,
          lu,
          !1
        )), vs(i);
    }
    function di(i, r, u) {
      if ((ui & (wo | Af)) !== su)
        throw Error("Should not already be working.");
      var m = !u && (r & 124) === 0 && (r & i.expiredLanes) === 0 || ka(i, r), E = m ? Da(i, r) : sf(i, r, !0), S = m;
      do {
        if (E === $g) {
          c1 && !m && ho(i, r, 0, !1);
          break;
        } else {
          if (u = i.current.alternate, S && !lp(u)) {
            E = sf(i, r, !1), S = !1;
            continue;
          }
          if (E === l1) {
            if (S = r, i.errorRecoveryDisabledLanes & S)
              var O = 0;
            else
              O = i.pendingLanes & -536870913, O = O !== 0 ? O : O & 536870912 ? 536870912 : 0;
            if (O !== 0) {
              r = O;
              t: {
                E = i;
                var I = O;
                O = eb;
                var F = E.current.memoizedState.isDehydrated;
                if (F && (ye(
                  E,
                  I
                ).flags |= 256), I = sf(
                  E,
                  I,
                  !1
                ), I !== l1) {
                  if (CR && !F) {
                    E.errorRecoveryDisabledLanes |= S, Xp |= S, E = Jy;
                    break t;
                  }
                  E = Ro, Ro = O, E !== null && (Ro === null ? Ro = E : Ro.push.apply(
                    Ro,
                    E
                  ));
                }
                E = I;
              }
              if (S = !1, E !== l1) continue;
            }
          }
          if (E === WE) {
            ye(i, 0), ho(i, r, 0, !0);
            break;
          }
          t: {
            switch (m = i, E) {
              case $g:
              case WE:
                throw Error("Root did not complete. This is a bug in React.");
              case Jy:
                if ((r & 4194048) !== r) break;
              case hx:
                ho(
                  m,
                  r,
                  lu,
                  !Fp
                );
                break t;
              case l1:
                Ro = null;
                break;
              case RR:
              case L4:
                break;
              default:
                throw Error("Unknown root exit status.");
            }
            if (Tt.actQueue !== null)
              go(
                m,
                u,
                r,
                Ro,
                nb,
                dx,
                lu,
                Xp,
                n_
              );
            else {
              if ((r & 62914560) === r && (S = DR + P4 - aa(), 10 < S)) {
                if (ho(
                  m,
                  r,
                  lu,
                  !Fp
                ), pa(m, 0, !0) !== 0) break t;
                m.timeoutHandle = Z4(
                  ig.bind(
                    null,
                    m,
                    u,
                    Ro,
                    nb,
                    dx,
                    r,
                    lu,
                    Xp,
                    n_,
                    Fp,
                    E,
                    MI,
                    GO,
                    0
                  ),
                  S
                );
                break t;
              }
              ig(
                m,
                u,
                Ro,
                nb,
                dx,
                r,
                lu,
                Xp,
                n_,
                Fp,
                E,
                RI,
                GO,
                0
              );
            }
          }
        }
        break;
      } while (!0);
      vs(i);
    }
    function ig(i, r, u, m, E, S, O, I, F, K, Rt, Lt, wt, zt) {
      if (i.timeoutHandle = o_, Lt = r.subtreeFlags, (Lt & 8192 || (Lt & 16785408) === 16785408) && (lb = { stylesheets: null, count: 0, unsuspend: vg }, ku(r), Lt = Rv(), Lt !== null)) {
        i.cancelPendingCommit = Lt(
          go.bind(
            null,
            i,
            r,
            S,
            u,
            m,
            E,
            O,
            I,
            F,
            Rt,
            AI,
            wt,
            zt
          )
        ), ho(
          i,
          S,
          O,
          !K
        );
        return;
      }
      go(
        i,
        r,
        S,
        u,
        m,
        E,
        O,
        I,
        F
      );
    }
    function lp(i) {
      for (var r = i; ; ) {
        var u = r.tag;
        if ((u === 0 || u === 11 || u === 15) && r.flags & 16384 && (u = r.updateQueue, u !== null && (u = u.stores, u !== null)))
          for (var m = 0; m < u.length; m++) {
            var E = u[m], S = E.getSnapshot;
            E = E.value;
            try {
              if (!Vt(S(), E)) return !1;
            } catch {
              return !1;
            }
          }
        if (u = r.child, r.subtreeFlags & 16384 && u !== null)
          u.return = r, r = u;
        else {
          if (r === i) break;
          for (; r.sibling === null; ) {
            if (r.return === null || r.return === i) return !0;
            r = r.return;
          }
          r.sibling.return = r.return, r = r.sibling;
        }
      }
      return !0;
    }
    function ho(i, r, u, m) {
      r &= ~OR, r &= ~Xp, i.suspendedLanes |= r, i.pingedLanes &= ~r, m && (i.warmLanes |= r), m = i.expirationTimes;
      for (var E = r; 0 < E; ) {
        var S = 31 - _e(E), O = 1 << S;
        m[S] = -1, E &= ~O;
      }
      u !== 0 && Ha(i, u, r);
    }
    function Yo() {
      return (ui & (wo | Af)) === su ? (Vl(0), !1) : !0;
    }
    function Hl() {
      if (Sn !== null) {
        if (mi === rl)
          var i = Sn.return;
        else
          i = Sn, ro(), oo(i), e1 = null, $E = 0, i = Sn;
        for (; i !== null; )
          Eh(i.alternate, i), i = i.return;
        Sn = null;
      }
    }
    function ye(i, r) {
      var u = i.timeoutHandle;
      u !== o_ && (i.timeoutHandle = o_, HI(u)), u = i.cancelPendingCommit, u !== null && (i.cancelPendingCommit = null, u()), Hl(), Li = i, Sn = u = Ns(i.current, null), An = r, mi = rl, ou = null, Fp = !1, c1 = ka(i, r), CR = !1, Ga = $g, n_ = lu = OR = Xp = $p = 0, Ro = eb = null, dx = !1, (r & 8) !== 0 && (r |= r & 32);
      var m = i.entangledLanes;
      if (m !== 0)
        for (i = i.entanglements, m &= r; 0 < m; ) {
          var E = 31 - _e(m), S = 1 << E;
          r |= i[E], m &= ~S;
        }
      return Qh = r, Jf(), r = PO(), 1e3 < r - IO && (Tt.recentlyCreatedOwnerStacks = 0, IO = r), Tf.discardPendingWarnings(), u;
    }
    function rf(i, r) {
      Qe = null, Tt.H = cx, Tt.getCurrentStack = null, Jo = !1, La = null, r === qE || r === rx ? (r = sr(), mi = JE) : r === kO ? (r = sr(), mi = I4) : mi = r === T4 ? MR : r !== null && typeof r == "object" && typeof r.then == "function" ? u1 : QE, ou = r;
      var u = Sn;
      if (u === null)
        Ga = WE, Qc(
          i,
          Ji(r, i.current)
        );
      else
        switch (u.mode & bs && Me(u), pe(), mi) {
          case QE:
            ie !== null && typeof ie.markComponentErrored == "function" && ie.markComponentErrored(
              u,
              r,
              An
            );
            break;
          case t_:
          case e_:
          case JE:
          case u1:
          case tb:
            ie !== null && typeof ie.markComponentSuspended == "function" && ie.markComponentSuspended(
              u,
              r,
              An
            );
        }
    }
    function ag() {
      var i = Tt.H;
      return Tt.H = cx, i === null ? cx : i;
    }
    function Bl() {
      var i = Tt.A;
      return Tt.A = xI, i;
    }
    function up() {
      Ga = Jy, Fp || (An & 4194048) !== An && vc.current !== null || (c1 = !0), ($p & 134217727) === 0 && (Xp & 134217727) === 0 || Li === null || ho(
        Li,
        An,
        lu,
        !1
      );
    }
    function sf(i, r, u) {
      var m = ui;
      ui |= wo;
      var E = ag(), S = Bl();
      if (Li !== i || An !== r) {
        if (da) {
          var O = i.memoizedUpdaters;
          0 < O.size && (Fu(i, An), O.clear()), Io(i, r);
        }
        nb = null, ye(i, r);
      }
      Mn(r), r = !1, O = Ga;
      t: do
        try {
          if (mi !== rl && Sn !== null) {
            var I = Sn, F = ou;
            switch (mi) {
              case MR:
                Hl(), O = hx;
                break t;
              case JE:
              case t_:
              case e_:
              case u1:
                vc.current === null && (r = !0);
                var K = mi;
                if (mi = rl, ou = null, qu(i, I, F, K), u && c1) {
                  O = $g;
                  break t;
                }
                break;
              default:
                K = mi, mi = rl, ou = null, qu(i, I, F, K);
            }
          }
          rg(), O = Ga;
          break;
        } catch (Rt) {
          rf(i, Rt);
        }
      while (!0);
      return r && i.shellSuspendCounter++, ro(), ui = m, Tt.H = E, Tt.A = S, te(), Sn === null && (Li = null, An = 0, Jf()), O;
    }
    function rg() {
      for (; Sn !== null; ) cp(Sn);
    }
    function Da(i, r) {
      var u = ui;
      ui |= wo;
      var m = ag(), E = Bl();
      if (Li !== i || An !== r) {
        if (da) {
          var S = i.memoizedUpdaters;
          0 < S.size && (Fu(i, An), S.clear()), Io(i, r);
        }
        nb = null, gx = aa() + z4, ye(i, r);
      } else
        c1 = ka(
          i,
          r
        );
      Mn(r);
      t: do
        try {
          if (mi !== rl && Sn !== null)
            e: switch (r = Sn, S = ou, mi) {
              case QE:
                mi = rl, ou = null, qu(
                  i,
                  r,
                  S,
                  QE
                );
                break;
              case t_:
              case e_:
                if (Nn(S)) {
                  mi = rl, ou = null, Mh(r);
                  break;
                }
                r = function() {
                  mi !== t_ && mi !== e_ || Li !== i || (mi = tb), vs(i);
                }, S.then(r, r);
                break t;
              case JE:
                mi = tb;
                break t;
              case I4:
                mi = AR;
                break t;
              case tb:
                Nn(S) ? (mi = rl, ou = null, Mh(r)) : (mi = rl, ou = null, qu(
                  i,
                  r,
                  S,
                  tb
                ));
                break;
              case AR:
                var O = null;
                switch (Sn.tag) {
                  case 26:
                    O = Sn.memoizedState;
                  case 5:
                  case 27:
                    var I = Sn;
                    if (!O || Cy(O)) {
                      mi = rl, ou = null;
                      var F = I.sibling;
                      if (F !== null) Sn = F;
                      else {
                        var K = I.return;
                        K !== null ? (Sn = K, Ch(K)) : Sn = null;
                      }
                      break e;
                    }
                    break;
                  default:
                    console.error(
                      "Unexpected type of fiber triggered a suspensey commit. This is a bug in React."
                    );
                }
                mi = rl, ou = null, qu(
                  i,
                  r,
                  S,
                  AR
                );
                break;
              case u1:
                mi = rl, ou = null, qu(
                  i,
                  r,
                  S,
                  u1
                );
                break;
              case MR:
                Hl(), Ga = hx;
                break t;
              default:
                throw Error(
                  "Unexpected SuspendedReason. This is a bug in React."
                );
            }
          Tt.actQueue !== null ? rg() : mv();
          break;
        } catch (Rt) {
          rf(i, Rt);
        }
      while (!0);
      return ro(), Tt.H = m, Tt.A = E, ui = u, Sn !== null ? (ie !== null && typeof ie.markRenderYielded == "function" && ie.markRenderYielded(), $g) : (te(), Li = null, An = 0, Jf(), Ga);
    }
    function mv() {
      for (; Sn !== null && !OE(); )
        cp(Sn);
    }
    function cp(i) {
      var r = i.alternate;
      (i.mode & bs) !== Vi ? (ae(i), r = de(
        i,
        zu,
        r,
        i,
        Qh
      ), Me(i)) : r = de(
        i,
        zu,
        r,
        i,
        Qh
      ), i.memoizedProps = i.pendingProps, r === null ? Ch(i) : Sn = r;
    }
    function Mh(i) {
      var r = de(i, my, i);
      i.memoizedProps = i.pendingProps, r === null ? Ch(i) : Sn = r;
    }
    function my(i) {
      var r = i.alternate, u = (i.mode & bs) !== Vi;
      switch (u && ae(i), i.tag) {
        case 15:
        case 0:
          r = Bd(
            r,
            i,
            i.pendingProps,
            i.type,
            void 0,
            An
          );
          break;
        case 11:
          r = Bd(
            r,
            i,
            i.pendingProps,
            i.type.render,
            i.ref,
            An
          );
          break;
        case 5:
          oo(i);
        default:
          Eh(r, i), i = Sn = Nm(i, Qh), r = zu(r, i, Qh);
      }
      return u && Me(i), r;
    }
    function qu(i, r, u, m) {
      ro(), oo(r), e1 = null, $E = 0;
      var E = r.return;
      try {
        if (Xm(
          i,
          E,
          r,
          u,
          An
        )) {
          Ga = WE, Qc(
            i,
            Ji(u, i.current)
          ), Sn = null;
          return;
        }
      } catch (S) {
        if (E !== null) throw Sn = E, S;
        Ga = WE, Qc(
          i,
          Ji(u, i.current)
        ), Sn = null;
        return;
      }
      r.flags & 32768 ? (Yn || m === QE ? i = !0 : c1 || (An & 536870912) !== 0 ? i = !1 : (Fp = i = !0, (m === t_ || m === e_ || m === JE || m === u1) && (m = vc.current, m !== null && m.tag === 13 && (m.flags |= 16384))), py(r, i)) : Ch(r);
    }
    function Ch(i) {
      var r = i;
      do {
        if ((r.flags & 32768) !== 0) {
          py(
            r,
            Fp
          );
          return;
        }
        var u = r.alternate;
        if (i = r.return, ae(r), u = de(
          r,
          ps,
          u,
          r,
          Qh
        ), (r.mode & bs) !== Vi && wn(r), u !== null) {
          Sn = u;
          return;
        }
        if (r = r.sibling, r !== null) {
          Sn = r;
          return;
        }
        Sn = r = i;
      } while (r !== null);
      Ga === $g && (Ga = L4);
    }
    function py(i, r) {
      do {
        var u = hv(i.alternate, i);
        if (u !== null) {
          u.flags &= 32767, Sn = u;
          return;
        }
        if ((i.mode & bs) !== Vi) {
          wn(i), u = i.actualDuration;
          for (var m = i.child; m !== null; )
            u += m.actualDuration, m = m.sibling;
          i.actualDuration = u;
        }
        if (u = i.return, u !== null && (u.flags |= 32768, u.subtreeFlags = 0, u.deletions = null), !r && (i = i.sibling, i !== null)) {
          Sn = i;
          return;
        }
        Sn = i = u;
      } while (i !== null);
      Ga = hx, Sn = null;
    }
    function go(i, r, u, m, E, S, O, I, F) {
      i.cancelPendingCommit = null;
      do
        Vu();
      while (xs !== i_);
      if (Tf.flushLegacyContextWarning(), Tf.flushPendingUnsafeLifecycleWarnings(), (ui & (wo | Af)) !== su)
        throw Error("Should not already be working.");
      if (ie !== null && typeof ie.markCommitStarted == "function" && ie.markCommitStarted(u), r === null) ee();
      else {
        if (u === 0 && console.error(
          "finishedLanes should not be empty during a commit. This is a bug in React."
        ), r === i.current)
          throw Error(
            "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
          );
        if (S = r.lanes | r.childLanes, S |= rR, mr(
          i,
          u,
          S,
          O,
          I,
          F
        ), i === Li && (Sn = Li = null, An = 0), f1 = r, Zp = i, Wp = u, LR = S, IR = E, k4 = m, (r.subtreeFlags & 10256) !== 0 || (r.flags & 10256) !== 0 ? (i.callbackNode = null, i.callbackPriority = 0, Nh(eu, function() {
          return Oh(), null;
        })) : (i.callbackNode = null, i.callbackPriority = 0), ex = Zv(), m = (r.flags & 13878) !== 0, (r.subtreeFlags & 13878) !== 0 || m) {
          m = Tt.T, Tt.T = null, E = Un.p, Un.p = Ze, O = ui, ui |= Af;
          try {
            gv(i, r, u);
          } finally {
            ui = O, Un.p = E, Tt.T = m;
          }
        }
        xs = G4, Hs(), ur(), sg();
      }
    }
    function Hs() {
      if (xs === G4) {
        xs = i_;
        var i = Zp, r = f1, u = Wp, m = (r.flags & 13878) !== 0;
        if ((r.subtreeFlags & 13878) !== 0 || m) {
          m = Tt.T, Tt.T = null;
          var E = Un.p;
          Un.p = Ze;
          var S = ui;
          ui |= Af;
          try {
            s1 = u, o1 = i, sp(r, i), o1 = s1 = null, u = YR;
            var O = ov(i.containerInfo), I = u.focusedElem, F = u.selectionRange;
            if (O !== I && I && I.ownerDocument && fs(
              I.ownerDocument.documentElement,
              I
            )) {
              if (F !== null && Mm(I)) {
                var K = F.start, Rt = F.end;
                if (Rt === void 0 && (Rt = K), "selectionStart" in I)
                  I.selectionStart = K, I.selectionEnd = Math.min(
                    Rt,
                    I.value.length
                  );
                else {
                  var Lt = I.ownerDocument || document, wt = Lt && Lt.defaultView || window;
                  if (wt.getSelection) {
                    var zt = wt.getSelection(), ge = I.textContent.length, ke = Math.min(
                      F.start,
                      ge
                    ), Ii = F.end === void 0 ? ke : Math.min(F.end, ge);
                    !zt.extend && ke > Ii && (O = Ii, Ii = ke, ke = O);
                    var On = sv(
                      I,
                      ke
                    ), at = sv(
                      I,
                      Ii
                    );
                    if (On && at && (zt.rangeCount !== 1 || zt.anchorNode !== On.node || zt.anchorOffset !== On.offset || zt.focusNode !== at.node || zt.focusOffset !== at.offset)) {
                      var rt = Lt.createRange();
                      rt.setStart(On.node, On.offset), zt.removeAllRanges(), ke > Ii ? (zt.addRange(rt), zt.extend(at.node, at.offset)) : (rt.setEnd(at.node, at.offset), zt.addRange(rt));
                    }
                  }
                }
              }
              for (Lt = [], zt = I; zt = zt.parentNode; )
                zt.nodeType === 1 && Lt.push({
                  element: zt,
                  left: zt.scrollLeft,
                  top: zt.scrollTop
                });
              for (typeof I.focus == "function" && I.focus(), I = 0; I < Lt.length; I++) {
                var ut = Lt[I];
                ut.element.scrollLeft = ut.left, ut.element.scrollTop = ut.top;
              }
            }
            Ox = !!VR, YR = VR = null;
          } finally {
            ui = S, Un.p = E, Tt.T = m;
          }
        }
        i.current = r, xs = U4;
      }
    }
    function ur() {
      if (xs === U4) {
        xs = i_;
        var i = Zp, r = f1, u = Wp, m = (r.flags & 8772) !== 0;
        if ((r.subtreeFlags & 8772) !== 0 || m) {
          m = Tt.T, Tt.T = null;
          var E = Un.p;
          Un.p = Ze;
          var S = ui;
          ui |= Af;
          try {
            ie !== null && typeof ie.markLayoutEffectsStarted == "function" && ie.markLayoutEffectsStarted(u), s1 = u, o1 = i, rp(
              i,
              r.alternate,
              r
            ), o1 = s1 = null, ie !== null && typeof ie.markLayoutEffectsStopped == "function" && ie.markLayoutEffectsStopped();
          } finally {
            ui = S, Un.p = E, Tt.T = m;
          }
        }
        xs = j4;
      }
    }
    function sg() {
      if (xs === CI || xs === j4) {
        xs = i_, Iv();
        var i = Zp, r = f1, u = Wp, m = k4, E = (r.subtreeFlags & 10256) !== 0 || (r.flags & 10256) !== 0;
        E ? xs = NR : (xs = i_, f1 = Zp = null, og(i, i.pendingLanes), a_ = 0, ab = null);
        var S = i.pendingLanes;
        if (S === 0 && (Kp = null), E || mo(i), E = Ms(u), r = r.stateNode, Wa && typeof Wa.onCommitFiberRoot == "function")
          try {
            var O = (r.current.flags & 128) === 128;
            switch (E) {
              case Ze:
                var I = Ag;
                break;
              case Wo:
                I = Op;
                break;
              case Qo:
                I = eu;
                break;
              case yf:
                I = sc;
                break;
              default:
                I = eu;
            }
            Wa.onCommitFiberRoot(
              pf,
              r,
              I,
              O
            );
          } catch (Lt) {
            qi || (qi = !0, console.error(
              "React instrumentation encountered an error: %s",
              Lt
            ));
          }
        if (da && i.memoizedUpdaters.clear(), hy(), m !== null) {
          O = Tt.T, I = Un.p, Un.p = Ze, Tt.T = null;
          try {
            var F = i.onRecoverableError;
            for (r = 0; r < m.length; r++) {
              var K = m[r], Rt = ql(K.stack);
              de(
                K.source,
                F,
                K.value,
                Rt
              );
            }
          } finally {
            Tt.T = O, Un.p = I;
          }
        }
        (Wp & 3) !== 0 && Vu(), vs(i), S = i.pendingLanes, (u & 4194090) !== 0 && (S & 42) !== 0 ? (ix = !0, i === PR ? ib++ : (ib = 0, PR = i)) : ib = 0, Vl(0), ee();
      }
    }
    function ql(i) {
      return i = { componentStack: i }, Object.defineProperty(i, "digest", {
        get: function() {
          console.error(
            'You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.'
          );
        }
      }), i;
    }
    function og(i, r) {
      (i.pooledCacheLanes &= r) === 0 && (r = i.pooledCache, r != null && (i.pooledCache = null, zs(r)));
    }
    function Vu(i) {
      return Hs(), ur(), sg(), Oh();
    }
    function Oh() {
      if (xs !== NR) return !1;
      var i = Zp, r = LR;
      LR = 0;
      var u = Ms(Wp), m = Qo > u ? Qo : u;
      u = Tt.T;
      var E = Un.p;
      try {
        Un.p = m, Tt.T = null, m = IR, IR = null;
        var S = Zp, O = Wp;
        if (xs = i_, f1 = Zp = null, Wp = 0, (ui & (wo | Af)) !== su)
          throw Error("Cannot flush passive effects while already rendering.");
        zR = !0, mx = !1, ie !== null && typeof ie.markPassiveEffectsStarted == "function" && ie.markPassiveEffectsStarted(O);
        var I = ui;
        if (ui |= Af, fy(S.current), af(
          S,
          S.current,
          O,
          m
        ), ie !== null && typeof ie.markPassiveEffectsStopped == "function" && ie.markPassiveEffectsStopped(), mo(S), ui = I, Vl(0, !1), mx ? S === ab ? a_++ : (a_ = 0, ab = S) : a_ = 0, mx = zR = !1, Wa && typeof Wa.onPostCommitFiberRoot == "function")
          try {
            Wa.onPostCommitFiberRoot(pf, S);
          } catch (K) {
            qi || (qi = !0, console.error(
              "React instrumentation encountered an error: %s",
              K
            ));
          }
        var F = S.current.stateNode;
        return F.effectDuration = 0, F.passiveEffectDuration = 0, !0;
      } finally {
        Un.p = E, Tt.T = u, og(i, r);
      }
    }
    function ni(i, r, u) {
      r = Ji(u, r), r = ki(i.stateNode, r, 2), i = Aa(i, r, 2), i !== null && (nr(i, 2), vs(i));
    }
    function Wn(i, r, u) {
      if (h1 = !1, i.tag === 3)
        ni(i, i, u);
      else {
        for (; r !== null; ) {
          if (r.tag === 3) {
            ni(
              r,
              i,
              u
            );
            return;
          }
          if (r.tag === 1) {
            var m = r.stateNode;
            if (typeof r.type.getDerivedStateFromError == "function" || typeof m.componentDidCatch == "function" && (Kp === null || !Kp.has(m))) {
              i = Ji(u, i), u = Gl(2), m = Aa(r, u, 2), m !== null && (Jc(
                u,
                m,
                r,
                i
              ), nr(m, 2), vs(m));
              return;
            }
          }
          r = r.return;
        }
        console.error(
          `Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`,
          u
        );
      }
    }
    function fp(i, r, u) {
      var m = i.pingCache;
      if (m === null) {
        m = i.pingCache = new wI();
        var E = /* @__PURE__ */ new Set();
        m.set(r, E);
      } else
        E = m.get(r), E === void 0 && (E = /* @__PURE__ */ new Set(), m.set(r, E));
      E.has(u) || (CR = !0, E.add(u), m = pv.bind(null, i, r, u), da && Fu(i, u), r.then(m, m));
    }
    function pv(i, r, u) {
      var m = i.pingCache;
      m !== null && m.delete(r), i.pingedLanes |= i.suspendedLanes & u, i.warmLanes &= ~u, dy() && Tt.actQueue === null && console.error(
        `A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`
      ), Li === i && (An & u) === u && (Ga === Jy || Ga === RR && (An & 62914560) === An && aa() - DR < P4 ? (ui & wo) === su && ye(i, 0) : OR |= u, n_ === An && (n_ = 0)), vs(i);
    }
    function Dh(i, r) {
      r === 0 && (r = Zi()), i = Gr(i, r), i !== null && (nr(i, r), vs(i));
    }
    function Yu(i) {
      var r = i.memoizedState, u = 0;
      r !== null && (u = r.retryLane), Dh(i, u);
    }
    function yv(i, r) {
      var u = 0;
      switch (i.tag) {
        case 13:
          var m = i.stateNode, E = i.memoizedState;
          E !== null && (u = E.retryLane);
          break;
        case 19:
          m = i.stateNode;
          break;
        case 22:
          m = i.stateNode._retryCache;
          break;
        default:
          throw Error(
            "Pinged unknown suspense boundary type. This is probably a bug in React."
          );
      }
      m !== null && m.delete(r), Dh(i, u);
    }
    function lg(i, r, u) {
      if ((r.subtreeFlags & 67117056) !== 0)
        for (r = r.child; r !== null; ) {
          var m = i, E = r, S = E.type === Za;
          S = u || S, E.tag !== 22 ? E.flags & 67108864 ? S && de(
            E,
            of,
            m,
            E,
            (E.mode & DO) === Vi
          ) : lg(
            m,
            E,
            S
          ) : E.memoizedState === null && (S && E.flags & 8192 ? de(
            E,
            of,
            m,
            E
          ) : E.subtreeFlags & 67108864 && de(
            E,
            lg,
            m,
            E,
            S
          )), r = r.sibling;
        }
    }
    function of(i, r) {
      var u = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : !0;
      $t(!0);
      try {
        lr(r), u && fo(r), cy(i, r.alternate, r, !1), u && Rh(i, r, 0, null, !1, 0);
      } finally {
        $t(!1);
      }
    }
    function mo(i) {
      var r = !0;
      i.current.mode & (Ks | xf) || (r = !1), lg(
        i,
        i.current,
        r
      );
    }
    function ug(i) {
      if ((ui & wo) === su) {
        var r = i.tag;
        if (r === 3 || r === 1 || r === 0 || r === 11 || r === 14 || r === 15) {
          if (r = ht(i) || "ReactComponent", px !== null) {
            if (px.has(r)) return;
            px.add(r);
          } else px = /* @__PURE__ */ new Set([r]);
          de(i, function() {
            console.error(
              "Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead."
            );
          });
        }
      }
    }
    function Fu(i, r) {
      da && i.memoizedUpdaters.forEach(function(u) {
        Gi(i, u, r);
      });
    }
    function Nh(i, r) {
      var u = Tt.actQueue;
      return u !== null ? (u.push(r), NI) : Ly(i, r);
    }
    function cg(i) {
      dy() && Tt.actQueue === null && de(i, function() {
        console.error(
          `An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,
          ht(i)
        );
      });
    }
    function vs(i) {
      i !== d1 && i.next === null && (d1 === null ? yx = d1 = i : d1 = d1.next = i), _x = !0, Tt.actQueue !== null ? UR || (UR = !0, _v()) : GR || (GR = !0, _v());
    }
    function Vl(i, r) {
      if (!jR && _x) {
        jR = !0;
        do
          for (var u = !1, m = yx; m !== null; ) {
            if (i !== 0) {
              var E = m.pendingLanes;
              if (E === 0) var S = 0;
              else {
                var O = m.suspendedLanes, I = m.pingedLanes;
                S = (1 << 31 - _e(42 | i) + 1) - 1, S &= E & ~(O & ~I), S = S & 201326741 ? S & 201326741 | 1 : S ? S | 2 : 0;
              }
              S !== 0 && (u = !0, yy(m, S));
            } else
              S = An, S = pa(
                m,
                m === Li ? S : 0,
                m.cancelPendingCommit !== null || m.timeoutHandle !== o_
              ), (S & 3) === 0 || ka(m, S) || (u = !0, yy(m, S));
            m = m.next;
          }
        while (u);
        jR = !1;
      }
    }
    function fg() {
      Bs();
    }
    function Bs() {
      _x = UR = GR = !1;
      var i = 0;
      r_ !== 0 && (Sy() && (i = r_), r_ = 0);
      for (var r = aa(), u = null, m = yx; m !== null; ) {
        var E = m.next, S = Gn(m, r);
        S === 0 ? (m.next = null, u === null ? yx = E : u.next = E, E === null && (d1 = u)) : (u = m, (i !== 0 || (S & 3) !== 0) && (_x = !0)), m = E;
      }
      Vl(i);
    }
    function Gn(i, r) {
      for (var u = i.suspendedLanes, m = i.pingedLanes, E = i.expirationTimes, S = i.pendingLanes & -62914561; 0 < S; ) {
        var O = 31 - _e(S), I = 1 << O, F = E[O];
        F === -1 ? ((I & u) === 0 || (I & m) !== 0) && (E[O] = Ai(I, r)) : F <= r && (i.expiredLanes |= I), S &= ~I;
      }
      if (r = Li, u = An, u = pa(
        i,
        i === r ? u : 0,
        i.cancelPendingCommit !== null || i.timeoutHandle !== o_
      ), m = i.callbackNode, u === 0 || i === r && (mi === t_ || mi === e_) || i.cancelPendingCommit !== null)
        return m !== null && na(m), i.callbackNode = null, i.callbackPriority = 0;
      if ((u & 3) === 0 || ka(i, u)) {
        if (r = u & -u, r !== i.callbackPriority || Tt.actQueue !== null && m !== kR)
          na(m);
        else return r;
        switch (Ms(u)) {
          case Ze:
          case Wo:
            u = Op;
            break;
          case Qo:
            u = eu;
            break;
          case yf:
            u = sc;
            break;
          default:
            u = eu;
        }
        return m = Fo.bind(null, i), Tt.actQueue !== null ? (Tt.actQueue.push(m), u = kR) : u = Ly(u, m), i.callbackPriority = r, i.callbackNode = u, r;
      }
      return m !== null && na(m), i.callbackPriority = 2, i.callbackNode = null, 2;
    }
    function Fo(i, r) {
      if (ix = nx = !1, xs !== i_ && xs !== NR)
        return i.callbackNode = null, i.callbackPriority = 0, null;
      var u = i.callbackNode;
      if (Vu() && i.callbackNode !== u)
        return null;
      var m = An;
      return m = pa(
        i,
        i === Li ? m : 0,
        i.cancelPendingCommit !== null || i.timeoutHandle !== o_
      ), m === 0 ? null : (di(
        i,
        m,
        r
      ), Gn(i, aa()), i.callbackNode != null && i.callbackNode === u ? Fo.bind(null, i) : null);
    }
    function yy(i, r) {
      if (Vu()) return null;
      nx = ix, ix = !1, di(i, r, !0);
    }
    function na(i) {
      i !== kR && i !== null && Lv(i);
    }
    function _v() {
      Tt.actQueue !== null && Tt.actQueue.push(function() {
        return Bs(), null;
      }), BI(function() {
        (ui & (wo | Af)) !== su ? Ly(
          Ag,
          fg
        ) : Bs();
      });
    }
    function hp() {
      return r_ === 0 && (r_ = fe()), r_;
    }
    function _y(i) {
      return i == null || typeof i == "symbol" || typeof i == "boolean" ? null : typeof i == "function" ? i : (st(i, "action"), Sl("" + i));
    }
    function wi(i, r) {
      var u = r.ownerDocument.createElement("input");
      return u.name = r.name, u.value = r.value, i.id && u.setAttribute("form", i.id), r.parentNode.insertBefore(u, r), i = new FormData(i), u.parentNode.removeChild(u), i;
    }
    function Kr(i, r, u, m, E) {
      if (r === "submit" && u && u.stateNode === E) {
        var S = _y(
          (E[es] || null).action
        ), O = m.submitter;
        O && (r = (r = O[es] || null) ? _y(r.formAction) : O.getAttribute("formAction"), r !== null && (S = r, O = null));
        var I = new jn(
          "action",
          "action",
          null,
          m,
          E
        );
        i.push({
          event: I,
          listeners: [
            {
              instance: null,
              listener: function() {
                if (m.defaultPrevented) {
                  if (r_ !== 0) {
                    var F = O ? wi(
                      E,
                      O
                    ) : new FormData(E), K = {
                      pending: !0,
                      data: F,
                      method: E.method,
                      action: S
                    };
                    Object.freeze(K), Vm(
                      u,
                      K,
                      null,
                      F
                    );
                  }
                } else
                  typeof S == "function" && (I.preventDefault(), F = O ? wi(
                    E,
                    O
                  ) : new FormData(E), K = {
                    pending: !0,
                    data: F,
                    method: E.method,
                    action: S
                  }, Object.freeze(K), Vm(
                    u,
                    K,
                    S,
                    F
                  ));
              },
              currentTarget: E
            }
          ]
        });
      }
    }
    function qs(i, r, u) {
      i.currentTarget = u;
      try {
        r(i);
      } catch (m) {
        bR(m);
      }
      i.currentTarget = null;
    }
    function vy(i, r) {
      r = (r & 4) !== 0;
      for (var u = 0; u < i.length; u++) {
        var m = i[u];
        t: {
          var E = void 0, S = m.event;
          if (m = m.listeners, r)
            for (var O = m.length - 1; 0 <= O; O--) {
              var I = m[O], F = I.instance, K = I.currentTarget;
              if (I = I.listener, F !== E && S.isPropagationStopped())
                break t;
              F !== null ? de(
                F,
                qs,
                S,
                I,
                K
              ) : qs(S, I, K), E = F;
            }
          else
            for (O = 0; O < m.length; O++) {
              if (I = m[O], F = I.instance, K = I.currentTarget, I = I.listener, F !== E && S.isPropagationStopped())
                break t;
              F !== null ? de(
                F,
                qs,
                S,
                I,
                K
              ) : qs(S, I, K), E = F;
            }
        }
      }
    }
    function mn(i, r) {
      HR.has(i) || console.error(
        'Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',
        i
      );
      var u = r[Dp];
      u === void 0 && (u = r[Dp] = /* @__PURE__ */ new Set());
      var m = i + "__bubble";
      u.has(m) || (Zr(r, i, 2, !1), u.add(m));
    }
    function Ey(i, r, u) {
      HR.has(i) && !r && console.error(
        'Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',
        i
      );
      var m = 0;
      r && (m |= 4), Zr(
        u,
        i,
        m,
        r
      );
    }
    function hg(i) {
      if (!i[vx]) {
        i[vx] = !0, _f.forEach(function(u) {
          u !== "selectionchange" && (HR.has(u) || Ey(u, !1, i), Ey(u, !0, i));
        });
        var r = i.nodeType === 9 ? i : i.ownerDocument;
        r === null || r[vx] || (r[vx] = !0, Ey("selectionchange", !1, r));
      }
    }
    function Zr(i, r, u, m) {
      switch (Wl(r)) {
        case Ze:
          var E = xg;
          break;
        case Wo:
          E = ec;
          break;
        default:
          E = jh;
      }
      u = E.bind(
        null,
        r,
        u,
        i
      ), E = void 0, !jt || r !== "touchstart" && r !== "touchmove" && r !== "wheel" || (E = !0), m ? E !== void 0 ? i.addEventListener(r, u, {
        capture: !0,
        passive: E
      }) : i.addEventListener(r, u, !0) : E !== void 0 ? i.addEventListener(r, u, {
        passive: E
      }) : i.addEventListener(
        r,
        u,
        !1
      );
    }
    function Wr(i, r, u, m, E) {
      var S = m;
      if ((r & 1) === 0 && (r & 2) === 0 && m !== null)
        t: for (; ; ) {
          if (m === null) return;
          var O = m.tag;
          if (O === 3 || O === 4) {
            var I = m.stateNode.containerInfo;
            if (I === E) break;
            if (O === 4)
              for (O = m.return; O !== null; ) {
                var F = O.tag;
                if ((F === 3 || F === 4) && O.stateNode.containerInfo === E)
                  return;
                O = O.return;
              }
            for (; I !== null; ) {
              if (O = Ui(I), O === null) return;
              if (F = O.tag, F === 5 || F === 6 || F === 26 || F === 27) {
                m = S = O;
                continue t;
              }
              I = I.parentNode;
            }
          }
          m = m.return;
        }
      Zf(function() {
        var K = S, Rt = no(u), Lt = [];
        t: {
          var wt = OO.get(i);
          if (wt !== void 0) {
            var zt = jn, ge = i;
            switch (i) {
              case "keypress":
                if (Hc(u) === 0) break t;
              case "keydown":
              case "keyup":
                zt = Fw;
                break;
              case "focusin":
                ge = "focus", zt = nl;
                break;
              case "focusout":
                ge = "blur", zt = nl;
                break;
              case "beforeblur":
              case "afterblur":
                zt = nl;
                break;
              case "click":
                if (u.button === 2) break t;
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                zt = ve;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                zt = Pa;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                zt = Kw;
                break;
              case ns:
              case Xs:
              case ma:
                zt = jw;
                break;
              case CO:
                zt = Ww;
                break;
              case "scroll":
              case "scrollend":
                zt = ct;
                break;
              case "wheel":
                zt = Jw;
                break;
              case "copy":
              case "cut":
              case "paste":
                zt = IE;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                zt = XS;
                break;
              case "toggle":
              case "beforetoggle":
                zt = eR;
            }
            var ke = (r & 4) !== 0, Ii = !ke && (i === "scroll" || i === "scrollend"), On = ke ? wt !== null ? wt + "Capture" : null : wt;
            ke = [];
            for (var at = K, rt; at !== null; ) {
              var ut = at;
              if (rt = ut.stateNode, ut = ut.tag, ut !== 5 && ut !== 26 && ut !== 27 || rt === null || On === null || (ut = Ds(at, On), ut != null && ke.push(
                lf(
                  at,
                  ut,
                  rt
                )
              )), Ii) break;
              at = at.return;
            }
            0 < ke.length && (wt = new zt(
              wt,
              ge,
              null,
              u,
              Rt
            ), Lt.push({
              event: wt,
              listeners: ke
            }));
          }
        }
        if ((r & 7) === 0) {
          t: {
            if (wt = i === "mouseover" || i === "pointerover", zt = i === "mouseout" || i === "pointerout", wt && u !== M && (ge = u.relatedTarget || u.fromElement) && (Ui(ge) || ge[lc]))
              break t;
            if ((zt || wt) && (wt = Rt.window === Rt ? Rt : (wt = Rt.ownerDocument) ? wt.defaultView || wt.parentWindow : window, zt ? (ge = u.relatedTarget || u.toElement, zt = K, ge = ge ? Ui(ge) : null, ge !== null && (Ii = k(ge), ke = ge.tag, ge !== Ii || ke !== 5 && ke !== 27 && ke !== 6) && (ge = null)) : (zt = null, ge = K), zt !== ge)) {
              if (ke = ve, ut = "onMouseLeave", On = "onMouseEnter", at = "mouse", (i === "pointerout" || i === "pointerover") && (ke = XS, ut = "onPointerLeave", On = "onPointerEnter", at = "pointer"), Ii = zt == null ? wt : Ba(zt), rt = ge == null ? wt : Ba(ge), wt = new ke(
                ut,
                at + "leave",
                zt,
                u,
                Rt
              ), wt.target = Ii, wt.relatedTarget = rt, ut = null, Ui(Rt) === K && (ke = new ke(
                On,
                at + "enter",
                ge,
                u,
                Rt
              ), ke.target = rt, ke.relatedTarget = Ii, ut = ke), Ii = ut, zt && ge)
                e: {
                  for (ke = zt, On = ge, at = 0, rt = ke; rt; rt = uf(rt))
                    at++;
                  for (rt = 0, ut = On; ut; ut = uf(ut))
                    rt++;
                  for (; 0 < at - rt; )
                    ke = uf(ke), at--;
                  for (; 0 < rt - at; )
                    On = uf(On), rt--;
                  for (; at--; ) {
                    if (ke === On || On !== null && ke === On.alternate)
                      break e;
                    ke = uf(ke), On = uf(On);
                  }
                  ke = null;
                }
              else ke = null;
              zt !== null && Yl(
                Lt,
                wt,
                zt,
                ke,
                !1
              ), ge !== null && Ii !== null && Yl(
                Lt,
                Ii,
                ge,
                ke,
                !0
              );
            }
          }
          t: {
            if (wt = K ? Ba(K) : window, zt = wt.nodeName && wt.nodeName.toLowerCase(), zt === "select" || zt === "input" && wt.type === "file")
              var Gt = H0;
            else if (Rd(wt))
              if (Yt)
                Gt = av;
              else {
                Gt = nv;
                var ne = Am;
              }
            else
              zt = wt.nodeName, !zt || zt.toLowerCase() !== "input" || wt.type !== "checkbox" && wt.type !== "radio" ? K && jc(K.elementType) && (Gt = H0) : Gt = iv;
            if (Gt && (Gt = Gt(i, K))) {
              ji(
                Lt,
                Gt,
                u,
                Rt
              );
              break t;
            }
            ne && ne(i, wt, K), i === "focusout" && K && wt.type === "number" && K.memoizedProps.value != null && Ic(wt, "number", wt.value);
          }
          switch (ne = K ? Ba(K) : window, i) {
            case "focusin":
              (Rd(ne) || ne.contentEditable === "true") && (he = ne, De = K, We = null);
              break;
            case "focusout":
              We = De = he = null;
              break;
            case "mousedown":
              Ne = !0;
              break;
            case "contextmenu":
            case "mouseup":
            case "dragend":
              Ne = !1, ao(
                Lt,
                u,
                Rt
              );
              break;
            case "selectionchange":
              if (re) break;
            case "keydown":
            case "keyup":
              ao(
                Lt,
                u,
                Rt
              );
          }
          var sn;
          if (PE)
            t: {
              switch (i) {
                case "compositionstart":
                  var me = "onCompositionStart";
                  break t;
                case "compositionend":
                  me = "onCompositionEnd";
                  break t;
                case "compositionupdate":
                  me = "onCompositionUpdate";
                  break t;
              }
              me = void 0;
            }
          else
            tt ? yu(i, u) && (me = "onCompositionEnd") : i === "keydown" && u.keyCode === KS && (me = "onCompositionStart");
          me && (R && u.locale !== "ko" && (tt || me !== "onCompositionStart" ? me === "onCompositionEnd" && tt && (sn = wm()) : (xt = Rt, bt = "value" in xt ? xt.value : xt.textContent, tt = !0)), ne = Xa(
            K,
            me
          ), 0 < ne.length && (me = new $S(
            me,
            i,
            null,
            u,
            Rt
          ), Lt.push({
            event: me,
            listeners: ne
          }), sn ? me.data = sn : (sn = Td(u), sn !== null && (me.data = sn)))), (sn = _ ? wd(i, u) : wE(i, u)) && (me = Xa(
            K,
            "onBeforeInput"
          ), 0 < me.length && (ne = new Hw(
            "onBeforeInput",
            "beforeinput",
            null,
            u,
            Rt
          ), Lt.push({
            event: ne,
            listeners: me
          }), ne.data = sn)), Kr(
            Lt,
            i,
            K,
            u,
            Rt
          );
        }
        vy(Lt, r);
      });
    }
    function lf(i, r, u) {
      return {
        instance: i,
        listener: r,
        currentTarget: u
      };
    }
    function Xa(i, r) {
      for (var u = r + "Capture", m = []; i !== null; ) {
        var E = i, S = E.stateNode;
        if (E = E.tag, E !== 5 && E !== 26 && E !== 27 || S === null || (E = Ds(i, u), E != null && m.unshift(
          lf(i, E, S)
        ), E = Ds(i, r), E != null && m.push(
          lf(i, E, S)
        )), i.tag === 3) return m;
        i = i.return;
      }
      return [];
    }
    function uf(i) {
      if (i === null) return null;
      do
        i = i.return;
      while (i && i.tag !== 5 && i.tag !== 27);
      return i || null;
    }
    function Yl(i, r, u, m, E) {
      for (var S = r._reactName, O = []; u !== null && u !== m; ) {
        var I = u, F = I.alternate, K = I.stateNode;
        if (I = I.tag, F !== null && F === m) break;
        I !== 5 && I !== 26 && I !== 27 || K === null || (F = K, E ? (K = Ds(u, S), K != null && O.unshift(
          lf(u, K, F)
        )) : E || (K = Ds(u, S), K != null && O.push(
          lf(u, K, F)
        ))), u = u.return;
      }
      O.length !== 0 && i.push({ event: r, listeners: O });
    }
    function Fl(i, r) {
      U0(i, r), i !== "input" && i !== "textarea" && i !== "select" || r == null || r.value !== null || qv || (qv = !0, i === "select" && r.multiple ? console.error(
        "`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",
        i
      ) : console.error(
        "`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",
        i
      ));
      var u = {
        registrationNameDependencies: So,
        possibleRegistrationNames: Np
      };
      jc(i) || typeof r.is == "string" || tv(i, r, u), r.contentEditable && !r.suppressContentEditableWarning && r.children != null && console.error(
        "A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."
      );
    }
    function gi(i, r, u, m) {
      r !== u && (u = $l(u), $l(r) !== u && (m[i] = r));
    }
    function by(i, r, u) {
      r.forEach(function(m) {
        u[ff(m)] = m === "style" ? dp(i) : i.getAttribute(m);
      });
    }
    function Vs(i, r) {
      r === !1 ? console.error(
        "Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",
        i,
        i,
        i
      ) : console.error(
        "Expected `%s` listener to be a function, instead got a value of `%s` type.",
        i,
        typeof r
      );
    }
    function po(i, r) {
      return i = i.namespaceURI === jp || i.namespaceURI === au ? i.ownerDocument.createElementNS(
        i.namespaceURI,
        i.tagName
      ) : i.ownerDocument.createElement(i.tagName), i.innerHTML = r, i.innerHTML;
    }
    function $l(i) {
      return j(i) && (console.error(
        "The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",
        W(i)
      ), X(i)), (typeof i == "string" ? i : "" + i).replace(LI, `
`).replace(II, "");
    }
    function cf(i, r) {
      return r = $l(r), $l(i) === r;
    }
    function $u() {
    }
    function Ve(i, r, u, m, E, S) {
      switch (u) {
        case "children":
          typeof m == "string" ? (Yf(m, r, !1), r === "body" || r === "textarea" && m === "" || Ff(i, m)) : (typeof m == "number" || typeof m == "bigint") && (Yf("" + m, r, !1), r !== "body" && Ff(i, "" + m));
          break;
        case "className":
          Ae(i, "class", m);
          break;
        case "tabIndex":
          Ae(i, "tabindex", m);
          break;
        case "dir":
        case "role":
        case "viewBox":
        case "width":
        case "height":
          Ae(i, u, m);
          break;
        case "style":
          Sd(i, m, S);
          break;
        case "data":
          if (r !== "object") {
            Ae(i, "data", m);
            break;
          }
        case "src":
        case "href":
          if (m === "" && (r !== "a" || u !== "href")) {
            console.error(
              u === "src" ? 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.' : 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
              u,
              u
            ), i.removeAttribute(u);
            break;
          }
          if (m == null || typeof m == "function" || typeof m == "symbol" || typeof m == "boolean") {
            i.removeAttribute(u);
            break;
          }
          st(m, u), m = Sl("" + m), i.setAttribute(u, m);
          break;
        case "action":
        case "formAction":
          if (m != null && (r === "form" ? u === "formAction" ? console.error(
            "You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."
          ) : typeof m == "function" && (E.encType == null && E.method == null || Sx || (Sx = !0, console.error(
            "Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden."
          )), E.target == null || bx || (bx = !0, console.error(
            "Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."
          ))) : r === "input" || r === "button" ? u === "action" ? console.error(
            "You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."
          ) : r !== "input" || E.type === "submit" || E.type === "image" || Ex ? r !== "button" || E.type == null || E.type === "submit" || Ex ? typeof m == "function" && (E.name == null || Y4 || (Y4 = !0, console.error(
            'Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.'
          )), E.formEncType == null && E.formMethod == null || Sx || (Sx = !0, console.error(
            "Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden."
          )), E.formTarget == null || bx || (bx = !0, console.error(
            "Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."
          ))) : (Ex = !0, console.error(
            'A button can only specify a formAction along with type="submit" or no type.'
          )) : (Ex = !0, console.error(
            'An input can only specify a formAction along with type="submit" or type="image".'
          )) : console.error(
            u === "action" ? "You can only pass the action prop to <form>." : "You can only pass the formAction prop to <input> or <button>."
          )), typeof m == "function") {
            i.setAttribute(
              u,
              "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 S == "function" && (u === "formAction" ? (r !== "input" && Ve(i, r, "name", E.name, E, null), Ve(
              i,
              r,
              "formEncType",
              E.formEncType,
              E,
              null
            ), Ve(
              i,
              r,
              "formMethod",
              E.formMethod,
              E,
              null
            ), Ve(
              i,
              r,
              "formTarget",
              E.formTarget,
              E,
              null
            )) : (Ve(
              i,
              r,
              "encType",
              E.encType,
              E,
              null
            ), Ve(i, r, "method", E.method, E, null), Ve(
              i,
              r,
              "target",
              E.target,
              E,
              null
            )));
          if (m == null || typeof m == "symbol" || typeof m == "boolean") {
            i.removeAttribute(u);
            break;
          }
          st(m, u), m = Sl("" + m), i.setAttribute(u, m);
          break;
        case "onClick":
          m != null && (typeof m != "function" && Vs(u, m), i.onclick = $u);
          break;
        case "onScroll":
          m != null && (typeof m != "function" && Vs(u, m), mn("scroll", i));
          break;
        case "onScrollEnd":
          m != null && (typeof m != "function" && Vs(u, m), mn("scrollend", i));
          break;
        case "dangerouslySetInnerHTML":
          if (m != null) {
            if (typeof m != "object" || !("__html" in m))
              throw Error(
                "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
              );
            if (u = m.__html, u != null) {
              if (E.children != null)
                throw Error(
                  "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
                );
              i.innerHTML = u;
            }
          }
          break;
        case "multiple":
          i.multiple = m && typeof m != "function" && typeof m != "symbol";
          break;
        case "muted":
          i.muted = m && typeof m != "function" && typeof m != "symbol";
          break;
        case "suppressContentEditableWarning":
        case "suppressHydrationWarning":
        case "defaultValue":
        case "defaultChecked":
        case "innerHTML":
        case "ref":
          break;
        case "autoFocus":
          break;
        case "xlinkHref":
          if (m == null || typeof m == "function" || typeof m == "boolean" || typeof m == "symbol") {
            i.removeAttribute("xlink:href");
            break;
          }
          st(m, u), u = Sl("" + m), i.setAttributeNS(s_, "xlink:href", u);
          break;
        case "contentEditable":
        case "spellCheck":
        case "draggable":
        case "value":
        case "autoReverse":
        case "externalResourcesRequired":
        case "focusable":
        case "preserveAlpha":
          m != null && typeof m != "function" && typeof m != "symbol" ? (st(m, u), i.setAttribute(u, "" + m)) : i.removeAttribute(u);
          break;
        case "inert":
          m !== "" || xx[u] || (xx[u] = !0, console.error(
            "Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
            u
          ));
        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":
          m && typeof m != "function" && typeof m != "symbol" ? i.setAttribute(u, "") : i.removeAttribute(u);
          break;
        case "capture":
        case "download":
          m === !0 ? i.setAttribute(u, "") : m !== !1 && m != null && typeof m != "function" && typeof m != "symbol" ? (st(m, u), i.setAttribute(u, m)) : i.removeAttribute(u);
          break;
        case "cols":
        case "rows":
        case "size":
        case "span":
          m != null && typeof m != "function" && typeof m != "symbol" && !isNaN(m) && 1 <= m ? (st(m, u), i.setAttribute(u, m)) : i.removeAttribute(u);
          break;
        case "rowSpan":
        case "start":
          m == null || typeof m == "function" || typeof m == "symbol" || isNaN(m) ? i.removeAttribute(u) : (st(m, u), i.setAttribute(u, m));
          break;
        case "popover":
          mn("beforetoggle", i), mn("toggle", i), Pe(i, "popover", m);
          break;
        case "xlinkActuate":
          xn(
            i,
            s_,
            "xlink:actuate",
            m
          );
          break;
        case "xlinkArcrole":
          xn(
            i,
            s_,
            "xlink:arcrole",
            m
          );
          break;
        case "xlinkRole":
          xn(
            i,
            s_,
            "xlink:role",
            m
          );
          break;
        case "xlinkShow":
          xn(
            i,
            s_,
            "xlink:show",
            m
          );
          break;
        case "xlinkTitle":
          xn(
            i,
            s_,
            "xlink:title",
            m
          );
          break;
        case "xlinkType":
          xn(
            i,
            s_,
            "xlink:type",
            m
          );
          break;
        case "xmlBase":
          xn(
            i,
            BR,
            "xml:base",
            m
          );
          break;
        case "xmlLang":
          xn(
            i,
            BR,
            "xml:lang",
            m
          );
          break;
        case "xmlSpace":
          xn(
            i,
            BR,
            "xml:space",
            m
          );
          break;
        case "is":
          S != null && console.error(
            'Cannot update the "is" prop after it has been initialized.'
          ), Pe(i, "is", m);
          break;
        case "innerText":
        case "textContent":
          break;
        case "popoverTarget":
          F4 || m == null || typeof m != "object" || (F4 = !0, console.error(
            "The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",
            m
          ));
        default:
          !(2 < u.length) || u[0] !== "o" && u[0] !== "O" || u[1] !== "n" && u[1] !== "N" ? (u = kc(u), Pe(i, u, m)) : So.hasOwnProperty(u) && m != null && typeof m != "function" && Vs(u, m);
      }
    }
    function Xu(i, r, u, m, E, S) {
      switch (u) {
        case "style":
          Sd(i, m, S);
          break;
        case "dangerouslySetInnerHTML":
          if (m != null) {
            if (typeof m != "object" || !("__html" in m))
              throw Error(
                "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
              );
            if (u = m.__html, u != null) {
              if (E.children != null)
                throw Error(
                  "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
                );
              i.innerHTML = u;
            }
          }
          break;
        case "children":
          typeof m == "string" ? Ff(i, m) : (typeof m == "number" || typeof m == "bigint") && Ff(i, "" + m);
          break;
        case "onScroll":
          m != null && (typeof m != "function" && Vs(u, m), mn("scroll", i));
          break;
        case "onScrollEnd":
          m != null && (typeof m != "function" && Vs(u, m), mn("scrollend", i));
          break;
        case "onClick":
          m != null && (typeof m != "function" && Vs(u, m), i.onclick = $u);
          break;
        case "suppressContentEditableWarning":
        case "suppressHydrationWarning":
        case "innerHTML":
        case "ref":
          break;
        case "innerText":
        case "textContent":
          break;
        default:
          if (So.hasOwnProperty(u))
            m != null && typeof m != "function" && Vs(u, m);
          else
            t: {
              if (u[0] === "o" && u[1] === "n" && (E = u.endsWith("Capture"), r = u.slice(2, E ? u.length - 7 : void 0), S = i[es] || null, S = S != null ? S[u] : null, typeof S == "function" && i.removeEventListener(r, S, E), typeof m == "function")) {
                typeof S != "function" && S !== null && (u in i ? i[u] = null : i.hasAttribute(u) && i.removeAttribute(u)), i.addEventListener(r, m, E);
                break t;
              }
              u in i ? i[u] = m : m === !0 ? i.setAttribute(u, "") : Pe(i, u, m);
            }
      }
    }
    function Na(i, r, u) {
      switch (Fl(r, u), r) {
        case "div":
        case "span":
        case "svg":
        case "path":
        case "a":
        case "g":
        case "p":
        case "li":
          break;
        case "img":
          mn("error", i), mn("load", i);
          var m = !1, E = !1, S;
          for (S in u)
            if (u.hasOwnProperty(S)) {
              var O = u[S];
              if (O != null)
                switch (S) {
                  case "src":
                    m = !0;
                    break;
                  case "srcSet":
                    E = !0;
                    break;
                  case "children":
                  case "dangerouslySetInnerHTML":
                    throw Error(
                      r + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
                    );
                  default:
                    Ve(i, r, S, O, u, null);
                }
            }
          E && Ve(i, r, "srcSet", u.srcSet, u, null), m && Ve(i, r, "src", u.src, u, null);
          return;
        case "input":
          oe("input", u), mn("invalid", i);
          var I = S = O = E = null, F = null, K = null;
          for (m in u)
            if (u.hasOwnProperty(m)) {
              var Rt = u[m];
              if (Rt != null)
                switch (m) {
                  case "name":
                    E = Rt;
                    break;
                  case "type":
                    O = Rt;
                    break;
                  case "checked":
                    F = Rt;
                    break;
                  case "defaultChecked":
                    K = Rt;
                    break;
                  case "value":
                    S = Rt;
                    break;
                  case "defaultValue":
                    I = Rt;
                    break;
                  case "children":
                  case "dangerouslySetInnerHTML":
                    if (Rt != null)
                      throw Error(
                        r + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
                      );
                    break;
                  default:
                    Ve(i, r, m, Rt, u, null);
                }
            }
          Lc(i, u), G0(
            i,
            S,
            I,
            F,
            K,
            O,
            E,
            !1
          ), Qi(i);
          return;
        case "select":
          oe("select", u), mn("invalid", i), m = O = S = null;
          for (E in u)
            if (u.hasOwnProperty(E) && (I = u[E], I != null))
              switch (E) {
                case "value":
                  S = I;
                  break;
                case "defaultValue":
                  O = I;
                  break;
                case "multiple":
                  m = I;
                default:
                  Ve(
                    i,
                    r,
                    E,
                    I,
                    u,
                    null
                  );
              }
          eo(i, u), r = S, u = O, i.multiple = !!m, r != null ? vl(i, !!m, r, !1) : u != null && vl(i, !!m, u, !0);
          return;
        case "textarea":
          oe("textarea", u), mn("invalid", i), S = E = m = null;
          for (O in u)
            if (u.hasOwnProperty(O) && (I = u[O], I != null))
              switch (O) {
                case "value":
                  m = I;
                  break;
                case "defaultValue":
                  E = I;
                  break;
                case "children":
                  S = I;
                  break;
                case "dangerouslySetInnerHTML":
                  if (I != null)
                    throw Error(
                      "`dangerouslySetInnerHTML` does not make sense on <textarea>."
                    );
                  break;
                default:
                  Ve(
                    i,
                    r,
                    O,
                    I,
                    u,
                    null
                  );
              }
          vd(i, u), Pc(i, m, E, S), Qi(i);
          return;
        case "option":
          Q_(i, u);
          for (F in u)
            if (u.hasOwnProperty(F) && (m = u[F], m != null))
              switch (F) {
                case "selected":
                  i.selected = m && typeof m != "function" && typeof m != "symbol";
                  break;
                default:
                  Ve(i, r, F, m, u, null);
              }
          return;
        case "dialog":
          mn("beforetoggle", i), mn("toggle", i), mn("cancel", i), mn("close", i);
          break;
        case "iframe":
        case "object":
          mn("load", i);
          break;
        case "video":
        case "audio":
          for (m = 0; m < rb.length; m++)
            mn(rb[m], i);
          break;
        case "image":
          mn("error", i), mn("load", i);
          break;
        case "details":
          mn("toggle", i);
          break;
        case "embed":
        case "source":
        case "link":
          mn("error", i), mn("load", i);
        case "area":
        case "base":
        case "br":
        case "col":
        case "hr":
        case "keygen":
        case "meta":
        case "param":
        case "track":
        case "wbr":
        case "menuitem":
          for (K in u)
            if (u.hasOwnProperty(K) && (m = u[K], m != null))
              switch (K) {
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(
                    r + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
                  );
                default:
                  Ve(i, r, K, m, u, null);
              }
          return;
        default:
          if (jc(r)) {
            for (Rt in u)
              u.hasOwnProperty(Rt) && (m = u[Rt], m !== void 0 && Xu(
                i,
                r,
                Rt,
                m,
                u,
                void 0
              ));
            return;
          }
      }
      for (I in u)
        u.hasOwnProperty(I) && (m = u[I], m != null && Ve(i, r, I, m, u, null));
    }
    function vv(i, r, u, m) {
      switch (Fl(r, m), r) {
        case "div":
        case "span":
        case "svg":
        case "path":
        case "a":
        case "g":
        case "p":
        case "li":
          break;
        case "input":
          var E = null, S = null, O = null, I = null, F = null, K = null, Rt = null;
          for (zt in u) {
            var Lt = u[zt];
            if (u.hasOwnProperty(zt) && Lt != null)
              switch (zt) {
                case "checked":
                  break;
                case "value":
                  break;
                case "defaultValue":
                  F = Lt;
                default:
                  m.hasOwnProperty(zt) || Ve(
                    i,
                    r,
                    zt,
                    null,
                    m,
                    Lt
                  );
              }
          }
          for (var wt in m) {
            var zt = m[wt];
            if (Lt = u[wt], m.hasOwnProperty(wt) && (zt != null || Lt != null))
              switch (wt) {
                case "type":
                  S = zt;
                  break;
                case "name":
                  E = zt;
                  break;
                case "checked":
                  K = zt;
                  break;
                case "defaultChecked":
                  Rt = zt;
                  break;
                case "value":
                  O = zt;
                  break;
                case "defaultValue":
                  I = zt;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (zt != null)
                    throw Error(
                      r + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
                    );
                  break;
                default:
                  zt !== Lt && Ve(
                    i,
                    r,
                    wt,
                    zt,
                    m,
                    Lt
                  );
              }
          }
          r = u.type === "checkbox" || u.type === "radio" ? u.checked != null : u.value != null, m = m.type === "checkbox" || m.type === "radio" ? m.checked != null : m.value != null, r || !m || V4 || (console.error(
            "A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"
          ), V4 = !0), !r || m || q4 || (console.error(
            "A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"
          ), q4 = !0), kf(
            i,
            O,
            I,
            F,
            K,
            Rt,
            S,
            E
          );
          return;
        case "select":
          zt = O = I = wt = null;
          for (S in u)
            if (F = u[S], u.hasOwnProperty(S) && F != null)
              switch (S) {
                case "value":
                  break;
                case "multiple":
                  zt = F;
                default:
                  m.hasOwnProperty(S) || Ve(
                    i,
                    r,
                    S,
                    null,
                    m,
                    F
                  );
              }
          for (E in m)
            if (S = m[E], F = u[E], m.hasOwnProperty(E) && (S != null || F != null))
              switch (E) {
                case "value":
                  wt = S;
                  break;
                case "defaultValue":
                  I = S;
                  break;
                case "multiple":
                  O = S;
                default:
                  S !== F && Ve(
                    i,
                    r,
                    E,
                    S,
                    m,
                    F
                  );
              }
          m = I, r = O, u = zt, wt != null ? vl(i, !!r, wt, !1) : !!u != !!r && (m != null ? vl(i, !!r, m, !0) : vl(i, !!r, r ? [] : "", !1));
          return;
        case "textarea":
          zt = wt = null;
          for (I in u)
            if (E = u[I], u.hasOwnProperty(I) && E != null && !m.hasOwnProperty(I))
              switch (I) {
                case "value":
                  break;
                case "children":
                  break;
                default:
                  Ve(i, r, I, null, m, E);
              }
          for (O in m)
            if (E = m[O], S = u[O], m.hasOwnProperty(O) && (E != null || S != null))
              switch (O) {
                case "value":
                  wt = E;
                  break;
                case "defaultValue":
                  zt = E;
                  break;
                case "children":
                  break;
                case "dangerouslySetInnerHTML":
                  if (E != null)
                    throw Error(
                      "`dangerouslySetInnerHTML` does not make sense on <textarea>."
                    );
                  break;
                default:
                  E !== S && Ve(i, r, O, E, m, S);
              }
          _m(i, wt, zt);
          return;
        case "option":
          for (var ge in u)
            if (wt = u[ge], u.hasOwnProperty(ge) && wt != null && !m.hasOwnProperty(ge))
              switch (ge) {
                case "selected":
                  i.selected = !1;
                  break;
                default:
                  Ve(
                    i,
                    r,
                    ge,
                    null,
                    m,
                    wt
                  );
              }
          for (F in m)
            if (wt = m[F], zt = u[F], m.hasOwnProperty(F) && wt !== zt && (wt != null || zt != null))
              switch (F) {
                case "selected":
                  i.selected = wt && typeof wt != "function" && typeof wt != "symbol";
                  break;
                default:
                  Ve(
                    i,
                    r,
                    F,
                    wt,
                    m,
                    zt
                  );
              }
          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 ke in u)
            wt = u[ke], u.hasOwnProperty(ke) && wt != null && !m.hasOwnProperty(ke) && Ve(
              i,
              r,
              ke,
              null,
              m,
              wt
            );
          for (K in m)
            if (wt = m[K], zt = u[K], m.hasOwnProperty(K) && wt !== zt && (wt != null || zt != null))
              switch (K) {
                case "children":
                case "dangerouslySetInnerHTML":
                  if (wt != null)
                    throw Error(
                      r + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
                    );
                  break;
                default:
                  Ve(
                    i,
                    r,
                    K,
                    wt,
                    m,
                    zt
                  );
              }
          return;
        default:
          if (jc(r)) {
            for (var Ii in u)
              wt = u[Ii], u.hasOwnProperty(Ii) && wt !== void 0 && !m.hasOwnProperty(Ii) && Xu(
                i,
                r,
                Ii,
                void 0,
                m,
                wt
              );
            for (Rt in m)
              wt = m[Rt], zt = u[Rt], !m.hasOwnProperty(Rt) || wt === zt || wt === void 0 && zt === void 0 || Xu(
                i,
                r,
                Rt,
                wt,
                m,
                zt
              );
            return;
          }
      }
      for (var On in u)
        wt = u[On], u.hasOwnProperty(On) && wt != null && !m.hasOwnProperty(On) && Ve(i, r, On, null, m, wt);
      for (Lt in m)
        wt = m[Lt], zt = u[Lt], !m.hasOwnProperty(Lt) || wt === zt || wt == null && zt == null || Ve(i, r, Lt, wt, m, zt);
    }
    function ff(i) {
      switch (i) {
        case "class":
          return "className";
        case "for":
          return "htmlFor";
        default:
          return i;
      }
    }
    function dp(i) {
      var r = {};
      i = i.style;
      for (var u = 0; u < i.length; u++) {
        var m = i[u];
        r[m] = i.getPropertyValue(m);
      }
      return r;
    }
    function dg(i, r, u) {
      if (r != null && typeof r != "object")
        console.error(
          "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
        );
      else {
        var m, E = m = "", S;
        for (S in r)
          if (r.hasOwnProperty(S)) {
            var O = r[S];
            O != null && typeof O != "boolean" && O !== "" && (S.indexOf("--") === 0 ? (At(O, S), m += E + S + ":" + ("" + O).trim()) : typeof O != "number" || O === 0 || Yy.has(S) ? (At(O, S), m += E + S.replace(iu, "-$1").toLowerCase().replace($h, "-ms-") + ":" + ("" + O).trim()) : m += E + S.replace(iu, "-$1").toLowerCase().replace($h, "-ms-") + ":" + O + "px", E = ";");
          }
        m = m || null, r = i.getAttribute("style"), r !== m && (m = $l(m), $l(r) !== m && (u.style = dp(i)));
      }
    }
    function Es(i, r, u, m, E, S) {
      if (E.delete(u), i = i.getAttribute(u), i === null)
        switch (typeof m) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            return;
        }
      else if (m != null)
        switch (typeof m) {
          case "function":
          case "symbol":
          case "boolean":
            break;
          default:
            if (st(m, r), i === "" + m)
              return;
        }
      gi(r, i, m, S);
    }
    function Ev(i, r, u, m, E, S) {
      if (E.delete(u), i = i.getAttribute(u), i === null) {
        switch (typeof m) {
          case "function":
          case "symbol":
            return;
        }
        if (!m) return;
      } else
        switch (typeof m) {
          case "function":
          case "symbol":
            break;
          default:
            if (m) return;
        }
      gi(r, i, m, S);
    }
    function gg(i, r, u, m, E, S) {
      if (E.delete(u), i = i.getAttribute(u), i === null)
        switch (typeof m) {
          case "undefined":
          case "function":
          case "symbol":
            return;
        }
      else if (m != null)
        switch (typeof m) {
          case "function":
          case "symbol":
            break;
          default:
            if (st(m, u), i === "" + m)
              return;
        }
      gi(r, i, m, S);
    }
    function qn(i, r, u, m, E, S) {
      if (E.delete(u), i = i.getAttribute(u), i === null)
        switch (typeof m) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            return;
          default:
            if (isNaN(m)) return;
        }
      else if (m != null)
        switch (typeof m) {
          case "function":
          case "symbol":
          case "boolean":
            break;
          default:
            if (!isNaN(m) && (st(m, r), i === "" + m))
              return;
        }
      gi(r, i, m, S);
    }
    function ii(i, r, u, m, E, S) {
      if (E.delete(u), i = i.getAttribute(u), i === null)
        switch (typeof m) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            return;
        }
      else if (m != null)
        switch (typeof m) {
          case "function":
          case "symbol":
          case "boolean":
            break;
          default:
            if (st(m, r), u = Sl("" + m), i === u)
              return;
        }
      gi(r, i, m, S);
    }
    function pn(i, r, u, m) {
      for (var E = {}, S = /* @__PURE__ */ new Set(), O = i.attributes, I = 0; I < O.length; I++)
        switch (O[I].name.toLowerCase()) {
          case "value":
            break;
          case "checked":
            break;
          case "selected":
            break;
          default:
            S.add(O[I].name);
        }
      if (jc(r)) {
        for (var F in u)
          if (u.hasOwnProperty(F)) {
            var K = u[F];
            if (K != null) {
              if (So.hasOwnProperty(F))
                typeof K != "function" && Vs(F, K);
              else if (u.suppressHydrationWarning !== !0)
                switch (F) {
                  case "children":
                    typeof K != "string" && typeof K != "number" || gi(
                      "children",
                      i.textContent,
                      K,
                      E
                    );
                    continue;
                  case "suppressContentEditableWarning":
                  case "suppressHydrationWarning":
                  case "defaultValue":
                  case "defaultChecked":
                  case "innerHTML":
                  case "ref":
                    continue;
                  case "dangerouslySetInnerHTML":
                    O = i.innerHTML, K = K ? K.__html : void 0, K != null && (K = po(i, K), gi(
                      F,
                      O,
                      K,
                      E
                    ));
                    continue;
                  case "style":
                    S.delete(F), dg(i, K, E);
                    continue;
                  case "offsetParent":
                  case "offsetTop":
                  case "offsetLeft":
                  case "offsetWidth":
                  case "offsetHeight":
                  case "isContentEditable":
                  case "outerText":
                  case "outerHTML":
                    S.delete(F.toLowerCase()), console.error(
                      "Assignment to read-only property will result in a no-op: `%s`",
                      F
                    );
                    continue;
                  case "className":
                    S.delete("class"), O = Ue(
                      i,
                      "class",
                      K
                    ), gi(
                      "className",
                      O,
                      K,
                      E
                    );
                    continue;
                  default:
                    m.context === Kg && r !== "svg" && r !== "math" ? S.delete(F.toLowerCase()) : S.delete(F), O = Ue(
                      i,
                      F,
                      K
                    ), gi(
                      F,
                      O,
                      K,
                      E
                    );
                }
            }
          }
      } else
        for (K in u)
          if (u.hasOwnProperty(K) && (F = u[K], F != null)) {
            if (So.hasOwnProperty(K))
              typeof F != "function" && Vs(K, F);
            else if (u.suppressHydrationWarning !== !0)
              switch (K) {
                case "children":
                  typeof F != "string" && typeof F != "number" || gi(
                    "children",
                    i.textContent,
                    F,
                    E
                  );
                  continue;
                case "suppressContentEditableWarning":
                case "suppressHydrationWarning":
                case "value":
                case "checked":
                case "selected":
                case "defaultValue":
                case "defaultChecked":
                case "innerHTML":
                case "ref":
                  continue;
                case "dangerouslySetInnerHTML":
                  O = i.innerHTML, F = F ? F.__html : void 0, F != null && (F = po(i, F), O !== F && (E[K] = { __html: O }));
                  continue;
                case "className":
                  Es(
                    i,
                    K,
                    "class",
                    F,
                    S,
                    E
                  );
                  continue;
                case "tabIndex":
                  Es(
                    i,
                    K,
                    "tabindex",
                    F,
                    S,
                    E
                  );
                  continue;
                case "style":
                  S.delete(K), dg(i, F, E);
                  continue;
                case "multiple":
                  S.delete(K), gi(
                    K,
                    i.multiple,
                    F,
                    E
                  );
                  continue;
                case "muted":
                  S.delete(K), gi(
                    K,
                    i.muted,
                    F,
                    E
                  );
                  continue;
                case "autoFocus":
                  S.delete("autofocus"), gi(
                    K,
                    i.autofocus,
                    F,
                    E
                  );
                  continue;
                case "data":
                  if (r !== "object") {
                    S.delete(K), O = i.getAttribute("data"), gi(
                      K,
                      O,
                      F,
                      E
                    );
                    continue;
                  }
                case "src":
                case "href":
                  if (!(F !== "" || r === "a" && K === "href" || r === "object" && K === "data")) {
                    console.error(
                      K === "src" ? 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.' : 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
                      K,
                      K
                    );
                    continue;
                  }
                  ii(
                    i,
                    K,
                    K,
                    F,
                    S,
                    E
                  );
                  continue;
                case "action":
                case "formAction":
                  if (O = i.getAttribute(K), typeof F == "function") {
                    S.delete(K.toLowerCase()), K === "formAction" ? (S.delete("name"), S.delete("formenctype"), S.delete("formmethod"), S.delete("formtarget")) : (S.delete("enctype"), S.delete("method"), S.delete("target"));
                    continue;
                  } else if (O === PI) {
                    S.delete(K.toLowerCase()), gi(
                      K,
                      "function",
                      F,
                      E
                    );
                    continue;
                  }
                  ii(
                    i,
                    K,
                    K.toLowerCase(),
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkHref":
                  ii(
                    i,
                    K,
                    "xlink:href",
                    F,
                    S,
                    E
                  );
                  continue;
                case "contentEditable":
                  gg(
                    i,
                    K,
                    "contenteditable",
                    F,
                    S,
                    E
                  );
                  continue;
                case "spellCheck":
                  gg(
                    i,
                    K,
                    "spellcheck",
                    F,
                    S,
                    E
                  );
                  continue;
                case "draggable":
                case "autoReverse":
                case "externalResourcesRequired":
                case "focusable":
                case "preserveAlpha":
                  gg(
                    i,
                    K,
                    K,
                    F,
                    S,
                    E
                  );
                  continue;
                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":
                  Ev(
                    i,
                    K,
                    K.toLowerCase(),
                    F,
                    S,
                    E
                  );
                  continue;
                case "capture":
                case "download":
                  t: {
                    I = i;
                    var Rt = O = K, Lt = E;
                    if (S.delete(Rt), I = I.getAttribute(Rt), I === null)
                      switch (typeof F) {
                        case "undefined":
                        case "function":
                        case "symbol":
                          break t;
                        default:
                          if (F === !1) break t;
                      }
                    else if (F != null)
                      switch (typeof F) {
                        case "function":
                        case "symbol":
                          break;
                        case "boolean":
                          if (F === !0 && I === "") break t;
                          break;
                        default:
                          if (st(F, O), I === "" + F)
                            break t;
                      }
                    gi(
                      O,
                      I,
                      F,
                      Lt
                    );
                  }
                  continue;
                case "cols":
                case "rows":
                case "size":
                case "span":
                  t: {
                    if (I = i, Rt = O = K, Lt = E, S.delete(Rt), I = I.getAttribute(Rt), I === null)
                      switch (typeof F) {
                        case "undefined":
                        case "function":
                        case "symbol":
                        case "boolean":
                          break t;
                        default:
                          if (isNaN(F) || 1 > F) break t;
                      }
                    else if (F != null)
                      switch (typeof F) {
                        case "function":
                        case "symbol":
                        case "boolean":
                          break;
                        default:
                          if (!(isNaN(F) || 1 > F) && (st(F, O), I === "" + F))
                            break t;
                      }
                    gi(
                      O,
                      I,
                      F,
                      Lt
                    );
                  }
                  continue;
                case "rowSpan":
                  qn(
                    i,
                    K,
                    "rowspan",
                    F,
                    S,
                    E
                  );
                  continue;
                case "start":
                  qn(
                    i,
                    K,
                    K,
                    F,
                    S,
                    E
                  );
                  continue;
                case "xHeight":
                  Es(
                    i,
                    K,
                    "x-height",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkActuate":
                  Es(
                    i,
                    K,
                    "xlink:actuate",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkArcrole":
                  Es(
                    i,
                    K,
                    "xlink:arcrole",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkRole":
                  Es(
                    i,
                    K,
                    "xlink:role",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkShow":
                  Es(
                    i,
                    K,
                    "xlink:show",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkTitle":
                  Es(
                    i,
                    K,
                    "xlink:title",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xlinkType":
                  Es(
                    i,
                    K,
                    "xlink:type",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xmlBase":
                  Es(
                    i,
                    K,
                    "xml:base",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xmlLang":
                  Es(
                    i,
                    K,
                    "xml:lang",
                    F,
                    S,
                    E
                  );
                  continue;
                case "xmlSpace":
                  Es(
                    i,
                    K,
                    "xml:space",
                    F,
                    S,
                    E
                  );
                  continue;
                case "inert":
                  F !== "" || xx[K] || (xx[K] = !0, console.error(
                    "Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
                    K
                  )), Ev(
                    i,
                    K,
                    K,
                    F,
                    S,
                    E
                  );
                  continue;
                default:
                  if (!(2 < K.length) || K[0] !== "o" && K[0] !== "O" || K[1] !== "n" && K[1] !== "N") {
                    I = kc(K), O = !1, m.context === Kg && r !== "svg" && r !== "math" ? S.delete(I.toLowerCase()) : (Rt = K.toLowerCase(), Rt = jg.hasOwnProperty(
                      Rt
                    ) && jg[Rt] || null, Rt !== null && Rt !== K && (O = !0, S.delete(Rt)), S.delete(I));
                    t: if (Rt = i, Lt = I, I = F, Be(Lt))
                      if (Rt.hasAttribute(Lt))
                        Rt = Rt.getAttribute(
                          Lt
                        ), st(
                          I,
                          Lt
                        ), I = Rt === "" + I ? I : Rt;
                      else {
                        switch (typeof I) {
                          case "function":
                          case "symbol":
                            break t;
                          case "boolean":
                            if (Rt = Lt.toLowerCase().slice(0, 5), Rt !== "data-" && Rt !== "aria-")
                              break t;
                        }
                        I = I === void 0 ? void 0 : null;
                      }
                    else I = void 0;
                    O || gi(
                      K,
                      I,
                      F,
                      E
                    );
                  }
              }
          }
      return 0 < S.size && u.suppressHydrationWarning !== !0 && by(i, S, E), Object.keys(E).length === 0 ? null : E;
    }
    function Rn(i, r) {
      switch (i.length) {
        case 0:
          return "";
        case 1:
          return i[0];
        case 2:
          return i[0] + " " + r + " " + i[1];
        default:
          return i.slice(0, -1).join(", ") + ", " + r + " " + i[i.length - 1];
      }
    }
    function In(i) {
      return i.nodeType === 9 ? i : i.ownerDocument;
    }
    function Qr(i) {
      switch (i) {
        case au:
          return g1;
        case jp:
          return Rx;
        default:
          return Kg;
      }
    }
    function Xl(i, r) {
      if (i === Kg)
        switch (r) {
          case "svg":
            return g1;
          case "math":
            return Rx;
          default:
            return Kg;
        }
      return i === g1 && r === "foreignObject" ? Kg : i;
    }
    function Ku(i, r) {
      return i === "textarea" || i === "noscript" || typeof r.children == "string" || typeof r.children == "number" || typeof r.children == "bigint" || typeof r.dangerouslySetInnerHTML == "object" && r.dangerouslySetInnerHTML !== null && r.dangerouslySetInnerHTML.__html != null;
    }
    function Sy() {
      var i = window.event;
      return i && i.type === "popstate" ? i === FR ? !1 : (FR = i, !0) : (FR = null, !1);
    }
    function Kl(i) {
      setTimeout(function() {
        throw i;
      });
    }
    function Hi(i, r, u) {
      switch (r) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          u.autoFocus && i.focus();
          break;
        case "img":
          u.src ? i.src = u.src : u.srcSet && (i.srcset = u.srcSet);
      }
    }
    function Zu(i, r, u, m) {
      vv(i, r, u, m), i[es] = m;
    }
    function Wu(i) {
      Ff(i, "");
    }
    function xy(i, r, u) {
      i.nodeValue = u;
    }
    function ba(i) {
      return i === "head";
    }
    function Lh(i, r) {
      i.removeChild(r);
    }
    function mg(i, r) {
      (i.nodeType === 9 ? i.body : i.nodeName === "HTML" ? i.ownerDocument.body : i).removeChild(r);
    }
    function Ar(i, r) {
      var u = r, m = 0, E = 0;
      do {
        var S = u.nextSibling;
        if (i.removeChild(u), S && S.nodeType === 8)
          if (u = S.data, u === wx) {
            if (0 < m && 8 > m) {
              u = m;
              var O = i.ownerDocument;
              if (u & GI && zh(O.documentElement), u & UI && zh(O.body), u & jI)
                for (u = O.head, zh(u), O = u.firstChild; O; ) {
                  var I = O.nextSibling, F = O.nodeName;
                  O[Og] || F === "SCRIPT" || F === "STYLE" || F === "LINK" && O.rel.toLowerCase() === "stylesheet" || u.removeChild(O), O = I;
                }
            }
            if (E === 0) {
              i.removeChild(S), qh(r);
              return;
            }
            E--;
          } else
            u === Tx || u === Xg || u === sb ? E++ : m = u.charCodeAt(0) - 48;
        else m = 0;
        u = S;
      } while (u);
      qh(r);
    }
    function Ty(i) {
      i = i.style, typeof i.setProperty == "function" ? i.setProperty("display", "none", "important") : i.display = "none";
    }
    function wy(i) {
      i.nodeValue = "";
    }
    function Ih(i, r) {
      r = r[kI], r = r != null && r.hasOwnProperty("display") ? r.display : null, i.style.display = r == null || typeof r == "boolean" ? "" : ("" + r).trim();
    }
    function pg(i, r) {
      i.nodeValue = r;
    }
    function $o(i) {
      var r = i.firstChild;
      for (r && r.nodeType === 10 && (r = r.nextSibling); r; ) {
        var u = r;
        switch (r = r.nextSibling, u.nodeName) {
          case "HTML":
          case "HEAD":
          case "BODY":
            $o(u), ir(u);
            continue;
          case "SCRIPT":
          case "STYLE":
            continue;
          case "LINK":
            if (u.rel.toLowerCase() === "stylesheet") continue;
        }
        i.removeChild(u);
      }
    }
    function Ka(i, r, u, m) {
      for (; i.nodeType === 1; ) {
        var E = u;
        if (i.nodeName.toLowerCase() !== r.toLowerCase()) {
          if (!m && (i.nodeName !== "INPUT" || i.type !== "hidden"))
            break;
        } else if (m) {
          if (!i[Og])
            switch (r) {
              case "meta":
                if (!i.hasAttribute("itemprop")) break;
                return i;
              case "link":
                if (S = i.getAttribute("rel"), S === "stylesheet" && i.hasAttribute("data-precedence"))
                  break;
                if (S !== E.rel || i.getAttribute("href") !== (E.href == null || E.href === "" ? null : E.href) || i.getAttribute("crossorigin") !== (E.crossOrigin == null ? null : E.crossOrigin) || i.getAttribute("title") !== (E.title == null ? null : E.title))
                  break;
                return i;
              case "style":
                if (i.hasAttribute("data-precedence")) break;
                return i;
              case "script":
                if (S = i.getAttribute("src"), (S !== (E.src == null ? null : E.src) || i.getAttribute("type") !== (E.type == null ? null : E.type) || i.getAttribute("crossorigin") !== (E.crossOrigin == null ? null : E.crossOrigin)) && S && i.hasAttribute("async") && !i.hasAttribute("itemprop"))
                  break;
                return i;
              default:
                return i;
            }
        } else if (r === "input" && i.type === "hidden") {
          st(E.name, "name");
          var S = E.name == null ? null : "" + E.name;
          if (E.type === "hidden" && i.getAttribute("name") === S)
            return i;
        } else return i;
        if (i = Jr(i.nextSibling), i === null) break;
      }
      return null;
    }
    function Qu(i, r, u) {
      if (r === "") return null;
      for (; i.nodeType !== 3; )
        if ((i.nodeType !== 1 || i.nodeName !== "INPUT" || i.type !== "hidden") && !u || (i = Jr(i.nextSibling), i === null)) return null;
      return i;
    }
    function Ju(i) {
      return i.data === sb || i.data === Xg && i.ownerDocument.readyState === X4;
    }
    function Ph(i, r) {
      var u = i.ownerDocument;
      if (i.data !== Xg || u.readyState === X4)
        r();
      else {
        var m = function() {
          r(), u.removeEventListener("DOMContentLoaded", m);
        };
        u.addEventListener("DOMContentLoaded", m), i._reactRetry = m;
      }
    }
    function Jr(i) {
      for (; i != null; i = i.nextSibling) {
        var r = i.nodeType;
        if (r === 1 || r === 3) break;
        if (r === 8) {
          if (r = i.data, r === Tx || r === sb || r === Xg || r === qR || r === $4)
            break;
          if (r === wx) return null;
        }
      }
      return i;
    }
    function gp(i) {
      if (i.nodeType === 1) {
        for (var r = i.nodeName.toLowerCase(), u = {}, m = i.attributes, E = 0; E < m.length; E++) {
          var S = m[E];
          u[ff(S.name)] = S.name.toLowerCase() === "style" ? dp(i) : S.value;
        }
        return { type: r, props: u };
      }
      return i.nodeType === 8 ? { type: "Suspense", props: {} } : i.nodeValue;
    }
    function Ry(i, r, u) {
      return u === null || u[zI] !== !0 ? (i.nodeValue === r ? i = null : (r = $l(r), i = $l(i.nodeValue) === r ? null : i.nodeValue), i) : null;
    }
    function hf(i) {
      i = i.nextSibling;
      for (var r = 0; i; ) {
        if (i.nodeType === 8) {
          var u = i.data;
          if (u === wx) {
            if (r === 0)
              return Jr(i.nextSibling);
            r--;
          } else
            u !== Tx && u !== sb && u !== Xg || r++;
        }
        i = i.nextSibling;
      }
      return null;
    }
    function mp(i) {
      i = i.previousSibling;
      for (var r = 0; i; ) {
        if (i.nodeType === 8) {
          var u = i.data;
          if (u === Tx || u === sb || u === Xg) {
            if (r === 0) return i;
            r--;
          } else u === wx && r++;
        }
        i = i.previousSibling;
      }
      return null;
    }
    function cr(i) {
      qh(i);
    }
    function bv(i) {
      qh(i);
    }
    function ts(i, r, u, m, E) {
      switch (E && bd(i, m.ancestorInfo), r = In(u), i) {
        case "html":
          if (i = r.documentElement, !i)
            throw Error(
              "React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page."
            );
          return i;
        case "head":
          if (i = r.head, !i)
            throw Error(
              "React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page."
            );
          return i;
        case "body":
          if (i = r.body, !i)
            throw Error(
              "React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page."
            );
          return i;
        default:
          throw Error(
            "resolveSingletonInstance was called with an element type that is not supported. This is a bug in React."
          );
      }
    }
    function Sv(i, r, u, m) {
      if (!u[lc] && sa(u)) {
        var E = u.tagName.toLowerCase();
        console.error(
          "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",
          E,
          E,
          E
        );
      }
      switch (i) {
        case "html":
        case "head":
        case "body":
          break;
        default:
          console.error(
            "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React."
          );
      }
      for (E = u.attributes; E.length; )
        u.removeAttributeNode(E[0]);
      Na(u, i, r), u[fr] = m, u[es] = r;
    }
    function zh(i) {
      for (var r = i.attributes; r.length; )
        i.removeAttributeNode(r[0]);
      ir(i);
    }
    function pp(i) {
      return typeof i.getRootNode == "function" ? i.getRootNode() : i.nodeType === 9 ? i : i.ownerDocument;
    }
    function Zl(i, r, u) {
      var m = m1;
      if (m && typeof r == "string" && r) {
        var E = Ra(r);
        E = 'link[rel="' + i + '"][href="' + E + '"]', typeof u == "string" && (E += '[crossorigin="' + u + '"]'), t3.has(E) || (t3.add(E), i = { rel: i, crossOrigin: u, href: r }, m.querySelector(E) === null && (r = m.createElement("link"), Na(r, "link", i), dt(r), m.head.appendChild(r)));
      }
    }
    function yg(i, r, u, m) {
      var E = (E = Xo.current) ? pp(E) : null;
      if (!E)
        throw Error(
          '"resourceRoot" was expected to exist. This is a bug in React.'
        );
      switch (i) {
        case "meta":
        case "title":
          return null;
        case "style":
          return typeof u.precedence == "string" && typeof u.href == "string" ? (u = yo(u.href), r = Y(E).hoistableStyles, m = r.get(u), m || (m = {
            type: "style",
            instance: null,
            count: 0,
            state: null
          }, r.set(u, m)), m) : { type: "void", instance: null, count: 0, state: null };
        case "link":
          if (u.rel === "stylesheet" && typeof u.href == "string" && typeof u.precedence == "string") {
            i = yo(u.href);
            var S = Y(E).hoistableStyles, O = S.get(i);
            if (!O && (E = E.ownerDocument || E, O = {
              type: "stylesheet",
              instance: null,
              count: 0,
              state: { loading: l_, preload: null }
            }, S.set(i, O), (S = E.querySelector(
              Uh(i)
            )) && !S._p && (O.instance = S, O.state.loading = ob | Ec), !bc.has(i))) {
              var I = {
                rel: "preload",
                as: "style",
                href: u.href,
                crossOrigin: u.crossOrigin,
                integrity: u.integrity,
                media: u.media,
                hrefLang: u.hrefLang,
                referrerPolicy: u.referrerPolicy
              };
              bc.set(i, I), S || xv(
                E,
                i,
                I,
                O.state
              );
            }
            if (r && m === null)
              throw u = `

  - ` + Gh(r) + `
  + ` + Gh(u), Error(
                "Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key." + u
              );
            return O;
          }
          if (r && m !== null)
            throw u = `

  - ` + Gh(r) + `
  + ` + Gh(u), Error(
              "Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key." + u
            );
          return null;
        case "script":
          return r = u.async, u = u.src, typeof u == "string" && r && typeof r != "function" && typeof r != "symbol" ? (u = tc(u), r = Y(E).hoistableScripts, m = r.get(u), m || (m = {
            type: "script",
            instance: null,
            count: 0,
            state: null
          }, r.set(u, m)), m) : { type: "void", instance: null, count: 0, state: null };
        default:
          throw Error(
            'getResource encountered a type it did not expect: "' + i + '". this is a bug in React.'
          );
      }
    }
    function Gh(i) {
      var r = 0, u = "<link";
      return typeof i.rel == "string" ? (r++, u += ' rel="' + i.rel + '"') : Ko.call(i, "rel") && (r++, u += ' rel="' + (i.rel === null ? "null" : "invalid type " + typeof i.rel) + '"'), typeof i.href == "string" ? (r++, u += ' href="' + i.href + '"') : Ko.call(i, "href") && (r++, u += ' href="' + (i.href === null ? "null" : "invalid type " + typeof i.href) + '"'), typeof i.precedence == "string" ? (r++, u += ' precedence="' + i.precedence + '"') : Ko.call(i, "precedence") && (r++, u += " precedence={" + (i.precedence === null ? "null" : "invalid type " + typeof i.precedence) + "}"), Object.getOwnPropertyNames(i).length > r && (u += " ..."), u + " />";
    }
    function yo(i) {
      return 'href="' + Ra(i) + '"';
    }
    function Uh(i) {
      return 'link[rel="stylesheet"][' + i + "]";
    }
    function Ay(i) {
      return He({}, i, {
        "data-precedence": i.precedence,
        precedence: null
      });
    }
    function xv(i, r, u, m) {
      i.querySelector(
        'link[rel="preload"][as="style"][' + r + "]"
      ) ? m.loading = ob : (r = i.createElement("link"), m.preload = r, r.addEventListener("load", function() {
        return m.loading |= ob;
      }), r.addEventListener("error", function() {
        return m.loading |= Q4;
      }), Na(r, "link", u), dt(r), i.head.appendChild(r));
    }
    function tc(i) {
      return '[src="' + Ra(i) + '"]';
    }
    function df(i) {
      return "script[async]" + i;
    }
    function Tv(i, r, u) {
      if (r.count++, r.instance === null)
        switch (r.type) {
          case "style":
            var m = i.querySelector(
              'style[data-href~="' + Ra(u.href) + '"]'
            );
            if (m)
              return r.instance = m, dt(m), m;
            var E = He({}, u, {
              "data-href": u.href,
              "data-precedence": u.precedence,
              href: null,
              precedence: null
            });
            return m = (i.ownerDocument || i).createElement("style"), dt(m), Na(m, "style", E), yp(m, u.precedence, i), r.instance = m;
          case "stylesheet":
            E = yo(u.href);
            var S = i.querySelector(
              Uh(E)
            );
            if (S)
              return r.state.loading |= Ec, r.instance = S, dt(S), S;
            m = Ay(u), (E = bc.get(E)) && _p(m, E), S = (i.ownerDocument || i).createElement("link"), dt(S);
            var O = S;
            return O._p = new Promise(function(I, F) {
              O.onload = I, O.onerror = F;
            }), Na(S, "link", m), r.state.loading |= Ec, yp(S, u.precedence, i), r.instance = S;
          case "script":
            return S = tc(u.src), (E = i.querySelector(
              df(S)
            )) ? (r.instance = E, dt(E), E) : (m = u, (E = bc.get(S)) && (m = He({}, u), _g(m, E)), i = i.ownerDocument || i, E = i.createElement("script"), dt(E), Na(E, "link", m), i.head.appendChild(E), r.instance = E);
          case "void":
            return null;
          default:
            throw Error(
              'acquireResource encountered a resource type it did not expect: "' + r.type + '". this is a bug in React.'
            );
        }
      else
        r.type === "stylesheet" && (r.state.loading & Ec) === l_ && (m = r.instance, r.state.loading |= Ec, yp(m, u.precedence, i));
      return r.instance;
    }
    function yp(i, r, u) {
      for (var m = u.querySelectorAll(
        'link[rel="stylesheet"][data-precedence],style[data-precedence]'
      ), E = m.length ? m[m.length - 1] : null, S = E, O = 0; O < m.length; O++) {
        var I = m[O];
        if (I.dataset.precedence === r) S = I;
        else if (S !== E) break;
      }
      S ? S.parentNode.insertBefore(i, S.nextSibling) : (r = u.nodeType === 9 ? u.head : u, r.insertBefore(i, r.firstChild));
    }
    function _p(i, r) {
      i.crossOrigin == null && (i.crossOrigin = r.crossOrigin), i.referrerPolicy == null && (i.referrerPolicy = r.referrerPolicy), i.title == null && (i.title = r.title);
    }
    function _g(i, r) {
      i.crossOrigin == null && (i.crossOrigin = r.crossOrigin), i.referrerPolicy == null && (i.referrerPolicy = r.referrerPolicy), i.integrity == null && (i.integrity = r.integrity);
    }
    function My(i, r, u) {
      if (Ax === null) {
        var m = /* @__PURE__ */ new Map(), E = Ax = /* @__PURE__ */ new Map();
        E.set(u, m);
      } else
        E = Ax, m = E.get(u), m || (m = /* @__PURE__ */ new Map(), E.set(u, m));
      if (m.has(i)) return m;
      for (m.set(i, null), u = u.getElementsByTagName(i), E = 0; E < u.length; E++) {
        var S = u[E];
        if (!(S[Og] || S[fr] || i === "link" && S.getAttribute("rel") === "stylesheet") && S.namespaceURI !== au) {
          var O = S.getAttribute(r) || "";
          O = i + O;
          var I = m.get(O);
          I ? I.push(S) : m.set(O, [S]);
        }
      }
      return m;
    }
    function gf(i, r, u) {
      i = i.ownerDocument || i, i.head.insertBefore(
        u,
        r === "title" ? i.querySelector("head > title") : null
      );
    }
    function vp(i, r, u) {
      var m = !u.ancestorInfo.containerTagInScope;
      if (u.context === g1 || r.itemProp != null)
        return !m || r.itemProp == null || i !== "meta" && i !== "title" && i !== "style" && i !== "link" && i !== "script" || console.error(
          "Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",
          i,
          i
        ), !1;
      switch (i) {
        case "meta":
        case "title":
          return !0;
        case "style":
          if (typeof r.precedence != "string" || typeof r.href != "string" || r.href === "") {
            m && console.error(
              'Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags.  Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.'
            );
            break;
          }
          return !0;
        case "link":
          if (typeof r.rel != "string" || typeof r.href != "string" || r.href === "" || r.onLoad || r.onError) {
            if (r.rel === "stylesheet" && typeof r.precedence == "string") {
              i = r.href;
              var E = r.onError, S = r.disabled;
              u = [], r.onLoad && u.push("`onLoad`"), E && u.push("`onError`"), S != null && u.push("`disabled`"), E = Rn(u, "and"), E += u.length === 1 ? " prop" : " props", S = u.length === 1 ? "an " + E : "the " + E, u.length && console.error(
                'React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',
                i,
                S,
                E
              );
            }
            m && (typeof r.rel != "string" || typeof r.href != "string" || r.href === "" ? console.error(
              "Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"
            ) : (r.onError || r.onLoad) && console.error(
              "Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."
            ));
            break;
          }
          switch (r.rel) {
            case "stylesheet":
              return i = r.precedence, r = r.disabled, typeof i != "string" && m && console.error(
                'Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'
              ), typeof i == "string" && r == null;
            default:
              return !0;
          }
        case "script":
          if (i = r.async && typeof r.async != "function" && typeof r.async != "symbol", !i || r.onLoad || r.onError || !r.src || typeof r.src != "string") {
            m && (i ? r.onLoad || r.onError ? console.error(
              "Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."
            ) : console.error(
              "Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."
            ) : console.error(
              'Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'
            ));
            break;
          }
          return !0;
        case "noscript":
        case "template":
          m && console.error(
            "Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",
            i
          );
      }
      return !1;
    }
    function Cy(i) {
      return !(i.type === "stylesheet" && (i.state.loading & J4) === l_);
    }
    function vg() {
    }
    function wv(i, r, u) {
      if (lb === null)
        throw Error(
          "Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug."
        );
      var m = lb;
      if (r.type === "stylesheet" && (typeof u.media != "string" || matchMedia(u.media).matches !== !1) && (r.state.loading & Ec) === l_) {
        if (r.instance === null) {
          var E = yo(u.href), S = i.querySelector(
            Uh(E)
          );
          if (S) {
            i = S._p, i !== null && typeof i == "object" && typeof i.then == "function" && (m.count++, m = Eg.bind(m), i.then(m, m)), r.state.loading |= Ec, r.instance = S, dt(S);
            return;
          }
          S = i.ownerDocument || i, u = Ay(u), (E = bc.get(E)) && _p(u, E), S = S.createElement("link"), dt(S);
          var O = S;
          O._p = new Promise(function(I, F) {
            O.onload = I, O.onerror = F;
          }), Na(S, "link", u), r.instance = S;
        }
        m.stylesheets === null && (m.stylesheets = /* @__PURE__ */ new Map()), m.stylesheets.set(r, i), (i = r.state.preload) && (r.state.loading & J4) === l_ && (m.count++, r = Eg.bind(m), i.addEventListener("load", r), i.addEventListener("error", r));
      }
    }
    function Rv() {
      if (lb === null)
        throw Error(
          "Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug."
        );
      var i = lb;
      return i.stylesheets && i.count === 0 && Ep(i, i.stylesheets), 0 < i.count ? function(r) {
        var u = setTimeout(function() {
          if (i.stylesheets && Ep(i, i.stylesheets), i.unsuspend) {
            var m = i.unsuspend;
            i.unsuspend = null, m();
          }
        }, 6e4);
        return i.unsuspend = r, function() {
          i.unsuspend = null, clearTimeout(u);
        };
      } : null;
    }
    function Eg() {
      if (this.count--, this.count === 0) {
        if (this.stylesheets)
          Ep(this, this.stylesheets);
        else if (this.unsuspend) {
          var i = this.unsuspend;
          this.unsuspend = null, i();
        }
      }
    }
    function Ep(i, r) {
      i.stylesheets = null, i.unsuspend !== null && (i.count++, Mx = /* @__PURE__ */ new Map(), r.forEach(bp, i), Mx = null, Eg.call(i));
    }
    function bp(i, r) {
      if (!(r.state.loading & Ec)) {
        var u = Mx.get(i);
        if (u) var m = u.get(XR);
        else {
          u = /* @__PURE__ */ new Map(), Mx.set(i, u);
          for (var E = i.querySelectorAll(
            "link[data-precedence],style[data-precedence]"
          ), S = 0; S < E.length; S++) {
            var O = E[S];
            (O.nodeName === "LINK" || O.getAttribute("media") !== "not all") && (u.set(O.dataset.precedence, O), m = O);
          }
          m && u.set(XR, m);
        }
        E = r.instance, O = E.getAttribute("data-precedence"), S = u.get(O) || m, S === m && u.set(XR, E), u.set(O, E), this.count++, m = Eg.bind(this), E.addEventListener("load", m), E.addEventListener("error", m), S ? S.parentNode.insertBefore(E, S.nextSibling) : (i = i.nodeType === 9 ? i.head : i, i.insertBefore(E, i.firstChild)), r.state.loading |= Ec;
      }
    }
    function Av(i, r, u, m, E, S, O, I) {
      for (this.tag = 1, this.containerInfo = i, this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = o_, this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null, this.callbackPriority = 0, this.expirationTimes = Dn(-1), this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = Dn(0), this.hiddenUpdates = Dn(null), this.identifierPrefix = m, this.onUncaughtError = E, this.onCaughtError = S, this.onRecoverableError = O, this.pooledCache = null, this.pooledCacheLanes = 0, this.formState = I, this.incompleteTransitions = /* @__PURE__ */ new Map(), this.passiveEffectDuration = this.effectDuration = -0, this.memoizedUpdaters = /* @__PURE__ */ new Set(), i = this.pendingUpdatersLaneMap = [], r = 0; 31 > r; r++) i.push(/* @__PURE__ */ new Set());
      this._debugRootType = u ? "hydrateRoot()" : "createRoot()";
    }
    function Oy(i, r, u, m, E, S, O, I, F, K, Rt, Lt) {
      return i = new Av(
        i,
        r,
        u,
        O,
        I,
        F,
        K,
        Lt
      ), r = hI, S === !0 && (r |= Ks | xf), da && (r |= bs), S = A(3, null, null, r), i.current = S, S.stateNode = i, r = $0(), Ps(r), i.pooledCache = r, Ps(r), S.memoizedState = {
        element: m,
        isDehydrated: u,
        cache: r
      }, Tu(S), i;
    }
    function ai(i) {
      return i ? (i = Bp, i) : Bp;
    }
    function bg(i, r, u, m, E, S) {
      if (Wa && typeof Wa.onScheduleFiberRoot == "function")
        try {
          Wa.onScheduleFiberRoot(pf, m, u);
        } catch (O) {
          qi || (qi = !0, console.error(
            "React instrumentation encountered an error: %s",
            O
          ));
        }
      ie !== null && typeof ie.markRenderScheduled == "function" && ie.markRenderScheduled(r), E = ai(E), m.context === null ? m.context = E : m.pendingContext = E, Jo && La !== null && !a3 && (a3 = !0, console.error(
        `Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`,
        ht(La) || "Unknown"
      )), m = Br(r), m.payload = { element: u }, S = S === void 0 ? null : S, S !== null && (typeof S != "function" && console.error(
        "Expected the last optional `callback` argument to be a function. Instead received: %s.",
        S
      ), m.callback = S), u = Aa(i, m, r), u !== null && (gn(u, i, r), zo(u, i, r));
    }
    function Mv(i, r) {
      if (i = i.memoizedState, i !== null && i.dehydrated !== null) {
        var u = i.retryLane;
        i.retryLane = u !== 0 && u < r ? u : r;
      }
    }
    function Sp(i, r) {
      Mv(i, r), (i = i.alternate) && Mv(i, r);
    }
    function Sg(i) {
      if (i.tag === 13) {
        var r = Gr(i, 67108864);
        r !== null && gn(r, i, 67108864), Sp(i, 67108864);
      }
    }
    function RE() {
      return La;
    }
    function Cv() {
      for (var i = /* @__PURE__ */ new Map(), r = 1, u = 0; 31 > u; u++) {
        var m = Pi(r);
        i.set(r, m), r *= 2;
      }
      return i;
    }
    function xg(i, r, u, m) {
      var E = Tt.T;
      Tt.T = null;
      var S = Un.p;
      try {
        Un.p = Ze, jh(i, r, u, m);
      } finally {
        Un.p = S, Tt.T = E;
      }
    }
    function ec(i, r, u, m) {
      var E = Tt.T;
      Tt.T = null;
      var S = Un.p;
      try {
        Un.p = Wo, jh(i, r, u, m);
      } finally {
        Un.p = S, Tt.T = E;
      }
    }
    function jh(i, r, u, m) {
      if (Ox) {
        var E = mf(m);
        if (E === null)
          Wr(
            i,
            r,
            m,
            Dx,
            u
          ), _o(i, m);
        else if (AE(
          E,
          i,
          r,
          u,
          m
        ))
          m.stopPropagation();
        else if (_o(i, m), r & 4 && -1 < VI.indexOf(i)) {
          for (; E !== null; ) {
            var S = sa(E);
            if (S !== null)
              switch (S.tag) {
                case 3:
                  if (S = S.stateNode, S.current.memoizedState.isDehydrated) {
                    var O = Ge(S.pendingLanes);
                    if (O !== 0) {
                      var I = S;
                      for (I.pendingLanes |= 2, I.entangledLanes |= 2; O; ) {
                        var F = 1 << 31 - _e(O);
                        I.entanglements[1] |= F, O &= ~F;
                      }
                      vs(S), (ui & (wo | Af)) === su && (gx = aa() + z4, Vl(0));
                    }
                  }
                  break;
                case 13:
                  I = Gr(S, 2), I !== null && gn(I, S, 2), Yo(), Sp(S, 2);
              }
            if (S = mf(m), S === null && Wr(
              i,
              r,
              m,
              Dx,
              u
            ), S === E) break;
            E = S;
          }
          E !== null && m.stopPropagation();
        } else
          Wr(
            i,
            r,
            m,
            null,
            u
          );
      }
    }
    function mf(i) {
      return i = no(i), kh(i);
    }
    function kh(i) {
      if (Dx = null, i = Ui(i), i !== null) {
        var r = k(i);
        if (r === null) i = null;
        else {
          var u = r.tag;
          if (u === 13) {
            if (i = H(r), i !== null) return i;
            i = null;
          } else if (u === 3) {
            if (r.stateNode.current.memoizedState.isDehydrated)
              return r.tag === 3 ? r.stateNode.containerInfo : null;
            i = null;
          } else r !== i && (i = null);
        }
      }
      return Dx = i, null;
    }
    function Wl(i) {
      switch (i) {
        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 Ze;
        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 Wo;
        case "message":
          switch (Cp()) {
            case Ag:
              return Ze;
            case Op:
              return Wo;
            case eu:
            case Mr:
              return Qo;
            case sc:
              return yf;
            default:
              return Qo;
          }
        default:
          return Qo;
      }
    }
    function _o(i, r) {
      switch (i) {
        case "focusin":
        case "focusout":
          Qp = null;
          break;
        case "dragenter":
        case "dragleave":
          Jp = null;
          break;
        case "mouseover":
        case "mouseout":
          t0 = null;
          break;
        case "pointerover":
        case "pointerout":
          cb.delete(r.pointerId);
          break;
        case "gotpointercapture":
        case "lostpointercapture":
          fb.delete(r.pointerId);
      }
    }
    function Ql(i, r, u, m, E, S) {
      return i === null || i.nativeEvent !== S ? (i = {
        blockedOn: r,
        domEventName: u,
        eventSystemFlags: m,
        nativeEvent: S,
        targetContainers: [E]
      }, r !== null && (r = sa(r), r !== null && Sg(r)), i) : (i.eventSystemFlags |= m, r = i.targetContainers, E !== null && r.indexOf(E) === -1 && r.push(E), i);
    }
    function AE(i, r, u, m, E) {
      switch (r) {
        case "focusin":
          return Qp = Ql(
            Qp,
            i,
            r,
            u,
            m,
            E
          ), !0;
        case "dragenter":
          return Jp = Ql(
            Jp,
            i,
            r,
            u,
            m,
            E
          ), !0;
        case "mouseover":
          return t0 = Ql(
            t0,
            i,
            r,
            u,
            m,
            E
          ), !0;
        case "pointerover":
          var S = E.pointerId;
          return cb.set(
            S,
            Ql(
              cb.get(S) || null,
              i,
              r,
              u,
              m,
              E
            )
          ), !0;
        case "gotpointercapture":
          return S = E.pointerId, fb.set(
            S,
            Ql(
              fb.get(S) || null,
              i,
              r,
              u,
              m,
              E
            )
          ), !0;
      }
      return !1;
    }
    function Hh(i) {
      var r = Ui(i.target);
      if (r !== null) {
        var u = k(r);
        if (u !== null) {
          if (r = u.tag, r === 13) {
            if (r = H(u), r !== null) {
              i.blockedOn = r, ls(i.priority, function() {
                if (u.tag === 13) {
                  var m = Xr(u);
                  m = zi(m);
                  var E = Gr(
                    u,
                    m
                  );
                  E !== null && gn(E, u, m), Sp(u, m);
                }
              });
              return;
            }
          } else if (r === 3 && u.stateNode.current.memoizedState.isDehydrated) {
            i.blockedOn = u.tag === 3 ? u.stateNode.containerInfo : null;
            return;
          }
        }
      }
      i.blockedOn = null;
    }
    function nc(i) {
      if (i.blockedOn !== null) return !1;
      for (var r = i.targetContainers; 0 < r.length; ) {
        var u = mf(i.nativeEvent);
        if (u === null) {
          u = i.nativeEvent;
          var m = new u.constructor(
            u.type,
            u
          ), E = m;
          M !== null && console.error(
            "Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."
          ), M = E, u.target.dispatchEvent(m), M === null && console.error(
            "Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."
          ), M = null;
        } else
          return r = sa(u), r !== null && Sg(r), i.blockedOn = u, !1;
        r.shift();
      }
      return !0;
    }
    function Dy(i, r, u) {
      nc(i) && u.delete(r);
    }
    function Ov() {
      KR = !1, Qp !== null && nc(Qp) && (Qp = null), Jp !== null && nc(Jp) && (Jp = null), t0 !== null && nc(t0) && (t0 = null), cb.forEach(Dy), fb.forEach(Dy);
    }
    function Bh(i, r) {
      i.blockedOn === r && (i.blockedOn = null, KR || (KR = !0, Bi.unstable_scheduleCallback(
        Bi.unstable_NormalPriority,
        Ov
      )));
    }
    function Tg(i) {
      Nx !== i && (Nx = i, Bi.unstable_scheduleCallback(
        Bi.unstable_NormalPriority,
        function() {
          Nx === i && (Nx = null);
          for (var r = 0; r < i.length; r += 3) {
            var u = i[r], m = i[r + 1], E = i[r + 2];
            if (typeof m != "function") {
              if (kh(m || u) === null)
                continue;
              break;
            }
            var S = sa(u);
            S !== null && (i.splice(r, 3), r -= 3, u = {
              pending: !0,
              data: E,
              method: u.method,
              action: m
            }, Object.freeze(u), Vm(
              S,
              u,
              m,
              E
            ));
          }
        }
      ));
    }
    function qh(i) {
      function r(F) {
        return Bh(F, i);
      }
      Qp !== null && Bh(Qp, i), Jp !== null && Bh(Jp, i), t0 !== null && Bh(t0, i), cb.forEach(r), fb.forEach(r);
      for (var u = 0; u < e0.length; u++) {
        var m = e0[u];
        m.blockedOn === i && (m.blockedOn = null);
      }
      for (; 0 < e0.length && (u = e0[0], u.blockedOn === null); )
        Hh(u), u.blockedOn === null && e0.shift();
      if (u = (i.ownerDocument || i).$$reactFormReplay, u != null)
        for (m = 0; m < u.length; m += 3) {
          var E = u[m], S = u[m + 1], O = E[es] || null;
          if (typeof S == "function")
            O || Tg(u);
          else if (O) {
            var I = null;
            if (S && S.hasAttribute("formAction")) {
              if (E = S, O = S[es] || null)
                I = O.formAction;
              else if (kh(E) !== null) continue;
            } else I = O.action;
            typeof I == "function" ? u[m + 1] = I : (u.splice(m, 3), m -= 3), Tg(u);
          }
        }
    }
    function xp(i) {
      this._internalRoot = i;
    }
    function Tp(i) {
      this._internalRoot = i;
    }
    function wp(i) {
      i[lc] && (i._reactRootContainer ? console.error(
        "You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."
      ) : console.error(
        "You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."
      ));
    }
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
    var Bi = G8(), Ny = C0(), ME = U8(), He = Object.assign, CE = Symbol.for("react.element"), Jl = Symbol.for("react.transitional.element"), Ke = Symbol.for("react.portal"), ic = Symbol.for("react.fragment"), Za = Symbol.for("react.strict_mode"), wg = Symbol.for("react.profiler"), Dv = Symbol.for("react.provider"), vo = Symbol.for("react.consumer"), be = Symbol.for("react.context"), ac = Symbol.for("react.forward_ref"), ia = Symbol.for("react.suspense"), Ci = Symbol.for("react.suspense_list"), Rp = Symbol.for("react.memo"), ha = Symbol.for("react.lazy"), Ap = Symbol.for("react.activity"), Nv = Symbol.for("react.memo_cache_sentinel"), Rg = Symbol.iterator, ri = Symbol.for("react.client.reference"), Sa = Array.isArray, Tt = Ny.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Un = ME.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Eo = Object.freeze({
      pending: !1,
      data: null,
      method: null,
      action: null
    }), Vh = [], tu = [], Pn = -1, Vn = Ct(null), rc = Ct(null), Xo = Ct(null), Mp = Ct(null), Ko = Object.prototype.hasOwnProperty, Ly = Bi.unstable_scheduleCallback, Lv = Bi.unstable_cancelCallback, OE = Bi.unstable_shouldYield, Iv = Bi.unstable_requestPaint, aa = Bi.unstable_now, Cp = Bi.unstable_getCurrentPriorityLevel, Ag = Bi.unstable_ImmediatePriority, Op = Bi.unstable_UserBlockingPriority, eu = Bi.unstable_NormalPriority, Mr = Bi.unstable_LowPriority, sc = Bi.unstable_IdlePriority, bo = Bi.log, Iy = Bi.unstable_setDisableYieldValue, pf = null, Wa = null, ie = null, qi = !1, da = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u", _e = Math.clz32 ? Math.clz32 : Jn, Zo = Math.log, Ys = Math.LN2, Mg = 256, nu = 4194304, Ze = 2, Wo = 8, Qo = 32, yf = 268435456, oc = Math.random().toString(36).slice(2), fr = "__reactFiber$" + oc, es = "__reactProps$" + oc, lc = "__reactContainer$" + oc, Dp = "__reactEvents$" + oc, Yh = "__reactListeners$" + oc, Cg = "__reactHandles$" + oc, Py = "__reactResources$" + oc, Og = "__reactMarker$" + oc, _f = /* @__PURE__ */ new Set(), So = {}, Np = {}, Lp = {
      button: !0,
      checkbox: !0,
      image: !0,
      hidden: !0,
      radio: !0,
      reset: !0,
      submit: !0
    }, Dg = 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]*$"
    ), Ip = {}, vf = {}, Fh = 0, zy, Pv, ga, xa, zv, Gv, Uv;
    Wi.__reactDisabledLog = !0;
    var Ef, Ng, Lg = !1, Gy = new (typeof WeakMap == "function" ? WeakMap : Map)(), La = null, Jo = !1, jv = /[\n"\\]/g, Uy = !1, Pp = !1, zp = !1, Gp = !1, jy = !1, Ig = !1, kv = ["value", "defaultValue"], bf = !1, Up = /["'&<>\n\t]|^\s|\s$/, ky = "address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(
      " "
    ), Pg = "applet caption html table td th marquee object template foreignObject desc title".split(
      " "
    ), Hy = Pg.concat(["button"]), Hv = "dd dt li option optgroup p rp rt".split(" "), zg = {
      current: null,
      formTag: null,
      aTagInScope: null,
      buttonTagInScope: null,
      nobrTagInScope: null,
      pTagInButtonScope: null,
      listItemTagAutoclosing: null,
      dlItemTagAutoclosing: null,
      containerTagInScope: null,
      implicitRootScope: !1
    }, Fs = {}, tl = {
      animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(
        " "
      ),
      background: "backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(
        " "
      ),
      backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
      border: "borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(
        " "
      ),
      borderBlockEnd: [
        "borderBlockEndColor",
        "borderBlockEndStyle",
        "borderBlockEndWidth"
      ],
      borderBlockStart: [
        "borderBlockStartColor",
        "borderBlockStartStyle",
        "borderBlockStartWidth"
      ],
      borderBottom: [
        "borderBottomColor",
        "borderBottomStyle",
        "borderBottomWidth"
      ],
      borderColor: [
        "borderBottomColor",
        "borderLeftColor",
        "borderRightColor",
        "borderTopColor"
      ],
      borderImage: [
        "borderImageOutset",
        "borderImageRepeat",
        "borderImageSlice",
        "borderImageSource",
        "borderImageWidth"
      ],
      borderInlineEnd: [
        "borderInlineEndColor",
        "borderInlineEndStyle",
        "borderInlineEndWidth"
      ],
      borderInlineStart: [
        "borderInlineStartColor",
        "borderInlineStartStyle",
        "borderInlineStartWidth"
      ],
      borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
      borderRadius: [
        "borderBottomLeftRadius",
        "borderBottomRightRadius",
        "borderTopLeftRadius",
        "borderTopRightRadius"
      ],
      borderRight: [
        "borderRightColor",
        "borderRightStyle",
        "borderRightWidth"
      ],
      borderStyle: [
        "borderBottomStyle",
        "borderLeftStyle",
        "borderRightStyle",
        "borderTopStyle"
      ],
      borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderWidth: [
        "borderBottomWidth",
        "borderLeftWidth",
        "borderRightWidth",
        "borderTopWidth"
      ],
      columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
      columns: ["columnCount", "columnWidth"],
      flex: ["flexBasis", "flexGrow", "flexShrink"],
      flexFlow: ["flexDirection", "flexWrap"],
      font: "fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(
        " "
      ),
      fontVariant: "fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(
        " "
      ),
      gap: ["columnGap", "rowGap"],
      grid: "gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(
        " "
      ),
      gridArea: [
        "gridColumnEnd",
        "gridColumnStart",
        "gridRowEnd",
        "gridRowStart"
      ],
      gridColumn: ["gridColumnEnd", "gridColumnStart"],
      gridColumnGap: ["columnGap"],
      gridGap: ["columnGap", "rowGap"],
      gridRow: ["gridRowEnd", "gridRowStart"],
      gridRowGap: ["rowGap"],
      gridTemplate: [
        "gridTemplateAreas",
        "gridTemplateColumns",
        "gridTemplateRows"
      ],
      listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
      margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
      marker: ["markerEnd", "markerMid", "markerStart"],
      mask: "maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(
        " "
      ),
      maskPosition: ["maskPositionX", "maskPositionY"],
      outline: ["outlineColor", "outlineStyle", "outlineWidth"],
      overflow: ["overflowX", "overflowY"],
      padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
      placeContent: ["alignContent", "justifyContent"],
      placeItems: ["alignItems", "justifyItems"],
      placeSelf: ["alignSelf", "justifySelf"],
      textDecoration: [
        "textDecorationColor",
        "textDecorationLine",
        "textDecorationStyle"
      ],
      textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
      transition: [
        "transitionDelay",
        "transitionDuration",
        "transitionProperty",
        "transitionTimingFunction"
      ],
      wordWrap: ["overflowWrap"]
    }, iu = /([A-Z])/g, $h = /^ms-/, Gg = /^(?:webkit|moz|o)[A-Z]/, uc = /^-ms-/, DE = /-(.)/g, By = /;\s*$/, el = {}, qy = {}, Vy = !1, Ug = !1, Yy = 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(
        " "
      )
    ), jp = "http://www.w3.org/1998/Math/MathML", au = "http://www.w3.org/2000/svg", kp = /* @__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"]
    ]), jg = {
      accept: "accept",
      acceptcharset: "acceptCharset",
      "accept-charset": "acceptCharset",
      accesskey: "accessKey",
      action: "action",
      allowfullscreen: "allowFullScreen",
      alt: "alt",
      as: "as",
      async: "async",
      autocapitalize: "autoCapitalize",
      autocomplete: "autoComplete",
      autocorrect: "autoCorrect",
      autofocus: "autoFocus",
      autoplay: "autoPlay",
      autosave: "autoSave",
      capture: "capture",
      cellpadding: "cellPadding",
      cellspacing: "cellSpacing",
      challenge: "challenge",
      charset: "charSet",
      checked: "checked",
      children: "children",
      cite: "cite",
      class: "className",
      classid: "classID",
      classname: "className",
      cols: "cols",
      colspan: "colSpan",
      content: "content",
      contenteditable: "contentEditable",
      contextmenu: "contextMenu",
      controls: "controls",
      controlslist: "controlsList",
      coords: "coords",
      crossorigin: "crossOrigin",
      dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
      data: "data",
      datetime: "dateTime",
      default: "default",
      defaultchecked: "defaultChecked",
      defaultvalue: "defaultValue",
      defer: "defer",
      dir: "dir",
      disabled: "disabled",
      disablepictureinpicture: "disablePictureInPicture",
      disableremoteplayback: "disableRemotePlayback",
      download: "download",
      draggable: "draggable",
      enctype: "encType",
      enterkeyhint: "enterKeyHint",
      fetchpriority: "fetchPriority",
      for: "htmlFor",
      form: "form",
      formmethod: "formMethod",
      formaction: "formAction",
      formenctype: "formEncType",
      formnovalidate: "formNoValidate",
      formtarget: "formTarget",
      frameborder: "frameBorder",
      headers: "headers",
      height: "height",
      hidden: "hidden",
      high: "high",
      href: "href",
      hreflang: "hrefLang",
      htmlfor: "htmlFor",
      httpequiv: "httpEquiv",
      "http-equiv": "httpEquiv",
      icon: "icon",
      id: "id",
      imagesizes: "imageSizes",
      imagesrcset: "imageSrcSet",
      inert: "inert",
      innerhtml: "innerHTML",
      inputmode: "inputMode",
      integrity: "integrity",
      is: "is",
      itemid: "itemID",
      itemprop: "itemProp",
      itemref: "itemRef",
      itemscope: "itemScope",
      itemtype: "itemType",
      keyparams: "keyParams",
      keytype: "keyType",
      kind: "kind",
      label: "label",
      lang: "lang",
      list: "list",
      loop: "loop",
      low: "low",
      manifest: "manifest",
      marginwidth: "marginWidth",
      marginheight: "marginHeight",
      max: "max",
      maxlength: "maxLength",
      media: "media",
      mediagroup: "mediaGroup",
      method: "method",
      min: "min",
      minlength: "minLength",
      multiple: "multiple",
      muted: "muted",
      name: "name",
      nomodule: "noModule",
      nonce: "nonce",
      novalidate: "noValidate",
      open: "open",
      optimum: "optimum",
      pattern: "pattern",
      placeholder: "placeholder",
      playsinline: "playsInline",
      poster: "poster",
      preload: "preload",
      profile: "profile",
      radiogroup: "radioGroup",
      readonly: "readOnly",
      referrerpolicy: "referrerPolicy",
      rel: "rel",
      required: "required",
      reversed: "reversed",
      role: "role",
      rows: "rows",
      rowspan: "rowSpan",
      sandbox: "sandbox",
      scope: "scope",
      scoped: "scoped",
      scrolling: "scrolling",
      seamless: "seamless",
      selected: "selected",
      shape: "shape",
      size: "size",
      sizes: "sizes",
      span: "span",
      spellcheck: "spellCheck",
      src: "src",
      srcdoc: "srcDoc",
      srclang: "srcLang",
      srcset: "srcSet",
      start: "start",
      step: "step",
      style: "style",
      summary: "summary",
      tabindex: "tabIndex",
      target: "target",
      title: "title",
      type: "type",
      usemap: "useMap",
      value: "value",
      width: "width",
      wmode: "wmode",
      wrap: "wrap",
      about: "about",
      accentheight: "accentHeight",
      "accent-height": "accentHeight",
      accumulate: "accumulate",
      additive: "additive",
      alignmentbaseline: "alignmentBaseline",
      "alignment-baseline": "alignmentBaseline",
      allowreorder: "allowReorder",
      alphabetic: "alphabetic",
      amplitude: "amplitude",
      arabicform: "arabicForm",
      "arabic-form": "arabicForm",
      ascent: "ascent",
      attributename: "attributeName",
      attributetype: "attributeType",
      autoreverse: "autoReverse",
      azimuth: "azimuth",
      basefrequency: "baseFrequency",
      baselineshift: "baselineShift",
      "baseline-shift": "baselineShift",
      baseprofile: "baseProfile",
      bbox: "bbox",
      begin: "begin",
      bias: "bias",
      by: "by",
      calcmode: "calcMode",
      capheight: "capHeight",
      "cap-height": "capHeight",
      clip: "clip",
      clippath: "clipPath",
      "clip-path": "clipPath",
      clippathunits: "clipPathUnits",
      cliprule: "clipRule",
      "clip-rule": "clipRule",
      color: "color",
      colorinterpolation: "colorInterpolation",
      "color-interpolation": "colorInterpolation",
      colorinterpolationfilters: "colorInterpolationFilters",
      "color-interpolation-filters": "colorInterpolationFilters",
      colorprofile: "colorProfile",
      "color-profile": "colorProfile",
      colorrendering: "colorRendering",
      "color-rendering": "colorRendering",
      contentscripttype: "contentScriptType",
      contentstyletype: "contentStyleType",
      cursor: "cursor",
      cx: "cx",
      cy: "cy",
      d: "d",
      datatype: "datatype",
      decelerate: "decelerate",
      descent: "descent",
      diffuseconstant: "diffuseConstant",
      direction: "direction",
      display: "display",
      divisor: "divisor",
      dominantbaseline: "dominantBaseline",
      "dominant-baseline": "dominantBaseline",
      dur: "dur",
      dx: "dx",
      dy: "dy",
      edgemode: "edgeMode",
      elevation: "elevation",
      enablebackground: "enableBackground",
      "enable-background": "enableBackground",
      end: "end",
      exponent: "exponent",
      externalresourcesrequired: "externalResourcesRequired",
      fill: "fill",
      fillopacity: "fillOpacity",
      "fill-opacity": "fillOpacity",
      fillrule: "fillRule",
      "fill-rule": "fillRule",
      filter: "filter",
      filterres: "filterRes",
      filterunits: "filterUnits",
      floodopacity: "floodOpacity",
      "flood-opacity": "floodOpacity",
      floodcolor: "floodColor",
      "flood-color": "floodColor",
      focusable: "focusable",
      fontfamily: "fontFamily",
      "font-family": "fontFamily",
      fontsize: "fontSize",
      "font-size": "fontSize",
      fontsizeadjust: "fontSizeAdjust",
      "font-size-adjust": "fontSizeAdjust",
      fontstretch: "fontStretch",
      "font-stretch": "fontStretch",
      fontstyle: "fontStyle",
      "font-style": "fontStyle",
      fontvariant: "fontVariant",
      "font-variant": "fontVariant",
      fontweight: "fontWeight",
      "font-weight": "fontWeight",
      format: "format",
      from: "from",
      fx: "fx",
      fy: "fy",
      g1: "g1",
      g2: "g2",
      glyphname: "glyphName",
      "glyph-name": "glyphName",
      glyphorientationhorizontal: "glyphOrientationHorizontal",
      "glyph-orientation-horizontal": "glyphOrientationHorizontal",
      glyphorientationvertical: "glyphOrientationVertical",
      "glyph-orientation-vertical": "glyphOrientationVertical",
      glyphref: "glyphRef",
      gradienttransform: "gradientTransform",
      gradientunits: "gradientUnits",
      hanging: "hanging",
      horizadvx: "horizAdvX",
      "horiz-adv-x": "horizAdvX",
      horizoriginx: "horizOriginX",
      "horiz-origin-x": "horizOriginX",
      ideographic: "ideographic",
      imagerendering: "imageRendering",
      "image-rendering": "imageRendering",
      in2: "in2",
      in: "in",
      inlist: "inlist",
      intercept: "intercept",
      k1: "k1",
      k2: "k2",
      k3: "k3",
      k4: "k4",
      k: "k",
      kernelmatrix: "kernelMatrix",
      kernelunitlength: "kernelUnitLength",
      kerning: "kerning",
      keypoints: "keyPoints",
      keysplines: "keySplines",
      keytimes: "keyTimes",
      lengthadjust: "lengthAdjust",
      letterspacing: "letterSpacing",
      "letter-spacing": "letterSpacing",
      lightingcolor: "lightingColor",
      "lighting-color": "lightingColor",
      limitingconeangle: "limitingConeAngle",
      local: "local",
      markerend: "markerEnd",
      "marker-end": "markerEnd",
      markerheight: "markerHeight",
      markermid: "markerMid",
      "marker-mid": "markerMid",
      markerstart: "markerStart",
      "marker-start": "markerStart",
      markerunits: "markerUnits",
      markerwidth: "markerWidth",
      mask: "mask",
      maskcontentunits: "maskContentUnits",
      maskunits: "maskUnits",
      mathematical: "mathematical",
      mode: "mode",
      numoctaves: "numOctaves",
      offset: "offset",
      opacity: "opacity",
      operator: "operator",
      order: "order",
      orient: "orient",
      orientation: "orientation",
      origin: "origin",
      overflow: "overflow",
      overlineposition: "overlinePosition",
      "overline-position": "overlinePosition",
      overlinethickness: "overlineThickness",
      "overline-thickness": "overlineThickness",
      paintorder: "paintOrder",
      "paint-order": "paintOrder",
      panose1: "panose1",
      "panose-1": "panose1",
      pathlength: "pathLength",
      patterncontentunits: "patternContentUnits",
      patterntransform: "patternTransform",
      patternunits: "patternUnits",
      pointerevents: "pointerEvents",
      "pointer-events": "pointerEvents",
      points: "points",
      pointsatx: "pointsAtX",
      pointsaty: "pointsAtY",
      pointsatz: "pointsAtZ",
      popover: "popover",
      popovertarget: "popoverTarget",
      popovertargetaction: "popoverTargetAction",
      prefix: "prefix",
      preservealpha: "preserveAlpha",
      preserveaspectratio: "preserveAspectRatio",
      primitiveunits: "primitiveUnits",
      property: "property",
      r: "r",
      radius: "radius",
      refx: "refX",
      refy: "refY",
      renderingintent: "renderingIntent",
      "rendering-intent": "renderingIntent",
      repeatcount: "repeatCount",
      repeatdur: "repeatDur",
      requiredextensions: "requiredExtensions",
      requiredfeatures: "requiredFeatures",
      resource: "resource",
      restart: "restart",
      result: "result",
      results: "results",
      rotate: "rotate",
      rx: "rx",
      ry: "ry",
      scale: "scale",
      security: "security",
      seed: "seed",
      shaperendering: "shapeRendering",
      "shape-rendering": "shapeRendering",
      slope: "slope",
      spacing: "spacing",
      specularconstant: "specularConstant",
      specularexponent: "specularExponent",
      speed: "speed",
      spreadmethod: "spreadMethod",
      startoffset: "startOffset",
      stddeviation: "stdDeviation",
      stemh: "stemh",
      stemv: "stemv",
      stitchtiles: "stitchTiles",
      stopcolor: "stopColor",
      "stop-color": "stopColor",
      stopopacity: "stopOpacity",
      "stop-opacity": "stopOpacity",
      strikethroughposition: "strikethroughPosition",
      "strikethrough-position": "strikethroughPosition",
      strikethroughthickness: "strikethroughThickness",
      "strikethrough-thickness": "strikethroughThickness",
      string: "string",
      stroke: "stroke",
      strokedasharray: "strokeDasharray",
      "stroke-dasharray": "strokeDasharray",
      strokedashoffset: "strokeDashoffset",
      "stroke-dashoffset": "strokeDashoffset",
      strokelinecap: "strokeLinecap",
      "stroke-linecap": "strokeLinecap",
      strokelinejoin: "strokeLinejoin",
      "stroke-linejoin": "strokeLinejoin",
      strokemiterlimit: "strokeMiterlimit",
      "stroke-miterlimit": "strokeMiterlimit",
      strokewidth: "strokeWidth",
      "stroke-width": "strokeWidth",
      strokeopacity: "strokeOpacity",
      "stroke-opacity": "strokeOpacity",
      suppresscontenteditablewarning: "suppressContentEditableWarning",
      suppresshydrationwarning: "suppressHydrationWarning",
      surfacescale: "surfaceScale",
      systemlanguage: "systemLanguage",
      tablevalues: "tableValues",
      targetx: "targetX",
      targety: "targetY",
      textanchor: "textAnchor",
      "text-anchor": "textAnchor",
      textdecoration: "textDecoration",
      "text-decoration": "textDecoration",
      textlength: "textLength",
      textrendering: "textRendering",
      "text-rendering": "textRendering",
      to: "to",
      transform: "transform",
      transformorigin: "transformOrigin",
      "transform-origin": "transformOrigin",
      typeof: "typeof",
      u1: "u1",
      u2: "u2",
      underlineposition: "underlinePosition",
      "underline-position": "underlinePosition",
      underlinethickness: "underlineThickness",
      "underline-thickness": "underlineThickness",
      unicode: "unicode",
      unicodebidi: "unicodeBidi",
      "unicode-bidi": "unicodeBidi",
      unicoderange: "unicodeRange",
      "unicode-range": "unicodeRange",
      unitsperem: "unitsPerEm",
      "units-per-em": "unitsPerEm",
      unselectable: "unselectable",
      valphabetic: "vAlphabetic",
      "v-alphabetic": "vAlphabetic",
      values: "values",
      vectoreffect: "vectorEffect",
      "vector-effect": "vectorEffect",
      version: "version",
      vertadvy: "vertAdvY",
      "vert-adv-y": "vertAdvY",
      vertoriginx: "vertOriginX",
      "vert-origin-x": "vertOriginX",
      vertoriginy: "vertOriginY",
      "vert-origin-y": "vertOriginY",
      vhanging: "vHanging",
      "v-hanging": "vHanging",
      videographic: "vIdeographic",
      "v-ideographic": "vIdeographic",
      viewbox: "viewBox",
      viewtarget: "viewTarget",
      visibility: "visibility",
      vmathematical: "vMathematical",
      "v-mathematical": "vMathematical",
      vocab: "vocab",
      widths: "widths",
      wordspacing: "wordSpacing",
      "word-spacing": "wordSpacing",
      writingmode: "writingMode",
      "writing-mode": "writingMode",
      x1: "x1",
      x2: "x2",
      x: "x",
      xchannelselector: "xChannelSelector",
      xheight: "xHeight",
      "x-height": "xHeight",
      xlinkactuate: "xlinkActuate",
      "xlink:actuate": "xlinkActuate",
      xlinkarcrole: "xlinkArcrole",
      "xlink:arcrole": "xlinkArcrole",
      xlinkhref: "xlinkHref",
      "xlink:href": "xlinkHref",
      xlinkrole: "xlinkRole",
      "xlink:role": "xlinkRole",
      xlinkshow: "xlinkShow",
      "xlink:show": "xlinkShow",
      xlinktitle: "xlinkTitle",
      "xlink:title": "xlinkTitle",
      xlinktype: "xlinkType",
      "xlink:type": "xlinkType",
      xmlbase: "xmlBase",
      "xml:base": "xmlBase",
      xmllang: "xmlLang",
      "xml:lang": "xmlLang",
      xmlns: "xmlns",
      "xml:space": "xmlSpace",
      xmlnsxlink: "xmlnsXlink",
      "xmlns:xlink": "xmlnsXlink",
      xmlspace: "xmlSpace",
      y1: "y1",
      y2: "y2",
      y: "y",
      ychannelselector: "yChannelSelector",
      z: "z",
      zoomandpan: "zoomAndPan"
    }, Xh = {
      "aria-current": 0,
      "aria-description": 0,
      "aria-details": 0,
      "aria-disabled": 0,
      "aria-hidden": 0,
      "aria-invalid": 0,
      "aria-keyshortcuts": 0,
      "aria-label": 0,
      "aria-roledescription": 0,
      "aria-autocomplete": 0,
      "aria-checked": 0,
      "aria-expanded": 0,
      "aria-haspopup": 0,
      "aria-level": 0,
      "aria-modal": 0,
      "aria-multiline": 0,
      "aria-multiselectable": 0,
      "aria-orientation": 0,
      "aria-placeholder": 0,
      "aria-pressed": 0,
      "aria-readonly": 0,
      "aria-required": 0,
      "aria-selected": 0,
      "aria-sort": 0,
      "aria-valuemax": 0,
      "aria-valuemin": 0,
      "aria-valuenow": 0,
      "aria-valuetext": 0,
      "aria-atomic": 0,
      "aria-busy": 0,
      "aria-live": 0,
      "aria-relevant": 0,
      "aria-dropeffect": 0,
      "aria-grabbed": 0,
      "aria-activedescendant": 0,
      "aria-colcount": 0,
      "aria-colindex": 0,
      "aria-colspan": 0,
      "aria-controls": 0,
      "aria-describedby": 0,
      "aria-errormessage": 0,
      "aria-flowto": 0,
      "aria-labelledby": 0,
      "aria-owns": 0,
      "aria-posinset": 0,
      "aria-rowcount": 0,
      "aria-rowindex": 0,
      "aria-rowspan": 0,
      "aria-setsize": 0
    }, cc = {}, Hp = RegExp(
      "^(aria)-[: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]*$"
    ), Bv = RegExp(
      "^(aria)[A-Z][: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]*$"
    ), qv = !1, Ia = {}, o = /^on./, c = /^on[^A-Z]/, d = RegExp(
      "^(aria)-[: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]*$"
    ), v = RegExp(
      "^(aria)[A-Z][: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]*$"
    ), T = /^[\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, M = null, P = null, q = null, it = !1, vt = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), jt = !1;
    if (vt)
      try {
        var Bt = {};
        Object.defineProperty(Bt, "passive", {
          get: function() {
            jt = !0;
          }
        }), window.addEventListener("test", Bt, Bt), window.removeEventListener("test", Bt, Bt);
      } catch {
        jt = !1;
      }
    var xt = null, bt = null, we = null, Ee = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function(i) {
        return i.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0
    }, jn = $e(Ee), yt = He({}, Ee, { view: 0, detail: 0 }), ct = $e(yt), Et, kt, le, nn = He({}, yt, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: rr,
      button: 0,
      buttons: 0,
      relatedTarget: function(i) {
        return i.relatedTarget === void 0 ? i.fromElement === i.srcElement ? i.toElement : i.fromElement : i.relatedTarget;
      },
      movementX: function(i) {
        return "movementX" in i ? i.movementX : (i !== le && (le && i.type === "mousemove" ? (Et = i.screenX - le.screenX, kt = i.screenY - le.screenY) : kt = Et = 0, le = i), Et);
      },
      movementY: function(i) {
        return "movementY" in i ? i.movementY : kt;
      }
    }), ve = $e(nn), Oe = He({}, nn, { dataTransfer: 0 }), Pa = $e(Oe), Cn = He({}, yt, { relatedTarget: 0 }), nl = $e(Cn), NE = He({}, Ee, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), jw = $e(NE), LE = He({}, Ee, {
      clipboardData: function(i) {
        return "clipboardData" in i ? i.clipboardData : window.clipboardData;
      }
    }), IE = $e(LE), kw = He({}, Ee, { data: 0 }), $S = $e(
      kw
    ), Hw = $S, Bw = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, qw = {
      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"
    }, Vw = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    }, Yw = He({}, yt, {
      key: function(i) {
        if (i.key) {
          var r = Bw[i.key] || i.key;
          if (r !== "Unidentified") return r;
        }
        return i.type === "keypress" ? (i = Hc(i), i === 13 ? "Enter" : String.fromCharCode(i)) : i.type === "keydown" || i.type === "keyup" ? qw[i.keyCode] || "Unidentified" : "";
      },
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: rr,
      charCode: function(i) {
        return i.type === "keypress" ? Hc(i) : 0;
      },
      keyCode: function(i) {
        return i.type === "keydown" || i.type === "keyup" ? i.keyCode : 0;
      },
      which: function(i) {
        return i.type === "keypress" ? Hc(i) : i.type === "keydown" || i.type === "keyup" ? i.keyCode : 0;
      }
    }), Fw = $e(Yw), $w = He({}, nn, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), XS = $e($w), Xw = He({}, yt, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: rr
    }), Kw = $e(Xw), Zw = He({}, Ee, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), Ww = $e(Zw), Qw = He({}, nn, {
      deltaX: function(i) {
        return "deltaX" in i ? i.deltaX : "wheelDeltaX" in i ? -i.wheelDeltaX : 0;
      },
      deltaY: function(i) {
        return "deltaY" in i ? i.deltaY : "wheelDeltaY" in i ? -i.wheelDeltaY : "wheelDelta" in i ? -i.wheelDelta : 0;
      },
      deltaZ: 0,
      deltaMode: 0
    }), Jw = $e(Qw), tR = He({}, Ee, {
      newState: 0,
      oldState: 0
    }), eR = $e(tR), nR = [9, 13, 27, 32], KS = 229, PE = vt && "CompositionEvent" in window, g = null;
    vt && "documentMode" in document && (g = document.documentMode);
    var _ = vt && "TextEvent" in window && !g, R = vt && (!PE || g && 8 < g && 11 >= g), D = 32, G = String.fromCharCode(D), $ = !1, tt = !1, lt = {
      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
    }, _t = null, Ht = null, Yt = !1;
    vt && (Yt = k0("input") && (!document.documentMode || 9 < document.documentMode));
    var Vt = typeof Object.is == "function" ? Object.is : rv, re = vt && "documentMode" in document && 11 >= document.documentMode, he = null, De = null, We = null, Ne = !1, rn = {
      animationend: Po("Animation", "AnimationEnd"),
      animationiteration: Po("Animation", "AnimationIteration"),
      animationstart: Po("Animation", "AnimationStart"),
      transitionrun: Po("Transition", "TransitionRun"),
      transitionstart: Po("Transition", "TransitionStart"),
      transitioncancel: Po("Transition", "TransitionCancel"),
      transitionend: Po("Transition", "TransitionEnd")
    }, bn = {}, $s = {};
    vt && ($s = document.createElement("div").style, "AnimationEvent" in window || (delete rn.animationend.animation, delete rn.animationiteration.animation, delete rn.animationstart.animation), "TransitionEvent" in window || delete rn.transitionend.transition);
    var ns = xl("animationend"), Xs = xl("animationiteration"), ma = xl("animationstart"), ru = xl("transitionrun"), Sf = xl("transitionstart"), ZS = xl("transitioncancel"), CO = xl("transitionend"), OO = /* @__PURE__ */ new Map(), iR = "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(
      " "
    );
    iR.push("scrollEnd");
    var aR = /* @__PURE__ */ new WeakMap(), WS = 1, kg = 2, fc = [], Vv = 0, rR = 0, Bp = {};
    Object.freeze(Bp);
    var hc = null, Yv = null, Vi = 0, hI = 1, bs = 2, Ks = 8, xf = 16, DO = 64, NO = !1;
    try {
      var LO = Object.preventExtensions({});
    } catch {
      NO = !0;
    }
    var Fv = [], $v = 0, QS = null, JS = 0, dc = [], gc = 0, Fy = null, Hg = 1, Bg = "", xo = null, za = null, Yn = !1, qg = !1, mc = null, $y = null, Kh = !1, sR = Error(
      "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
    ), IO = 0;
    if (typeof performance == "object" && typeof performance.now == "function")
      var dI = performance, PO = function() {
        return dI.now();
      };
    else {
      var gI = Date;
      PO = function() {
        return gI.now();
      };
    }
    var oR = Ct(null), lR = Ct(null), zO = {}, tx = null, Xv = null, Kv = !1, mI = typeof AbortController < "u" ? AbortController : function() {
      var i = [], r = this.signal = {
        aborted: !1,
        addEventListener: function(u, m) {
          i.push(m);
        }
      };
      this.abort = function() {
        r.aborted = !0, i.forEach(function(u) {
          return u();
        });
      };
    }, pI = Bi.unstable_scheduleCallback, yI = Bi.unstable_NormalPriority, Cr = {
      $$typeof: be,
      Consumer: null,
      Provider: null,
      _currentValue: null,
      _currentValue2: null,
      _threadCount: 0,
      _currentRenderer: null,
      _currentRenderer2: null
    }, Zv = Bi.unstable_now, GO = -0, ex = -0, il = -1.1, Xy = -0, nx = !1, ix = !1, zE = null, uR = 0, Ky = 0, Wv = null, UO = Tt.S;
    Tt.S = function(i, r) {
      typeof r == "object" && r !== null && typeof r.then == "function" && cv(i, r), UO !== null && UO(i, r);
    };
    var Zy = Ct(null), Tf = {
      recordUnsafeLifecycleWarnings: function() {
      },
      flushPendingUnsafeLifecycleWarnings: function() {
      },
      recordLegacyContextWarning: function() {
      },
      flushLegacyContextWarning: function() {
      },
      discardPendingWarnings: function() {
      }
    }, GE = [], UE = [], jE = [], kE = [], HE = [], BE = [], Wy = /* @__PURE__ */ new Set();
    Tf.recordUnsafeLifecycleWarnings = function(i, r) {
      Wy.has(i.type) || (typeof r.componentWillMount == "function" && r.componentWillMount.__suppressDeprecationWarning !== !0 && GE.push(i), i.mode & Ks && typeof r.UNSAFE_componentWillMount == "function" && UE.push(i), typeof r.componentWillReceiveProps == "function" && r.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && jE.push(i), i.mode & Ks && typeof r.UNSAFE_componentWillReceiveProps == "function" && kE.push(i), typeof r.componentWillUpdate == "function" && r.componentWillUpdate.__suppressDeprecationWarning !== !0 && HE.push(i), i.mode & Ks && typeof r.UNSAFE_componentWillUpdate == "function" && BE.push(i));
    }, Tf.flushPendingUnsafeLifecycleWarnings = function() {
      var i = /* @__PURE__ */ new Set();
      0 < GE.length && (GE.forEach(function(I) {
        i.add(
          ht(I) || "Component"
        ), Wy.add(I.type);
      }), GE = []);
      var r = /* @__PURE__ */ new Set();
      0 < UE.length && (UE.forEach(function(I) {
        r.add(
          ht(I) || "Component"
        ), Wy.add(I.type);
      }), UE = []);
      var u = /* @__PURE__ */ new Set();
      0 < jE.length && (jE.forEach(function(I) {
        u.add(
          ht(I) || "Component"
        ), Wy.add(I.type);
      }), jE = []);
      var m = /* @__PURE__ */ new Set();
      0 < kE.length && (kE.forEach(
        function(I) {
          m.add(
            ht(I) || "Component"
          ), Wy.add(I.type);
        }
      ), kE = []);
      var E = /* @__PURE__ */ new Set();
      0 < HE.length && (HE.forEach(function(I) {
        E.add(
          ht(I) || "Component"
        ), Wy.add(I.type);
      }), HE = []);
      var S = /* @__PURE__ */ new Set();
      if (0 < BE.length && (BE.forEach(function(I) {
        S.add(
          ht(I) || "Component"
        ), Wy.add(I.type);
      }), BE = []), 0 < r.size) {
        var O = w(
          r
        );
        console.error(
          `Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`,
          O
        );
      }
      0 < m.size && (O = w(
        m
      ), console.error(
        `Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s`,
        O
      )), 0 < S.size && (O = w(
        S
      ), console.error(
        `Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`,
        O
      )), 0 < i.size && (O = w(i), console.warn(
        `componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,
        O
      )), 0 < u.size && (O = w(
        u
      ), console.warn(
        `componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,
        O
      )), 0 < E.size && (O = w(E), console.warn(
        `componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,
        O
      ));
    };
    var ax = /* @__PURE__ */ new Map(), jO = /* @__PURE__ */ new Set();
    Tf.recordLegacyContextWarning = function(i, r) {
      for (var u = null, m = i; m !== null; )
        m.mode & Ks && (u = m), m = m.return;
      u === null ? console.error(
        "Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."
      ) : !jO.has(i.type) && (m = ax.get(u), i.type.contextTypes != null || i.type.childContextTypes != null || r !== null && typeof r.getChildContext == "function") && (m === void 0 && (m = [], ax.set(u, m)), m.push(i));
    }, Tf.flushLegacyContextWarning = function() {
      ax.forEach(function(i) {
        if (i.length !== 0) {
          var r = i[0], u = /* @__PURE__ */ new Set();
          i.forEach(function(E) {
            u.add(ht(E) || "Component"), jO.add(E.type);
          });
          var m = w(u);
          de(r, function() {
            console.error(
              `Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://react.dev/link/legacy-context`,
              m
            );
          });
        }
      });
    }, Tf.discardPendingWarnings = function() {
      GE = [], UE = [], jE = [], kE = [], HE = [], BE = [], ax = /* @__PURE__ */ new Map();
    };
    var qE = Error(
      "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
    ), kO = Error(
      "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
    ), rx = Error(
      "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
    ), cR = {
      then: function() {
        console.error(
          'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
        );
      }
    }, VE = null, sx = !1, pc = 0, yc = 1, To = 2, Ss = 4, Or = 8, HO = 0, BO = 1, qO = 2, fR = 3, qp = !1, VO = !1, hR = null, dR = !1, Qv = Ct(null), ox = Ct(0), Jv, YO = /* @__PURE__ */ new Set(), FO = /* @__PURE__ */ new Set(), gR = /* @__PURE__ */ new Set(), $O = /* @__PURE__ */ new Set(), Vp = 0, Qe = null, Oi = null, hr = null, lx = !1, t1 = !1, Qy = !1, ux = 0, YE = 0, Vg = null, _I = 0, vI = 25, Nt = null, _c = null, Yg = -1, FE = !1, cx = {
      readContext: xi,
      use: hi,
      useCallback: Zn,
      useContext: Zn,
      useEffect: Zn,
      useImperativeHandle: Zn,
      useLayoutEffect: Zn,
      useInsertionEffect: Zn,
      useMemo: Zn,
      useReducer: Zn,
      useRef: Zn,
      useState: Zn,
      useDebugValue: Zn,
      useDeferredValue: Zn,
      useTransition: Zn,
      useSyncExternalStore: Zn,
      useId: Zn,
      useHostTransitionStatus: Zn,
      useFormState: Zn,
      useActionState: Zn,
      useOptimistic: Zn,
      useMemoCache: Zn,
      useCacheRefresh: Zn
    }, mR = null, XO = null, pR = null, KO = null, Zh = null, wf = null, fx = null;
    mR = {
      readContext: function(i) {
        return xi(i);
      },
      use: hi,
      useCallback: function(i, r) {
        return Nt = "useCallback", en(), Au(r), dh(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", en(), xi(i);
      },
      useEffect: function(i, r) {
        return Nt = "useEffect", en(), Au(r), Pd(i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", en(), Au(u), Nl(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        Nt = "useInsertionEffect", en(), Au(r), ua(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", en(), Au(r), Q0(i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", en(), Au(r);
        var u = Tt.H;
        Tt.H = Zh;
        try {
          return Ya(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", en();
        var m = Tt.H;
        Tt.H = Zh;
        try {
          return ds(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function(i) {
        return Nt = "useRef", en(), Nu(i);
      },
      useState: function(i) {
        Nt = "useState", en();
        var r = Tt.H;
        Tt.H = Zh;
        try {
          return V(i);
        } finally {
          Tt.H = r;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", en();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", en(), gh(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", en(), Ll();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", en(), km(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", en(), Kc();
      },
      useFormState: function(i, r) {
        return Nt = "useFormState", en(), Cl(), fh(i, r);
      },
      useActionState: function(i, r) {
        return Nt = "useActionState", en(), fh(i, r);
      },
      useOptimistic: function(i) {
        return Nt = "useOptimistic", en(), br(i);
      },
      useHostTransitionStatus: xr,
      useMemoCache: Bn,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", en(), ms();
      }
    }, XO = {
      readContext: function(i) {
        return xi(i);
      },
      use: hi,
      useCallback: function(i, r) {
        return Nt = "useCallback", Xt(), dh(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", Xt(), xi(i);
      },
      useEffect: function(i, r) {
        return Nt = "useEffect", Xt(), Pd(i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", Xt(), Nl(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        Nt = "useInsertionEffect", Xt(), ua(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", Xt(), Q0(i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", Xt();
        var u = Tt.H;
        Tt.H = Zh;
        try {
          return Ya(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", Xt();
        var m = Tt.H;
        Tt.H = Zh;
        try {
          return ds(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function(i) {
        return Nt = "useRef", Xt(), Nu(i);
      },
      useState: function(i) {
        Nt = "useState", Xt();
        var r = Tt.H;
        Tt.H = Zh;
        try {
          return V(i);
        } finally {
          Tt.H = r;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", Xt();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", Xt(), gh(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", Xt(), Ll();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", Xt(), km(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", Xt(), Kc();
      },
      useActionState: function(i, r) {
        return Nt = "useActionState", Xt(), fh(i, r);
      },
      useFormState: function(i, r) {
        return Nt = "useFormState", Xt(), Cl(), fh(i, r);
      },
      useOptimistic: function(i) {
        return Nt = "useOptimistic", Xt(), br(i);
      },
      useHostTransitionStatus: xr,
      useMemoCache: Bn,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", Xt(), ms();
      }
    }, pR = {
      readContext: function(i) {
        return xi(i);
      },
      use: hi,
      useCallback: function(i, r) {
        return Nt = "useCallback", Xt(), zd(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", Xt(), xi(i);
      },
      useEffect: function(i, r) {
        Nt = "useEffect", Xt(), Vr(2048, Or, i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", Xt(), Us(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        return Nt = "useInsertionEffect", Xt(), Vr(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", Xt(), Vr(4, Ss, i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", Xt();
        var u = Tt.H;
        Tt.H = wf;
        try {
          return Gd(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", Xt();
        var m = Tt.H;
        Tt.H = wf;
        try {
          return _a(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function() {
        return Nt = "useRef", Xt(), zn().memoizedState;
      },
      useState: function() {
        Nt = "useState", Xt();
        var i = Tt.H;
        Tt.H = wf;
        try {
          return _a(je);
        } finally {
          Tt.H = i;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", Xt();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", Xt(), Bm(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", Xt(), Xc();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", Xt(), Nd(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", Xt(), zn().memoizedState;
      },
      useFormState: function(i) {
        return Nt = "useFormState", Xt(), Cl(), Hm(i);
      },
      useActionState: function(i) {
        return Nt = "useActionState", Xt(), Hm(i);
      },
      useOptimistic: function(i, r) {
        return Nt = "useOptimistic", Xt(), gs(i, r);
      },
      useHostTransitionStatus: xr,
      useMemoCache: Bn,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", Xt(), zn().memoizedState;
      }
    }, KO = {
      readContext: function(i) {
        return xi(i);
      },
      use: hi,
      useCallback: function(i, r) {
        return Nt = "useCallback", Xt(), zd(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", Xt(), xi(i);
      },
      useEffect: function(i, r) {
        Nt = "useEffect", Xt(), Vr(2048, Or, i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", Xt(), Us(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        return Nt = "useInsertionEffect", Xt(), Vr(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", Xt(), Vr(4, Ss, i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", Xt();
        var u = Tt.H;
        Tt.H = fx;
        try {
          return Gd(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", Xt();
        var m = Tt.H;
        Tt.H = fx;
        try {
          return or(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function() {
        return Nt = "useRef", Xt(), zn().memoizedState;
      },
      useState: function() {
        Nt = "useState", Xt();
        var i = Tt.H;
        Tt.H = fx;
        try {
          return or(je);
        } finally {
          Tt.H = i;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", Xt();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", Xt(), ty(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", Xt(), Il();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", Xt(), Nd(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", Xt(), zn().memoizedState;
      },
      useFormState: function(i) {
        return Nt = "useFormState", Xt(), Cl(), Du(i);
      },
      useActionState: function(i) {
        return Nt = "useActionState", Xt(), Du(i);
      },
      useOptimistic: function(i, r) {
        return Nt = "useOptimistic", Xt(), fn(i, r);
      },
      useHostTransitionStatus: xr,
      useMemoCache: Bn,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", Xt(), zn().memoizedState;
      }
    }, Zh = {
      readContext: function(i) {
        return b(), xi(i);
      },
      use: function(i) {
        return y(), hi(i);
      },
      useCallback: function(i, r) {
        return Nt = "useCallback", y(), en(), dh(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", y(), en(), xi(i);
      },
      useEffect: function(i, r) {
        return Nt = "useEffect", y(), en(), Pd(i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", y(), en(), Nl(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        Nt = "useInsertionEffect", y(), en(), ua(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", y(), en(), Q0(i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", y(), en();
        var u = Tt.H;
        Tt.H = Zh;
        try {
          return Ya(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", y(), en();
        var m = Tt.H;
        Tt.H = Zh;
        try {
          return ds(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function(i) {
        return Nt = "useRef", y(), en(), Nu(i);
      },
      useState: function(i) {
        Nt = "useState", y(), en();
        var r = Tt.H;
        Tt.H = Zh;
        try {
          return V(i);
        } finally {
          Tt.H = r;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", y(), en();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", y(), en(), gh(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", y(), en(), Ll();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", y(), en(), km(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", y(), en(), Kc();
      },
      useFormState: function(i, r) {
        return Nt = "useFormState", y(), en(), fh(i, r);
      },
      useActionState: function(i, r) {
        return Nt = "useActionState", y(), en(), fh(i, r);
      },
      useOptimistic: function(i) {
        return Nt = "useOptimistic", y(), en(), br(i);
      },
      useMemoCache: function(i) {
        return y(), Bn(i);
      },
      useHostTransitionStatus: xr,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", en(), ms();
      }
    }, wf = {
      readContext: function(i) {
        return b(), xi(i);
      },
      use: function(i) {
        return y(), hi(i);
      },
      useCallback: function(i, r) {
        return Nt = "useCallback", y(), Xt(), zd(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", y(), Xt(), xi(i);
      },
      useEffect: function(i, r) {
        Nt = "useEffect", y(), Xt(), Vr(2048, Or, i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", y(), Xt(), Us(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        return Nt = "useInsertionEffect", y(), Xt(), Vr(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", y(), Xt(), Vr(4, Ss, i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", y(), Xt();
        var u = Tt.H;
        Tt.H = wf;
        try {
          return Gd(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", y(), Xt();
        var m = Tt.H;
        Tt.H = wf;
        try {
          return _a(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function() {
        return Nt = "useRef", y(), Xt(), zn().memoizedState;
      },
      useState: function() {
        Nt = "useState", y(), Xt();
        var i = Tt.H;
        Tt.H = wf;
        try {
          return _a(je);
        } finally {
          Tt.H = i;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", y(), Xt();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", y(), Xt(), Bm(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", y(), Xt(), Xc();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", y(), Xt(), Nd(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", y(), Xt(), zn().memoizedState;
      },
      useFormState: function(i) {
        return Nt = "useFormState", y(), Xt(), Hm(i);
      },
      useActionState: function(i) {
        return Nt = "useActionState", y(), Xt(), Hm(i);
      },
      useOptimistic: function(i, r) {
        return Nt = "useOptimistic", y(), Xt(), gs(i, r);
      },
      useMemoCache: function(i) {
        return y(), Bn(i);
      },
      useHostTransitionStatus: xr,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", Xt(), zn().memoizedState;
      }
    }, fx = {
      readContext: function(i) {
        return b(), xi(i);
      },
      use: function(i) {
        return y(), hi(i);
      },
      useCallback: function(i, r) {
        return Nt = "useCallback", y(), Xt(), zd(i, r);
      },
      useContext: function(i) {
        return Nt = "useContext", y(), Xt(), xi(i);
      },
      useEffect: function(i, r) {
        Nt = "useEffect", y(), Xt(), Vr(2048, Or, i, r);
      },
      useImperativeHandle: function(i, r, u) {
        return Nt = "useImperativeHandle", y(), Xt(), Us(i, r, u);
      },
      useInsertionEffect: function(i, r) {
        return Nt = "useInsertionEffect", y(), Xt(), Vr(4, To, i, r);
      },
      useLayoutEffect: function(i, r) {
        return Nt = "useLayoutEffect", y(), Xt(), Vr(4, Ss, i, r);
      },
      useMemo: function(i, r) {
        Nt = "useMemo", y(), Xt();
        var u = Tt.H;
        Tt.H = wf;
        try {
          return Gd(i, r);
        } finally {
          Tt.H = u;
        }
      },
      useReducer: function(i, r, u) {
        Nt = "useReducer", y(), Xt();
        var m = Tt.H;
        Tt.H = wf;
        try {
          return or(i, r, u);
        } finally {
          Tt.H = m;
        }
      },
      useRef: function() {
        return Nt = "useRef", y(), Xt(), zn().memoizedState;
      },
      useState: function() {
        Nt = "useState", y(), Xt();
        var i = Tt.H;
        Tt.H = wf;
        try {
          return or(je);
        } finally {
          Tt.H = i;
        }
      },
      useDebugValue: function() {
        Nt = "useDebugValue", y(), Xt();
      },
      useDeferredValue: function(i, r) {
        return Nt = "useDeferredValue", y(), Xt(), ty(i, r);
      },
      useTransition: function() {
        return Nt = "useTransition", y(), Xt(), Il();
      },
      useSyncExternalStore: function(i, r, u) {
        return Nt = "useSyncExternalStore", y(), Xt(), Nd(
          i,
          r,
          u
        );
      },
      useId: function() {
        return Nt = "useId", y(), Xt(), zn().memoizedState;
      },
      useFormState: function(i) {
        return Nt = "useFormState", y(), Xt(), Du(i);
      },
      useActionState: function(i) {
        return Nt = "useActionState", y(), Xt(), Du(i);
      },
      useOptimistic: function(i, r) {
        return Nt = "useOptimistic", y(), Xt(), fn(i, r);
      },
      useMemoCache: function(i) {
        return y(), Bn(i);
      },
      useHostTransitionStatus: xr,
      useCacheRefresh: function() {
        return Nt = "useCacheRefresh", Xt(), zn().memoizedState;
      }
    };
    var ZO = {
      react_stack_bottom_frame: function(i, r, u) {
        var m = Jo;
        Jo = !0;
        try {
          return i(r, u);
        } finally {
          Jo = m;
        }
      }
    }, yR = ZO.react_stack_bottom_frame.bind(ZO), WO = {
      react_stack_bottom_frame: function(i) {
        var r = Jo;
        Jo = !0;
        try {
          return i.render();
        } finally {
          Jo = r;
        }
      }
    }, QO = WO.react_stack_bottom_frame.bind(WO), JO = {
      react_stack_bottom_frame: function(i, r) {
        try {
          r.componentDidMount();
        } catch (u) {
          Wn(i, i.return, u);
        }
      }
    }, _R = JO.react_stack_bottom_frame.bind(
      JO
    ), t4 = {
      react_stack_bottom_frame: function(i, r, u, m, E) {
        try {
          r.componentDidUpdate(u, m, E);
        } catch (S) {
          Wn(i, i.return, S);
        }
      }
    }, e4 = t4.react_stack_bottom_frame.bind(
      t4
    ), n4 = {
      react_stack_bottom_frame: function(i, r) {
        var u = r.stack;
        i.componentDidCatch(r.value, {
          componentStack: u !== null ? u : ""
        });
      }
    }, EI = n4.react_stack_bottom_frame.bind(
      n4
    ), i4 = {
      react_stack_bottom_frame: function(i, r, u) {
        try {
          u.componentWillUnmount();
        } catch (m) {
          Wn(i, r, m);
        }
      }
    }, a4 = i4.react_stack_bottom_frame.bind(
      i4
    ), r4 = {
      react_stack_bottom_frame: function(i) {
        i.resourceKind != null && console.error(
          "Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",
          i.resourceKind
        );
        var r = i.create;
        return i = i.inst, r = r(), i.destroy = r;
      }
    }, bI = r4.react_stack_bottom_frame.bind(r4), s4 = {
      react_stack_bottom_frame: function(i, r, u) {
        try {
          u();
        } catch (m) {
          Wn(i, r, m);
        }
      }
    }, SI = s4.react_stack_bottom_frame.bind(s4), o4 = {
      react_stack_bottom_frame: function(i) {
        var r = i._init;
        return r(i._payload);
      }
    }, Yp = o4.react_stack_bottom_frame.bind(o4), e1 = null, $E = 0, _n = null, vR, l4 = vR = !1, u4 = {}, c4 = {}, f4 = {};
    p = function(i, r, u) {
      if (u !== null && typeof u == "object" && u._store && (!u._store.validated && u.key == null || u._store.validated === 2)) {
        if (typeof u._store != "object")
          throw Error(
            "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue."
          );
        u._store.validated = 1;
        var m = ht(i), E = m || "null";
        if (!u4[E]) {
          u4[E] = !0, u = u._owner, i = i._debugOwner;
          var S = "";
          i && typeof i.tag == "number" && (E = ht(i)) && (S = `

Check the render method of \`` + E + "`."), S || m && (S = `

Check the top-level render call using <` + m + ">.");
          var O = "";
          u != null && i !== u && (m = null, typeof u.tag == "number" ? m = ht(u) : typeof u.name == "string" && (m = u.name), m && (O = " It was passed a child from " + m + ".")), de(r, function() {
            console.error(
              'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
              S,
              O
            );
          });
        }
      }
    };
    var n1 = Lu(!0), h4 = Lu(!1), vc = Ct(null), Wh = null, i1 = 1, XE = 2, Dr = Ct(0), d4 = {}, g4 = /* @__PURE__ */ new Set(), m4 = /* @__PURE__ */ new Set(), p4 = /* @__PURE__ */ new Set(), y4 = /* @__PURE__ */ new Set(), _4 = /* @__PURE__ */ new Set(), v4 = /* @__PURE__ */ new Set(), E4 = /* @__PURE__ */ new Set(), b4 = /* @__PURE__ */ new Set(), S4 = /* @__PURE__ */ new Set(), x4 = /* @__PURE__ */ new Set();
    Object.freeze(d4);
    var ER = {
      enqueueSetState: function(i, r, u) {
        i = i._reactInternals;
        var m = Xr(i), E = Br(m);
        E.payload = r, u != null && (yn(u), E.callback = u), r = Aa(i, E, m), r !== null && (gn(r, i, m), zo(r, i, m)), tn(i, m);
      },
      enqueueReplaceState: function(i, r, u) {
        i = i._reactInternals;
        var m = Xr(i), E = Br(m);
        E.tag = BO, E.payload = r, u != null && (yn(u), E.callback = u), r = Aa(i, E, m), r !== null && (gn(r, i, m), zo(r, i, m)), tn(i, m);
      },
      enqueueForceUpdate: function(i, r) {
        i = i._reactInternals;
        var u = Xr(i), m = Br(u);
        m.tag = qO, r != null && (yn(r), m.callback = r), r = Aa(i, m, u), r !== null && (gn(r, i, u), zo(r, i, u)), ie !== null && typeof ie.markForceUpdateScheduled == "function" && ie.markForceUpdateScheduled(i, u);
      }
    }, bR = typeof reportError == "function" ? reportError : function(i) {
      if (typeof window == "object" && typeof window.ErrorEvent == "function") {
        var r = new window.ErrorEvent("error", {
          bubbles: !0,
          cancelable: !0,
          message: typeof i == "object" && i !== null && typeof i.message == "string" ? String(i.message) : String(i),
          error: i
        });
        if (!window.dispatchEvent(r)) return;
      } else if (typeof process == "object" && typeof process.emit == "function") {
        process.emit("uncaughtException", i);
        return;
      }
      console.error(i);
    }, a1 = null, SR = null, T4 = Error(
      "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."
    ), is = !1, w4 = {}, R4 = {}, A4 = {}, M4 = {}, r1 = !1, C4 = {}, xR = {}, TR = {
      dehydrated: null,
      treeContext: null,
      retryLane: 0,
      hydrationErrors: null
    }, O4 = !1, D4 = null;
    D4 = /* @__PURE__ */ new Set();
    var Fg = !1, Qa = !1, wR = !1, N4 = typeof WeakSet == "function" ? WeakSet : Set, as = null, s1 = null, o1 = null, dr = null, al = !1, Rf = null, KE = 8192, xI = {
      getCacheForType: function(i) {
        var r = xi(Cr), u = r.data.get(i);
        return u === void 0 && (u = i(), r.data.set(i, u)), u;
      },
      getOwner: function() {
        return La;
      }
    };
    if (typeof Symbol == "function" && Symbol.for) {
      var ZE = Symbol.for;
      ZE("selector.component"), ZE("selector.has_pseudo_class"), ZE("selector.role"), ZE("selector.test_id"), ZE("selector.text");
    }
    var TI = [], wI = typeof WeakMap == "function" ? WeakMap : Map, su = 0, wo = 2, Af = 4, $g = 0, WE = 1, l1 = 2, RR = 3, Jy = 4, hx = 6, L4 = 5, ui = su, Li = null, Sn = null, An = 0, rl = 0, QE = 1, t_ = 2, JE = 3, I4 = 4, AR = 5, u1 = 6, tb = 7, MR = 8, e_ = 9, mi = rl, ou = null, Fp = !1, c1 = !1, CR = !1, Qh = 0, Ga = $g, $p = 0, Xp = 0, OR = 0, lu = 0, n_ = 0, eb = null, Ro = null, dx = !1, DR = 0, P4 = 300, gx = 1 / 0, z4 = 500, nb = null, Kp = null, RI = 0, AI = 1, MI = 2, i_ = 0, G4 = 1, U4 = 2, j4 = 3, CI = 4, NR = 5, xs = 0, Zp = null, f1 = null, Wp = 0, LR = 0, IR = null, k4 = null, OI = 50, ib = 0, PR = null, zR = !1, mx = !1, DI = 50, a_ = 0, ab = null, h1 = !1, px = null, H4 = !1, B4 = /* @__PURE__ */ new Set(), NI = {}, yx = null, d1 = null, GR = !1, UR = !1, _x = !1, jR = !1, r_ = 0, kR = {};
    (function() {
      for (var i = 0; i < iR.length; i++) {
        var r = iR[i], u = r.toLowerCase();
        r = r[0].toUpperCase() + r.slice(1), Tn(u, "on" + r);
      }
      Tn(ns, "onAnimationEnd"), Tn(Xs, "onAnimationIteration"), Tn(ma, "onAnimationStart"), Tn("dblclick", "onDoubleClick"), Tn("focusin", "onFocus"), Tn("focusout", "onBlur"), Tn(ru, "onTransitionRun"), Tn(Sf, "onTransitionStart"), Tn(ZS, "onTransitionCancel"), Tn(CO, "onTransitionEnd");
    })(), Jt("onMouseEnter", ["mouseout", "mouseover"]), Jt("onMouseLeave", ["mouseout", "mouseover"]), Jt("onPointerEnter", ["pointerout", "pointerover"]), Jt("onPointerLeave", ["pointerout", "pointerover"]), Kt(
      "onChange",
      "change click focusin focusout input keydown keyup selectionchange".split(
        " "
      )
    ), Kt(
      "onSelect",
      "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
        " "
      )
    ), Kt("onBeforeInput", [
      "compositionend",
      "keypress",
      "textInput",
      "paste"
    ]), Kt(
      "onCompositionEnd",
      "compositionend focusout keydown keypress keyup mousedown".split(" ")
    ), Kt(
      "onCompositionStart",
      "compositionstart focusout keydown keypress keyup mousedown".split(" ")
    ), Kt(
      "onCompositionUpdate",
      "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
    );
    var rb = "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(
      " "
    ), HR = new Set(
      "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rb)
    ), vx = "_reactListening" + Math.random().toString(36).slice(2), q4 = !1, V4 = !1, Ex = !1, Y4 = !1, bx = !1, Sx = !1, F4 = !1, xx = {}, LI = /\r\n?/g, II = /\u0000|\uFFFD/g, s_ = "http://www.w3.org/1999/xlink", BR = "http://www.w3.org/XML/1998/namespace", PI = "javascript:throw new Error('React form unexpectedly submitted.')", zI = "suppressHydrationWarning", Tx = "$", wx = "/$", Xg = "$?", sb = "$!", GI = 1, UI = 2, jI = 4, qR = "F!", $4 = "F", X4 = "complete", kI = "style", Kg = 0, g1 = 1, Rx = 2, VR = null, YR = null, K4 = { dialog: !0, webview: !0 }, FR = null, Z4 = typeof setTimeout == "function" ? setTimeout : void 0, HI = typeof clearTimeout == "function" ? clearTimeout : void 0, o_ = -1, W4 = typeof Promise == "function" ? Promise : void 0, BI = typeof queueMicrotask == "function" ? queueMicrotask : typeof W4 < "u" ? function(i) {
      return W4.resolve(null).then(i).catch(Kl);
    } : Z4, $R = null, l_ = 0, ob = 1, Q4 = 2, J4 = 3, Ec = 4, bc = /* @__PURE__ */ new Map(), t3 = /* @__PURE__ */ new Set(), Zg = Un.d;
    Un.d = {
      f: function() {
        var i = Zg.f(), r = Yo();
        return i || r;
      },
      r: function(i) {
        var r = sa(i);
        r !== null && r.tag === 5 && r.type === "form" ? lo(r) : Zg.r(i);
      },
      D: function(i) {
        Zg.D(i), Zl("dns-prefetch", i, null);
      },
      C: function(i, r) {
        Zg.C(i, r), Zl("preconnect", i, r);
      },
      L: function(i, r, u) {
        Zg.L(i, r, u);
        var m = m1;
        if (m && i && r) {
          var E = 'link[rel="preload"][as="' + Ra(r) + '"]';
          r === "image" && u && u.imageSrcSet ? (E += '[imagesrcset="' + Ra(
            u.imageSrcSet
          ) + '"]', typeof u.imageSizes == "string" && (E += '[imagesizes="' + Ra(
            u.imageSizes
          ) + '"]')) : E += '[href="' + Ra(i) + '"]';
          var S = E;
          switch (r) {
            case "style":
              S = yo(i);
              break;
            case "script":
              S = tc(i);
          }
          bc.has(S) || (i = He(
            {
              rel: "preload",
              href: r === "image" && u && u.imageSrcSet ? void 0 : i,
              as: r
            },
            u
          ), bc.set(S, i), m.querySelector(E) !== null || r === "style" && m.querySelector(
            Uh(S)
          ) || r === "script" && m.querySelector(df(S)) || (r = m.createElement("link"), Na(r, "link", i), dt(r), m.head.appendChild(r)));
        }
      },
      m: function(i, r) {
        Zg.m(i, r);
        var u = m1;
        if (u && i) {
          var m = r && typeof r.as == "string" ? r.as : "script", E = 'link[rel="modulepreload"][as="' + Ra(m) + '"][href="' + Ra(i) + '"]', S = E;
          switch (m) {
            case "audioworklet":
            case "paintworklet":
            case "serviceworker":
            case "sharedworker":
            case "worker":
            case "script":
              S = tc(i);
          }
          if (!bc.has(S) && (i = He({ rel: "modulepreload", href: i }, r), bc.set(S, i), u.querySelector(E) === null)) {
            switch (m) {
              case "audioworklet":
              case "paintworklet":
              case "serviceworker":
              case "sharedworker":
              case "worker":
              case "script":
                if (u.querySelector(df(S)))
                  return;
            }
            m = u.createElement("link"), Na(m, "link", i), dt(m), u.head.appendChild(m);
          }
        }
      },
      X: function(i, r) {
        Zg.X(i, r);
        var u = m1;
        if (u && i) {
          var m = Y(u).hoistableScripts, E = tc(i), S = m.get(E);
          S || (S = u.querySelector(
            df(E)
          ), S || (i = He({ src: i, async: !0 }, r), (r = bc.get(E)) && _g(i, r), S = u.createElement("script"), dt(S), Na(S, "link", i), u.head.appendChild(S)), S = {
            type: "script",
            instance: S,
            count: 1,
            state: null
          }, m.set(E, S));
        }
      },
      S: function(i, r, u) {
        Zg.S(i, r, u);
        var m = m1;
        if (m && i) {
          var E = Y(m).hoistableStyles, S = yo(i);
          r = r || "default";
          var O = E.get(S);
          if (!O) {
            var I = { loading: l_, preload: null };
            if (O = m.querySelector(
              Uh(S)
            ))
              I.loading = ob | Ec;
            else {
              i = He(
                {
                  rel: "stylesheet",
                  href: i,
                  "data-precedence": r
                },
                u
              ), (u = bc.get(S)) && _p(i, u);
              var F = O = m.createElement("link");
              dt(F), Na(F, "link", i), F._p = new Promise(function(K, Rt) {
                F.onload = K, F.onerror = Rt;
              }), F.addEventListener("load", function() {
                I.loading |= ob;
              }), F.addEventListener("error", function() {
                I.loading |= Q4;
              }), I.loading |= Ec, yp(O, r, m);
            }
            O = {
              type: "stylesheet",
              instance: O,
              count: 1,
              state: I
            }, E.set(S, O);
          }
        }
      },
      M: function(i, r) {
        Zg.M(i, r);
        var u = m1;
        if (u && i) {
          var m = Y(u).hoistableScripts, E = tc(i), S = m.get(E);
          S || (S = u.querySelector(
            df(E)
          ), S || (i = He({ src: i, async: !0, type: "module" }, r), (r = bc.get(E)) && _g(i, r), S = u.createElement("script"), dt(S), Na(S, "link", i), u.head.appendChild(S)), S = {
            type: "script",
            instance: S,
            count: 1,
            state: null
          }, m.set(E, S));
        }
      }
    };
    var m1 = typeof document > "u" ? null : document, Ax = null, lb = null, XR = null, Mx = null, u_ = Eo, ub = {
      $$typeof: be,
      Provider: null,
      Consumer: null,
      _currentValue: u_,
      _currentValue2: u_,
      _threadCount: 0
    }, e3 = "%c%s%c ", n3 = "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", i3 = "", Cx = " ", qI = Function.prototype.bind, a3 = !1, r3 = null, s3 = null, o3 = null, l3 = null, u3 = null, c3 = null, f3 = null, h3 = null, d3 = null;
    r3 = function(i, r, u, m) {
      r = t(i, r), r !== null && (u = e(r.memoizedState, u, 0, m), r.memoizedState = u, r.baseState = u, i.memoizedProps = He({}, i.memoizedProps), u = Gr(i, 2), u !== null && gn(u, i, 2));
    }, s3 = function(i, r, u) {
      r = t(i, r), r !== null && (u = l(r.memoizedState, u, 0), r.memoizedState = u, r.baseState = u, i.memoizedProps = He({}, i.memoizedProps), u = Gr(i, 2), u !== null && gn(u, i, 2));
    }, o3 = function(i, r, u, m) {
      r = t(i, r), r !== null && (u = a(r.memoizedState, u, m), r.memoizedState = u, r.baseState = u, i.memoizedProps = He({}, i.memoizedProps), u = Gr(i, 2), u !== null && gn(u, i, 2));
    }, l3 = function(i, r, u) {
      i.pendingProps = e(i.memoizedProps, r, 0, u), i.alternate && (i.alternate.pendingProps = i.pendingProps), r = Gr(i, 2), r !== null && gn(r, i, 2);
    }, u3 = function(i, r) {
      i.pendingProps = l(i.memoizedProps, r, 0), i.alternate && (i.alternate.pendingProps = i.pendingProps), r = Gr(i, 2), r !== null && gn(r, i, 2);
    }, c3 = function(i, r, u) {
      i.pendingProps = a(
        i.memoizedProps,
        r,
        u
      ), i.alternate && (i.alternate.pendingProps = i.pendingProps), r = Gr(i, 2), r !== null && gn(r, i, 2);
    }, f3 = function(i) {
      var r = Gr(i, 2);
      r !== null && gn(r, i, 2);
    }, h3 = function(i) {
      h = i;
    }, d3 = function(i) {
      f = i;
    };
    var Ox = !0, Dx = null, KR = !1, Qp = null, Jp = null, t0 = null, cb = /* @__PURE__ */ new Map(), fb = /* @__PURE__ */ new Map(), e0 = [], VI = "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(
      " "
    ), Nx = null;
    if (Tp.prototype.render = xp.prototype.render = function(i) {
      var r = this._internalRoot;
      if (r === null) throw Error("Cannot update an unmounted root.");
      var u = arguments;
      typeof u[1] == "function" ? console.error(
        "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
      ) : U(u[1]) ? console.error(
        "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."
      ) : typeof u[1] < "u" && console.error(
        "You passed a second argument to root.render(...) but it only accepts one argument."
      ), u = i;
      var m = r.current, E = Xr(m);
      bg(m, E, u, r, null, null);
    }, Tp.prototype.unmount = xp.prototype.unmount = function() {
      var i = arguments;
      if (typeof i[0] == "function" && console.error(
        "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
      ), i = this._internalRoot, i !== null) {
        this._internalRoot = null;
        var r = i.containerInfo;
        (ui & (wo | Af)) !== su && console.error(
          "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."
        ), bg(i.current, 2, null, i, null, null), Yo(), r[lc] = null;
      }
    }, Tp.prototype.unstable_scheduleHydration = function(i) {
      if (i) {
        var r = _l();
        i = { blockedOn: null, target: i, priority: r };
        for (var u = 0; u < e0.length && r !== 0 && r < e0[u].priority; u++) ;
        e0.splice(u, 0, i), u === 0 && Hh(i);
      }
    }, function() {
      var i = Ny.version;
      if (i !== "19.1.1")
        throw Error(
          `Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
  - react:      ` + (i + `
  - react-dom:  19.1.1
Learn more: https://react.dev/warnings/version-mismatch`)
        );
    }(), typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
      "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"
    ), Un.findDOMNode = function(i) {
      var r = i._reactInternals;
      if (r === void 0)
        throw typeof i.render == "function" ? Error("Unable to find node on an unmounted component.") : (i = Object.keys(i).join(","), Error(
          "Argument appears to not be a ReactComponent. Keys: " + i
        ));
      return i = z(r), i = i !== null ? Q(i) : null, i = i === null ? null : i.stateNode, i;
    }, !function() {
      var i = {
        bundleType: 1,
        version: "19.1.1",
        rendererPackageName: "react-dom",
        currentDispatcherRef: Tt,
        reconcilerVersion: "19.1.1"
      };
      return i.overrideHookState = r3, i.overrideHookStateDeletePath = s3, i.overrideHookStateRenamePath = o3, i.overrideProps = l3, i.overridePropsDeletePath = u3, i.overridePropsRenamePath = c3, i.scheduleUpdate = f3, i.setErrorHandler = h3, i.setSuspenseHandler = d3, i.scheduleRefresh = L, i.scheduleRoot = C, i.setRefreshHandler = N, i.getCurrentFiber = RE, i.getLaneLabelMap = Cv, i.injectProfilingHooks = Qt, It(i);
    }() && vt && window.top === window.self && (-1 < navigator.userAgent.indexOf("Chrome") && navigator.userAgent.indexOf("Edge") === -1 || -1 < navigator.userAgent.indexOf("Firefox"))) {
      var g3 = window.location.protocol;
      /^(https?|file):$/.test(g3) && console.info(
        "%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools" + (g3 === "file:" ? `
You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq` : ""),
        "font-weight:bold"
      );
    }
    yb.createRoot = function(i, r) {
      if (!U(i))
        throw Error("Target container is not a DOM element.");
      wp(i);
      var u = !1, m = "", E = Fm, S = $m, O = Pu, I = null;
      return r != null && (r.hydrate ? console.warn(
        "hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."
      ) : typeof r == "object" && r !== null && r.$$typeof === Jl && console.error(
        `You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:

  let root = createRoot(domContainer);
  root.render(<App />);`
      ), r.unstable_strictMode === !0 && (u = !0), r.identifierPrefix !== void 0 && (m = r.identifierPrefix), r.onUncaughtError !== void 0 && (E = r.onUncaughtError), r.onCaughtError !== void 0 && (S = r.onCaughtError), r.onRecoverableError !== void 0 && (O = r.onRecoverableError), r.unstable_transitionCallbacks !== void 0 && (I = r.unstable_transitionCallbacks)), r = Oy(
        i,
        1,
        !1,
        null,
        null,
        u,
        m,
        E,
        S,
        O,
        I,
        null
      ), i[lc] = r.current, hg(i), new xp(r);
    }, yb.hydrateRoot = function(i, r, u) {
      if (!U(i))
        throw Error("Target container is not a DOM element.");
      wp(i), r === void 0 && console.error(
        "Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)"
      );
      var m = !1, E = "", S = Fm, O = $m, I = Pu, F = null, K = null;
      return u != null && (u.unstable_strictMode === !0 && (m = !0), u.identifierPrefix !== void 0 && (E = u.identifierPrefix), u.onUncaughtError !== void 0 && (S = u.onUncaughtError), u.onCaughtError !== void 0 && (O = u.onCaughtError), u.onRecoverableError !== void 0 && (I = u.onRecoverableError), u.unstable_transitionCallbacks !== void 0 && (F = u.unstable_transitionCallbacks), u.formState !== void 0 && (K = u.formState)), r = Oy(
        i,
        1,
        !0,
        r,
        u ?? null,
        m,
        E,
        S,
        O,
        I,
        F,
        K
      ), r.context = ai(null), u = r.current, m = Xr(u), m = zi(m), E = Br(m), E.callback = null, Aa(u, E, m), u = m, r.current.lanes = u, nr(r, u), vs(r), i[lc] = r.current, hg(i), new Tp(r);
    }, yb.version = "19.1.1", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
  }(), yb;
}
var DD;
function Zj() {
  if (DD) return kx.exports;
  DD = 1;
  var n = {};
  function t() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
      if (n.NODE_ENV !== "production")
        throw new Error("^_^");
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t);
      } catch (e) {
        console.error(e);
      }
    }
  }
  return n.NODE_ENV === "production" ? (t(), kx.exports = Xj()) : kx.exports = Kj(), kx.exports;
}
var Wj = Zj(), qx = { exports: {} }, rA = {};
/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var ND;
function Qj() {
  if (ND) return rA;
  ND = 1;
  var n = C0();
  function t(p, y) {
    return p === y && (p !== 0 || 1 / p === 1 / y) || p !== p && y !== y;
  }
  var e = typeof Object.is == "function" ? Object.is : t, a = n.useSyncExternalStore, s = n.useRef, l = n.useEffect, f = n.useMemo, h = n.useDebugValue;
  return rA.useSyncExternalStoreWithSelector = function(p, y, b, x, w) {
    var A = s(null);
    if (A.current === null) {
      var C = { hasValue: !1, value: null };
      A.current = C;
    } else C = A.current;
    A = f(
      function() {
        function N(z) {
          if (!U) {
            if (U = !0, k = z, z = x(z), w !== void 0 && C.hasValue) {
              var Q = C.value;
              if (w(Q, z))
                return H = Q;
            }
            return H = z;
          }
          if (Q = H, e(k, z)) return Q;
          var et = x(z);
          return w !== void 0 && w(Q, et) ? (k = z, Q) : (k = z, H = et);
        }
        var U = !1, k, H, B = b === void 0 ? null : b;
        return [
          function() {
            return N(y());
          },
          B === null ? void 0 : function() {
            return N(B());
          }
        ];
      },
      [y, b, x, w]
    );
    var L = a(p, A[0], A[1]);
    return l(
      function() {
        C.hasValue = !0, C.value = L;
      },
      [L]
    ), h(L), L;
  }, rA;
}
var sA = {}, LD;
function Jj() {
  if (LD) return sA;
  LD = 1;
  var n = {};
  /**
   * @license React
   * use-sync-external-store-with-selector.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return n.NODE_ENV !== "production" && function() {
    function t(y, b) {
      return y === b && (y !== 0 || 1 / y === 1 / b) || y !== y && b !== b;
    }
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
    var e = C0(), a = typeof Object.is == "function" ? Object.is : t, s = e.useSyncExternalStore, l = e.useRef, f = e.useEffect, h = e.useMemo, p = e.useDebugValue;
    sA.useSyncExternalStoreWithSelector = function(y, b, x, w, A) {
      var C = l(null);
      if (C.current === null) {
        var L = { hasValue: !1, value: null };
        C.current = L;
      } else L = C.current;
      C = h(
        function() {
          function U(Q) {
            if (!k) {
              if (k = !0, H = Q, Q = w(Q), A !== void 0 && L.hasValue) {
                var et = L.value;
                if (A(et, Q))
                  return B = et;
              }
              return B = Q;
            }
            if (et = B, a(H, Q))
              return et;
            var ot = w(Q);
            return A !== void 0 && A(et, ot) ? (H = Q, et) : (H = Q, B = ot);
          }
          var k = !1, H, B, z = x === void 0 ? null : x;
          return [
            function() {
              return U(b());
            },
            z === null ? void 0 : function() {
              return U(z());
            }
          ];
        },
        [b, x, w, A]
      );
      var N = s(y, C[0], C[1]);
      return f(
        function() {
          L.hasValue = !0, L.value = N;
        },
        [N]
      ), p(N), N;
    }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
  }(), sA;
}
var ID;
function tk() {
  if (ID) return qx.exports;
  ID = 1;
  var n = {};
  return n.NODE_ENV === "production" ? qx.exports = Qj() : qx.exports = Jj(), qx.exports;
}
var ek = tk(), aS = {};
function nk(n) {
  n();
}
function ik() {
  let n = null, t = null;
  return {
    clear() {
      n = null, t = null;
    },
    notify() {
      nk(() => {
        let e = n;
        for (; e; )
          e.callback(), e = e.next;
      });
    },
    get() {
      const e = [];
      let a = n;
      for (; a; )
        e.push(a), a = a.next;
      return e;
    },
    subscribe(e) {
      let a = !0;
      const s = t = {
        callback: e,
        next: null,
        prev: t
      };
      return s.prev ? s.prev.next = s : n = s, function() {
        !a || n === null || (a = !1, s.next ? s.next.prev = s.prev : t = s.prev, s.prev ? s.prev.next = s.next : n = s.next);
      };
    }
  };
}
var PD = {
  notify() {
  },
  get: () => []
};
function ak(n, t) {
  let e, a = PD, s = 0, l = !1;
  function f(L) {
    b();
    const N = a.subscribe(L);
    let U = !1;
    return () => {
      U || (U = !0, N(), x());
    };
  }
  function h() {
    a.notify();
  }
  function p() {
    C.onStateChange && C.onStateChange();
  }
  function y() {
    return l;
  }
  function b() {
    s++, e || (e = n.subscribe(p), a = ik());
  }
  function x() {
    s--, e && s === 0 && (e(), e = void 0, a.clear(), a = PD);
  }
  function w() {
    l || (l = !0, b());
  }
  function A() {
    l && (l = !1, x());
  }
  const C = {
    addNestedSub: f,
    notifyNestedSubs: h,
    handleChangeWrapper: p,
    isSubscribed: y,
    trySubscribe: w,
    tryUnsubscribe: A,
    getListeners: () => a
  };
  return C;
}
var rk = () => typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", sk = /* @__PURE__ */ rk(), ok = () => typeof navigator < "u" && navigator.product === "ReactNative", lk = /* @__PURE__ */ ok(), uk = () => sk || lk ? Se.useLayoutEffect : Se.useEffect, ck = /* @__PURE__ */ uk(), fk = /* @__PURE__ */ Symbol.for("react-redux-context"), hk = typeof globalThis < "u" ? globalThis : (
  /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
  {}
);
function dk() {
  if (!Se.createContext) return {};
  const n = hk[fk] ??= /* @__PURE__ */ new Map();
  let t = n.get(Se.createContext);
  return t || (t = Se.createContext(
    null
  ), aS.NODE_ENV !== "production" && (t.displayName = "ReactRedux"), n.set(Se.createContext, t)), t;
}
var T0 = /* @__PURE__ */ dk();
function gk(n) {
  const { children: t, context: e, serverState: a, store: s } = n, l = Se.useMemo(() => {
    const p = ak(s), y = {
      store: s,
      subscription: p,
      getServerState: a ? () => a : void 0
    };
    if (aS.NODE_ENV === "production")
      return y;
    {
      const { identityFunctionCheck: b = "once", stabilityCheck: x = "once" } = n;
      return /* @__PURE__ */ Object.assign(y, {
        stabilityCheck: x,
        identityFunctionCheck: b
      });
    }
  }, [s, a]), f = Se.useMemo(() => s.getState(), [s]);
  ck(() => {
    const { subscription: p } = l;
    return p.onStateChange = p.notifyNestedSubs, p.trySubscribe(), f !== s.getState() && p.notifyNestedSubs(), () => {
      p.tryUnsubscribe(), p.onStateChange = void 0;
    };
  }, [l, f]);
  const h = e || T0;
  return /* @__PURE__ */ Se.createElement(h.Provider, { value: l }, t);
}
var mk = gk;
function wC(n = T0) {
  return function() {
    const e = Se.useContext(n);
    if (aS.NODE_ENV !== "production" && !e)
      throw new Error(
        "could not find react-redux context value; please ensure the component is wrapped in a <Provider>"
      );
    return e;
  };
}
var j8 = /* @__PURE__ */ wC();
function k8(n = T0) {
  const t = n === T0 ? j8 : (
    // @ts-ignore
    wC(n)
  ), e = () => {
    const { store: a } = t();
    return a;
  };
  return Object.assign(e, {
    withTypes: () => e
  }), e;
}
var pk = /* @__PURE__ */ k8();
function yk(n = T0) {
  const t = n === T0 ? pk : k8(n), e = () => t().dispatch;
  return Object.assign(e, {
    withTypes: () => e
  }), e;
}
var Lo = /* @__PURE__ */ yk(), _k = (n, t) => n === t;
function vk(n = T0) {
  const t = n === T0 ? j8 : wC(n), e = (a, s = {}) => {
    const { equalityFn: l = _k } = typeof s == "function" ? { equalityFn: s } : s;
    if (aS.NODE_ENV !== "production") {
      if (!a)
        throw new Error("You must pass a selector to useSelector");
      if (typeof a != "function")
        throw new Error("You must pass a function as a selector to useSelector");
      if (typeof l != "function")
        throw new Error(
          "You must pass a function as an equality function to useSelector"
        );
    }
    const f = t(), { store: h, subscription: p, getServerState: y } = f, b = Se.useRef(!0), x = Se.useCallback(
      {
        [a.name](A) {
          const C = a(A);
          if (aS.NODE_ENV !== "production") {
            const { devModeChecks: L = {} } = typeof s == "function" ? {} : s, { identityFunctionCheck: N, stabilityCheck: U } = f, {
              identityFunctionCheck: k,
              stabilityCheck: H
            } = {
              stabilityCheck: U,
              identityFunctionCheck: N,
              ...L
            };
            if (H === "always" || H === "once" && b.current) {
              const B = a(A);
              if (!l(C, B)) {
                let z;
                try {
                  throw new Error();
                } catch (Q) {
                  ({ stack: z } = Q);
                }
                console.warn(
                  "Selector " + (a.name || "unknown") + ` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,
                  {
                    state: A,
                    selected: C,
                    selected2: B,
                    stack: z
                  }
                );
              }
            }
            if ((k === "always" || k === "once" && b.current) && C === A) {
              let B;
              try {
                throw new Error();
              } catch (z) {
                ({ stack: B } = z);
              }
              console.warn(
                "Selector " + (a.name || "unknown") + ` returned the root state when called. This can lead to unnecessary rerenders.
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,
                { stack: B }
              );
            }
            b.current && (b.current = !1);
          }
          return C;
        }
      }[a.name],
      [a]
    ), w = ek.useSyncExternalStoreWithSelector(
      p.addNestedSub,
      h.getState,
      y || h.getState,
      x,
      l
    );
    return Se.useDebugValue(w), w;
  };
  return Object.assign(e, {
    withTypes: () => e
  }), e;
}
var Te = /* @__PURE__ */ vk(), Ob = { exports: {} };
/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
var Ek = Ob.exports, zD;
function bk() {
  return zD || (zD = 1, function(n, t) {
    (function() {
      var e, a = "4.17.21", s = 200, l = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", f = "Expected a function", h = "Invalid `variable` option passed into `_.template`", p = "__lodash_hash_undefined__", y = 500, b = "__lodash_placeholder__", x = 1, w = 2, A = 4, C = 1, L = 2, N = 1, U = 2, k = 4, H = 8, B = 16, z = 32, Q = 64, et = 128, ot = 256, pt = 512, ht = 30, Ct = "...", mt = 800, St = 16, Ut = 1, Ft = 2, nt = 3, J = 1 / 0, gt = 9007199254740991, Ot = 17976931348623157e292, W = NaN, j = 4294967295, X = j - 1, st = j >>> 1, At = [
        ["ary", et],
        ["bind", N],
        ["bindKey", U],
        ["curry", H],
        ["curryRight", B],
        ["flip", pt],
        ["partial", z],
        ["partialRight", Q],
        ["rearg", ot]
      ], Dt = "[object Arguments]", It = "[object Array]", $t = "[object AsyncFunction]", Qt = "[object Boolean]", ee = "[object Date]", ce = "[object DOMException]", pe = "[object Error]", Mn = "[object Function]", te = "[object GeneratorFunction]", tn = "[object Map]", Jn = "[object Number]", Pi = "[object Null]", Ge = "[object Object]", pa = "[object Promise]", ka = "[object Proxy]", Ai = "[object RegExp]", fe = "[object Set]", Zi = "[object String]", Dn = "[object Symbol]", nr = "[object Undefined]", mr = "[object WeakMap]", Ha = "[object WeakSet]", ti = "[object ArrayBuffer]", zi = "[object DataView]", Gi = "[object Float32Array]", Io = "[object Float64Array]", Ms = "[object Int8Array]", _l = "[object Int16Array]", ls = "[object Int32Array]", ir = "[object Uint8Array]", Ui = "[object Uint8ClampedArray]", sa = "[object Uint16Array]", Ba = "[object Uint32Array]", Y = /\b__p \+= '';/g, dt = /\b(__p \+=) '' \+/g, Kt = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Jt = /&(?:amp|lt|gt|quot|#39);/g, oe = /[&<>"']/g, Be = RegExp(Jt.source), Ue = RegExp(oe.source), Pe = /<%-([\s\S]+?)%>/g, Ae = /<%([\s\S]+?)%>/g, xn = /<%=([\s\S]+?)%>/g, Wi = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ar = /^\w*$/, oa = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, un = /[\\^$.*+?()[\]{}|]/g, cn = RegExp(un.source), Si = /^\s+/, us = /\s/, ym = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, W_ = /\{\n\/\* \[wrapped with (.+)\] \*/, md = /,? & /, pd = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, de = /[()=,{}\[\]\/\s]/, mu = /\\(\\)?/g, qa = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Nc = /\w*$/, jf = /^[-+]0x[0-9a-f]+$/i, Qi = /^0b[01]+$/i, z0 = /^\[object .+?Constructor\]$/, yd = /^0o[0-7]+$/i, Ra = /^(?:0|[1-9]\d*)$/, Lc = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, kf = /($^)/, G0 = /['\n\r\u2028\u2029\\]/g, Ic = "\\ud800-\\udfff", Q_ = "\\u0300-\\u036f", _d = "\\ufe20-\\ufe2f", vl = "\\u20d0-\\u20ff", eo = Q_ + _d + vl, vd = "\\u2700-\\u27bf", _m = "a-z\\xdf-\\xf6\\xf8-\\xff", Pc = "\\xac\\xb1\\xd7\\xf7", vm = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", pr = "\\u2000-\\u206f", Hf = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", El = "A-Z\\xc0-\\xd6\\xd8-\\xde", zr = "\\ufe0e\\ufe0f", zc = Pc + vm + pr + Hf, Bf = "['’]", qf = "[" + Ic + "]", Gc = "[" + zc + "]", Cs = "[" + eo + "]", Em = "\\d+", Os = "[" + vd + "]", bm = "[" + _m + "]", Sm = "[^" + Ic + zc + Em + vd + _m + El + "]", Uc = "\\ud83c[\\udffb-\\udfff]", pu = "(?:" + Cs + "|" + Uc + ")", xm = "[^" + Ic + "]", Ed = "(?:\\ud83c[\\udde6-\\uddff]){2}", bl = "[\\ud800-\\udbff][\\udc00-\\udfff]", Vf = "[" + El + "]", Tm = "\\u200d", bd = "(?:" + bm + "|" + Sm + ")", Yf = "(?:" + Vf + "|" + Sm + ")", Ff = "(?:" + Bf + "(?:d|ll|m|re|s|t|ve))?", J_ = "(?:" + Bf + "(?:D|LL|M|RE|S|T|VE))?", $f = pu + "?", Sd = "[" + zr + "]?", jc = "(?:" + Tm + "(?:" + [xm, Ed, bl].join("|") + ")" + Sd + $f + ")*", kc = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Xf = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", U0 = Sd + $f + jc, j0 = "(?:" + [Os, Ed, bl].join("|") + ")" + U0, tv = "(?:" + [xm + Cs + "?", Cs, Ed, bl, qf].join("|") + ")", Sl = RegExp(Bf, "g"), no = RegExp(Cs, "g"), Kf = RegExp(Uc + "(?=" + Uc + ")|" + tv + U0, "g"), Zf = RegExp([
        Vf + "?" + bm + "+" + Ff + "(?=" + [Gc, Vf, "$"].join("|") + ")",
        Yf + "+" + J_ + "(?=" + [Gc, Vf + bd, "$"].join("|") + ")",
        Vf + "?" + bd + "+" + Ff,
        Vf + "+" + J_,
        Xf,
        kc,
        Em,
        j0
      ].join("|"), "g"), Ds = RegExp("[" + Tm + Ic + eo + zr + "]"), wm = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Hc = [
        "Array",
        "Buffer",
        "DataView",
        "Date",
        "Error",
        "Float32Array",
        "Float64Array",
        "Function",
        "Int8Array",
        "Int16Array",
        "Int32Array",
        "Map",
        "Math",
        "Object",
        "Promise",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "TypeError",
        "Uint8Array",
        "Uint8ClampedArray",
        "Uint16Array",
        "Uint32Array",
        "WeakMap",
        "_",
        "clearTimeout",
        "isFinite",
        "parseInt",
        "setTimeout"
      ], xd = -1, Xn = {};
      Xn[Gi] = Xn[Io] = Xn[Ms] = Xn[_l] = Xn[ls] = Xn[ir] = Xn[Ui] = Xn[sa] = Xn[Ba] = !0, Xn[Dt] = Xn[It] = Xn[ti] = Xn[Qt] = Xn[zi] = Xn[ee] = Xn[pe] = Xn[Mn] = Xn[tn] = Xn[Jn] = Xn[Ge] = Xn[Ai] = Xn[fe] = Xn[Zi] = Xn[mr] = !1;
      var $e = {};
      $e[Dt] = $e[It] = $e[ti] = $e[zi] = $e[Qt] = $e[ee] = $e[Gi] = $e[Io] = $e[Ms] = $e[_l] = $e[ls] = $e[tn] = $e[Jn] = $e[Ge] = $e[Ai] = $e[fe] = $e[Zi] = $e[Dn] = $e[ir] = $e[Ui] = $e[sa] = $e[Ba] = !0, $e[pe] = $e[Mn] = $e[mr] = !1;
      var ev = {
        // Latin-1 Supplement block.
        À: "A",
        Á: "A",
        Â: "A",
        Ã: "A",
        Ä: "A",
        Å: "A",
        à: "a",
        á: "a",
        â: "a",
        ã: "a",
        ä: "a",
        å: "a",
        Ç: "C",
        ç: "c",
        Ð: "D",
        ð: "d",
        È: "E",
        É: "E",
        Ê: "E",
        Ë: "E",
        è: "e",
        é: "e",
        ê: "e",
        ë: "e",
        Ì: "I",
        Í: "I",
        Î: "I",
        Ï: "I",
        ì: "i",
        í: "i",
        î: "i",
        ï: "i",
        Ñ: "N",
        ñ: "n",
        Ò: "O",
        Ó: "O",
        Ô: "O",
        Õ: "O",
        Ö: "O",
        Ø: "O",
        ò: "o",
        ó: "o",
        ô: "o",
        õ: "o",
        ö: "o",
        ø: "o",
        Ù: "U",
        Ú: "U",
        Û: "U",
        Ü: "U",
        ù: "u",
        ú: "u",
        û: "u",
        ü: "u",
        Ý: "Y",
        ý: "y",
        ÿ: "y",
        Æ: "Ae",
        æ: "ae",
        Þ: "Th",
        þ: "th",
        ß: "ss",
        // Latin Extended-A block.
        Ā: "A",
        Ă: "A",
        Ą: "A",
        ā: "a",
        ă: "a",
        ą: "a",
        Ć: "C",
        Ĉ: "C",
        Ċ: "C",
        Č: "C",
        ć: "c",
        ĉ: "c",
        ċ: "c",
        č: "c",
        Ď: "D",
        Đ: "D",
        ď: "d",
        đ: "d",
        Ē: "E",
        Ĕ: "E",
        Ė: "E",
        Ę: "E",
        Ě: "E",
        ē: "e",
        ĕ: "e",
        ė: "e",
        ę: "e",
        ě: "e",
        Ĝ: "G",
        Ğ: "G",
        Ġ: "G",
        Ģ: "G",
        ĝ: "g",
        ğ: "g",
        ġ: "g",
        ģ: "g",
        Ĥ: "H",
        Ħ: "H",
        ĥ: "h",
        ħ: "h",
        Ĩ: "I",
        Ī: "I",
        Ĭ: "I",
        Į: "I",
        İ: "I",
        ĩ: "i",
        ī: "i",
        ĭ: "i",
        į: "i",
        ı: "i",
        Ĵ: "J",
        ĵ: "j",
        Ķ: "K",
        ķ: "k",
        ĸ: "k",
        Ĺ: "L",
        Ļ: "L",
        Ľ: "L",
        Ŀ: "L",
        Ł: "L",
        ĺ: "l",
        ļ: "l",
        ľ: "l",
        ŀ: "l",
        ł: "l",
        Ń: "N",
        Ņ: "N",
        Ň: "N",
        Ŋ: "N",
        ń: "n",
        ņ: "n",
        ň: "n",
        ŋ: "n",
        Ō: "O",
        Ŏ: "O",
        Ő: "O",
        ō: "o",
        ŏ: "o",
        ő: "o",
        Ŕ: "R",
        Ŗ: "R",
        Ř: "R",
        ŕ: "r",
        ŗ: "r",
        ř: "r",
        Ś: "S",
        Ŝ: "S",
        Ş: "S",
        Š: "S",
        ś: "s",
        ŝ: "s",
        ş: "s",
        š: "s",
        Ţ: "T",
        Ť: "T",
        Ŧ: "T",
        ţ: "t",
        ť: "t",
        ŧ: "t",
        Ũ: "U",
        Ū: "U",
        Ŭ: "U",
        Ů: "U",
        Ű: "U",
        Ų: "U",
        ũ: "u",
        ū: "u",
        ŭ: "u",
        ů: "u",
        ű: "u",
        ų: "u",
        Ŵ: "W",
        ŵ: "w",
        Ŷ: "Y",
        ŷ: "y",
        Ÿ: "Y",
        Ź: "Z",
        Ż: "Z",
        Ž: "Z",
        ź: "z",
        ż: "z",
        ž: "z",
        Ĳ: "IJ",
        ĳ: "ij",
        Œ: "Oe",
        œ: "oe",
        ŉ: "'n",
        ſ: "s"
      }, rr = {
        "&": "&amp;",
        "<": "&lt;",
        ">": "&gt;",
        '"': "&quot;",
        "'": "&#39;"
      }, yu = {
        "&amp;": "&",
        "&lt;": "<",
        "&gt;": ">",
        "&quot;": '"',
        "&#39;": "'"
      }, Td = {
        "\\": "\\",
        "'": "'",
        "\n": "n",
        "\r": "r",
        "\u2028": "u2028",
        "\u2029": "u2029"
      }, wd = parseFloat, wE = parseInt, Rd = typeof f0 == "object" && f0 && f0.Object === Object && f0, k0 = typeof self == "object" && self && self.Object === Object && self, ji = Rd || k0 || Function("return this")(), Wf = t && !t.nodeType && t, io = Wf && !0 && n && !n.nodeType && n, H0 = io && io.exports === Wf, Rm = H0 && Rd.process, cs = function() {
        try {
          var ft = io && io.require && io.require("util").types;
          return ft || Rm && Rm.binding && Rm.binding("util");
        } catch {
        }
      }(), Am = cs && cs.isArrayBuffer, nv = cs && cs.isDate, iv = cs && cs.isMap, av = cs && cs.isRegExp, rv = cs && cs.isSet, Qf = cs && cs.isTypedArray;
      function yr(ft, Pt, Mt) {
        switch (Mt.length) {
          case 0:
            return ft.call(Pt);
          case 1:
            return ft.call(Pt, Mt[0]);
          case 2:
            return ft.call(Pt, Mt[0], Mt[1]);
          case 3:
            return ft.call(Pt, Mt[0], Mt[1], Mt[2]);
        }
        return ft.apply(Pt, Mt);
      }
      function sv(ft, Pt, Mt, ae) {
        for (var Me = -1, wn = ft == null ? 0 : ft.length; ++Me < wn; ) {
          var Kn = ft[Me];
          Pt(ae, Kn, Mt(Kn), ft);
        }
        return ae;
      }
      function fs(ft, Pt) {
        for (var Mt = -1, ae = ft == null ? 0 : ft.length; ++Mt < ae && Pt(ft[Mt], Mt, ft) !== !1; )
          ;
        return ft;
      }
      function ov(ft, Pt) {
        for (var Mt = ft == null ? 0 : ft.length; Mt-- && Pt(ft[Mt], Mt, ft) !== !1; )
          ;
        return ft;
      }
      function Mm(ft, Pt) {
        for (var Mt = -1, ae = ft == null ? 0 : ft.length; ++Mt < ae; )
          if (!Pt(ft[Mt], Mt, ft))
            return !1;
        return !0;
      }
      function ao(ft, Pt) {
        for (var Mt = -1, ae = ft == null ? 0 : ft.length, Me = 0, wn = []; ++Mt < ae; ) {
          var Kn = ft[Mt];
          Pt(Kn, Mt, ft) && (wn[Me++] = Kn);
        }
        return wn;
      }
      function Po(ft, Pt) {
        var Mt = ft == null ? 0 : ft.length;
        return !!Mt && Bc(ft, Pt, 0) > -1;
      }
      function xl(ft, Pt, Mt) {
        for (var ae = -1, Me = ft == null ? 0 : ft.length; ++ae < Me; )
          if (Mt(Pt, ft[ae]))
            return !0;
        return !1;
      }
      function Tn(ft, Pt) {
        for (var Mt = -1, ae = ft == null ? 0 : ft.length, Me = Array(ae); ++Mt < ae; )
          Me[Mt] = Pt(ft[Mt], Mt, ft);
        return Me;
      }
      function Ji(ft, Pt) {
        for (var Mt = -1, ae = Pt.length, Me = ft.length; ++Mt < ae; )
          ft[Me + Mt] = Pt[Mt];
        return ft;
      }
      function Jf(ft, Pt, Mt, ae) {
        var Me = -1, wn = ft == null ? 0 : ft.length;
        for (ae && wn && (Mt = ft[++Me]); ++Me < wn; )
          Mt = Pt(Mt, ft[Me], Me, ft);
        return Mt;
      }
      function Cm(ft, Pt, Mt, ae) {
        var Me = ft == null ? 0 : ft.length;
        for (ae && Me && (Mt = ft[--Me]); Me--; )
          Mt = Pt(Mt, ft[Me], Me, ft);
        return Mt;
      }
      function Ad(ft, Pt) {
        for (var Mt = -1, ae = ft == null ? 0 : ft.length; ++Mt < ae; )
          if (Pt(ft[Mt], Mt, ft))
            return !0;
        return !1;
      }
      var Gr = eh("length");
      function lv(ft) {
        return ft.split("");
      }
      function Om(ft) {
        return ft.match(pd) || [];
      }
      function _u(ft, Pt, Mt) {
        var ae;
        return Mt(ft, function(Me, wn, Kn) {
          if (Pt(Me, wn, Kn))
            return ae = wn, !1;
        }), ae;
      }
      function th(ft, Pt, Mt, ae) {
        for (var Me = ft.length, wn = Mt + (ae ? 1 : -1); ae ? wn-- : ++wn < Me; )
          if (Pt(ft[wn], wn, ft))
            return wn;
        return -1;
      }
      function Bc(ft, Pt, Mt) {
        return Pt === Pt ? F0(ft, Pt, Mt) : th(ft, vu, Mt);
      }
      function Dm(ft, Pt, Mt, ae) {
        for (var Me = Mt - 1, wn = ft.length; ++Me < wn; )
          if (ae(ft[Me], Pt))
            return Me;
        return -1;
      }
      function vu(ft) {
        return ft !== ft;
      }
      function uv(ft, Pt) {
        var Mt = ft == null ? 0 : ft.length;
        return Mt ? qc(ft, Pt) / Mt : W;
      }
      function eh(ft) {
        return function(Pt) {
          return Pt == null ? e : Pt[ft];
        };
      }
      function Ns(ft) {
        return function(Pt) {
          return ft == null ? e : ft[Pt];
        };
      }
      function Nm(ft, Pt, Mt, ae, Me) {
        return Me(ft, function(wn, Kn, Xe) {
          Mt = ae ? (ae = !1, wn) : Pt(Mt, wn, Kn, Xe);
        }), Mt;
      }
      function Lm(ft, Pt) {
        var Mt = ft.length;
        for (ft.sort(Pt); Mt--; )
          ft[Mt] = ft[Mt].value;
        return ft;
      }
      function qc(ft, Pt) {
        for (var Mt, ae = -1, Me = ft.length; ++ae < Me; ) {
          var wn = Pt(ft[ae]);
          wn !== e && (Mt = Mt === e ? wn : Mt + wn);
        }
        return Mt;
      }
      function Ur(ft, Pt) {
        for (var Mt = -1, ae = Array(ft); ++Mt < ft; )
          ae[Mt] = Pt(Mt);
        return ae;
      }
      function B0(ft, Pt) {
        return Tn(Pt, function(Mt) {
          return [Mt, ft[Mt]];
        });
      }
      function Im(ft) {
        return ft && ft.slice(0, wl(ft) + 1).replace(Si, "");
      }
      function ya(ft) {
        return function(Pt) {
          return ft(Pt);
        };
      }
      function Md(ft, Pt) {
        return Tn(Pt, function(Mt) {
          return ft[Mt];
        });
      }
      function Eu(ft, Pt) {
        return ft.has(Pt);
      }
      function bu(ft, Pt) {
        for (var Mt = -1, ae = ft.length; ++Mt < ae && Bc(Pt, ft[Mt], 0) > -1; )
          ;
        return Mt;
      }
      function Ls(ft, Pt) {
        for (var Mt = ft.length; Mt-- && Bc(Pt, ft[Mt], 0) > -1; )
          ;
        return Mt;
      }
      function Vc(ft, Pt) {
        for (var Mt = ft.length, ae = 0; Mt--; )
          ft[Mt] === Pt && ++ae;
        return ae;
      }
      var nh = Ns(ev), Su = Ns(rr);
      function q0(ft) {
        return "\\" + Td[ft];
      }
      function Pm(ft, Pt) {
        return ft == null ? e : ft[Pt];
      }
      function Is(ft) {
        return Ds.test(ft);
      }
      function ih(ft) {
        return wm.test(ft);
      }
      function V0(ft) {
        for (var Pt, Mt = []; !(Pt = ft.next()).done; )
          Mt.push(Pt.value);
        return Mt;
      }
      function xu(ft) {
        var Pt = -1, Mt = Array(ft.size);
        return ft.forEach(function(ae, Me) {
          Mt[++Pt] = [Me, ae];
        }), Mt;
      }
      function Y0(ft, Pt) {
        return function(Mt) {
          return ft(Pt(Mt));
        };
      }
      function ro(ft, Pt) {
        for (var Mt = -1, ae = ft.length, Me = 0, wn = []; ++Mt < ae; ) {
          var Kn = ft[Mt];
          (Kn === Pt || Kn === b) && (ft[Mt] = b, wn[Me++] = Mt);
        }
        return wn;
      }
      function so(ft) {
        var Pt = -1, Mt = Array(ft.size);
        return ft.forEach(function(ae) {
          Mt[++Pt] = ae;
        }), Mt;
      }
      function Tl(ft) {
        var Pt = -1, Mt = Array(ft.size);
        return ft.forEach(function(ae) {
          Mt[++Pt] = [ae, ae];
        }), Mt;
      }
      function F0(ft, Pt, Mt) {
        for (var ae = Mt - 1, Me = ft.length; ++ae < Me; )
          if (ft[ae] === Pt)
            return ae;
        return -1;
      }
      function _r(ft, Pt, Mt) {
        for (var ae = Mt + 1; ae--; )
          if (ft[ae] === Pt)
            return ae;
        return ae;
      }
      function jr(ft) {
        return Is(ft) ? Cd(ft) : Gr(ft);
      }
      function vr(ft) {
        return Is(ft) ? zm(ft) : lv(ft);
      }
      function wl(ft) {
        for (var Pt = ft.length; Pt-- && us.test(ft.charAt(Pt)); )
          ;
        return Pt;
      }
      var xi = Ns(yu);
      function Cd(ft) {
        for (var Pt = Kf.lastIndex = 0; Kf.test(ft); )
          ++Pt;
        return Pt;
      }
      function zm(ft) {
        return ft.match(Kf) || [];
      }
      function $0(ft) {
        return ft.match(Zf) || [];
      }
      var Ps = function ft(Pt) {
        Pt = Pt == null ? ji : zs.defaults(ji.Object(), Pt, zs.pick(ji, Hc));
        var Mt = Pt.Array, ae = Pt.Date, Me = Pt.Error, wn = Pt.Function, Kn = Pt.Math, Xe = Pt.Object, Yc = Pt.RegExp, cv = Pt.String, kr = Pt.TypeError, Gm = Mt.prototype, X0 = wn.prototype, Rl = Xe.prototype, ah = Pt["__core-js_shared__"], rh = X0.toString, Nn = Rl.hasOwnProperty, Hr = 0, Um = function() {
          var g = /[^.]+$/.exec(ah && ah.keys && ah.keys.IE_PROTO || "");
          return g ? "Symbol(src)_1." + g : "";
        }(), sr = Rl.toString, hs = rh.call(Xe), Tu = ji._, Od = Yc(
          "^" + rh.call(Nn).replace(un, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
        ), Br = H0 ? Pt.Buffer : e, Aa = Pt.Symbol, zo = Pt.Uint8Array, Go = Br ? Br.allocUnsafe : e, Al = Y0(Xe.getPrototypeOf, Xe), Ml = Xe.create, wu = Rl.propertyIsEnumerable, jm = Gm.splice, Er = Aa ? Aa.isConcatSpreadable : e, Ru = Aa ? Aa.iterator : e, Va = Aa ? Aa.toStringTag : e, Fc = function() {
          try {
            var g = Bl(Xe, "defineProperty");
            return g({}, "", {}), g;
          } catch {
          }
        }(), en = Pt.clearTimeout !== ji.clearTimeout && Pt.clearTimeout, Xt = ae && ae.now !== ji.Date.now && ae.now, Au = Pt.setTimeout !== ji.setTimeout && Pt.setTimeout, Cl = Kn.ceil, Zn = Kn.floor, Uo = Xe.getOwnPropertySymbols, sh = Br ? Br.isBuffer : e, oh = Pt.isFinite, qr = Gm.join, Gs = Y0(Xe.keys, Xe), oi = Kn.max, fi = Kn.min, oo = ae.now, la = Pt.parseInt, zn = Kn.random, Dd = Gm.reverse, Ol = Bl(Pt, "DataView"), hi = Bl(Pt, "Map"), Bn = Bl(Pt, "Promise"), je = Bl(Pt, "Set"), ds = Bl(Pt, "WeakMap"), _a = Bl(Xe, "create"), Mu = ds && new ds(), or = {}, km = Fo(Ol), Nd = Fo(hi), lh = Fo(Bn), uh = Fo(je), K0 = Fo(ds), Dl = Aa ? Aa.prototype : e, Cu = Dl ? Dl.valueOf : e, jo = Dl ? Dl.toString : e;
        function V(g) {
          if (Vn(g) && !be(g) && !(g instanceof fn)) {
            if (g instanceof Sr)
              return g;
            if (Nn.call(g, "__wrapped__"))
              return na(g);
          }
          return new Sr(g);
        }
        var br = /* @__PURE__ */ function() {
          function g() {
          }
          return function(_) {
            if (!Pn(_))
              return {};
            if (Ml)
              return Ml(_);
            g.prototype = _;
            var R = new g();
            return g.prototype = e, R;
          };
        }();
        function gs() {
        }
        function Sr(g, _) {
          this.__wrapped__ = g, this.__actions__ = [], this.__chain__ = !!_, this.__index__ = 0, this.__values__ = e;
        }
        V.templateSettings = {
          /**
           * Used to detect `data` property values to be HTML-escaped.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          escape: Pe,
          /**
           * Used to detect code to be evaluated.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          evaluate: Ae,
          /**
           * Used to detect `data` property values to inject.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          interpolate: xn,
          /**
           * Used to reference the data object in the template text.
           *
           * @memberOf _.templateSettings
           * @type {string}
           */
          variable: "",
          /**
           * Used to import variables into the compiled template.
           *
           * @memberOf _.templateSettings
           * @type {Object}
           */
          imports: {
            /**
             * A reference to the `lodash` function.
             *
             * @memberOf _.templateSettings.imports
             * @type {Function}
             */
            _: V
          }
        }, V.prototype = gs.prototype, V.prototype.constructor = V, Sr.prototype = br(gs.prototype), Sr.prototype.constructor = Sr;
        function fn(g) {
          this.__wrapped__ = g, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = j, this.__views__ = [];
        }
        function Ld() {
          var g = new fn(this.__wrapped__);
          return g.__actions__ = li(this.__actions__), g.__dir__ = this.__dir__, g.__filtered__ = this.__filtered__, g.__iteratees__ = li(this.__iteratees__), g.__takeCount__ = this.__takeCount__, g.__views__ = li(this.__views__), g;
        }
        function Id() {
          if (this.__filtered__) {
            var g = new fn(this);
            g.__dir__ = -1, g.__filtered__ = !0;
          } else
            g = this.clone(), g.__dir__ *= -1;
          return g;
        }
        function Ou() {
          var g = this.__wrapped__.value(), _ = this.__dir__, R = be(g), D = _ < 0, G = R ? g.length : 0, $ = mv(0, G, this.__views__), tt = $.start, lt = $.end, _t = lt - tt, Ht = D ? lt : tt - 1, Yt = this.__iteratees__, Vt = Yt.length, re = 0, he = fi(_t, this.__takeCount__);
          if (!R || !D && G == _t && he == _t)
            return dv(g, this.__actions__);
          var De = [];
          t:
            for (; _t-- && re < he; ) {
              Ht += _;
              for (var We = -1, Ne = g[Ht]; ++We < Vt; ) {
                var rn = Yt[We], bn = rn.iteratee, $s = rn.type, ns = bn(Ne);
                if ($s == Ft)
                  Ne = ns;
                else if (!ns) {
                  if ($s == Ut)
                    continue t;
                  break t;
                }
              }
              De[re++] = Ne;
            }
          return De;
        }
        fn.prototype = br(gs.prototype), fn.prototype.constructor = fn;
        function Di(g) {
          var _ = -1, R = g == null ? 0 : g.length;
          for (this.clear(); ++_ < R; ) {
            var D = g[_];
            this.set(D[0], D[1]);
          }
        }
        function ch() {
          this.__data__ = _a ? _a(null) : {}, this.size = 0;
        }
        function Z0(g) {
          var _ = this.has(g) && delete this.__data__[g];
          return this.size -= _ ? 1 : 0, _;
        }
        function fv(g) {
          var _ = this.__data__;
          if (_a) {
            var R = _[g];
            return R === p ? e : R;
          }
          return Nn.call(_, g) ? _[g] : e;
        }
        function fh(g) {
          var _ = this.__data__;
          return _a ? _[g] !== e : Nn.call(_, g);
        }
        function Hm(g, _) {
          var R = this.__data__;
          return this.size += this.has(g) ? 0 : 1, R[g] = _a && _ === e ? p : _, this;
        }
        Di.prototype.clear = ch, Di.prototype.delete = Z0, Di.prototype.get = fv, Di.prototype.has = fh, Di.prototype.set = Hm;
        function ei(g) {
          var _ = -1, R = g == null ? 0 : g.length;
          for (this.clear(); ++_ < R; ) {
            var D = g[_];
            this.set(D[0], D[1]);
          }
        }
        function W0() {
          this.__data__ = [], this.size = 0;
        }
        function Du(g) {
          var _ = this.__data__, R = Xc(_, g);
          if (R < 0)
            return !1;
          var D = _.length - 1;
          return R == D ? _.pop() : jm.call(_, R, 1), --this.size, !0;
        }
        function ko(g) {
          var _ = this.__data__, R = Xc(_, g);
          return R < 0 ? e : _[R][1];
        }
        function hh(g) {
          return Xc(this.__data__, g) > -1;
        }
        function Nu(g, _) {
          var R = this.__data__, D = Xc(R, g);
          return D < 0 ? (++this.size, R.push([g, _])) : R[D][1] = _, this;
        }
        ei.prototype.clear = W0, ei.prototype.delete = Du, ei.prototype.get = ko, ei.prototype.has = hh, ei.prototype.set = Nu;
        function ua(g) {
          var _ = -1, R = g == null ? 0 : g.length;
          for (this.clear(); ++_ < R; ) {
            var D = g[_];
            this.set(D[0], D[1]);
          }
        }
        function Vr() {
          this.size = 0, this.__data__ = {
            hash: new Di(),
            map: new (hi || ei)(),
            string: new Di()
          };
        }
        function Pd(g) {
          var _ = rf(this, g).delete(g);
          return this.size -= _ ? 1 : 0, _;
        }
        function Q0(g) {
          return rf(this, g).get(g);
        }
        function J0(g) {
          return rf(this, g).has(g);
        }
        function Nl(g, _) {
          var R = rf(this, g), D = R.size;
          return R.set(g, _), this.size += R.size == D ? 0 : 1, this;
        }
        ua.prototype.clear = Vr, ua.prototype.delete = Pd, ua.prototype.get = Q0, ua.prototype.has = J0, ua.prototype.set = Nl;
        function Us(g) {
          var _ = -1, R = g == null ? 0 : g.length;
          for (this.__data__ = new ua(); ++_ < R; )
            this.add(g[_]);
        }
        function dh(g) {
          return this.__data__.set(g, p), this;
        }
        function zd(g) {
          return this.__data__.has(g);
        }
        Us.prototype.add = Us.prototype.push = dh, Us.prototype.has = zd;
        function Ya(g) {
          var _ = this.__data__ = new ei(g);
          this.size = _.size;
        }
        function Gd() {
          this.__data__ = new ei(), this.size = 0;
        }
        function gh(g) {
          var _ = this.__data__, R = _.delete(g);
          return this.size = _.size, R;
        }
        function Bm(g) {
          return this.__data__.get(g);
        }
        function ty(g) {
          return this.__data__.has(g);
        }
        function mh(g, _) {
          var R = this.__data__;
          if (R instanceof ei) {
            var D = R.__data__;
            if (!hi || D.length < s - 1)
              return D.push([g, _]), this.size = ++R.size, this;
            R = this.__data__ = new ua(D);
          }
          return R.set(g, _), this.size = R.size, this;
        }
        Ya.prototype.clear = Gd, Ya.prototype.delete = gh, Ya.prototype.get = Bm, Ya.prototype.has = ty, Ya.prototype.set = mh;
        function qm(g, _) {
          var R = be(g), D = !R && vo(g), G = !R && !D && ha(g), $ = !R && !D && !G && sc(g), tt = R || D || G || $, lt = tt ? Ur(g.length, cv) : [], _t = lt.length;
          for (var Ht in g)
            (_ || Nn.call(g, Ht)) && !(tt && // Safari 9 has enumerable `arguments.length` in strict mode.
            (Ht == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
            G && (Ht == "offset" || Ht == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
            $ && (Ht == "buffer" || Ht == "byteLength" || Ht == "byteOffset") || // Skip index properties.
            Hs(Ht, _t))) && lt.push(Ht);
          return lt;
        }
        function $c(g) {
          var _ = g.length;
          return _ ? g[$d(0, _ - 1)] : e;
        }
        function Vm(g, _) {
          return fg(li(g), uo(_, 0, g.length));
        }
        function ey(g) {
          return fg(li(g));
        }
        function lo(g, _, R) {
          (R !== e && !Za(g[_], R) || R === e && !(_ in g)) && ms(g, _, R);
        }
        function Ll(g, _, R) {
          var D = g[_];
          (!(Nn.call(g, _) && Za(D, R)) || R === e && !(_ in g)) && ms(g, _, R);
        }
        function Xc(g, _) {
          for (var R = g.length; R--; )
            if (Za(g[R][0], _))
              return R;
          return -1;
        }
        function Il(g, _, R, D) {
          return Bo(g, function(G, $, tt) {
            _(D, G, R(G), tt);
          }), D;
        }
        function xr(g, _) {
          return g && Rr(_, ga(_), g);
        }
        function Kc(g, _) {
          return g && Rr(_, xa(_), g);
        }
        function ms(g, _, R) {
          _ == "__proto__" && Fc ? Fc(g, _, {
            configurable: !0,
            enumerable: !0,
            value: R,
            writable: !0
          }) : g[_] = R;
        }
        function Ud(g, _) {
          for (var R = -1, D = _.length, G = Mt(D), $ = g == null; ++R < D; )
            G[R] = $ ? e : Dg(g, _[R]);
          return G;
        }
        function uo(g, _, R) {
          return g === g && (R !== e && (g = g <= R ? g : R), _ !== e && (g = g >= _ ? g : _)), g;
        }
        function Fa(g, _, R, D, G, $) {
          var tt, lt = _ & x, _t = _ & w, Ht = _ & A;
          if (R && (tt = G ? R(g, D, G, $) : R(g)), tt !== e)
            return tt;
          if (!Pn(g))
            return g;
          var Yt = be(g);
          if (Yt) {
            if (tt = my(g), !lt)
              return li(g, tt);
          } else {
            var Vt = Da(g), re = Vt == Mn || Vt == te;
            if (ha(g))
              return Wd(g, lt);
            if (Vt == Ge || Vt == Dt || re && !G) {
              if (tt = _t || re ? {} : qu(g), !lt)
                return _t ? eg(g, Kc(tt, g)) : tg(g, xr(tt, g));
            } else {
              if (!$e[Vt])
                return G ? g : {};
              tt = Ch(g, Vt, lt);
            }
          }
          $ || ($ = new Ya());
          var he = $.get(g);
          if (he)
            return he;
          $.set(g, tt), Op(g) ? g.forEach(function(Ne) {
            tt.add(Fa(Ne, _, R, Ne, g, $));
          }) : rc(g) && g.forEach(function(Ne, rn) {
            tt.set(rn, Fa(Ne, _, R, rn, g, $));
          });
          var De = Ht ? _t ? lp : ig : _t ? xa : ga, We = Yt ? e : De(g);
          return fs(We || g, function(Ne, rn) {
            We && (rn = Ne, Ne = g[rn]), Ll(tt, rn, Fa(Ne, _, R, rn, g, $));
          }), tt;
        }
        function ph(g) {
          var _ = ga(g);
          return function(R) {
            return jd(R, g, _);
          };
        }
        function jd(g, _, R) {
          var D = R.length;
          if (g == null)
            return !D;
          for (g = Xe(g); D--; ) {
            var G = R[D], $ = _[G], tt = g[G];
            if (tt === e && !(G in g) || !$(tt))
              return !1;
          }
          return !0;
        }
        function Ho(g, _, R) {
          if (typeof g != "function")
            throw new kr(f);
          return Nh(function() {
            g.apply(e, R);
          }, _);
        }
        function Pl(g, _, R, D) {
          var G = -1, $ = Po, tt = !0, lt = g.length, _t = [], Ht = _.length;
          if (!lt)
            return _t;
          R && (_ = Tn(_, ya(R))), D ? ($ = xl, tt = !1) : _.length >= s && ($ = Eu, tt = !1, _ = new Us(_));
          t:
            for (; ++G < lt; ) {
              var Yt = g[G], Vt = R == null ? Yt : R(Yt);
              if (Yt = D || Yt !== 0 ? Yt : 0, tt && Vt === Vt) {
                for (var re = Ht; re--; )
                  if (_[re] === Vt)
                    continue t;
                _t.push(Yt);
              } else $(_, Vt, D) || _t.push(Yt);
            }
          return _t;
        }
        var Bo = sp(Ni), ca = sp(Zc, !0);
        function yh(g, _) {
          var R = !0;
          return Bo(g, function(D, G, $) {
            return R = !!_(D, G, $), R;
          }), R;
        }
        function Yr(g, _, R) {
          for (var D = -1, G = g.length; ++D < G; ) {
            var $ = g[D], tt = _($);
            if (tt != null && (lt === e ? tt === tt && !Mr(tt) : R(tt, lt)))
              var lt = tt, _t = $;
          }
          return _t;
        }
        function qe(g, _, R, D) {
          var G = g.length;
          for (R = _e(R), R < 0 && (R = -R > G ? 0 : G + R), D = D === e || D > G ? G : _e(D), D < 0 && (D += G), D = R > D ? 0 : Zo(D); R < D; )
            g[R++] = _;
          return g;
        }
        function Ln(g, _) {
          var R = [];
          return Bo(g, function(D, G, $) {
            _(D, G, $) && R.push(D);
          }), R;
        }
        function hn(g, _, R, D, G) {
          var $ = -1, tt = g.length;
          for (R || (R = go), G || (G = []); ++$ < tt; ) {
            var lt = g[$];
            _ > 0 && R(lt) ? _ > 1 ? hn(lt, _ - 1, R, D, G) : Ji(G, lt) : D || (G[G.length] = lt);
          }
          return G;
        }
        var zl = Ea(), Lu = Ea(!0);
        function Ni(g, _) {
          return g && zl(g, _, ga);
        }
        function Zc(g, _) {
          return g && Lu(g, _, ga);
        }
        function Tr(g, _) {
          return ao(_, function(R) {
            return Eo(g[R]);
          });
        }
        function fa(g, _) {
          _ = Ca(_, g);
          for (var R = 0, D = _.length; g != null && R < D; )
            g = g[Gn(_[R++])];
          return R && R == D ? g : e;
        }
        function kd(g, _, R) {
          var D = _(g);
          return be(g) ? D : Ji(D, R(g));
        }
        function yn(g) {
          return g == null ? g === e ? nr : Pi : Va && Va in Xe(g) ? up(g) : yv(g);
        }
        function Wc(g, _) {
          return g > _;
        }
        function Ym(g, _) {
          return g != null && Nn.call(g, _);
        }
        function ny(g, _) {
          return g != null && _ in Xe(g);
        }
        function Iu(g, _, R) {
          return g >= fi(_, R) && g < oi(_, R);
        }
        function Fm(g, _, R) {
          for (var D = R ? xl : Po, G = g[0].length, $ = g.length, tt = $, lt = Mt($), _t = 1 / 0, Ht = []; tt--; ) {
            var Yt = g[tt];
            tt && _ && (Yt = Tn(Yt, ya(_))), _t = fi(Yt.length, _t), lt[tt] = !R && (_ || G >= 120 && Yt.length >= 120) ? new Us(tt && Yt) : e;
          }
          Yt = g[0];
          var Vt = -1, re = lt[0];
          t:
            for (; ++Vt < G && Ht.length < _t; ) {
              var he = Yt[Vt], De = _ ? _(he) : he;
              if (he = R || he !== 0 ? he : 0, !(re ? Eu(re, De) : D(Ht, De, R))) {
                for (tt = $; --tt; ) {
                  var We = lt[tt];
                  if (!(We ? Eu(We, De) : D(g[tt], De, R)))
                    continue t;
                }
                re && re.push(De), Ht.push(he);
              }
            }
          return Ht;
        }
        function $m(g, _, R, D) {
          return Ni(g, function(G, $, tt) {
            _(D, R(G), $, tt);
          }), D;
        }
        function Pu(g, _, R) {
          _ = Ca(_, g), g = of(g, _);
          var D = g == null ? g : g[Gn(Ve(_))];
          return D == null ? e : yr(D, g, R);
        }
        function Qc(g) {
          return Vn(g) && yn(g) == Dt;
        }
        function wr(g) {
          return Vn(g) && yn(g) == ti;
        }
        function ki(g) {
          return Vn(g) && yn(g) == ee;
        }
        function Gl(g, _, R, D, G) {
          return g === _ ? !0 : g == null || _ == null || !Vn(g) && !Vn(_) ? g !== g && _ !== _ : Jc(g, _, R, D, Gl, G);
        }
        function Jc(g, _, R, D, G, $) {
          var tt = be(g), lt = be(_), _t = tt ? It : Da(g), Ht = lt ? It : Da(_);
          _t = _t == Dt ? Ge : _t, Ht = Ht == Dt ? Ge : Ht;
          var Yt = _t == Ge, Vt = Ht == Ge, re = _t == Ht;
          if (re && ha(g)) {
            if (!ha(_))
              return !1;
            tt = !0, Yt = !1;
          }
          if (re && !Yt)
            return $ || ($ = new Ya()), tt || sc(g) ? Xr(g, _, R, D, G, $) : gy(g, _, _t, R, D, G, $);
          if (!(R & C)) {
            var he = Yt && Nn.call(g, "__wrapped__"), De = Vt && Nn.call(_, "__wrapped__");
            if (he || De) {
              var We = he ? g.value() : g, Ne = De ? _.value() : _;
              return $ || ($ = new Ya()), G(We, Ne, R, D, $);
            }
          }
          return re ? ($ || ($ = new Ya()), gn(g, _, R, D, G, $)) : !1;
        }
        function Xm(g) {
          return Vn(g) && Da(g) == tn;
        }
        function ta(g, _, R, D) {
          var G = R.length, $ = G, tt = !D;
          if (g == null)
            return !$;
          for (g = Xe(g); G--; ) {
            var lt = R[G];
            if (tt && lt[2] ? lt[1] !== g[lt[0]] : !(lt[0] in g))
              return !1;
          }
          for (; ++G < $; ) {
            lt = R[G];
            var _t = lt[0], Ht = g[_t], Yt = lt[1];
            if (tt && lt[2]) {
              if (Ht === e && !(_t in g))
                return !1;
            } else {
              var Vt = new Ya();
              if (D)
                var re = D(Ht, Yt, _t, g, _, Vt);
              if (!(re === e ? Gl(Yt, Ht, C | L, D, Vt) : re))
                return !1;
            }
          }
          return !0;
        }
        function co(g) {
          if (!Pn(g) || Vu(g))
            return !1;
          var _ = Eo(g) ? Od : z0;
          return _.test(Fo(g));
        }
        function Hd(g) {
          return Vn(g) && yn(g) == Ai;
        }
        function Km(g) {
          return Vn(g) && Da(g) == fe;
        }
        function Zm(g) {
          return Vn(g) && tu(g.length) && !!Xn[yn(g)];
        }
        function Wm(g) {
          return typeof g == "function" ? g : g == null ? bt : typeof g == "object" ? be(g) ? _h(g[0], g[1]) : tp(g) : Cn(g);
        }
        function tf(g) {
          if (!ni(g))
            return Gs(g);
          var _ = [];
          for (var R in Xe(g))
            Nn.call(g, R) && R != "constructor" && _.push(R);
          return _;
        }
        function Qm(g) {
          if (!Pn(g))
            return Yu(g);
          var _ = ni(g), R = [];
          for (var D in g)
            D == "constructor" && (_ || !Nn.call(g, D)) || R.push(D);
          return R;
        }
        function Bd(g, _) {
          return g < _;
        }
        function Jm(g, _) {
          var R = -1, D = ia(g) ? Mt(g.length) : [];
          return Bo(g, function(G, $, tt) {
            D[++R] = _(G, $, tt);
          }), D;
        }
        function tp(g) {
          var _ = ag(g);
          return _.length == 1 && _[0][2] ? fp(_[0][0], _[0][1]) : function(R) {
            return R === g || ta(R, g, _);
          };
        }
        function _h(g, _) {
          return sg(g) && Wn(_) ? fp(Gn(g), _) : function(R) {
            var D = Dg(R, g);
            return D === e && D === _ ? vf(R, g) : Gl(_, D, C | L);
          };
        }
        function ef(g, _, R, D, G) {
          g !== _ && zl(_, function($, tt) {
            if (G || (G = new Ya()), Pn($))
              iy(g, _, tt, R, ef, D, G);
            else {
              var lt = D ? D(ug(g, tt), $, tt + "", g, _, G) : e;
              lt === e && (lt = $), lo(g, tt, lt);
            }
          }, xa);
        }
        function iy(g, _, R, D, G, $, tt) {
          var lt = ug(g, R), _t = ug(_, R), Ht = tt.get(_t);
          if (Ht) {
            lo(g, R, Ht);
            return;
          }
          var Yt = $ ? $(lt, _t, R + "", g, _, tt) : e, Vt = Yt === e;
          if (Vt) {
            var re = be(_t), he = !re && ha(_t), De = !re && !he && sc(_t);
            Yt = _t, re || he || De ? be(lt) ? Yt = lt : Ci(lt) ? Yt = li(lt) : he ? (Vt = !1, Yt = Wd(_t, !0)) : De ? (Vt = !1, Yt = oy(_t, !0)) : Yt = [] : aa(_t) || vo(_t) ? (Yt = lt, vo(lt) ? Yt = Mg(lt) : (!Pn(lt) || Eo(lt)) && (Yt = qu(_t))) : Vt = !1;
          }
          Vt && (tt.set(_t, Yt), G(Yt, _t, D, $, tt), tt.delete(_t)), lo(g, R, Yt);
        }
        function ep(g, _) {
          var R = g.length;
          if (R)
            return _ += _ < 0 ? R : 0, Hs(_, R) ? g[_] : e;
        }
        function qd(g, _, R) {
          _.length ? _ = Tn(_, function($) {
            return be($) ? function(tt) {
              return fa(tt, $.length === 1 ? $[0] : $);
            } : $;
          }) : _ = [bt];
          var D = -1;
          _ = Tn(_, ya(ye()));
          var G = Jm(g, function($, tt, lt) {
            var _t = Tn(_, function(Ht) {
              return Ht($);
            });
            return { criteria: _t, index: ++D, value: $ };
          });
          return Lm(G, function($, tt) {
            return gv($, tt, R);
          });
        }
        function Vd(g, _) {
          return vh(g, _, function(R, D) {
            return vf(g, D);
          });
        }
        function vh(g, _, R) {
          for (var D = -1, G = _.length, $ = {}; ++D < G; ) {
            var tt = _[D], lt = fa(g, tt);
            R(lt, tt) && nf($, Ca(tt, g), lt);
          }
          return $;
        }
        function ay(g) {
          return function(_) {
            return fa(_, g);
          };
        }
        function Yd(g, _, R, D) {
          var G = D ? Dm : Bc, $ = -1, tt = _.length, lt = g;
          for (g === _ && (_ = li(_)), R && (lt = Tn(g, ya(R))); ++$ < tt; )
            for (var _t = 0, Ht = _[$], Yt = R ? R(Ht) : Ht; (_t = G(lt, Yt, _t, D)) > -1; )
              lt !== g && jm.call(lt, _t, 1), jm.call(g, _t, 1);
          return g;
        }
        function Fd(g, _) {
          for (var R = g ? _.length : 0, D = R - 1; R--; ) {
            var G = _[R];
            if (R == D || G !== $) {
              var $ = G;
              Hs(G) ? jm.call(g, G, 1) : Sh(g, G);
            }
          }
          return g;
        }
        function $d(g, _) {
          return g + Zn(zn() * (_ - g + 1));
        }
        function qo(g, _, R, D) {
          for (var G = -1, $ = oi(Cl((_ - g) / (R || 1)), 0), tt = Mt($); $--; )
            tt[D ? $ : ++G] = g, g += R;
          return tt;
        }
        function Xd(g, _) {
          var R = "";
          if (!g || _ < 1 || _ > gt)
            return R;
          do
            _ % 2 && (R += g), _ = Zn(_ / 2), _ && (g += g);
          while (_);
          return R;
        }
        function an(g, _) {
          return cg(lg(g, _, bt), g + "");
        }
        function zu(g) {
          return $c(bf(g));
        }
        function js(g, _) {
          var R = bf(g);
          return fg(R, uo(_, 0, R.length));
        }
        function nf(g, _, R, D) {
          if (!Pn(g))
            return g;
          _ = Ca(_, g);
          for (var G = -1, $ = _.length, tt = $ - 1, lt = g; lt != null && ++G < $; ) {
            var _t = Gn(_[G]), Ht = R;
            if (_t === "__proto__" || _t === "constructor" || _t === "prototype")
              return g;
            if (G != tt) {
              var Yt = lt[_t];
              Ht = D ? D(Yt, _t, lt) : e, Ht === e && (Ht = Pn(Yt) ? Yt : Hs(_[G + 1]) ? [] : {});
            }
            Ll(lt, _t, Ht), lt = lt[_t];
          }
          return g;
        }
        var Gu = Mu ? function(g, _) {
          return Mu.set(g, _), g;
        } : bt, Ul = Fc ? function(g, _) {
          return Fc(g, "toString", {
            configurable: !0,
            enumerable: !1,
            value: vt(_),
            writable: !0
          });
        } : bt;
        function Ti(g) {
          return fg(bf(g));
        }
        function ps(g, _, R) {
          var D = -1, G = g.length;
          _ < 0 && (_ = -_ > G ? 0 : G + _), R = R > G ? G : R, R < 0 && (R += G), G = _ > R ? 0 : R - _ >>> 0, _ >>>= 0;
          for (var $ = Mt(G); ++D < G; )
            $[D] = g[D + _];
          return $;
        }
        function hv(g, _) {
          var R;
          return Bo(g, function(D, G, $) {
            return R = _(D, G, $), !R;
          }), !!R;
        }
        function Eh(g, _, R) {
          var D = 0, G = g == null ? D : g.length;
          if (typeof _ == "number" && _ === _ && G <= st) {
            for (; D < G; ) {
              var $ = D + G >>> 1, tt = g[$];
              tt !== null && !Mr(tt) && (R ? tt <= _ : tt < _) ? D = $ + 1 : G = $;
            }
            return G;
          }
          return ys(g, _, bt, R);
        }
        function ys(g, _, R, D) {
          var G = 0, $ = g == null ? 0 : g.length;
          if ($ === 0)
            return 0;
          _ = R(_);
          for (var tt = _ !== _, lt = _ === null, _t = Mr(_), Ht = _ === e; G < $; ) {
            var Yt = Zn((G + $) / 2), Vt = R(g[Yt]), re = Vt !== e, he = Vt === null, De = Vt === Vt, We = Mr(Vt);
            if (tt)
              var Ne = D || De;
            else Ht ? Ne = De && (D || re) : lt ? Ne = De && re && (D || !he) : _t ? Ne = De && re && !he && (D || !We) : he || We ? Ne = !1 : Ne = D ? Vt <= _ : Vt < _;
            Ne ? G = Yt + 1 : $ = Yt;
          }
          return fi($, X);
        }
        function np(g, _) {
          for (var R = -1, D = g.length, G = 0, $ = []; ++R < D; ) {
            var tt = g[R], lt = _ ? _(tt) : tt;
            if (!R || !Za(lt, _t)) {
              var _t = lt;
              $[G++] = tt === 0 ? 0 : tt;
            }
          }
          return $;
        }
        function bh(g) {
          return typeof g == "number" ? g : Mr(g) ? W : +g;
        }
        function Ma(g) {
          if (typeof g == "string")
            return g;
          if (be(g))
            return Tn(g, Ma) + "";
          if (Mr(g))
            return jo ? jo.call(g) : "";
          var _ = g + "";
          return _ == "0" && 1 / g == -J ? "-0" : _;
        }
        function Fr(g, _, R) {
          var D = -1, G = Po, $ = g.length, tt = !0, lt = [], _t = lt;
          if (R)
            tt = !1, G = xl;
          else if ($ >= s) {
            var Ht = _ ? null : fy(g);
            if (Ht)
              return so(Ht);
            tt = !1, G = Eu, _t = new Us();
          } else
            _t = _ ? [] : lt;
          t:
            for (; ++D < $; ) {
              var Yt = g[D], Vt = _ ? _(Yt) : Yt;
              if (Yt = R || Yt !== 0 ? Yt : 0, tt && Vt === Vt) {
                for (var re = _t.length; re--; )
                  if (_t[re] === Vt)
                    continue t;
                _ && _t.push(Vt), lt.push(Yt);
              } else G(_t, Vt, R) || (_t !== lt && _t.push(Vt), lt.push(Yt));
            }
          return lt;
        }
        function Sh(g, _) {
          return _ = Ca(_, g), g = of(g, _), g == null || delete g[Gn(Ve(_))];
        }
        function Kd(g, _, R, D) {
          return nf(g, _, R(fa(g, _)), D);
        }
        function xh(g, _, R, D) {
          for (var G = g.length, $ = D ? G : -1; (D ? $-- : ++$ < G) && _(g[$], $, g); )
            ;
          return R ? ps(g, D ? 0 : $, D ? $ + 1 : G) : ps(g, D ? $ + 1 : 0, D ? G : $);
        }
        function dv(g, _) {
          var R = g;
          return R instanceof fn && (R = R.value()), Jf(_, function(D, G) {
            return G.func.apply(G.thisArg, Ji([D], G.args));
          }, R);
        }
        function Zd(g, _, R) {
          var D = g.length;
          if (D < 2)
            return D ? Fr(g[0]) : [];
          for (var G = -1, $ = Mt(D); ++G < D; )
            for (var tt = g[G], lt = -1; ++lt < D; )
              lt != G && ($[G] = Pl($[G] || tt, g[lt], _, R));
          return Fr(hn($, 1), _, R);
        }
        function ip(g, _, R) {
          for (var D = -1, G = g.length, $ = _.length, tt = {}; ++D < G; ) {
            var lt = D < $ ? _[D] : e;
            R(tt, g[D], lt);
          }
          return tt;
        }
        function ap(g) {
          return Ci(g) ? g : [];
        }
        function jl(g) {
          return typeof g == "function" ? g : bt;
        }
        function Ca(g, _) {
          return be(g) ? g : sg(g, _) ? [g] : Bs(Ze(g));
        }
        var ry = an;
        function Uu(g, _, R) {
          var D = g.length;
          return R = R === e ? D : R, !_ && R >= D ? g : ps(g, _, R);
        }
        var sy = en || function(g) {
          return ji.clearTimeout(g);
        };
        function Wd(g, _) {
          if (_)
            return g.slice();
          var R = g.length, D = Go ? Go(R) : new g.constructor(R);
          return g.copy(D), D;
        }
        function ju(g) {
          var _ = new g.constructor(g.byteLength);
          return new zo(_).set(new zo(g)), _;
        }
        function Qd(g, _) {
          var R = _ ? ju(g.buffer) : g.buffer;
          return new g.constructor(R, g.byteOffset, g.byteLength);
        }
        function Th(g) {
          var _ = new g.constructor(g.source, Nc.exec(g));
          return _.lastIndex = g.lastIndex, _;
        }
        function Jd(g) {
          return Cu ? Xe(Cu.call(g)) : {};
        }
        function oy(g, _) {
          var R = _ ? ju(g.buffer) : g.buffer;
          return new g.constructor(R, g.byteOffset, g.length);
        }
        function wh(g, _) {
          if (g !== _) {
            var R = g !== e, D = g === null, G = g === g, $ = Mr(g), tt = _ !== e, lt = _ === null, _t = _ === _, Ht = Mr(_);
            if (!lt && !Ht && !$ && g > _ || $ && tt && _t && !lt && !Ht || D && tt && _t || !R && _t || !G)
              return 1;
            if (!D && !$ && !Ht && g < _ || Ht && R && G && !D && !$ || lt && R && G || !tt && G || !_t)
              return -1;
          }
          return 0;
        }
        function gv(g, _, R) {
          for (var D = -1, G = g.criteria, $ = _.criteria, tt = G.length, lt = R.length; ++D < tt; ) {
            var _t = wh(G[D], $[D]);
            if (_t) {
              if (D >= lt)
                return _t;
              var Ht = R[D];
              return _t * (Ht == "desc" ? -1 : 1);
            }
          }
          return g.index - _.index;
        }
        function rp(g, _, R, D) {
          for (var G = -1, $ = g.length, tt = R.length, lt = -1, _t = _.length, Ht = oi($ - tt, 0), Yt = Mt(_t + Ht), Vt = !D; ++lt < _t; )
            Yt[lt] = _[lt];
          for (; ++G < tt; )
            (Vt || G < $) && (Yt[R[G]] = g[G]);
          for (; Ht--; )
            Yt[lt++] = g[G++];
          return Yt;
        }
        function ly(g, _, R, D) {
          for (var G = -1, $ = g.length, tt = -1, lt = R.length, _t = -1, Ht = _.length, Yt = oi($ - lt, 0), Vt = Mt(Yt + Ht), re = !D; ++G < Yt; )
            Vt[G] = g[G];
          for (var he = G; ++_t < Ht; )
            Vt[he + _t] = _[_t];
          for (; ++tt < lt; )
            (re || G < $) && (Vt[he + R[tt]] = g[G++]);
          return Vt;
        }
        function li(g, _) {
          var R = -1, D = g.length;
          for (_ || (_ = Mt(D)); ++R < D; )
            _[R] = g[R];
          return _;
        }
        function Rr(g, _, R, D) {
          var G = !R;
          R || (R = {});
          for (var $ = -1, tt = _.length; ++$ < tt; ) {
            var lt = _[$], _t = D ? D(R[lt], g[lt], lt, R, g) : e;
            _t === e && (_t = g[lt]), G ? ms(R, lt, _t) : Ll(R, lt, _t);
          }
          return R;
        }
        function tg(g, _) {
          return Rr(g, sf(g), _);
        }
        function eg(g, _) {
          return Rr(g, rg(g), _);
        }
        function kl(g, _) {
          return function(R, D) {
            var G = be(R) ? sv : Il, $ = _ ? _() : {};
            return G(R, g, ye(D, 2), $);
          };
        }
        function va(g) {
          return an(function(_, R) {
            var D = -1, G = R.length, $ = G > 1 ? R[G - 1] : e, tt = G > 2 ? R[2] : e;
            for ($ = g.length > 3 && typeof $ == "function" ? (G--, $) : e, tt && ur(R[0], R[1], tt) && ($ = G < 3 ? e : $, G = 1), _ = Xe(_); ++D < G; ) {
              var lt = R[D];
              lt && g(_, lt, D, $);
            }
            return _;
          });
        }
        function sp(g, _) {
          return function(R, D) {
            if (R == null)
              return R;
            if (!ia(R))
              return g(R, D);
            for (var G = R.length, $ = _ ? G : -1, tt = Xe(R); (_ ? $-- : ++$ < G) && D(tt[$], $, tt) !== !1; )
              ;
            return R;
          };
        }
        function Ea(g) {
          return function(_, R, D) {
            for (var G = -1, $ = Xe(_), tt = D(_), lt = tt.length; lt--; ) {
              var _t = tt[g ? lt : ++G];
              if (R($[_t], _t, $) === !1)
                break;
            }
            return _;
          };
        }
        function uy(g, _, R) {
          var D = _ & N, G = Oa(g);
          function $() {
            var tt = this && this !== ji && this instanceof $ ? G : g;
            return tt.apply(D ? R : this, arguments);
          }
          return $;
        }
        function ea(g) {
          return function(_) {
            _ = Ze(_);
            var R = Is(_) ? vr(_) : e, D = R ? R[0] : _.charAt(0), G = R ? Uu(R, 1).join("") : _.slice(1);
            return D[g]() + G;
          };
        }
        function lr(g) {
          return function(_) {
            return Jf(T(Fs(_).replace(Sl, "")), g, "");
          };
        }
        function Oa(g) {
          return function() {
            var _ = arguments;
            switch (_.length) {
              case 0:
                return new g();
              case 1:
                return new g(_[0]);
              case 2:
                return new g(_[0], _[1]);
              case 3:
                return new g(_[0], _[1], _[2]);
              case 4:
                return new g(_[0], _[1], _[2], _[3]);
              case 5:
                return new g(_[0], _[1], _[2], _[3], _[4]);
              case 6:
                return new g(_[0], _[1], _[2], _[3], _[4], _[5]);
              case 7:
                return new g(_[0], _[1], _[2], _[3], _[4], _[5], _[6]);
            }
            var R = br(g.prototype), D = g.apply(R, _);
            return Pn(D) ? D : R;
          };
        }
        function cy(g, _, R) {
          var D = Oa(g);
          function G() {
            for (var $ = arguments.length, tt = Mt($), lt = $, _t = Hl(G); lt--; )
              tt[lt] = arguments[lt];
            var Ht = $ < 3 && tt[0] !== _t && tt[$ - 1] !== _t ? [] : ro(tt, _t);
            if ($ -= Ht.length, $ < R)
              return op(
                g,
                _,
                Mi,
                G.placeholder,
                e,
                tt,
                Ht,
                e,
                e,
                R - $
              );
            var Yt = this && this !== ji && this instanceof G ? D : g;
            return yr(Yt, this, tt);
          }
          return G;
        }
        function $a(g) {
          return function(_, R, D) {
            var G = Xe(_);
            if (!ia(_)) {
              var $ = ye(R, 3);
              _ = ga(_), R = function(lt) {
                return $(G[lt], lt, G);
              };
            }
            var tt = g(_, R, D);
            return tt > -1 ? G[$ ? _[tt] : tt] : e;
          };
        }
        function ks(g) {
          return di(function(_) {
            var R = _.length, D = R, G = Sr.prototype.thru;
            for (g && _.reverse(); D--; ) {
              var $ = _[D];
              if (typeof $ != "function")
                throw new kr(f);
              if (G && !tt && Yo($) == "wrapper")
                var tt = new Sr([], !0);
            }
            for (D = tt ? D : R; ++D < R; ) {
              $ = _[D];
              var lt = Yo($), _t = lt == "wrapper" ? ho($) : e;
              _t && og(_t[0]) && _t[1] == (et | H | z | ot) && !_t[4].length && _t[9] == 1 ? tt = tt[Yo(_t[0])].apply(tt, _t[3]) : tt = $.length == 1 && og($) ? tt[lt]() : tt.thru($);
            }
            return function() {
              var Ht = arguments, Yt = Ht[0];
              if (tt && Ht.length == 1 && be(Yt))
                return tt.plant(Yt).value();
              for (var Vt = 0, re = R ? _[Vt].apply(this, Ht) : Yt; ++Vt < R; )
                re = _[Vt].call(this, re);
              return re;
            };
          });
        }
        function Mi(g, _, R, D, G, $, tt, lt, _t, Ht) {
          var Yt = _ & et, Vt = _ & N, re = _ & U, he = _ & (H | B), De = _ & pt, We = re ? e : Oa(g);
          function Ne() {
            for (var rn = arguments.length, bn = Mt(rn), $s = rn; $s--; )
              bn[$s] = arguments[$s];
            if (he)
              var ns = Hl(Ne), Xs = Vc(bn, ns);
            if (D && (bn = rp(bn, D, G, he)), $ && (bn = ly(bn, $, tt, he)), rn -= Xs, he && rn < Ht) {
              var ma = ro(bn, ns);
              return op(
                g,
                _,
                Mi,
                Ne.placeholder,
                R,
                bn,
                ma,
                lt,
                _t,
                Ht - rn
              );
            }
            var ru = Vt ? R : this, Sf = re ? ru[g] : g;
            return rn = bn.length, lt ? bn = mo(bn, lt) : De && rn > 1 && bn.reverse(), Yt && _t < rn && (bn.length = _t), this && this !== ji && this instanceof Ne && (Sf = We || Oa(Sf)), Sf.apply(ru, bn);
          }
          return Ne;
        }
        function $r(g, _) {
          return function(R, D) {
            return $m(R, g, _(D), {});
          };
        }
        function af(g, _) {
          return function(R, D) {
            var G;
            if (R === e && D === e)
              return _;
            if (R !== e && (G = R), D !== e) {
              if (G === e)
                return D;
              typeof R == "string" || typeof D == "string" ? (R = Ma(R), D = Ma(D)) : (R = bh(R), D = bh(D)), G = g(R, D);
            }
            return G;
          };
        }
        function Vo(g) {
          return di(function(_) {
            return _ = Tn(_, ya(ye())), an(function(R) {
              var D = this;
              return g(_, function(G) {
                return yr(G, D, R);
              });
            });
          });
        }
        function Rh(g, _) {
          _ = _ === e ? " " : Ma(_);
          var R = _.length;
          if (R < 2)
            return R ? Xd(_, g) : _;
          var D = Xd(_, Cl(g / jr(_)));
          return Is(_) ? Uu(vr(D), 0, g).join("") : D.slice(0, g);
        }
        function Ah(g, _, R, D) {
          var G = _ & N, $ = Oa(g);
          function tt() {
            for (var lt = -1, _t = arguments.length, Ht = -1, Yt = D.length, Vt = Mt(Yt + _t), re = this && this !== ji && this instanceof tt ? $ : g; ++Ht < Yt; )
              Vt[Ht] = D[Ht];
            for (; _t--; )
              Vt[Ht++] = arguments[++lt];
            return yr(re, G ? R : this, Vt);
          }
          return tt;
        }
        function _s(g) {
          return function(_, R, D) {
            return D && typeof D != "number" && ur(_, R, D) && (R = D = e), _ = da(_), R === e ? (R = _, _ = 0) : R = da(R), D = D === e ? _ < R ? 1 : -1 : da(D), qo(_, R, D, g);
          };
        }
        function ku(g) {
          return function(_, R) {
            return typeof _ == "string" && typeof R == "string" || (_ = Ys(_), R = Ys(R)), g(_, R);
          };
        }
        function op(g, _, R, D, G, $, tt, lt, _t, Ht) {
          var Yt = _ & H, Vt = Yt ? tt : e, re = Yt ? e : tt, he = Yt ? $ : e, De = Yt ? e : $;
          _ |= Yt ? z : Q, _ &= ~(Yt ? Q : z), _ & k || (_ &= -4);
          var We = [
            g,
            _,
            G,
            he,
            Vt,
            De,
            re,
            lt,
            _t,
            Ht
          ], Ne = R.apply(e, We);
          return og(g) && Fu(Ne, We), Ne.placeholder = D, vs(Ne, g, _);
        }
        function Hu(g) {
          var _ = Kn[g];
          return function(R, D) {
            if (R = Ys(R), D = D == null ? 0 : fi(_e(D), 292), D && oh(R)) {
              var G = (Ze(R) + "e").split("e"), $ = _(G[0] + "e" + (+G[1] + D));
              return G = (Ze($) + "e").split("e"), +(G[0] + "e" + (+G[1] - D));
            }
            return _(R);
          };
        }
        var fy = je && 1 / so(new je([, -0]))[1] == J ? function(g) {
          return new je(g);
        } : le;
        function Bu(g) {
          return function(_) {
            var R = Da(_);
            return R == tn ? xu(_) : R == fe ? Tl(_) : B0(_, g(_));
          };
        }
        function fo(g, _, R, D, G, $, tt, lt) {
          var _t = _ & U;
          if (!_t && typeof g != "function")
            throw new kr(f);
          var Ht = D ? D.length : 0;
          if (Ht || (_ &= -97, D = G = e), tt = tt === e ? tt : oi(_e(tt), 0), lt = lt === e ? lt : _e(lt), Ht -= G ? G.length : 0, _ & Q) {
            var Yt = D, Vt = G;
            D = G = e;
          }
          var re = _t ? e : ho(g), he = [
            g,
            _,
            R,
            D,
            G,
            Yt,
            Vt,
            $,
            tt,
            lt
          ];
          if (re && Dh(he, re), g = he[0], _ = he[1], R = he[2], D = he[3], G = he[4], lt = he[9] = he[9] === e ? _t ? 0 : g.length : oi(he[9] - Ht, 0), !lt && _ & (H | B) && (_ &= -25), !_ || _ == N)
            var De = uy(g, _, R);
          else _ == H || _ == B ? De = cy(g, _, lt) : (_ == z || _ == (N | z)) && !G.length ? De = Ah(g, _, R, D) : De = Mi.apply(e, he);
          var We = re ? Gu : Fu;
          return vs(We(De, he), g, _);
        }
        function ng(g, _, R, D) {
          return g === e || Za(g, Rl[R]) && !Nn.call(D, R) ? _ : g;
        }
        function hy(g, _, R, D, G, $) {
          return Pn(g) && Pn(_) && ($.set(_, g), ef(g, _, e, hy, $), $.delete(_)), g;
        }
        function dy(g) {
          return aa(g) ? e : g;
        }
        function Xr(g, _, R, D, G, $) {
          var tt = R & C, lt = g.length, _t = _.length;
          if (lt != _t && !(tt && _t > lt))
            return !1;
          var Ht = $.get(g), Yt = $.get(_);
          if (Ht && Yt)
            return Ht == _ && Yt == g;
          var Vt = -1, re = !0, he = R & L ? new Us() : e;
          for ($.set(g, _), $.set(_, g); ++Vt < lt; ) {
            var De = g[Vt], We = _[Vt];
            if (D)
              var Ne = tt ? D(We, De, Vt, _, g, $) : D(De, We, Vt, g, _, $);
            if (Ne !== e) {
              if (Ne)
                continue;
              re = !1;
              break;
            }
            if (he) {
              if (!Ad(_, function(rn, bn) {
                if (!Eu(he, bn) && (De === rn || G(De, rn, R, D, $)))
                  return he.push(bn);
              })) {
                re = !1;
                break;
              }
            } else if (!(De === We || G(De, We, R, D, $))) {
              re = !1;
              break;
            }
          }
          return $.delete(g), $.delete(_), re;
        }
        function gy(g, _, R, D, G, $, tt) {
          switch (R) {
            case zi:
              if (g.byteLength != _.byteLength || g.byteOffset != _.byteOffset)
                return !1;
              g = g.buffer, _ = _.buffer;
            case ti:
              return !(g.byteLength != _.byteLength || !$(new zo(g), new zo(_)));
            case Qt:
            case ee:
            case Jn:
              return Za(+g, +_);
            case pe:
              return g.name == _.name && g.message == _.message;
            case Ai:
            case Zi:
              return g == _ + "";
            case tn:
              var lt = xu;
            case fe:
              var _t = D & C;
              if (lt || (lt = so), g.size != _.size && !_t)
                return !1;
              var Ht = tt.get(g);
              if (Ht)
                return Ht == _;
              D |= L, tt.set(g, _);
              var Yt = Xr(lt(g), lt(_), D, G, $, tt);
              return tt.delete(g), Yt;
            case Dn:
              if (Cu)
                return Cu.call(g) == Cu.call(_);
          }
          return !1;
        }
        function gn(g, _, R, D, G, $) {
          var tt = R & C, lt = ig(g), _t = lt.length, Ht = ig(_), Yt = Ht.length;
          if (_t != Yt && !tt)
            return !1;
          for (var Vt = _t; Vt--; ) {
            var re = lt[Vt];
            if (!(tt ? re in _ : Nn.call(_, re)))
              return !1;
          }
          var he = $.get(g), De = $.get(_);
          if (he && De)
            return he == _ && De == g;
          var We = !0;
          $.set(g, _), $.set(_, g);
          for (var Ne = tt; ++Vt < _t; ) {
            re = lt[Vt];
            var rn = g[re], bn = _[re];
            if (D)
              var $s = tt ? D(bn, rn, re, _, g, $) : D(rn, bn, re, g, _, $);
            if (!($s === e ? rn === bn || G(rn, bn, R, D, $) : $s)) {
              We = !1;
              break;
            }
            Ne || (Ne = re == "constructor");
          }
          if (We && !Ne) {
            var ns = g.constructor, Xs = _.constructor;
            ns != Xs && "constructor" in g && "constructor" in _ && !(typeof ns == "function" && ns instanceof ns && typeof Xs == "function" && Xs instanceof Xs) && (We = !1);
          }
          return $.delete(g), $.delete(_), We;
        }
        function di(g) {
          return cg(lg(g, e, Xa), g + "");
        }
        function ig(g) {
          return kd(g, ga, sf);
        }
        function lp(g) {
          return kd(g, xa, rg);
        }
        var ho = Mu ? function(g) {
          return Mu.get(g);
        } : le;
        function Yo(g) {
          for (var _ = g.name + "", R = or[_], D = Nn.call(or, _) ? R.length : 0; D--; ) {
            var G = R[D], $ = G.func;
            if ($ == null || $ == g)
              return G.name;
          }
          return _;
        }
        function Hl(g) {
          var _ = Nn.call(V, "placeholder") ? V : g;
          return _.placeholder;
        }
        function ye() {
          var g = V.iteratee || we;
          return g = g === we ? Wm : g, arguments.length ? g(arguments[0], arguments[1]) : g;
        }
        function rf(g, _) {
          var R = g.__data__;
          return ql(_) ? R[typeof _ == "string" ? "string" : "hash"] : R.map;
        }
        function ag(g) {
          for (var _ = ga(g), R = _.length; R--; ) {
            var D = _[R], G = g[D];
            _[R] = [D, G, Wn(G)];
          }
          return _;
        }
        function Bl(g, _) {
          var R = Pm(g, _);
          return co(R) ? R : e;
        }
        function up(g) {
          var _ = Nn.call(g, Va), R = g[Va];
          try {
            g[Va] = e;
            var D = !0;
          } catch {
          }
          var G = sr.call(g);
          return D && (_ ? g[Va] = R : delete g[Va]), G;
        }
        var sf = Uo ? function(g) {
          return g == null ? [] : (g = Xe(g), ao(Uo(g), function(_) {
            return wu.call(g, _);
          }));
        } : LE, rg = Uo ? function(g) {
          for (var _ = []; g; )
            Ji(_, sf(g)), g = Al(g);
          return _;
        } : LE, Da = yn;
        (Ol && Da(new Ol(new ArrayBuffer(1))) != zi || hi && Da(new hi()) != tn || Bn && Da(Bn.resolve()) != pa || je && Da(new je()) != fe || ds && Da(new ds()) != mr) && (Da = function(g) {
          var _ = yn(g), R = _ == Ge ? g.constructor : e, D = R ? Fo(R) : "";
          if (D)
            switch (D) {
              case km:
                return zi;
              case Nd:
                return tn;
              case lh:
                return pa;
              case uh:
                return fe;
              case K0:
                return mr;
            }
          return _;
        });
        function mv(g, _, R) {
          for (var D = -1, G = R.length; ++D < G; ) {
            var $ = R[D], tt = $.size;
            switch ($.type) {
              case "drop":
                g += tt;
                break;
              case "dropRight":
                _ -= tt;
                break;
              case "take":
                _ = fi(_, g + tt);
                break;
              case "takeRight":
                g = oi(g, _ - tt);
                break;
            }
          }
          return { start: g, end: _ };
        }
        function cp(g) {
          var _ = g.match(W_);
          return _ ? _[1].split(md) : [];
        }
        function Mh(g, _, R) {
          _ = Ca(_, g);
          for (var D = -1, G = _.length, $ = !1; ++D < G; ) {
            var tt = Gn(_[D]);
            if (!($ = g != null && R(g, tt)))
              break;
            g = g[tt];
          }
          return $ || ++D != G ? $ : (G = g == null ? 0 : g.length, !!G && tu(G) && Hs(tt, G) && (be(g) || vo(g)));
        }
        function my(g) {
          var _ = g.length, R = new g.constructor(_);
          return _ && typeof g[0] == "string" && Nn.call(g, "index") && (R.index = g.index, R.input = g.input), R;
        }
        function qu(g) {
          return typeof g.constructor == "function" && !ni(g) ? br(Al(g)) : {};
        }
        function Ch(g, _, R) {
          var D = g.constructor;
          switch (_) {
            case ti:
              return ju(g);
            case Qt:
            case ee:
              return new D(+g);
            case zi:
              return Qd(g, R);
            case Gi:
            case Io:
            case Ms:
            case _l:
            case ls:
            case ir:
            case Ui:
            case sa:
            case Ba:
              return oy(g, R);
            case tn:
              return new D();
            case Jn:
            case Zi:
              return new D(g);
            case Ai:
              return Th(g);
            case fe:
              return new D();
            case Dn:
              return Jd(g);
          }
        }
        function py(g, _) {
          var R = _.length;
          if (!R)
            return g;
          var D = R - 1;
          return _[D] = (R > 1 ? "& " : "") + _[D], _ = _.join(R > 2 ? ", " : " "), g.replace(ym, `{
/* [wrapped with ` + _ + `] */
`);
        }
        function go(g) {
          return be(g) || vo(g) || !!(Er && g && g[Er]);
        }
        function Hs(g, _) {
          var R = typeof g;
          return _ = _ ?? gt, !!_ && (R == "number" || R != "symbol" && Ra.test(g)) && g > -1 && g % 1 == 0 && g < _;
        }
        function ur(g, _, R) {
          if (!Pn(R))
            return !1;
          var D = typeof _;
          return (D == "number" ? ia(R) && Hs(_, R.length) : D == "string" && _ in R) ? Za(R[_], g) : !1;
        }
        function sg(g, _) {
          if (be(g))
            return !1;
          var R = typeof g;
          return R == "number" || R == "symbol" || R == "boolean" || g == null || Mr(g) ? !0 : ar.test(g) || !Wi.test(g) || _ != null && g in Xe(_);
        }
        function ql(g) {
          var _ = typeof g;
          return _ == "string" || _ == "number" || _ == "symbol" || _ == "boolean" ? g !== "__proto__" : g === null;
        }
        function og(g) {
          var _ = Yo(g), R = V[_];
          if (typeof R != "function" || !(_ in fn.prototype))
            return !1;
          if (g === R)
            return !0;
          var D = ho(R);
          return !!D && g === D[0];
        }
        function Vu(g) {
          return !!Um && Um in g;
        }
        var Oh = ah ? Eo : IE;
        function ni(g) {
          var _ = g && g.constructor, R = typeof _ == "function" && _.prototype || Rl;
          return g === R;
        }
        function Wn(g) {
          return g === g && !Pn(g);
        }
        function fp(g, _) {
          return function(R) {
            return R == null ? !1 : R[g] === _ && (_ !== e || g in Xe(R));
          };
        }
        function pv(g) {
          var _ = Hh(g, function(D) {
            return R.size === y && R.clear(), D;
          }), R = _.cache;
          return _;
        }
        function Dh(g, _) {
          var R = g[1], D = _[1], G = R | D, $ = G < (N | U | et), tt = D == et && R == H || D == et && R == ot && g[7].length <= _[8] || D == (et | ot) && _[7].length <= _[8] && R == H;
          if (!($ || tt))
            return g;
          D & N && (g[2] = _[2], G |= R & N ? 0 : k);
          var lt = _[3];
          if (lt) {
            var _t = g[3];
            g[3] = _t ? rp(_t, lt, _[4]) : lt, g[4] = _t ? ro(g[3], b) : _[4];
          }
          return lt = _[5], lt && (_t = g[5], g[5] = _t ? ly(_t, lt, _[6]) : lt, g[6] = _t ? ro(g[5], b) : _[6]), lt = _[7], lt && (g[7] = lt), D & et && (g[8] = g[8] == null ? _[8] : fi(g[8], _[8])), g[9] == null && (g[9] = _[9]), g[0] = _[0], g[1] = G, g;
        }
        function Yu(g) {
          var _ = [];
          if (g != null)
            for (var R in Xe(g))
              _.push(R);
          return _;
        }
        function yv(g) {
          return sr.call(g);
        }
        function lg(g, _, R) {
          return _ = oi(_ === e ? g.length - 1 : _, 0), function() {
            for (var D = arguments, G = -1, $ = oi(D.length - _, 0), tt = Mt($); ++G < $; )
              tt[G] = D[_ + G];
            G = -1;
            for (var lt = Mt(_ + 1); ++G < _; )
              lt[G] = D[G];
            return lt[_] = R(tt), yr(g, this, lt);
          };
        }
        function of(g, _) {
          return _.length < 2 ? g : fa(g, ps(_, 0, -1));
        }
        function mo(g, _) {
          for (var R = g.length, D = fi(_.length, R), G = li(g); D--; ) {
            var $ = _[D];
            g[D] = Hs($, R) ? G[$] : e;
          }
          return g;
        }
        function ug(g, _) {
          if (!(_ === "constructor" && typeof g[_] == "function") && _ != "__proto__")
            return g[_];
        }
        var Fu = Vl(Gu), Nh = Au || function(g, _) {
          return ji.setTimeout(g, _);
        }, cg = Vl(Ul);
        function vs(g, _, R) {
          var D = _ + "";
          return cg(g, py(D, yy(cp(D), R)));
        }
        function Vl(g) {
          var _ = 0, R = 0;
          return function() {
            var D = oo(), G = St - (D - R);
            if (R = D, G > 0) {
              if (++_ >= mt)
                return arguments[0];
            } else
              _ = 0;
            return g.apply(e, arguments);
          };
        }
        function fg(g, _) {
          var R = -1, D = g.length, G = D - 1;
          for (_ = _ === e ? D : _; ++R < _; ) {
            var $ = $d(R, G), tt = g[$];
            g[$] = g[R], g[R] = tt;
          }
          return g.length = _, g;
        }
        var Bs = pv(function(g) {
          var _ = [];
          return g.charCodeAt(0) === 46 && _.push(""), g.replace(oa, function(R, D, G, $) {
            _.push(G ? $.replace(mu, "$1") : D || R);
          }), _;
        });
        function Gn(g) {
          if (typeof g == "string" || Mr(g))
            return g;
          var _ = g + "";
          return _ == "0" && 1 / g == -J ? "-0" : _;
        }
        function Fo(g) {
          if (g != null) {
            try {
              return rh.call(g);
            } catch {
            }
            try {
              return g + "";
            } catch {
            }
          }
          return "";
        }
        function yy(g, _) {
          return fs(At, function(R) {
            var D = "_." + R[0];
            _ & R[1] && !Po(g, D) && g.push(D);
          }), g.sort();
        }
        function na(g) {
          if (g instanceof fn)
            return g.clone();
          var _ = new Sr(g.__wrapped__, g.__chain__);
          return _.__actions__ = li(g.__actions__), _.__index__ = g.__index__, _.__values__ = g.__values__, _;
        }
        function _v(g, _, R) {
          (R ? ur(g, _, R) : _ === e) ? _ = 1 : _ = oi(_e(_), 0);
          var D = g == null ? 0 : g.length;
          if (!D || _ < 1)
            return [];
          for (var G = 0, $ = 0, tt = Mt(Cl(D / _)); G < D; )
            tt[$++] = ps(g, G, G += _);
          return tt;
        }
        function hp(g) {
          for (var _ = -1, R = g == null ? 0 : g.length, D = 0, G = []; ++_ < R; ) {
            var $ = g[_];
            $ && (G[D++] = $);
          }
          return G;
        }
        function _y() {
          var g = arguments.length;
          if (!g)
            return [];
          for (var _ = Mt(g - 1), R = arguments[0], D = g; D--; )
            _[D - 1] = arguments[D];
          return Ji(be(R) ? li(R) : [R], hn(_, 1));
        }
        var wi = an(function(g, _) {
          return Ci(g) ? Pl(g, hn(_, 1, Ci, !0)) : [];
        }), Kr = an(function(g, _) {
          var R = Ve(_);
          return Ci(R) && (R = e), Ci(g) ? Pl(g, hn(_, 1, Ci, !0), ye(R, 2)) : [];
        }), qs = an(function(g, _) {
          var R = Ve(_);
          return Ci(R) && (R = e), Ci(g) ? Pl(g, hn(_, 1, Ci, !0), e, R) : [];
        });
        function vy(g, _, R) {
          var D = g == null ? 0 : g.length;
          return D ? (_ = R || _ === e ? 1 : _e(_), ps(g, _ < 0 ? 0 : _, D)) : [];
        }
        function mn(g, _, R) {
          var D = g == null ? 0 : g.length;
          return D ? (_ = R || _ === e ? 1 : _e(_), _ = D - _, ps(g, 0, _ < 0 ? 0 : _)) : [];
        }
        function Ey(g, _) {
          return g && g.length ? xh(g, ye(_, 3), !0, !0) : [];
        }
        function hg(g, _) {
          return g && g.length ? xh(g, ye(_, 3), !0) : [];
        }
        function Zr(g, _, R, D) {
          var G = g == null ? 0 : g.length;
          return G ? (R && typeof R != "number" && ur(g, _, R) && (R = 0, D = G), qe(g, _, R, D)) : [];
        }
        function Wr(g, _, R) {
          var D = g == null ? 0 : g.length;
          if (!D)
            return -1;
          var G = R == null ? 0 : _e(R);
          return G < 0 && (G = oi(D + G, 0)), th(g, ye(_, 3), G);
        }
        function lf(g, _, R) {
          var D = g == null ? 0 : g.length;
          if (!D)
            return -1;
          var G = D - 1;
          return R !== e && (G = _e(R), G = R < 0 ? oi(D + G, 0) : fi(G, D - 1)), th(g, ye(_, 3), G, !0);
        }
        function Xa(g) {
          var _ = g == null ? 0 : g.length;
          return _ ? hn(g, 1) : [];
        }
        function uf(g) {
          var _ = g == null ? 0 : g.length;
          return _ ? hn(g, J) : [];
        }
        function Yl(g, _) {
          var R = g == null ? 0 : g.length;
          return R ? (_ = _ === e ? 1 : _e(_), hn(g, _)) : [];
        }
        function Fl(g) {
          for (var _ = -1, R = g == null ? 0 : g.length, D = {}; ++_ < R; ) {
            var G = g[_];
            D[G[0]] = G[1];
          }
          return D;
        }
        function gi(g) {
          return g && g.length ? g[0] : e;
        }
        function by(g, _, R) {
          var D = g == null ? 0 : g.length;
          if (!D)
            return -1;
          var G = R == null ? 0 : _e(R);
          return G < 0 && (G = oi(D + G, 0)), Bc(g, _, G);
        }
        function Vs(g) {
          var _ = g == null ? 0 : g.length;
          return _ ? ps(g, 0, -1) : [];
        }
        var po = an(function(g) {
          var _ = Tn(g, ap);
          return _.length && _[0] === g[0] ? Fm(_) : [];
        }), $l = an(function(g) {
          var _ = Ve(g), R = Tn(g, ap);
          return _ === Ve(R) ? _ = e : R.pop(), R.length && R[0] === g[0] ? Fm(R, ye(_, 2)) : [];
        }), cf = an(function(g) {
          var _ = Ve(g), R = Tn(g, ap);
          return _ = typeof _ == "function" ? _ : e, _ && R.pop(), R.length && R[0] === g[0] ? Fm(R, e, _) : [];
        });
        function $u(g, _) {
          return g == null ? "" : qr.call(g, _);
        }
        function Ve(g) {
          var _ = g == null ? 0 : g.length;
          return _ ? g[_ - 1] : e;
        }
        function Xu(g, _, R) {
          var D = g == null ? 0 : g.length;
          if (!D)
            return -1;
          var G = D;
          return R !== e && (G = _e(R), G = G < 0 ? oi(D + G, 0) : fi(G, D - 1)), _ === _ ? _r(g, _, G) : th(g, vu, G, !0);
        }
        function Na(g, _) {
          return g && g.length ? ep(g, _e(_)) : e;
        }
        var vv = an(ff);
        function ff(g, _) {
          return g && g.length && _ && _.length ? Yd(g, _) : g;
        }
        function dp(g, _, R) {
          return g && g.length && _ && _.length ? Yd(g, _, ye(R, 2)) : g;
        }
        function dg(g, _, R) {
          return g && g.length && _ && _.length ? Yd(g, _, e, R) : g;
        }
        var Es = di(function(g, _) {
          var R = g == null ? 0 : g.length, D = Ud(g, _);
          return Fd(g, Tn(_, function(G) {
            return Hs(G, R) ? +G : G;
          }).sort(wh)), D;
        });
        function Ev(g, _) {
          var R = [];
          if (!(g && g.length))
            return R;
          var D = -1, G = [], $ = g.length;
          for (_ = ye(_, 3); ++D < $; ) {
            var tt = g[D];
            _(tt, D, g) && (R.push(tt), G.push(D));
          }
          return Fd(g, G), R;
        }
        function gg(g) {
          return g == null ? g : Dd.call(g);
        }
        function qn(g, _, R) {
          var D = g == null ? 0 : g.length;
          return D ? (R && typeof R != "number" && ur(g, _, R) ? (_ = 0, R = D) : (_ = _ == null ? 0 : _e(_), R = R === e ? D : _e(R)), ps(g, _, R)) : [];
        }
        function ii(g, _) {
          return Eh(g, _);
        }
        function pn(g, _, R) {
          return ys(g, _, ye(R, 2));
        }
        function Rn(g, _) {
          var R = g == null ? 0 : g.length;
          if (R) {
            var D = Eh(g, _);
            if (D < R && Za(g[D], _))
              return D;
          }
          return -1;
        }
        function In(g, _) {
          return Eh(g, _, !0);
        }
        function Qr(g, _, R) {
          return ys(g, _, ye(R, 2), !0);
        }
        function Xl(g, _) {
          var R = g == null ? 0 : g.length;
          if (R) {
            var D = Eh(g, _, !0) - 1;
            if (Za(g[D], _))
              return D;
          }
          return -1;
        }
        function Ku(g) {
          return g && g.length ? np(g) : [];
        }
        function Sy(g, _) {
          return g && g.length ? np(g, ye(_, 2)) : [];
        }
        function Kl(g) {
          var _ = g == null ? 0 : g.length;
          return _ ? ps(g, 1, _) : [];
        }
        function Hi(g, _, R) {
          return g && g.length ? (_ = R || _ === e ? 1 : _e(_), ps(g, 0, _ < 0 ? 0 : _)) : [];
        }
        function Zu(g, _, R) {
          var D = g == null ? 0 : g.length;
          return D ? (_ = R || _ === e ? 1 : _e(_), _ = D - _, ps(g, _ < 0 ? 0 : _, D)) : [];
        }
        function Wu(g, _) {
          return g && g.length ? xh(g, ye(_, 3), !1, !0) : [];
        }
        function xy(g, _) {
          return g && g.length ? xh(g, ye(_, 3)) : [];
        }
        var ba = an(function(g) {
          return Fr(hn(g, 1, Ci, !0));
        }), Lh = an(function(g) {
          var _ = Ve(g);
          return Ci(_) && (_ = e), Fr(hn(g, 1, Ci, !0), ye(_, 2));
        }), mg = an(function(g) {
          var _ = Ve(g);
          return _ = typeof _ == "function" ? _ : e, Fr(hn(g, 1, Ci, !0), e, _);
        });
        function Ar(g) {
          return g && g.length ? Fr(g) : [];
        }
        function Ty(g, _) {
          return g && g.length ? Fr(g, ye(_, 2)) : [];
        }
        function wy(g, _) {
          return _ = typeof _ == "function" ? _ : e, g && g.length ? Fr(g, e, _) : [];
        }
        function Ih(g) {
          if (!(g && g.length))
            return [];
          var _ = 0;
          return g = ao(g, function(R) {
            if (Ci(R))
              return _ = oi(R.length, _), !0;
          }), Ur(_, function(R) {
            return Tn(g, eh(R));
          });
        }
        function pg(g, _) {
          if (!(g && g.length))
            return [];
          var R = Ih(g);
          return _ == null ? R : Tn(R, function(D) {
            return yr(_, e, D);
          });
        }
        var $o = an(function(g, _) {
          return Ci(g) ? Pl(g, _) : [];
        }), Ka = an(function(g) {
          return Zd(ao(g, Ci));
        }), Qu = an(function(g) {
          var _ = Ve(g);
          return Ci(_) && (_ = e), Zd(ao(g, Ci), ye(_, 2));
        }), Ju = an(function(g) {
          var _ = Ve(g);
          return _ = typeof _ == "function" ? _ : e, Zd(ao(g, Ci), e, _);
        }), Ph = an(Ih);
        function Jr(g, _) {
          return ip(g || [], _ || [], Ll);
        }
        function gp(g, _) {
          return ip(g || [], _ || [], nf);
        }
        var Ry = an(function(g) {
          var _ = g.length, R = _ > 1 ? g[_ - 1] : e;
          return R = typeof R == "function" ? (g.pop(), R) : e, pg(g, R);
        });
        function hf(g) {
          var _ = V(g);
          return _.__chain__ = !0, _;
        }
        function mp(g, _) {
          return _(g), g;
        }
        function cr(g, _) {
          return _(g);
        }
        var bv = di(function(g) {
          var _ = g.length, R = _ ? g[0] : 0, D = this.__wrapped__, G = function($) {
            return Ud($, g);
          };
          return _ > 1 || this.__actions__.length || !(D instanceof fn) || !Hs(R) ? this.thru(G) : (D = D.slice(R, +R + (_ ? 1 : 0)), D.__actions__.push({
            func: cr,
            args: [G],
            thisArg: e
          }), new Sr(D, this.__chain__).thru(function($) {
            return _ && !$.length && $.push(e), $;
          }));
        });
        function ts() {
          return hf(this);
        }
        function Sv() {
          return new Sr(this.value(), this.__chain__);
        }
        function zh() {
          this.__values__ === e && (this.__values__ = qi(this.value()));
          var g = this.__index__ >= this.__values__.length, _ = g ? e : this.__values__[this.__index__++];
          return { done: g, value: _ };
        }
        function pp() {
          return this;
        }
        function Zl(g) {
          for (var _, R = this; R instanceof gs; ) {
            var D = na(R);
            D.__index__ = 0, D.__values__ = e, _ ? G.__wrapped__ = D : _ = D;
            var G = D;
            R = R.__wrapped__;
          }
          return G.__wrapped__ = g, _;
        }
        function yg() {
          var g = this.__wrapped__;
          if (g instanceof fn) {
            var _ = g;
            return this.__actions__.length && (_ = new fn(this)), _ = _.reverse(), _.__actions__.push({
              func: cr,
              args: [gg],
              thisArg: e
            }), new Sr(_, this.__chain__);
          }
          return this.thru(gg);
        }
        function Gh() {
          return dv(this.__wrapped__, this.__actions__);
        }
        var yo = kl(function(g, _, R) {
          Nn.call(g, R) ? ++g[R] : ms(g, R, 1);
        });
        function Uh(g, _, R) {
          var D = be(g) ? Mm : yh;
          return R && ur(g, _, R) && (_ = e), D(g, ye(_, 3));
        }
        function Ay(g, _) {
          var R = be(g) ? ao : Ln;
          return R(g, ye(_, 3));
        }
        var xv = $a(Wr), tc = $a(lf);
        function df(g, _) {
          return hn(vg(g, _), 1);
        }
        function Tv(g, _) {
          return hn(vg(g, _), J);
        }
        function yp(g, _, R) {
          return R = R === e ? 1 : _e(R), hn(vg(g, _), R);
        }
        function _p(g, _) {
          var R = be(g) ? fs : Bo;
          return R(g, ye(_, 3));
        }
        function _g(g, _) {
          var R = be(g) ? ov : ca;
          return R(g, ye(_, 3));
        }
        var My = kl(function(g, _, R) {
          Nn.call(g, R) ? g[R].push(_) : ms(g, R, [_]);
        });
        function gf(g, _, R, D) {
          g = ia(g) ? g : bf(g), R = R && !D ? _e(R) : 0;
          var G = g.length;
          return R < 0 && (R = oi(G + R, 0)), eu(g) ? R <= G && g.indexOf(_, R) > -1 : !!G && Bc(g, _, R) > -1;
        }
        var vp = an(function(g, _, R) {
          var D = -1, G = typeof _ == "function", $ = ia(g) ? Mt(g.length) : [];
          return Bo(g, function(tt) {
            $[++D] = G ? yr(_, tt, R) : Pu(tt, _, R);
          }), $;
        }), Cy = kl(function(g, _, R) {
          ms(g, R, _);
        });
        function vg(g, _) {
          var R = be(g) ? Tn : Jm;
          return R(g, ye(_, 3));
        }
        function wv(g, _, R, D) {
          return g == null ? [] : (be(_) || (_ = _ == null ? [] : [_]), R = D ? e : R, be(R) || (R = R == null ? [] : [R]), qd(g, _, R));
        }
        var Rv = kl(function(g, _, R) {
          g[R ? 0 : 1].push(_);
        }, function() {
          return [[], []];
        });
        function Eg(g, _, R) {
          var D = be(g) ? Jf : Nm, G = arguments.length < 3;
          return D(g, ye(_, 4), R, G, Bo);
        }
        function Ep(g, _, R) {
          var D = be(g) ? Cm : Nm, G = arguments.length < 3;
          return D(g, ye(_, 4), R, G, ca);
        }
        function bp(g, _) {
          var R = be(g) ? ao : Ln;
          return R(g, nc(ye(_, 3)));
        }
        function Av(g) {
          var _ = be(g) ? $c : zu;
          return _(g);
        }
        function Oy(g, _, R) {
          (R ? ur(g, _, R) : _ === e) ? _ = 1 : _ = _e(_);
          var D = be(g) ? Vm : js;
          return D(g, _);
        }
        function ai(g) {
          var _ = be(g) ? ey : Ti;
          return _(g);
        }
        function bg(g) {
          if (g == null)
            return 0;
          if (ia(g))
            return eu(g) ? jr(g) : g.length;
          var _ = Da(g);
          return _ == tn || _ == fe ? g.size : tf(g).length;
        }
        function Mv(g, _, R) {
          var D = be(g) ? Ad : hv;
          return R && ur(g, _, R) && (_ = e), D(g, ye(_, 3));
        }
        var Sp = an(function(g, _) {
          if (g == null)
            return [];
          var R = _.length;
          return R > 1 && ur(g, _[0], _[1]) ? _ = [] : R > 2 && ur(_[0], _[1], _[2]) && (_ = [_[0]]), qd(g, hn(_, 1), []);
        }), Sg = Xt || function() {
          return ji.Date.now();
        };
        function RE(g, _) {
          if (typeof _ != "function")
            throw new kr(f);
          return g = _e(g), function() {
            if (--g < 1)
              return _.apply(this, arguments);
          };
        }
        function Cv(g, _, R) {
          return _ = R ? e : _, _ = g && _ == null ? g.length : _, fo(g, et, e, e, e, e, _);
        }
        function xg(g, _) {
          var R;
          if (typeof _ != "function")
            throw new kr(f);
          return g = _e(g), function() {
            return --g > 0 && (R = _.apply(this, arguments)), g <= 1 && (_ = e), R;
          };
        }
        var ec = an(function(g, _, R) {
          var D = N;
          if (R.length) {
            var G = ro(R, Hl(ec));
            D |= z;
          }
          return fo(g, D, _, R, G);
        }), jh = an(function(g, _, R) {
          var D = N | U;
          if (R.length) {
            var G = ro(R, Hl(jh));
            D |= z;
          }
          return fo(_, D, g, R, G);
        });
        function mf(g, _, R) {
          _ = R ? e : _;
          var D = fo(g, H, e, e, e, e, e, _);
          return D.placeholder = mf.placeholder, D;
        }
        function kh(g, _, R) {
          _ = R ? e : _;
          var D = fo(g, B, e, e, e, e, e, _);
          return D.placeholder = kh.placeholder, D;
        }
        function Wl(g, _, R) {
          var D, G, $, tt, lt, _t, Ht = 0, Yt = !1, Vt = !1, re = !0;
          if (typeof g != "function")
            throw new kr(f);
          _ = Ys(_) || 0, Pn(R) && (Yt = !!R.leading, Vt = "maxWait" in R, $ = Vt ? oi(Ys(R.maxWait) || 0, _) : $, re = "trailing" in R ? !!R.trailing : re);
          function he(ma) {
            var ru = D, Sf = G;
            return D = G = e, Ht = ma, tt = g.apply(Sf, ru), tt;
          }
          function De(ma) {
            return Ht = ma, lt = Nh(rn, _), Yt ? he(ma) : tt;
          }
          function We(ma) {
            var ru = ma - _t, Sf = ma - Ht, ZS = _ - ru;
            return Vt ? fi(ZS, $ - Sf) : ZS;
          }
          function Ne(ma) {
            var ru = ma - _t, Sf = ma - Ht;
            return _t === e || ru >= _ || ru < 0 || Vt && Sf >= $;
          }
          function rn() {
            var ma = Sg();
            if (Ne(ma))
              return bn(ma);
            lt = Nh(rn, We(ma));
          }
          function bn(ma) {
            return lt = e, re && D ? he(ma) : (D = G = e, tt);
          }
          function $s() {
            lt !== e && sy(lt), Ht = 0, D = _t = G = lt = e;
          }
          function ns() {
            return lt === e ? tt : bn(Sg());
          }
          function Xs() {
            var ma = Sg(), ru = Ne(ma);
            if (D = arguments, G = this, _t = ma, ru) {
              if (lt === e)
                return De(_t);
              if (Vt)
                return sy(lt), lt = Nh(rn, _), he(_t);
            }
            return lt === e && (lt = Nh(rn, _)), tt;
          }
          return Xs.cancel = $s, Xs.flush = ns, Xs;
        }
        var _o = an(function(g, _) {
          return Ho(g, 1, _);
        }), Ql = an(function(g, _, R) {
          return Ho(g, Ys(_) || 0, R);
        });
        function AE(g) {
          return fo(g, pt);
        }
        function Hh(g, _) {
          if (typeof g != "function" || _ != null && typeof _ != "function")
            throw new kr(f);
          var R = function() {
            var D = arguments, G = _ ? _.apply(this, D) : D[0], $ = R.cache;
            if ($.has(G))
              return $.get(G);
            var tt = g.apply(this, D);
            return R.cache = $.set(G, tt) || $, tt;
          };
          return R.cache = new (Hh.Cache || ua)(), R;
        }
        Hh.Cache = ua;
        function nc(g) {
          if (typeof g != "function")
            throw new kr(f);
          return function() {
            var _ = arguments;
            switch (_.length) {
              case 0:
                return !g.call(this);
              case 1:
                return !g.call(this, _[0]);
              case 2:
                return !g.call(this, _[0], _[1]);
              case 3:
                return !g.call(this, _[0], _[1], _[2]);
            }
            return !g.apply(this, _);
          };
        }
        function Dy(g) {
          return xg(2, g);
        }
        var Ov = ry(function(g, _) {
          _ = _.length == 1 && be(_[0]) ? Tn(_[0], ya(ye())) : Tn(hn(_, 1), ya(ye()));
          var R = _.length;
          return an(function(D) {
            for (var G = -1, $ = fi(D.length, R); ++G < $; )
              D[G] = _[G].call(this, D[G]);
            return yr(g, this, D);
          });
        }), Bh = an(function(g, _) {
          var R = ro(_, Hl(Bh));
          return fo(g, z, e, _, R);
        }), Tg = an(function(g, _) {
          var R = ro(_, Hl(Tg));
          return fo(g, Q, e, _, R);
        }), qh = di(function(g, _) {
          return fo(g, ot, e, e, e, _);
        });
        function xp(g, _) {
          if (typeof g != "function")
            throw new kr(f);
          return _ = _ === e ? _ : _e(_), an(g, _);
        }
        function Tp(g, _) {
          if (typeof g != "function")
            throw new kr(f);
          return _ = _ == null ? 0 : oi(_e(_), 0), an(function(R) {
            var D = R[_], G = Uu(R, 0, _);
            return D && Ji(G, D), yr(g, this, G);
          });
        }
        function wp(g, _, R) {
          var D = !0, G = !0;
          if (typeof g != "function")
            throw new kr(f);
          return Pn(R) && (D = "leading" in R ? !!R.leading : D, G = "trailing" in R ? !!R.trailing : G), Wl(g, _, {
            leading: D,
            maxWait: _,
            trailing: G
          });
        }
        function Bi(g) {
          return Cv(g, 1);
        }
        function Ny(g, _) {
          return Bh(jl(_), g);
        }
        function ME() {
          if (!arguments.length)
            return [];
          var g = arguments[0];
          return be(g) ? g : [g];
        }
        function He(g) {
          return Fa(g, A);
        }
        function CE(g, _) {
          return _ = typeof _ == "function" ? _ : e, Fa(g, A, _);
        }
        function Jl(g) {
          return Fa(g, x | A);
        }
        function Ke(g, _) {
          return _ = typeof _ == "function" ? _ : e, Fa(g, x | A, _);
        }
        function ic(g, _) {
          return _ == null || jd(g, _, ga(_));
        }
        function Za(g, _) {
          return g === _ || g !== g && _ !== _;
        }
        var wg = ku(Wc), Dv = ku(function(g, _) {
          return g >= _;
        }), vo = Qc(/* @__PURE__ */ function() {
          return arguments;
        }()) ? Qc : function(g) {
          return Vn(g) && Nn.call(g, "callee") && !wu.call(g, "callee");
        }, be = Mt.isArray, ac = Am ? ya(Am) : wr;
        function ia(g) {
          return g != null && tu(g.length) && !Eo(g);
        }
        function Ci(g) {
          return Vn(g) && ia(g);
        }
        function Rp(g) {
          return g === !0 || g === !1 || Vn(g) && yn(g) == Qt;
        }
        var ha = sh || IE, Ap = nv ? ya(nv) : ki;
        function Nv(g) {
          return Vn(g) && g.nodeType === 1 && !aa(g);
        }
        function Rg(g) {
          if (g == null)
            return !0;
          if (ia(g) && (be(g) || typeof g == "string" || typeof g.splice == "function" || ha(g) || sc(g) || vo(g)))
            return !g.length;
          var _ = Da(g);
          if (_ == tn || _ == fe)
            return !g.size;
          if (ni(g))
            return !tf(g).length;
          for (var R in g)
            if (Nn.call(g, R))
              return !1;
          return !0;
        }
        function ri(g, _) {
          return Gl(g, _);
        }
        function Sa(g, _, R) {
          R = typeof R == "function" ? R : e;
          var D = R ? R(g, _) : e;
          return D === e ? Gl(g, _, e, R) : !!D;
        }
        function Tt(g) {
          if (!Vn(g))
            return !1;
          var _ = yn(g);
          return _ == pe || _ == ce || typeof g.message == "string" && typeof g.name == "string" && !aa(g);
        }
        function Un(g) {
          return typeof g == "number" && oh(g);
        }
        function Eo(g) {
          if (!Pn(g))
            return !1;
          var _ = yn(g);
          return _ == Mn || _ == te || _ == $t || _ == ka;
        }
        function Vh(g) {
          return typeof g == "number" && g == _e(g);
        }
        function tu(g) {
          return typeof g == "number" && g > -1 && g % 1 == 0 && g <= gt;
        }
        function Pn(g) {
          var _ = typeof g;
          return g != null && (_ == "object" || _ == "function");
        }
        function Vn(g) {
          return g != null && typeof g == "object";
        }
        var rc = iv ? ya(iv) : Xm;
        function Xo(g, _) {
          return g === _ || ta(g, _, ag(_));
        }
        function Mp(g, _, R) {
          return R = typeof R == "function" ? R : e, ta(g, _, ag(_), R);
        }
        function Ko(g) {
          return Iv(g) && g != +g;
        }
        function Ly(g) {
          if (Oh(g))
            throw new Me(l);
          return co(g);
        }
        function Lv(g) {
          return g === null;
        }
        function OE(g) {
          return g == null;
        }
        function Iv(g) {
          return typeof g == "number" || Vn(g) && yn(g) == Jn;
        }
        function aa(g) {
          if (!Vn(g) || yn(g) != Ge)
            return !1;
          var _ = Al(g);
          if (_ === null)
            return !0;
          var R = Nn.call(_, "constructor") && _.constructor;
          return typeof R == "function" && R instanceof R && rh.call(R) == hs;
        }
        var Cp = av ? ya(av) : Hd;
        function Ag(g) {
          return Vh(g) && g >= -gt && g <= gt;
        }
        var Op = rv ? ya(rv) : Km;
        function eu(g) {
          return typeof g == "string" || !be(g) && Vn(g) && yn(g) == Zi;
        }
        function Mr(g) {
          return typeof g == "symbol" || Vn(g) && yn(g) == Dn;
        }
        var sc = Qf ? ya(Qf) : Zm;
        function bo(g) {
          return g === e;
        }
        function Iy(g) {
          return Vn(g) && Da(g) == mr;
        }
        function pf(g) {
          return Vn(g) && yn(g) == Ha;
        }
        var Wa = ku(Bd), ie = ku(function(g, _) {
          return g <= _;
        });
        function qi(g) {
          if (!g)
            return [];
          if (ia(g))
            return eu(g) ? vr(g) : li(g);
          if (Ru && g[Ru])
            return V0(g[Ru]());
          var _ = Da(g), R = _ == tn ? xu : _ == fe ? so : bf;
          return R(g);
        }
        function da(g) {
          if (!g)
            return g === 0 ? g : 0;
          if (g = Ys(g), g === J || g === -J) {
            var _ = g < 0 ? -1 : 1;
            return _ * Ot;
          }
          return g === g ? g : 0;
        }
        function _e(g) {
          var _ = da(g), R = _ % 1;
          return _ === _ ? R ? _ - R : _ : 0;
        }
        function Zo(g) {
          return g ? uo(_e(g), 0, j) : 0;
        }
        function Ys(g) {
          if (typeof g == "number")
            return g;
          if (Mr(g))
            return W;
          if (Pn(g)) {
            var _ = typeof g.valueOf == "function" ? g.valueOf() : g;
            g = Pn(_) ? _ + "" : _;
          }
          if (typeof g != "string")
            return g === 0 ? g : +g;
          g = Im(g);
          var R = Qi.test(g);
          return R || yd.test(g) ? wE(g.slice(2), R ? 2 : 8) : jf.test(g) ? W : +g;
        }
        function Mg(g) {
          return Rr(g, xa(g));
        }
        function nu(g) {
          return g ? uo(_e(g), -gt, gt) : g === 0 ? g : 0;
        }
        function Ze(g) {
          return g == null ? "" : Ma(g);
        }
        var Wo = va(function(g, _) {
          if (ni(_) || ia(_)) {
            Rr(_, ga(_), g);
            return;
          }
          for (var R in _)
            Nn.call(_, R) && Ll(g, R, _[R]);
        }), Qo = va(function(g, _) {
          Rr(_, xa(_), g);
        }), yf = va(function(g, _, R, D) {
          Rr(_, xa(_), g, D);
        }), oc = va(function(g, _, R, D) {
          Rr(_, ga(_), g, D);
        }), fr = di(Ud);
        function es(g, _) {
          var R = br(g);
          return _ == null ? R : xr(R, _);
        }
        var lc = an(function(g, _) {
          g = Xe(g);
          var R = -1, D = _.length, G = D > 2 ? _[2] : e;
          for (G && ur(_[0], _[1], G) && (D = 1); ++R < D; )
            for (var $ = _[R], tt = xa($), lt = -1, _t = tt.length; ++lt < _t; ) {
              var Ht = tt[lt], Yt = g[Ht];
              (Yt === e || Za(Yt, Rl[Ht]) && !Nn.call(g, Ht)) && (g[Ht] = $[Ht]);
            }
          return g;
        }), Dp = an(function(g) {
          return g.push(e, hy), yr(Ef, e, g);
        });
        function Yh(g, _) {
          return _u(g, ye(_, 3), Ni);
        }
        function Cg(g, _) {
          return _u(g, ye(_, 3), Zc);
        }
        function Py(g, _) {
          return g == null ? g : zl(g, ye(_, 3), xa);
        }
        function Og(g, _) {
          return g == null ? g : Lu(g, ye(_, 3), xa);
        }
        function _f(g, _) {
          return g && Ni(g, ye(_, 3));
        }
        function So(g, _) {
          return g && Zc(g, ye(_, 3));
        }
        function Np(g) {
          return g == null ? [] : Tr(g, ga(g));
        }
        function Lp(g) {
          return g == null ? [] : Tr(g, xa(g));
        }
        function Dg(g, _, R) {
          var D = g == null ? e : fa(g, _);
          return D === e ? R : D;
        }
        function Ip(g, _) {
          return g != null && Mh(g, _, Ym);
        }
        function vf(g, _) {
          return g != null && Mh(g, _, ny);
        }
        var Fh = $r(function(g, _, R) {
          _ != null && typeof _.toString != "function" && (_ = sr.call(_)), g[_] = R;
        }, vt(bt)), zy = $r(function(g, _, R) {
          _ != null && typeof _.toString != "function" && (_ = sr.call(_)), Nn.call(g, _) ? g[_].push(R) : g[_] = [R];
        }, ye), Pv = an(Pu);
        function ga(g) {
          return ia(g) ? qm(g) : tf(g);
        }
        function xa(g) {
          return ia(g) ? qm(g, !0) : Qm(g);
        }
        function zv(g, _) {
          var R = {};
          return _ = ye(_, 3), Ni(g, function(D, G, $) {
            ms(R, _(D, G, $), D);
          }), R;
        }
        function Gv(g, _) {
          var R = {};
          return _ = ye(_, 3), Ni(g, function(D, G, $) {
            ms(R, G, _(D, G, $));
          }), R;
        }
        var Uv = va(function(g, _, R) {
          ef(g, _, R);
        }), Ef = va(function(g, _, R, D) {
          ef(g, _, R, D);
        }), Ng = di(function(g, _) {
          var R = {};
          if (g == null)
            return R;
          var D = !1;
          _ = Tn(_, function($) {
            return $ = Ca($, g), D || (D = $.length > 1), $;
          }), Rr(g, lp(g), R), D && (R = Fa(R, x | w | A, dy));
          for (var G = _.length; G--; )
            Sh(R, _[G]);
          return R;
        });
        function Lg(g, _) {
          return La(g, nc(ye(_)));
        }
        var Gy = di(function(g, _) {
          return g == null ? {} : Vd(g, _);
        });
        function La(g, _) {
          if (g == null)
            return {};
          var R = Tn(lp(g), function(D) {
            return [D];
          });
          return _ = ye(_), vh(g, R, function(D, G) {
            return _(D, G[0]);
          });
        }
        function Jo(g, _, R) {
          _ = Ca(_, g);
          var D = -1, G = _.length;
          for (G || (G = 1, g = e); ++D < G; ) {
            var $ = g == null ? e : g[Gn(_[D])];
            $ === e && (D = G, $ = R), g = Eo($) ? $.call(g) : $;
          }
          return g;
        }
        function jv(g, _, R) {
          return g == null ? g : nf(g, _, R);
        }
        function Uy(g, _, R, D) {
          return D = typeof D == "function" ? D : e, g == null ? g : nf(g, _, R, D);
        }
        var Pp = Bu(ga), zp = Bu(xa);
        function Gp(g, _, R) {
          var D = be(g), G = D || ha(g) || sc(g);
          if (_ = ye(_, 4), R == null) {
            var $ = g && g.constructor;
            G ? R = D ? new $() : [] : Pn(g) ? R = Eo($) ? br(Al(g)) : {} : R = {};
          }
          return (G ? fs : Ni)(g, function(tt, lt, _t) {
            return _(R, tt, lt, _t);
          }), R;
        }
        function jy(g, _) {
          return g == null ? !0 : Sh(g, _);
        }
        function Ig(g, _, R) {
          return g == null ? g : Kd(g, _, jl(R));
        }
        function kv(g, _, R, D) {
          return D = typeof D == "function" ? D : e, g == null ? g : Kd(g, _, jl(R), D);
        }
        function bf(g) {
          return g == null ? [] : Md(g, ga(g));
        }
        function Up(g) {
          return g == null ? [] : Md(g, xa(g));
        }
        function ky(g, _, R) {
          return R === e && (R = _, _ = e), R !== e && (R = Ys(R), R = R === R ? R : 0), _ !== e && (_ = Ys(_), _ = _ === _ ? _ : 0), uo(Ys(g), _, R);
        }
        function Pg(g, _, R) {
          return _ = da(_), R === e ? (R = _, _ = 0) : R = da(R), g = Ys(g), Iu(g, _, R);
        }
        function Hy(g, _, R) {
          if (R && typeof R != "boolean" && ur(g, _, R) && (_ = R = e), R === e && (typeof _ == "boolean" ? (R = _, _ = e) : typeof g == "boolean" && (R = g, g = e)), g === e && _ === e ? (g = 0, _ = 1) : (g = da(g), _ === e ? (_ = g, g = 0) : _ = da(_)), g > _) {
            var D = g;
            g = _, _ = D;
          }
          if (R || g % 1 || _ % 1) {
            var G = zn();
            return fi(g + G * (_ - g + wd("1e-" + ((G + "").length - 1))), _);
          }
          return $d(g, _);
        }
        var Hv = lr(function(g, _, R) {
          return _ = _.toLowerCase(), g + (R ? zg(_) : _);
        });
        function zg(g) {
          return v(Ze(g).toLowerCase());
        }
        function Fs(g) {
          return g = Ze(g), g && g.replace(Lc, nh).replace(no, "");
        }
        function tl(g, _, R) {
          g = Ze(g), _ = Ma(_);
          var D = g.length;
          R = R === e ? D : uo(_e(R), 0, D);
          var G = R;
          return R -= _.length, R >= 0 && g.slice(R, G) == _;
        }
        function iu(g) {
          return g = Ze(g), g && Ue.test(g) ? g.replace(oe, Su) : g;
        }
        function $h(g) {
          return g = Ze(g), g && cn.test(g) ? g.replace(un, "\\$&") : g;
        }
        var Gg = lr(function(g, _, R) {
          return g + (R ? "-" : "") + _.toLowerCase();
        }), uc = lr(function(g, _, R) {
          return g + (R ? " " : "") + _.toLowerCase();
        }), DE = ea("toLowerCase");
        function By(g, _, R) {
          g = Ze(g), _ = _e(_);
          var D = _ ? jr(g) : 0;
          if (!_ || D >= _)
            return g;
          var G = (_ - D) / 2;
          return Rh(Zn(G), R) + g + Rh(Cl(G), R);
        }
        function el(g, _, R) {
          g = Ze(g), _ = _e(_);
          var D = _ ? jr(g) : 0;
          return _ && D < _ ? g + Rh(_ - D, R) : g;
        }
        function qy(g, _, R) {
          g = Ze(g), _ = _e(_);
          var D = _ ? jr(g) : 0;
          return _ && D < _ ? Rh(_ - D, R) + g : g;
        }
        function Vy(g, _, R) {
          return R || _ == null ? _ = 0 : _ && (_ = +_), la(Ze(g).replace(Si, ""), _ || 0);
        }
        function Ug(g, _, R) {
          return (R ? ur(g, _, R) : _ === e) ? _ = 1 : _ = _e(_), Xd(Ze(g), _);
        }
        function Yy() {
          var g = arguments, _ = Ze(g[0]);
          return g.length < 3 ? _ : _.replace(g[1], g[2]);
        }
        var jp = lr(function(g, _, R) {
          return g + (R ? "_" : "") + _.toLowerCase();
        });
        function au(g, _, R) {
          return R && typeof R != "number" && ur(g, _, R) && (_ = R = e), R = R === e ? j : R >>> 0, R ? (g = Ze(g), g && (typeof _ == "string" || _ != null && !Cp(_)) && (_ = Ma(_), !_ && Is(g)) ? Uu(vr(g), 0, R) : g.split(_, R)) : [];
        }
        var kp = lr(function(g, _, R) {
          return g + (R ? " " : "") + v(_);
        });
        function jg(g, _, R) {
          return g = Ze(g), R = R == null ? 0 : uo(_e(R), 0, g.length), _ = Ma(_), g.slice(R, R + _.length) == _;
        }
        function Xh(g, _, R) {
          var D = V.templateSettings;
          R && ur(g, _, R) && (_ = e), g = Ze(g), _ = yf({}, _, D, ng);
          var G = yf({}, _.imports, D.imports, ng), $ = ga(G), tt = Md(G, $), lt, _t, Ht = 0, Yt = _.interpolate || kf, Vt = "__p += '", re = Yc(
            (_.escape || kf).source + "|" + Yt.source + "|" + (Yt === xn ? qa : kf).source + "|" + (_.evaluate || kf).source + "|$",
            "g"
          ), he = "//# sourceURL=" + (Nn.call(_, "sourceURL") ? (_.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++xd + "]") + `
`;
          g.replace(re, function(Ne, rn, bn, $s, ns, Xs) {
            return bn || (bn = $s), Vt += g.slice(Ht, Xs).replace(G0, q0), rn && (lt = !0, Vt += `' +
__e(` + rn + `) +
'`), ns && (_t = !0, Vt += `';
` + ns + `;
__p += '`), bn && (Vt += `' +
((__t = (` + bn + `)) == null ? '' : __t) +
'`), Ht = Xs + Ne.length, Ne;
          }), Vt += `';
`;
          var De = Nn.call(_, "variable") && _.variable;
          if (!De)
            Vt = `with (obj) {
` + Vt + `
}
`;
          else if (de.test(De))
            throw new Me(h);
          Vt = (_t ? Vt.replace(Y, "") : Vt).replace(dt, "$1").replace(Kt, "$1;"), Vt = "function(" + (De || "obj") + `) {
` + (De ? "" : `obj || (obj = {});
`) + "var __t, __p = ''" + (lt ? ", __e = _.escape" : "") + (_t ? `, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
` : `;
`) + Vt + `return __p
}`;
          var We = M(function() {
            return wn($, he + "return " + Vt).apply(e, tt);
          });
          if (We.source = Vt, Tt(We))
            throw We;
          return We;
        }
        function cc(g) {
          return Ze(g).toLowerCase();
        }
        function Hp(g) {
          return Ze(g).toUpperCase();
        }
        function Bv(g, _, R) {
          if (g = Ze(g), g && (R || _ === e))
            return Im(g);
          if (!g || !(_ = Ma(_)))
            return g;
          var D = vr(g), G = vr(_), $ = bu(D, G), tt = Ls(D, G) + 1;
          return Uu(D, $, tt).join("");
        }
        function qv(g, _, R) {
          if (g = Ze(g), g && (R || _ === e))
            return g.slice(0, wl(g) + 1);
          if (!g || !(_ = Ma(_)))
            return g;
          var D = vr(g), G = Ls(D, vr(_)) + 1;
          return Uu(D, 0, G).join("");
        }
        function Ia(g, _, R) {
          if (g = Ze(g), g && (R || _ === e))
            return g.replace(Si, "");
          if (!g || !(_ = Ma(_)))
            return g;
          var D = vr(g), G = bu(D, vr(_));
          return Uu(D, G).join("");
        }
        function o(g, _) {
          var R = ht, D = Ct;
          if (Pn(_)) {
            var G = "separator" in _ ? _.separator : G;
            R = "length" in _ ? _e(_.length) : R, D = "omission" in _ ? Ma(_.omission) : D;
          }
          g = Ze(g);
          var $ = g.length;
          if (Is(g)) {
            var tt = vr(g);
            $ = tt.length;
          }
          if (R >= $)
            return g;
          var lt = R - jr(D);
          if (lt < 1)
            return D;
          var _t = tt ? Uu(tt, 0, lt).join("") : g.slice(0, lt);
          if (G === e)
            return _t + D;
          if (tt && (lt += _t.length - lt), Cp(G)) {
            if (g.slice(lt).search(G)) {
              var Ht, Yt = _t;
              for (G.global || (G = Yc(G.source, Ze(Nc.exec(G)) + "g")), G.lastIndex = 0; Ht = G.exec(Yt); )
                var Vt = Ht.index;
              _t = _t.slice(0, Vt === e ? lt : Vt);
            }
          } else if (g.indexOf(Ma(G), lt) != lt) {
            var re = _t.lastIndexOf(G);
            re > -1 && (_t = _t.slice(0, re));
          }
          return _t + D;
        }
        function c(g) {
          return g = Ze(g), g && Be.test(g) ? g.replace(Jt, xi) : g;
        }
        var d = lr(function(g, _, R) {
          return g + (R ? " " : "") + _.toUpperCase();
        }), v = ea("toUpperCase");
        function T(g, _, R) {
          return g = Ze(g), _ = R ? e : _, _ === e ? ih(g) ? $0(g) : Om(g) : g.match(_) || [];
        }
        var M = an(function(g, _) {
          try {
            return yr(g, e, _);
          } catch (R) {
            return Tt(R) ? R : new Me(R);
          }
        }), P = di(function(g, _) {
          return fs(_, function(R) {
            R = Gn(R), ms(g, R, ec(g[R], g));
          }), g;
        });
        function q(g) {
          var _ = g == null ? 0 : g.length, R = ye();
          return g = _ ? Tn(g, function(D) {
            if (typeof D[1] != "function")
              throw new kr(f);
            return [R(D[0]), D[1]];
          }) : [], an(function(D) {
            for (var G = -1; ++G < _; ) {
              var $ = g[G];
              if (yr($[0], this, D))
                return yr($[1], this, D);
            }
          });
        }
        function it(g) {
          return ph(Fa(g, x));
        }
        function vt(g) {
          return function() {
            return g;
          };
        }
        function jt(g, _) {
          return g == null || g !== g ? _ : g;
        }
        var Bt = ks(), xt = ks(!0);
        function bt(g) {
          return g;
        }
        function we(g) {
          return Wm(typeof g == "function" ? g : Fa(g, x));
        }
        function Ee(g) {
          return tp(Fa(g, x));
        }
        function jn(g, _) {
          return _h(g, Fa(_, x));
        }
        var yt = an(function(g, _) {
          return function(R) {
            return Pu(R, g, _);
          };
        }), ct = an(function(g, _) {
          return function(R) {
            return Pu(g, R, _);
          };
        });
        function Et(g, _, R) {
          var D = ga(_), G = Tr(_, D);
          R == null && !(Pn(_) && (G.length || !D.length)) && (R = _, _ = g, g = this, G = Tr(_, ga(_)));
          var $ = !(Pn(R) && "chain" in R) || !!R.chain, tt = Eo(g);
          return fs(G, function(lt) {
            var _t = _[lt];
            g[lt] = _t, tt && (g.prototype[lt] = function() {
              var Ht = this.__chain__;
              if ($ || Ht) {
                var Yt = g(this.__wrapped__), Vt = Yt.__actions__ = li(this.__actions__);
                return Vt.push({ func: _t, args: arguments, thisArg: g }), Yt.__chain__ = Ht, Yt;
              }
              return _t.apply(g, Ji([this.value()], arguments));
            });
          }), g;
        }
        function kt() {
          return ji._ === this && (ji._ = Tu), this;
        }
        function le() {
        }
        function nn(g) {
          return g = _e(g), an(function(_) {
            return ep(_, g);
          });
        }
        var ve = Vo(Tn), Oe = Vo(Mm), Pa = Vo(Ad);
        function Cn(g) {
          return sg(g) ? eh(Gn(g)) : ay(g);
        }
        function nl(g) {
          return function(_) {
            return g == null ? e : fa(g, _);
          };
        }
        var NE = _s(), jw = _s(!0);
        function LE() {
          return [];
        }
        function IE() {
          return !1;
        }
        function kw() {
          return {};
        }
        function $S() {
          return "";
        }
        function Hw() {
          return !0;
        }
        function Bw(g, _) {
          if (g = _e(g), g < 1 || g > gt)
            return [];
          var R = j, D = fi(g, j);
          _ = ye(_), g -= j;
          for (var G = Ur(D, _); ++R < g; )
            _(R);
          return G;
        }
        function qw(g) {
          return be(g) ? Tn(g, Gn) : Mr(g) ? [g] : li(Bs(Ze(g)));
        }
        function Vw(g) {
          var _ = ++Hr;
          return Ze(g) + _;
        }
        var Yw = af(function(g, _) {
          return g + _;
        }, 0), Fw = Hu("ceil"), $w = af(function(g, _) {
          return g / _;
        }, 1), XS = Hu("floor");
        function Xw(g) {
          return g && g.length ? Yr(g, bt, Wc) : e;
        }
        function Kw(g, _) {
          return g && g.length ? Yr(g, ye(_, 2), Wc) : e;
        }
        function Zw(g) {
          return uv(g, bt);
        }
        function Ww(g, _) {
          return uv(g, ye(_, 2));
        }
        function Qw(g) {
          return g && g.length ? Yr(g, bt, Bd) : e;
        }
        function Jw(g, _) {
          return g && g.length ? Yr(g, ye(_, 2), Bd) : e;
        }
        var tR = af(function(g, _) {
          return g * _;
        }, 1), eR = Hu("round"), nR = af(function(g, _) {
          return g - _;
        }, 0);
        function KS(g) {
          return g && g.length ? qc(g, bt) : 0;
        }
        function PE(g, _) {
          return g && g.length ? qc(g, ye(_, 2)) : 0;
        }
        return V.after = RE, V.ary = Cv, V.assign = Wo, V.assignIn = Qo, V.assignInWith = yf, V.assignWith = oc, V.at = fr, V.before = xg, V.bind = ec, V.bindAll = P, V.bindKey = jh, V.castArray = ME, V.chain = hf, V.chunk = _v, V.compact = hp, V.concat = _y, V.cond = q, V.conforms = it, V.constant = vt, V.countBy = yo, V.create = es, V.curry = mf, V.curryRight = kh, V.debounce = Wl, V.defaults = lc, V.defaultsDeep = Dp, V.defer = _o, V.delay = Ql, V.difference = wi, V.differenceBy = Kr, V.differenceWith = qs, V.drop = vy, V.dropRight = mn, V.dropRightWhile = Ey, V.dropWhile = hg, V.fill = Zr, V.filter = Ay, V.flatMap = df, V.flatMapDeep = Tv, V.flatMapDepth = yp, V.flatten = Xa, V.flattenDeep = uf, V.flattenDepth = Yl, V.flip = AE, V.flow = Bt, V.flowRight = xt, V.fromPairs = Fl, V.functions = Np, V.functionsIn = Lp, V.groupBy = My, V.initial = Vs, V.intersection = po, V.intersectionBy = $l, V.intersectionWith = cf, V.invert = Fh, V.invertBy = zy, V.invokeMap = vp, V.iteratee = we, V.keyBy = Cy, V.keys = ga, V.keysIn = xa, V.map = vg, V.mapKeys = zv, V.mapValues = Gv, V.matches = Ee, V.matchesProperty = jn, V.memoize = Hh, V.merge = Uv, V.mergeWith = Ef, V.method = yt, V.methodOf = ct, V.mixin = Et, V.negate = nc, V.nthArg = nn, V.omit = Ng, V.omitBy = Lg, V.once = Dy, V.orderBy = wv, V.over = ve, V.overArgs = Ov, V.overEvery = Oe, V.overSome = Pa, V.partial = Bh, V.partialRight = Tg, V.partition = Rv, V.pick = Gy, V.pickBy = La, V.property = Cn, V.propertyOf = nl, V.pull = vv, V.pullAll = ff, V.pullAllBy = dp, V.pullAllWith = dg, V.pullAt = Es, V.range = NE, V.rangeRight = jw, V.rearg = qh, V.reject = bp, V.remove = Ev, V.rest = xp, V.reverse = gg, V.sampleSize = Oy, V.set = jv, V.setWith = Uy, V.shuffle = ai, V.slice = qn, V.sortBy = Sp, V.sortedUniq = Ku, V.sortedUniqBy = Sy, V.split = au, V.spread = Tp, V.tail = Kl, V.take = Hi, V.takeRight = Zu, V.takeRightWhile = Wu, V.takeWhile = xy, V.tap = mp, V.throttle = wp, V.thru = cr, V.toArray = qi, V.toPairs = Pp, V.toPairsIn = zp, V.toPath = qw, V.toPlainObject = Mg, V.transform = Gp, V.unary = Bi, V.union = ba, V.unionBy = Lh, V.unionWith = mg, V.uniq = Ar, V.uniqBy = Ty, V.uniqWith = wy, V.unset = jy, V.unzip = Ih, V.unzipWith = pg, V.update = Ig, V.updateWith = kv, V.values = bf, V.valuesIn = Up, V.without = $o, V.words = T, V.wrap = Ny, V.xor = Ka, V.xorBy = Qu, V.xorWith = Ju, V.zip = Ph, V.zipObject = Jr, V.zipObjectDeep = gp, V.zipWith = Ry, V.entries = Pp, V.entriesIn = zp, V.extend = Qo, V.extendWith = yf, Et(V, V), V.add = Yw, V.attempt = M, V.camelCase = Hv, V.capitalize = zg, V.ceil = Fw, V.clamp = ky, V.clone = He, V.cloneDeep = Jl, V.cloneDeepWith = Ke, V.cloneWith = CE, V.conformsTo = ic, V.deburr = Fs, V.defaultTo = jt, V.divide = $w, V.endsWith = tl, V.eq = Za, V.escape = iu, V.escapeRegExp = $h, V.every = Uh, V.find = xv, V.findIndex = Wr, V.findKey = Yh, V.findLast = tc, V.findLastIndex = lf, V.findLastKey = Cg, V.floor = XS, V.forEach = _p, V.forEachRight = _g, V.forIn = Py, V.forInRight = Og, V.forOwn = _f, V.forOwnRight = So, V.get = Dg, V.gt = wg, V.gte = Dv, V.has = Ip, V.hasIn = vf, V.head = gi, V.identity = bt, V.includes = gf, V.indexOf = by, V.inRange = Pg, V.invoke = Pv, V.isArguments = vo, V.isArray = be, V.isArrayBuffer = ac, V.isArrayLike = ia, V.isArrayLikeObject = Ci, V.isBoolean = Rp, V.isBuffer = ha, V.isDate = Ap, V.isElement = Nv, V.isEmpty = Rg, V.isEqual = ri, V.isEqualWith = Sa, V.isError = Tt, V.isFinite = Un, V.isFunction = Eo, V.isInteger = Vh, V.isLength = tu, V.isMap = rc, V.isMatch = Xo, V.isMatchWith = Mp, V.isNaN = Ko, V.isNative = Ly, V.isNil = OE, V.isNull = Lv, V.isNumber = Iv, V.isObject = Pn, V.isObjectLike = Vn, V.isPlainObject = aa, V.isRegExp = Cp, V.isSafeInteger = Ag, V.isSet = Op, V.isString = eu, V.isSymbol = Mr, V.isTypedArray = sc, V.isUndefined = bo, V.isWeakMap = Iy, V.isWeakSet = pf, V.join = $u, V.kebabCase = Gg, V.last = Ve, V.lastIndexOf = Xu, V.lowerCase = uc, V.lowerFirst = DE, V.lt = Wa, V.lte = ie, V.max = Xw, V.maxBy = Kw, V.mean = Zw, V.meanBy = Ww, V.min = Qw, V.minBy = Jw, V.stubArray = LE, V.stubFalse = IE, V.stubObject = kw, V.stubString = $S, V.stubTrue = Hw, V.multiply = tR, V.nth = Na, V.noConflict = kt, V.noop = le, V.now = Sg, V.pad = By, V.padEnd = el, V.padStart = qy, V.parseInt = Vy, V.random = Hy, V.reduce = Eg, V.reduceRight = Ep, V.repeat = Ug, V.replace = Yy, V.result = Jo, V.round = eR, V.runInContext = ft, V.sample = Av, V.size = bg, V.snakeCase = jp, V.some = Mv, V.sortedIndex = ii, V.sortedIndexBy = pn, V.sortedIndexOf = Rn, V.sortedLastIndex = In, V.sortedLastIndexBy = Qr, V.sortedLastIndexOf = Xl, V.startCase = kp, V.startsWith = jg, V.subtract = nR, V.sum = KS, V.sumBy = PE, V.template = Xh, V.times = Bw, V.toFinite = da, V.toInteger = _e, V.toLength = Zo, V.toLower = cc, V.toNumber = Ys, V.toSafeInteger = nu, V.toString = Ze, V.toUpper = Hp, V.trim = Bv, V.trimEnd = qv, V.trimStart = Ia, V.truncate = o, V.unescape = c, V.uniqueId = Vw, V.upperCase = d, V.upperFirst = v, V.each = _p, V.eachRight = _g, V.first = gi, Et(V, function() {
          var g = {};
          return Ni(V, function(_, R) {
            Nn.call(V.prototype, R) || (g[R] = _);
          }), g;
        }(), { chain: !1 }), V.VERSION = a, fs(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(g) {
          V[g].placeholder = V;
        }), fs(["drop", "take"], function(g, _) {
          fn.prototype[g] = function(R) {
            R = R === e ? 1 : oi(_e(R), 0);
            var D = this.__filtered__ && !_ ? new fn(this) : this.clone();
            return D.__filtered__ ? D.__takeCount__ = fi(R, D.__takeCount__) : D.__views__.push({
              size: fi(R, j),
              type: g + (D.__dir__ < 0 ? "Right" : "")
            }), D;
          }, fn.prototype[g + "Right"] = function(R) {
            return this.reverse()[g](R).reverse();
          };
        }), fs(["filter", "map", "takeWhile"], function(g, _) {
          var R = _ + 1, D = R == Ut || R == nt;
          fn.prototype[g] = function(G) {
            var $ = this.clone();
            return $.__iteratees__.push({
              iteratee: ye(G, 3),
              type: R
            }), $.__filtered__ = $.__filtered__ || D, $;
          };
        }), fs(["head", "last"], function(g, _) {
          var R = "take" + (_ ? "Right" : "");
          fn.prototype[g] = function() {
            return this[R](1).value()[0];
          };
        }), fs(["initial", "tail"], function(g, _) {
          var R = "drop" + (_ ? "" : "Right");
          fn.prototype[g] = function() {
            return this.__filtered__ ? new fn(this) : this[R](1);
          };
        }), fn.prototype.compact = function() {
          return this.filter(bt);
        }, fn.prototype.find = function(g) {
          return this.filter(g).head();
        }, fn.prototype.findLast = function(g) {
          return this.reverse().find(g);
        }, fn.prototype.invokeMap = an(function(g, _) {
          return typeof g == "function" ? new fn(this) : this.map(function(R) {
            return Pu(R, g, _);
          });
        }), fn.prototype.reject = function(g) {
          return this.filter(nc(ye(g)));
        }, fn.prototype.slice = function(g, _) {
          g = _e(g);
          var R = this;
          return R.__filtered__ && (g > 0 || _ < 0) ? new fn(R) : (g < 0 ? R = R.takeRight(-g) : g && (R = R.drop(g)), _ !== e && (_ = _e(_), R = _ < 0 ? R.dropRight(-_) : R.take(_ - g)), R);
        }, fn.prototype.takeRightWhile = function(g) {
          return this.reverse().takeWhile(g).reverse();
        }, fn.prototype.toArray = function() {
          return this.take(j);
        }, Ni(fn.prototype, function(g, _) {
          var R = /^(?:filter|find|map|reject)|While$/.test(_), D = /^(?:head|last)$/.test(_), G = V[D ? "take" + (_ == "last" ? "Right" : "") : _], $ = D || /^find/.test(_);
          G && (V.prototype[_] = function() {
            var tt = this.__wrapped__, lt = D ? [1] : arguments, _t = tt instanceof fn, Ht = lt[0], Yt = _t || be(tt), Vt = function(rn) {
              var bn = G.apply(V, Ji([rn], lt));
              return D && re ? bn[0] : bn;
            };
            Yt && R && typeof Ht == "function" && Ht.length != 1 && (_t = Yt = !1);
            var re = this.__chain__, he = !!this.__actions__.length, De = $ && !re, We = _t && !he;
            if (!$ && Yt) {
              tt = We ? tt : new fn(this);
              var Ne = g.apply(tt, lt);
              return Ne.__actions__.push({ func: cr, args: [Vt], thisArg: e }), new Sr(Ne, re);
            }
            return De && We ? g.apply(this, lt) : (Ne = this.thru(Vt), De ? D ? Ne.value()[0] : Ne.value() : Ne);
          });
        }), fs(["pop", "push", "shift", "sort", "splice", "unshift"], function(g) {
          var _ = Gm[g], R = /^(?:push|sort|unshift)$/.test(g) ? "tap" : "thru", D = /^(?:pop|shift)$/.test(g);
          V.prototype[g] = function() {
            var G = arguments;
            if (D && !this.__chain__) {
              var $ = this.value();
              return _.apply(be($) ? $ : [], G);
            }
            return this[R](function(tt) {
              return _.apply(be(tt) ? tt : [], G);
            });
          };
        }), Ni(fn.prototype, function(g, _) {
          var R = V[_];
          if (R) {
            var D = R.name + "";
            Nn.call(or, D) || (or[D] = []), or[D].push({ name: _, func: R });
          }
        }), or[Mi(e, U).name] = [{
          name: "wrapper",
          func: e
        }], fn.prototype.clone = Ld, fn.prototype.reverse = Id, fn.prototype.value = Ou, V.prototype.at = bv, V.prototype.chain = ts, V.prototype.commit = Sv, V.prototype.next = zh, V.prototype.plant = Zl, V.prototype.reverse = yg, V.prototype.toJSON = V.prototype.valueOf = V.prototype.value = Gh, V.prototype.first = V.prototype.head, Ru && (V.prototype[Ru] = pp), V;
      }, zs = Ps();
      io ? ((io.exports = zs)._ = zs, Wf._ = zs) : ji._ = zs;
    }).call(Ek);
  }(Ob, Ob.exports)), Ob.exports;
}
var Re = bk(), Vx = { exports: {} }, Yx = { exports: {} }, pi = {};
/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var GD;
function Sk() {
  if (GD) return pi;
  GD = 1;
  var n = typeof Symbol == "function" && Symbol.for, t = n ? Symbol.for("react.element") : 60103, e = n ? Symbol.for("react.portal") : 60106, a = n ? Symbol.for("react.fragment") : 60107, s = n ? Symbol.for("react.strict_mode") : 60108, l = n ? Symbol.for("react.profiler") : 60114, f = n ? Symbol.for("react.provider") : 60109, h = n ? Symbol.for("react.context") : 60110, p = n ? Symbol.for("react.async_mode") : 60111, y = n ? Symbol.for("react.concurrent_mode") : 60111, b = n ? Symbol.for("react.forward_ref") : 60112, x = n ? Symbol.for("react.suspense") : 60113, w = n ? Symbol.for("react.suspense_list") : 60120, A = n ? Symbol.for("react.memo") : 60115, C = n ? Symbol.for("react.lazy") : 60116, L = n ? Symbol.for("react.block") : 60121, N = n ? Symbol.for("react.fundamental") : 60117, U = n ? Symbol.for("react.responder") : 60118, k = n ? Symbol.for("react.scope") : 60119;
  function H(z) {
    if (typeof z == "object" && z !== null) {
      var Q = z.$$typeof;
      switch (Q) {
        case t:
          switch (z = z.type, z) {
            case p:
            case y:
            case a:
            case l:
            case s:
            case x:
              return z;
            default:
              switch (z = z && z.$$typeof, z) {
                case h:
                case b:
                case C:
                case A:
                case f:
                  return z;
                default:
                  return Q;
              }
          }
        case e:
          return Q;
      }
    }
  }
  function B(z) {
    return H(z) === y;
  }
  return pi.AsyncMode = p, pi.ConcurrentMode = y, pi.ContextConsumer = h, pi.ContextProvider = f, pi.Element = t, pi.ForwardRef = b, pi.Fragment = a, pi.Lazy = C, pi.Memo = A, pi.Portal = e, pi.Profiler = l, pi.StrictMode = s, pi.Suspense = x, pi.isAsyncMode = function(z) {
    return B(z) || H(z) === p;
  }, pi.isConcurrentMode = B, pi.isContextConsumer = function(z) {
    return H(z) === h;
  }, pi.isContextProvider = function(z) {
    return H(z) === f;
  }, pi.isElement = function(z) {
    return typeof z == "object" && z !== null && z.$$typeof === t;
  }, pi.isForwardRef = function(z) {
    return H(z) === b;
  }, pi.isFragment = function(z) {
    return H(z) === a;
  }, pi.isLazy = function(z) {
    return H(z) === C;
  }, pi.isMemo = function(z) {
    return H(z) === A;
  }, pi.isPortal = function(z) {
    return H(z) === e;
  }, pi.isProfiler = function(z) {
    return H(z) === l;
  }, pi.isStrictMode = function(z) {
    return H(z) === s;
  }, pi.isSuspense = function(z) {
    return H(z) === x;
  }, pi.isValidElementType = function(z) {
    return typeof z == "string" || typeof z == "function" || z === a || z === y || z === l || z === s || z === x || z === w || typeof z == "object" && z !== null && (z.$$typeof === C || z.$$typeof === A || z.$$typeof === f || z.$$typeof === h || z.$$typeof === b || z.$$typeof === N || z.$$typeof === U || z.$$typeof === k || z.$$typeof === L);
  }, pi.typeOf = H, pi;
}
var yi = {}, UD;
function xk() {
  if (UD) return yi;
  UD = 1;
  var n = {};
  /** @license React v16.13.1
   * react-is.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return n.NODE_ENV !== "production" && function() {
    var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, a = t ? Symbol.for("react.portal") : 60106, s = t ? Symbol.for("react.fragment") : 60107, l = t ? Symbol.for("react.strict_mode") : 60108, f = t ? Symbol.for("react.profiler") : 60114, h = t ? Symbol.for("react.provider") : 60109, p = t ? Symbol.for("react.context") : 60110, y = t ? Symbol.for("react.async_mode") : 60111, b = t ? Symbol.for("react.concurrent_mode") : 60111, x = t ? Symbol.for("react.forward_ref") : 60112, w = t ? Symbol.for("react.suspense") : 60113, A = t ? Symbol.for("react.suspense_list") : 60120, C = t ? Symbol.for("react.memo") : 60115, L = t ? Symbol.for("react.lazy") : 60116, N = t ? Symbol.for("react.block") : 60121, U = t ? Symbol.for("react.fundamental") : 60117, k = t ? Symbol.for("react.responder") : 60118, H = t ? Symbol.for("react.scope") : 60119;
    function B(te) {
      return typeof te == "string" || typeof te == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
      te === s || te === b || te === f || te === l || te === w || te === A || typeof te == "object" && te !== null && (te.$$typeof === L || te.$$typeof === C || te.$$typeof === h || te.$$typeof === p || te.$$typeof === x || te.$$typeof === U || te.$$typeof === k || te.$$typeof === H || te.$$typeof === N);
    }
    function z(te) {
      if (typeof te == "object" && te !== null) {
        var tn = te.$$typeof;
        switch (tn) {
          case e:
            var Jn = te.type;
            switch (Jn) {
              case y:
              case b:
              case s:
              case f:
              case l:
              case w:
                return Jn;
              default:
                var Pi = Jn && Jn.$$typeof;
                switch (Pi) {
                  case p:
                  case x:
                  case L:
                  case C:
                  case h:
                    return Pi;
                  default:
                    return tn;
                }
            }
          case a:
            return tn;
        }
      }
    }
    var Q = y, et = b, ot = p, pt = h, ht = e, Ct = x, mt = s, St = L, Ut = C, Ft = a, nt = f, J = l, gt = w, Ot = !1;
    function W(te) {
      return Ot || (Ot = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), j(te) || z(te) === y;
    }
    function j(te) {
      return z(te) === b;
    }
    function X(te) {
      return z(te) === p;
    }
    function st(te) {
      return z(te) === h;
    }
    function At(te) {
      return typeof te == "object" && te !== null && te.$$typeof === e;
    }
    function Dt(te) {
      return z(te) === x;
    }
    function It(te) {
      return z(te) === s;
    }
    function $t(te) {
      return z(te) === L;
    }
    function Qt(te) {
      return z(te) === C;
    }
    function ee(te) {
      return z(te) === a;
    }
    function ce(te) {
      return z(te) === f;
    }
    function pe(te) {
      return z(te) === l;
    }
    function Mn(te) {
      return z(te) === w;
    }
    yi.AsyncMode = Q, yi.ConcurrentMode = et, yi.ContextConsumer = ot, yi.ContextProvider = pt, yi.Element = ht, yi.ForwardRef = Ct, yi.Fragment = mt, yi.Lazy = St, yi.Memo = Ut, yi.Portal = Ft, yi.Profiler = nt, yi.StrictMode = J, yi.Suspense = gt, yi.isAsyncMode = W, yi.isConcurrentMode = j, yi.isContextConsumer = X, yi.isContextProvider = st, yi.isElement = At, yi.isForwardRef = Dt, yi.isFragment = It, yi.isLazy = $t, yi.isMemo = Qt, yi.isPortal = ee, yi.isProfiler = ce, yi.isStrictMode = pe, yi.isSuspense = Mn, yi.isValidElementType = B, yi.typeOf = z;
  }(), yi;
}
var jD;
function H8() {
  if (jD) return Yx.exports;
  jD = 1;
  var n = {};
  return n.NODE_ENV === "production" ? Yx.exports = Sk() : Yx.exports = xk(), Yx.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var oA, kD;
function Tk() {
  if (kD) return oA;
  kD = 1;
  var n = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, e = Object.prototype.propertyIsEnumerable;
  function a(l) {
    if (l == null)
      throw new TypeError("Object.assign cannot be called with null or undefined");
    return Object(l);
  }
  function s() {
    try {
      if (!Object.assign)
        return !1;
      var l = new String("abc");
      if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
        return !1;
      for (var f = {}, h = 0; h < 10; h++)
        f["_" + String.fromCharCode(h)] = h;
      var p = Object.getOwnPropertyNames(f).map(function(b) {
        return f[b];
      });
      if (p.join("") !== "0123456789")
        return !1;
      var y = {};
      return "abcdefghijklmnopqrst".split("").forEach(function(b) {
        y[b] = b;
      }), Object.keys(Object.assign({}, y)).join("") === "abcdefghijklmnopqrst";
    } catch {
      return !1;
    }
  }
  return oA = s() ? Object.assign : function(l, f) {
    for (var h, p = a(l), y, b = 1; b < arguments.length; b++) {
      h = Object(arguments[b]);
      for (var x in h)
        t.call(h, x) && (p[x] = h[x]);
      if (n) {
        y = n(h);
        for (var w = 0; w < y.length; w++)
          e.call(h, y[w]) && (p[y[w]] = h[y[w]]);
      }
    }
    return p;
  }, oA;
}
var lA, HD;
function RC() {
  if (HD) return lA;
  HD = 1;
  var n = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  return lA = n, lA;
}
var uA, BD;
function B8() {
  return BD || (BD = 1, uA = Function.call.bind(Object.prototype.hasOwnProperty)), uA;
}
var cA, qD;
function wk() {
  if (qD) return cA;
  qD = 1;
  var n = {}, t = function() {
  };
  if (n.NODE_ENV !== "production") {
    var e = /* @__PURE__ */ RC(), a = {}, s = /* @__PURE__ */ B8();
    t = function(f) {
      var h = "Warning: " + f;
      typeof console < "u" && console.error(h);
      try {
        throw new Error(h);
      } catch {
      }
    };
  }
  function l(f, h, p, y, b) {
    if (n.NODE_ENV !== "production") {
      for (var x in f)
        if (s(f, x)) {
          var w;
          try {
            if (typeof f[x] != "function") {
              var A = Error(
                (y || "React class") + ": " + p + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof f[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
              );
              throw A.name = "Invariant Violation", A;
            }
            w = f[x](h, x, y, p, null, e);
          } catch (L) {
            w = L;
          }
          if (w && !(w instanceof Error) && t(
            (y || "React class") + ": type specification of " + p + " `" + x + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof w + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
          ), w instanceof Error && !(w.message in a)) {
            a[w.message] = !0;
            var C = b ? b() : "";
            t(
              "Failed " + p + " type: " + w.message + (C ?? "")
            );
          }
        }
    }
  }
  return l.resetWarningCache = function() {
    n.NODE_ENV !== "production" && (a = {});
  }, cA = l, cA;
}
var fA, VD;
function Rk() {
  if (VD) return fA;
  VD = 1;
  var n = {}, t = H8(), e = Tk(), a = /* @__PURE__ */ RC(), s = /* @__PURE__ */ B8(), l = /* @__PURE__ */ wk(), f = function() {
  };
  n.NODE_ENV !== "production" && (f = function(p) {
    var y = "Warning: " + p;
    typeof console < "u" && console.error(y);
    try {
      throw new Error(y);
    } catch {
    }
  });
  function h() {
    return null;
  }
  return fA = function(p, y) {
    var b = typeof Symbol == "function" && Symbol.iterator, x = "@@iterator";
    function w(j) {
      var X = j && (b && j[b] || j[x]);
      if (typeof X == "function")
        return X;
    }
    var A = "<<anonymous>>", C = {
      array: k("array"),
      bigint: k("bigint"),
      bool: k("boolean"),
      func: k("function"),
      number: k("number"),
      object: k("object"),
      string: k("string"),
      symbol: k("symbol"),
      any: H(),
      arrayOf: B,
      element: z(),
      elementType: Q(),
      instanceOf: et,
      node: Ct(),
      objectOf: pt,
      oneOf: ot,
      oneOfType: ht,
      shape: St,
      exact: Ut
    };
    function L(j, X) {
      return j === X ? j !== 0 || 1 / j === 1 / X : j !== j && X !== X;
    }
    function N(j, X) {
      this.message = j, this.data = X && typeof X == "object" ? X : {}, this.stack = "";
    }
    N.prototype = Error.prototype;
    function U(j) {
      if (n.NODE_ENV !== "production")
        var X = {}, st = 0;
      function At(It, $t, Qt, ee, ce, pe, Mn) {
        if (ee = ee || A, pe = pe || Qt, Mn !== a) {
          if (y) {
            var te = new Error(
              "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
            );
            throw te.name = "Invariant Violation", te;
          } else if (n.NODE_ENV !== "production" && typeof console < "u") {
            var tn = ee + ":" + Qt;
            !X[tn] && // Avoid spamming the console because they are often not actionable except for lib authors
            st < 3 && (f(
              "You are manually calling a React.PropTypes validation function for the `" + pe + "` prop on `" + ee + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
            ), X[tn] = !0, st++);
          }
        }
        return $t[Qt] == null ? It ? $t[Qt] === null ? new N("The " + ce + " `" + pe + "` is marked as required " + ("in `" + ee + "`, but its value is `null`.")) : new N("The " + ce + " `" + pe + "` is marked as required in " + ("`" + ee + "`, but its value is `undefined`.")) : null : j($t, Qt, ee, ce, pe);
      }
      var Dt = At.bind(null, !1);
      return Dt.isRequired = At.bind(null, !0), Dt;
    }
    function k(j) {
      function X(st, At, Dt, It, $t, Qt) {
        var ee = st[At], ce = J(ee);
        if (ce !== j) {
          var pe = gt(ee);
          return new N(
            "Invalid " + It + " `" + $t + "` of type " + ("`" + pe + "` supplied to `" + Dt + "`, expected ") + ("`" + j + "`."),
            { expectedType: j }
          );
        }
        return null;
      }
      return U(X);
    }
    function H() {
      return U(h);
    }
    function B(j) {
      function X(st, At, Dt, It, $t) {
        if (typeof j != "function")
          return new N("Property `" + $t + "` of component `" + Dt + "` has invalid PropType notation inside arrayOf.");
        var Qt = st[At];
        if (!Array.isArray(Qt)) {
          var ee = J(Qt);
          return new N("Invalid " + It + " `" + $t + "` of type " + ("`" + ee + "` supplied to `" + Dt + "`, expected an array."));
        }
        for (var ce = 0; ce < Qt.length; ce++) {
          var pe = j(Qt, ce, Dt, It, $t + "[" + ce + "]", a);
          if (pe instanceof Error)
            return pe;
        }
        return null;
      }
      return U(X);
    }
    function z() {
      function j(X, st, At, Dt, It) {
        var $t = X[st];
        if (!p($t)) {
          var Qt = J($t);
          return new N("Invalid " + Dt + " `" + It + "` of type " + ("`" + Qt + "` supplied to `" + At + "`, expected a single ReactElement."));
        }
        return null;
      }
      return U(j);
    }
    function Q() {
      function j(X, st, At, Dt, It) {
        var $t = X[st];
        if (!t.isValidElementType($t)) {
          var Qt = J($t);
          return new N("Invalid " + Dt + " `" + It + "` of type " + ("`" + Qt + "` supplied to `" + At + "`, expected a single ReactElement type."));
        }
        return null;
      }
      return U(j);
    }
    function et(j) {
      function X(st, At, Dt, It, $t) {
        if (!(st[At] instanceof j)) {
          var Qt = j.name || A, ee = W(st[At]);
          return new N("Invalid " + It + " `" + $t + "` of type " + ("`" + ee + "` supplied to `" + Dt + "`, expected ") + ("instance of `" + Qt + "`."));
        }
        return null;
      }
      return U(X);
    }
    function ot(j) {
      if (!Array.isArray(j))
        return n.NODE_ENV !== "production" && (arguments.length > 1 ? f(
          "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
        ) : f("Invalid argument supplied to oneOf, expected an array.")), h;
      function X(st, At, Dt, It, $t) {
        for (var Qt = st[At], ee = 0; ee < j.length; ee++)
          if (L(Qt, j[ee]))
            return null;
        var ce = JSON.stringify(j, function(Mn, te) {
          var tn = gt(te);
          return tn === "symbol" ? String(te) : te;
        });
        return new N("Invalid " + It + " `" + $t + "` of value `" + String(Qt) + "` " + ("supplied to `" + Dt + "`, expected one of " + ce + "."));
      }
      return U(X);
    }
    function pt(j) {
      function X(st, At, Dt, It, $t) {
        if (typeof j != "function")
          return new N("Property `" + $t + "` of component `" + Dt + "` has invalid PropType notation inside objectOf.");
        var Qt = st[At], ee = J(Qt);
        if (ee !== "object")
          return new N("Invalid " + It + " `" + $t + "` of type " + ("`" + ee + "` supplied to `" + Dt + "`, expected an object."));
        for (var ce in Qt)
          if (s(Qt, ce)) {
            var pe = j(Qt, ce, Dt, It, $t + "." + ce, a);
            if (pe instanceof Error)
              return pe;
          }
        return null;
      }
      return U(X);
    }
    function ht(j) {
      if (!Array.isArray(j))
        return n.NODE_ENV !== "production" && f("Invalid argument supplied to oneOfType, expected an instance of array."), h;
      for (var X = 0; X < j.length; X++) {
        var st = j[X];
        if (typeof st != "function")
          return f(
            "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Ot(st) + " at index " + X + "."
          ), h;
      }
      function At(Dt, It, $t, Qt, ee) {
        for (var ce = [], pe = 0; pe < j.length; pe++) {
          var Mn = j[pe], te = Mn(Dt, It, $t, Qt, ee, a);
          if (te == null)
            return null;
          te.data && s(te.data, "expectedType") && ce.push(te.data.expectedType);
        }
        var tn = ce.length > 0 ? ", expected one of type [" + ce.join(", ") + "]" : "";
        return new N("Invalid " + Qt + " `" + ee + "` supplied to " + ("`" + $t + "`" + tn + "."));
      }
      return U(At);
    }
    function Ct() {
      function j(X, st, At, Dt, It) {
        return Ft(X[st]) ? null : new N("Invalid " + Dt + " `" + It + "` supplied to " + ("`" + At + "`, expected a ReactNode."));
      }
      return U(j);
    }
    function mt(j, X, st, At, Dt) {
      return new N(
        (j || "React class") + ": " + X + " type `" + st + "." + At + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Dt + "`."
      );
    }
    function St(j) {
      function X(st, At, Dt, It, $t) {
        var Qt = st[At], ee = J(Qt);
        if (ee !== "object")
          return new N("Invalid " + It + " `" + $t + "` of type `" + ee + "` " + ("supplied to `" + Dt + "`, expected `object`."));
        for (var ce in j) {
          var pe = j[ce];
          if (typeof pe != "function")
            return mt(Dt, It, $t, ce, gt(pe));
          var Mn = pe(Qt, ce, Dt, It, $t + "." + ce, a);
          if (Mn)
            return Mn;
        }
        return null;
      }
      return U(X);
    }
    function Ut(j) {
      function X(st, At, Dt, It, $t) {
        var Qt = st[At], ee = J(Qt);
        if (ee !== "object")
          return new N("Invalid " + It + " `" + $t + "` of type `" + ee + "` " + ("supplied to `" + Dt + "`, expected `object`."));
        var ce = e({}, st[At], j);
        for (var pe in ce) {
          var Mn = j[pe];
          if (s(j, pe) && typeof Mn != "function")
            return mt(Dt, It, $t, pe, gt(Mn));
          if (!Mn)
            return new N(
              "Invalid " + It + " `" + $t + "` key `" + pe + "` supplied to `" + Dt + "`.\nBad object: " + JSON.stringify(st[At], null, "  ") + `
Valid keys: ` + JSON.stringify(Object.keys(j), null, "  ")
            );
          var te = Mn(Qt, pe, Dt, It, $t + "." + pe, a);
          if (te)
            return te;
        }
        return null;
      }
      return U(X);
    }
    function Ft(j) {
      switch (typeof j) {
        case "number":
        case "string":
        case "undefined":
          return !0;
        case "boolean":
          return !j;
        case "object":
          if (Array.isArray(j))
            return j.every(Ft);
          if (j === null || p(j))
            return !0;
          var X = w(j);
          if (X) {
            var st = X.call(j), At;
            if (X !== j.entries) {
              for (; !(At = st.next()).done; )
                if (!Ft(At.value))
                  return !1;
            } else
              for (; !(At = st.next()).done; ) {
                var Dt = At.value;
                if (Dt && !Ft(Dt[1]))
                  return !1;
              }
          } else
            return !1;
          return !0;
        default:
          return !1;
      }
    }
    function nt(j, X) {
      return j === "symbol" ? !0 : X ? X["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && X instanceof Symbol : !1;
    }
    function J(j) {
      var X = typeof j;
      return Array.isArray(j) ? "array" : j instanceof RegExp ? "object" : nt(X, j) ? "symbol" : X;
    }
    function gt(j) {
      if (typeof j > "u" || j === null)
        return "" + j;
      var X = J(j);
      if (X === "object") {
        if (j instanceof Date)
          return "date";
        if (j instanceof RegExp)
          return "regexp";
      }
      return X;
    }
    function Ot(j) {
      var X = gt(j);
      switch (X) {
        case "array":
        case "object":
          return "an " + X;
        case "boolean":
        case "date":
        case "regexp":
          return "a " + X;
        default:
          return X;
      }
    }
    function W(j) {
      return !j.constructor || !j.constructor.name ? A : j.constructor.name;
    }
    return C.checkPropTypes = l, C.resetWarningCache = l.resetWarningCache, C.PropTypes = C, C;
  }, fA;
}
var hA, YD;
function Ak() {
  if (YD) return hA;
  YD = 1;
  var n = /* @__PURE__ */ RC();
  function t() {
  }
  function e() {
  }
  return e.resetWarningCache = t, hA = function() {
    function a(f, h, p, y, b, x) {
      if (x !== n) {
        var w = new Error(
          "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
        );
        throw w.name = "Invariant Violation", w;
      }
    }
    a.isRequired = a;
    function s() {
      return a;
    }
    var l = {
      array: a,
      bigint: a,
      bool: a,
      func: a,
      number: a,
      object: a,
      string: a,
      symbol: a,
      any: a,
      arrayOf: s,
      element: a,
      elementType: a,
      instanceOf: s,
      node: a,
      objectOf: s,
      oneOf: s,
      oneOfType: s,
      shape: s,
      exact: s,
      checkPropTypes: e,
      resetWarningCache: t
    };
    return l.PropTypes = l, l;
  }, hA;
}
var FD;
function Mk() {
  if (FD) return Vx.exports;
  FD = 1;
  var n = {};
  if (n.NODE_ENV !== "production") {
    var t = H8(), e = !0;
    Vx.exports = /* @__PURE__ */ Rk()(t.isElement, e);
  } else
    Vx.exports = /* @__PURE__ */ Ak()();
  return Vx.exports;
}
var Ck = /* @__PURE__ */ Mk();
const wa = /* @__PURE__ */ FI(Ck);
var tr = {};
function ws(n) {
  return `Minified Redux error #${n}; visit https://redux.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `;
}
var Ok = typeof Symbol == "function" && Symbol.observable || "@@observable", $D = Ok, dA = () => Math.random().toString(36).substring(7).split("").join("."), Dk = {
  INIT: `@@redux/INIT${/* @__PURE__ */ dA()}`,
  REPLACE: `@@redux/REPLACE${/* @__PURE__ */ dA()}`,
  PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${dA()}`
}, A_ = Dk;
function MS(n) {
  if (typeof n != "object" || n === null)
    return !1;
  let t = n;
  for (; Object.getPrototypeOf(t) !== null; )
    t = Object.getPrototypeOf(t);
  return Object.getPrototypeOf(n) === t || Object.getPrototypeOf(n) === null;
}
function Nk(n) {
  if (n === void 0)
    return "undefined";
  if (n === null)
    return "null";
  const t = typeof n;
  switch (t) {
    case "boolean":
    case "string":
    case "number":
    case "symbol":
    case "function":
      return t;
  }
  if (Array.isArray(n))
    return "array";
  if (Pk(n))
    return "date";
  if (Ik(n))
    return "error";
  const e = Lk(n);
  switch (e) {
    case "Symbol":
    case "Promise":
    case "WeakMap":
    case "WeakSet":
    case "Map":
    case "Set":
      return e;
  }
  return Object.prototype.toString.call(n).slice(8, -1).toLowerCase().replace(/\s/g, "");
}
function Lk(n) {
  return typeof n.constructor == "function" ? n.constructor.name : null;
}
function Ik(n) {
  return n instanceof Error || typeof n.message == "string" && n.constructor && typeof n.constructor.stackTraceLimit == "number";
}
function Pk(n) {
  return n instanceof Date ? !0 : typeof n.toDateString == "function" && typeof n.getDate == "function" && typeof n.setDate == "function";
}
function l0(n) {
  let t = typeof n;
  return tr.NODE_ENV !== "production" && (t = Nk(n)), t;
}
function q8(n, t, e) {
  if (typeof n != "function")
    throw new Error(tr.NODE_ENV === "production" ? ws(2) : `Expected the root reducer to be a function. Instead, received: '${l0(n)}'`);
  if (typeof t == "function" && typeof e == "function" || typeof e == "function" && typeof arguments[3] == "function")
    throw new Error(tr.NODE_ENV === "production" ? ws(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
  if (typeof t == "function" && typeof e > "u" && (e = t, t = void 0), typeof e < "u") {
    if (typeof e != "function")
      throw new Error(tr.NODE_ENV === "production" ? ws(1) : `Expected the enhancer to be a function. Instead, received: '${l0(e)}'`);
    return e(q8)(n, t);
  }
  let a = n, s = t, l = /* @__PURE__ */ new Map(), f = l, h = 0, p = !1;
  function y() {
    f === l && (f = /* @__PURE__ */ new Map(), l.forEach((N, U) => {
      f.set(U, N);
    }));
  }
  function b() {
    if (p)
      throw new Error(tr.NODE_ENV === "production" ? ws(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
    return s;
  }
  function x(N) {
    if (typeof N != "function")
      throw new Error(tr.NODE_ENV === "production" ? ws(4) : `Expected the listener to be a function. Instead, received: '${l0(N)}'`);
    if (p)
      throw new Error(tr.NODE_ENV === "production" ? ws(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
    let U = !0;
    y();
    const k = h++;
    return f.set(k, N), function() {
      if (U) {
        if (p)
          throw new Error(tr.NODE_ENV === "production" ? ws(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
        U = !1, y(), f.delete(k), l = null;
      }
    };
  }
  function w(N) {
    if (!MS(N))
      throw new Error(tr.NODE_ENV === "production" ? ws(7) : `Actions must be plain objects. Instead, the actual type was: '${l0(N)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);
    if (typeof N.type > "u")
      throw new Error(tr.NODE_ENV === "production" ? ws(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
    if (typeof N.type != "string")
      throw new Error(tr.NODE_ENV === "production" ? ws(17) : `Action "type" property must be a string. Instead, the actual type was: '${l0(N.type)}'. Value was: '${N.type}' (stringified)`);
    if (p)
      throw new Error(tr.NODE_ENV === "production" ? ws(9) : "Reducers may not dispatch actions.");
    try {
      p = !0, s = a(s, N);
    } finally {
      p = !1;
    }
    return (l = f).forEach((k) => {
      k();
    }), N;
  }
  function A(N) {
    if (typeof N != "function")
      throw new Error(tr.NODE_ENV === "production" ? ws(10) : `Expected the nextReducer to be a function. Instead, received: '${l0(N)}`);
    a = N, w({
      type: A_.REPLACE
    });
  }
  function C() {
    const N = x;
    return {
      /**
       * The minimal observable subscription method.
       * @param observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe(U) {
        if (typeof U != "object" || U === null)
          throw new Error(tr.NODE_ENV === "production" ? ws(11) : `Expected the observer to be an object. Instead, received: '${l0(U)}'`);
        function k() {
          const B = U;
          B.next && B.next(b());
        }
        return k(), {
          unsubscribe: N(k)
        };
      },
      [$D]() {
        return this;
      }
    };
  }
  return w({
    type: A_.INIT
  }), {
    dispatch: w,
    subscribe: x,
    getState: b,
    replaceReducer: A,
    [$D]: C
  };
}
function XD(n) {
  typeof console < "u" && typeof console.error == "function" && console.error(n);
  try {
    throw new Error(n);
  } catch {
  }
}
function zk(n, t, e, a) {
  const s = Object.keys(t), l = e && e.type === A_.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
  if (s.length === 0)
    return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
  if (!MS(n))
    return `The ${l} has unexpected type of "${l0(n)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;
  const f = Object.keys(n).filter((h) => !t.hasOwnProperty(h) && !a[h]);
  if (f.forEach((h) => {
    a[h] = !0;
  }), !(e && e.type === A_.REPLACE) && f.length > 0)
    return `Unexpected ${f.length > 1 ? "keys" : "key"} "${f.join('", "')}" found in ${l}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`;
}
function Gk(n) {
  Object.keys(n).forEach((t) => {
    const e = n[t];
    if (typeof e(void 0, {
      type: A_.INIT
    }) > "u")
      throw new Error(tr.NODE_ENV === "production" ? ws(12) : `The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
    if (typeof e(void 0, {
      type: A_.PROBE_UNKNOWN_ACTION()
    }) > "u")
      throw new Error(tr.NODE_ENV === "production" ? ws(13) : `The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${A_.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
  });
}
function Uk(n) {
  const t = Object.keys(n), e = {};
  for (let f = 0; f < t.length; f++) {
    const h = t[f];
    tr.NODE_ENV !== "production" && typeof n[h] > "u" && XD(`No reducer provided for key "${h}"`), typeof n[h] == "function" && (e[h] = n[h]);
  }
  const a = Object.keys(e);
  let s;
  tr.NODE_ENV !== "production" && (s = {});
  let l;
  try {
    Gk(e);
  } catch (f) {
    l = f;
  }
  return function(h = {}, p) {
    if (l)
      throw l;
    if (tr.NODE_ENV !== "production") {
      const x = zk(h, e, p, s);
      x && XD(x);
    }
    let y = !1;
    const b = {};
    for (let x = 0; x < a.length; x++) {
      const w = a[x], A = e[w], C = h[w], L = A(C, p);
      if (typeof L > "u") {
        const N = p && p.type;
        throw new Error(tr.NODE_ENV === "production" ? ws(14) : `When called with an action of type ${N ? `"${String(N)}"` : "(unknown type)"}, the slice reducer for key "${w}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
      }
      b[w] = L, y = y || L !== C;
    }
    return y = y || a.length !== Object.keys(h).length, y ? b : h;
  };
}
function jT(...n) {
  return n.length === 0 ? (t) => t : n.length === 1 ? n[0] : n.reduce((t, e) => (...a) => t(e(...a)));
}
function jk(...n) {
  return (t) => (e, a) => {
    const s = t(e, a);
    let l = () => {
      throw new Error(tr.NODE_ENV === "production" ? ws(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
    };
    const f = {
      getState: s.getState,
      dispatch: (p, ...y) => l(p, ...y)
    }, h = n.map((p) => p(f));
    return l = jT(...h)(s.dispatch), {
      ...s,
      dispatch: l
    };
  };
}
function V8(n) {
  return MS(n) && "type" in n && typeof n.type == "string";
}
var CS = {}, Y8 = Symbol.for("immer-nothing"), KD = Symbol.for("immer-draftable"), cu = Symbol.for("immer-state"), kk = CS.NODE_ENV !== "production" ? [
  // All error codes, starting by 0:
  function(n) {
    return `The plugin for '${n}' has not been loaded into Immer. To enable the plugin, import and call \`enable${n}()\` when initializing your application.`;
  },
  function(n) {
    return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${n}'`;
  },
  "This object has been frozen and should not be mutated",
  function(n) {
    return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n;
  },
  "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
  "Immer forbids circular references",
  "The first or second argument to `produce` must be a function",
  "The third argument to `produce` must be a function or undefined",
  "First argument to `createDraft` must be a plain object, an array, or an immerable object",
  "First argument to `finishDraft` must be a draft returned by `createDraft`",
  function(n) {
    return `'current' expects a draft, got: ${n}`;
  },
  "Object.defineProperty() cannot be used on an Immer draft",
  "Object.setPrototypeOf() cannot be used on an Immer draft",
  "Immer only supports deleting array indices",
  "Immer only supports setting array indices and the 'length' property",
  function(n) {
    return `'original' expects a draft, got: ${n}`;
  }
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
  // See Patches.ts for additional errors
] : [];
function hl(n, ...t) {
  if (CS.NODE_ENV !== "production") {
    const e = kk[n], a = typeof e == "function" ? e.apply(null, t) : e;
    throw new Error(`[Immer] ${a}`);
  }
  throw new Error(
    `[Immer] minified error nr: ${n}. Full error at: https://bit.ly/3cXEKWf`
  );
}
var tE = Object.getPrototypeOf;
function P_(n) {
  return !!n && !!n[cu];
}
function hm(n) {
  return n ? F8(n) || Array.isArray(n) || !!n[KD] || !!n.constructor?.[KD] || yw(n) || _w(n) : !1;
}
var Hk = Object.prototype.constructor.toString();
function F8(n) {
  if (!n || typeof n != "object")
    return !1;
  const t = tE(n);
  if (t === null)
    return !0;
  const e = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
  return e === Object ? !0 : typeof e == "function" && Function.toString.call(e) === Hk;
}
function kT(n, t) {
  pw(n) === 0 ? Reflect.ownKeys(n).forEach((e) => {
    t(e, n[e], n);
  }) : n.forEach((e, a) => t(a, e, n));
}
function pw(n) {
  const t = n[cu];
  return t ? t.type_ : Array.isArray(n) ? 1 : yw(n) ? 2 : _w(n) ? 3 : 0;
}
function CM(n, t) {
  return pw(n) === 2 ? n.has(t) : Object.prototype.hasOwnProperty.call(n, t);
}
function $8(n, t, e) {
  const a = pw(n);
  a === 2 ? n.set(t, e) : a === 3 ? n.add(e) : n[t] = e;
}
function Bk(n, t) {
  return n === t ? n !== 0 || 1 / n === 1 / t : n !== n && t !== t;
}
function yw(n) {
  return n instanceof Map;
}
function _w(n) {
  return n instanceof Set;
}
function d_(n) {
  return n.copy_ || n.base_;
}
function OM(n, t) {
  if (yw(n))
    return new Map(n);
  if (_w(n))
    return new Set(n);
  if (Array.isArray(n))
    return Array.prototype.slice.call(n);
  const e = F8(n);
  if (t === !0 || t === "class_only" && !e) {
    const a = Object.getOwnPropertyDescriptors(n);
    delete a[cu];
    let s = Reflect.ownKeys(a);
    for (let l = 0; l < s.length; l++) {
      const f = s[l], h = a[f];
      h.writable === !1 && (h.writable = !0, h.configurable = !0), (h.get || h.set) && (a[f] = {
        configurable: !0,
        writable: !0,
        // could live with !!desc.set as well here...
        enumerable: h.enumerable,
        value: n[f]
      });
    }
    return Object.create(tE(n), a);
  } else {
    const a = tE(n);
    if (a !== null && e)
      return { ...n };
    const s = Object.create(a);
    return Object.assign(s, n);
  }
}
function AC(n, t = !1) {
  return vw(n) || P_(n) || !hm(n) || (pw(n) > 1 && (n.set = n.add = n.clear = n.delete = qk), Object.freeze(n), t && Object.entries(n).forEach(([e, a]) => AC(a, !0))), n;
}
function qk() {
  hl(2);
}
function vw(n) {
  return Object.isFrozen(n);
}
var Vk = {};
function z_(n) {
  const t = Vk[n];
  return t || hl(0, n), t;
}
var rS;
function X8() {
  return rS;
}
function Yk(n, t) {
  return {
    drafts_: [],
    parent_: n,
    immer_: t,
    // Whenever the modified draft contains a draft from another scope, we
    // need to prevent auto-freezing so the unowned draft can be finalized.
    canAutoFreeze_: !0,
    unfinalizedDrafts_: 0
  };
}
function ZD(n, t) {
  t && (z_("Patches"), n.patches_ = [], n.inversePatches_ = [], n.patchListener_ = t);
}
function DM(n) {
  NM(n), n.drafts_.forEach(Fk), n.drafts_ = null;
}
function NM(n) {
  n === rS && (rS = n.parent_);
}
function WD(n) {
  return rS = Yk(rS, n);
}
function Fk(n) {
  const t = n[cu];
  t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
}
function QD(n, t) {
  t.unfinalizedDrafts_ = t.drafts_.length;
  const e = t.drafts_[0];
  return n !== void 0 && n !== e ? (e[cu].modified_ && (DM(t), hl(4)), hm(n) && (n = HT(t, n), t.parent_ || BT(t, n)), t.patches_ && z_("Patches").generateReplacementPatches_(
    e[cu].base_,
    n,
    t.patches_,
    t.inversePatches_
  )) : n = HT(t, e, []), DM(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), n !== Y8 ? n : void 0;
}
function HT(n, t, e) {
  if (vw(t))
    return t;
  const a = t[cu];
  if (!a)
    return kT(
      t,
      (s, l) => JD(n, a, t, s, l, e)
    ), t;
  if (a.scope_ !== n)
    return t;
  if (!a.modified_)
    return BT(n, a.base_, !0), a.base_;
  if (!a.finalized_) {
    a.finalized_ = !0, a.scope_.unfinalizedDrafts_--;
    const s = a.copy_;
    let l = s, f = !1;
    a.type_ === 3 && (l = new Set(s), s.clear(), f = !0), kT(
      l,
      (h, p) => JD(n, a, s, h, p, e, f)
    ), BT(n, s, !1), e && n.patches_ && z_("Patches").generatePatches_(
      a,
      e,
      n.patches_,
      n.inversePatches_
    );
  }
  return a.copy_;
}
function JD(n, t, e, a, s, l, f) {
  if (CS.NODE_ENV !== "production" && s === e && hl(5), P_(s)) {
    const h = l && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
    !CM(t.assigned_, a) ? l.concat(a) : void 0, p = HT(n, s, h);
    if ($8(e, a, p), P_(p))
      n.canAutoFreeze_ = !1;
    else
      return;
  } else f && e.add(s);
  if (hm(s) && !vw(s)) {
    if (!n.immer_.autoFreeze_ && n.unfinalizedDrafts_ < 1)
      return;
    HT(n, s), (!t || !t.scope_.parent_) && typeof a != "symbol" && Object.prototype.propertyIsEnumerable.call(e, a) && BT(n, s);
  }
}
function BT(n, t, e = !1) {
  !n.parent_ && n.immer_.autoFreeze_ && n.canAutoFreeze_ && AC(t, e);
}
function $k(n, t) {
  const e = Array.isArray(n), a = {
    type_: e ? 1 : 0,
    // Track which produce call this is associated with.
    scope_: t ? t.scope_ : X8(),
    // True for both shallow and deep changes.
    modified_: !1,
    // Used during finalization.
    finalized_: !1,
    // Track which properties have been assigned (true) or deleted (false).
    assigned_: {},
    // The parent draft state.
    parent_: t,
    // The base state.
    base_: n,
    // The base proxy.
    draft_: null,
    // set below
    // The base copy with any updated values.
    copy_: null,
    // Called by the `produce` function.
    revoke_: null,
    isManual_: !1
  };
  let s = a, l = MC;
  e && (s = [a], l = sS);
  const { revoke: f, proxy: h } = Proxy.revocable(s, l);
  return a.draft_ = h, a.revoke_ = f, h;
}
var MC = {
  get(n, t) {
    if (t === cu)
      return n;
    const e = d_(n);
    if (!CM(e, t))
      return Xk(n, e, t);
    const a = e[t];
    return n.finalized_ || !hm(a) ? a : a === gA(n.base_, t) ? (mA(n), n.copy_[t] = IM(a, n)) : a;
  },
  has(n, t) {
    return t in d_(n);
  },
  ownKeys(n) {
    return Reflect.ownKeys(d_(n));
  },
  set(n, t, e) {
    const a = K8(d_(n), t);
    if (a?.set)
      return a.set.call(n.draft_, e), !0;
    if (!n.modified_) {
      const s = gA(d_(n), t), l = s?.[cu];
      if (l && l.base_ === e)
        return n.copy_[t] = e, n.assigned_[t] = !1, !0;
      if (Bk(e, s) && (e !== void 0 || CM(n.base_, t)))
        return !0;
      mA(n), LM(n);
    }
    return n.copy_[t] === e && // special case: handle new props with value 'undefined'
    (e !== void 0 || t in n.copy_) || // special case: NaN
    Number.isNaN(e) && Number.isNaN(n.copy_[t]) || (n.copy_[t] = e, n.assigned_[t] = !0), !0;
  },
  deleteProperty(n, t) {
    return gA(n.base_, t) !== void 0 || t in n.base_ ? (n.assigned_[t] = !1, mA(n), LM(n)) : delete n.assigned_[t], n.copy_ && delete n.copy_[t], !0;
  },
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
  // the same guarantee in ES5 mode.
  getOwnPropertyDescriptor(n, t) {
    const e = d_(n), a = Reflect.getOwnPropertyDescriptor(e, t);
    return a && {
      writable: !0,
      configurable: n.type_ !== 1 || t !== "length",
      enumerable: a.enumerable,
      value: e[t]
    };
  },
  defineProperty() {
    hl(11);
  },
  getPrototypeOf(n) {
    return tE(n.base_);
  },
  setPrototypeOf() {
    hl(12);
  }
}, sS = {};
kT(MC, (n, t) => {
  sS[n] = function() {
    return arguments[0] = arguments[0][0], t.apply(this, arguments);
  };
});
sS.deleteProperty = function(n, t) {
  return CS.NODE_ENV !== "production" && isNaN(parseInt(t)) && hl(13), sS.set.call(this, n, t, void 0);
};
sS.set = function(n, t, e) {
  return CS.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && hl(14), MC.set.call(this, n[0], t, e, n[0]);
};
function gA(n, t) {
  const e = n[cu];
  return (e ? d_(e) : n)[t];
}
function Xk(n, t, e) {
  const a = K8(t, e);
  return a ? "value" in a ? a.value : (
    // This is a very special case, if the prop is a getter defined by the
    // prototype, we should invoke it with the draft as context!
    a.get?.call(n.draft_)
  ) : void 0;
}
function K8(n, t) {
  if (!(t in n))
    return;
  let e = tE(n);
  for (; e; ) {
    const a = Object.getOwnPropertyDescriptor(e, t);
    if (a)
      return a;
    e = tE(e);
  }
}
function LM(n) {
  n.modified_ || (n.modified_ = !0, n.parent_ && LM(n.parent_));
}
function mA(n) {
  n.copy_ || (n.copy_ = OM(
    n.base_,
    n.scope_.immer_.useStrictShallowCopy_
  ));
}
var Kk = class {
  constructor(n) {
    this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (t, e, a) => {
      if (typeof t == "function" && typeof e != "function") {
        const l = e;
        e = t;
        const f = this;
        return function(p = l, ...y) {
          return f.produce(p, (b) => e.call(this, b, ...y));
        };
      }
      typeof e != "function" && hl(6), a !== void 0 && typeof a != "function" && hl(7);
      let s;
      if (hm(t)) {
        const l = WD(this), f = IM(t, void 0);
        let h = !0;
        try {
          s = e(f), h = !1;
        } finally {
          h ? DM(l) : NM(l);
        }
        return ZD(l, a), QD(s, l);
      } else if (!t || typeof t != "object") {
        if (s = e(t), s === void 0 && (s = t), s === Y8 && (s = void 0), this.autoFreeze_ && AC(s, !0), a) {
          const l = [], f = [];
          z_("Patches").generateReplacementPatches_(t, s, l, f), a(l, f);
        }
        return s;
      } else
        hl(1, t);
    }, this.produceWithPatches = (t, e) => {
      if (typeof t == "function")
        return (f, ...h) => this.produceWithPatches(f, (p) => t(p, ...h));
      let a, s;
      return [this.produce(t, e, (f, h) => {
        a = f, s = h;
      }), a, s];
    }, typeof n?.autoFreeze == "boolean" && this.setAutoFreeze(n.autoFreeze), typeof n?.useStrictShallowCopy == "boolean" && this.setUseStrictShallowCopy(n.useStrictShallowCopy);
  }
  createDraft(n) {
    hm(n) || hl(8), P_(n) && (n = Zk(n));
    const t = WD(this), e = IM(n, void 0);
    return e[cu].isManual_ = !0, NM(t), e;
  }
  finishDraft(n, t) {
    const e = n && n[cu];
    (!e || !e.isManual_) && hl(9);
    const { scope_: a } = e;
    return ZD(a, t), QD(void 0, a);
  }
  /**
   * Pass true to automatically freeze all copies created by Immer.
   *
   * By default, auto-freezing is enabled.
   */
  setAutoFreeze(n) {
    this.autoFreeze_ = n;
  }
  /**
   * Pass true to enable strict shallow copy.
   *
   * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
   */
  setUseStrictShallowCopy(n) {
    this.useStrictShallowCopy_ = n;
  }
  applyPatches(n, t) {
    let e;
    for (e = t.length - 1; e >= 0; e--) {
      const s = t[e];
      if (s.path.length === 0 && s.op === "replace") {
        n = s.value;
        break;
      }
    }
    e > -1 && (t = t.slice(e + 1));
    const a = z_("Patches").applyPatches_;
    return P_(n) ? a(n, t) : this.produce(
      n,
      (s) => a(s, t)
    );
  }
};
function IM(n, t) {
  const e = yw(n) ? z_("MapSet").proxyMap_(n, t) : _w(n) ? z_("MapSet").proxySet_(n, t) : $k(n, t);
  return (t ? t.scope_ : X8()).drafts_.push(e), e;
}
function Zk(n) {
  return P_(n) || hl(10, n), Z8(n);
}
function Z8(n) {
  if (!hm(n) || vw(n))
    return n;
  const t = n[cu];
  let e;
  if (t) {
    if (!t.modified_)
      return t.base_;
    t.finalized_ = !0, e = OM(n, t.scope_.immer_.useStrictShallowCopy_);
  } else
    e = OM(n, !0);
  return kT(e, (a, s) => {
    $8(e, a, Z8(s));
  }), t && (t.finalized_ = !1), e;
}
var fu = new Kk(), W8 = fu.produce;
fu.produceWithPatches.bind(
  fu
);
fu.setAutoFreeze.bind(fu);
fu.setUseStrictShallowCopy.bind(fu);
fu.applyPatches.bind(fu);
fu.createDraft.bind(fu);
fu.finishDraft.bind(fu);
function Q8(n) {
  return ({ dispatch: e, getState: a }) => (s) => (l) => typeof l == "function" ? l(e, a, n) : s(l);
}
var Wk = Q8(), Qk = Q8, Fe = {}, Jk = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
  if (arguments.length !== 0)
    return typeof arguments[0] == "object" ? jT : jT.apply(null, arguments);
}, tH = (n) => n && typeof n.match == "function";
function tN(n, t) {
  function e(...a) {
    if (t) {
      let s = t(...a);
      if (!s)
        throw new Error(Fe.NODE_ENV === "production" ? Fi(0) : "prepareAction did not return an object");
      return {
        type: n,
        payload: s.payload,
        ..."meta" in s && {
          meta: s.meta
        },
        ..."error" in s && {
          error: s.error
        }
      };
    }
    return {
      type: n,
      payload: a[0]
    };
  }
  return e.toString = () => `${n}`, e.type = n, e.match = (a) => V8(a) && a.type === n, e;
}
function eH(n) {
  return typeof n == "function" && "type" in n && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it
  tH(n);
}
function nH(n) {
  const t = n ? `${n}`.split("/") : [], e = t[t.length - 1] || "actionCreator";
  return `Detected an action creator with type "${n || "unknown"}" being dispatched. 
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${e}())\` instead of \`dispatch(${e})\`. This is necessary even if the action has no payload.`;
}
function iH(n = {}) {
  if (Fe.NODE_ENV === "production")
    return () => (e) => (a) => e(a);
  const {
    isActionCreator: t = eH
  } = n;
  return () => (e) => (a) => (t(a) && console.warn(nH(a.type)), e(a));
}
function J8(n, t) {
  let e = 0;
  return {
    measureTime(a) {
      const s = Date.now();
      try {
        return a();
      } finally {
        const l = Date.now();
        e += l - s;
      }
    },
    warnIfExceeded() {
      e > n && console.warn(`${t} took ${e}ms, which is more than the warning threshold of ${n}ms. 
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
It is disabled in production builds, so you don't need to worry about that.`);
    }
  };
}
var t6 = class Db extends Array {
  constructor(...t) {
    super(...t), Object.setPrototypeOf(this, Db.prototype);
  }
  static get [Symbol.species]() {
    return Db;
  }
  concat(...t) {
    return super.concat.apply(this, t);
  }
  prepend(...t) {
    return t.length === 1 && Array.isArray(t[0]) ? new Db(...t[0].concat(this)) : new Db(...t.concat(this));
  }
};
function eN(n) {
  return hm(n) ? W8(n, () => {
  }) : n;
}
function Fx(n, t, e) {
  return n.has(t) ? n.get(t) : n.set(t, e(t)).get(t);
}
function aH(n) {
  return typeof n != "object" || n == null || Object.isFrozen(n);
}
function rH(n, t, e) {
  const a = e6(n, t, e);
  return {
    detectMutations() {
      return n6(n, t, a, e);
    }
  };
}
function e6(n, t = [], e, a = "", s = /* @__PURE__ */ new Set()) {
  const l = {
    value: e
  };
  if (!n(e) && !s.has(e)) {
    s.add(e), l.children = {};
    for (const f in e) {
      const h = a ? a + "." + f : f;
      t.length && t.indexOf(h) !== -1 || (l.children[f] = e6(n, t, e[f], h));
    }
  }
  return l;
}
function n6(n, t = [], e, a, s = !1, l = "") {
  const f = e ? e.value : void 0, h = f === a;
  if (s && !h && !Number.isNaN(a))
    return {
      wasMutated: !0,
      path: l
    };
  if (n(f) || n(a))
    return {
      wasMutated: !1
    };
  const p = {};
  for (let b in e.children)
    p[b] = !0;
  for (let b in a)
    p[b] = !0;
  const y = t.length > 0;
  for (let b in p) {
    const x = l ? l + "." + b : b;
    if (y && t.some((C) => C instanceof RegExp ? C.test(x) : x === C))
      continue;
    const w = n6(n, t, e.children[b], a[b], h, x);
    if (w.wasMutated)
      return w;
  }
  return {
    wasMutated: !1
  };
}
function sH(n = {}) {
  if (Fe.NODE_ENV === "production")
    return () => (t) => (e) => t(e);
  {
    let t = function(h, p, y, b) {
      return JSON.stringify(h, e(p, b), y);
    }, e = function(h, p) {
      let y = [], b = [];
      return p || (p = function(x, w) {
        return y[0] === w ? "[Circular ~]" : "[Circular ~." + b.slice(0, y.indexOf(w)).join(".") + "]";
      }), function(x, w) {
        if (y.length > 0) {
          var A = y.indexOf(this);
          ~A ? y.splice(A + 1) : y.push(this), ~A ? b.splice(A, 1 / 0, x) : b.push(x), ~y.indexOf(w) && (w = p.call(this, x, w));
        } else y.push(w);
        return h == null ? w : h.call(this, x, w);
      };
    }, {
      isImmutable: a = aH,
      ignoredPaths: s,
      warnAfter: l = 32
    } = n;
    const f = rH.bind(null, a, s);
    return ({
      getState: h
    }) => {
      let p = h(), y = f(p), b;
      return (x) => (w) => {
        const A = J8(l, "ImmutableStateInvariantMiddleware");
        A.measureTime(() => {
          if (p = h(), b = y.detectMutations(), y = f(p), b.wasMutated)
            throw new Error(Fe.NODE_ENV === "production" ? Fi(19) : `A state mutation was detected between dispatches, in the path '${b.path || ""}'.  This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);
        });
        const C = x(w);
        return A.measureTime(() => {
          if (p = h(), b = y.detectMutations(), y = f(p), b.wasMutated)
            throw new Error(Fe.NODE_ENV === "production" ? Fi(20) : `A state mutation was detected inside a dispatch, in the path: ${b.path || ""}. Take a look at the reducer(s) handling the action ${t(w)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);
        }), A.warnIfExceeded(), C;
      };
    };
  }
}
function i6(n) {
  const t = typeof n;
  return n == null || t === "string" || t === "boolean" || t === "number" || Array.isArray(n) || MS(n);
}
function PM(n, t = "", e = i6, a, s = [], l) {
  let f;
  if (!e(n))
    return {
      keyPath: t || "<root>",
      value: n
    };
  if (typeof n != "object" || n === null || l?.has(n)) return !1;
  const h = a != null ? a(n) : Object.entries(n), p = s.length > 0;
  for (const [y, b] of h) {
    const x = t ? t + "." + y : y;
    if (!(p && s.some((A) => A instanceof RegExp ? A.test(x) : x === A))) {
      if (!e(b))
        return {
          keyPath: x,
          value: b
        };
      if (typeof b == "object" && (f = PM(b, x, e, a, s, l), f))
        return f;
    }
  }
  return l && a6(n) && l.add(n), !1;
}
function a6(n) {
  if (!Object.isFrozen(n)) return !1;
  for (const t of Object.values(n))
    if (!(typeof t != "object" || t === null) && !a6(t))
      return !1;
  return !0;
}
function oH(n = {}) {
  if (Fe.NODE_ENV === "production")
    return () => (t) => (e) => t(e);
  {
    const {
      isSerializable: t = i6,
      getEntries: e,
      ignoredActions: a = [],
      ignoredActionPaths: s = ["meta.arg", "meta.baseQueryMeta"],
      ignoredPaths: l = [],
      warnAfter: f = 32,
      ignoreState: h = !1,
      ignoreActions: p = !1,
      disableCache: y = !1
    } = n, b = !y && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
    return (x) => (w) => (A) => {
      if (!V8(A))
        return w(A);
      const C = w(A), L = J8(f, "SerializableStateInvariantMiddleware");
      return !p && !(a.length && a.indexOf(A.type) !== -1) && L.measureTime(() => {
        const N = PM(A, "", t, e, s, b);
        if (N) {
          const {
            keyPath: U,
            value: k
          } = N;
          console.error(`A non-serializable value was detected in an action, in the path: \`${U}\`. Value:`, k, `
Take a look at the logic that dispatched this action: `, A, `
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`, `
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`);
        }
      }), h || (L.measureTime(() => {
        const N = x.getState(), U = PM(N, "", t, e, l, b);
        if (U) {
          const {
            keyPath: k,
            value: H
          } = U;
          console.error(`A non-serializable value was detected in the state, in the path: \`${k}\`. Value:`, H, `
Take a look at the reducer(s) handling this action type: ${A.type}.
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`);
        }
      }), L.warnIfExceeded()), C;
    };
  }
}
function $x(n) {
  return typeof n == "boolean";
}
var lH = () => function(t) {
  const {
    thunk: e = !0,
    immutableCheck: a = !0,
    serializableCheck: s = !0,
    actionCreatorCheck: l = !0
  } = t ?? {};
  let f = new t6();
  if (e && ($x(e) ? f.push(Wk) : f.push(Qk(e.extraArgument))), Fe.NODE_ENV !== "production") {
    if (a) {
      let h = {};
      $x(a) || (h = a), f.unshift(sH(h));
    }
    if (s) {
      let h = {};
      $x(s) || (h = s), f.push(oH(h));
    }
    if (l) {
      let h = {};
      $x(l) || (h = l), f.unshift(iH(h));
    }
  }
  return f;
}, uH = "RTK_autoBatch", nN = (n) => (t) => {
  setTimeout(t, n);
}, cH = (n = {
  type: "raf"
}) => (t) => (...e) => {
  const a = t(...e);
  let s = !0, l = !1, f = !1;
  const h = /* @__PURE__ */ new Set(), p = n.type === "tick" ? queueMicrotask : n.type === "raf" ? (
    // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.
    typeof window < "u" && window.requestAnimationFrame ? window.requestAnimationFrame : nN(10)
  ) : n.type === "callback" ? n.queueNotification : nN(n.timeout), y = () => {
    f = !1, l && (l = !1, h.forEach((b) => b()));
  };
  return Object.assign({}, a, {
    // Override the base `store.subscribe` method to keep original listeners
    // from running if we're delaying notifications
    subscribe(b) {
      const x = () => s && b(), w = a.subscribe(x);
      return h.add(b), () => {
        w(), h.delete(b);
      };
    },
    // Override the base `store.dispatch` method so that we can check actions
    // for the `shouldAutoBatch` flag and determine if batching is active
    dispatch(b) {
      try {
        return s = !b?.meta?.[uH], l = !s, l && (f || (f = !0, p(y))), a.dispatch(b);
      } finally {
        s = !0;
      }
    }
  });
}, fH = (n) => function(e) {
  const {
    autoBatch: a = !0
  } = e ?? {};
  let s = new t6(n);
  return a && s.push(cH(typeof a == "object" ? a : void 0)), s;
};
function hH(n) {
  const t = lH(), {
    reducer: e = void 0,
    middleware: a,
    devTools: s = !0,
    duplicateMiddlewareCheck: l = !0,
    preloadedState: f = void 0,
    enhancers: h = void 0
  } = n || {};
  let p;
  if (typeof e == "function")
    p = e;
  else if (MS(e))
    p = Uk(e);
  else
    throw new Error(Fe.NODE_ENV === "production" ? Fi(1) : "`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");
  if (Fe.NODE_ENV !== "production" && a && typeof a != "function")
    throw new Error(Fe.NODE_ENV === "production" ? Fi(2) : "`middleware` field must be a callback");
  let y;
  if (typeof a == "function") {
    if (y = a(t), Fe.NODE_ENV !== "production" && !Array.isArray(y))
      throw new Error(Fe.NODE_ENV === "production" ? Fi(3) : "when using a middleware builder function, an array of middleware must be returned");
  } else
    y = t();
  if (Fe.NODE_ENV !== "production" && y.some((L) => typeof L != "function"))
    throw new Error(Fe.NODE_ENV === "production" ? Fi(4) : "each middleware provided to configureStore must be a function");
  if (Fe.NODE_ENV !== "production" && l) {
    let L = /* @__PURE__ */ new Set();
    y.forEach((N) => {
      if (L.has(N))
        throw new Error(Fe.NODE_ENV === "production" ? Fi(42) : "Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");
      L.add(N);
    });
  }
  let b = jT;
  s && (b = Jk({
    // Enable capture of stack traces for dispatched Redux actions
    trace: Fe.NODE_ENV !== "production",
    ...typeof s == "object" && s
  }));
  const x = jk(...y), w = fH(x);
  if (Fe.NODE_ENV !== "production" && h && typeof h != "function")
    throw new Error(Fe.NODE_ENV === "production" ? Fi(5) : "`enhancers` field must be a callback");
  let A = typeof h == "function" ? h(w) : w();
  if (Fe.NODE_ENV !== "production" && !Array.isArray(A))
    throw new Error(Fe.NODE_ENV === "production" ? Fi(6) : "`enhancers` callback must return an array");
  if (Fe.NODE_ENV !== "production" && A.some((L) => typeof L != "function"))
    throw new Error(Fe.NODE_ENV === "production" ? Fi(7) : "each enhancer provided to configureStore must be a function");
  Fe.NODE_ENV !== "production" && y.length && !A.includes(x) && console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");
  const C = b(...A);
  return q8(p, f, C);
}
function r6(n) {
  const t = {}, e = [];
  let a;
  const s = {
    addCase(l, f) {
      if (Fe.NODE_ENV !== "production") {
        if (e.length > 0)
          throw new Error(Fe.NODE_ENV === "production" ? Fi(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
        if (a)
          throw new Error(Fe.NODE_ENV === "production" ? Fi(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
      }
      const h = typeof l == "string" ? l : l.type;
      if (!h)
        throw new Error(Fe.NODE_ENV === "production" ? Fi(28) : "`builder.addCase` cannot be called with an empty action type");
      if (h in t)
        throw new Error(Fe.NODE_ENV === "production" ? Fi(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${h}'`);
      return t[h] = f, s;
    },
    addMatcher(l, f) {
      if (Fe.NODE_ENV !== "production" && a)
        throw new Error(Fe.NODE_ENV === "production" ? Fi(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
      return e.push({
        matcher: l,
        reducer: f
      }), s;
    },
    addDefaultCase(l) {
      if (Fe.NODE_ENV !== "production" && a)
        throw new Error(Fe.NODE_ENV === "production" ? Fi(31) : "`builder.addDefaultCase` can only be called once");
      return a = l, s;
    }
  };
  return n(s), [t, e, a];
}
function dH(n) {
  return typeof n == "function";
}
function gH(n, t) {
  if (Fe.NODE_ENV !== "production" && typeof t == "object")
    throw new Error(Fe.NODE_ENV === "production" ? Fi(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
  let [e, a, s] = r6(t), l;
  if (dH(n))
    l = () => eN(n());
  else {
    const h = eN(n);
    l = () => h;
  }
  function f(h = l(), p) {
    let y = [e[p.type], ...a.filter(({
      matcher: b
    }) => b(p)).map(({
      reducer: b
    }) => b)];
    return y.filter((b) => !!b).length === 0 && (y = [s]), y.reduce((b, x) => {
      if (x)
        if (P_(b)) {
          const A = x(b, p);
          return A === void 0 ? b : A;
        } else {
          if (hm(b))
            return W8(b, (w) => x(w, p));
          {
            const w = x(b, p);
            if (w === void 0) {
              if (b === null)
                return b;
              throw Error("A case reducer on a non-draftable value must not return undefined");
            }
            return w;
          }
        }
      return b;
    }, h);
  }
  return f.getInitialState = l, f;
}
var mH = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
function pH(n, t) {
  return `${n}/${t}`;
}
function yH({
  creators: n
} = {}) {
  const t = n?.asyncThunk?.[mH];
  return function(a) {
    const {
      name: s,
      reducerPath: l = s
    } = a;
    if (!s)
      throw new Error(Fe.NODE_ENV === "production" ? Fi(11) : "`name` is a required option for createSlice");
    typeof process < "u" && Fe.NODE_ENV === "development" && a.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
    const f = (typeof a.reducers == "function" ? a.reducers(vH()) : a.reducers) || {}, h = Object.keys(f), p = {
      sliceCaseReducersByName: {},
      sliceCaseReducersByType: {},
      actionCreators: {},
      sliceMatchers: []
    }, y = {
      addCase(H, B) {
        const z = typeof H == "string" ? H : H.type;
        if (!z)
          throw new Error(Fe.NODE_ENV === "production" ? Fi(12) : "`context.addCase` cannot be called with an empty action type");
        if (z in p.sliceCaseReducersByType)
          throw new Error(Fe.NODE_ENV === "production" ? Fi(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + z);
        return p.sliceCaseReducersByType[z] = B, y;
      },
      addMatcher(H, B) {
        return p.sliceMatchers.push({
          matcher: H,
          reducer: B
        }), y;
      },
      exposeAction(H, B) {
        return p.actionCreators[H] = B, y;
      },
      exposeCaseReducer(H, B) {
        return p.sliceCaseReducersByName[H] = B, y;
      }
    };
    h.forEach((H) => {
      const B = f[H], z = {
        reducerName: H,
        type: pH(s, H),
        createNotation: typeof a.reducers == "function"
      };
      bH(B) ? xH(z, B, y, t) : EH(z, B, y);
    });
    function b() {
      if (Fe.NODE_ENV !== "production" && typeof a.extraReducers == "object")
        throw new Error(Fe.NODE_ENV === "production" ? Fi(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
      const [H = {}, B = [], z = void 0] = typeof a.extraReducers == "function" ? r6(a.extraReducers) : [a.extraReducers], Q = {
        ...H,
        ...p.sliceCaseReducersByType
      };
      return gH(a.initialState, (et) => {
        for (let ot in Q)
          et.addCase(ot, Q[ot]);
        for (let ot of p.sliceMatchers)
          et.addMatcher(ot.matcher, ot.reducer);
        for (let ot of B)
          et.addMatcher(ot.matcher, ot.reducer);
        z && et.addDefaultCase(z);
      });
    }
    const x = (H) => H, w = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new WeakMap();
    let C;
    function L(H, B) {
      return C || (C = b()), C(H, B);
    }
    function N() {
      return C || (C = b()), C.getInitialState();
    }
    function U(H, B = !1) {
      function z(et) {
        let ot = et[H];
        if (typeof ot > "u") {
          if (B)
            ot = Fx(A, z, N);
          else if (Fe.NODE_ENV !== "production")
            throw new Error(Fe.NODE_ENV === "production" ? Fi(15) : "selectSlice returned undefined for an uninjected slice reducer");
        }
        return ot;
      }
      function Q(et = x) {
        const ot = Fx(w, B, () => /* @__PURE__ */ new WeakMap());
        return Fx(ot, et, () => {
          const pt = {};
          for (const [ht, Ct] of Object.entries(a.selectors ?? {}))
            pt[ht] = _H(Ct, et, () => Fx(A, et, N), B);
          return pt;
        });
      }
      return {
        reducerPath: H,
        getSelectors: Q,
        get selectors() {
          return Q(z);
        },
        selectSlice: z
      };
    }
    const k = {
      name: s,
      reducer: L,
      actions: p.actionCreators,
      caseReducers: p.sliceCaseReducersByName,
      getInitialState: N,
      ...U(l),
      injectInto(H, {
        reducerPath: B,
        ...z
      } = {}) {
        const Q = B ?? l;
        return H.inject({
          reducerPath: Q,
          reducer: L
        }, z), {
          ...k,
          ...U(Q, !0)
        };
      }
    };
    return k;
  };
}
function _H(n, t, e, a) {
  function s(l, ...f) {
    let h = t(l);
    if (typeof h > "u") {
      if (a)
        h = e();
      else if (Fe.NODE_ENV !== "production")
        throw new Error(Fe.NODE_ENV === "production" ? Fi(16) : "selectState returned undefined for an uninjected slice reducer");
    }
    return n(h, ...f);
  }
  return s.unwrapped = n, s;
}
var hd = /* @__PURE__ */ yH();
function vH() {
  function n(t, e) {
    return {
      _reducerDefinitionType: "asyncThunk",
      payloadCreator: t,
      ...e
    };
  }
  return n.withTypes = () => n, {
    reducer(t) {
      return Object.assign({
        // hack so the wrapping function has the same name as the original
        // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original
        [t.name](...e) {
          return t(...e);
        }
      }[t.name], {
        _reducerDefinitionType: "reducer"
        /* reducer */
      });
    },
    preparedReducer(t, e) {
      return {
        _reducerDefinitionType: "reducerWithPrepare",
        prepare: t,
        reducer: e
      };
    },
    asyncThunk: n
  };
}
function EH({
  type: n,
  reducerName: t,
  createNotation: e
}, a, s) {
  let l, f;
  if ("reducer" in a) {
    if (e && !SH(a))
      throw new Error(Fe.NODE_ENV === "production" ? Fi(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
    l = a.reducer, f = a.prepare;
  } else
    l = a;
  s.addCase(n, l).exposeCaseReducer(t, l).exposeAction(t, f ? tN(n, f) : tN(n));
}
function bH(n) {
  return n._reducerDefinitionType === "asyncThunk";
}
function SH(n) {
  return n._reducerDefinitionType === "reducerWithPrepare";
}
function xH({
  type: n,
  reducerName: t
}, e, a, s) {
  if (!s)
    throw new Error(Fe.NODE_ENV === "production" ? Fi(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
  const {
    payloadCreator: l,
    fulfilled: f,
    pending: h,
    rejected: p,
    settled: y,
    options: b
  } = e, x = s(n, l, b);
  a.exposeAction(t, x), f && a.addCase(x.fulfilled, f), h && a.addCase(x.pending, h), p && a.addCase(x.rejected, p), y && a.addMatcher(x.settled, y), a.exposeCaseReducer(t, {
    fulfilled: f || Xx,
    pending: h || Xx,
    rejected: p || Xx,
    settled: y || Xx
  });
}
function Xx() {
}
function Fi(n) {
  return `Minified Redux Toolkit error #${n}; visit https://redux-toolkit.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `;
}
const s6 = hd({
  name: "availability",
  initialState: {
    key: "OerebAvailability",
    visible: !0
  },
  reducers: {
    setAvailabilityPrefix: (n, t) => {
      n.key = t.payload + "OerebAvailability";
    },
    initAvailability: (n) => {
      const t = localStorage.getItem(n.key);
      Re.isBoolean(t) ? n.visible = t : Re.isString(t) ? n.visible = JSON.parse(t) : n.visible = !0;
    },
    showAvailability: (n, t) => {
      n.visible = t.payload, localStorage.setItem(n.key, n.visible);
    }
  }
}), { setAvailabilityPrefix: TH, initAvailability: wH, showAvailability: RH } = s6.actions, AH = s6.reducer, o6 = hd({
  name: "config",
  initialState: {
    config: {}
  },
  reducers: {
    update: (n, t) => {
      n.config = t.payload;
    }
  }
}), { update: MH } = o6.actions, CH = o6.reducer, l6 = hd({
  name: "extract",
  initialState: {
    loading: !1,
    zoom: !1,
    visible: !1,
    collapsed: !1,
    error: !1,
    egrid: null,
    identdn: null,
    number: null,
    information: !1,
    tab: 0,
    data: {},
    highlight: !0,
    background: !0
  },
  reducers: {
    loadExtract: (n, t) => {
      if (!n.loading) {
        n.loading = !0, n.visible = !1, n.collapsed = !1, n.error = !1, n.information = !1, n.tab = 0, n.egrid = t.payload.egrid, n.identdn = t.payload.identdn, n.number = t.payload.number, n.zoom = t.payload.zoom, n.data = {};
        const e = new URLSearchParams(window.location.search);
        n.egrid !== null ? e.set("egrid", n.egrid) : n.identdn !== null && n.number !== null && (e.set("identdn", n.identdn), e.set("number", n.number)), window.history.pushState(null, null, "?" + e.toString());
      }
    },
    showExtract: (n, t) => {
      n.loading = !1, n.visible = !0, n.collapsed = !1, n.error = !1, n.information = !1, n.highlight = !0, n.background = !0, n.tab = 0, n.data = t.payload;
    },
    showError: (n) => {
      n.loading = !1, n.zoom = !1, n.visible = !1, n.collapsed = !1, n.error = !0, n.information = !1, n.tab = 0, n.data = {};
      const t = new URLSearchParams(window.location.search);
      t.delete("egrid"), t.delete("identdn"), t.delete("number"), window.history.pushState(null, null, "?" + t.toString());
    },
    hideExtract: (n) => {
      n.loading = !1, n.zoom = !1, n.visible = !1, n.collapsed = !1, n.error = !1, n.egrid = null, n.identdn = null, n.number = null, n.information = !1, n.tab = 0, n.data = {};
      const t = new URLSearchParams(window.location.search);
      t.delete("egrid"), t.delete("identdn"), t.delete("number"), window.history.pushState(null, null, "?" + t.toString());
    },
    toggleCollapsed: (n) => {
      n.collapsed = !n.collapsed;
    },
    toggleHighlight: (n) => {
      n.highlight = !n.highlight;
    },
    toggleBackground: (n) => {
      n.background = !n.background;
    },
    toggleInformationPanel: (n) => {
      n.information = !n.information, n.information && (n.tab = 0);
    },
    setInformationPanelTab: (n, t) => {
      n.tab = t.payload;
    }
  }
}), {
  loadExtract: mE,
  showExtract: pE,
  showError: $_,
  hideExtract: w0,
  toggleCollapsed: OH,
  toggleHighlight: DH,
  toggleBackground: NH,
  toggleInformationPanel: u6,
  setInformationPanelTab: LH
} = l6.actions, IH = l6.reducer, c6 = hd({
  name: "history",
  initialState: {
    key: "OerebHistory",
    elements: []
  },
  reducers: {
    setHistoryPrefix: (n, t) => {
      n.key = t.payload + "OerebHistory";
    },
    initHistory: (n) => {
      const t = localStorage.getItem(n.key);
      t ? n.elements = JSON.parse(t) : n.elements = [];
    },
    updateHistory: (n, t) => {
      const a = t.payload.GetExtractByIdResponse.extract.RealEstate, s = {
        EGRID: a.EGRID,
        IdentDN: a.IdentDN,
        Municipality: a.MunicipalityName,
        Number: a.Number
      };
      for (let l = 0; l < n.elements.length; l++)
        if (Re.isEqual(s, n.elements[l])) {
          n.elements.splice(l, 1);
          break;
        }
      n.elements.length > 4 && n.elements.splice(0, 1), n.elements.push(s), localStorage.setItem(n.key, JSON.stringify(n.elements));
    }
  }
}), { setHistoryPrefix: PH, initHistory: zH, updateHistory: yE } = c6.actions, GH = c6.reducer, f6 = hd({
  name: "language",
  initialState: {
    current: null,
    default: null,
    available: []
  },
  reducers: {
    initLanguages: (n, t) => {
      n.default = t.payload.default, n.available = t.payload.available;
      const e = new URLSearchParams(window.location.search);
      e.has("lang") && n.available.indexOf(e.get("lang")) > -1 ? n.current = e.get("lang") : n.current = n.default, os.changeLanguage(n.current), e.set("lang", n.current), window.history.pushState(null, null, "?" + e.toString());
    },
    setLanguage: (n, t) => {
      if (n.available.indexOf(t.payload) > -1) {
        n.current = t.payload, os.changeLanguage(n.current);
        const e = new URLSearchParams(window.location.search);
        e.set("lang", n.current), window.history.pushState(null, null, "?" + e.toString());
      }
    }
  }
}), { initLanguages: UH, setLanguage: jH } = f6.actions, kH = f6.reducer, h6 = hd({
  name: "symbolZoom",
  initialState: {
    key: "OerebSymbolZoom",
    enabled: !0
  },
  reducers: {
    setSymbolZoomPrefix: (n, t) => {
      n.key = t.payload + "OerebSymbolZoom";
    },
    initSymbolZoom: (n) => {
      const t = localStorage.getItem(n.key);
      Re.isBoolean(t) ? n.enabled = t : Re.isString(t) ? n.enabled = JSON.parse(t) : n.enabled = !0;
    },
    enableSymbolZoom: (n, t) => {
      n.enabled = t.payload, localStorage.setItem(n.key, n.enabled);
    }
  }
}), { setSymbolZoomPrefix: HH, initSymbolZoom: BH, enableSymbolZoom: qH } = h6.actions, VH = h6.reducer;
class pA extends Error {
  constructor(t) {
    super(t), this.name = "NoDataError";
  }
}
class sd extends Error {
  constructor(t) {
    super(t), this.name = "TooManyRequestsError";
  }
}
const _E = function(n, t, e, a, s, l) {
  const f = new URL(n + "extract/json/");
  return Re.isString(t) ? f.searchParams.append("EGRID", t) : (f.searchParams.append("IDENTDN", e), f.searchParams.append("NUMBER", a)), f.searchParams.append("GEOMETRY", !0), f.searchParams.append("_dc", (/* @__PURE__ */ new Date()).getTime()), l && f.searchParams.append("LANG", l), new Promise((h, p) => {
    const y = new AbortController(), b = setTimeout(() => y.abort(), s * 1e3);
    fetch(f.toString(), { signal: y.signal }).then((x) => {
      clearTimeout(b), x.ok ? h(x.json()) : x.status === 429 ? p(new sd(x.text())) : p(new Error(x.text()));
    }).catch((x) => {
      clearTimeout(b), p(x);
    });
  });
}, YH = function(n, t, e, a, s, l) {
  const f = new URL(n + "extract/pdf/");
  return Re.isString(t) ? f.searchParams.append("EGRID", t) : (f.searchParams.append("IDENTDN", e), f.searchParams.append("NUMBER", a)), f.searchParams.append("_dc", (/* @__PURE__ */ new Date()).getTime()), l && f.searchParams.append("LANG", l), new Promise((h, p) => {
    const y = new AbortController(), b = setTimeout(() => y.abort(), s * 1e3);
    fetch(f.toString(), { signal: y.signal }).then((x) => {
      clearTimeout(b), x.ok ? h(x.arrayBuffer()) : x.status === 429 ? p(new sd(x.text())) : p(new Error(x.text()));
    }).catch((x) => {
      clearTimeout(b), p(x);
    });
  });
}, d6 = function(n) {
  let t = n.Code.replace(".", "").replace("-", "").replace("_", "");
  return Re.isString(n.SubCode) && (t += "_" + n.SubCode.replace(".", "").replace("-", "").replace("_", "")), t;
}, FH = function(n, t) {
  let e = null;
  for (let a = 0; a < t.length; a++)
    if (t[a].Code === n.Code) {
      e = t[a];
      break;
    }
  return e;
}, $H = function(n, t) {
  const e = {};
  return n.forEach((a) => {
    const s = d6(a.Theme), l = a.Lawstatus.Code;
    if (!Reflect.apply(Object.prototype.hasOwnProperty, e, [s])) {
      let f = null, h = null;
      Re.isString(a.Theme.SubCode) ? (h = a.Theme.Text, f = FH(a.Theme, t).Text) : f = a.Theme.Text, e[s] = {
        themeText: f,
        subThemeText: h,
        inForce: [],
        changeWithPreEffect: [],
        changeWithoutPreEffect: []
      };
    }
    e[s][l].push(a);
  }), e;
}, g6 = hd({
  name: "accordion",
  initialState: {
    category: null,
    topic: null,
    viewServices: [],
    callback: null
  },
  reducers: {
    setActiveCategory: (n, t) => {
      n.category = t.payload;
    },
    setActiveTopic: (n, t) => {
      n.topic = t.payload;
    },
    setViewServices: (n, t) => {
      n.viewServices = t.payload.viewServices, n.callback = t.payload.callback;
    }
  }
}), { setActiveCategory: CC, setActiveTopic: oS, setViewServices: G_ } = g6.actions, XH = g6.reducer;
var Do = "top", hu = "bottom", du = "right", No = "left", Ew = "auto", vE = [Do, hu, du, No], U_ = "start", eE = "end", m6 = "clippingParents", OC = "viewport", C1 = "popper", p6 = "reference", zM = /* @__PURE__ */ vE.reduce(function(n, t) {
  return n.concat([t + "-" + U_, t + "-" + eE]);
}, []), DC = /* @__PURE__ */ [].concat(vE, [Ew]).reduce(function(n, t) {
  return n.concat([t, t + "-" + U_, t + "-" + eE]);
}, []), y6 = "beforeRead", _6 = "read", v6 = "afterRead", E6 = "beforeMain", b6 = "main", S6 = "afterMain", x6 = "beforeWrite", T6 = "write", w6 = "afterWrite", R6 = [y6, _6, v6, E6, b6, S6, x6, T6, w6];
function cd(n) {
  return n ? (n.nodeName || "").toLowerCase() : null;
}
function gu(n) {
  if (n == null)
    return window;
  if (n.toString() !== "[object Window]") {
    var t = n.ownerDocument;
    return t && t.defaultView || window;
  }
  return n;
}
function j_(n) {
  var t = gu(n).Element;
  return n instanceof t || n instanceof Element;
}
function Mc(n) {
  var t = gu(n).HTMLElement;
  return n instanceof t || n instanceof HTMLElement;
}
function NC(n) {
  if (typeof ShadowRoot > "u")
    return !1;
  var t = gu(n).ShadowRoot;
  return n instanceof t || n instanceof ShadowRoot;
}
function KH(n) {
  var t = n.state;
  Object.keys(t.elements).forEach(function(e) {
    var a = t.styles[e] || {}, s = t.attributes[e] || {}, l = t.elements[e];
    !Mc(l) || !cd(l) || (Object.assign(l.style, a), Object.keys(s).forEach(function(f) {
      var h = s[f];
      h === !1 ? l.removeAttribute(f) : l.setAttribute(f, h === !0 ? "" : h);
    }));
  });
}
function ZH(n) {
  var t = n.state, e = {
    popper: {
      position: t.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  return Object.assign(t.elements.popper.style, e.popper), t.styles = e, t.elements.arrow && Object.assign(t.elements.arrow.style, e.arrow), function() {
    Object.keys(t.elements).forEach(function(a) {
      var s = t.elements[a], l = t.attributes[a] || {}, f = Object.keys(t.styles.hasOwnProperty(a) ? t.styles[a] : e[a]), h = f.reduce(function(p, y) {
        return p[y] = "", p;
      }, {});
      !Mc(s) || !cd(s) || (Object.assign(s.style, h), Object.keys(l).forEach(function(p) {
        s.removeAttribute(p);
      }));
    });
  };
}
const LC = {
  name: "applyStyles",
  enabled: !0,
  phase: "write",
  fn: KH,
  effect: ZH,
  requires: ["computeStyles"]
};
function od(n) {
  return n.split("-")[0];
}
var M_ = Math.max, qT = Math.min, nE = Math.round;
function GM() {
  var n = navigator.userAgentData;
  return n != null && n.brands && Array.isArray(n.brands) ? n.brands.map(function(t) {
    return t.brand + "/" + t.version;
  }).join(" ") : navigator.userAgent;
}
function A6() {
  return !/^((?!chrome|android).)*safari/i.test(GM());
}
function iE(n, t, e) {
  t === void 0 && (t = !1), e === void 0 && (e = !1);
  var a = n.getBoundingClientRect(), s = 1, l = 1;
  t && Mc(n) && (s = n.offsetWidth > 0 && nE(a.width) / n.offsetWidth || 1, l = n.offsetHeight > 0 && nE(a.height) / n.offsetHeight || 1);
  var f = j_(n) ? gu(n) : window, h = f.visualViewport, p = !A6() && e, y = (a.left + (p && h ? h.offsetLeft : 0)) / s, b = (a.top + (p && h ? h.offsetTop : 0)) / l, x = a.width / s, w = a.height / l;
  return {
    width: x,
    height: w,
    top: b,
    right: y + x,
    bottom: b + w,
    left: y,
    x: y,
    y: b
  };
}
function IC(n) {
  var t = iE(n), e = n.offsetWidth, a = n.offsetHeight;
  return Math.abs(t.width - e) <= 1 && (e = t.width), Math.abs(t.height - a) <= 1 && (a = t.height), {
    x: n.offsetLeft,
    y: n.offsetTop,
    width: e,
    height: a
  };
}
function M6(n, t) {
  var e = t.getRootNode && t.getRootNode();
  if (n.contains(t))
    return !0;
  if (e && NC(e)) {
    var a = t;
    do {
      if (a && n.isSameNode(a))
        return !0;
      a = a.parentNode || a.host;
    } while (a);
  }
  return !1;
}
function dm(n) {
  return gu(n).getComputedStyle(n);
}
function WH(n) {
  return ["table", "td", "th"].indexOf(cd(n)) >= 0;
}
function D0(n) {
  return ((j_(n) ? n.ownerDocument : (
    // $FlowFixMe[prop-missing]
    n.document
  )) || window.document).documentElement;
}
function bw(n) {
  return cd(n) === "html" ? n : (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    n.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    n.parentNode || // DOM Element detected
    (NC(n) ? n.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    D0(n)
  );
}
function iN(n) {
  return !Mc(n) || // https://github.com/popperjs/popper-core/issues/837
  dm(n).position === "fixed" ? null : n.offsetParent;
}
function QH(n) {
  var t = /firefox/i.test(GM()), e = /Trident/i.test(GM());
  if (e && Mc(n)) {
    var a = dm(n);
    if (a.position === "fixed")
      return null;
  }
  var s = bw(n);
  for (NC(s) && (s = s.host); Mc(s) && ["html", "body"].indexOf(cd(s)) < 0; ) {
    var l = dm(s);
    if (l.transform !== "none" || l.perspective !== "none" || l.contain === "paint" || ["transform", "perspective"].indexOf(l.willChange) !== -1 || t && l.willChange === "filter" || t && l.filter && l.filter !== "none")
      return s;
    s = s.parentNode;
  }
  return null;
}
function OS(n) {
  for (var t = gu(n), e = iN(n); e && WH(e) && dm(e).position === "static"; )
    e = iN(e);
  return e && (cd(e) === "html" || cd(e) === "body" && dm(e).position === "static") ? t : e || QH(n) || t;
}
function PC(n) {
  return ["top", "bottom"].indexOf(n) >= 0 ? "x" : "y";
}
function Yb(n, t, e) {
  return M_(n, qT(t, e));
}
function JH(n, t, e) {
  var a = Yb(n, t, e);
  return a > e ? e : a;
}
function C6() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function O6(n) {
  return Object.assign({}, C6(), n);
}
function D6(n, t) {
  return t.reduce(function(e, a) {
    return e[a] = n, e;
  }, {});
}
var tB = function(t, e) {
  return t = typeof t == "function" ? t(Object.assign({}, e.rects, {
    placement: e.placement
  })) : t, O6(typeof t != "number" ? t : D6(t, vE));
};
function eB(n) {
  var t, e = n.state, a = n.name, s = n.options, l = e.elements.arrow, f = e.modifiersData.popperOffsets, h = od(e.placement), p = PC(h), y = [No, du].indexOf(h) >= 0, b = y ? "height" : "width";
  if (!(!l || !f)) {
    var x = tB(s.padding, e), w = IC(l), A = p === "y" ? Do : No, C = p === "y" ? hu : du, L = e.rects.reference[b] + e.rects.reference[p] - f[p] - e.rects.popper[b], N = f[p] - e.rects.reference[p], U = OS(l), k = U ? p === "y" ? U.clientHeight || 0 : U.clientWidth || 0 : 0, H = L / 2 - N / 2, B = x[A], z = k - w[b] - x[C], Q = k / 2 - w[b] / 2 + H, et = Yb(B, Q, z), ot = p;
    e.modifiersData[a] = (t = {}, t[ot] = et, t.centerOffset = et - Q, t);
  }
}
function nB(n) {
  var t = n.state, e = n.options, a = e.element, s = a === void 0 ? "[data-popper-arrow]" : a;
  s != null && (typeof s == "string" && (s = t.elements.popper.querySelector(s), !s) || M6(t.elements.popper, s) && (t.elements.arrow = s));
}
const N6 = {
  name: "arrow",
  enabled: !0,
  phase: "main",
  fn: eB,
  effect: nB,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function aE(n) {
  return n.split("-")[1];
}
var iB = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function aB(n, t) {
  var e = n.x, a = n.y, s = t.devicePixelRatio || 1;
  return {
    x: nE(e * s) / s || 0,
    y: nE(a * s) / s || 0
  };
}
function aN(n) {
  var t, e = n.popper, a = n.popperRect, s = n.placement, l = n.variation, f = n.offsets, h = n.position, p = n.gpuAcceleration, y = n.adaptive, b = n.roundOffsets, x = n.isFixed, w = f.x, A = w === void 0 ? 0 : w, C = f.y, L = C === void 0 ? 0 : C, N = typeof b == "function" ? b({
    x: A,
    y: L
  }) : {
    x: A,
    y: L
  };
  A = N.x, L = N.y;
  var U = f.hasOwnProperty("x"), k = f.hasOwnProperty("y"), H = No, B = Do, z = window;
  if (y) {
    var Q = OS(e), et = "clientHeight", ot = "clientWidth";
    if (Q === gu(e) && (Q = D0(e), dm(Q).position !== "static" && h === "absolute" && (et = "scrollHeight", ot = "scrollWidth")), Q = Q, s === Do || (s === No || s === du) && l === eE) {
      B = hu;
      var pt = x && Q === z && z.visualViewport ? z.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        Q[et]
      );
      L -= pt - a.height, L *= p ? 1 : -1;
    }
    if (s === No || (s === Do || s === hu) && l === eE) {
      H = du;
      var ht = x && Q === z && z.visualViewport ? z.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        Q[ot]
      );
      A -= ht - a.width, A *= p ? 1 : -1;
    }
  }
  var Ct = Object.assign({
    position: h
  }, y && iB), mt = b === !0 ? aB({
    x: A,
    y: L
  }, gu(e)) : {
    x: A,
    y: L
  };
  if (A = mt.x, L = mt.y, p) {
    var St;
    return Object.assign({}, Ct, (St = {}, St[B] = k ? "0" : "", St[H] = U ? "0" : "", St.transform = (z.devicePixelRatio || 1) <= 1 ? "translate(" + A + "px, " + L + "px)" : "translate3d(" + A + "px, " + L + "px, 0)", St));
  }
  return Object.assign({}, Ct, (t = {}, t[B] = k ? L + "px" : "", t[H] = U ? A + "px" : "", t.transform = "", t));
}
function rB(n) {
  var t = n.state, e = n.options, a = e.gpuAcceleration, s = a === void 0 ? !0 : a, l = e.adaptive, f = l === void 0 ? !0 : l, h = e.roundOffsets, p = h === void 0 ? !0 : h, y = {
    placement: od(t.placement),
    variation: aE(t.placement),
    popper: t.elements.popper,
    popperRect: t.rects.popper,
    gpuAcceleration: s,
    isFixed: t.options.strategy === "fixed"
  };
  t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, aN(Object.assign({}, y, {
    offsets: t.modifiersData.popperOffsets,
    position: t.options.strategy,
    adaptive: f,
    roundOffsets: p
  })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, aN(Object.assign({}, y, {
    offsets: t.modifiersData.arrow,
    position: "absolute",
    adaptive: !1,
    roundOffsets: p
  })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-placement": t.placement
  });
}
const zC = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: rB,
  data: {}
};
var Kx = {
  passive: !0
};
function sB(n) {
  var t = n.state, e = n.instance, a = n.options, s = a.scroll, l = s === void 0 ? !0 : s, f = a.resize, h = f === void 0 ? !0 : f, p = gu(t.elements.popper), y = [].concat(t.scrollParents.reference, t.scrollParents.popper);
  return l && y.forEach(function(b) {
    b.addEventListener("scroll", e.update, Kx);
  }), h && p.addEventListener("resize", e.update, Kx), function() {
    l && y.forEach(function(b) {
      b.removeEventListener("scroll", e.update, Kx);
    }), h && p.removeEventListener("resize", e.update, Kx);
  };
}
const GC = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function() {
  },
  effect: sB,
  data: {}
};
var oB = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function yT(n) {
  return n.replace(/left|right|bottom|top/g, function(t) {
    return oB[t];
  });
}
var lB = {
  start: "end",
  end: "start"
};
function rN(n) {
  return n.replace(/start|end/g, function(t) {
    return lB[t];
  });
}
function UC(n) {
  var t = gu(n), e = t.pageXOffset, a = t.pageYOffset;
  return {
    scrollLeft: e,
    scrollTop: a
  };
}
function jC(n) {
  return iE(D0(n)).left + UC(n).scrollLeft;
}
function uB(n, t) {
  var e = gu(n), a = D0(n), s = e.visualViewport, l = a.clientWidth, f = a.clientHeight, h = 0, p = 0;
  if (s) {
    l = s.width, f = s.height;
    var y = A6();
    (y || !y && t === "fixed") && (h = s.offsetLeft, p = s.offsetTop);
  }
  return {
    width: l,
    height: f,
    x: h + jC(n),
    y: p
  };
}
function cB(n) {
  var t, e = D0(n), a = UC(n), s = (t = n.ownerDocument) == null ? void 0 : t.body, l = M_(e.scrollWidth, e.clientWidth, s ? s.scrollWidth : 0, s ? s.clientWidth : 0), f = M_(e.scrollHeight, e.clientHeight, s ? s.scrollHeight : 0, s ? s.clientHeight : 0), h = -a.scrollLeft + jC(n), p = -a.scrollTop;
  return dm(s || e).direction === "rtl" && (h += M_(e.clientWidth, s ? s.clientWidth : 0) - l), {
    width: l,
    height: f,
    x: h,
    y: p
  };
}
function kC(n) {
  var t = dm(n), e = t.overflow, a = t.overflowX, s = t.overflowY;
  return /auto|scroll|overlay|hidden/.test(e + s + a);
}
function L6(n) {
  return ["html", "body", "#document"].indexOf(cd(n)) >= 0 ? n.ownerDocument.body : Mc(n) && kC(n) ? n : L6(bw(n));
}
function Fb(n, t) {
  var e;
  t === void 0 && (t = []);
  var a = L6(n), s = a === ((e = n.ownerDocument) == null ? void 0 : e.body), l = gu(a), f = s ? [l].concat(l.visualViewport || [], kC(a) ? a : []) : a, h = t.concat(f);
  return s ? h : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    h.concat(Fb(bw(f)))
  );
}
function UM(n) {
  return Object.assign({}, n, {
    left: n.x,
    top: n.y,
    right: n.x + n.width,
    bottom: n.y + n.height
  });
}
function fB(n, t) {
  var e = iE(n, !1, t === "fixed");
  return e.top = e.top + n.clientTop, e.left = e.left + n.clientLeft, e.bottom = e.top + n.clientHeight, e.right = e.left + n.clientWidth, e.width = n.clientWidth, e.height = n.clientHeight, e.x = e.left, e.y = e.top, e;
}
function sN(n, t, e) {
  return t === OC ? UM(uB(n, e)) : j_(t) ? fB(t, e) : UM(cB(D0(n)));
}
function hB(n) {
  var t = Fb(bw(n)), e = ["absolute", "fixed"].indexOf(dm(n).position) >= 0, a = e && Mc(n) ? OS(n) : n;
  return j_(a) ? t.filter(function(s) {
    return j_(s) && M6(s, a) && cd(s) !== "body";
  }) : [];
}
function dB(n, t, e, a) {
  var s = t === "clippingParents" ? hB(n) : [].concat(t), l = [].concat(s, [e]), f = l[0], h = l.reduce(function(p, y) {
    var b = sN(n, y, a);
    return p.top = M_(b.top, p.top), p.right = qT(b.right, p.right), p.bottom = qT(b.bottom, p.bottom), p.left = M_(b.left, p.left), p;
  }, sN(n, f, a));
  return h.width = h.right - h.left, h.height = h.bottom - h.top, h.x = h.left, h.y = h.top, h;
}
function I6(n) {
  var t = n.reference, e = n.element, a = n.placement, s = a ? od(a) : null, l = a ? aE(a) : null, f = t.x + t.width / 2 - e.width / 2, h = t.y + t.height / 2 - e.height / 2, p;
  switch (s) {
    case Do:
      p = {
        x: f,
        y: t.y - e.height
      };
      break;
    case hu:
      p = {
        x: f,
        y: t.y + t.height
      };
      break;
    case du:
      p = {
        x: t.x + t.width,
        y: h
      };
      break;
    case No:
      p = {
        x: t.x - e.width,
        y: h
      };
      break;
    default:
      p = {
        x: t.x,
        y: t.y
      };
  }
  var y = s ? PC(s) : null;
  if (y != null) {
    var b = y === "y" ? "height" : "width";
    switch (l) {
      case U_:
        p[y] = p[y] - (t[b] / 2 - e[b] / 2);
        break;
      case eE:
        p[y] = p[y] + (t[b] / 2 - e[b] / 2);
        break;
    }
  }
  return p;
}
function rE(n, t) {
  t === void 0 && (t = {});
  var e = t, a = e.placement, s = a === void 0 ? n.placement : a, l = e.strategy, f = l === void 0 ? n.strategy : l, h = e.boundary, p = h === void 0 ? m6 : h, y = e.rootBoundary, b = y === void 0 ? OC : y, x = e.elementContext, w = x === void 0 ? C1 : x, A = e.altBoundary, C = A === void 0 ? !1 : A, L = e.padding, N = L === void 0 ? 0 : L, U = O6(typeof N != "number" ? N : D6(N, vE)), k = w === C1 ? p6 : C1, H = n.rects.popper, B = n.elements[C ? k : w], z = dB(j_(B) ? B : B.contextElement || D0(n.elements.popper), p, b, f), Q = iE(n.elements.reference), et = I6({
    reference: Q,
    element: H,
    placement: s
  }), ot = UM(Object.assign({}, H, et)), pt = w === C1 ? ot : Q, ht = {
    top: z.top - pt.top + U.top,
    bottom: pt.bottom - z.bottom + U.bottom,
    left: z.left - pt.left + U.left,
    right: pt.right - z.right + U.right
  }, Ct = n.modifiersData.offset;
  if (w === C1 && Ct) {
    var mt = Ct[s];
    Object.keys(ht).forEach(function(St) {
      var Ut = [du, hu].indexOf(St) >= 0 ? 1 : -1, Ft = [Do, hu].indexOf(St) >= 0 ? "y" : "x";
      ht[St] += mt[Ft] * Ut;
    });
  }
  return ht;
}
function gB(n, t) {
  t === void 0 && (t = {});
  var e = t, a = e.placement, s = e.boundary, l = e.rootBoundary, f = e.padding, h = e.flipVariations, p = e.allowedAutoPlacements, y = p === void 0 ? DC : p, b = aE(a), x = b ? h ? zM : zM.filter(function(C) {
    return aE(C) === b;
  }) : vE, w = x.filter(function(C) {
    return y.indexOf(C) >= 0;
  });
  w.length === 0 && (w = x);
  var A = w.reduce(function(C, L) {
    return C[L] = rE(n, {
      placement: L,
      boundary: s,
      rootBoundary: l,
      padding: f
    })[od(L)], C;
  }, {});
  return Object.keys(A).sort(function(C, L) {
    return A[C] - A[L];
  });
}
function mB(n) {
  if (od(n) === Ew)
    return [];
  var t = yT(n);
  return [rN(n), t, rN(t)];
}
function pB(n) {
  var t = n.state, e = n.options, a = n.name;
  if (!t.modifiersData[a]._skip) {
    for (var s = e.mainAxis, l = s === void 0 ? !0 : s, f = e.altAxis, h = f === void 0 ? !0 : f, p = e.fallbackPlacements, y = e.padding, b = e.boundary, x = e.rootBoundary, w = e.altBoundary, A = e.flipVariations, C = A === void 0 ? !0 : A, L = e.allowedAutoPlacements, N = t.options.placement, U = od(N), k = U === N, H = p || (k || !C ? [yT(N)] : mB(N)), B = [N].concat(H).reduce(function(At, Dt) {
      return At.concat(od(Dt) === Ew ? gB(t, {
        placement: Dt,
        boundary: b,
        rootBoundary: x,
        padding: y,
        flipVariations: C,
        allowedAutoPlacements: L
      }) : Dt);
    }, []), z = t.rects.reference, Q = t.rects.popper, et = /* @__PURE__ */ new Map(), ot = !0, pt = B[0], ht = 0; ht < B.length; ht++) {
      var Ct = B[ht], mt = od(Ct), St = aE(Ct) === U_, Ut = [Do, hu].indexOf(mt) >= 0, Ft = Ut ? "width" : "height", nt = rE(t, {
        placement: Ct,
        boundary: b,
        rootBoundary: x,
        altBoundary: w,
        padding: y
      }), J = Ut ? St ? du : No : St ? hu : Do;
      z[Ft] > Q[Ft] && (J = yT(J));
      var gt = yT(J), Ot = [];
      if (l && Ot.push(nt[mt] <= 0), h && Ot.push(nt[J] <= 0, nt[gt] <= 0), Ot.every(function(At) {
        return At;
      })) {
        pt = Ct, ot = !1;
        break;
      }
      et.set(Ct, Ot);
    }
    if (ot)
      for (var W = C ? 3 : 1, j = function(Dt) {
        var It = B.find(function($t) {
          var Qt = et.get($t);
          if (Qt)
            return Qt.slice(0, Dt).every(function(ee) {
              return ee;
            });
        });
        if (It)
          return pt = It, "break";
      }, X = W; X > 0; X--) {
        var st = j(X);
        if (st === "break") break;
      }
    t.placement !== pt && (t.modifiersData[a]._skip = !0, t.placement = pt, t.reset = !0);
  }
}
const P6 = {
  name: "flip",
  enabled: !0,
  phase: "main",
  fn: pB,
  requiresIfExists: ["offset"],
  data: {
    _skip: !1
  }
};
function oN(n, t, e) {
  return e === void 0 && (e = {
    x: 0,
    y: 0
  }), {
    top: n.top - t.height - e.y,
    right: n.right - t.width + e.x,
    bottom: n.bottom - t.height + e.y,
    left: n.left - t.width - e.x
  };
}
function lN(n) {
  return [Do, du, hu, No].some(function(t) {
    return n[t] >= 0;
  });
}
function yB(n) {
  var t = n.state, e = n.name, a = t.rects.reference, s = t.rects.popper, l = t.modifiersData.preventOverflow, f = rE(t, {
    elementContext: "reference"
  }), h = rE(t, {
    altBoundary: !0
  }), p = oN(f, a), y = oN(h, s, l), b = lN(p), x = lN(y);
  t.modifiersData[e] = {
    referenceClippingOffsets: p,
    popperEscapeOffsets: y,
    isReferenceHidden: b,
    hasPopperEscaped: x
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-reference-hidden": b,
    "data-popper-escaped": x
  });
}
const z6 = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: yB
};
function _B(n, t, e) {
  var a = od(n), s = [No, Do].indexOf(a) >= 0 ? -1 : 1, l = typeof e == "function" ? e(Object.assign({}, t, {
    placement: n
  })) : e, f = l[0], h = l[1];
  return f = f || 0, h = (h || 0) * s, [No, du].indexOf(a) >= 0 ? {
    x: h,
    y: f
  } : {
    x: f,
    y: h
  };
}
function vB(n) {
  var t = n.state, e = n.options, a = n.name, s = e.offset, l = s === void 0 ? [0, 0] : s, f = DC.reduce(function(b, x) {
    return b[x] = _B(x, t.rects, l), b;
  }, {}), h = f[t.placement], p = h.x, y = h.y;
  t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += p, t.modifiersData.popperOffsets.y += y), t.modifiersData[a] = f;
}
const G6 = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: vB
};
function EB(n) {
  var t = n.state, e = n.name;
  t.modifiersData[e] = I6({
    reference: t.rects.reference,
    element: t.rects.popper,
    placement: t.placement
  });
}
const HC = {
  name: "popperOffsets",
  enabled: !0,
  phase: "read",
  fn: EB,
  data: {}
};
function bB(n) {
  return n === "x" ? "y" : "x";
}
function SB(n) {
  var t = n.state, e = n.options, a = n.name, s = e.mainAxis, l = s === void 0 ? !0 : s, f = e.altAxis, h = f === void 0 ? !1 : f, p = e.boundary, y = e.rootBoundary, b = e.altBoundary, x = e.padding, w = e.tether, A = w === void 0 ? !0 : w, C = e.tetherOffset, L = C === void 0 ? 0 : C, N = rE(t, {
    boundary: p,
    rootBoundary: y,
    padding: x,
    altBoundary: b
  }), U = od(t.placement), k = aE(t.placement), H = !k, B = PC(U), z = bB(B), Q = t.modifiersData.popperOffsets, et = t.rects.reference, ot = t.rects.popper, pt = typeof L == "function" ? L(Object.assign({}, t.rects, {
    placement: t.placement
  })) : L, ht = typeof pt == "number" ? {
    mainAxis: pt,
    altAxis: pt
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, pt), Ct = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, mt = {
    x: 0,
    y: 0
  };
  if (Q) {
    if (l) {
      var St, Ut = B === "y" ? Do : No, Ft = B === "y" ? hu : du, nt = B === "y" ? "height" : "width", J = Q[B], gt = J + N[Ut], Ot = J - N[Ft], W = A ? -ot[nt] / 2 : 0, j = k === U_ ? et[nt] : ot[nt], X = k === U_ ? -ot[nt] : -et[nt], st = t.elements.arrow, At = A && st ? IC(st) : {
        width: 0,
        height: 0
      }, Dt = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : C6(), It = Dt[Ut], $t = Dt[Ft], Qt = Yb(0, et[nt], At[nt]), ee = H ? et[nt] / 2 - W - Qt - It - ht.mainAxis : j - Qt - It - ht.mainAxis, ce = H ? -et[nt] / 2 + W + Qt + $t + ht.mainAxis : X + Qt + $t + ht.mainAxis, pe = t.elements.arrow && OS(t.elements.arrow), Mn = pe ? B === "y" ? pe.clientTop || 0 : pe.clientLeft || 0 : 0, te = (St = Ct?.[B]) != null ? St : 0, tn = J + ee - te - Mn, Jn = J + ce - te, Pi = Yb(A ? qT(gt, tn) : gt, J, A ? M_(Ot, Jn) : Ot);
      Q[B] = Pi, mt[B] = Pi - J;
    }
    if (h) {
      var Ge, pa = B === "x" ? Do : No, ka = B === "x" ? hu : du, Ai = Q[z], fe = z === "y" ? "height" : "width", Zi = Ai + N[pa], Dn = Ai - N[ka], nr = [Do, No].indexOf(U) !== -1, mr = (Ge = Ct?.[z]) != null ? Ge : 0, Ha = nr ? Zi : Ai - et[fe] - ot[fe] - mr + ht.altAxis, ti = nr ? Ai + et[fe] + ot[fe] - mr - ht.altAxis : Dn, zi = A && nr ? JH(Ha, Ai, ti) : Yb(A ? Ha : Zi, Ai, A ? ti : Dn);
      Q[z] = zi, mt[z] = zi - Ai;
    }
    t.modifiersData[a] = mt;
  }
}
const U6 = {
  name: "preventOverflow",
  enabled: !0,
  phase: "main",
  fn: SB,
  requiresIfExists: ["offset"]
};
function xB(n) {
  return {
    scrollLeft: n.scrollLeft,
    scrollTop: n.scrollTop
  };
}
function TB(n) {
  return n === gu(n) || !Mc(n) ? UC(n) : xB(n);
}
function wB(n) {
  var t = n.getBoundingClientRect(), e = nE(t.width) / n.offsetWidth || 1, a = nE(t.height) / n.offsetHeight || 1;
  return e !== 1 || a !== 1;
}
function RB(n, t, e) {
  e === void 0 && (e = !1);
  var a = Mc(t), s = Mc(t) && wB(t), l = D0(t), f = iE(n, s, e), h = {
    scrollLeft: 0,
    scrollTop: 0
  }, p = {
    x: 0,
    y: 0
  };
  return (a || !a && !e) && ((cd(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  kC(l)) && (h = TB(t)), Mc(t) ? (p = iE(t, !0), p.x += t.clientLeft, p.y += t.clientTop) : l && (p.x = jC(l))), {
    x: f.left + h.scrollLeft - p.x,
    y: f.top + h.scrollTop - p.y,
    width: f.width,
    height: f.height
  };
}
function AB(n) {
  var t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Set(), a = [];
  n.forEach(function(l) {
    t.set(l.name, l);
  });
  function s(l) {
    e.add(l.name);
    var f = [].concat(l.requires || [], l.requiresIfExists || []);
    f.forEach(function(h) {
      if (!e.has(h)) {
        var p = t.get(h);
        p && s(p);
      }
    }), a.push(l);
  }
  return n.forEach(function(l) {
    e.has(l.name) || s(l);
  }), a;
}
function MB(n) {
  var t = AB(n);
  return R6.reduce(function(e, a) {
    return e.concat(t.filter(function(s) {
      return s.phase === a;
    }));
  }, []);
}
function CB(n) {
  var t;
  return function() {
    return t || (t = new Promise(function(e) {
      Promise.resolve().then(function() {
        t = void 0, e(n());
      });
    })), t;
  };
}
function OB(n) {
  var t = n.reduce(function(e, a) {
    var s = e[a.name];
    return e[a.name] = s ? Object.assign({}, s, a, {
      options: Object.assign({}, s.options, a.options),
      data: Object.assign({}, s.data, a.data)
    }) : a, e;
  }, {});
  return Object.keys(t).map(function(e) {
    return t[e];
  });
}
var uN = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function cN() {
  for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
    t[e] = arguments[e];
  return !t.some(function(a) {
    return !(a && typeof a.getBoundingClientRect == "function");
  });
}
function Sw(n) {
  n === void 0 && (n = {});
  var t = n, e = t.defaultModifiers, a = e === void 0 ? [] : e, s = t.defaultOptions, l = s === void 0 ? uN : s;
  return function(h, p, y) {
    y === void 0 && (y = l);
    var b = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, uN, l),
      modifiersData: {},
      elements: {
        reference: h,
        popper: p
      },
      attributes: {},
      styles: {}
    }, x = [], w = !1, A = {
      state: b,
      setOptions: function(U) {
        var k = typeof U == "function" ? U(b.options) : U;
        L(), b.options = Object.assign({}, l, b.options, k), b.scrollParents = {
          reference: j_(h) ? Fb(h) : h.contextElement ? Fb(h.contextElement) : [],
          popper: Fb(p)
        };
        var H = MB(OB([].concat(a, b.options.modifiers)));
        return b.orderedModifiers = H.filter(function(B) {
          return B.enabled;
        }), C(), A.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function() {
        if (!w) {
          var U = b.elements, k = U.reference, H = U.popper;
          if (cN(k, H)) {
            b.rects = {
              reference: RB(k, OS(H), b.options.strategy === "fixed"),
              popper: IC(H)
            }, b.reset = !1, b.placement = b.options.placement, b.orderedModifiers.forEach(function(ht) {
              return b.modifiersData[ht.name] = Object.assign({}, ht.data);
            });
            for (var B = 0; B < b.orderedModifiers.length; B++) {
              if (b.reset === !0) {
                b.reset = !1, B = -1;
                continue;
              }
              var z = b.orderedModifiers[B], Q = z.fn, et = z.options, ot = et === void 0 ? {} : et, pt = z.name;
              typeof Q == "function" && (b = Q({
                state: b,
                options: ot,
                name: pt,
                instance: A
              }) || b);
            }
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: CB(function() {
        return new Promise(function(N) {
          A.forceUpdate(), N(b);
        });
      }),
      destroy: function() {
        L(), w = !0;
      }
    };
    if (!cN(h, p))
      return A;
    A.setOptions(y).then(function(N) {
      !w && y.onFirstUpdate && y.onFirstUpdate(N);
    });
    function C() {
      b.orderedModifiers.forEach(function(N) {
        var U = N.name, k = N.options, H = k === void 0 ? {} : k, B = N.effect;
        if (typeof B == "function") {
          var z = B({
            state: b,
            name: U,
            instance: A,
            options: H
          }), Q = function() {
          };
          x.push(z || Q);
        }
      });
    }
    function L() {
      x.forEach(function(N) {
        return N();
      }), x = [];
    }
    return A;
  };
}
var DB = /* @__PURE__ */ Sw(), NB = [GC, HC, zC, LC], LB = /* @__PURE__ */ Sw({
  defaultModifiers: NB
}), IB = [GC, HC, zC, LC, G6, P6, U6, N6, z6], BC = /* @__PURE__ */ Sw({
  defaultModifiers: IB
});
const j6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  afterMain: S6,
  afterRead: v6,
  afterWrite: w6,
  applyStyles: LC,
  arrow: N6,
  auto: Ew,
  basePlacements: vE,
  beforeMain: E6,
  beforeRead: y6,
  beforeWrite: x6,
  bottom: hu,
  clippingParents: m6,
  computeStyles: zC,
  createPopper: BC,
  createPopperBase: DB,
  createPopperLite: LB,
  detectOverflow: rE,
  end: eE,
  eventListeners: GC,
  flip: P6,
  hide: z6,
  left: No,
  main: b6,
  modifierPhases: R6,
  offset: G6,
  placements: DC,
  popper: C1,
  popperGenerator: Sw,
  popperOffsets: HC,
  preventOverflow: U6,
  read: _6,
  reference: p6,
  right: du,
  start: U_,
  top: Do,
  variationPlacements: zM,
  viewport: OC,
  write: T6
}, Symbol.toStringTag, { value: "Module" }));
/*!
  * Bootstrap v5.3.7 (https://getbootstrap.com/)
  * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
const n0 = /* @__PURE__ */ new Map(), yA = {
  set(n, t, e) {
    n0.has(n) || n0.set(n, /* @__PURE__ */ new Map());
    const a = n0.get(n);
    if (!a.has(t) && a.size !== 0) {
      console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(a.keys())[0]}.`);
      return;
    }
    a.set(t, e);
  },
  get(n, t) {
    return n0.has(n) && n0.get(n).get(t) || null;
  },
  remove(n, t) {
    if (!n0.has(n))
      return;
    const e = n0.get(n);
    e.delete(t), e.size === 0 && n0.delete(n);
  }
}, PB = 1e6, zB = 1e3, jM = "transitionend", k6 = (n) => (n && window.CSS && window.CSS.escape && (n = n.replace(/#([^\s"#']+)/g, (t, e) => `#${CSS.escape(e)}`)), n), GB = (n) => n == null ? `${n}` : Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(), UB = (n) => {
  do
    n += Math.floor(Math.random() * PB);
  while (document.getElementById(n));
  return n;
}, jB = (n) => {
  if (!n)
    return 0;
  let {
    transitionDuration: t,
    transitionDelay: e
  } = window.getComputedStyle(n);
  const a = Number.parseFloat(t), s = Number.parseFloat(e);
  return !a && !s ? 0 : (t = t.split(",")[0], e = e.split(",")[0], (Number.parseFloat(t) + Number.parseFloat(e)) * zB);
}, H6 = (n) => {
  n.dispatchEvent(new Event(jM));
}, am = (n) => !n || typeof n != "object" ? !1 : (typeof n.jquery < "u" && (n = n[0]), typeof n.nodeType < "u"), R0 = (n) => am(n) ? n.jquery ? n[0] : n : typeof n == "string" && n.length > 0 ? document.querySelector(k6(n)) : null, EE = (n) => {
  if (!am(n) || n.getClientRects().length === 0)
    return !1;
  const t = getComputedStyle(n).getPropertyValue("visibility") === "visible", e = n.closest("details:not([open])");
  if (!e)
    return t;
  if (e !== n) {
    const a = n.closest("summary");
    if (a && a.parentNode !== e || a === null)
      return !1;
  }
  return t;
}, A0 = (n) => !n || n.nodeType !== Node.ELEMENT_NODE || n.classList.contains("disabled") ? !0 : typeof n.disabled < "u" ? n.disabled : n.hasAttribute("disabled") && n.getAttribute("disabled") !== "false", B6 = (n) => {
  if (!document.documentElement.attachShadow)
    return null;
  if (typeof n.getRootNode == "function") {
    const t = n.getRootNode();
    return t instanceof ShadowRoot ? t : null;
  }
  return n instanceof ShadowRoot ? n : n.parentNode ? B6(n.parentNode) : null;
}, VT = () => {
}, DS = (n) => {
  n.offsetHeight;
}, q6 = () => window.jQuery && !document.body.hasAttribute("data-bs-no-jquery") ? window.jQuery : null, _A = [], kB = (n) => {
  document.readyState === "loading" ? (_A.length || document.addEventListener("DOMContentLoaded", () => {
    for (const t of _A)
      t();
  }), _A.push(n)) : n();
}, Cc = () => document.documentElement.dir === "rtl", Dc = (n) => {
  kB(() => {
    const t = q6();
    if (t) {
      const e = n.NAME, a = t.fn[e];
      t.fn[e] = n.jQueryInterface, t.fn[e].Constructor = n, t.fn[e].noConflict = () => (t.fn[e] = a, n.jQueryInterface);
    }
  });
}, dl = (n, t = [], e = n) => typeof n == "function" ? n.call(...t) : e, V6 = (n, t, e = !0) => {
  if (!e) {
    dl(n);
    return;
  }
  const s = jB(t) + 5;
  let l = !1;
  const f = ({
    target: h
  }) => {
    h === t && (l = !0, t.removeEventListener(jM, f), dl(n));
  };
  t.addEventListener(jM, f), setTimeout(() => {
    l || H6(t);
  }, s);
}, qC = (n, t, e, a) => {
  const s = n.length;
  let l = n.indexOf(t);
  return l === -1 ? !e && a ? n[s - 1] : n[0] : (l += e ? 1 : -1, a && (l = (l + s) % s), n[Math.max(0, Math.min(l, s - 1))]);
}, HB = /[^.]*(?=\..*)\.|.*/, BB = /\..*/, qB = /::\d+$/, vA = {};
let fN = 1;
const Y6 = {
  mouseenter: "mouseover",
  mouseleave: "mouseout"
}, VB = /* @__PURE__ */ new Set(["click", "dblclick", "mouseup", "mousedown", "contextmenu", "mousewheel", "DOMMouseScroll", "mouseover", "mouseout", "mousemove", "selectstart", "selectend", "keydown", "keypress", "keyup", "orientationchange", "touchstart", "touchmove", "touchend", "touchcancel", "pointerdown", "pointermove", "pointerup", "pointerleave", "pointercancel", "gesturestart", "gesturechange", "gestureend", "focus", "blur", "change", "reset", "select", "submit", "focusin", "focusout", "load", "unload", "beforeunload", "resize", "move", "DOMContentLoaded", "readystatechange", "error", "abort", "scroll"]);
function F6(n, t) {
  return t && `${t}::${fN++}` || n.uidEvent || fN++;
}
function $6(n) {
  const t = F6(n);
  return n.uidEvent = t, vA[t] = vA[t] || {}, vA[t];
}
function YB(n, t) {
  return function e(a) {
    return VC(a, {
      delegateTarget: n
    }), e.oneOff && Zt.off(n, a.type, t), t.apply(n, [a]);
  };
}
function FB(n, t, e) {
  return function a(s) {
    const l = n.querySelectorAll(t);
    for (let {
      target: f
    } = s; f && f !== this; f = f.parentNode)
      for (const h of l)
        if (h === f)
          return VC(s, {
            delegateTarget: f
          }), a.oneOff && Zt.off(n, s.type, t, e), e.apply(f, [s]);
  };
}
function X6(n, t, e = null) {
  return Object.values(n).find((a) => a.callable === t && a.delegationSelector === e);
}
function K6(n, t, e) {
  const a = typeof t == "string", s = a ? e : t || e;
  let l = Z6(n);
  return VB.has(l) || (l = n), [a, s, l];
}
function hN(n, t, e, a, s) {
  if (typeof t != "string" || !n)
    return;
  let [l, f, h] = K6(t, e, a);
  t in Y6 && (f = ((C) => function(L) {
    if (!L.relatedTarget || L.relatedTarget !== L.delegateTarget && !L.delegateTarget.contains(L.relatedTarget))
      return C.call(this, L);
  })(f));
  const p = $6(n), y = p[h] || (p[h] = {}), b = X6(y, f, l ? e : null);
  if (b) {
    b.oneOff = b.oneOff && s;
    return;
  }
  const x = F6(f, t.replace(HB, "")), w = l ? FB(n, e, f) : YB(n, f);
  w.delegationSelector = l ? e : null, w.callable = f, w.oneOff = s, w.uidEvent = x, y[x] = w, n.addEventListener(h, w, l);
}
function kM(n, t, e, a, s) {
  const l = X6(t[e], a, s);
  l && (n.removeEventListener(e, l, !!s), delete t[e][l.uidEvent]);
}
function $B(n, t, e, a) {
  const s = t[e] || {};
  for (const [l, f] of Object.entries(s))
    l.includes(a) && kM(n, t, e, f.callable, f.delegationSelector);
}
function Z6(n) {
  return n = n.replace(BB, ""), Y6[n] || n;
}
const Zt = {
  on(n, t, e, a) {
    hN(n, t, e, a, !1);
  },
  one(n, t, e, a) {
    hN(n, t, e, a, !0);
  },
  off(n, t, e, a) {
    if (typeof t != "string" || !n)
      return;
    const [s, l, f] = K6(t, e, a), h = f !== t, p = $6(n), y = p[f] || {}, b = t.startsWith(".");
    if (typeof l < "u") {
      if (!Object.keys(y).length)
        return;
      kM(n, p, f, l, s ? e : null);
      return;
    }
    if (b)
      for (const x of Object.keys(p))
        $B(n, p, x, t.slice(1));
    for (const [x, w] of Object.entries(y)) {
      const A = x.replace(qB, "");
      (!h || t.includes(A)) && kM(n, p, f, w.callable, w.delegationSelector);
    }
  },
  trigger(n, t, e) {
    if (typeof t != "string" || !n)
      return null;
    const a = q6(), s = Z6(t), l = t !== s;
    let f = null, h = !0, p = !0, y = !1;
    l && a && (f = a.Event(t, e), a(n).trigger(f), h = !f.isPropagationStopped(), p = !f.isImmediatePropagationStopped(), y = f.isDefaultPrevented());
    const b = VC(new Event(t, {
      bubbles: h,
      cancelable: !0
    }), e);
    return y && b.preventDefault(), p && n.dispatchEvent(b), b.defaultPrevented && f && f.preventDefault(), b;
  }
};
function VC(n, t = {}) {
  for (const [e, a] of Object.entries(t))
    try {
      n[e] = a;
    } catch {
      Object.defineProperty(n, e, {
        configurable: !0,
        get() {
          return a;
        }
      });
    }
  return n;
}
function dN(n) {
  if (n === "true")
    return !0;
  if (n === "false")
    return !1;
  if (n === Number(n).toString())
    return Number(n);
  if (n === "" || n === "null")
    return null;
  if (typeof n != "string")
    return n;
  try {
    return JSON.parse(decodeURIComponent(n));
  } catch {
    return n;
  }
}
function EA(n) {
  return n.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
}
const rm = {
  setDataAttribute(n, t, e) {
    n.setAttribute(`data-bs-${EA(t)}`, e);
  },
  removeDataAttribute(n, t) {
    n.removeAttribute(`data-bs-${EA(t)}`);
  },
  getDataAttributes(n) {
    if (!n)
      return {};
    const t = {}, e = Object.keys(n.dataset).filter((a) => a.startsWith("bs") && !a.startsWith("bsConfig"));
    for (const a of e) {
      let s = a.replace(/^bs/, "");
      s = s.charAt(0).toLowerCase() + s.slice(1), t[s] = dN(n.dataset[a]);
    }
    return t;
  },
  getDataAttribute(n, t) {
    return dN(n.getAttribute(`data-bs-${EA(t)}`));
  }
};
class NS {
  // Getters
  static get Default() {
    return {};
  }
  static get DefaultType() {
    return {};
  }
  static get NAME() {
    throw new Error('You have to implement the static method "NAME", for each component!');
  }
  _getConfig(t) {
    return t = this._mergeConfigObj(t), t = this._configAfterMerge(t), this._typeCheckConfig(t), t;
  }
  _configAfterMerge(t) {
    return t;
  }
  _mergeConfigObj(t, e) {
    const a = am(e) ? rm.getDataAttribute(e, "config") : {};
    return {
      ...this.constructor.Default,
      ...typeof a == "object" ? a : {},
      ...am(e) ? rm.getDataAttributes(e) : {},
      ...typeof t == "object" ? t : {}
    };
  }
  _typeCheckConfig(t, e = this.constructor.DefaultType) {
    for (const [a, s] of Object.entries(e)) {
      const l = t[a], f = am(l) ? "element" : GB(l);
      if (!new RegExp(s).test(f))
        throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${a}" provided type "${f}" but expected type "${s}".`);
    }
  }
}
const XB = "5.3.7";
class Gf extends NS {
  constructor(t, e) {
    super(), t = R0(t), t && (this._element = t, this._config = this._getConfig(e), yA.set(this._element, this.constructor.DATA_KEY, this));
  }
  // Public
  dispose() {
    yA.remove(this._element, this.constructor.DATA_KEY), Zt.off(this._element, this.constructor.EVENT_KEY);
    for (const t of Object.getOwnPropertyNames(this))
      this[t] = null;
  }
  // Private
  _queueCallback(t, e, a = !0) {
    V6(t, e, a);
  }
  _getConfig(t) {
    return t = this._mergeConfigObj(t, this._element), t = this._configAfterMerge(t), this._typeCheckConfig(t), t;
  }
  // Static
  static getInstance(t) {
    return yA.get(R0(t), this.DATA_KEY);
  }
  static getOrCreateInstance(t, e = {}) {
    return this.getInstance(t) || new this(t, typeof e == "object" ? e : null);
  }
  static get VERSION() {
    return XB;
  }
  static get DATA_KEY() {
    return `bs.${this.NAME}`;
  }
  static get EVENT_KEY() {
    return `.${this.DATA_KEY}`;
  }
  static eventName(t) {
    return `${t}${this.EVENT_KEY}`;
  }
}
const bA = (n) => {
  let t = n.getAttribute("data-bs-target");
  if (!t || t === "#") {
    let e = n.getAttribute("href");
    if (!e || !e.includes("#") && !e.startsWith("."))
      return null;
    e.includes("#") && !e.startsWith("#") && (e = `#${e.split("#")[1]}`), t = e && e !== "#" ? e.trim() : null;
  }
  return t ? t.split(",").map((e) => k6(e)).join(",") : null;
}, Ie = {
  find(n, t = document.documentElement) {
    return [].concat(...Element.prototype.querySelectorAll.call(t, n));
  },
  findOne(n, t = document.documentElement) {
    return Element.prototype.querySelector.call(t, n);
  },
  children(n, t) {
    return [].concat(...n.children).filter((e) => e.matches(t));
  },
  parents(n, t) {
    const e = [];
    let a = n.parentNode.closest(t);
    for (; a; )
      e.push(a), a = a.parentNode.closest(t);
    return e;
  },
  prev(n, t) {
    let e = n.previousElementSibling;
    for (; e; ) {
      if (e.matches(t))
        return [e];
      e = e.previousElementSibling;
    }
    return [];
  },
  // TODO: this is now unused; remove later along with prev()
  next(n, t) {
    let e = n.nextElementSibling;
    for (; e; ) {
      if (e.matches(t))
        return [e];
      e = e.nextElementSibling;
    }
    return [];
  },
  focusableChildren(n) {
    const t = ["a", "button", "input", "textarea", "select", "details", "[tabindex]", '[contenteditable="true"]'].map((e) => `${e}:not([tabindex^="-"])`).join(",");
    return this.find(t, n).filter((e) => !A0(e) && EE(e));
  },
  getSelectorFromElement(n) {
    const t = bA(n);
    return t && Ie.findOne(t) ? t : null;
  },
  getElementFromSelector(n) {
    const t = bA(n);
    return t ? Ie.findOne(t) : null;
  },
  getMultipleElementsFromSelector(n) {
    const t = bA(n);
    return t ? Ie.find(t) : [];
  }
}, xw = (n, t = "hide") => {
  const e = `click.dismiss${n.EVENT_KEY}`, a = n.NAME;
  Zt.on(document, e, `[data-bs-dismiss="${a}"]`, function(s) {
    if (["A", "AREA"].includes(this.tagName) && s.preventDefault(), A0(this))
      return;
    const l = Ie.getElementFromSelector(this) || this.closest(`.${a}`);
    n.getOrCreateInstance(l)[t]();
  });
}, KB = "alert", ZB = "bs.alert", W6 = `.${ZB}`, WB = `close${W6}`, QB = `closed${W6}`, JB = "fade", tq = "show";
class Tw extends Gf {
  // Getters
  static get NAME() {
    return KB;
  }
  // Public
  close() {
    if (Zt.trigger(this._element, WB).defaultPrevented)
      return;
    this._element.classList.remove(tq);
    const e = this._element.classList.contains(JB);
    this._queueCallback(() => this._destroyElement(), this._element, e);
  }
  // Private
  _destroyElement() {
    this._element.remove(), Zt.trigger(this._element, QB), this.dispose();
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = Tw.getOrCreateInstance(this);
      if (typeof t == "string") {
        if (e[t] === void 0 || t.startsWith("_") || t === "constructor")
          throw new TypeError(`No method named "${t}"`);
        e[t](this);
      }
    });
  }
}
xw(Tw, "close");
Dc(Tw);
const eq = "button", nq = "bs.button", iq = `.${nq}`, aq = ".data-api", rq = "active", gN = '[data-bs-toggle="button"]', sq = `click${iq}${aq}`;
class ww extends Gf {
  // Getters
  static get NAME() {
    return eq;
  }
  // Public
  toggle() {
    this._element.setAttribute("aria-pressed", this._element.classList.toggle(rq));
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = ww.getOrCreateInstance(this);
      t === "toggle" && e[t]();
    });
  }
}
Zt.on(document, sq, gN, (n) => {
  n.preventDefault();
  const t = n.target.closest(gN);
  ww.getOrCreateInstance(t).toggle();
});
Dc(ww);
const oq = "swipe", bE = ".bs.swipe", lq = `touchstart${bE}`, uq = `touchmove${bE}`, cq = `touchend${bE}`, fq = `pointerdown${bE}`, hq = `pointerup${bE}`, dq = "touch", gq = "pen", mq = "pointer-event", pq = 40, yq = {
  endCallback: null,
  leftCallback: null,
  rightCallback: null
}, _q = {
  endCallback: "(function|null)",
  leftCallback: "(function|null)",
  rightCallback: "(function|null)"
};
class YT extends NS {
  constructor(t, e) {
    super(), this._element = t, !(!t || !YT.isSupported()) && (this._config = this._getConfig(e), this._deltaX = 0, this._supportPointerEvents = !!window.PointerEvent, this._initEvents());
  }
  // Getters
  static get Default() {
    return yq;
  }
  static get DefaultType() {
    return _q;
  }
  static get NAME() {
    return oq;
  }
  // Public
  dispose() {
    Zt.off(this._element, bE);
  }
  // Private
  _start(t) {
    if (!this._supportPointerEvents) {
      this._deltaX = t.touches[0].clientX;
      return;
    }
    this._eventIsPointerPenTouch(t) && (this._deltaX = t.clientX);
  }
  _end(t) {
    this._eventIsPointerPenTouch(t) && (this._deltaX = t.clientX - this._deltaX), this._handleSwipe(), dl(this._config.endCallback);
  }
  _move(t) {
    this._deltaX = t.touches && t.touches.length > 1 ? 0 : t.touches[0].clientX - this._deltaX;
  }
  _handleSwipe() {
    const t = Math.abs(this._deltaX);
    if (t <= pq)
      return;
    const e = t / this._deltaX;
    this._deltaX = 0, e && dl(e > 0 ? this._config.rightCallback : this._config.leftCallback);
  }
  _initEvents() {
    this._supportPointerEvents ? (Zt.on(this._element, fq, (t) => this._start(t)), Zt.on(this._element, hq, (t) => this._end(t)), this._element.classList.add(mq)) : (Zt.on(this._element, lq, (t) => this._start(t)), Zt.on(this._element, uq, (t) => this._move(t)), Zt.on(this._element, cq, (t) => this._end(t)));
  }
  _eventIsPointerPenTouch(t) {
    return this._supportPointerEvents && (t.pointerType === gq || t.pointerType === dq);
  }
  // Static
  static isSupported() {
    return "ontouchstart" in document.documentElement || navigator.maxTouchPoints > 0;
  }
}
const vq = "carousel", Eq = "bs.carousel", N0 = `.${Eq}`, Q6 = ".data-api", bq = "ArrowLeft", Sq = "ArrowRight", xq = 500, _b = "next", E1 = "prev", O1 = "left", _T = "right", Tq = `slide${N0}`, SA = `slid${N0}`, wq = `keydown${N0}`, Rq = `mouseenter${N0}`, Aq = `mouseleave${N0}`, Mq = `dragstart${N0}`, Cq = `load${N0}${Q6}`, Oq = `click${N0}${Q6}`, J6 = "carousel", Zx = "active", Dq = "slide", Nq = "carousel-item-end", Lq = "carousel-item-start", Iq = "carousel-item-next", Pq = "carousel-item-prev", t2 = ".active", e2 = ".carousel-item", zq = t2 + e2, Gq = ".carousel-item img", Uq = ".carousel-indicators", jq = "[data-bs-slide], [data-bs-slide-to]", kq = '[data-bs-ride="carousel"]', Hq = {
  [bq]: _T,
  [Sq]: O1
}, Bq = {
  interval: 5e3,
  keyboard: !0,
  pause: "hover",
  ride: !1,
  touch: !0,
  wrap: !0
}, qq = {
  interval: "(number|boolean)",
  // TODO:v6 remove boolean support
  keyboard: "boolean",
  pause: "(string|boolean)",
  ride: "(boolean|string)",
  touch: "boolean",
  wrap: "boolean"
};
class LS extends Gf {
  constructor(t, e) {
    super(t, e), this._interval = null, this._activeElement = null, this._isSliding = !1, this.touchTimeout = null, this._swipeHelper = null, this._indicatorsElement = Ie.findOne(Uq, this._element), this._addEventListeners(), this._config.ride === J6 && this.cycle();
  }
  // Getters
  static get Default() {
    return Bq;
  }
  static get DefaultType() {
    return qq;
  }
  static get NAME() {
    return vq;
  }
  // Public
  next() {
    this._slide(_b);
  }
  nextWhenVisible() {
    !document.hidden && EE(this._element) && this.next();
  }
  prev() {
    this._slide(E1);
  }
  pause() {
    this._isSliding && H6(this._element), this._clearInterval();
  }
  cycle() {
    this._clearInterval(), this._updateInterval(), this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);
  }
  _maybeEnableCycle() {
    if (this._config.ride) {
      if (this._isSliding) {
        Zt.one(this._element, SA, () => this.cycle());
        return;
      }
      this.cycle();
    }
  }
  to(t) {
    const e = this._getItems();
    if (t > e.length - 1 || t < 0)
      return;
    if (this._isSliding) {
      Zt.one(this._element, SA, () => this.to(t));
      return;
    }
    const a = this._getItemIndex(this._getActive());
    if (a === t)
      return;
    const s = t > a ? _b : E1;
    this._slide(s, e[t]);
  }
  dispose() {
    this._swipeHelper && this._swipeHelper.dispose(), super.dispose();
  }
  // Private
  _configAfterMerge(t) {
    return t.defaultInterval = t.interval, t;
  }
  _addEventListeners() {
    this._config.keyboard && Zt.on(this._element, wq, (t) => this._keydown(t)), this._config.pause === "hover" && (Zt.on(this._element, Rq, () => this.pause()), Zt.on(this._element, Aq, () => this._maybeEnableCycle())), this._config.touch && YT.isSupported() && this._addTouchEventListeners();
  }
  _addTouchEventListeners() {
    for (const a of Ie.find(Gq, this._element))
      Zt.on(a, Mq, (s) => s.preventDefault());
    const e = {
      leftCallback: () => this._slide(this._directionToOrder(O1)),
      rightCallback: () => this._slide(this._directionToOrder(_T)),
      endCallback: () => {
        this._config.pause === "hover" && (this.pause(), this.touchTimeout && clearTimeout(this.touchTimeout), this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), xq + this._config.interval));
      }
    };
    this._swipeHelper = new YT(this._element, e);
  }
  _keydown(t) {
    if (/input|textarea/i.test(t.target.tagName))
      return;
    const e = Hq[t.key];
    e && (t.preventDefault(), this._slide(this._directionToOrder(e)));
  }
  _getItemIndex(t) {
    return this._getItems().indexOf(t);
  }
  _setActiveIndicatorElement(t) {
    if (!this._indicatorsElement)
      return;
    const e = Ie.findOne(t2, this._indicatorsElement);
    e.classList.remove(Zx), e.removeAttribute("aria-current");
    const a = Ie.findOne(`[data-bs-slide-to="${t}"]`, this._indicatorsElement);
    a && (a.classList.add(Zx), a.setAttribute("aria-current", "true"));
  }
  _updateInterval() {
    const t = this._activeElement || this._getActive();
    if (!t)
      return;
    const e = Number.parseInt(t.getAttribute("data-bs-interval"), 10);
    this._config.interval = e || this._config.defaultInterval;
  }
  _slide(t, e = null) {
    if (this._isSliding)
      return;
    const a = this._getActive(), s = t === _b, l = e || qC(this._getItems(), a, s, this._config.wrap);
    if (l === a)
      return;
    const f = this._getItemIndex(l), h = (A) => Zt.trigger(this._element, A, {
      relatedTarget: l,
      direction: this._orderToDirection(t),
      from: this._getItemIndex(a),
      to: f
    });
    if (h(Tq).defaultPrevented || !a || !l)
      return;
    const y = !!this._interval;
    this.pause(), this._isSliding = !0, this._setActiveIndicatorElement(f), this._activeElement = l;
    const b = s ? Lq : Nq, x = s ? Iq : Pq;
    l.classList.add(x), DS(l), a.classList.add(b), l.classList.add(b);
    const w = () => {
      l.classList.remove(b, x), l.classList.add(Zx), a.classList.remove(Zx, x, b), this._isSliding = !1, h(SA);
    };
    this._queueCallback(w, a, this._isAnimated()), y && this.cycle();
  }
  _isAnimated() {
    return this._element.classList.contains(Dq);
  }
  _getActive() {
    return Ie.findOne(zq, this._element);
  }
  _getItems() {
    return Ie.find(e2, this._element);
  }
  _clearInterval() {
    this._interval && (clearInterval(this._interval), this._interval = null);
  }
  _directionToOrder(t) {
    return Cc() ? t === O1 ? E1 : _b : t === O1 ? _b : E1;
  }
  _orderToDirection(t) {
    return Cc() ? t === E1 ? O1 : _T : t === E1 ? _T : O1;
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = LS.getOrCreateInstance(this, t);
      if (typeof t == "number") {
        e.to(t);
        return;
      }
      if (typeof t == "string") {
        if (e[t] === void 0 || t.startsWith("_") || t === "constructor")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
}
Zt.on(document, Oq, jq, function(n) {
  const t = Ie.getElementFromSelector(this);
  if (!t || !t.classList.contains(J6))
    return;
  n.preventDefault();
  const e = LS.getOrCreateInstance(t), a = this.getAttribute("data-bs-slide-to");
  if (a) {
    e.to(a), e._maybeEnableCycle();
    return;
  }
  if (rm.getDataAttribute(this, "slide") === "next") {
    e.next(), e._maybeEnableCycle();
    return;
  }
  e.prev(), e._maybeEnableCycle();
});
Zt.on(window, Cq, () => {
  const n = Ie.find(kq);
  for (const t of n)
    LS.getOrCreateInstance(t);
});
Dc(LS);
const Vq = "collapse", Yq = "bs.collapse", IS = `.${Yq}`, Fq = ".data-api", $q = `show${IS}`, Xq = `shown${IS}`, Kq = `hide${IS}`, Zq = `hidden${IS}`, Wq = `click${IS}${Fq}`, xA = "show", B1 = "collapse", Wx = "collapsing", Qq = "collapsed", Jq = `:scope .${B1} .${B1}`, tV = "collapse-horizontal", eV = "width", nV = "height", iV = ".collapse.show, .collapse.collapsing", HM = '[data-bs-toggle="collapse"]', aV = {
  parent: null,
  toggle: !0
}, rV = {
  parent: "(null|element)",
  toggle: "boolean"
};
class k_ extends Gf {
  constructor(t, e) {
    super(t, e), this._isTransitioning = !1, this._triggerArray = [];
    const a = Ie.find(HM);
    for (const s of a) {
      const l = Ie.getSelectorFromElement(s), f = Ie.find(l).filter((h) => h === this._element);
      l !== null && f.length && this._triggerArray.push(s);
    }
    this._initializeChildren(), this._config.parent || this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()), this._config.toggle && this.toggle();
  }
  // Getters
  static get Default() {
    return aV;
  }
  static get DefaultType() {
    return rV;
  }
  static get NAME() {
    return Vq;
  }
  // Public
  toggle() {
    this._isShown() ? this.hide() : this.show();
  }
  show() {
    if (this._isTransitioning || this._isShown())
      return;
    let t = [];
    if (this._config.parent && (t = this._getFirstLevelChildren(iV).filter((h) => h !== this._element).map((h) => k_.getOrCreateInstance(h, {
      toggle: !1
    }))), t.length && t[0]._isTransitioning || Zt.trigger(this._element, $q).defaultPrevented)
      return;
    for (const h of t)
      h.hide();
    const a = this._getDimension();
    this._element.classList.remove(B1), this._element.classList.add(Wx), this._element.style[a] = 0, this._addAriaAndCollapsedClass(this._triggerArray, !0), this._isTransitioning = !0;
    const s = () => {
      this._isTransitioning = !1, this._element.classList.remove(Wx), this._element.classList.add(B1, xA), this._element.style[a] = "", Zt.trigger(this._element, Xq);
    }, f = `scroll${a[0].toUpperCase() + a.slice(1)}`;
    this._queueCallback(s, this._element, !0), this._element.style[a] = `${this._element[f]}px`;
  }
  hide() {
    if (this._isTransitioning || !this._isShown() || Zt.trigger(this._element, Kq).defaultPrevented)
      return;
    const e = this._getDimension();
    this._element.style[e] = `${this._element.getBoundingClientRect()[e]}px`, DS(this._element), this._element.classList.add(Wx), this._element.classList.remove(B1, xA);
    for (const s of this._triggerArray) {
      const l = Ie.getElementFromSelector(s);
      l && !this._isShown(l) && this._addAriaAndCollapsedClass([s], !1);
    }
    this._isTransitioning = !0;
    const a = () => {
      this._isTransitioning = !1, this._element.classList.remove(Wx), this._element.classList.add(B1), Zt.trigger(this._element, Zq);
    };
    this._element.style[e] = "", this._queueCallback(a, this._element, !0);
  }
  // Private
  _isShown(t = this._element) {
    return t.classList.contains(xA);
  }
  _configAfterMerge(t) {
    return t.toggle = !!t.toggle, t.parent = R0(t.parent), t;
  }
  _getDimension() {
    return this._element.classList.contains(tV) ? eV : nV;
  }
  _initializeChildren() {
    if (!this._config.parent)
      return;
    const t = this._getFirstLevelChildren(HM);
    for (const e of t) {
      const a = Ie.getElementFromSelector(e);
      a && this._addAriaAndCollapsedClass([e], this._isShown(a));
    }
  }
  _getFirstLevelChildren(t) {
    const e = Ie.find(Jq, this._config.parent);
    return Ie.find(t, this._config.parent).filter((a) => !e.includes(a));
  }
  _addAriaAndCollapsedClass(t, e) {
    if (t.length)
      for (const a of t)
        a.classList.toggle(Qq, !e), a.setAttribute("aria-expanded", e);
  }
  // Static
  static jQueryInterface(t) {
    const e = {};
    return typeof t == "string" && /show|hide/.test(t) && (e.toggle = !1), this.each(function() {
      const a = k_.getOrCreateInstance(this, e);
      if (typeof t == "string") {
        if (typeof a[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        a[t]();
      }
    });
  }
}
Zt.on(document, Wq, HM, function(n) {
  (n.target.tagName === "A" || n.delegateTarget && n.delegateTarget.tagName === "A") && n.preventDefault();
  for (const t of Ie.getMultipleElementsFromSelector(this))
    k_.getOrCreateInstance(t, {
      toggle: !1
    }).toggle();
});
Dc(k_);
const mN = "dropdown", sV = "bs.dropdown", X_ = `.${sV}`, YC = ".data-api", oV = "Escape", pN = "Tab", lV = "ArrowUp", yN = "ArrowDown", uV = 2, cV = `hide${X_}`, fV = `hidden${X_}`, hV = `show${X_}`, dV = `shown${X_}`, n2 = `click${X_}${YC}`, i2 = `keydown${X_}${YC}`, gV = `keyup${X_}${YC}`, D1 = "show", mV = "dropup", pV = "dropend", yV = "dropstart", _V = "dropup-center", vV = "dropdown-center", y_ = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)', EV = `${y_}.${D1}`, vT = ".dropdown-menu", bV = ".navbar", SV = ".navbar-nav", xV = ".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)", TV = Cc() ? "top-end" : "top-start", wV = Cc() ? "top-start" : "top-end", RV = Cc() ? "bottom-end" : "bottom-start", AV = Cc() ? "bottom-start" : "bottom-end", MV = Cc() ? "left-start" : "right-start", CV = Cc() ? "right-start" : "left-start", OV = "top", DV = "bottom", NV = {
  autoClose: !0,
  boundary: "clippingParents",
  display: "dynamic",
  offset: [0, 2],
  popperConfig: null,
  reference: "toggle"
}, LV = {
  autoClose: "(boolean|string)",
  boundary: "(string|element)",
  display: "string",
  offset: "(array|string|function)",
  popperConfig: "(null|object|function)",
  reference: "(string|element|object)"
};
class ld extends Gf {
  constructor(t, e) {
    super(t, e), this._popper = null, this._parent = this._element.parentNode, this._menu = Ie.next(this._element, vT)[0] || Ie.prev(this._element, vT)[0] || Ie.findOne(vT, this._parent), this._inNavbar = this._detectNavbar();
  }
  // Getters
  static get Default() {
    return NV;
  }
  static get DefaultType() {
    return LV;
  }
  static get NAME() {
    return mN;
  }
  // Public
  toggle() {
    return this._isShown() ? this.hide() : this.show();
  }
  show() {
    if (A0(this._element) || this._isShown())
      return;
    const t = {
      relatedTarget: this._element
    };
    if (!Zt.trigger(this._element, hV, t).defaultPrevented) {
      if (this._createPopper(), "ontouchstart" in document.documentElement && !this._parent.closest(SV))
        for (const a of [].concat(...document.body.children))
          Zt.on(a, "mouseover", VT);
      this._element.focus(), this._element.setAttribute("aria-expanded", !0), this._menu.classList.add(D1), this._element.classList.add(D1), Zt.trigger(this._element, dV, t);
    }
  }
  hide() {
    if (A0(this._element) || !this._isShown())
      return;
    const t = {
      relatedTarget: this._element
    };
    this._completeHide(t);
  }
  dispose() {
    this._popper && this._popper.destroy(), super.dispose();
  }
  update() {
    this._inNavbar = this._detectNavbar(), this._popper && this._popper.update();
  }
  // Private
  _completeHide(t) {
    if (!Zt.trigger(this._element, cV, t).defaultPrevented) {
      if ("ontouchstart" in document.documentElement)
        for (const a of [].concat(...document.body.children))
          Zt.off(a, "mouseover", VT);
      this._popper && this._popper.destroy(), this._menu.classList.remove(D1), this._element.classList.remove(D1), this._element.setAttribute("aria-expanded", "false"), rm.removeDataAttribute(this._menu, "popper"), Zt.trigger(this._element, fV, t), this._element.focus();
    }
  }
  _getConfig(t) {
    if (t = super._getConfig(t), typeof t.reference == "object" && !am(t.reference) && typeof t.reference.getBoundingClientRect != "function")
      throw new TypeError(`${mN.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
    return t;
  }
  _createPopper() {
    if (typeof j6 > "u")
      throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");
    let t = this._element;
    this._config.reference === "parent" ? t = this._parent : am(this._config.reference) ? t = R0(this._config.reference) : typeof this._config.reference == "object" && (t = this._config.reference);
    const e = this._getPopperConfig();
    this._popper = BC(t, this._menu, e);
  }
  _isShown() {
    return this._menu.classList.contains(D1);
  }
  _getPlacement() {
    const t = this._parent;
    if (t.classList.contains(pV))
      return MV;
    if (t.classList.contains(yV))
      return CV;
    if (t.classList.contains(_V))
      return OV;
    if (t.classList.contains(vV))
      return DV;
    const e = getComputedStyle(this._menu).getPropertyValue("--bs-position").trim() === "end";
    return t.classList.contains(mV) ? e ? wV : TV : e ? AV : RV;
  }
  _detectNavbar() {
    return this._element.closest(bV) !== null;
  }
  _getOffset() {
    const {
      offset: t
    } = this._config;
    return typeof t == "string" ? t.split(",").map((e) => Number.parseInt(e, 10)) : typeof t == "function" ? (e) => t(e, this._element) : t;
  }
  _getPopperConfig() {
    const t = {
      placement: this._getPlacement(),
      modifiers: [{
        name: "preventOverflow",
        options: {
          boundary: this._config.boundary
        }
      }, {
        name: "offset",
        options: {
          offset: this._getOffset()
        }
      }]
    };
    return (this._inNavbar || this._config.display === "static") && (rm.setDataAttribute(this._menu, "popper", "static"), t.modifiers = [{
      name: "applyStyles",
      enabled: !1
    }]), {
      ...t,
      ...dl(this._config.popperConfig, [void 0, t])
    };
  }
  _selectMenuItem({
    key: t,
    target: e
  }) {
    const a = Ie.find(xV, this._menu).filter((s) => EE(s));
    a.length && qC(a, e, t === yN, !a.includes(e)).focus();
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = ld.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (typeof e[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
  static clearMenus(t) {
    if (t.button === uV || t.type === "keyup" && t.key !== pN)
      return;
    const e = Ie.find(EV);
    for (const a of e) {
      const s = ld.getInstance(a);
      if (!s || s._config.autoClose === !1)
        continue;
      const l = t.composedPath(), f = l.includes(s._menu);
      if (l.includes(s._element) || s._config.autoClose === "inside" && !f || s._config.autoClose === "outside" && f || s._menu.contains(t.target) && (t.type === "keyup" && t.key === pN || /input|select|option|textarea|form/i.test(t.target.tagName)))
        continue;
      const h = {
        relatedTarget: s._element
      };
      t.type === "click" && (h.clickEvent = t), s._completeHide(h);
    }
  }
  static dataApiKeydownHandler(t) {
    const e = /input|textarea/i.test(t.target.tagName), a = t.key === oV, s = [lV, yN].includes(t.key);
    if (!s && !a || e && !a)
      return;
    t.preventDefault();
    const l = this.matches(y_) ? this : Ie.prev(this, y_)[0] || Ie.next(this, y_)[0] || Ie.findOne(y_, t.delegateTarget.parentNode), f = ld.getOrCreateInstance(l);
    if (s) {
      t.stopPropagation(), f.show(), f._selectMenuItem(t);
      return;
    }
    f._isShown() && (t.stopPropagation(), f.hide(), l.focus());
  }
}
Zt.on(document, i2, y_, ld.dataApiKeydownHandler);
Zt.on(document, i2, vT, ld.dataApiKeydownHandler);
Zt.on(document, n2, ld.clearMenus);
Zt.on(document, gV, ld.clearMenus);
Zt.on(document, n2, y_, function(n) {
  n.preventDefault(), ld.getOrCreateInstance(this).toggle();
});
Dc(ld);
const a2 = "backdrop", IV = "fade", _N = "show", vN = `mousedown.bs.${a2}`, PV = {
  className: "modal-backdrop",
  clickCallback: null,
  isAnimated: !1,
  isVisible: !0,
  // if false, we use the backdrop helper without adding any element to the dom
  rootElement: "body"
  // give the choice to place backdrop under different elements
}, zV = {
  className: "string",
  clickCallback: "(function|null)",
  isAnimated: "boolean",
  isVisible: "boolean",
  rootElement: "(element|string)"
};
class r2 extends NS {
  constructor(t) {
    super(), this._config = this._getConfig(t), this._isAppended = !1, this._element = null;
  }
  // Getters
  static get Default() {
    return PV;
  }
  static get DefaultType() {
    return zV;
  }
  static get NAME() {
    return a2;
  }
  // Public
  show(t) {
    if (!this._config.isVisible) {
      dl(t);
      return;
    }
    this._append();
    const e = this._getElement();
    this._config.isAnimated && DS(e), e.classList.add(_N), this._emulateAnimation(() => {
      dl(t);
    });
  }
  hide(t) {
    if (!this._config.isVisible) {
      dl(t);
      return;
    }
    this._getElement().classList.remove(_N), this._emulateAnimation(() => {
      this.dispose(), dl(t);
    });
  }
  dispose() {
    this._isAppended && (Zt.off(this._element, vN), this._element.remove(), this._isAppended = !1);
  }
  // Private
  _getElement() {
    if (!this._element) {
      const t = document.createElement("div");
      t.className = this._config.className, this._config.isAnimated && t.classList.add(IV), this._element = t;
    }
    return this._element;
  }
  _configAfterMerge(t) {
    return t.rootElement = R0(t.rootElement), t;
  }
  _append() {
    if (this._isAppended)
      return;
    const t = this._getElement();
    this._config.rootElement.append(t), Zt.on(t, vN, () => {
      dl(this._config.clickCallback);
    }), this._isAppended = !0;
  }
  _emulateAnimation(t) {
    V6(t, this._getElement(), this._config.isAnimated);
  }
}
const GV = "focustrap", UV = "bs.focustrap", FT = `.${UV}`, jV = `focusin${FT}`, kV = `keydown.tab${FT}`, HV = "Tab", BV = "forward", EN = "backward", qV = {
  autofocus: !0,
  trapElement: null
  // The element to trap focus inside of
}, VV = {
  autofocus: "boolean",
  trapElement: "element"
};
class s2 extends NS {
  constructor(t) {
    super(), this._config = this._getConfig(t), this._isActive = !1, this._lastTabNavDirection = null;
  }
  // Getters
  static get Default() {
    return qV;
  }
  static get DefaultType() {
    return VV;
  }
  static get NAME() {
    return GV;
  }
  // Public
  activate() {
    this._isActive || (this._config.autofocus && this._config.trapElement.focus(), Zt.off(document, FT), Zt.on(document, jV, (t) => this._handleFocusin(t)), Zt.on(document, kV, (t) => this._handleKeydown(t)), this._isActive = !0);
  }
  deactivate() {
    this._isActive && (this._isActive = !1, Zt.off(document, FT));
  }
  // Private
  _handleFocusin(t) {
    const {
      trapElement: e
    } = this._config;
    if (t.target === document || t.target === e || e.contains(t.target))
      return;
    const a = Ie.focusableChildren(e);
    a.length === 0 ? e.focus() : this._lastTabNavDirection === EN ? a[a.length - 1].focus() : a[0].focus();
  }
  _handleKeydown(t) {
    t.key === HV && (this._lastTabNavDirection = t.shiftKey ? EN : BV);
  }
}
const bN = ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top", SN = ".sticky-top", Qx = "padding-right", xN = "margin-right";
class BM {
  constructor() {
    this._element = document.body;
  }
  // Public
  getWidth() {
    const t = document.documentElement.clientWidth;
    return Math.abs(window.innerWidth - t);
  }
  hide() {
    const t = this.getWidth();
    this._disableOverFlow(), this._setElementAttributes(this._element, Qx, (e) => e + t), this._setElementAttributes(bN, Qx, (e) => e + t), this._setElementAttributes(SN, xN, (e) => e - t);
  }
  reset() {
    this._resetElementAttributes(this._element, "overflow"), this._resetElementAttributes(this._element, Qx), this._resetElementAttributes(bN, Qx), this._resetElementAttributes(SN, xN);
  }
  isOverflowing() {
    return this.getWidth() > 0;
  }
  // Private
  _disableOverFlow() {
    this._saveInitialAttribute(this._element, "overflow"), this._element.style.overflow = "hidden";
  }
  _setElementAttributes(t, e, a) {
    const s = this.getWidth(), l = (f) => {
      if (f !== this._element && window.innerWidth > f.clientWidth + s)
        return;
      this._saveInitialAttribute(f, e);
      const h = window.getComputedStyle(f).getPropertyValue(e);
      f.style.setProperty(e, `${a(Number.parseFloat(h))}px`);
    };
    this._applyManipulationCallback(t, l);
  }
  _saveInitialAttribute(t, e) {
    const a = t.style.getPropertyValue(e);
    a && rm.setDataAttribute(t, e, a);
  }
  _resetElementAttributes(t, e) {
    const a = (s) => {
      const l = rm.getDataAttribute(s, e);
      if (l === null) {
        s.style.removeProperty(e);
        return;
      }
      rm.removeDataAttribute(s, e), s.style.setProperty(e, l);
    };
    this._applyManipulationCallback(t, a);
  }
  _applyManipulationCallback(t, e) {
    if (am(t)) {
      e(t);
      return;
    }
    for (const a of Ie.find(t, this._element))
      e(a);
  }
}
const YV = "modal", FV = "bs.modal", Oc = `.${FV}`, $V = ".data-api", XV = "Escape", KV = `hide${Oc}`, ZV = `hidePrevented${Oc}`, o2 = `hidden${Oc}`, l2 = `show${Oc}`, WV = `shown${Oc}`, QV = `resize${Oc}`, JV = `click.dismiss${Oc}`, tY = `mousedown.dismiss${Oc}`, eY = `keydown.dismiss${Oc}`, nY = `click${Oc}${$V}`, TN = "modal-open", iY = "fade", wN = "show", TA = "modal-static", aY = ".modal.show", rY = ".modal-dialog", sY = ".modal-body", oY = '[data-bs-toggle="modal"]', lY = {
  backdrop: !0,
  focus: !0,
  keyboard: !0
}, uY = {
  backdrop: "(boolean|string)",
  focus: "boolean",
  keyboard: "boolean"
};
class H_ extends Gf {
  constructor(t, e) {
    super(t, e), this._dialog = Ie.findOne(rY, this._element), this._backdrop = this._initializeBackDrop(), this._focustrap = this._initializeFocusTrap(), this._isShown = !1, this._isTransitioning = !1, this._scrollBar = new BM(), this._addEventListeners();
  }
  // Getters
  static get Default() {
    return lY;
  }
  static get DefaultType() {
    return uY;
  }
  static get NAME() {
    return YV;
  }
  // Public
  toggle(t) {
    return this._isShown ? this.hide() : this.show(t);
  }
  show(t) {
    this._isShown || this._isTransitioning || Zt.trigger(this._element, l2, {
      relatedTarget: t
    }).defaultPrevented || (this._isShown = !0, this._isTransitioning = !0, this._scrollBar.hide(), document.body.classList.add(TN), this._adjustDialog(), this._backdrop.show(() => this._showElement(t)));
  }
  hide() {
    !this._isShown || this._isTransitioning || Zt.trigger(this._element, KV).defaultPrevented || (this._isShown = !1, this._isTransitioning = !0, this._focustrap.deactivate(), this._element.classList.remove(wN), this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()));
  }
  dispose() {
    Zt.off(window, Oc), Zt.off(this._dialog, Oc), this._backdrop.dispose(), this._focustrap.deactivate(), super.dispose();
  }
  handleUpdate() {
    this._adjustDialog();
  }
  // Private
  _initializeBackDrop() {
    return new r2({
      isVisible: !!this._config.backdrop,
      // 'static' option will be translated to true, and booleans will keep their value,
      isAnimated: this._isAnimated()
    });
  }
  _initializeFocusTrap() {
    return new s2({
      trapElement: this._element
    });
  }
  _showElement(t) {
    document.body.contains(this._element) || document.body.append(this._element), this._element.style.display = "block", this._element.removeAttribute("aria-hidden"), this._element.setAttribute("aria-modal", !0), this._element.setAttribute("role", "dialog"), this._element.scrollTop = 0;
    const e = Ie.findOne(sY, this._dialog);
    e && (e.scrollTop = 0), DS(this._element), this._element.classList.add(wN);
    const a = () => {
      this._config.focus && this._focustrap.activate(), this._isTransitioning = !1, Zt.trigger(this._element, WV, {
        relatedTarget: t
      });
    };
    this._queueCallback(a, this._dialog, this._isAnimated());
  }
  _addEventListeners() {
    Zt.on(this._element, eY, (t) => {
      if (t.key === XV) {
        if (this._config.keyboard) {
          this.hide();
          return;
        }
        this._triggerBackdropTransition();
      }
    }), Zt.on(window, QV, () => {
      this._isShown && !this._isTransitioning && this._adjustDialog();
    }), Zt.on(this._element, tY, (t) => {
      Zt.one(this._element, JV, (e) => {
        if (!(this._element !== t.target || this._element !== e.target)) {
          if (this._config.backdrop === "static") {
            this._triggerBackdropTransition();
            return;
          }
          this._config.backdrop && this.hide();
        }
      });
    });
  }
  _hideModal() {
    this._element.style.display = "none", this._element.setAttribute("aria-hidden", !0), this._element.removeAttribute("aria-modal"), this._element.removeAttribute("role"), this._isTransitioning = !1, this._backdrop.hide(() => {
      document.body.classList.remove(TN), this._resetAdjustments(), this._scrollBar.reset(), Zt.trigger(this._element, o2);
    });
  }
  _isAnimated() {
    return this._element.classList.contains(iY);
  }
  _triggerBackdropTransition() {
    if (Zt.trigger(this._element, ZV).defaultPrevented)
      return;
    const e = this._element.scrollHeight > document.documentElement.clientHeight, a = this._element.style.overflowY;
    a === "hidden" || this._element.classList.contains(TA) || (e || (this._element.style.overflowY = "hidden"), this._element.classList.add(TA), this._queueCallback(() => {
      this._element.classList.remove(TA), this._queueCallback(() => {
        this._element.style.overflowY = a;
      }, this._dialog);
    }, this._dialog), this._element.focus());
  }
  /**
   * The following methods are used to handle overflowing modals
   */
  _adjustDialog() {
    const t = this._element.scrollHeight > document.documentElement.clientHeight, e = this._scrollBar.getWidth(), a = e > 0;
    if (a && !t) {
      const s = Cc() ? "paddingLeft" : "paddingRight";
      this._element.style[s] = `${e}px`;
    }
    if (!a && t) {
      const s = Cc() ? "paddingRight" : "paddingLeft";
      this._element.style[s] = `${e}px`;
    }
  }
  _resetAdjustments() {
    this._element.style.paddingLeft = "", this._element.style.paddingRight = "";
  }
  // Static
  static jQueryInterface(t, e) {
    return this.each(function() {
      const a = H_.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (typeof a[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        a[t](e);
      }
    });
  }
}
Zt.on(document, nY, oY, function(n) {
  const t = Ie.getElementFromSelector(this);
  ["A", "AREA"].includes(this.tagName) && n.preventDefault(), Zt.one(t, l2, (s) => {
    s.defaultPrevented || Zt.one(t, o2, () => {
      EE(this) && this.focus();
    });
  });
  const e = Ie.findOne(aY);
  e && H_.getInstance(e).hide(), H_.getOrCreateInstance(t).toggle(this);
});
xw(H_);
Dc(H_);
const cY = "offcanvas", fY = "bs.offcanvas", mm = `.${fY}`, u2 = ".data-api", hY = `load${mm}${u2}`, dY = "Escape", RN = "show", AN = "showing", MN = "hiding", gY = "offcanvas-backdrop", c2 = ".offcanvas.show", mY = `show${mm}`, pY = `shown${mm}`, yY = `hide${mm}`, CN = `hidePrevented${mm}`, f2 = `hidden${mm}`, _Y = `resize${mm}`, vY = `click${mm}${u2}`, EY = `keydown.dismiss${mm}`, bY = '[data-bs-toggle="offcanvas"]', SY = {
  backdrop: !0,
  keyboard: !0,
  scroll: !1
}, xY = {
  backdrop: "(boolean|string)",
  keyboard: "boolean",
  scroll: "boolean"
};
class M0 extends Gf {
  constructor(t, e) {
    super(t, e), this._isShown = !1, this._backdrop = this._initializeBackDrop(), this._focustrap = this._initializeFocusTrap(), this._addEventListeners();
  }
  // Getters
  static get Default() {
    return SY;
  }
  static get DefaultType() {
    return xY;
  }
  static get NAME() {
    return cY;
  }
  // Public
  toggle(t) {
    return this._isShown ? this.hide() : this.show(t);
  }
  show(t) {
    if (this._isShown || Zt.trigger(this._element, mY, {
      relatedTarget: t
    }).defaultPrevented)
      return;
    this._isShown = !0, this._backdrop.show(), this._config.scroll || new BM().hide(), this._element.setAttribute("aria-modal", !0), this._element.setAttribute("role", "dialog"), this._element.classList.add(AN);
    const a = () => {
      (!this._config.scroll || this._config.backdrop) && this._focustrap.activate(), this._element.classList.add(RN), this._element.classList.remove(AN), Zt.trigger(this._element, pY, {
        relatedTarget: t
      });
    };
    this._queueCallback(a, this._element, !0);
  }
  hide() {
    if (!this._isShown || Zt.trigger(this._element, yY).defaultPrevented)
      return;
    this._focustrap.deactivate(), this._element.blur(), this._isShown = !1, this._element.classList.add(MN), this._backdrop.hide();
    const e = () => {
      this._element.classList.remove(RN, MN), this._element.removeAttribute("aria-modal"), this._element.removeAttribute("role"), this._config.scroll || new BM().reset(), Zt.trigger(this._element, f2);
    };
    this._queueCallback(e, this._element, !0);
  }
  dispose() {
    this._backdrop.dispose(), this._focustrap.deactivate(), super.dispose();
  }
  // Private
  _initializeBackDrop() {
    const t = () => {
      if (this._config.backdrop === "static") {
        Zt.trigger(this._element, CN);
        return;
      }
      this.hide();
    }, e = !!this._config.backdrop;
    return new r2({
      className: gY,
      isVisible: e,
      isAnimated: !0,
      rootElement: this._element.parentNode,
      clickCallback: e ? t : null
    });
  }
  _initializeFocusTrap() {
    return new s2({
      trapElement: this._element
    });
  }
  _addEventListeners() {
    Zt.on(this._element, EY, (t) => {
      if (t.key === dY) {
        if (this._config.keyboard) {
          this.hide();
          return;
        }
        Zt.trigger(this._element, CN);
      }
    });
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = M0.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (e[t] === void 0 || t.startsWith("_") || t === "constructor")
          throw new TypeError(`No method named "${t}"`);
        e[t](this);
      }
    });
  }
}
Zt.on(document, vY, bY, function(n) {
  const t = Ie.getElementFromSelector(this);
  if (["A", "AREA"].includes(this.tagName) && n.preventDefault(), A0(this))
    return;
  Zt.one(t, f2, () => {
    EE(this) && this.focus();
  });
  const e = Ie.findOne(c2);
  e && e !== t && M0.getInstance(e).hide(), M0.getOrCreateInstance(t).toggle(this);
});
Zt.on(window, hY, () => {
  for (const n of Ie.find(c2))
    M0.getOrCreateInstance(n).show();
});
Zt.on(window, _Y, () => {
  for (const n of Ie.find("[aria-modal][class*=show][class*=offcanvas-]"))
    getComputedStyle(n).position !== "fixed" && M0.getOrCreateInstance(n).hide();
});
xw(M0);
Dc(M0);
const TY = /^aria-[\w-]*$/i, h2 = {
  // Global attributes allowed on any supplied element below.
  "*": ["class", "dir", "id", "lang", "role", TY],
  a: ["target", "href", "title", "rel"],
  area: [],
  b: [],
  br: [],
  col: [],
  code: [],
  dd: [],
  div: [],
  dl: [],
  dt: [],
  em: [],
  hr: [],
  h1: [],
  h2: [],
  h3: [],
  h4: [],
  h5: [],
  h6: [],
  i: [],
  img: ["src", "srcset", "alt", "title", "width", "height"],
  li: [],
  ol: [],
  p: [],
  pre: [],
  s: [],
  small: [],
  span: [],
  sub: [],
  sup: [],
  strong: [],
  u: [],
  ul: []
}, wY = /* @__PURE__ */ new Set(["background", "cite", "href", "itemtype", "longdesc", "poster", "src", "xlink:href"]), RY = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i, AY = (n, t) => {
  const e = n.nodeName.toLowerCase();
  return t.includes(e) ? wY.has(e) ? !!RY.test(n.nodeValue) : !0 : t.filter((a) => a instanceof RegExp).some((a) => a.test(e));
};
function MY(n, t, e) {
  if (!n.length)
    return n;
  if (e && typeof e == "function")
    return e(n);
  const s = new window.DOMParser().parseFromString(n, "text/html"), l = [].concat(...s.body.querySelectorAll("*"));
  for (const f of l) {
    const h = f.nodeName.toLowerCase();
    if (!Object.keys(t).includes(h)) {
      f.remove();
      continue;
    }
    const p = [].concat(...f.attributes), y = [].concat(t["*"] || [], t[h] || []);
    for (const b of p)
      AY(b, y) || f.removeAttribute(b.nodeName);
  }
  return s.body.innerHTML;
}
const CY = "TemplateFactory", OY = {
  allowList: h2,
  content: {},
  // { selector : text ,  selector2 : text2 , }
  extraClass: "",
  html: !1,
  sanitize: !0,
  sanitizeFn: null,
  template: "<div></div>"
}, DY = {
  allowList: "object",
  content: "object",
  extraClass: "(string|function)",
  html: "boolean",
  sanitize: "boolean",
  sanitizeFn: "(null|function)",
  template: "string"
}, NY = {
  entry: "(string|element|function|null)",
  selector: "(string|element)"
};
class LY extends NS {
  constructor(t) {
    super(), this._config = this._getConfig(t);
  }
  // Getters
  static get Default() {
    return OY;
  }
  static get DefaultType() {
    return DY;
  }
  static get NAME() {
    return CY;
  }
  // Public
  getContent() {
    return Object.values(this._config.content).map((t) => this._resolvePossibleFunction(t)).filter(Boolean);
  }
  hasContent() {
    return this.getContent().length > 0;
  }
  changeContent(t) {
    return this._checkContent(t), this._config.content = {
      ...this._config.content,
      ...t
    }, this;
  }
  toHtml() {
    const t = document.createElement("div");
    t.innerHTML = this._maybeSanitize(this._config.template);
    for (const [s, l] of Object.entries(this._config.content))
      this._setContent(t, l, s);
    const e = t.children[0], a = this._resolvePossibleFunction(this._config.extraClass);
    return a && e.classList.add(...a.split(" ")), e;
  }
  // Private
  _typeCheckConfig(t) {
    super._typeCheckConfig(t), this._checkContent(t.content);
  }
  _checkContent(t) {
    for (const [e, a] of Object.entries(t))
      super._typeCheckConfig({
        selector: e,
        entry: a
      }, NY);
  }
  _setContent(t, e, a) {
    const s = Ie.findOne(a, t);
    if (s) {
      if (e = this._resolvePossibleFunction(e), !e) {
        s.remove();
        return;
      }
      if (am(e)) {
        this._putElementInTemplate(R0(e), s);
        return;
      }
      if (this._config.html) {
        s.innerHTML = this._maybeSanitize(e);
        return;
      }
      s.textContent = e;
    }
  }
  _maybeSanitize(t) {
    return this._config.sanitize ? MY(t, this._config.allowList, this._config.sanitizeFn) : t;
  }
  _resolvePossibleFunction(t) {
    return dl(t, [void 0, this]);
  }
  _putElementInTemplate(t, e) {
    if (this._config.html) {
      e.innerHTML = "", e.append(t);
      return;
    }
    e.textContent = t.textContent;
  }
}
const IY = "tooltip", PY = /* @__PURE__ */ new Set(["sanitize", "allowList", "sanitizeFn"]), wA = "fade", zY = "modal", Jx = "show", GY = ".tooltip-inner", ON = `.${zY}`, DN = "hide.bs.modal", vb = "hover", RA = "focus", AA = "click", UY = "manual", jY = "hide", kY = "hidden", HY = "show", BY = "shown", qY = "inserted", VY = "click", YY = "focusin", FY = "focusout", $Y = "mouseenter", XY = "mouseleave", KY = {
  AUTO: "auto",
  TOP: "top",
  RIGHT: Cc() ? "left" : "right",
  BOTTOM: "bottom",
  LEFT: Cc() ? "right" : "left"
}, ZY = {
  allowList: h2,
  animation: !0,
  boundary: "clippingParents",
  container: !1,
  customClass: "",
  delay: 0,
  fallbackPlacements: ["top", "right", "bottom", "left"],
  html: !1,
  offset: [0, 6],
  placement: "top",
  popperConfig: null,
  sanitize: !0,
  sanitizeFn: null,
  selector: !1,
  template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  title: "",
  trigger: "hover focus"
}, WY = {
  allowList: "object",
  animation: "boolean",
  boundary: "(string|element)",
  container: "(string|element|boolean)",
  customClass: "(string|function)",
  delay: "(number|object)",
  fallbackPlacements: "array",
  html: "boolean",
  offset: "(array|string|function)",
  placement: "(string|function)",
  popperConfig: "(null|object|function)",
  sanitize: "boolean",
  sanitizeFn: "(null|function)",
  selector: "(string|boolean)",
  template: "string",
  title: "(string|element|function)",
  trigger: "string"
};
class SE extends Gf {
  constructor(t, e) {
    if (typeof j6 > "u")
      throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");
    super(t, e), this._isEnabled = !0, this._timeout = 0, this._isHovered = null, this._activeTrigger = {}, this._popper = null, this._templateFactory = null, this._newContent = null, this.tip = null, this._setListeners(), this._config.selector || this._fixTitle();
  }
  // Getters
  static get Default() {
    return ZY;
  }
  static get DefaultType() {
    return WY;
  }
  static get NAME() {
    return IY;
  }
  // Public
  enable() {
    this._isEnabled = !0;
  }
  disable() {
    this._isEnabled = !1;
  }
  toggleEnabled() {
    this._isEnabled = !this._isEnabled;
  }
  toggle() {
    if (this._isEnabled) {
      if (this._isShown()) {
        this._leave();
        return;
      }
      this._enter();
    }
  }
  dispose() {
    clearTimeout(this._timeout), Zt.off(this._element.closest(ON), DN, this._hideModalHandler), this._element.getAttribute("data-bs-original-title") && this._element.setAttribute("title", this._element.getAttribute("data-bs-original-title")), this._disposePopper(), super.dispose();
  }
  show() {
    if (this._element.style.display === "none")
      throw new Error("Please use show on visible elements");
    if (!(this._isWithContent() && this._isEnabled))
      return;
    const t = Zt.trigger(this._element, this.constructor.eventName(HY)), a = (B6(this._element) || this._element.ownerDocument.documentElement).contains(this._element);
    if (t.defaultPrevented || !a)
      return;
    this._disposePopper();
    const s = this._getTipElement();
    this._element.setAttribute("aria-describedby", s.getAttribute("id"));
    const {
      container: l
    } = this._config;
    if (this._element.ownerDocument.documentElement.contains(this.tip) || (l.append(s), Zt.trigger(this._element, this.constructor.eventName(qY))), this._popper = this._createPopper(s), s.classList.add(Jx), "ontouchstart" in document.documentElement)
      for (const h of [].concat(...document.body.children))
        Zt.on(h, "mouseover", VT);
    const f = () => {
      Zt.trigger(this._element, this.constructor.eventName(BY)), this._isHovered === !1 && this._leave(), this._isHovered = !1;
    };
    this._queueCallback(f, this.tip, this._isAnimated());
  }
  hide() {
    if (!this._isShown() || Zt.trigger(this._element, this.constructor.eventName(jY)).defaultPrevented)
      return;
    if (this._getTipElement().classList.remove(Jx), "ontouchstart" in document.documentElement)
      for (const s of [].concat(...document.body.children))
        Zt.off(s, "mouseover", VT);
    this._activeTrigger[AA] = !1, this._activeTrigger[RA] = !1, this._activeTrigger[vb] = !1, this._isHovered = null;
    const a = () => {
      this._isWithActiveTrigger() || (this._isHovered || this._disposePopper(), this._element.removeAttribute("aria-describedby"), Zt.trigger(this._element, this.constructor.eventName(kY)));
    };
    this._queueCallback(a, this.tip, this._isAnimated());
  }
  update() {
    this._popper && this._popper.update();
  }
  // Protected
  _isWithContent() {
    return !!this._getTitle();
  }
  _getTipElement() {
    return this.tip || (this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())), this.tip;
  }
  _createTipElement(t) {
    const e = this._getTemplateFactory(t).toHtml();
    if (!e)
      return null;
    e.classList.remove(wA, Jx), e.classList.add(`bs-${this.constructor.NAME}-auto`);
    const a = UB(this.constructor.NAME).toString();
    return e.setAttribute("id", a), this._isAnimated() && e.classList.add(wA), e;
  }
  setContent(t) {
    this._newContent = t, this._isShown() && (this._disposePopper(), this.show());
  }
  _getTemplateFactory(t) {
    return this._templateFactory ? this._templateFactory.changeContent(t) : this._templateFactory = new LY({
      ...this._config,
      // the `content` var has to be after `this._config`
      // to override config.content in case of popover
      content: t,
      extraClass: this._resolvePossibleFunction(this._config.customClass)
    }), this._templateFactory;
  }
  _getContentForTemplate() {
    return {
      [GY]: this._getTitle()
    };
  }
  _getTitle() {
    return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute("data-bs-original-title");
  }
  // Private
  _initializeOnDelegatedTarget(t) {
    return this.constructor.getOrCreateInstance(t.delegateTarget, this._getDelegateConfig());
  }
  _isAnimated() {
    return this._config.animation || this.tip && this.tip.classList.contains(wA);
  }
  _isShown() {
    return this.tip && this.tip.classList.contains(Jx);
  }
  _createPopper(t) {
    const e = dl(this._config.placement, [this, t, this._element]), a = KY[e.toUpperCase()];
    return BC(this._element, t, this._getPopperConfig(a));
  }
  _getOffset() {
    const {
      offset: t
    } = this._config;
    return typeof t == "string" ? t.split(",").map((e) => Number.parseInt(e, 10)) : typeof t == "function" ? (e) => t(e, this._element) : t;
  }
  _resolvePossibleFunction(t) {
    return dl(t, [this._element, this._element]);
  }
  _getPopperConfig(t) {
    const e = {
      placement: t,
      modifiers: [{
        name: "flip",
        options: {
          fallbackPlacements: this._config.fallbackPlacements
        }
      }, {
        name: "offset",
        options: {
          offset: this._getOffset()
        }
      }, {
        name: "preventOverflow",
        options: {
          boundary: this._config.boundary
        }
      }, {
        name: "arrow",
        options: {
          element: `.${this.constructor.NAME}-arrow`
        }
      }, {
        name: "preSetPlacement",
        enabled: !0,
        phase: "beforeMain",
        fn: (a) => {
          this._getTipElement().setAttribute("data-popper-placement", a.state.placement);
        }
      }]
    };
    return {
      ...e,
      ...dl(this._config.popperConfig, [void 0, e])
    };
  }
  _setListeners() {
    const t = this._config.trigger.split(" ");
    for (const e of t)
      if (e === "click")
        Zt.on(this._element, this.constructor.eventName(VY), this._config.selector, (a) => {
          const s = this._initializeOnDelegatedTarget(a);
          s._activeTrigger[AA] = !(s._isShown() && s._activeTrigger[AA]), s.toggle();
        });
      else if (e !== UY) {
        const a = e === vb ? this.constructor.eventName($Y) : this.constructor.eventName(YY), s = e === vb ? this.constructor.eventName(XY) : this.constructor.eventName(FY);
        Zt.on(this._element, a, this._config.selector, (l) => {
          const f = this._initializeOnDelegatedTarget(l);
          f._activeTrigger[l.type === "focusin" ? RA : vb] = !0, f._enter();
        }), Zt.on(this._element, s, this._config.selector, (l) => {
          const f = this._initializeOnDelegatedTarget(l);
          f._activeTrigger[l.type === "focusout" ? RA : vb] = f._element.contains(l.relatedTarget), f._leave();
        });
      }
    this._hideModalHandler = () => {
      this._element && this.hide();
    }, Zt.on(this._element.closest(ON), DN, this._hideModalHandler);
  }
  _fixTitle() {
    const t = this._element.getAttribute("title");
    t && (!this._element.getAttribute("aria-label") && !this._element.textContent.trim() && this._element.setAttribute("aria-label", t), this._element.setAttribute("data-bs-original-title", t), this._element.removeAttribute("title"));
  }
  _enter() {
    if (this._isShown() || this._isHovered) {
      this._isHovered = !0;
      return;
    }
    this._isHovered = !0, this._setTimeout(() => {
      this._isHovered && this.show();
    }, this._config.delay.show);
  }
  _leave() {
    this._isWithActiveTrigger() || (this._isHovered = !1, this._setTimeout(() => {
      this._isHovered || this.hide();
    }, this._config.delay.hide));
  }
  _setTimeout(t, e) {
    clearTimeout(this._timeout), this._timeout = setTimeout(t, e);
  }
  _isWithActiveTrigger() {
    return Object.values(this._activeTrigger).includes(!0);
  }
  _getConfig(t) {
    const e = rm.getDataAttributes(this._element);
    for (const a of Object.keys(e))
      PY.has(a) && delete e[a];
    return t = {
      ...e,
      ...typeof t == "object" && t ? t : {}
    }, t = this._mergeConfigObj(t), t = this._configAfterMerge(t), this._typeCheckConfig(t), t;
  }
  _configAfterMerge(t) {
    return t.container = t.container === !1 ? document.body : R0(t.container), typeof t.delay == "number" && (t.delay = {
      show: t.delay,
      hide: t.delay
    }), typeof t.title == "number" && (t.title = t.title.toString()), typeof t.content == "number" && (t.content = t.content.toString()), t;
  }
  _getDelegateConfig() {
    const t = {};
    for (const [e, a] of Object.entries(this._config))
      this.constructor.Default[e] !== a && (t[e] = a);
    return t.selector = !1, t.trigger = "manual", t;
  }
  _disposePopper() {
    this._popper && (this._popper.destroy(), this._popper = null), this.tip && (this.tip.remove(), this.tip = null);
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = SE.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (typeof e[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
}
Dc(SE);
const QY = "popover", JY = ".popover-header", tF = ".popover-body", eF = {
  ...SE.Default,
  content: "",
  offset: [0, 8],
  placement: "right",
  template: '<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',
  trigger: "click"
}, nF = {
  ...SE.DefaultType,
  content: "(null|string|element|function)"
};
class Rw extends SE {
  // Getters
  static get Default() {
    return eF;
  }
  static get DefaultType() {
    return nF;
  }
  static get NAME() {
    return QY;
  }
  // Overrides
  _isWithContent() {
    return this._getTitle() || this._getContent();
  }
  // Private
  _getContentForTemplate() {
    return {
      [JY]: this._getTitle(),
      [tF]: this._getContent()
    };
  }
  _getContent() {
    return this._resolvePossibleFunction(this._config.content);
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = Rw.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (typeof e[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
}
Dc(Rw);
const iF = "scrollspy", aF = "bs.scrollspy", FC = `.${aF}`, rF = ".data-api", sF = `activate${FC}`, NN = `click${FC}`, oF = `load${FC}${rF}`, lF = "dropdown-item", b1 = "active", uF = '[data-bs-spy="scroll"]', MA = "[href]", cF = ".nav, .list-group", LN = ".nav-link", fF = ".nav-item", hF = ".list-group-item", dF = `${LN}, ${fF} > ${LN}, ${hF}`, gF = ".dropdown", mF = ".dropdown-toggle", pF = {
  offset: null,
  // TODO: v6 @deprecated, keep it for backwards compatibility reasons
  rootMargin: "0px 0px -25%",
  smoothScroll: !1,
  target: null,
  threshold: [0.1, 0.5, 1]
}, yF = {
  offset: "(number|null)",
  // TODO v6 @deprecated, keep it for backwards compatibility reasons
  rootMargin: "string",
  smoothScroll: "boolean",
  target: "element",
  threshold: "array"
};
class Aw extends Gf {
  constructor(t, e) {
    super(t, e), this._targetLinks = /* @__PURE__ */ new Map(), this._observableSections = /* @__PURE__ */ new Map(), this._rootElement = getComputedStyle(this._element).overflowY === "visible" ? null : this._element, this._activeTarget = null, this._observer = null, this._previousScrollData = {
      visibleEntryTop: 0,
      parentScrollTop: 0
    }, this.refresh();
  }
  // Getters
  static get Default() {
    return pF;
  }
  static get DefaultType() {
    return yF;
  }
  static get NAME() {
    return iF;
  }
  // Public
  refresh() {
    this._initializeTargetsAndObservables(), this._maybeEnableSmoothScroll(), this._observer ? this._observer.disconnect() : this._observer = this._getNewObserver();
    for (const t of this._observableSections.values())
      this._observer.observe(t);
  }
  dispose() {
    this._observer.disconnect(), super.dispose();
  }
  // Private
  _configAfterMerge(t) {
    return t.target = R0(t.target) || document.body, t.rootMargin = t.offset ? `${t.offset}px 0px -30%` : t.rootMargin, typeof t.threshold == "string" && (t.threshold = t.threshold.split(",").map((e) => Number.parseFloat(e))), t;
  }
  _maybeEnableSmoothScroll() {
    this._config.smoothScroll && (Zt.off(this._config.target, NN), Zt.on(this._config.target, NN, MA, (t) => {
      const e = this._observableSections.get(t.target.hash);
      if (e) {
        t.preventDefault();
        const a = this._rootElement || window, s = e.offsetTop - this._element.offsetTop;
        if (a.scrollTo) {
          a.scrollTo({
            top: s,
            behavior: "smooth"
          });
          return;
        }
        a.scrollTop = s;
      }
    }));
  }
  _getNewObserver() {
    const t = {
      root: this._rootElement,
      threshold: this._config.threshold,
      rootMargin: this._config.rootMargin
    };
    return new IntersectionObserver((e) => this._observerCallback(e), t);
  }
  // The logic of selection
  _observerCallback(t) {
    const e = (f) => this._targetLinks.get(`#${f.target.id}`), a = (f) => {
      this._previousScrollData.visibleEntryTop = f.target.offsetTop, this._process(e(f));
    }, s = (this._rootElement || document.documentElement).scrollTop, l = s >= this._previousScrollData.parentScrollTop;
    this._previousScrollData.parentScrollTop = s;
    for (const f of t) {
      if (!f.isIntersecting) {
        this._activeTarget = null, this._clearActiveClass(e(f));
        continue;
      }
      const h = f.target.offsetTop >= this._previousScrollData.visibleEntryTop;
      if (l && h) {
        if (a(f), !s)
          return;
        continue;
      }
      !l && !h && a(f);
    }
  }
  _initializeTargetsAndObservables() {
    this._targetLinks = /* @__PURE__ */ new Map(), this._observableSections = /* @__PURE__ */ new Map();
    const t = Ie.find(MA, this._config.target);
    for (const e of t) {
      if (!e.hash || A0(e))
        continue;
      const a = Ie.findOne(decodeURI(e.hash), this._element);
      EE(a) && (this._targetLinks.set(decodeURI(e.hash), e), this._observableSections.set(e.hash, a));
    }
  }
  _process(t) {
    this._activeTarget !== t && (this._clearActiveClass(this._config.target), this._activeTarget = t, t.classList.add(b1), this._activateParents(t), Zt.trigger(this._element, sF, {
      relatedTarget: t
    }));
  }
  _activateParents(t) {
    if (t.classList.contains(lF)) {
      Ie.findOne(mF, t.closest(gF)).classList.add(b1);
      return;
    }
    for (const e of Ie.parents(t, cF))
      for (const a of Ie.prev(e, dF))
        a.classList.add(b1);
  }
  _clearActiveClass(t) {
    t.classList.remove(b1);
    const e = Ie.find(`${MA}.${b1}`, t);
    for (const a of e)
      a.classList.remove(b1);
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = Aw.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (e[t] === void 0 || t.startsWith("_") || t === "constructor")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
}
Zt.on(window, oF, () => {
  for (const n of Ie.find(uF))
    Aw.getOrCreateInstance(n);
});
Dc(Aw);
const _F = "tab", vF = "bs.tab", K_ = `.${vF}`, EF = `hide${K_}`, bF = `hidden${K_}`, SF = `show${K_}`, xF = `shown${K_}`, TF = `click${K_}`, wF = `keydown${K_}`, RF = `load${K_}`, AF = "ArrowLeft", IN = "ArrowRight", MF = "ArrowUp", PN = "ArrowDown", CA = "Home", zN = "End", __ = "active", GN = "fade", OA = "show", CF = "dropdown", d2 = ".dropdown-toggle", OF = ".dropdown-menu", DA = `:not(${d2})`, DF = '.list-group, .nav, [role="tablist"]', NF = ".nav-item, .list-group-item", LF = `.nav-link${DA}, .list-group-item${DA}, [role="tab"]${DA}`, g2 = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]', NA = `${LF}, ${g2}`, IF = `.${__}[data-bs-toggle="tab"], .${__}[data-bs-toggle="pill"], .${__}[data-bs-toggle="list"]`;
class sE extends Gf {
  constructor(t) {
    super(t), this._parent = this._element.closest(DF), this._parent && (this._setInitialAttributes(this._parent, this._getChildren()), Zt.on(this._element, wF, (e) => this._keydown(e)));
  }
  // Getters
  static get NAME() {
    return _F;
  }
  // Public
  show() {
    const t = this._element;
    if (this._elemIsActive(t))
      return;
    const e = this._getActiveElem(), a = e ? Zt.trigger(e, EF, {
      relatedTarget: t
    }) : null;
    Zt.trigger(t, SF, {
      relatedTarget: e
    }).defaultPrevented || a && a.defaultPrevented || (this._deactivate(e, t), this._activate(t, e));
  }
  // Private
  _activate(t, e) {
    if (!t)
      return;
    t.classList.add(__), this._activate(Ie.getElementFromSelector(t));
    const a = () => {
      if (t.getAttribute("role") !== "tab") {
        t.classList.add(OA);
        return;
      }
      t.removeAttribute("tabindex"), t.setAttribute("aria-selected", !0), this._toggleDropDown(t, !0), Zt.trigger(t, xF, {
        relatedTarget: e
      });
    };
    this._queueCallback(a, t, t.classList.contains(GN));
  }
  _deactivate(t, e) {
    if (!t)
      return;
    t.classList.remove(__), t.blur(), this._deactivate(Ie.getElementFromSelector(t));
    const a = () => {
      if (t.getAttribute("role") !== "tab") {
        t.classList.remove(OA);
        return;
      }
      t.setAttribute("aria-selected", !1), t.setAttribute("tabindex", "-1"), this._toggleDropDown(t, !1), Zt.trigger(t, bF, {
        relatedTarget: e
      });
    };
    this._queueCallback(a, t, t.classList.contains(GN));
  }
  _keydown(t) {
    if (![AF, IN, MF, PN, CA, zN].includes(t.key))
      return;
    t.stopPropagation(), t.preventDefault();
    const e = this._getChildren().filter((s) => !A0(s));
    let a;
    if ([CA, zN].includes(t.key))
      a = e[t.key === CA ? 0 : e.length - 1];
    else {
      const s = [IN, PN].includes(t.key);
      a = qC(e, t.target, s, !0);
    }
    a && (a.focus({
      preventScroll: !0
    }), sE.getOrCreateInstance(a).show());
  }
  _getChildren() {
    return Ie.find(NA, this._parent);
  }
  _getActiveElem() {
    return this._getChildren().find((t) => this._elemIsActive(t)) || null;
  }
  _setInitialAttributes(t, e) {
    this._setAttributeIfNotExists(t, "role", "tablist");
    for (const a of e)
      this._setInitialAttributesOnChild(a);
  }
  _setInitialAttributesOnChild(t) {
    t = this._getInnerElement(t);
    const e = this._elemIsActive(t), a = this._getOuterElement(t);
    t.setAttribute("aria-selected", e), a !== t && this._setAttributeIfNotExists(a, "role", "presentation"), e || t.setAttribute("tabindex", "-1"), this._setAttributeIfNotExists(t, "role", "tab"), this._setInitialAttributesOnTargetPanel(t);
  }
  _setInitialAttributesOnTargetPanel(t) {
    const e = Ie.getElementFromSelector(t);
    e && (this._setAttributeIfNotExists(e, "role", "tabpanel"), t.id && this._setAttributeIfNotExists(e, "aria-labelledby", `${t.id}`));
  }
  _toggleDropDown(t, e) {
    const a = this._getOuterElement(t);
    if (!a.classList.contains(CF))
      return;
    const s = (l, f) => {
      const h = Ie.findOne(l, a);
      h && h.classList.toggle(f, e);
    };
    s(d2, __), s(OF, OA), a.setAttribute("aria-expanded", e);
  }
  _setAttributeIfNotExists(t, e, a) {
    t.hasAttribute(e) || t.setAttribute(e, a);
  }
  _elemIsActive(t) {
    return t.classList.contains(__);
  }
  // Try to get the inner element (usually the .nav-link)
  _getInnerElement(t) {
    return t.matches(NA) ? t : Ie.findOne(NA, t);
  }
  // Try to get the outer element (usually the .nav-item)
  _getOuterElement(t) {
    return t.closest(NF) || t;
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = sE.getOrCreateInstance(this);
      if (typeof t == "string") {
        if (e[t] === void 0 || t.startsWith("_") || t === "constructor")
          throw new TypeError(`No method named "${t}"`);
        e[t]();
      }
    });
  }
}
Zt.on(document, TF, g2, function(n) {
  ["A", "AREA"].includes(this.tagName) && n.preventDefault(), !A0(this) && sE.getOrCreateInstance(this).show();
});
Zt.on(window, RF, () => {
  for (const n of Ie.find(IF))
    sE.getOrCreateInstance(n);
});
Dc(sE);
const PF = "toast", zF = "bs.toast", L0 = `.${zF}`, GF = `mouseover${L0}`, UF = `mouseout${L0}`, jF = `focusin${L0}`, kF = `focusout${L0}`, HF = `hide${L0}`, BF = `hidden${L0}`, qF = `show${L0}`, VF = `shown${L0}`, YF = "fade", UN = "hide", tT = "show", eT = "showing", FF = {
  animation: "boolean",
  autohide: "boolean",
  delay: "number"
}, $F = {
  animation: !0,
  autohide: !0,
  delay: 5e3
};
class oE extends Gf {
  constructor(t, e) {
    super(t, e), this._timeout = null, this._hasMouseInteraction = !1, this._hasKeyboardInteraction = !1, this._setListeners();
  }
  // Getters
  static get Default() {
    return $F;
  }
  static get DefaultType() {
    return FF;
  }
  static get NAME() {
    return PF;
  }
  // Public
  show() {
    if (Zt.trigger(this._element, qF).defaultPrevented)
      return;
    this._clearTimeout(), this._config.animation && this._element.classList.add(YF);
    const e = () => {
      this._element.classList.remove(eT), Zt.trigger(this._element, VF), this._maybeScheduleHide();
    };
    this._element.classList.remove(UN), DS(this._element), this._element.classList.add(tT, eT), this._queueCallback(e, this._element, this._config.animation);
  }
  hide() {
    if (!this.isShown() || Zt.trigger(this._element, HF).defaultPrevented)
      return;
    const e = () => {
      this._element.classList.add(UN), this._element.classList.remove(eT, tT), Zt.trigger(this._element, BF);
    };
    this._element.classList.add(eT), this._queueCallback(e, this._element, this._config.animation);
  }
  dispose() {
    this._clearTimeout(), this.isShown() && this._element.classList.remove(tT), super.dispose();
  }
  isShown() {
    return this._element.classList.contains(tT);
  }
  // Private
  _maybeScheduleHide() {
    this._config.autohide && (this._hasMouseInteraction || this._hasKeyboardInteraction || (this._timeout = setTimeout(() => {
      this.hide();
    }, this._config.delay)));
  }
  _onInteraction(t, e) {
    switch (t.type) {
      case "mouseover":
      case "mouseout": {
        this._hasMouseInteraction = e;
        break;
      }
      case "focusin":
      case "focusout": {
        this._hasKeyboardInteraction = e;
        break;
      }
    }
    if (e) {
      this._clearTimeout();
      return;
    }
    const a = t.relatedTarget;
    this._element === a || this._element.contains(a) || this._maybeScheduleHide();
  }
  _setListeners() {
    Zt.on(this._element, GF, (t) => this._onInteraction(t, !0)), Zt.on(this._element, UF, (t) => this._onInteraction(t, !1)), Zt.on(this._element, jF, (t) => this._onInteraction(t, !0)), Zt.on(this._element, kF, (t) => this._onInteraction(t, !1));
  }
  _clearTimeout() {
    clearTimeout(this._timeout), this._timeout = null;
  }
  // Static
  static jQueryInterface(t) {
    return this.each(function() {
      const e = oE.getOrCreateInstance(this, t);
      if (typeof t == "string") {
        if (typeof e[t] > "u")
          throw new TypeError(`No method named "${t}"`);
        e[t](this);
      }
    });
  }
}
xw(oE);
Dc(oE);
const ja = function(n, t, e) {
  if (Re.isArray(n) && n.length > 0) {
    let a = null;
    for (let s = 0; s < n.length; s++) {
      if (n[s].Language === t)
        return n[s].Text;
      n[s].Language === e && (a = n[s].Text);
    }
    return a || n[0].Text;
  }
  return null;
}, jN = function(n, t, e) {
  if (Re.isArray(n) && n.length > 0) {
    let a = null;
    for (let s = 0; s < n.length; s++) {
      if (n[s].Language === t)
        return n[s].URL;
      n[s].Language === e && (a = n[s].URL);
    }
    return a || n[0].URL;
  }
  return null;
}, ol = {
  /**
   * Triggered when an item is added to the collection.
   * @event module:ol/Collection.CollectionEvent#add
   * @api
   */
  ADD: "add",
  /**
   * Triggered when an item is removed from the collection.
   * @event module:ol/Collection.CollectionEvent#remove
   * @api
   */
  REMOVE: "remove"
}, lE = {
  /**
   * Triggered when a property is changed.
   * @event module:ol/Object.ObjectEvent#propertychange
   * @api
   */
  PROPERTYCHANGE: "propertychange"
}, ln = {
  /**
   * Generic change event. Triggered when the revision counter is increased.
   * @event module:ol/events/Event~BaseEvent#change
   * @api
   */
  CHANGE: "change",
  /**
   * Generic error event. Triggered when an error occurs.
   * @event module:ol/events/Event~BaseEvent#error
   * @api
   */
  ERROR: "error",
  CONTEXTMENU: "contextmenu",
  CLICK: "click",
  DBLCLICK: "dblclick",
  KEYDOWN: "keydown",
  KEYPRESS: "keypress",
  LOAD: "load",
  TOUCHMOVE: "touchmove",
  WHEEL: "wheel"
};
class Mw {
  constructor() {
    this.disposed = !1;
  }
  /**
   * Clean up.
   */
  dispose() {
    this.disposed || (this.disposed = !0, this.disposeInternal());
  }
  /**
   * Extension point for disposable objects.
   * @protected
   */
  disposeInternal() {
  }
}
function XF(n, t, e) {
  let a, s;
  e = e || sm;
  let l = 0, f = n.length, h = !1;
  for (; l < f; )
    a = l + (f - l >> 1), s = +e(n[a], t), s < 0 ? l = a + 1 : (f = a, h = !s);
  return h ? l : ~l;
}
function sm(n, t) {
  return n > t ? 1 : n < t ? -1 : 0;
}
function KF(n, t) {
  return n < t ? 1 : n > t ? -1 : 0;
}
function Cw(n, t, e) {
  if (n[0] <= t)
    return 0;
  const a = n.length;
  if (t <= n[a - 1])
    return a - 1;
  if (typeof e == "function") {
    for (let s = 1; s < a; ++s) {
      const l = n[s];
      if (l === t)
        return s;
      if (l < t)
        return e(t, n[s - 1], l) > 0 ? s - 1 : s;
    }
    return a - 1;
  }
  if (e > 0) {
    for (let s = 1; s < a; ++s)
      if (n[s] < t)
        return s - 1;
    return a - 1;
  }
  if (e < 0) {
    for (let s = 1; s < a; ++s)
      if (n[s] <= t)
        return s;
    return a - 1;
  }
  for (let s = 1; s < a; ++s) {
    if (n[s] == t)
      return s;
    if (n[s] < t)
      return n[s - 1] - t < t - n[s] ? s - 1 : s;
  }
  return a - 1;
}
function ZF(n, t, e) {
  for (; t < e; ) {
    const a = n[t];
    n[t] = n[e], n[e] = a, ++t, --e;
  }
}
function uE(n, t) {
  const e = Array.isArray(t) ? t : [t], a = e.length;
  for (let s = 0; s < a; s++)
    n[n.length] = e[s];
}
function I0(n, t) {
  const e = n.length;
  if (e !== t.length)
    return !1;
  for (let a = 0; a < e; a++)
    if (n[a] !== t[a])
      return !1;
  return !0;
}
function WF(n, t, e) {
  const a = t || sm;
  return n.every(function(s, l) {
    if (l === 0)
      return !0;
    const f = a(n[l - 1], s);
    return !(f > 0 || f === 0);
  });
}
function lS() {
  return !0;
}
function Ow() {
  return !1;
}
function uS() {
}
function m2(n) {
  let t, e, a;
  return function() {
    const s = Array.prototype.slice.call(arguments);
    return (!e || this !== a || !I0(s, e)) && (a = this, e = s, t = n.apply(this, arguments)), t;
  };
}
function p2(n) {
  function t() {
    let e;
    try {
      e = n();
    } catch (a) {
      return Promise.reject(a);
    }
    return e instanceof Promise ? e : Promise.resolve(e);
  }
  return t();
}
class dd {
  /**
   * @param {string} type Type.
   */
  constructor(t) {
    this.propagationStopped, this.defaultPrevented, this.type = t, this.target = null;
  }
  /**
   * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
   * will be fired.
   * @api
   */
  preventDefault() {
    this.defaultPrevented = !0;
  }
  /**
   * Stop event propagation.
   * @api
   */
  stopPropagation() {
    this.propagationStopped = !0;
  }
}
class PS extends Mw {
  /**
   * @param {*} [target] Default event target for dispatched events.
   */
  constructor(t) {
    super(), this.eventTarget_ = t, this.pendingRemovals_ = null, this.dispatching_ = null, this.listeners_ = null;
  }
  /**
   * @param {string} type Type.
   * @param {import("../events.js").Listener} listener Listener.
   */
  addEventListener(t, e) {
    if (!t || !e)
      return;
    const a = this.listeners_ || (this.listeners_ = {}), s = a[t] || (a[t] = []);
    s.includes(e) || s.push(e);
  }
  /**
   * Dispatches an event and calls all listeners listening for events
   * of this type. The event parameter can either be a string or an
   * Object with a `type` property.
   *
   * @param {import("./Event.js").default|string} event Event object.
   * @return {boolean|undefined} `false` if anyone called preventDefault on the
   *     event object or if any of the listeners returned false.
   * @api
   */
  dispatchEvent(t) {
    const e = typeof t == "string", a = e ? t : t.type, s = this.listeners_ && this.listeners_[a];
    if (!s)
      return;
    const l = e ? new dd(t) : (
      /** @type {Event} */
      t
    );
    l.target || (l.target = this.eventTarget_ || this);
    const f = this.dispatching_ || (this.dispatching_ = {}), h = this.pendingRemovals_ || (this.pendingRemovals_ = {});
    a in f || (f[a] = 0, h[a] = 0), ++f[a];
    let p;
    for (let y = 0, b = s.length; y < b; ++y)
      if ("handleEvent" in s[y] ? p = /** @type {import("../events.js").ListenerObject} */
      s[y].handleEvent(l) : p = /** @type {import("../events.js").ListenerFunction} */
      s[y].call(this, l), p === !1 || l.propagationStopped) {
        p = !1;
        break;
      }
    if (--f[a] === 0) {
      let y = h[a];
      for (delete h[a]; y--; )
        this.removeEventListener(a, uS);
      delete f[a];
    }
    return p;
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.listeners_ && SS(this.listeners_);
  }
  /**
   * Get the listeners for a specified event type. Listeners are returned in the
   * order that they will be called in.
   *
   * @param {string} type Type.
   * @return {Array<import("../events.js").Listener>|undefined} Listeners.
   */
  getListeners(t) {
    return this.listeners_ && this.listeners_[t] || void 0;
  }
  /**
   * @param {string} [type] Type. If not provided,
   *     `true` will be returned if this event target has any listeners.
   * @return {boolean} Has listeners.
   */
  hasListener(t) {
    return this.listeners_ ? t ? t in this.listeners_ : Object.keys(this.listeners_).length > 0 : !1;
  }
  /**
   * @param {string} type Type.
   * @param {import("../events.js").Listener} listener Listener.
   */
  removeEventListener(t, e) {
    if (!this.listeners_)
      return;
    const a = this.listeners_[t];
    if (!a)
      return;
    const s = a.indexOf(e);
    s !== -1 && (this.pendingRemovals_ && t in this.pendingRemovals_ ? (a[s] = uS, ++this.pendingRemovals_[t]) : (a.splice(s, 1), a.length === 0 && delete this.listeners_[t]));
  }
}
function Fn(n, t, e, a, s) {
  if (s) {
    const f = e;
    e = function(h) {
      return n.removeEventListener(t, e), f.call(a ?? this, h);
    };
  } else a && a !== n && (e = e.bind(a));
  const l = {
    target: n,
    type: t,
    listener: e
  };
  return n.addEventListener(t, e), l;
}
function $T(n, t, e, a) {
  return Fn(n, t, e, a, !0);
}
function Xi(n) {
  n && n.target && (n.target.removeEventListener(n.type, n.listener), SS(n));
}
class zS extends PS {
  constructor() {
    super(), this.on = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
    this.onInternal, this.once = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
    this.onceInternal, this.un = /** @type {ObservableOnSignature<void>} */
    this.unInternal, this.revision_ = 0;
  }
  /**
   * Increases the revision counter and dispatches a 'change' event.
   * @api
   */
  changed() {
    ++this.revision_, this.dispatchEvent(ln.CHANGE);
  }
  /**
   * Get the version number for this object.  Each time the object is modified,
   * its version number will be incremented.
   * @return {number} Revision.
   * @api
   */
  getRevision() {
    return this.revision_;
  }
  /**
   * @param {string|Array<string>} type Type.
   * @param {function((Event|import("./events/Event").default)): ?} listener Listener.
   * @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
   * @protected
   */
  onInternal(t, e) {
    if (Array.isArray(t)) {
      const a = t.length, s = new Array(a);
      for (let l = 0; l < a; ++l)
        s[l] = Fn(this, t[l], e);
      return s;
    }
    return Fn(
      this,
      /** @type {string} */
      t,
      e
    );
  }
  /**
   * @param {string|Array<string>} type Type.
   * @param {function((Event|import("./events/Event").default)): ?} listener Listener.
   * @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
   * @protected
   */
  onceInternal(t, e) {
    let a;
    if (Array.isArray(t)) {
      const s = t.length;
      a = new Array(s);
      for (let l = 0; l < s; ++l)
        a[l] = $T(this, t[l], e);
    } else
      a = $T(
        this,
        /** @type {string} */
        t,
        e
      );
    return e.ol_key = a, a;
  }
  /**
   * Unlisten for a certain type of event.
   * @param {string|Array<string>} type Type.
   * @param {function((Event|import("./events/Event").default)): ?} listener Listener.
   * @protected
   */
  unInternal(t, e) {
    const a = (
      /** @type {Object} */
      e.ol_key
    );
    if (a)
      QF(a);
    else if (Array.isArray(t))
      for (let s = 0, l = t.length; s < l; ++s)
        this.removeEventListener(t[s], e);
    else
      this.removeEventListener(t, e);
  }
}
zS.prototype.on;
zS.prototype.once;
zS.prototype.un;
function QF(n) {
  if (Array.isArray(n))
    for (let t = 0, e = n.length; t < e; ++t)
      Xi(n[t]);
  else
    Xi(
      /** @type {import("./events.js").EventsKey} */
      n
    );
}
function Qn() {
  throw new Error("Unimplemented abstract method.");
}
let JF = 0;
function si(n) {
  return n.ol_uid || (n.ol_uid = String(++JF));
}
class kN extends dd {
  /**
   * @param {string} type The event type.
   * @param {string} key The property name.
   * @param {*} oldValue The old value for `key`.
   */
  constructor(t, e, a) {
    super(t), this.key = e, this.oldValue = a;
  }
}
class Uf extends zS {
  /**
   * @param {Object<string, *>} [values] An object with key-value pairs.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, si(this), this.values_ = null, t !== void 0 && this.setProperties(t);
  }
  /**
   * Gets a value.
   * @param {string} key Key name.
   * @return {*} Value.
   * @api
   */
  get(t) {
    let e;
    return this.values_ && this.values_.hasOwnProperty(t) && (e = this.values_[t]), e;
  }
  /**
   * Get a list of object property names.
   * @return {Array<string>} List of property names.
   * @api
   */
  getKeys() {
    return this.values_ && Object.keys(this.values_) || [];
  }
  /**
   * Get an object of all property names and values.
   * @return {Object<string, *>} Object.
   * @api
   */
  getProperties() {
    return this.values_ && Object.assign({}, this.values_) || {};
  }
  /**
   * Get an object of all property names and values.
   * @return {Object<string, *>?} Object.
   */
  getPropertiesInternal() {
    return this.values_;
  }
  /**
   * @return {boolean} The object has properties.
   */
  hasProperties() {
    return !!this.values_;
  }
  /**
   * @param {string} key Key name.
   * @param {*} oldValue Old value.
   */
  notify(t, e) {
    let a;
    a = `change:${t}`, this.hasListener(a) && this.dispatchEvent(new kN(a, t, e)), a = lE.PROPERTYCHANGE, this.hasListener(a) && this.dispatchEvent(new kN(a, t, e));
  }
  /**
   * @param {string} key Key name.
   * @param {import("./events.js").Listener} listener Listener.
   */
  addChangeListener(t, e) {
    this.addEventListener(`change:${t}`, e);
  }
  /**
   * @param {string} key Key name.
   * @param {import("./events.js").Listener} listener Listener.
   */
  removeChangeListener(t, e) {
    this.removeEventListener(`change:${t}`, e);
  }
  /**
   * Sets a value.
   * @param {string} key Key name.
   * @param {*} value Value.
   * @param {boolean} [silent] Update without triggering an event.
   * @api
   */
  set(t, e, a) {
    const s = this.values_ || (this.values_ = {});
    if (a)
      s[t] = e;
    else {
      const l = s[t];
      s[t] = e, l !== e && this.notify(t, l);
    }
  }
  /**
   * Sets a collection of key-value pairs.  Note that this changes any existing
   * properties and adds new ones (it does not remove any existing properties).
   * @param {Object<string, *>} values Values.
   * @param {boolean} [silent] Update without triggering an event.
   * @api
   */
  setProperties(t, e) {
    for (const a in t)
      this.set(a, t[a], e);
  }
  /**
   * Apply any properties from another object without triggering events.
   * @param {BaseObject} source The source object.
   * @protected
   */
  applyProperties(t) {
    t.values_ && Object.assign(this.values_ || (this.values_ = {}), t.values_);
  }
  /**
   * Unsets a property.
   * @param {string} key Key name.
   * @param {boolean} [silent] Unset without triggering an event.
   * @api
   */
  unset(t, e) {
    if (this.values_ && t in this.values_) {
      const a = this.values_[t];
      delete this.values_[t], W1(this.values_) && (this.values_ = null), e || this.notify(t, a);
    }
  }
}
const HN = {
  LENGTH: "length"
};
class nT extends dd {
  /**
   * @param {import("./CollectionEventType.js").default} type Type.
   * @param {T} element Element.
   * @param {number} index The index of the added or removed element.
   */
  constructor(t, e, a) {
    super(t), this.element = e, this.index = a;
  }
}
class Nf extends Uf {
  /**
   * @param {Array<T>} [array] Array.
   * @param {Options} [options] Collection options.
   */
  constructor(t, e) {
    if (super(), this.on, this.once, this.un, e = e || {}, this.unique_ = !!e.unique, this.array_ = t || [], this.unique_)
      for (let a = 0, s = this.array_.length; a < s; ++a)
        this.assertUnique_(this.array_[a], a);
    this.updateLength_();
  }
  /**
   * Remove all elements from the collection.
   * @api
   */
  clear() {
    for (; this.getLength() > 0; )
      this.pop();
  }
  /**
   * Add elements to the collection.  This pushes each item in the provided array
   * to the end of the collection.
   * @param {!Array<T>} arr Array.
   * @return {Collection<T>} This collection.
   * @api
   */
  extend(t) {
    for (let e = 0, a = t.length; e < a; ++e)
      this.push(t[e]);
    return this;
  }
  /**
   * Iterate over each element, calling the provided callback.
   * @param {function(T, number, Array<T>): *} f The function to call
   *     for every element. This function takes 3 arguments (the element, the
   *     index and the array). The return value is ignored.
   * @api
   */
  forEach(t) {
    const e = this.array_;
    for (let a = 0, s = e.length; a < s; ++a)
      t(e[a], a, e);
  }
  /**
   * Get a reference to the underlying Array object. Warning: if the array
   * is mutated, no events will be dispatched by the collection, and the
   * collection's "length" property won't be in sync with the actual length
   * of the array.
   * @return {!Array<T>} Array.
   * @api
   */
  getArray() {
    return this.array_;
  }
  /**
   * Get the element at the provided index.
   * @param {number} index Index.
   * @return {T} Element.
   * @api
   */
  item(t) {
    return this.array_[t];
  }
  /**
   * Get the length of this collection.
   * @return {number} The length of the array.
   * @observable
   * @api
   */
  getLength() {
    return this.get(HN.LENGTH);
  }
  /**
   * Insert an element at the provided index.
   * @param {number} index Index.
   * @param {T} elem Element.
   * @api
   */
  insertAt(t, e) {
    if (t < 0 || t > this.getLength())
      throw new Error("Index out of bounds: " + t);
    this.unique_ && this.assertUnique_(e), this.array_.splice(t, 0, e), this.updateLength_(), this.dispatchEvent(
      new nT(ol.ADD, e, t)
    );
  }
  /**
   * Remove the last element of the collection and return it.
   * Return `undefined` if the collection is empty.
   * @return {T|undefined} Element.
   * @api
   */
  pop() {
    return this.removeAt(this.getLength() - 1);
  }
  /**
   * Insert the provided element at the end of the collection.
   * @param {T} elem Element.
   * @return {number} New length of the collection.
   * @api
   */
  push(t) {
    this.unique_ && this.assertUnique_(t);
    const e = this.getLength();
    return this.insertAt(e, t), this.getLength();
  }
  /**
   * Remove the first occurrence of an element from the collection.
   * @param {T} elem Element.
   * @return {T|undefined} The removed element or undefined if none found.
   * @api
   */
  remove(t) {
    const e = this.array_;
    for (let a = 0, s = e.length; a < s; ++a)
      if (e[a] === t)
        return this.removeAt(a);
  }
  /**
   * Remove the element at the provided index and return it.
   * Return `undefined` if the collection does not contain this index.
   * @param {number} index Index.
   * @return {T|undefined} Value.
   * @api
   */
  removeAt(t) {
    if (t < 0 || t >= this.getLength())
      return;
    const e = this.array_[t];
    return this.array_.splice(t, 1), this.updateLength_(), this.dispatchEvent(
      /** @type {CollectionEvent<T>} */
      new nT(ol.REMOVE, e, t)
    ), e;
  }
  /**
   * Set the element at the provided index.
   * @param {number} index Index.
   * @param {T} elem Element.
   * @api
   */
  setAt(t, e) {
    const a = this.getLength();
    if (t >= a) {
      this.insertAt(t, e);
      return;
    }
    if (t < 0)
      throw new Error("Index out of bounds: " + t);
    this.unique_ && this.assertUnique_(e, t);
    const s = this.array_[t];
    this.array_[t] = e, this.dispatchEvent(
      /** @type {CollectionEvent<T>} */
      new nT(ol.REMOVE, s, t)
    ), this.dispatchEvent(
      /** @type {CollectionEvent<T>} */
      new nT(ol.ADD, e, t)
    );
  }
  /**
   * @private
   */
  updateLength_() {
    this.set(HN.LENGTH, this.array_.length);
  }
  /**
   * @private
   * @param {T} elem Element.
   * @param {number} [except] Optional index to ignore.
   */
  assertUnique_(t, e) {
    for (let a = 0, s = this.array_.length; a < s; ++a)
      if (this.array_[a] === t && a !== e)
        throw new Error("Duplicate item added to a unique collection");
  }
}
function Ei(n, t) {
  if (!n)
    throw new Error(t);
}
const Ri = {
  OPACITY: "opacity",
  VISIBLE: "visible",
  EXTENT: "extent",
  Z_INDEX: "zIndex",
  MAX_RESOLUTION: "maxResolution",
  MIN_RESOLUTION: "minResolution",
  MAX_ZOOM: "maxZoom",
  MIN_ZOOM: "minZoom",
  SOURCE: "source",
  MAP: "map"
};
class $C extends Uf {
  /**
   * @param {Options} options Layer options.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, this.background_ = t.background;
    const e = Object.assign({}, t);
    typeof t.properties == "object" && (delete e.properties, Object.assign(e, t.properties)), e[Ri.OPACITY] = t.opacity !== void 0 ? t.opacity : 1, Ei(
      typeof e[Ri.OPACITY] == "number",
      "Layer opacity must be a number"
    ), e[Ri.VISIBLE] = t.visible !== void 0 ? t.visible : !0, e[Ri.Z_INDEX] = t.zIndex, e[Ri.MAX_RESOLUTION] = t.maxResolution !== void 0 ? t.maxResolution : 1 / 0, e[Ri.MIN_RESOLUTION] = t.minResolution !== void 0 ? t.minResolution : 0, e[Ri.MIN_ZOOM] = t.minZoom !== void 0 ? t.minZoom : -1 / 0, e[Ri.MAX_ZOOM] = t.maxZoom !== void 0 ? t.maxZoom : 1 / 0, this.className_ = e.className !== void 0 ? e.className : "ol-layer", delete e.className, this.setProperties(e), this.state_ = null;
  }
  /**
   * Get the background for this layer.
   * @return {BackgroundColor|false} Layer background.
   */
  getBackground() {
    return this.background_;
  }
  /**
   * @return {string} CSS class name.
   */
  getClassName() {
    return this.className_;
  }
  /**
   * This method is not meant to be called by layers or layer renderers because the state
   * is incorrect if the layer is included in a layer group.
   *
   * @param {boolean} [managed] Layer is managed.
   * @return {import("./Layer.js").State} Layer state.
   */
  getLayerState(t) {
    const e = this.state_ || /** @type {?} */
    {
      layer: this,
      managed: t === void 0 ? !0 : t
    }, a = this.getZIndex();
    return e.opacity = ra(Math.round(this.getOpacity() * 100) / 100, 0, 1), e.visible = this.getVisible(), e.extent = this.getExtent(), e.zIndex = a === void 0 && !e.managed ? 1 / 0 : a, e.maxResolution = this.getMaxResolution(), e.minResolution = Math.max(this.getMinResolution(), 0), e.minZoom = this.getMinZoom(), e.maxZoom = this.getMaxZoom(), this.state_ = e, e;
  }
  /**
   * @abstract
   * @param {Array<import("./Layer.js").default>} [array] Array of layers (to be
   *     modified in place).
   * @return {Array<import("./Layer.js").default>} Array of layers.
   */
  getLayersArray(t) {
    return Qn();
  }
  /**
   * @abstract
   * @param {Array<import("./Layer.js").State>} [states] Optional list of layer
   *     states (to be modified in place).
   * @return {Array<import("./Layer.js").State>} List of layer states.
   */
  getLayerStatesArray(t) {
    return Qn();
  }
  /**
   * Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it
   * will be visible regardless of extent.
   * @return {import("../extent.js").Extent|undefined} The layer extent.
   * @observable
   * @api
   */
  getExtent() {
    return (
      /** @type {import("../extent.js").Extent|undefined} */
      this.get(Ri.EXTENT)
    );
  }
  /**
   * Return the maximum resolution of the layer. Returns Infinity if
   * the layer has no maximum resolution set.
   * @return {number} The maximum resolution of the layer.
   * @observable
   * @api
   */
  getMaxResolution() {
    return (
      /** @type {number} */
      this.get(Ri.MAX_RESOLUTION)
    );
  }
  /**
   * Return the minimum resolution of the layer. Returns 0 if
   * the layer has no minimum resolution set.
   * @return {number} The minimum resolution of the layer.
   * @observable
   * @api
   */
  getMinResolution() {
    return (
      /** @type {number} */
      this.get(Ri.MIN_RESOLUTION)
    );
  }
  /**
   * Return the minimum zoom level of the layer. Returns -Infinity if
   * the layer has no minimum zoom set.
   * @return {number} The minimum zoom level of the layer.
   * @observable
   * @api
   */
  getMinZoom() {
    return (
      /** @type {number} */
      this.get(Ri.MIN_ZOOM)
    );
  }
  /**
   * Return the maximum zoom level of the layer. Returns Infinity if
   * the layer has no maximum zoom set.
   * @return {number} The maximum zoom level of the layer.
   * @observable
   * @api
   */
  getMaxZoom() {
    return (
      /** @type {number} */
      this.get(Ri.MAX_ZOOM)
    );
  }
  /**
   * Return the opacity of the layer (between 0 and 1).
   * @return {number} The opacity of the layer.
   * @observable
   * @api
   */
  getOpacity() {
    return (
      /** @type {number} */
      this.get(Ri.OPACITY)
    );
  }
  /**
   * @abstract
   * @return {import("../source/Source.js").State} Source state.
   */
  getSourceState() {
    return Qn();
  }
  /**
   * Return the value of this layer's `visible` property. To find out whether the layer
   * is visible on a map, use `isVisible()` instead.
   * @return {boolean} The value of the `visible` property of the layer.
   * @observable
   * @api
   */
  getVisible() {
    return (
      /** @type {boolean} */
      this.get(Ri.VISIBLE)
    );
  }
  /**
   * Return the Z-index of the layer, which is used to order layers before
   * rendering. Returns undefined if the layer is unmanaged.
   * @return {number|undefined} The Z-index of the layer.
   * @observable
   * @api
   */
  getZIndex() {
    return (
      /** @type {number|undefined} */
      this.get(Ri.Z_INDEX)
    );
  }
  /**
   * Sets the background color.
   * @param {BackgroundColor} [background] Background color.
   */
  setBackground(t) {
    this.background_ = t, this.changed();
  }
  /**
   * Set the extent at which the layer is visible.  If `undefined`, the layer
   * will be visible at all extents.
   * @param {import("../extent.js").Extent|undefined} extent The extent of the layer.
   * @observable
   * @api
   */
  setExtent(t) {
    this.set(Ri.EXTENT, t);
  }
  /**
   * Set the maximum resolution at which the layer is visible.
   * @param {number} maxResolution The maximum resolution of the layer.
   * @observable
   * @api
   */
  setMaxResolution(t) {
    this.set(Ri.MAX_RESOLUTION, t);
  }
  /**
   * Set the minimum resolution at which the layer is visible.
   * @param {number} minResolution The minimum resolution of the layer.
   * @observable
   * @api
   */
  setMinResolution(t) {
    this.set(Ri.MIN_RESOLUTION, t);
  }
  /**
   * Set the maximum zoom (exclusive) at which the layer is visible.
   * Note that the zoom levels for layer visibility are based on the
   * view zoom level, which may be different from a tile source zoom level.
   * @param {number} maxZoom The maximum zoom of the layer.
   * @observable
   * @api
   */
  setMaxZoom(t) {
    this.set(Ri.MAX_ZOOM, t);
  }
  /**
   * Set the minimum zoom (inclusive) at which the layer is visible.
   * Note that the zoom levels for layer visibility are based on the
   * view zoom level, which may be different from a tile source zoom level.
   * @param {number} minZoom The minimum zoom of the layer.
   * @observable
   * @api
   */
  setMinZoom(t) {
    this.set(Ri.MIN_ZOOM, t);
  }
  /**
   * Set the opacity of the layer, allowed values range from 0 to 1.
   * @param {number} opacity The opacity of the layer.
   * @observable
   * @api
   */
  setOpacity(t) {
    Ei(typeof t == "number", "Layer opacity must be a number"), this.set(Ri.OPACITY, t);
  }
  /**
   * Set the visibility of the layer (`true` or `false`).
   * @param {boolean} visible The visibility of the layer.
   * @observable
   * @api
   */
  setVisible(t) {
    this.set(Ri.VISIBLE, t);
  }
  /**
   * Set Z-index of the layer, which is used to order layers before rendering.
   * The default Z-index is 0.
   * @param {number} zindex The z-index of the layer.
   * @observable
   * @api
   */
  setZIndex(t) {
    this.set(Ri.Z_INDEX, t);
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.state_ && (this.state_.layer = null, this.state_ = null), super.disposeInternal();
  }
}
class c0 extends dd {
  /**
   * @param {GroupEventType} type The event type.
   * @param {BaseLayer} layer The layer.
   */
  constructor(t, e) {
    super(t), this.layer = e;
  }
}
const LA = {
  LAYERS: "layers"
};
class P0 extends $C {
  /**
   * @param {Options} [options] Layer options.
   */
  constructor(t) {
    t = t || {};
    const e = (
      /** @type {Options} */
      Object.assign({}, t)
    );
    delete e.layers;
    let a = t.layers;
    super(e), this.on, this.once, this.un, this.layersListenerKeys_ = [], this.listenerKeys_ = {}, this.addChangeListener(LA.LAYERS, this.handleLayersChanged_), a ? Array.isArray(a) ? a = new Nf(a.slice(), { unique: !0 }) : Ei(
      typeof /** @type {?} */
      a.getArray == "function",
      "Expected `layers` to be an array or a `Collection`"
    ) : a = new Nf(void 0, { unique: !0 }), this.setLayers(a);
  }
  /**
   * @private
   */
  handleLayerChange_() {
    this.changed();
  }
  /**
   * @private
   */
  handleLayersChanged_() {
    this.layersListenerKeys_.forEach(Xi), this.layersListenerKeys_.length = 0;
    const t = this.getLayers();
    this.layersListenerKeys_.push(
      Fn(t, ol.ADD, this.handleLayersAdd_, this),
      Fn(
        t,
        ol.REMOVE,
        this.handleLayersRemove_,
        this
      )
    );
    for (const a in this.listenerKeys_)
      this.listenerKeys_[a].forEach(Xi);
    SS(this.listenerKeys_);
    const e = t.getArray();
    for (let a = 0, s = e.length; a < s; a++) {
      const l = e[a];
      this.registerLayerListeners_(l), this.dispatchEvent(new c0("addlayer", l));
    }
    this.changed();
  }
  /**
   * @param {BaseLayer} layer The layer.
   */
  registerLayerListeners_(t) {
    const e = [
      Fn(
        t,
        lE.PROPERTYCHANGE,
        this.handleLayerChange_,
        this
      ),
      Fn(t, ln.CHANGE, this.handleLayerChange_, this)
    ];
    t instanceof P0 && e.push(
      Fn(t, "addlayer", this.handleLayerGroupAdd_, this),
      Fn(t, "removelayer", this.handleLayerGroupRemove_, this)
    ), this.listenerKeys_[si(t)] = e;
  }
  /**
   * @param {GroupEvent} event The layer group event.
   */
  handleLayerGroupAdd_(t) {
    this.dispatchEvent(new c0("addlayer", t.layer));
  }
  /**
   * @param {GroupEvent} event The layer group event.
   */
  handleLayerGroupRemove_(t) {
    this.dispatchEvent(new c0("removelayer", t.layer));
  }
  /**
   * @param {import("../Collection.js").CollectionEvent<import("./Base.js").default>} collectionEvent CollectionEvent.
   * @private
   */
  handleLayersAdd_(t) {
    const e = t.element;
    this.registerLayerListeners_(e), this.dispatchEvent(new c0("addlayer", e)), this.changed();
  }
  /**
   * @param {import("../Collection.js").CollectionEvent<import("./Base.js").default>} collectionEvent CollectionEvent.
   * @private
   */
  handleLayersRemove_(t) {
    const e = t.element, a = si(e);
    this.listenerKeys_[a].forEach(Xi), delete this.listenerKeys_[a], this.dispatchEvent(new c0("removelayer", e)), this.changed();
  }
  /**
   * Returns the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}
   * in this group.
   * @return {!Collection<import("./Base.js").default>} Collection of
   *   {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.
   * @observable
   * @api
   */
  getLayers() {
    return (
      /** @type {!Collection<import("./Base.js").default>} */
      this.get(LA.LAYERS)
    );
  }
  /**
   * Set the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}
   * in this group.
   * @param {!Collection<import("./Base.js").default>} layers Collection of
   *   {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.
   * @observable
   * @api
   */
  setLayers(t) {
    const e = this.getLayers();
    if (e) {
      const a = e.getArray();
      for (let s = 0, l = a.length; s < l; ++s)
        this.dispatchEvent(new c0("removelayer", a[s]));
    }
    this.set(LA.LAYERS, t);
  }
  /**
   * @param {Array<import("./Layer.js").default>} [array] Array of layers (to be modified in place).
   * @return {Array<import("./Layer.js").default>} Array of layers.
   * @override
   */
  getLayersArray(t) {
    return t = t !== void 0 ? t : [], this.getLayers().forEach(function(e) {
      e.getLayersArray(t);
    }), t;
  }
  /**
   * Get the layer states list and use this groups z-index as the default
   * for all layers in this and nested groups, if it is unset at this point.
   * If dest is not provided and this group's z-index is undefined
   * 0 is used a the default z-index.
   * @param {Array<import("./Layer.js").State>} [dest] Optional list
   * of layer states (to be modified in place).
   * @return {Array<import("./Layer.js").State>} List of layer states.
   * @override
   */
  getLayerStatesArray(t) {
    const e = t !== void 0 ? t : [], a = e.length;
    this.getLayers().forEach(function(f) {
      f.getLayerStatesArray(e);
    });
    const s = this.getLayerState();
    let l = s.zIndex;
    !t && s.zIndex === void 0 && (l = 0);
    for (let f = a, h = e.length; f < h; f++) {
      const p = e[f];
      p.opacity *= s.opacity, p.visible = p.visible && s.visible, p.maxResolution = Math.min(
        p.maxResolution,
        s.maxResolution
      ), p.minResolution = Math.max(
        p.minResolution,
        s.minResolution
      ), p.minZoom = Math.max(p.minZoom, s.minZoom), p.maxZoom = Math.min(p.maxZoom, s.maxZoom), s.extent !== void 0 && (p.extent !== void 0 ? p.extent = im(
        p.extent,
        s.extent
      ) : p.extent = s.extent), p.zIndex === void 0 && (p.zIndex = l);
    }
    return e;
  }
  /**
   * @return {import("../source/Source.js").State} Source state.
   * @override
   */
  getSourceState() {
    return "ready";
  }
}
const XT = function(n, t) {
  if (Re.isArray(t)) {
    for (var e = 0; e < t.length; e++)
      if (Re.isEqual(t[e], n))
        return;
    t.push(n);
  }
}, t$ = function(n, t) {
  const e = t[n.Type.Code];
  if (Re.isObject(t) && Re.isArray(e)) {
    for (var a = 0; a < e.length; a++)
      if (Re.isEqual(e[a].Title, n.Title) && Re.isEqual(e[a].OfficialNumber, n.OfficialNumber) && Re.isEqual(e[a].Lawstatus, n.Lawstatus)) {
        for (var s = 0; s < n.ArticleNumber.length; s++)
          XT(n.ArticleNumber[s], e[a].ArticleNumber);
        for (var l = 0; l < n.TextAtWeb.length; l++)
          XT(n.TextAtWeb[l], e[a].TextAtWeb);
        return;
      }
    e.push(n);
  }
}, e$ = function(n) {
  const t = {
    LegalProvision: [],
    Law: [],
    Hint: []
  };
  return n.forEach((e) => {
    e.LegalProvisions.forEach((s) => {
      t$({
        Type: s.Type,
        Title: s.Title,
        Abbreviation: s.Abbreviation,
        OfficialNumber: s.OfficialNumber,
        ArticleNumber: s.ArticleNumber || [],
        Article: s.Article || [],
        TextAtWeb: [s.TextAtWeb],
        Index: s.Index
      }, t);
    });
  }), t;
}, n$ = function(n, t, e) {
  let a = ja(n.Title, t, e);
  return Re.isArray(n.Abbreviation) && n.Abbreviation.length > 0 && (a += " (" + ja(n.Abbreviation, t, e) + ")"), Re.isArray(n.OfficialNumber) && n.OfficialNumber.length > 0 && (a += ", " + ja(n.OfficialNumber, t, e)), a;
}, IA = function(n, t, e, a) {
  const s = n.ArticleNumber.map(
    (f, h) => /* @__PURE__ */ Z.jsxs("span", { children: [
      " ",
      /* @__PURE__ */ Z.jsx("span", { className: "badge bg-primary", children: f })
    ] }, h)
  ), l = n.TextAtWeb.map((f, h) => {
    const p = ja(f, e, a);
    return /* @__PURE__ */ Z.jsx("li", { children: /* @__PURE__ */ Z.jsx("a", { href: p, target: "_blank", rel: "noreferrer", children: p }) }, h);
  });
  return /* @__PURE__ */ Z.jsxs("dd", { className: "oereb-client-document ms-2", children: [
    /* @__PURE__ */ Z.jsx("span", { children: n$(n, e, a) }),
    s,
    /* @__PURE__ */ Z.jsx("ul", { className: "ps-2 mb-2", children: l })
  ] }, t);
}, y2 = function(n) {
  const { t } = gr(), e = n.restrictions, a = Te((A) => A.language), s = a.current, l = a.default, f = e$(e), h = function() {
    return f.LegalProvision.length > 0 ? /* @__PURE__ */ Z.jsx("dt", { children: t("extract.topic.document.legal_provisions") }) : null;
  }, p = f.LegalProvision.sort((A, C) => A.Index - C.Index).map((A, C) => IA(A, C, s, l)), y = function() {
    return f.Law.length > 0 ? /* @__PURE__ */ Z.jsx("dt", { children: t("extract.topic.document.laws") }) : null;
  }, b = f.Law.sort((A, C) => A.Index - C.Index).map((A, C) => IA(A, C, s, l)), x = function() {
    return f.Hint.length > 0 ? /* @__PURE__ */ Z.jsx("dt", { children: t("extract.topic.document.hints") }) : null;
  }, w = f.Hint.sort((A, C) => A.Index - C.Index).map((A, C) => IA(A, C, s, l));
  return /* @__PURE__ */ Z.jsxs("dl", { className: "oereb-client-documents mb-2", children: [
    h(),
    p,
    y(),
    b,
    x(),
    w
  ] });
};
y2.propTypes = {
  /** The list of restrictions for which to collect the documents. */
  restrictions: wa.array.isRequired
};
const XC = function(n) {
  return Reflect.apply(Object.prototype.hasOwnProperty, n, ["NrOfPoints"]) ? "Point" : Reflect.apply(Object.prototype.hasOwnProperty, n, ["LengthShare"]) ? "LineString" : Reflect.apply(Object.prototype.hasOwnProperty, n, ["AreaShare"]) ? "Polygon" : null;
}, i$ = function(n) {
  for (var t = [], e = 0; e < n.length; e++) {
    const f = XC(n[e]);
    for (var a = !1, s = 0; s < t.length; s++)
      if (t[s].TypeCode === n[e].TypeCode && t[s].GeomType === f) {
        a = !0, f === "Point" && (t[s].NrOfPoints += n[e].NrOfPoints), f === "LineString" && (t[s].LengthShare += n[e].LengthShare), f === "Polygon" && (t[s].AreaShare += n[e].AreaShare, t[s].PartInPercent += n[e].PartInPercent);
        break;
      }
    if (!a) {
      var l = {
        GeomType: f,
        TypeCode: n[e].TypeCode,
        LegendText: n[e].LegendText,
        SymbolRef: n[e].SymbolRef,
        SubTheme: n[e].SubTheme
      };
      f === "Point" && (l.NrOfPoints = n[e].NrOfPoints), f === "LineString" && (l.LengthShare = n[e].LengthShare), f === "Polygon" && (l.AreaShare = n[e].AreaShare, l.PartInPercent = n[e].PartInPercent), t.push(l);
    }
  }
  return t.sort((f, h) => (f.AreaShare || 0) > (h.AreaShare || 0) ? -1 : (f.AreaShare || 0) < (h.AreaShare || 0) ? 1 : (f.LengthShare || 0) > (h.LengthShare || 0) ? -1 : (f.LengthShare || 0) < (h.LengthShare || 0) ? 1 : (f.NrOfPoints || 0) > (h.NrOfPoints || 0) ? -1 : (f.NrOfPoints || 0) < (h.NrOfPoints || 0) ? 1 : 0);
}, a$ = function(n) {
  return XC(n) === "Polygon" ? n.PartInPercent.toFixed(1) + "%" : null;
}, r$ = function(n) {
  const t = XC(n);
  return t === "Point" ? n.NrOfPoints.toFixed(0) : t === "LineString" ? n.LengthShare.toFixed(0) + " m" : t === "Polygon" ? /* @__PURE__ */ Z.jsxs("span", { children: [
    n.AreaShare.toFixed(0),
    " m",
    /* @__PURE__ */ Z.jsx("sup", { children: "2" })
  ] }) : null;
}, _2 = function(n) {
  const { t } = gr(), e = Te((y) => y.language), a = e.current, s = e.default, l = Te((y) => y.symbolZoom).enabled, f = n.restrictions, h = Se.useRef(null), p = i$(f).map((y, b) => {
    const x = ja(y.LegendText, a, s), w = y.SymbolRef, A = r$(y), C = a$(y);
    return /* @__PURE__ */ Z.jsxs("tr", { children: [
      /* @__PURE__ */ Z.jsx("td", { className: "oereb-client-symbol-cell", children: /* @__PURE__ */ Z.jsx("img", { className: "oereb-client-symbol", src: w }) }),
      /* @__PURE__ */ Z.jsx("td", { className: "oereb-client-legend-text", children: x }),
      /* @__PURE__ */ Z.jsx("td", { className: "oereb-client-legend-text text-end text-nowrap", children: A }),
      /* @__PURE__ */ Z.jsx("td", { className: "oereb-client-legend-text text-end text-nowrap", children: C })
    ] }, b);
  });
  return Se.useEffect(() => {
    h.current.querySelectorAll(".oereb-client-symbol").forEach((b) => {
      const x = b.getAttribute("src"), w = new Rw(b, {
        content: '<img src="' + x + '" />',
        html: !0,
        trigger: "hover"
      });
      l ? w.enable() : w.disable();
    });
  }), /* @__PURE__ */ Z.jsxs("table", { className: "table table-sm mb-2 oereb-client-legend", children: [
    /* @__PURE__ */ Z.jsx("thead", { children: /* @__PURE__ */ Z.jsxs("tr", { children: [
      /* @__PURE__ */ Z.jsx("th", { children: t("extract.topic.legend.type") }),
      /* @__PURE__ */ Z.jsx("th", {}),
      /* @__PURE__ */ Z.jsx("th", { className: "text-end text-nowrap", children: t("extract.topic.legend.part") }),
      /* @__PURE__ */ Z.jsx("th", { className: "text-end text-nowrap", children: t("extract.topic.legend.part_in_percent") })
    ] }) }),
    /* @__PURE__ */ Z.jsx("tbody", { ref: h, children: p })
  ] });
};
_2.propTypes = {
  /** The restrictions to show the legend for. */
  restrictions: wa.array.isRequired
};
const v2 = function(n) {
  const { t } = gr(), e = n.restrictions, a = Te((p) => p.language), s = a.current, l = a.default, f = [];
  e.forEach((p) => {
    XT(p.ResponsibleOffice, f);
  });
  const h = f.map((p, y) => {
    const b = ja(p.Name, s, l), x = ja(p.OfficeAtWeb, s, l);
    return x === null ? /* @__PURE__ */ Z.jsx("dd", { className: "ms-2", children: b }, y) : /* @__PURE__ */ Z.jsx("dd", { className: "ms-2", children: /* @__PURE__ */ Z.jsx("a", { href: x, target: "_blank", rel: "noreferrer", children: b }) }, y);
  });
  return /* @__PURE__ */ Z.jsxs("dl", { className: "oereb-client-responsible-office border-top pt-2 mb-2", children: [
    /* @__PURE__ */ Z.jsx("dt", { children: t("extract.topic.responsible_office") }),
    h
  ] });
};
v2.propTypes = {
  /** The topic's restrictions to collect the responsible offices for. */
  restrictions: wa.array.isRequired
};
const ET = function(n) {
  const { t } = gr(), e = n.restrictions, a = Se.useRef(null), s = Se.useRef(null), [l, f] = Se.useState(!1), [h, p] = Se.useState(1), [y, b] = Se.useState(!1), x = Te((Q) => Q.accordion).topic, w = Te((Q) => Q.map).topicLayers, A = Te((Q) => Q.language), C = A.current, L = A.default, N = Lo(), U = [];
  e.forEach((Q) => {
    const et = Q.Map;
    XT(et, U);
  }), Se.useEffect(() => {
    const Q = new k_(a.current, {
      toggle: !1
    });
    x === a.current && l ? (Q.show(), s.current.classList.remove("collapsed")) : (Q.hide(), s.current.classList.add("collapsed"));
  });
  let k = null;
  y && (k = /* @__PURE__ */ Z.jsx("div", { className: "spinner-grow spinner-grow-sm text-secondary float-end me-2" })), Se.useEffect(() => {
    w instanceof P0 && w.setOpacity(h);
  });
  const H = function() {
    x === a.current ? (f(!l), N(oS(null)), N(G_({
      viewServices: [],
      callback: null
    }))) : (f(!0), N(oS(a.current)), N(G_({
      viewServices: U,
      callback: b
    })));
  }, B = function(Q) {
    p(Q.target.value / 100);
  }, z = ja(e[0].Lawstatus.Text, C, L);
  return /* @__PURE__ */ Z.jsxs("div", { className: "accordion-item oereb-client-topic", children: [
    /* @__PURE__ */ Z.jsx("h2", { className: "accordion-header", children: /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: "accordion-button pt-2 pb-2 collapsed",
        type: "button",
        onClick: H,
        ref: s,
        children: /* @__PURE__ */ Z.jsxs("div", { className: "oereb-topic-lawstatus", children: [
          /* @__PURE__ */ Z.jsx("small", { className: "fst-italic", children: z }),
          k
        ] })
      }
    ) }),
    /* @__PURE__ */ Z.jsx("div", { className: "accordion-collapse collapse", ref: a, children: /* @__PURE__ */ Z.jsxs("div", { className: "accordion-body", children: [
      /* @__PURE__ */ Z.jsxs("div", { className: "row align-items-center mb-2", children: [
        /* @__PURE__ */ Z.jsx("div", { className: "col-3", children: /* @__PURE__ */ Z.jsxs("small", { children: [
          t("extract.topic.opacity"),
          ":"
        ] }) }),
        /* @__PURE__ */ Z.jsx("div", { className: "col-2 pe-2 text-end", children: /* @__PURE__ */ Z.jsxs("small", { children: [
          Math.round(h * 100),
          "%"
        ] }) }),
        /* @__PURE__ */ Z.jsx("div", { className: "col-7", children: /* @__PURE__ */ Z.jsx(
          "input",
          {
            type: "range",
            className: "form-range align-middle",
            min: "0",
            max: "100",
            value: Math.round(h * 100),
            onChange: B
          }
        ) })
      ] }),
      /* @__PURE__ */ Z.jsx(_2, { restrictions: e }),
      /* @__PURE__ */ Z.jsx(y2, { restrictions: e }),
      /* @__PURE__ */ Z.jsx(v2, { restrictions: e })
    ] }) })
  ] });
};
ET.propTypes = {
  /** The restrictions of the topic to be shown. */
  restrictions: wa.array.isRequired
};
const E2 = function(n) {
  const t = n.data, e = n.restrictions, a = Se.useRef(null), s = Te((p) => p.language), l = s.current, f = s.default, h = t.map((p, y) => {
    const b = d6(p);
    return Object.keys(e).filter((A) => A === b || A.startsWith(b + "_")).map((A, C) => {
      const L = e[A];
      let N = ja(L.themeText, l, f);
      L.subThemeText !== null && (N += ": " + ja(L.subThemeText, l, f));
      let U = null, k = null, H = null;
      return L.inForce.length > 0 && (U = /* @__PURE__ */ Z.jsx(ET, { restrictions: L.inForce })), L.changeWithPreEffect.length > 0 && (k = /* @__PURE__ */ Z.jsx(ET, { restrictions: L.changeWithPreEffect })), L.changeWithoutPreEffect.length > 0 && (H = /* @__PURE__ */ Z.jsx(ET, { restrictions: L.changeWithoutPreEffect })), /* @__PURE__ */ Z.jsxs("div", { className: "accordion-item", children: [
        /* @__PURE__ */ Z.jsx("div", { className: "accordion-item p-2 ps-3 oereb-client-topic-with-restrictions", children: /* @__PURE__ */ Z.jsx("strong", { children: N }) }),
        U,
        k,
        H
      ] }, `${y}_${C}`);
    });
  });
  return /* @__PURE__ */ Z.jsx("div", { className: "accordion-body p-0 oereb-client-topic-list-with-restrictions", children: /* @__PURE__ */ Z.jsx("div", { className: "accordion accordion-flush", ref: a, children: h }) });
};
E2.propTypes = {
  /** The list of topics. */
  data: wa.array.isRequired,
  /** The restrictions grouped by topic. */
  restrictions: wa.object.isRequired
};
const b2 = function(n) {
  const t = Te((f) => f.language), e = t.current, a = t.default, l = n.data.map((f, h) => {
    const p = ja(f.Text, e, a);
    return /* @__PURE__ */ Z.jsx("li", { className: "list-group-item", children: p }, h);
  });
  return /* @__PURE__ */ Z.jsx("div", { className: "accordion-body p-0 oereb-client-topic-list-without-restrictions", children: /* @__PURE__ */ Z.jsx("ul", { className: "list-group list-group-flush", children: l }) });
};
b2.propTypes = {
  /** The list of topics. */
  data: wa.array.isRequired
};
const bT = function(n) {
  const t = n.title, e = n.data, a = n.restriction, s = Se.useRef(null), l = Se.useRef(null), [f, h] = Se.useState(!1), p = Te((A) => A.accordion).category, y = Te((A) => A.extract).data.GetExtractByIdResponse.extract, b = Lo(), x = function() {
    p === s.current ? h(!f) : h(!0), b(CC(s.current)), b(oS(null)), b(G_([]));
  };
  Se.useEffect(() => {
    const A = new k_(s.current, {
      toggle: !1
    });
    p === s.current && f ? (A.show(), l.current.classList.remove("collapsed")) : (A.hide(), l.current.classList.add("collapsed")), p === null && n.initial && x();
  });
  const w = (() => {
    if (a && Re.isArray(y.RealEstate.RestrictionOnLandownership)) {
      const A = $H(
        y.RealEstate.RestrictionOnLandownership,
        y.ConcernedTheme
      );
      return /* @__PURE__ */ Z.jsx(E2, { data: e, restrictions: A });
    }
    return /* @__PURE__ */ Z.jsx(b2, { data: e });
  })();
  return /* @__PURE__ */ Z.jsxs("div", { className: "accordion-item mt-3 oereb-client-category", children: [
    /* @__PURE__ */ Z.jsx("h2", { className: "accordion-header", children: /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: "accordion-button collapsed ps-1",
        type: "button",
        onClick: x,
        ref: l,
        children: /* @__PURE__ */ Z.jsxs("div", { className: "container-fluid", children: [
          /* @__PURE__ */ Z.jsx("strong", { children: t }),
          /* @__PURE__ */ Z.jsx("span", { className: "badge rounded-pill bg-secondary float-end", children: e.length })
        ] })
      }
    ) }),
    /* @__PURE__ */ Z.jsx("div", { className: "accordion-collapse collapse", ref: s, children: w })
  ] });
};
bT.propTypes = {
  /** The category title. */
  title: wa.string.isRequired,
  /** The topics contained in this category. */
  data: wa.array.isRequired,
  /** Use `true` to show the restrictions data. */
  restriction: wa.bool.isRequired,
  /** Initially show this category */
  initial: wa.bool
};
const BN = new RegExp("({([\\w]*)})", "g"), S2 = function(n, t) {
  if (Re.isString(n)) {
    let e = n, a = BN.exec(n);
    for (; a !== null; )
      e = e.replace(a[1], t[a[2]] || ""), a = BN.exec(n);
    return e;
  }
  return n;
}, s$ = function() {
  const n = Te((p) => p.config).config, t = Te((p) => p.extract), e = Te((p) => p.language), a = e.current, s = e.default;
  if (!(Re.isObject(n.external_viewer) && Re.isArray(n.external_viewer.tooltip) && Re.isString(n.external_viewer.url)))
    return null;
  const f = ja(
    n.external_viewer.tooltip,
    a,
    s
  ), h = function() {
    if (t.visible) {
      const p = new URLSearchParams(window.location.search), y = t.data.GetExtractByIdResponse.extract.RealEstate, b = {
        map_x: p.get("map_x"),
        map_y: p.get("map_y"),
        map_zoom: p.get("map_zoom"),
        lang: p.get("lang"),
        canton: y.Canton,
        egrid: y.EGRID,
        fosnr: y.FosNr,
        identdn: y.IdentDN,
        municipality: y.MunicipalityName,
        number: y.Number
      };
      let x = n.external_viewer.url;
      x.indexOf("?") === -1 && (x += "?");
      const w = n.external_viewer.params;
      Re.isArray(w) && (x += w.join("&")), window.open(encodeURI(S2(x, b)), "_blank");
    }
  };
  return /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: "btn btn-outline-secondary oereb-client-external-viewer",
      title: f,
      onClick: h,
      children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-map" })
    }
  );
}, x2 = function() {
  const { t: n } = gr(), t = document.getElementById("permalinkModal"), e = t.querySelector("input"), a = t.querySelector("h5"), s = H_.getOrCreateInstance(t);
  t.getAttribute("data-bs-modal-shown-listener") !== "true" && (t.addEventListener("shown.bs.modal", () => {
    e.focus(), e.select();
  }), t.setAttribute("data-bs-modal-shown-listener", "true"));
  const l = function() {
    a.textContent = n("extract.permalink.title"), e.value = window.location, s.show();
  };
  return /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: "btn btn-outline-secondary oereb-client-permalink",
      onClick: l,
      title: n("extract.permalink.title"),
      children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-link-45deg" })
    }
  );
};
x2.propTypes = {};
const T2 = function(n) {
  const { t } = gr(), e = n.data, a = e.Number, s = e.MunicipalityName, l = e.EGRID, f = e.LandRegistryArea, h = Te((x) => x.language), p = h.current, y = h.default, b = ja(e.Type.Text, p, y);
  return /* @__PURE__ */ Z.jsxs("div", { className: "container-fluid mt-3 oereb-client-real-estate", children: [
    /* @__PURE__ */ Z.jsxs("h5", { children: [
      b,
      " ",
      a,
      " ",
      t("extract.real_estate.at"),
      " ",
      s
    ] }),
    /* @__PURE__ */ Z.jsxs("div", { className: "row row-cols-2", children: [
      /* @__PURE__ */ Z.jsx("div", { className: "col-3", children: /* @__PURE__ */ Z.jsxs("strong", { children: [
        t("extract.real_estate.egrid"),
        ":"
      ] }) }),
      /* @__PURE__ */ Z.jsx("div", { className: "col-9", children: l })
    ] }),
    /* @__PURE__ */ Z.jsxs("div", { className: "row row-cols-2", children: [
      /* @__PURE__ */ Z.jsx("div", { className: "col-3", children: /* @__PURE__ */ Z.jsxs("strong", { children: [
        t("extract.real_estate.area"),
        ":"
      ] }) }),
      /* @__PURE__ */ Z.jsxs("div", { className: "col-9", children: [
        f,
        " m²"
      ] })
    ] })
  ] });
};
T2.propTypes = {
  /** The real estate data. */
  data: wa.object.isRequired
};
var ST = { exports: {} }, o$ = ST.exports, qN;
function l$() {
  return qN || (qN = 1, function(n, t) {
    (function(e, a) {
      a();
    })(o$, function() {
      function e(y, b) {
        return typeof b > "u" ? b = { autoBom: !1 } : typeof b != "object" && (console.warn("Deprecated: Expected third argument to be a object"), b = { autoBom: !b }), b.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(y.type) ? new Blob(["\uFEFF", y], { type: y.type }) : y;
      }
      function a(y, b, x) {
        var w = new XMLHttpRequest();
        w.open("GET", y), w.responseType = "blob", w.onload = function() {
          p(w.response, b, x);
        }, w.onerror = function() {
          console.error("could not download file");
        }, w.send();
      }
      function s(y) {
        var b = new XMLHttpRequest();
        b.open("HEAD", y, !1);
        try {
          b.send();
        } catch {
        }
        return 200 <= b.status && 299 >= b.status;
      }
      function l(y) {
        try {
          y.dispatchEvent(new MouseEvent("click"));
        } catch {
          var b = document.createEvent("MouseEvents");
          b.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), y.dispatchEvent(b);
        }
      }
      var f = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof f0 == "object" && f0.global === f0 ? f0 : void 0, h = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), p = f.saveAs || (typeof window != "object" || window !== f ? function() {
      } : "download" in HTMLAnchorElement.prototype && !h ? function(y, b, x) {
        var w = f.URL || f.webkitURL, A = document.createElement("a");
        b = b || y.name || "download", A.download = b, A.rel = "noopener", typeof y == "string" ? (A.href = y, A.origin === location.origin ? l(A) : s(A.href) ? a(y, b, x) : l(A, A.target = "_blank")) : (A.href = w.createObjectURL(y), setTimeout(function() {
          w.revokeObjectURL(A.href);
        }, 4e4), setTimeout(function() {
          l(A);
        }, 0));
      } : "msSaveOrOpenBlob" in navigator ? function(y, b, x) {
        if (b = b || y.name || "download", typeof y != "string") navigator.msSaveOrOpenBlob(e(y, x), b);
        else if (s(y)) a(y, b, x);
        else {
          var w = document.createElement("a");
          w.href = y, w.target = "_blank", setTimeout(function() {
            l(w);
          });
        }
      } : function(y, b, x, w) {
        if (w = w || open("", "_blank"), w && (w.document.title = w.document.body.innerText = "downloading..."), typeof y == "string") return a(y, b, x);
        var A = y.type === "application/octet-stream", C = /constructor/i.test(f.HTMLElement) || f.safari, L = /CriOS\/[\d]+/.test(navigator.userAgent);
        if ((L || A && C || h) && typeof FileReader < "u") {
          var N = new FileReader();
          N.onloadend = function() {
            var H = N.result;
            H = L ? H : H.replace(/^data:[^;]*;/, "data:attachment/file;"), w ? w.location.href = H : location = H, w = null;
          }, N.readAsDataURL(y);
        } else {
          var U = f.URL || f.webkitURL, k = U.createObjectURL(y);
          w ? w.location = k : location.href = k, w = null, setTimeout(function() {
            U.revokeObjectURL(k);
          }, 4e4);
        }
      });
      f.saveAs = p.saveAs = p, n.exports = p;
    });
  }(ST)), ST.exports;
}
var u$ = l$();
const Ts = [];
for (let n = 0; n < 256; ++n)
  Ts.push((n + 256).toString(16).slice(1));
function c$(n, t = 0) {
  return (Ts[n[t + 0]] + Ts[n[t + 1]] + Ts[n[t + 2]] + Ts[n[t + 3]] + "-" + Ts[n[t + 4]] + Ts[n[t + 5]] + "-" + Ts[n[t + 6]] + Ts[n[t + 7]] + "-" + Ts[n[t + 8]] + Ts[n[t + 9]] + "-" + Ts[n[t + 10]] + Ts[n[t + 11]] + Ts[n[t + 12]] + Ts[n[t + 13]] + Ts[n[t + 14]] + Ts[n[t + 15]]).toLowerCase();
}
let PA;
const f$ = new Uint8Array(16);
function h$() {
  if (!PA) {
    if (typeof crypto > "u" || !crypto.getRandomValues)
      throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    PA = crypto.getRandomValues.bind(crypto);
  }
  return PA(f$);
}
const d$ = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), VN = { randomUUID: d$ };
function zA(n, t, e) {
  if (VN.randomUUID && !n)
    return VN.randomUUID();
  n = n || {};
  const a = n.random ?? n.rng?.() ?? h$();
  if (a.length < 16)
    throw new Error("Random bytes length must be >= 16");
  return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, c$(a);
}
const GS = 1e4, w2 = hd({
  name: "message",
  initialState: {
    messages: []
  },
  reducers: {
    info: (n, t) => {
      n.messages.push({
        id: zA(),
        type: "info",
        text: t.payload.text,
        confirmation: t.payload.confirmation,
        timestamp: Date.now()
      });
    },
    warning: (n, t) => {
      n.messages.push({
        id: zA(),
        type: "warning",
        text: t.payload.text,
        confirmation: t.payload.confirmation,
        timestamp: Date.now()
      });
    },
    error: (n, t) => {
      n.messages.push({
        id: zA(),
        type: "error",
        text: t.payload.text,
        confirmation: t.payload.confirmation,
        timestamp: Date.now()
      });
    },
    close: (n, t) => {
      for (let e = 0; e < n.messages.length; e++)
        if (n.messages[e].id === t.payload) {
          n.messages.splice(e, 1);
          break;
        }
    },
    cleanMessages: (n) => {
      for (let t = n.messages.length; t > 0; t--) {
        const e = Date.now();
        !n.messages[t - 1].confirmation && e - n.messages[t - 1].timestamp >= GS && n.messages.splice(t - 1, 1);
      }
    }
  }
}), { cleanMessages: KC, info: g$, error: m$, warning: p$, close: y$ } = w2.actions, _$ = function(n, t) {
  return function(e) {
    e(g$({
      text: n,
      confirmation: t
    })), setTimeout(() => {
      e(KC());
    }, GS);
  };
}, om = function(n, t) {
  return function(e) {
    e(p$({
      text: n,
      confirmation: t || !1
    })), setTimeout(() => {
      e(KC());
    }, GS);
  };
}, v$ = function(n, t) {
  return function(e) {
    e(m$({
      text: n,
      confirmation: !1
    })), setTimeout(() => {
      e(KC());
    }, GS);
  };
}, E$ = w2.reducer, b$ = function() {
  const { t: n } = gr(), t = Te((p) => p.config).config, e = Te((p) => p.extract), s = Te((p) => p.language).current, l = Se.useRef(null), f = Lo(), h = function() {
    if (e.visible) {
      const p = e.data.GetExtractByIdResponse.extract.ExtractIdentifier;
      l.current.classList.remove("bi", "bi-file-earmark-pdf"), l.current.classList.add("spinner-grow", "spinner-grow-sm"), YH(
        t.service_url,
        e.egrid,
        e.identdn,
        e.number,
        t.extract_pdf_timeout,
        s
      ).then((y) => {
        const b = p + ".pdf";
        l.current.classList.remove("spinner-grow", "spinner-grow-sm"), l.current.classList.add("bi", "bi-file-earmark-pdf"), u$.saveAs(new Blob([y], { type: "application/pdf" }), b);
      }).catch((y) => {
        console.log(y), l.current.classList.remove("spinner-grow", "spinner-grow-sm"), l.current.classList.add("bi", "bi-file-earmark-pdf"), y instanceof sd ? (f(w0()), f(om(n("extract.error.too_many_requests"), !0))) : f($_());
      });
    }
  };
  return /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: "btn btn-outline-secondary oereb-client-static-extract",
      title: n("extract.static_extract.title"),
      onClick: h,
      children: /* @__PURE__ */ Z.jsx("i", { ref: l, className: "bi bi-file-earmark-pdf" })
    }
  );
}, R2 = function() {
  const { t: n } = gr(), t = Te((l) => l.extract).highlight, e = Lo(), a = () => {
    e(DH());
  };
  let s;
  return t ? s = "btn btn-outline-secondary oereb-client-toggle-highlight" : s = "btn btn-secondary oereb-client-toggle-highlight", /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: s,
      onClick: a,
      title: n("extract.hide_highlight.title"),
      children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-bounding-box-circles" })
    }
  );
};
R2.propTypes = {};
const A2 = function() {
  const { t: n } = gr(), t = Te((l) => l.extract).background, e = Lo(), a = () => {
    e(NH());
  };
  let s;
  return t ? s = "btn btn-outline-secondary oereb-client-toggle-background" : s = "btn btn-secondary oereb-client-toggle-background", /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: s,
      onClick: a,
      title: n("extract.hide_background.title"),
      children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-layers-half" })
    }
  );
};
A2.propTypes = {};
const S$ = function() {
  const { t: n } = gr(), t = Te((b) => b.extract), e = Lo(), a = function() {
    e(G_([])), e(oS(null)), e(CC(null)), e(w0());
  }, s = t.data.GetExtractByIdResponse.extract, l = t.collapsed, f = function() {
    e(u6());
  }, h = function() {
    e(OH());
  }, p = (() => {
    let b = n("extract.hide"), x = "bi bi-chevron-up";
    return l && (b = n("extract.show"), x = "bi bi-chevron-down"), /* @__PURE__ */ Z.jsx(
      "button",
      {
        type: "button",
        className: "btn btn-outline-secondary collapse-extract",
        title: b,
        onClick: h,
        children: /* @__PURE__ */ Z.jsx("i", { className: x })
      }
    );
  })(), y = [
    "oereb-client-extract",
    "data container-fluid",
    "d-flex",
    "flex-column",
    "justify-content-start",
    "align-items-stretch"
  ];
  return /* @__PURE__ */ Z.jsxs("div", { className: y.join(" "), children: [
    /* @__PURE__ */ Z.jsxs("div", { children: [
      /* @__PURE__ */ Z.jsxs("div", { className: "btn-group float-end", role: "group", children: [
        p,
        /* @__PURE__ */ Z.jsx(
          "button",
          {
            onClick: a,
            className: "btn btn-outline-secondary",
            type: "button",
            children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-x-lg" })
          }
        )
      ] }),
      /* @__PURE__ */ Z.jsxs("div", { className: "btn-group float-start me-3", role: "group", children: [
        /* @__PURE__ */ Z.jsx(x2, {}),
        /* @__PURE__ */ Z.jsx(s$, {}),
        /* @__PURE__ */ Z.jsx(b$, {}),
        /* @__PURE__ */ Z.jsx(
          "button",
          {
            type: "button",
            className: "btn btn-outline-secondary",
            title: n("extract.information_panel.button.title"),
            onClick: f,
            children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-info-square" })
          }
        )
      ] }),
      /* @__PURE__ */ Z.jsxs("div", { className: "btn-group float-start", role: "group", children: [
        /* @__PURE__ */ Z.jsx(R2, {}),
        /* @__PURE__ */ Z.jsx(A2, {})
      ] })
    ] }),
    /* @__PURE__ */ Z.jsx(T2, { data: s.RealEstate }),
    /* @__PURE__ */ Z.jsxs("div", { className: "accordion accordion-flush flex-grow-1 mt-1 mb-2 oereb-client-extract-data", children: [
      /* @__PURE__ */ Z.jsx(
        bT,
        {
          title: n("extract.category.concerned_theme"),
          initial: !0,
          data: s.ConcernedTheme,
          restriction: !0
        }
      ),
      /* @__PURE__ */ Z.jsx(
        bT,
        {
          title: n("extract.category.not_concerned_theme"),
          data: s.NotConcernedTheme,
          restriction: !1
        }
      ),
      /* @__PURE__ */ Z.jsx(
        bT,
        {
          title: n("extract.category.theme_without_data"),
          data: s.ThemeWithoutData,
          restriction: !1
        }
      )
    ] })
  ] });
}, x$ = function() {
  const { t: n } = gr(), t = Lo(), e = Te((H) => H.config).config, a = Te((H) => H.extract), s = Te((H) => H.language), l = s.current, f = s.default, h = function(H) {
    return H ? /* @__PURE__ */ Z.jsxs("span", { children: [
      /* @__PURE__ */ Z.jsx("br", {}),
      H
    ] }) : null;
  }, p = function() {
    return e.support.phone ? /* @__PURE__ */ Z.jsxs("span", { children: [
      /* @__PURE__ */ Z.jsx("br", {}),
      /* @__PURE__ */ Z.jsx("i", { className: "bi bi-telephone-fill", title: n("extract.error.support.phone.title") }),
      " ",
      e.support.phone
    ] }) : null;
  }, y = function() {
    return e.support.email ? /* @__PURE__ */ Z.jsxs("span", { children: [
      /* @__PURE__ */ Z.jsx("br", {}),
      /* @__PURE__ */ Z.jsx("i", { className: "bi bi-envelope-fill", title: n("extract.error.support.email.title") }),
      " ",
      /* @__PURE__ */ Z.jsx("a", { href: "mailto:" + e.support.email, children: e.support.email })
    ] }) : null;
  }, b = ja(e.support.office1, l, f), x = h(ja(
    e.support.office2,
    l,
    f
  )), w = h(e.support.street), A = h(e.support.city), C = p(), L = y(), N = e.service_url, U = function() {
    t(w0());
  }, k = function() {
    t(mE({
      egrid: a.egrid,
      identdn: a.identdn,
      number: a.number,
      zoom: !0
    })), _E(
      N,
      a.egrid,
      a.identdn,
      a.number,
      e.extract_json_timeout,
      l
    ).then((H) => {
      t(pE(H)), t(yE(H));
    }).catch((H) => {
      H instanceof sd ? (t(w0()), t(om(n("extract.error.too_many_requests"), !0))) : t($_());
    });
  };
  return /* @__PURE__ */ Z.jsxs("div", { className: "oereb-client-extract oereb-client-extract-error container-fluid", children: [
    /* @__PURE__ */ Z.jsx("p", { className: "text-end", children: /* @__PURE__ */ Z.jsx(
      "button",
      {
        onClick: U,
        className: "btn btn-outline-secondary",
        type: "button",
        children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-x-lg" })
      }
    ) }),
    /* @__PURE__ */ Z.jsxs("h3", { children: [
      /* @__PURE__ */ Z.jsx("i", { className: "bi bi-exclamation-circle-fill text-secondary" }),
      " ",
      n("extract.error.title")
    ] }),
    /* @__PURE__ */ Z.jsx("p", { children: n("extract.error.message") }),
    /* @__PURE__ */ Z.jsx("p", { className: "text-center", children: /* @__PURE__ */ Z.jsx("button", { onClick: k, className: "btn btn-secondary", children: n("extract.error.button.text") }) }),
    /* @__PURE__ */ Z.jsx("p", { children: n("extract.error.support.message") }),
    /* @__PURE__ */ Z.jsxs("address", { children: [
      /* @__PURE__ */ Z.jsx("strong", { children: b }),
      x,
      w,
      A,
      C,
      L
    ] })
  ] });
}, T$ = function() {
  const { t: n } = gr(), t = Lo();
  return Se.useEffect(() => {
    t(G_([])), t(oS(null)), t(CC(null));
  }, []), /* @__PURE__ */ Z.jsx("div", { className: "oereb-client-extract oereb-client-extract-loading container-fluid", children: /* @__PURE__ */ Z.jsxs("p", { className: "text-center align-middle pt-5", children: [
    /* @__PURE__ */ Z.jsx("i", { className: "spinner-grow spinner-grow-sm" }),
    " ",
    n("extract.loading.message")
  ] }) });
}, w$ = function() {
  const n = Te((a) => a.extract), t = Se.useRef(null), e = n.loading ? /* @__PURE__ */ Z.jsx(T$, {}) : n.error ? /* @__PURE__ */ Z.jsx(x$, {}) : n.visible ? /* @__PURE__ */ Z.jsx(S$, {}) : null;
  return Se.useEffect(() => {
    t.current.classList.remove("hidden", "loading", "shown", "collapsed"), n.collapsed ? t.current.classList.add("collapsed") : n.loading ? t.current.classList.add("loading") : n.visible || n.error ? t.current.classList.add("shown") : t.current.classList.add("hidden");
  }), document.querySelectorAll(".ol-scale-bar").forEach((a) => {
    n.visible || n.error ? a.style.left = "513px" : a.style.left = "8px";
  }), /* @__PURE__ */ Z.jsx("div", { ref: t, className: "oereb-client-extract-wrapper", children: e });
}, R$ = function() {
  const { t: n } = gr(), t = Te((B) => B.extract), e = Te((B) => B.language), a = e.current, s = e.default;
  if (!(t.visible && Re.isObject(t.data) && Re.isObject(t.data.GetExtractByIdResponse) && Re.isObject(t.data.GetExtractByIdResponse.extract)))
    return null;
  const f = t.data.GetExtractByIdResponse.extract.PLRCadastreAuthority, h = t.data.GetExtractByIdResponse.extract.CantonalLogoRef, p = ja(f.Name, a, s), y = f.Street + " " + f.Number, b = f.PostalCode + " " + f.City, x = ja(f.OfficeAtWeb, a, s);
  let w = "d-flex g-0";
  document.body.offsetWidth < 1200 && (w += " flex-column");
  const A = new Date(t.data.GetExtractByIdResponse.extract.UpdateDateCS).toLocaleDateString("de-CH"), L = t.data.GetExtractByIdResponse.extract.GeneralInformation.map((B, z) => {
    const Q = ja(
      B,
      a,
      s
    );
    return /* @__PURE__ */ Z.jsx("p", { className: "card-text m-0 mb-2", children: Q }, z);
  }), N = t.data.GetExtractByIdResponse.extract.FederalLogoRef, U = t.data.GetExtractByIdResponse.extract.MunicipalityLogoRef, k = t.data.GetExtractByIdResponse.extract.RealEstate.MunicipalityName;
  let H = "card-text d-flex align-items-stretch";
  return document.body.offsetWidth < 1200 && (H += " flex-column"), /* @__PURE__ */ Z.jsxs("div", { className: "container-fluid oereb-client-general-information", children: [
    /* @__PURE__ */ Z.jsx("div", { className: "card oereb-client-authority", children: /* @__PURE__ */ Z.jsxs("div", { className: w, children: [
      /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsxs("div", { className: "card-body", children: [
        /* @__PURE__ */ Z.jsx("h5", { className: "card-title", children: n("extract.information_panel.general_information.authority") }),
        /* @__PURE__ */ Z.jsx("p", { className: "card-text fw-bold m-0", children: p }),
        /* @__PURE__ */ Z.jsx("p", { className: "card-text m-0", children: y }),
        /* @__PURE__ */ Z.jsx("p", { className: "card-text m-0", children: b }),
        /* @__PURE__ */ Z.jsx("p", { className: "card-text m-0", children: /* @__PURE__ */ Z.jsx("a", { href: x, target: "_blank", rel: "noreferrer", children: x }) })
      ] }) }),
      /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsx("div", { className: "card-body", children: /* @__PURE__ */ Z.jsx("img", { src: h, className: "img-fluid oereb-client-authority-logo" }) }) })
    ] }) }),
    /* @__PURE__ */ Z.jsx("div", { className: "card mt-4 oereb-client-base-data", children: /* @__PURE__ */ Z.jsx("div", { className: "d-flex g-0", children: /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsxs("div", { className: "card-body", children: [
      /* @__PURE__ */ Z.jsx("h5", { className: "card-title", children: n("extract.information_panel.general_information.base_data") }),
      /* @__PURE__ */ Z.jsxs("p", { className: "card-text m-0", children: [
        n("extract.information_panel.general_information.update_date_cs"),
        ": ",
        A
      ] })
    ] }) }) }) }),
    /* @__PURE__ */ Z.jsx("div", { className: "card mt-4 oereb-client-general-information-card", children: /* @__PURE__ */ Z.jsx("div", { className: "d-flex g-0", children: /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsxs("div", { className: "card-body pb-1", children: [
      /* @__PURE__ */ Z.jsx("h5", { className: "card-title", children: n("extract.information_panel.general_information.general_information") }),
      L
    ] }) }) }) }),
    /* @__PURE__ */ Z.jsx("div", { className: "card mt-4 oereb-client-involved-parties", children: /* @__PURE__ */ Z.jsx("div", { className: "d-flex g-0", children: /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsxs("div", { className: "card-body", children: [
      /* @__PURE__ */ Z.jsx("h5", { className: "card-title", children: n("extract.information_panel.general_information.further_participants") }),
      /* @__PURE__ */ Z.jsxs("div", { className: H, children: [
        /* @__PURE__ */ Z.jsx("div", { className: "text-center", children: /* @__PURE__ */ Z.jsx("img", { src: N, className: "img-fluid oereb-client-federal-logo" }) }),
        /* @__PURE__ */ Z.jsxs("div", { className: "text-center", children: [
          /* @__PURE__ */ Z.jsx("img", { src: U, className: "img-fluid oereb-client-municipality-logo" }),
          /* @__PURE__ */ Z.jsx("p", { children: k })
        ] })
      ] })
    ] }) }) }) })
  ] });
}, qM = function(n) {
  const t = n.catalog, e = n.search, a = Te((w) => w.extract), s = Te((w) => w.language), l = s.current, f = s.default;
  if (!(a.visible && Re.isObject(a.data) && Re.isObject(a.data.GetExtractByIdResponse) && Re.isObject(a.data.GetExtractByIdResponse.extract)))
    return null;
  const p = function(w, A) {
    const C = w.split(new RegExp(`(${A})`, "gi")).map((L, N) => L.toLocaleLowerCase() === A.toLocaleLowerCase() ? /* @__PURE__ */ Z.jsx("mark", { className: "ps-0 pe-0", children: L }, N) : /* @__PURE__ */ Z.jsx("span", { children: L }, N));
    return /* @__PURE__ */ Z.jsx("span", { children: C });
  }, x = a.data.GetExtractByIdResponse.extract[t].map((w) => ({
    title: ja(w.Title, l, f),
    content: ja(w.Content, l, f)
  })).filter((w) => Re.isString(e) && e.length > 0 ? w.title.toLocaleLowerCase().includes(e.toLocaleLowerCase()) || w.content.toLocaleLowerCase().includes(e.toLocaleLowerCase()) : !0).sort((w, A) => w.title.localeCompare(A.title)).map((w, A) => {
    let C = w.title, L = w.content;
    return Re.isString(e) && e.length > 0 && (C = p(C, e), L = p(L, e)), /* @__PURE__ */ Z.jsxs("li", { className: "list-group-item", children: [
      /* @__PURE__ */ Z.jsx("p", { className: "fw-bold m-0", children: C }),
      /* @__PURE__ */ Z.jsx("p", { className: "m-0", children: L })
    ] }, A);
  });
  return /* @__PURE__ */ Z.jsx("div", { className: "container-fluid oereb-client-catalog", children: /* @__PURE__ */ Z.jsx("ul", { className: "list-group list-group-flush", children: x }) });
};
qM.propTypes = {
  /** The catalog data to be shown. */
  catalog: wa.string.isRequired,
  /** The current value to filter the catalog entries for. */
  search: wa.string
};
const A$ = function() {
  const { t: n } = gr(), t = Lo(), e = Te((C) => C.extract), a = Se.useRef(null), [s, l] = Se.useState(null), f = [
    {
      title: n("extract.information_panel.general_information.title"),
      content: /* @__PURE__ */ Z.jsx(R$, {}),
      search: !1
    },
    {
      title: n("extract.information_panel.exclusion_of_liability.title"),
      content: /* @__PURE__ */ Z.jsx(qM, { catalog: "Disclaimer", search: s }),
      search: !0
    },
    {
      title: n("extract.information_panel.glossary.title"),
      content: /* @__PURE__ */ Z.jsx(qM, { catalog: "Glossary", search: s }),
      search: !0
    }
  ], h = f[e.tab].content, p = function(C) {
    t(LH(C));
  }, y = function() {
    t(u6());
  }, b = f.map((C, L) => {
    let N = "nav-link";
    return L === e.tab && (N += " active"), /* @__PURE__ */ Z.jsx("li", { className: "nav-item", children: /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: N,
        onClick: p.bind(this, L),
        children: /* @__PURE__ */ Z.jsx("span", { className: "text-body", children: C.title })
      }
    ) }, L);
  }), x = function(C) {
    l(C.target.value);
  };
  let w = null;
  f[e.tab].search && (document.body.offsetWidth < 1200 ? w = /* @__PURE__ */ Z.jsx("div", { className: "mt-2", children: /* @__PURE__ */ Z.jsx(
    "input",
    {
      className: "form-control",
      placeholder: n("extract.information_panel.search.placeholder"),
      onChange: x
    }
  ) }) : w = /* @__PURE__ */ Z.jsx("div", { className: "ms-4", children: /* @__PURE__ */ Z.jsx(
    "input",
    {
      className: "form-control",
      placeholder: n("extract.information_panel.search.placeholder"),
      onChange: x
    }
  ) }));
  const A = document.body.offsetWidth < 1200 ? /* @__PURE__ */ Z.jsxs("div", { className: "mb-4 oereb-client-information-panel-nav-mobile", children: [
    /* @__PURE__ */ Z.jsxs("div", { className: "d-flex", children: [
      /* @__PURE__ */ Z.jsx("ul", { className: "nav nav-pills nav-justified flex-column", children: b }),
      /* @__PURE__ */ Z.jsx("div", { className: "flex-grow-1 text-end ms-4", children: /* @__PURE__ */ Z.jsx(
        "button",
        {
          className: "btn btn-outline-secondary text-body",
          onClick: y,
          children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-x-lg" })
        }
      ) })
    ] }),
    w
  ] }) : /* @__PURE__ */ Z.jsxs("ul", { className: "nav nav-tabs mb-4 oereb-client-information-panel-nav", children: [
    b,
    w,
    /* @__PURE__ */ Z.jsx("li", { className: "nav-item ms-auto", children: /* @__PURE__ */ Z.jsx("button", { className: "nav-link text-body", onClick: y, children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-x-lg" }) }) })
  ] });
  return Se.useEffect(() => {
    a.current.classList.remove("disabled", "hidden", "shown"), e.visible ? e.information ? a.current.classList.add("shown") : a.current.classList.add("hidden") : a.current.classList.add("disabled");
  }), /* @__PURE__ */ Z.jsxs("div", { ref: a, className: "oereb-client-information-panel container-fluid d-flex flex-column", children: [
    A,
    /* @__PURE__ */ Z.jsx("div", { className: "flex-grow-1 content-wrapper", children: h })
  ] });
};
class ZC extends Uf {
  /**
   * @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]
   *     You may pass a Geometry object directly, or an object literal containing
   *     properties. If you pass an object literal, you may include a Geometry
   *     associated with a `geometry` key.
   */
  constructor(t) {
    if (super(), this.on, this.once, this.un, this.id_ = void 0, this.geometryName_ = "geometry", this.style_ = null, this.styleFunction_ = void 0, this.geometryChangeKey_ = null, this.addChangeListener(this.geometryName_, this.handleGeometryChanged_), t)
      if (typeof /** @type {?} */
      t.getSimplifiedGeometry == "function") {
        const e = (
          /** @type {Geometry} */
          t
        );
        this.setGeometry(e);
      } else {
        const e = t;
        this.setProperties(e);
      }
  }
  /**
   * Clone this feature. If the original feature has a geometry it
   * is also cloned. The feature id is not set in the clone.
   * @return {Feature<Geometry>} The clone.
   * @api
   */
  clone() {
    const t = (
      /** @type {Feature<Geometry>} */
      new ZC(this.hasProperties() ? this.getProperties() : null)
    );
    t.setGeometryName(this.getGeometryName());
    const e = this.getGeometry();
    e && t.setGeometry(
      /** @type {Geometry} */
      e.clone()
    );
    const a = this.getStyle();
    return a && t.setStyle(a), t;
  }
  /**
   * Get the feature's default geometry.  A feature may have any number of named
   * geometries.  The "default" geometry (the one that is rendered by default) is
   * set when calling {@link module:ol/Feature~Feature#setGeometry}.
   * @return {Geometry|undefined} The default geometry for the feature.
   * @api
   * @observable
   */
  getGeometry() {
    return (
      /** @type {Geometry|undefined} */
      this.get(this.geometryName_)
    );
  }
  /**
   * Get the feature identifier.  This is a stable identifier for the feature and
   * is either set when reading data from a remote source or set explicitly by
   * calling {@link module:ol/Feature~Feature#setId}.
   * @return {number|string|undefined} Id.
   * @api
   */
  getId() {
    return this.id_;
  }
  /**
   * Get the name of the feature's default geometry.  By default, the default
   * geometry is named `geometry`.
   * @return {string} Get the property name associated with the default geometry
   *     for this feature.
   * @api
   */
  getGeometryName() {
    return this.geometryName_;
  }
  /**
   * Get the feature's style. Will return what was provided to the
   * {@link module:ol/Feature~Feature#setStyle} method.
   * @return {import("./style/Style.js").StyleLike|undefined} The feature style.
   * @api
   */
  getStyle() {
    return this.style_;
  }
  /**
   * Get the feature's style function.
   * @return {import("./style/Style.js").StyleFunction|undefined} Return a function
   * representing the current style of this feature.
   * @api
   */
  getStyleFunction() {
    return this.styleFunction_;
  }
  /**
   * @private
   */
  handleGeometryChange_() {
    this.changed();
  }
  /**
   * @private
   */
  handleGeometryChanged_() {
    this.geometryChangeKey_ && (Xi(this.geometryChangeKey_), this.geometryChangeKey_ = null);
    const t = this.getGeometry();
    t && (this.geometryChangeKey_ = Fn(
      t,
      ln.CHANGE,
      this.handleGeometryChange_,
      this
    )), this.changed();
  }
  /**
   * Set the default geometry for the feature.  This will update the property
   * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.
   * @param {Geometry|undefined} geometry The new geometry.
   * @api
   * @observable
   */
  setGeometry(t) {
    this.set(this.geometryName_, t);
  }
  /**
   * Set the style for the feature to override the layer style.  This can be a
   * single style object, an array of styles, or a function that takes a
   * resolution and returns an array of styles. To unset the feature style, call
   * `setStyle()` without arguments or a falsey value.
   * @param {import("./style/Style.js").StyleLike} [style] Style for this feature.
   * @api
   * @fires module:ol/events/Event~BaseEvent#event:change
   */
  setStyle(t) {
    this.style_ = t, this.styleFunction_ = t ? M$(t) : void 0, this.changed();
  }
  /**
   * Set the feature id.  The feature id is considered stable and may be used when
   * requesting features or comparing identifiers returned from a remote source.
   * The feature id can be used with the
   * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.
   * @param {number|string|undefined} id The feature id.
   * @api
   * @fires module:ol/events/Event~BaseEvent#event:change
   */
  setId(t) {
    this.id_ = t, this.changed();
  }
  /**
   * Set the property name to be used when getting the feature's default geometry.
   * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with
   * this name will be returned.
   * @param {string} name The property name of the default geometry.
   * @api
   */
  setGeometryName(t) {
    this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_), this.geometryName_ = t, this.addChangeListener(this.geometryName_, this.handleGeometryChanged_), this.handleGeometryChanged_();
  }
}
function M$(n) {
  if (typeof n == "function")
    return n;
  let t;
  return Array.isArray(n) ? t = n : (Ei(
    typeof /** @type {?} */
    n.getZIndex == "function",
    "Expected an `ol/style/Style` or an array of `ol/style/Style.js`"
  ), t = [
    /** @type {import("./style/Style.js").default} */
    n
  ]), function() {
    return t;
  };
}
new Array(6);
function Pf() {
  return [1, 0, 0, 1, 0, 0];
}
function C$(n, t) {
  return n[0] = t[0], n[1] = t[1], n[2] = t[2], n[3] = t[3], n[4] = t[4], n[5] = t[5], n;
}
function Lr(n, t) {
  const e = t[0], a = t[1];
  return t[0] = n[0] * e + n[2] * a + n[4], t[1] = n[1] * e + n[3] * a + n[5], t;
}
function fd(n, t, e, a, s, l, f, h) {
  const p = Math.sin(l), y = Math.cos(l);
  return n[0] = a * y, n[1] = s * p, n[2] = -a * p, n[3] = s * y, n[4] = f * a * y - h * a * p + t, n[5] = f * s * p + h * s * y + e, n;
}
function M2(n, t) {
  const e = O$(t);
  Ei(e !== 0, "Transformation matrix cannot be inverted");
  const a = t[0], s = t[1], l = t[2], f = t[3], h = t[4], p = t[5];
  return n[0] = f / e, n[1] = -s / e, n[2] = -l / e, n[3] = a / e, n[4] = (l * p - f * h) / e, n[5] = -(a * p - s * h) / e, n;
}
function O$(n) {
  return n[0] * n[3] - n[1] * n[2];
}
const D$ = [1e5, 1e5, 1e5, 1e5, 2, 2];
function N$(n) {
  return "matrix(" + n.join(", ") + ")";
}
function YN(n) {
  return n.substring(7, n.length - 1).split(",").map(parseFloat);
}
function L$(n, t) {
  const e = YN(n), a = YN(t);
  for (let s = 0; s < 6; ++s)
    if (Math.round((e[s] - a[s]) * D$[s]) !== 0)
      return !1;
  return !0;
}
function v0(n, t, e, a, s, l, f) {
  l = l || [], f = f || 2;
  let h = 0;
  for (let p = t; p < e; p += a) {
    const y = n[p], b = n[p + 1];
    l[h++] = s[0] * y + s[2] * b + s[4], l[h++] = s[1] * y + s[3] * b + s[5];
    for (let x = 2; x < f; x++)
      l[h++] = n[p + x];
  }
  return l && l.length != h && (l.length = h), l;
}
function C2(n, t, e, a, s, l, f) {
  f = f || [];
  const h = Math.cos(s), p = Math.sin(s), y = l[0], b = l[1];
  let x = 0;
  for (let w = t; w < e; w += a) {
    const A = n[w] - y, C = n[w + 1] - b;
    f[x++] = y + A * h - C * p, f[x++] = b + A * p + C * h;
    for (let L = w + 2; L < w + a; ++L)
      f[x++] = n[L];
  }
  return f && f.length != x && (f.length = x), f;
}
function I$(n, t, e, a, s, l, f, h) {
  h = h || [];
  const p = f[0], y = f[1];
  let b = 0;
  for (let x = t; x < e; x += a) {
    const w = n[x] - p, A = n[x + 1] - y;
    h[b++] = p + s * w, h[b++] = y + l * A;
    for (let C = x + 2; C < x + a; ++C)
      h[b++] = n[C];
  }
  return h && h.length != b && (h.length = b), h;
}
function P$(n, t, e, a, s, l, f) {
  f = f || [];
  let h = 0;
  for (let p = t; p < e; p += a) {
    f[h++] = n[p] + s, f[h++] = n[p + 1] + l;
    for (let y = p + 2; y < p + a; ++y)
      f[h++] = n[y];
  }
  return f && f.length != h && (f.length = h), f;
}
const FN = Pf(), z$ = [NaN, NaN];
class G$ extends Uf {
  constructor() {
    super(), this.extent_ = uu(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = m2(
      (t, e, a) => {
        if (!a)
          return this.getSimplifiedGeometry(e);
        const s = this.clone();
        return s.applyTransform(a), s.getSimplifiedGeometry(e);
      }
    );
  }
  /**
   * Get a transformed and simplified version of the geometry.
   * @abstract
   * @param {number} squaredTolerance Squared tolerance.
   * @param {import("../proj.js").TransformFunction} [transform] Optional transform function.
   * @return {Geometry} Simplified geometry.
   */
  simplifyTransformed(t, e) {
    return this.simplifyTransformedInternal(
      this.getRevision(),
      t,
      e
    );
  }
  /**
   * Make a complete copy of the geometry.
   * @abstract
   * @return {!Geometry} Clone.
   */
  clone() {
    return Qn();
  }
  /**
   * @abstract
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   */
  closestPointXY(t, e, a, s) {
    return Qn();
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @return {boolean} Contains (x, y).
   */
  containsXY(t, e) {
    return this.closestPointXY(t, e, z$, Number.MIN_VALUE) === 0;
  }
  /**
   * Return the closest point of the geometry to the passed point as
   * {@link module:ol/coordinate~Coordinate coordinate}.
   * @param {import("../coordinate.js").Coordinate} point Point.
   * @param {import("../coordinate.js").Coordinate} [closestPoint] Closest point.
   * @return {import("../coordinate.js").Coordinate} Closest point.
   * @api
   */
  getClosestPoint(t, e) {
    return e = e || [NaN, NaN], this.closestPointXY(t[0], t[1], e, 1 / 0), e;
  }
  /**
   * Returns true if this geometry includes the specified coordinate. If the
   * coordinate is on the boundary of the geometry, returns false.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @return {boolean} Contains coordinate.
   * @api
   */
  intersectsCoordinate(t) {
    return this.containsXY(t[0], t[1]);
  }
  /**
   * @abstract
   * @param {import("../extent.js").Extent} extent Extent.
   * @protected
   * @return {import("../extent.js").Extent} extent Extent.
   */
  computeExtent(t) {
    return Qn();
  }
  /**
   * Get the extent of the geometry.
   * @param {import("../extent.js").Extent} [extent] Extent.
   * @return {import("../extent.js").Extent} extent Extent.
   * @api
   */
  getExtent(t) {
    if (this.extentRevision_ != this.getRevision()) {
      const e = this.computeExtent(this.extent_);
      (isNaN(e[0]) || isNaN(e[1])) && vS(e), this.extentRevision_ = this.getRevision();
    }
    return f9(this.extent_, t);
  }
  /**
   * Rotate the geometry around a given coordinate. This modifies the geometry
   * coordinates in place.
   * @abstract
   * @param {number} angle Rotation angle in radians.
   * @param {import("../coordinate.js").Coordinate} anchor The rotation center.
   * @api
   */
  rotate(t, e) {
    Qn();
  }
  /**
   * Scale the geometry (with an optional origin).  This modifies the geometry
   * coordinates in place.
   * @abstract
   * @param {number} sx The scaling factor in the x-direction.
   * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).
   * @param {import("../coordinate.js").Coordinate} [anchor] The scale origin (defaults to the center
   *     of the geometry extent).
   * @api
   */
  scale(t, e, a) {
    Qn();
  }
  /**
   * Create a simplified version of this geometry.  For linestrings, this uses
   * the [Douglas Peucker](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)
   * algorithm.  For polygons, a quantization-based
   * simplification is used to preserve topology.
   * @param {number} tolerance The tolerance distance for simplification.
   * @return {Geometry} A new, simplified version of the original geometry.
   * @api
   */
  simplify(t) {
    return this.getSimplifiedGeometry(t * t);
  }
  /**
   * Create a simplified version of this geometry using the Douglas Peucker
   * algorithm.
   * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.
   * @abstract
   * @param {number} squaredTolerance Squared tolerance.
   * @return {Geometry} Simplified geometry.
   */
  getSimplifiedGeometry(t) {
    return Qn();
  }
  /**
   * Get the type of this geometry.
   * @abstract
   * @return {Type} Geometry type.
   */
  getType() {
    return Qn();
  }
  /**
   * Apply a transform function to the coordinates of the geometry.
   * The geometry is modified in place.
   * If you do not want the geometry modified in place, first `clone()` it and
   * then use this function on the clone.
   * @abstract
   * @param {import("../proj.js").TransformFunction} transformFn Transform function.
   * Called with a flat array of geometry coordinates.
   */
  applyTransform(t) {
    Qn();
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @abstract
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   */
  intersectsExtent(t) {
    return Qn();
  }
  /**
   * Translate the geometry.  This modifies the geometry coordinates in place.  If
   * instead you want a new geometry, first `clone()` this geometry.
   * @abstract
   * @param {number} deltaX Delta X.
   * @param {number} deltaY Delta Y.
   * @api
   */
  translate(t, e) {
    Qn();
  }
  /**
   * Transform each coordinate of the geometry from one coordinate reference
   * system to another. The geometry is modified in place.
   * For example, a line will be transformed to a line and a circle to a circle.
   * If you do not want the geometry modified in place, first `clone()` it and
   * then use this function on the clone.
   *
   * @param {import("../proj.js").ProjectionLike} source The current projection.  Can be a
   *     string identifier or a {@link module:ol/proj/Projection~Projection} object.
   * @param {import("../proj.js").ProjectionLike} destination The desired projection.  Can be a
   *     string identifier or a {@link module:ol/proj/Projection~Projection} object.
   * @return {this} This geometry.  Note that original geometry is
   *     modified in place.
   * @api
   */
  transform(t, e) {
    const a = $i(t), s = a.getUnits() == "tile-pixels" ? function(l, f, h) {
      const p = a.getExtent(), y = a.getWorldExtent(), b = Ir(y) / Ir(p);
      fd(
        FN,
        y[0],
        y[3],
        b,
        -b,
        0,
        0,
        0
      );
      const x = v0(
        l,
        0,
        l.length,
        h,
        FN,
        f
      ), w = Jb(a, e);
      return w ? w(x, x, h) : x;
    } : Jb(a, e);
    return this.applyTransform(s), this;
  }
}
class US extends G$ {
  constructor() {
    super(), this.layout = "XY", this.stride = 2, this.flatCoordinates;
  }
  /**
   * @param {import("../extent.js").Extent} extent Extent.
   * @protected
   * @return {import("../extent.js").Extent} extent Extent.
   * @override
   */
  computeExtent(t) {
    return sC(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride,
      t
    );
  }
  /**
   * @abstract
   * @return {Array<*> | null} Coordinates.
   */
  getCoordinates() {
    return Qn();
  }
  /**
   * Return the first coordinate of the geometry.
   * @return {import("../coordinate.js").Coordinate} First coordinate.
   * @api
   */
  getFirstCoordinate() {
    return this.flatCoordinates.slice(0, this.stride);
  }
  /**
   * @return {Array<number>} Flat coordinates.
   */
  getFlatCoordinates() {
    return this.flatCoordinates;
  }
  /**
   * Return the last coordinate of the geometry.
   * @return {import("../coordinate.js").Coordinate} Last point.
   * @api
   */
  getLastCoordinate() {
    return this.flatCoordinates.slice(
      this.flatCoordinates.length - this.stride
    );
  }
  /**
   * Return the {@link import("./Geometry.js").GeometryLayout layout} of the geometry.
   * @return {import("./Geometry.js").GeometryLayout} Layout.
   * @api
   */
  getLayout() {
    return this.layout;
  }
  /**
   * Create a simplified version of this geometry using the Douglas Peucker algorithm.
   * @param {number} squaredTolerance Squared tolerance.
   * @return {SimpleGeometry} Simplified geometry.
   * @override
   */
  getSimplifiedGeometry(t) {
    if (this.simplifiedGeometryRevision !== this.getRevision() && (this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = this.getRevision()), t < 0 || this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && t <= this.simplifiedGeometryMaxMinSquaredTolerance)
      return this;
    const e = this.getSimplifiedGeometryInternal(t);
    return e.getFlatCoordinates().length < this.flatCoordinates.length ? e : (this.simplifiedGeometryMaxMinSquaredTolerance = t, this);
  }
  /**
   * @param {number} squaredTolerance Squared tolerance.
   * @return {SimpleGeometry} Simplified geometry.
   * @protected
   */
  getSimplifiedGeometryInternal(t) {
    return this;
  }
  /**
   * @return {number} Stride.
   */
  getStride() {
    return this.stride;
  }
  /**
   * @param {import("./Geometry.js").GeometryLayout} layout Layout.
   * @param {Array<number>} flatCoordinates Flat coordinates.
   */
  setFlatCoordinates(t, e) {
    this.stride = $N(t), this.layout = t, this.flatCoordinates = e;
  }
  /**
   * @abstract
   * @param {!Array<*>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   */
  setCoordinates(t, e) {
    Qn();
  }
  /**
   * @param {import("./Geometry.js").GeometryLayout|undefined} layout Layout.
   * @param {Array<*>} coordinates Coordinates.
   * @param {number} nesting Nesting.
   * @protected
   */
  setLayout(t, e, a) {
    let s;
    if (t)
      s = $N(t);
    else {
      for (let l = 0; l < a; ++l) {
        if (e.length === 0) {
          this.layout = "XY", this.stride = 2;
          return;
        }
        e = /** @type {Array<unknown>} */
        e[0];
      }
      s = e.length, t = U$(s);
    }
    this.layout = t, this.stride = s;
  }
  /**
   * Apply a transform function to the coordinates of the geometry.
   * The geometry is modified in place.
   * If you do not want the geometry modified in place, first `clone()` it and
   * then use this function on the clone.
   * @param {import("../proj.js").TransformFunction} transformFn Transform function.
   * Called with a flat array of geometry coordinates.
   * @api
   * @override
   */
  applyTransform(t) {
    this.flatCoordinates && (t(
      this.flatCoordinates,
      this.flatCoordinates,
      this.layout.startsWith("XYZ") ? 3 : 2,
      this.stride
    ), this.changed());
  }
  /**
   * Rotate the geometry around a given coordinate. This modifies the geometry
   * coordinates in place.
   * @param {number} angle Rotation angle in counter-clockwise radians.
   * @param {import("../coordinate.js").Coordinate} anchor The rotation center.
   * @api
   * @override
   */
  rotate(t, e) {
    const a = this.getFlatCoordinates();
    if (a) {
      const s = this.getStride();
      C2(
        a,
        0,
        a.length,
        s,
        t,
        e,
        a
      ), this.changed();
    }
  }
  /**
   * Scale the geometry (with an optional origin).  This modifies the geometry
   * coordinates in place.
   * @param {number} sx The scaling factor in the x-direction.
   * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).
   * @param {import("../coordinate.js").Coordinate} [anchor] The scale origin (defaults to the center
   *     of the geometry extent).
   * @api
   * @override
   */
  scale(t, e, a) {
    e === void 0 && (e = t), a || (a = fm(this.getExtent()));
    const s = this.getFlatCoordinates();
    if (s) {
      const l = this.getStride();
      I$(
        s,
        0,
        s.length,
        l,
        t,
        e,
        a,
        s
      ), this.changed();
    }
  }
  /**
   * Translate the geometry.  This modifies the geometry coordinates in place.  If
   * instead you want a new geometry, first `clone()` this geometry.
   * @param {number} deltaX Delta X.
   * @param {number} deltaY Delta Y.
   * @api
   * @override
   */
  translate(t, e) {
    const a = this.getFlatCoordinates();
    if (a) {
      const s = this.getStride();
      P$(
        a,
        0,
        a.length,
        s,
        t,
        e,
        a
      ), this.changed();
    }
  }
}
function U$(n) {
  let t;
  return n == 2 ? t = "XY" : n == 3 ? t = "XYZ" : n == 4 && (t = "XYZM"), /** @type {import("./Geometry.js").GeometryLayout} */
  t;
}
function $N(n) {
  let t;
  return n == "XY" ? t = 2 : n == "XYZ" || n == "XYM" ? t = 3 : n == "XYZM" && (t = 4), /** @type {number} */
  t;
}
function j$(n, t, e) {
  const a = n.getFlatCoordinates();
  if (!a)
    return null;
  const s = n.getStride();
  return v0(
    a,
    0,
    a.length,
    s,
    t,
    e
  );
}
function O2(n, t, e, a) {
  let s = 0;
  const l = n[e - a], f = n[e - a + 1];
  let h = 0, p = 0;
  for (; t < e; t += a) {
    const y = n[t] - l, b = n[t + 1] - f;
    s += p * y - h * b, h = y, p = b;
  }
  return s / 2;
}
function D2(n, t, e, a) {
  let s = 0;
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    s += O2(n, t, h, a), t = h;
  }
  return s;
}
function k$(n, t, e, a) {
  let s = 0;
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    s += D2(n, t, h, a), t = h[h.length - 1];
  }
  return s;
}
function XN(n, t, e, a, s, l, f) {
  const h = n[t], p = n[t + 1], y = n[e] - h, b = n[e + 1] - p;
  let x;
  if (y === 0 && b === 0)
    x = t;
  else {
    const w = ((s - h) * y + (l - p) * b) / (y * y + b * b);
    if (w > 1)
      x = e;
    else if (w > 0) {
      for (let A = 0; A < a; ++A)
        f[A] = Tc(
          n[t + A],
          n[e + A],
          w
        );
      f.length = a;
      return;
    } else
      x = t;
  }
  for (let w = 0; w < a; ++w)
    f[w] = n[x + w];
  f.length = a;
}
function N2(n, t, e, a, s) {
  let l = n[t], f = n[t + 1];
  for (t += a; t < e; t += a) {
    const h = n[t], p = n[t + 1], y = T_(l, f, h, p);
    y > s && (s = y), l = h, f = p;
  }
  return s;
}
function L2(n, t, e, a, s) {
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    s = N2(n, t, h, a, s), t = h;
  }
  return s;
}
function H$(n, t, e, a, s) {
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    s = L2(n, t, h, a, s), t = h[h.length - 1];
  }
  return s;
}
function I2(n, t, e, a, s, l, f, h, p, y, b) {
  if (t == e)
    return y;
  let x, w;
  if (s === 0) {
    if (w = T_(
      f,
      h,
      n[t],
      n[t + 1]
    ), w < y) {
      for (x = 0; x < a; ++x)
        p[x] = n[t + x];
      return p.length = a, w;
    }
    return y;
  }
  b = b || [NaN, NaN];
  let A = t + a;
  for (; A < e; )
    if (XN(
      n,
      A - a,
      A,
      a,
      f,
      h,
      b
    ), w = T_(f, h, b[0], b[1]), w < y) {
      for (y = w, x = 0; x < a; ++x)
        p[x] = b[x];
      p.length = a, A += a;
    } else
      A += a * Math.max(
        (Math.sqrt(w) - Math.sqrt(y)) / s | 0,
        1
      );
  if (XN(
    n,
    e - a,
    t,
    a,
    f,
    h,
    b
  ), w = T_(f, h, b[0], b[1]), w < y) {
    for (y = w, x = 0; x < a; ++x)
      p[x] = b[x];
    p.length = a;
  }
  return y;
}
function P2(n, t, e, a, s, l, f, h, p, y, b) {
  b = b || [NaN, NaN];
  for (let x = 0, w = e.length; x < w; ++x) {
    const A = e[x];
    y = I2(
      n,
      t,
      A,
      a,
      s,
      l,
      f,
      h,
      p,
      y,
      b
    ), t = A;
  }
  return y;
}
function B$(n, t, e, a, s, l, f, h, p, y, b) {
  b = b || [NaN, NaN];
  for (let x = 0, w = e.length; x < w; ++x) {
    const A = e[x];
    y = P2(
      n,
      t,
      A,
      a,
      s,
      l,
      f,
      h,
      p,
      y,
      b
    ), t = A[A.length - 1];
  }
  return y;
}
function q$(n, t, e, a) {
  for (let s = 0, l = e.length; s < l; ++s)
    n[t++] = e[s];
  return t;
}
function WC(n, t, e, a) {
  for (let s = 0, l = e.length; s < l; ++s) {
    const f = e[s];
    for (let h = 0; h < a; ++h)
      n[t++] = f[h];
  }
  return t;
}
function z2(n, t, e, a, s) {
  s = s || [];
  let l = 0;
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = WC(
      n,
      t,
      e[f],
      a
    );
    s[l++] = p, t = p;
  }
  return s.length = l, s;
}
function V$(n, t, e, a, s) {
  s = s || [];
  let l = 0;
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = z2(
      n,
      t,
      e[f],
      a,
      s[l]
    );
    p.length === 0 && (p[0] = t), s[l++] = p, t = p[p.length - 1];
  }
  return s.length = l, s;
}
function v_(n, t, e, a, s) {
  s = s !== void 0 ? s : [];
  let l = 0;
  for (let f = t; f < e; f += a)
    s[l++] = n.slice(f, f + a);
  return s.length = l, s;
}
function KT(n, t, e, a, s) {
  s = s !== void 0 ? s : [];
  let l = 0;
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = e[f];
    s[l++] = v_(
      n,
      t,
      p,
      a,
      s[l]
    ), t = p;
  }
  return s.length = l, s;
}
function VM(n, t, e, a, s) {
  s = s !== void 0 ? s : [];
  let l = 0;
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = e[f];
    s[l++] = p.length === 1 && p[0] === t ? [] : KT(
      n,
      t,
      p,
      a,
      s[l]
    ), t = p[p.length - 1];
  }
  return s.length = l, s;
}
function QC(n, t, e, a, s, l, f) {
  const h = (e - t) / a;
  if (h < 3) {
    for (; t < e; t += a)
      l[f++] = n[t], l[f++] = n[t + 1];
    return f;
  }
  const p = new Array(h);
  p[0] = 1, p[h - 1] = 1;
  const y = [t, e - a];
  let b = 0;
  for (; y.length > 0; ) {
    const x = y.pop(), w = y.pop();
    let A = 0;
    const C = n[w], L = n[w + 1], N = n[x], U = n[x + 1];
    for (let k = w + a; k < x; k += a) {
      const H = n[k], B = n[k + 1], z = g9(H, B, C, L, N, U);
      z > A && (b = k, A = z);
    }
    A > s && (p[(b - t) / a] = 1, w + a < b && y.push(w, b), b + a < x && y.push(b, x));
  }
  for (let x = 0; x < h; ++x)
    p[x] && (l[f++] = n[t + x * a], l[f++] = n[t + x * a + 1]);
  return f;
}
function Y$(n, t, e, a, s, l, f, h) {
  for (let p = 0, y = e.length; p < y; ++p) {
    const b = e[p];
    f = QC(
      n,
      t,
      b,
      a,
      s,
      l,
      f
    ), h.push(f), t = b;
  }
  return f;
}
function g_(n, t) {
  return t * Math.round(n / t);
}
function F$(n, t, e, a, s, l, f) {
  if (t == e)
    return f;
  let h = g_(n[t], s), p = g_(n[t + 1], s);
  t += a, l[f++] = h, l[f++] = p;
  let y, b;
  do
    if (y = g_(n[t], s), b = g_(n[t + 1], s), t += a, t == e)
      return l[f++] = y, l[f++] = b, f;
  while (y == h && b == p);
  for (; t < e; ) {
    const x = g_(n[t], s), w = g_(n[t + 1], s);
    if (t += a, x == y && w == b)
      continue;
    const A = y - h, C = b - p, L = x - h, N = w - p;
    if (A * N == C * L && (A < 0 && L < A || A == L || A > 0 && L > A) && (C < 0 && N < C || C == N || C > 0 && N > C)) {
      y = x, b = w;
      continue;
    }
    l[f++] = y, l[f++] = b, h = y, p = b, y = x, b = w;
  }
  return l[f++] = y, l[f++] = b, f;
}
function JC(n, t, e, a, s, l, f, h) {
  for (let p = 0, y = e.length; p < y; ++p) {
    const b = e[p];
    f = F$(
      n,
      t,
      b,
      a,
      s,
      l,
      f
    ), h.push(f), t = b;
  }
  return f;
}
function $$(n, t, e, a, s, l, f, h) {
  for (let p = 0, y = e.length; p < y; ++p) {
    const b = e[p], x = [];
    f = JC(
      n,
      t,
      b,
      a,
      s,
      l,
      f,
      x
    ), h.push(x), t = b[b.length - 1];
  }
  return f;
}
class cS extends US {
  /**
   * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
   *     For internal use, flat coordinates in combination with `layout` are also accepted.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   */
  constructor(t, e) {
    super(), this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, e !== void 0 && !Array.isArray(t[0]) ? this.setFlatCoordinates(
      e,
      /** @type {Array<number>} */
      t
    ) : this.setCoordinates(
      /** @type {Array<import("../coordinate.js").Coordinate>} */
      t,
      e
    );
  }
  /**
   * Make a complete copy of the geometry.
   * @return {!LinearRing} Clone.
   * @api
   * @override
   */
  clone() {
    return new cS(this.flatCoordinates.slice(), this.layout);
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   * @override
   */
  closestPointXY(t, e, a, s) {
    return s < ow(this.getExtent(), t, e) ? s : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
      N2(
        this.flatCoordinates,
        0,
        this.flatCoordinates.length,
        this.stride,
        0
      )
    ), this.maxDeltaRevision_ = this.getRevision()), I2(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride,
      this.maxDelta_,
      !0,
      t,
      e,
      a,
      s
    ));
  }
  /**
   * Return the area of the linear ring on projected plane.
   * @return {number} Area (on projected plane).
   * @api
   */
  getArea() {
    return O2(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride
    );
  }
  /**
   * Return the coordinates of the linear ring.
   * @return {Array<import("../coordinate.js").Coordinate>} Coordinates.
   * @api
   * @override
   */
  getCoordinates() {
    return v_(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride
    );
  }
  /**
   * @param {number} squaredTolerance Squared tolerance.
   * @return {LinearRing} Simplified LinearRing.
   * @protected
   * @override
   */
  getSimplifiedGeometryInternal(t) {
    const e = [];
    return e.length = QC(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride,
      t,
      e,
      0
    ), new cS(e, "XY");
  }
  /**
   * Get the type of this geometry.
   * @return {import("./Geometry.js").Type} Geometry type.
   * @api
   * @override
   */
  getType() {
    return "LinearRing";
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   * @api
   * @override
   */
  intersectsExtent(t) {
    return !1;
  }
  /**
   * Set the coordinates of the linear ring.
   * @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @api
   * @override
   */
  setCoordinates(t, e) {
    this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = WC(
      this.flatCoordinates,
      0,
      t,
      this.stride
    ), this.changed();
  }
}
class cE extends US {
  /**
   * @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   */
  constructor(t, e) {
    super(), this.setCoordinates(t, e);
  }
  /**
   * Make a complete copy of the geometry.
   * @return {!Point} Clone.
   * @api
   * @override
   */
  clone() {
    const t = new cE(this.flatCoordinates.slice(), this.layout);
    return t.applyProperties(this), t;
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   * @override
   */
  closestPointXY(t, e, a, s) {
    const l = this.flatCoordinates, f = T_(
      t,
      e,
      l[0],
      l[1]
    );
    if (f < s) {
      const h = this.stride;
      for (let p = 0; p < h; ++p)
        a[p] = l[p];
      return a.length = h, f;
    }
    return s;
  }
  /**
   * Return the coordinate of the point.
   * @return {import("../coordinate.js").Coordinate} Coordinates.
   * @api
   * @override
   */
  getCoordinates() {
    return this.flatCoordinates.slice();
  }
  /**
   * @param {import("../extent.js").Extent} extent Extent.
   * @protected
   * @return {import("../extent.js").Extent} extent Extent.
   * @override
   */
  computeExtent(t) {
    return JL(this.flatCoordinates, t);
  }
  /**
   * Get the type of this geometry.
   * @return {import("./Geometry.js").Type} Geometry type.
   * @api
   * @override
   */
  getType() {
    return "Point";
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   * @api
   * @override
   */
  intersectsExtent(t) {
    return rC(t, this.flatCoordinates[0], this.flatCoordinates[1]);
  }
  /**
   * @param {!Array<*>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @api
   * @override
   */
  setCoordinates(t, e) {
    this.setLayout(e, t, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = q$(
      this.flatCoordinates,
      0,
      t,
      this.stride
    ), this.changed();
  }
}
function X$(n, t, e, a, s) {
  return !e8(
    s,
    /**
     * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
     * @return {boolean} Contains (x, y).
     */
    function(f) {
      return !E_(
        n,
        t,
        e,
        a,
        f[0],
        f[1]
      );
    }
  );
}
function E_(n, t, e, a, s, l) {
  let f = 0, h = n[e - a], p = n[e - a + 1];
  for (; t < e; t += a) {
    const y = n[t], b = n[t + 1];
    p <= l ? b > l && (y - h) * (l - p) - (s - h) * (b - p) > 0 && f++ : b <= l && (y - h) * (l - p) - (s - h) * (b - p) < 0 && f--, h = y, p = b;
  }
  return f !== 0;
}
function tO(n, t, e, a, s, l) {
  if (e.length === 0 || !E_(n, t, e[0], a, s, l))
    return !1;
  for (let f = 1, h = e.length; f < h; ++f)
    if (E_(n, e[f - 1], e[f], a, s, l))
      return !1;
  return !0;
}
function K$(n, t, e, a, s, l) {
  if (e.length === 0)
    return !1;
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = e[f];
    if (tO(n, t, p, a, s, l))
      return !0;
    t = p[p.length - 1];
  }
  return !1;
}
function eO(n, t, e, a, s, l, f) {
  let h, p, y, b, x, w, A;
  const C = s[l + 1], L = [];
  for (let k = 0, H = e.length; k < H; ++k) {
    const B = e[k];
    for (b = n[B - a], w = n[B - a + 1], h = t; h < B; h += a)
      x = n[h], A = n[h + 1], (C <= w && A <= C || w <= C && C <= A) && (y = (C - w) / (A - w) * (x - b) + b, L.push(y)), b = x, w = A;
  }
  let N = NaN, U = -1 / 0;
  for (L.sort(sm), b = L[0], h = 1, p = L.length; h < p; ++h) {
    x = L[h];
    const k = Math.abs(x - b);
    k > U && (y = (b + x) / 2, tO(n, t, e, a, y, C) && (N = y, U = k)), b = x;
  }
  return isNaN(N) && (N = s[l]), f ? (f.push(N, C, U), f) : [N, C, U];
}
function G2(n, t, e, a, s) {
  let l = [];
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = e[f];
    l = eO(
      n,
      t,
      p,
      a,
      s,
      2 * f,
      l
    ), t = p[p.length - 1];
  }
  return l;
}
function Z$(n, t, e, a, s) {
  let l;
  for (t += a; t < e; t += a)
    if (l = s(
      n.slice(t - a, t),
      n.slice(t, t + a)
    ), l)
      return l;
  return !1;
}
function U2(n, t, e, a, s, l) {
  return l = l ?? t8(uu(), n, t, e, a), Co(s, l) ? l[0] >= s[0] && l[2] <= s[2] || l[1] >= s[1] && l[3] <= s[3] ? !0 : Z$(
    n,
    t,
    e,
    a,
    /**
     * @param {import("../../coordinate.js").Coordinate} point1 Start point.
     * @param {import("../../coordinate.js").Coordinate} point2 End point.
     * @return {boolean} `true` if the segment and the extent intersect,
     *     `false` otherwise.
     */
    function(f, h) {
      return h9(s, f, h);
    }
  ) : !1;
}
function j2(n, t, e, a, s) {
  return !!(U2(n, t, e, a, s) || E_(
    n,
    t,
    e,
    a,
    s[0],
    s[1]
  ) || E_(
    n,
    t,
    e,
    a,
    s[0],
    s[3]
  ) || E_(
    n,
    t,
    e,
    a,
    s[2],
    s[1]
  ) || E_(
    n,
    t,
    e,
    a,
    s[2],
    s[3]
  ));
}
function k2(n, t, e, a, s) {
  if (!j2(n, t, e[0], a, s))
    return !1;
  if (e.length === 1)
    return !0;
  for (let l = 1, f = e.length; l < f; ++l)
    if (X$(
      n,
      e[l - 1],
      e[l],
      a,
      s
    ) && !U2(
      n,
      e[l - 1],
      e[l],
      a,
      s
    ))
      return !1;
  return !0;
}
function W$(n, t, e, a, s) {
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    if (k2(n, t, h, a, s))
      return !0;
    t = h[h.length - 1];
  }
  return !1;
}
function Q$(n, t, e, a) {
  for (; t < e - a; ) {
    for (let s = 0; s < a; ++s) {
      const l = n[t + s];
      n[t + s] = n[e - a + s], n[e - a + s] = l;
    }
    t += a, e -= a;
  }
}
function nO(n, t, e, a) {
  let s = 0, l = n[e - a], f = n[e - a + 1];
  for (; t < e; t += a) {
    const h = n[t], p = n[t + 1];
    s += (h - l) * (p + f), l = h, f = p;
  }
  return s === 0 ? void 0 : s > 0;
}
function H2(n, t, e, a, s) {
  s = s !== void 0 ? s : !1;
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l], p = nO(
      n,
      t,
      h,
      a
    );
    if (l === 0) {
      if (s && p || !s && !p)
        return !1;
    } else if (s && !p || !s && p)
      return !1;
    t = h;
  }
  return !0;
}
function J$(n, t, e, a, s) {
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l];
    if (!H2(n, t, h, a, s))
      return !1;
    h.length && (t = h[h.length - 1]);
  }
  return !0;
}
function YM(n, t, e, a, s) {
  s = s !== void 0 ? s : !1;
  for (let l = 0, f = e.length; l < f; ++l) {
    const h = e[l], p = nO(
      n,
      t,
      h,
      a
    );
    (l === 0 ? s && p || !s && !p : s && !p || !s && p) && Q$(n, t, h, a), t = h;
  }
  return t;
}
function KN(n, t, e, a, s) {
  for (let l = 0, f = e.length; l < f; ++l)
    t = YM(
      n,
      t,
      e[l],
      a,
      s
    );
  return t;
}
function tX(n, t) {
  const e = [];
  let a = 0, s = 0, l;
  for (let f = 0, h = t.length; f < h; ++f) {
    const p = t[f], y = nO(n, a, p, 2);
    if (l === void 0 && (l = y), y === l)
      e.push(t.slice(s, f + 1));
    else {
      if (e.length === 0)
        continue;
      e[e.length - 1].push(t[s]);
    }
    s = f + 1, a = p;
  }
  return e;
}
class B_ extends US {
  /**
   * @param {!Array<Array<import("../coordinate.js").Coordinate>>|!Array<number>} coordinates
   *     Array of linear rings that define the polygon. The first linear ring of the
   *     array defines the outer-boundary or surface of the polygon. Each subsequent
   *     linear ring defines a hole in the surface of the polygon. A linear ring is
   *     an array of vertices' coordinates where the first coordinate and the last are
   *     equivalent. (For internal use, flat coordinates in combination with
   *     `layout` and `ends` are also accepted.)
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @param {Array<number>} [ends] Ends (for internal use with flat coordinates).
   */
  constructor(t, e, a) {
    super(), this.ends_ = [], this.flatInteriorPointRevision_ = -1, this.flatInteriorPoint_ = null, this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, this.orientedRevision_ = -1, this.orientedFlatCoordinates_ = null, e !== void 0 && a ? (this.setFlatCoordinates(
      e,
      /** @type {Array<number>} */
      t
    ), this.ends_ = a) : this.setCoordinates(
      /** @type {Array<Array<import("../coordinate.js").Coordinate>>} */
      t,
      e
    );
  }
  /**
   * Append the passed linear ring to this polygon.
   * @param {LinearRing} linearRing Linear ring.
   * @api
   */
  appendLinearRing(t) {
    this.flatCoordinates ? uE(this.flatCoordinates, t.getFlatCoordinates()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed();
  }
  /**
   * Make a complete copy of the geometry.
   * @return {!Polygon} Clone.
   * @api
   * @override
   */
  clone() {
    const t = new B_(
      this.flatCoordinates.slice(),
      this.layout,
      this.ends_.slice()
    );
    return t.applyProperties(this), t;
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   * @override
   */
  closestPointXY(t, e, a, s) {
    return s < ow(this.getExtent(), t, e) ? s : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
      L2(
        this.flatCoordinates,
        0,
        this.ends_,
        this.stride,
        0
      )
    ), this.maxDeltaRevision_ = this.getRevision()), P2(
      this.flatCoordinates,
      0,
      this.ends_,
      this.stride,
      this.maxDelta_,
      !0,
      t,
      e,
      a,
      s
    ));
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @return {boolean} Contains (x, y).
   * @override
   */
  containsXY(t, e) {
    return tO(
      this.getOrientedFlatCoordinates(),
      0,
      this.ends_,
      this.stride,
      t,
      e
    );
  }
  /**
   * Return the area of the polygon on projected plane.
   * @return {number} Area (on projected plane).
   * @api
   */
  getArea() {
    return D2(
      this.getOrientedFlatCoordinates(),
      0,
      this.ends_,
      this.stride
    );
  }
  /**
   * Get the coordinate array for this geometry.  This array has the structure
   * of a GeoJSON coordinate array for polygons.
   *
   * @param {boolean} [right] Orient coordinates according to the right-hand
   *     rule (counter-clockwise for exterior and clockwise for interior rings).
   *     If `false`, coordinates will be oriented according to the left-hand rule
   *     (clockwise for exterior and counter-clockwise for interior rings).
   *     By default, coordinate orientation will depend on how the geometry was
   *     constructed.
   * @return {Array<Array<import("../coordinate.js").Coordinate>>} Coordinates.
   * @api
   * @override
   */
  getCoordinates(t) {
    let e;
    return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(), YM(e, 0, this.ends_, this.stride, t)) : e = this.flatCoordinates, KT(e, 0, this.ends_, this.stride);
  }
  /**
   * @return {Array<number>} Ends.
   */
  getEnds() {
    return this.ends_;
  }
  /**
   * @return {Array<number>} Interior point.
   */
  getFlatInteriorPoint() {
    if (this.flatInteriorPointRevision_ != this.getRevision()) {
      const t = fm(this.getExtent());
      this.flatInteriorPoint_ = eO(
        this.getOrientedFlatCoordinates(),
        0,
        this.ends_,
        this.stride,
        t,
        0
      ), this.flatInteriorPointRevision_ = this.getRevision();
    }
    return (
      /** @type {import("../coordinate.js").Coordinate} */
      this.flatInteriorPoint_
    );
  }
  /**
   * Return an interior point of the polygon.
   * @return {Point} Interior point as XYM coordinate, where M is the
   * length of the horizontal intersection that the point belongs to.
   * @api
   */
  getInteriorPoint() {
    return new cE(this.getFlatInteriorPoint(), "XYM");
  }
  /**
   * Return the number of rings of the polygon,  this includes the exterior
   * ring and any interior rings.
   *
   * @return {number} Number of rings.
   * @api
   */
  getLinearRingCount() {
    return this.ends_.length;
  }
  /**
   * Return the Nth linear ring of the polygon geometry. Return `null` if the
   * given index is out of range.
   * The exterior linear ring is available at index `0` and the interior rings
   * at index `1` and beyond.
   *
   * @param {number} index Index.
   * @return {LinearRing|null} Linear ring.
   * @api
   */
  getLinearRing(t) {
    return t < 0 || this.ends_.length <= t ? null : new cS(
      this.flatCoordinates.slice(
        t === 0 ? 0 : this.ends_[t - 1],
        this.ends_[t]
      ),
      this.layout
    );
  }
  /**
   * Return the linear rings of the polygon.
   * @return {Array<LinearRing>} Linear rings.
   * @api
   */
  getLinearRings() {
    const t = this.layout, e = this.flatCoordinates, a = this.ends_, s = [];
    let l = 0;
    for (let f = 0, h = a.length; f < h; ++f) {
      const p = a[f], y = new cS(
        e.slice(l, p),
        t
      );
      s.push(y), l = p;
    }
    return s;
  }
  /**
   * @return {Array<number>} Oriented flat coordinates.
   */
  getOrientedFlatCoordinates() {
    if (this.orientedRevision_ != this.getRevision()) {
      const t = this.flatCoordinates;
      H2(t, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = YM(
        this.orientedFlatCoordinates_,
        0,
        this.ends_,
        this.stride
      )), this.orientedRevision_ = this.getRevision();
    }
    return (
      /** @type {Array<number>} */
      this.orientedFlatCoordinates_
    );
  }
  /**
   * @param {number} squaredTolerance Squared tolerance.
   * @return {Polygon} Simplified Polygon.
   * @protected
   * @override
   */
  getSimplifiedGeometryInternal(t) {
    const e = [], a = [];
    return e.length = JC(
      this.flatCoordinates,
      0,
      this.ends_,
      this.stride,
      Math.sqrt(t),
      e,
      0,
      a
    ), new B_(e, "XY", a);
  }
  /**
   * Get the type of this geometry.
   * @return {import("./Geometry.js").Type} Geometry type.
   * @api
   * @override
   */
  getType() {
    return "Polygon";
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   * @api
   * @override
   */
  intersectsExtent(t) {
    return k2(
      this.getOrientedFlatCoordinates(),
      0,
      this.ends_,
      this.stride,
      t
    );
  }
  /**
   * Set the coordinates of the polygon.
   * @param {!Array<Array<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @api
   * @override
   */
  setCoordinates(t, e) {
    this.setLayout(e, t, 2), this.flatCoordinates || (this.flatCoordinates = []);
    const a = z2(
      this.flatCoordinates,
      0,
      t,
      this.stride,
      this.ends_
    );
    this.flatCoordinates.length = a.length === 0 ? 0 : a[a.length - 1], this.changed();
  }
}
function ZN(n) {
  if (F_(n))
    throw new Error("Cannot create polygon from empty extent");
  const t = n[0], e = n[1], a = n[2], s = n[3], l = [
    t,
    e,
    t,
    s,
    a,
    s,
    a,
    e,
    t,
    e
  ];
  return new B_(l, "XY", [l.length]);
}
function WN(n, t, e, a, s, l, f) {
  let h, p;
  const y = (e - t) / a;
  if (y === 1)
    h = t;
  else if (y === 2)
    h = t, p = s;
  else if (y !== 0) {
    let b = n[t], x = n[t + 1], w = 0;
    const A = [0];
    for (let N = t + a; N < e; N += a) {
      const U = n[N], k = n[N + 1];
      w += Math.sqrt((U - b) * (U - b) + (k - x) * (k - x)), A.push(w), b = U, x = k;
    }
    const C = s * w, L = XF(A, C);
    L < 0 ? (p = (C - A[-L - 2]) / (A[-L - 1] - A[-L - 2]), h = t + (-L - 2) * a) : h = t + L * a;
  }
  f = f > 1 ? f : 2, l = l || new Array(f);
  for (let b = 0; b < f; ++b)
    l[b] = h === void 0 ? NaN : p === void 0 ? n[h + b] : Tc(n[h + b], n[h + a + b], p);
  return l;
}
function eX(n, t, e, a) {
  let s = n[t], l = n[t + 1], f = 0;
  for (let h = t + a; h < e; h += a) {
    const p = n[h], y = n[h + 1];
    f += Math.sqrt((p - s) * (p - s) + (y - l) * (y - l)), s = p, l = y;
  }
  return f;
}
const wc = {
  /**
   * Triggered before a layer is rendered.
   * @event module:ol/render/Event~RenderEvent#prerender
   * @api
   */
  PRERENDER: "prerender",
  /**
   * Triggered after a layer is rendered.
   * @event module:ol/render/Event~RenderEvent#postrender
   * @api
   */
  POSTRENDER: "postrender",
  /**
   * Triggered before layers are composed.  When dispatched by the map, the event object will not have
   * a `context` set.  When dispatched by a layer, the event object will have a `context` set.  Only
   * WebGL layers currently dispatch this event.
   * @event module:ol/render/Event~RenderEvent#precompose
   * @api
   */
  PRECOMPOSE: "precompose",
  /**
   * Triggered after layers are composed.  When dispatched by the map, the event object will not have
   * a `context` set.  When dispatched by a layer, the event object will have a `context` set.  Only
   * WebGL layers currently dispatch this event.
   * @event module:ol/render/Event~RenderEvent#postcompose
   * @api
   */
  POSTCOMPOSE: "postcompose",
  /**
   * Triggered when rendering is complete, i.e. all sources and tiles have
   * finished loading for the current viewport, and all tiles are faded in.
   * The event object will not have a `context` set.
   * @event module:ol/render/Event~RenderEvent#rendercomplete
   * @api
   */
  RENDERCOMPLETE: "rendercomplete"
}, q_ = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "", nX = q_.includes("safari") && !q_.includes("chrom");
nX && (q_.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(q_));
const iX = q_.includes("webkit") && !q_.includes("edge"), B2 = q_.includes("macintosh"), aX = typeof devicePixelRatio < "u" ? devicePixelRatio : 1, iO = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, aO = typeof Image < "u" && Image.prototype.decode, q2 = typeof createImageBitmap == "function", V2 = function() {
  let n = !1;
  try {
    const t = Object.defineProperty({}, "passive", {
      get: function() {
        n = !0;
      }
    });
    window.addEventListener("_", null, t), window.removeEventListener("_", null, t);
  } catch {
  }
  return n;
}(), xe = {
  IDLE: 0,
  LOADING: 1,
  LOADED: 2,
  ERROR: 3,
  EMPTY: 4
};
function Pr(n, t, e, a) {
  let s;
  return e && e.length ? s = /** @type {HTMLCanvasElement} */
  e.shift() : iO ? s = new OffscreenCanvas(n || 300, t || 300) : s = document.createElement("canvas"), n && (s.width = n), t && (s.height = t), /** @type {CanvasRenderingContext2D} */
  s.getContext("2d", a);
}
let GA;
function ZT() {
  return GA || (GA = Pr(1, 1)), GA;
}
function Dw(n) {
  const t = n.canvas;
  t.width = 1, t.height = 1, n.clearRect(0, 0, 1, 1);
}
function rX(n) {
  let t = n.offsetWidth;
  const e = getComputedStyle(n);
  return t += parseInt(e.marginLeft, 10) + parseInt(e.marginRight, 10), t;
}
function sX(n) {
  let t = n.offsetHeight;
  const e = getComputedStyle(n);
  return t += parseInt(e.marginTop, 10) + parseInt(e.marginBottom, 10), t;
}
function QN(n, t) {
  const e = t.parentNode;
  e && e.replaceChild(n, t);
}
function Y2(n) {
  for (; n.lastChild; )
    n.lastChild.remove();
}
function oX(n, t) {
  const e = n.childNodes;
  for (let a = 0; ; ++a) {
    const s = e[a], l = t[a];
    if (!s && !l)
      break;
    if (s !== l) {
      if (!s) {
        n.appendChild(l);
        continue;
      }
      if (!l) {
        n.removeChild(s), --a;
        continue;
      }
      n.insertBefore(l, s);
    }
  }
}
const rO = [NaN, NaN, NaN, 0];
let UA;
function lX() {
  return UA || (UA = Pr(1, 1, void 0, {
    willReadFrequently: !0,
    desynchronized: !0
  })), UA;
}
const uX = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, cX = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, fX = /^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, hX = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;
function iT(n, t) {
  return n.endsWith("%") ? Number(n.substring(0, n.length - 1)) / t : Number(n);
}
function $b(n) {
  throw new Error('failed to parse "' + n + '" as color');
}
function F2(n) {
  if (n.toLowerCase().startsWith("rgb")) {
    const l = n.match(cX) || n.match(uX) || n.match(fX);
    if (l) {
      const f = l[4], h = 100 / 255;
      return [
        ra(iT(l[1], h) + 0.5 | 0, 0, 255),
        ra(iT(l[2], h) + 0.5 | 0, 0, 255),
        ra(iT(l[3], h) + 0.5 | 0, 0, 255),
        f !== void 0 ? ra(iT(f, 100), 0, 1) : 1
      ];
    }
    $b(n);
  }
  if (n.startsWith("#")) {
    if (hX.test(n)) {
      const l = n.substring(1), f = l.length <= 4 ? 1 : 2, h = [0, 0, 0, 255];
      for (let p = 0, y = l.length; p < y; p += f) {
        let b = parseInt(l.substring(p, p + f), 16);
        f === 1 && (b += b << 4), h[p / f] = b;
      }
      return h[3] = h[3] / 255, h;
    }
    $b(n);
  }
  const t = lX();
  t.fillStyle = "#abcdef";
  let e = t.fillStyle;
  t.fillStyle = n, t.fillStyle === e && (t.fillStyle = "#fedcba", e = t.fillStyle, t.fillStyle = n, t.fillStyle === e && $b(n));
  const a = t.fillStyle;
  if (a.startsWith("#") || a.startsWith("rgba"))
    return F2(a);
  t.clearRect(0, 0, 1, 1), t.fillRect(0, 0, 1, 1);
  const s = Array.from(t.getImageData(0, 0, 1, 1).data);
  return s[3] = ES(s[3] / 255, 3), s;
}
function dX(n) {
  return typeof n == "string" ? n : oO(n);
}
const gX = 1024, Eb = {};
let jA = 0;
function mX(n) {
  if (n.length === 4)
    return n;
  const t = n.slice();
  return t[3] = 1, t;
}
function kA(n) {
  return n > 31308e-7 ? Math.pow(n, 1 / 2.4) * 269.025 - 14.025 : n * 3294.6;
}
function HA(n) {
  return n > 0.2068965 ? Math.pow(n, 3) : (n - 4 / 29) * (108 / 841);
}
function BA(n) {
  return n > 10.314724 ? Math.pow((n + 14.025) / 269.025, 2.4) : n / 3294.6;
}
function qA(n) {
  return n > 88564e-7 ? Math.pow(n, 1 / 3) : n / (108 / 841) + 4 / 29;
}
function JN(n) {
  const t = BA(n[0]), e = BA(n[1]), a = BA(n[2]), s = qA(t * 0.222488403 + e * 0.716873169 + a * 0.06060791), l = 500 * (qA(t * 0.452247074 + e * 0.399439023 + a * 0.148375274) - s), f = 200 * (s - qA(t * 0.016863605 + e * 0.117638439 + a * 0.865350722)), h = Math.atan2(f, l) * (180 / Math.PI);
  return [
    116 * s - 16,
    Math.sqrt(l * l + f * f),
    h < 0 ? h + 360 : h,
    n[3]
  ];
}
function pX(n) {
  const t = (n[0] + 16) / 116, e = n[1], a = n[2] * Math.PI / 180, s = HA(t), l = HA(t + e / 500 * Math.cos(a)), f = HA(t - e / 200 * Math.sin(a)), h = kA(l * 3.021973625 - s * 1.617392459 - f * 0.404875592), p = kA(l * -0.943766287 + s * 1.916279586 + f * 0.027607165), y = kA(l * 0.069407491 - s * 0.22898585 + f * 1.159737864);
  return [
    ra(h + 0.5 | 0, 0, 255),
    ra(p + 0.5 | 0, 0, 255),
    ra(y + 0.5 | 0, 0, 255),
    n[3]
  ];
}
function sO(n) {
  if (n === "none")
    return rO;
  if (Eb.hasOwnProperty(n))
    return Eb[n];
  if (jA >= gX) {
    let e = 0;
    for (const a in Eb)
      (e++ & 3) === 0 && (delete Eb[a], --jA);
  }
  const t = F2(n);
  t.length !== 4 && $b(n);
  for (const e of t)
    isNaN(e) && $b(n);
  return Eb[n] = t, ++jA, t;
}
function fE(n) {
  return Array.isArray(n) ? n : sO(n);
}
function oO(n) {
  let t = n[0];
  t != (t | 0) && (t = t + 0.5 | 0);
  let e = n[1];
  e != (e | 0) && (e = e + 0.5 | 0);
  let a = n[2];
  a != (a | 0) && (a = a + 0.5 | 0);
  const s = n[3] === void 0 ? 1 : Math.round(n[3] * 1e3) / 1e3;
  return "rgba(" + t + "," + e + "," + a + "," + s + ")";
}
class $2 extends PS {
  /**
   * @param {import("./extent.js").Extent} extent Extent.
   * @param {number|Array<number>|undefined} resolution Resolution. If provided as array, x and y
   * resolution will be assumed.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("./ImageState.js").default|Loader} stateOrLoader State.
   */
  constructor(t, e, a, s) {
    super(), this.extent = t, this.pixelRatio_ = a, this.resolution = e, this.state = typeof s == "function" ? xe.IDLE : s, this.image_ = null, this.loader = typeof s == "function" ? s : null;
  }
  /**
   * @protected
   */
  changed() {
    this.dispatchEvent(ln.CHANGE);
  }
  /**
   * @return {import("./extent.js").Extent} Extent.
   */
  getExtent() {
    return this.extent;
  }
  /**
   * @return {import('./DataTile.js').ImageLike} Image.
   */
  getImage() {
    return this.image_;
  }
  /**
   * @return {number} PixelRatio.
   */
  getPixelRatio() {
    return this.pixelRatio_;
  }
  /**
   * @return {number|Array<number>} Resolution.
   */
  getResolution() {
    return (
      /** @type {number} */
      this.resolution
    );
  }
  /**
   * @return {import("./ImageState.js").default} State.
   */
  getState() {
    return this.state;
  }
  /**
   * Load not yet loaded URI.
   */
  load() {
    if (this.state == xe.IDLE && this.loader) {
      this.state = xe.LOADING, this.changed();
      const t = this.getResolution(), e = Array.isArray(t) ? t[0] : t;
      p2(
        () => this.loader(
          this.getExtent(),
          e,
          this.getPixelRatio()
        )
      ).then((a) => {
        "image" in a && (this.image_ = a.image), "extent" in a && (this.extent = a.extent), "resolution" in a && (this.resolution = a.resolution), "pixelRatio" in a && (this.pixelRatio_ = a.pixelRatio), (a instanceof HTMLImageElement || q2 && a instanceof ImageBitmap || a instanceof HTMLCanvasElement || a instanceof HTMLVideoElement) && (this.image_ = a), this.state = xe.LOADED;
      }).catch((a) => {
        this.state = xe.ERROR, console.error(a);
      }).finally(() => this.changed());
    }
  }
  /**
   * @param {import('./DataTile.js').ImageLike} image The image.
   */
  setImage(t) {
    this.image_ = t;
  }
  /**
   * @param {number|Array<number>} resolution Resolution.
   */
  setResolution(t) {
    this.resolution = t;
  }
}
function yX(n, t, e) {
  const a = (
    /** @type {HTMLImageElement} */
    n
  );
  let s = !0, l = !1, f = !1;
  const h = [
    $T(a, ln.LOAD, function() {
      f = !0, l || t();
    })
  ];
  return a.src && aO ? (l = !0, a.decode().then(function() {
    s && t();
  }).catch(function(p) {
    s && (f ? t() : e());
  })) : h.push($T(a, ln.ERROR, e)), function() {
    s = !1, h.forEach(Xi);
  };
}
function _X(n, t) {
  return new Promise((e, a) => {
    function s() {
      f(), e(n);
    }
    function l() {
      f(), a(new Error("Image load error"));
    }
    function f() {
      n.removeEventListener("load", s), n.removeEventListener("error", l);
    }
    n.addEventListener("load", s), n.addEventListener("error", l);
  });
}
function X2(n, t) {
  return t && (n.src = t), n.src && aO ? new Promise(
    (e, a) => n.decode().then(() => e(n)).catch(
      (s) => n.complete && n.width ? e(n) : a(s)
    )
  ) : _X(n);
}
function K2(n, t) {
  return t && (n.src = t), n.src && aO && q2 ? n.decode().then(() => createImageBitmap(n)).catch((e) => {
    if (n.complete && n.width)
      return n;
    throw e;
  }) : X2(n);
}
class vX {
  constructor() {
    this.cache_ = {}, this.patternCache_ = {}, this.cacheSize_ = 0, this.maxCacheSize_ = 1024;
  }
  /**
   * FIXME empty description for jsdoc
   */
  clear() {
    this.cache_ = {}, this.patternCache_ = {}, this.cacheSize_ = 0;
  }
  /**
   * @return {boolean} Can expire cache.
   */
  canExpireCache() {
    return this.cacheSize_ > this.maxCacheSize_;
  }
  /**
   * FIXME empty description for jsdoc
   */
  expire() {
    if (this.canExpireCache()) {
      let t = 0;
      for (const e in this.cache_) {
        const a = this.cache_[e];
        (t++ & 3) === 0 && !a.hasListener() && (delete this.cache_[e], delete this.patternCache_[e], --this.cacheSize_);
      }
    }
  }
  /**
   * @param {string} src Src.
   * @param {?string} crossOrigin Cross origin.
   * @param {import("../color.js").Color|string|null} color Color.
   * @return {import("./IconImage.js").default} Icon image.
   */
  get(t, e, a) {
    const s = VA(t, e, a);
    return s in this.cache_ ? this.cache_[s] : null;
  }
  /**
   * @param {string} src Src.
   * @param {?string} crossOrigin Cross origin.
   * @param {import("../color.js").Color|string|null} color Color.
   * @return {CanvasPattern} Icon image.
   */
  getPattern(t, e, a) {
    const s = VA(t, e, a);
    return s in this.patternCache_ ? this.patternCache_[s] : null;
  }
  /**
   * @param {string} src Src.
   * @param {?string} crossOrigin Cross origin.
   * @param {import("../color.js").Color|string|null} color Color.
   * @param {import("./IconImage.js").default|null} iconImage Icon image.
   * @param {boolean} [pattern] Also cache a `'repeat'` pattern with this `iconImage`.
   */
  set(t, e, a, s, l) {
    const f = VA(t, e, a), h = f in this.cache_;
    this.cache_[f] = s, l && (s.getImageState() === xe.IDLE && s.load(), s.getImageState() === xe.LOADING ? s.ready().then(() => {
      this.patternCache_[f] = ZT().createPattern(
        s.getImage(1),
        "repeat"
      );
    }) : this.patternCache_[f] = ZT().createPattern(
      s.getImage(1),
      "repeat"
    )), h || ++this.cacheSize_;
  }
  /**
   * Set the cache size of the icon cache. Default is `1024`. Change this value when
   * your map uses more than 1024 different icon images and you are not caching icon
   * styles on the application level.
   * @param {number} maxCacheSize Cache max size.
   * @api
   */
  setSize(t) {
    this.maxCacheSize_ = t, this.expire();
  }
}
function VA(n, t, e) {
  const a = e ? fE(e) : "null";
  return t + ":" + n + ":" + a;
}
const Rc = new vX();
let bb = null;
class Z2 extends PS {
  /**
   * @param {HTMLImageElement|HTMLCanvasElement|ImageBitmap|null} image Image.
   * @param {string|undefined} src Src.
   * @param {?string} crossOrigin Cross origin.
   * @param {import("../ImageState.js").default|undefined} imageState Image state.
   * @param {import("../color.js").Color|string|null} color Color.
   */
  constructor(t, e, a, s, l) {
    super(), this.hitDetectionImage_ = null, this.image_ = t, this.crossOrigin_ = a, this.canvas_ = {}, this.color_ = l, this.imageState_ = s === void 0 ? xe.IDLE : s, this.size_ = t && t.width && t.height ? [t.width, t.height] : null, this.src_ = e, this.tainted_, this.ready_ = null;
  }
  /**
   * @private
   */
  initializeImage_() {
    this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_);
  }
  /**
   * @private
   * @return {boolean} The image canvas is tainted.
   */
  isTainted_() {
    if (this.tainted_ === void 0 && this.imageState_ === xe.LOADED) {
      bb || (bb = Pr(1, 1, void 0, {
        willReadFrequently: !0
      })), bb.drawImage(this.image_, 0, 0);
      try {
        bb.getImageData(0, 0, 1, 1), this.tainted_ = !1;
      } catch {
        bb = null, this.tainted_ = !0;
      }
    }
    return this.tainted_ === !0;
  }
  /**
   * @private
   */
  dispatchChangeEvent_() {
    this.dispatchEvent(ln.CHANGE);
  }
  /**
   * @private
   */
  handleImageError_() {
    this.imageState_ = xe.ERROR, this.dispatchChangeEvent_();
  }
  /**
   * @private
   */
  handleImageLoad_() {
    this.imageState_ = xe.LOADED, this.size_ = [this.image_.width, this.image_.height], this.dispatchChangeEvent_();
  }
  /**
   * @param {number} pixelRatio Pixel ratio.
   * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image or Canvas element or image bitmap.
   */
  getImage(t) {
    return this.image_ || this.initializeImage_(), this.replaceColor_(t), this.canvas_[t] ? this.canvas_[t] : this.image_;
  }
  /**
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} Image or Canvas element.
   */
  getPixelRatio(t) {
    return this.replaceColor_(t), this.canvas_[t] ? t : 1;
  }
  /**
   * @return {import("../ImageState.js").default} Image state.
   */
  getImageState() {
    return this.imageState_;
  }
  /**
   * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image element.
   */
  getHitDetectionImage() {
    if (this.image_ || this.initializeImage_(), !this.hitDetectionImage_)
      if (this.isTainted_()) {
        const t = this.size_[0], e = this.size_[1], a = Pr(t, e);
        a.fillRect(0, 0, t, e), this.hitDetectionImage_ = a.canvas;
      } else
        this.hitDetectionImage_ = this.image_;
    return this.hitDetectionImage_;
  }
  /**
   * Get the size of the icon (in pixels).
   * @return {import("../size.js").Size} Image size.
   */
  getSize() {
    return this.size_;
  }
  /**
   * @return {string|undefined} Image src.
   */
  getSrc() {
    return this.src_;
  }
  /**
   * Load not yet loaded URI.
   */
  load() {
    if (this.imageState_ === xe.IDLE) {
      this.image_ || this.initializeImage_(), this.imageState_ = xe.LOADING;
      try {
        this.src_ !== void 0 && (this.image_.src = this.src_);
      } catch {
        this.handleImageError_();
      }
      this.image_ instanceof HTMLImageElement && X2(this.image_, this.src_).then((t) => {
        this.image_ = t, this.handleImageLoad_();
      }).catch(this.handleImageError_.bind(this));
    }
  }
  /**
   * @param {number} pixelRatio Pixel ratio.
   * @private
   */
  replaceColor_(t) {
    if (!this.color_ || this.canvas_[t] || this.imageState_ !== xe.LOADED)
      return;
    const e = this.image_, a = Pr(
      Math.ceil(e.width * t),
      Math.ceil(e.height * t)
    ), s = a.canvas;
    a.scale(t, t), a.drawImage(e, 0, 0), a.globalCompositeOperation = "multiply", a.fillStyle = dX(this.color_), a.fillRect(0, 0, s.width / t, s.height / t), a.globalCompositeOperation = "destination-in", a.drawImage(e, 0, 0), this.canvas_[t] = s;
  }
  /**
   * @return {Promise<void>} Promise that resolves when the image is loaded.
   */
  ready() {
    return this.ready_ || (this.ready_ = new Promise((t) => {
      if (this.imageState_ === xe.LOADED || this.imageState_ === xe.ERROR)
        t();
      else {
        const e = () => {
          (this.imageState_ === xe.LOADED || this.imageState_ === xe.ERROR) && (this.removeEventListener(ln.CHANGE, e), t());
        };
        this.addEventListener(ln.CHANGE, e);
      }
    })), this.ready_;
  }
}
function lO(n, t, e, a, s, l) {
  let f = t === void 0 ? void 0 : Rc.get(t, e, s);
  return f || (f = new Z2(
    n,
    n && "src" in n ? n.src || void 0 : t,
    e,
    a,
    s
  ), Rc.set(t, e, s, f, l)), l && f && !Rc.getPattern(t, e, s) && Rc.set(t, e, s, f, l), f;
}
function rd(n) {
  return n ? Array.isArray(n) ? oO(n) : typeof n == "object" && "src" in n ? EX(n) : n : null;
}
function EX(n) {
  if (!n.offset || !n.size)
    return Rc.getPattern(n.src, "anonymous", n.color);
  const t = n.src + ":" + n.offset, e = Rc.getPattern(
    t,
    void 0,
    n.color
  );
  if (e)
    return e;
  const a = Rc.get(n.src, "anonymous", null);
  if (a.getImageState() !== xe.LOADED)
    return null;
  const s = Pr(
    n.size[0],
    n.size[1]
  );
  return s.drawImage(
    a.getImage(1),
    n.offset[0],
    n.offset[1],
    n.size[0],
    n.size[1],
    0,
    0,
    n.size[0],
    n.size[1]
  ), lO(
    s.canvas,
    t,
    void 0,
    xe.LOADED,
    n.color,
    !0
  ), Rc.getPattern(t, void 0, n.color);
}
class W2 {
  /**
   * Render a geometry with a custom renderer.
   *
   * @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {Function} renderer Renderer.
   * @param {Function} hitDetectionRenderer Renderer.
   * @param {number} [index] Render order index.
   */
  drawCustom(t, e, a, s, l) {
  }
  /**
   * Render a geometry.
   *
   * @param {import("../geom/Geometry.js").default} geometry The geometry to render.
   */
  drawGeometry(t) {
  }
  /**
   * Set the rendering style.
   *
   * @param {import("../style/Style.js").default} style The rendering style.
   */
  setStyle(t) {
  }
  /**
   * @param {import("../geom/Circle.js").default} circleGeometry Circle geometry.
   * @param {import("../Feature.js").default} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawCircle(t, e, a) {
  }
  /**
   * @param {import("../Feature.js").default} feature Feature.
   * @param {import("../style/Style.js").default} style Style.
   * @param {number} [index] Render order index.
   */
  drawFeature(t, e, a) {
  }
  /**
   * @param {import("../geom/GeometryCollection.js").default} geometryCollectionGeometry Geometry collection.
   * @param {import("../Feature.js").default} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawGeometryCollection(t, e, a) {
  }
  /**
   * @param {import("../geom/LineString.js").default|import("./Feature.js").default} lineStringGeometry Line string geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawLineString(t, e, a) {
  }
  /**
   * @param {import("../geom/MultiLineString.js").default|import("./Feature.js").default} multiLineStringGeometry MultiLineString geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawMultiLineString(t, e, a) {
  }
  /**
   * @param {import("../geom/MultiPoint.js").default|import("./Feature.js").default} multiPointGeometry MultiPoint geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawMultiPoint(t, e, a) {
  }
  /**
   * @param {import("../geom/MultiPolygon.js").default} multiPolygonGeometry MultiPolygon geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawMultiPolygon(t, e, a) {
  }
  /**
   * @param {import("../geom/Point.js").default|import("./Feature.js").default} pointGeometry Point geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawPoint(t, e, a) {
  }
  /**
   * @param {import("../geom/Polygon.js").default|import("./Feature.js").default} polygonGeometry Polygon geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawPolygon(t, e, a) {
  }
  /**
   * @param {import("../geom/SimpleGeometry.js").default|import("./Feature.js").default} geometry Geometry.
   * @param {import("../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   */
  drawText(t, e, a) {
  }
  /**
   * @param {import("../style/Fill.js").default} fillStyle Fill style.
   * @param {import("../style/Stroke.js").default} strokeStyle Stroke style.
   */
  setFillStrokeStyle(t, e) {
  }
  /**
   * @param {import("../style/Image.js").default} imageStyle Image style.
   * @param {import("../render/canvas.js").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with a text style.
   */
  setImageStyle(t, e) {
  }
  /**
   * @param {import("../style/Text.js").default} textStyle Text style.
   * @param {import("../render/canvas.js").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with an image style.
   */
  setTextStyle(t, e) {
  }
}
const aT = "ol-hidden", bX = "ol-selectable", jS = "ol-unselectable", uO = "ol-control", tL = "ol-collapsed", SX = new RegExp(
  [
    "^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)",
    "(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)",
    "(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)",
    "(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?",
    "(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))",
    "(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",
    `?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`
  ].join(""),
  "i"
), eL = [
  "style",
  "variant",
  "weight",
  "size",
  "lineHeight",
  "family"
], FM = {
  normal: 400,
  bold: 700
}, $M = function(n) {
  const t = n.match(SX);
  if (!t)
    return null;
  const e = (
    /** @type {FontParameters} */
    {
      lineHeight: "normal",
      size: "1.2em",
      style: "normal",
      weight: "400",
      variant: "normal"
    }
  );
  for (let a = 0, s = eL.length; a < s; ++a) {
    const l = t[a + 1];
    l !== void 0 && (e[eL[a]] = typeof l == "string" ? l.trim() : l);
  }
  return isNaN(Number(e.weight)) && e.weight in FM && (e.weight = FM[e.weight]), e.families = e.family.split(/,\s?/).map((a) => a.trim().replace(/^['"]|['"]$/g, "")), e;
}, Q2 = "10px sans-serif", ll = "#000", hE = "round", lm = [], um = 0, dE = "round", fS = 10, hS = "#000", dS = "center", WT = "middle", b_ = [0, 0, 0, 0], gS = 1, N1 = new Uf();
let Sb = null, nL;
const XM = {}, xX = /* @__PURE__ */ new Set([
  "serif",
  "sans-serif",
  "monospace",
  "cursive",
  "fantasy",
  "system-ui",
  "ui-serif",
  "ui-sans-serif",
  "ui-monospace",
  "ui-rounded",
  "emoji",
  "math",
  "fangsong"
]);
function TX(n, t, e) {
  return `${n} ${t} 16px "${e}"`;
}
const wX = /* @__PURE__ */ function() {
  let t, e;
  async function a(l) {
    await e.ready;
    const f = await e.load(l);
    if (f.length === 0)
      return !1;
    const h = $M(l), p = h.families[0].toLowerCase(), y = h.weight;
    return f.some(
      /**
       * @param {import('../css.js').FontParameters} f Font.
       * @return {boolean} Font matches.
       */
      (b) => {
        const x = b.family.replace(/^['"]|['"]$/g, "").toLowerCase(), w = FM[b.weight] || b.weight;
        return x === p && b.style === h.style && w == y;
      }
    );
  }
  async function s() {
    await e.ready;
    let l = !0;
    const f = N1.getProperties(), h = Object.keys(f).filter(
      (p) => f[p] < 100
    );
    for (let p = h.length - 1; p >= 0; --p) {
      const y = h[p];
      let b = f[y];
      b < 100 && (await a(y) ? (SS(XM), N1.set(y, 100)) : (b += 10, N1.set(y, b, !0), b < 100 && (l = !1)));
    }
    t = void 0, l || (t = setTimeout(s, 100));
  }
  return async function(l) {
    e || (e = iO ? self.fonts : document.fonts);
    const f = $M(l);
    if (!f)
      return;
    const h = f.families;
    let p = !1;
    for (const y of h) {
      if (xX.has(y))
        continue;
      const b = TX(f.style, f.weight, y);
      N1.get(b) === void 0 && (N1.set(b, 0, !0), p = !0);
    }
    p && (clearTimeout(t), t = setTimeout(s, 100));
  };
}(), RX = /* @__PURE__ */ function() {
  let n;
  return function(t) {
    let e = XM[t];
    if (e == null) {
      if (iO) {
        const a = $M(t), s = J2(t, "Žg");
        e = (isNaN(Number(a.lineHeight)) ? 1.2 : Number(a.lineHeight)) * (s.actualBoundingBoxAscent + s.actualBoundingBoxDescent);
      } else
        n || (n = document.createElement("div"), n.innerHTML = "M", n.style.minHeight = "0", n.style.maxHeight = "none", n.style.height = "auto", n.style.padding = "0", n.style.border = "none", n.style.position = "absolute", n.style.display = "block", n.style.left = "-99999px"), n.style.font = t, document.body.appendChild(n), e = n.offsetHeight, document.body.removeChild(n);
      XM[t] = e;
    }
    return e;
  };
}();
function J2(n, t) {
  return Sb || (Sb = Pr(1, 1)), n != nL && (Sb.font = n, nL = Sb.font), Sb.measureText(t);
}
function t5(n, t) {
  return J2(n, t).width;
}
function iL(n, t, e) {
  if (t in e)
    return e[t];
  const a = t.split(`
`).reduce((s, l) => Math.max(s, t5(n, l)), 0);
  return e[t] = a, a;
}
function AX(n, t) {
  const e = [], a = [], s = [];
  let l = 0, f = 0, h = 0, p = 0;
  for (let y = 0, b = t.length; y <= b; y += 2) {
    const x = t[y];
    if (x === `
` || y === b) {
      l = Math.max(l, f), s.push(f), f = 0, h += p, p = 0;
      continue;
    }
    const w = t[y + 1] || n.font, A = t5(w, x);
    e.push(A), f += A;
    const C = RX(w);
    a.push(C), p = Math.max(p, C);
  }
  return { width: l, height: h, widths: e, heights: a, lineWidths: s };
}
function MX(n, t, e, a, s, l, f, h, p, y, b) {
  n.save(), e !== 1 && (n.globalAlpha === void 0 ? n.globalAlpha = (x) => x.globalAlpha *= e : n.globalAlpha *= e), t && n.transform.apply(n, t), /** @type {*} */
  a.contextInstructions ? (n.translate(p, y), n.scale(b[0], b[1]), CX(
    /** @type {Label} */
    a,
    n
  )) : b[0] < 0 || b[1] < 0 ? (n.translate(p, y), n.scale(b[0], b[1]), n.drawImage(
    /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
    a,
    s,
    l,
    f,
    h,
    0,
    0,
    f,
    h
  )) : n.drawImage(
    /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
    a,
    s,
    l,
    f,
    h,
    p,
    y,
    f * b[0],
    h * b[1]
  ), n.restore();
}
function CX(n, t) {
  const e = n.contextInstructions;
  for (let a = 0, s = e.length; a < s; a += 2)
    Array.isArray(e[a + 1]) ? t[e[a]].apply(
      t,
      e[a + 1]
    ) : t[e[a]] = e[a + 1];
}
class OX extends W2 {
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../../extent.js").Extent} extent Extent.
   * @param {import("../../transform.js").Transform} transform Transform.
   * @param {number} viewRotation View rotation.
   * @param {number} [squaredTolerance] Optional squared tolerance for simplification.
   * @param {import("../../proj.js").TransformFunction} [userTransform] Transform from user to view projection.
   */
  constructor(t, e, a, s, l, f, h) {
    super(), this.context_ = t, this.pixelRatio_ = e, this.extent_ = a, this.transform_ = s, this.transformRotation_ = s ? ES(Math.atan2(s[1], s[0]), 10) : 0, this.viewRotation_ = l, this.squaredTolerance_ = f, this.userTransform_ = h, this.contextFillState_ = null, this.contextStrokeState_ = null, this.contextTextState_ = null, this.fillState_ = null, this.strokeState_ = null, this.image_ = null, this.imageAnchorX_ = 0, this.imageAnchorY_ = 0, this.imageHeight_ = 0, this.imageOpacity_ = 0, this.imageOriginX_ = 0, this.imageOriginY_ = 0, this.imageRotateWithView_ = !1, this.imageRotation_ = 0, this.imageScale_ = [0, 0], this.imageWidth_ = 0, this.text_ = "", this.textOffsetX_ = 0, this.textOffsetY_ = 0, this.textRotateWithView_ = !1, this.textRotation_ = 0, this.textScale_ = [0, 0], this.textFillState_ = null, this.textStrokeState_ = null, this.textState_ = null, this.pixelCoordinates_ = [], this.tmpLocalTransform_ = Pf();
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {number} end End.
   * @param {number} stride Stride.
   * @private
   */
  drawImages_(t, e, a, s) {
    if (!this.image_)
      return;
    const l = v0(
      t,
      e,
      a,
      s,
      this.transform_,
      this.pixelCoordinates_
    ), f = this.context_, h = this.tmpLocalTransform_, p = f.globalAlpha;
    this.imageOpacity_ != 1 && (f.globalAlpha = p * this.imageOpacity_);
    let y = this.imageRotation_;
    this.transformRotation_ === 0 && (y -= this.viewRotation_), this.imageRotateWithView_ && (y += this.viewRotation_);
    for (let b = 0, x = l.length; b < x; b += 2) {
      const w = l[b] - this.imageAnchorX_, A = l[b + 1] - this.imageAnchorY_;
      if (y !== 0 || this.imageScale_[0] != 1 || this.imageScale_[1] != 1) {
        const C = w + this.imageAnchorX_, L = A + this.imageAnchorY_;
        fd(
          h,
          C,
          L,
          1,
          1,
          y,
          -C,
          -L
        ), f.save(), f.transform.apply(f, h), f.translate(C, L), f.scale(this.imageScale_[0], this.imageScale_[1]), f.drawImage(
          this.image_,
          this.imageOriginX_,
          this.imageOriginY_,
          this.imageWidth_,
          this.imageHeight_,
          -this.imageAnchorX_,
          -this.imageAnchorY_,
          this.imageWidth_,
          this.imageHeight_
        ), f.restore();
      } else
        f.drawImage(
          this.image_,
          this.imageOriginX_,
          this.imageOriginY_,
          this.imageWidth_,
          this.imageHeight_,
          w,
          A,
          this.imageWidth_,
          this.imageHeight_
        );
    }
    this.imageOpacity_ != 1 && (f.globalAlpha = p);
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {number} end End.
   * @param {number} stride Stride.
   * @private
   */
  drawText_(t, e, a, s) {
    if (!this.textState_ || this.text_ === "")
      return;
    this.textFillState_ && this.setContextFillState_(this.textFillState_), this.textStrokeState_ && this.setContextStrokeState_(this.textStrokeState_), this.setContextTextState_(this.textState_);
    const l = v0(
      t,
      e,
      a,
      s,
      this.transform_,
      this.pixelCoordinates_
    ), f = this.context_;
    let h = this.textRotation_;
    for (this.transformRotation_ === 0 && (h -= this.viewRotation_), this.textRotateWithView_ && (h += this.viewRotation_); e < a; e += s) {
      const p = l[e] + this.textOffsetX_, y = l[e + 1] + this.textOffsetY_;
      h !== 0 || this.textScale_[0] != 1 || this.textScale_[1] != 1 ? (f.save(), f.translate(p - this.textOffsetX_, y - this.textOffsetY_), f.rotate(h), f.translate(this.textOffsetX_, this.textOffsetY_), f.scale(this.textScale_[0], this.textScale_[1]), this.textStrokeState_ && f.strokeText(this.text_, 0, 0), this.textFillState_ && f.fillText(this.text_, 0, 0), f.restore()) : (this.textStrokeState_ && f.strokeText(this.text_, p, y), this.textFillState_ && f.fillText(this.text_, p, y));
    }
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {number} end End.
   * @param {number} stride Stride.
   * @param {boolean} close Close.
   * @private
   * @return {number} end End.
   */
  moveToLineTo_(t, e, a, s, l) {
    const f = this.context_, h = v0(
      t,
      e,
      a,
      s,
      this.transform_,
      this.pixelCoordinates_
    );
    f.moveTo(h[0], h[1]);
    let p = h.length;
    l && (p -= 2);
    for (let y = 2; y < p; y += 2)
      f.lineTo(h[y], h[y + 1]);
    return l && f.closePath(), a;
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {Array<number>} ends Ends.
   * @param {number} stride Stride.
   * @private
   * @return {number} End.
   */
  drawRings_(t, e, a, s) {
    for (let l = 0, f = a.length; l < f; ++l)
      e = this.moveToLineTo_(
        t,
        e,
        a[l],
        s,
        !0
      );
    return e;
  }
  /**
   * Render a circle geometry into the canvas.  Rendering is immediate and uses
   * the current fill and stroke styles.
   *
   * @param {import("../../geom/Circle.js").default} geometry Circle geometry.
   * @api
   * @override
   */
  drawCircle(t) {
    if (this.squaredTolerance_ && (t = /** @type {import("../../geom/Circle.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    )), !!Co(this.extent_, t.getExtent())) {
      if (this.fillState_ || this.strokeState_) {
        this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
        const e = j$(
          t,
          this.transform_,
          this.pixelCoordinates_
        ), a = e[2] - e[0], s = e[3] - e[1], l = Math.sqrt(a * a + s * s), f = this.context_;
        f.beginPath(), f.arc(
          e[0],
          e[1],
          l,
          0,
          2 * Math.PI
        ), this.fillState_ && f.fill(), this.strokeState_ && f.stroke();
      }
      this.text_ !== "" && this.drawText_(t.getCenter(), 0, 2, 2);
    }
  }
  /**
   * Set the rendering style.  Note that since this is an immediate rendering API,
   * any `zIndex` on the provided style will be ignored.
   *
   * @param {import("../../style/Style.js").default} style The rendering style.
   * @api
   * @override
   */
  setStyle(t) {
    this.setFillStrokeStyle(t.getFill(), t.getStroke()), this.setImageStyle(t.getImage()), this.setTextStyle(t.getText());
  }
  /**
   * @param {import("../../transform.js").Transform} transform Transform.
   */
  setTransform(t) {
    this.transform_ = t;
  }
  /**
   * Render a geometry into the canvas.  Call
   * {@link module:ol/render/canvas/Immediate~CanvasImmediateRenderer#setStyle renderer.setStyle()} first to set the rendering style.
   *
   * @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry The geometry to render.
   * @api
   * @override
   */
  drawGeometry(t) {
    switch (t.getType()) {
      case "Point":
        this.drawPoint(
          /** @type {import("../../geom/Point.js").default} */
          t
        );
        break;
      case "LineString":
        this.drawLineString(
          /** @type {import("../../geom/LineString.js").default} */
          t
        );
        break;
      case "Polygon":
        this.drawPolygon(
          /** @type {import("../../geom/Polygon.js").default} */
          t
        );
        break;
      case "MultiPoint":
        this.drawMultiPoint(
          /** @type {import("../../geom/MultiPoint.js").default} */
          t
        );
        break;
      case "MultiLineString":
        this.drawMultiLineString(
          /** @type {import("../../geom/MultiLineString.js").default} */
          t
        );
        break;
      case "MultiPolygon":
        this.drawMultiPolygon(
          /** @type {import("../../geom/MultiPolygon.js").default} */
          t
        );
        break;
      case "GeometryCollection":
        this.drawGeometryCollection(
          /** @type {import("../../geom/GeometryCollection.js").default} */
          t
        );
        break;
      case "Circle":
        this.drawCircle(
          /** @type {import("../../geom/Circle.js").default} */
          t
        );
        break;
    }
  }
  /**
   * Render a feature into the canvas.  Note that any `zIndex` on the provided
   * style will be ignored - features are rendered immediately in the order that
   * this method is called.  If you need `zIndex` support, you should be using an
   * {@link module:ol/layer/Vector~VectorLayer} instead.
   *
   * @param {import("../../Feature.js").default} feature Feature.
   * @param {import("../../style/Style.js").default} style Style.
   * @api
   * @override
   */
  drawFeature(t, e) {
    const a = e.getGeometryFunction()(t);
    a && (this.setStyle(e), this.drawGeometry(a));
  }
  /**
   * Render a GeometryCollection to the canvas.  Rendering is immediate and
   * uses the current styles appropriate for each geometry in the collection.
   *
   * @param {import("../../geom/GeometryCollection.js").default} geometry Geometry collection.
   * @override
   */
  drawGeometryCollection(t) {
    const e = t.getGeometriesArray();
    for (let a = 0, s = e.length; a < s; ++a)
      this.drawGeometry(e[a]);
  }
  /**
   * Render a Point geometry into the canvas.  Rendering is immediate and uses
   * the current style.
   *
   * @param {import("../../geom/Point.js").default|import("../Feature.js").default} geometry Point geometry.
   * @override
   */
  drawPoint(t) {
    this.squaredTolerance_ && (t = /** @type {import("../../geom/Point.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    ));
    const e = t.getFlatCoordinates(), a = t.getStride();
    this.image_ && this.drawImages_(e, 0, e.length, a), this.text_ !== "" && this.drawText_(e, 0, e.length, a);
  }
  /**
   * Render a MultiPoint geometry  into the canvas.  Rendering is immediate and
   * uses the current style.
   *
   * @param {import("../../geom/MultiPoint.js").default|import("../Feature.js").default} geometry MultiPoint geometry.
   * @override
   */
  drawMultiPoint(t) {
    this.squaredTolerance_ && (t = /** @type {import("../../geom/MultiPoint.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    ));
    const e = t.getFlatCoordinates(), a = t.getStride();
    this.image_ && this.drawImages_(e, 0, e.length, a), this.text_ !== "" && this.drawText_(e, 0, e.length, a);
  }
  /**
   * Render a LineString into the canvas.  Rendering is immediate and uses
   * the current style.
   *
   * @param {import("../../geom/LineString.js").default|import("../Feature.js").default} geometry LineString geometry.
   * @override
   */
  drawLineString(t) {
    if (this.squaredTolerance_ && (t = /** @type {import("../../geom/LineString.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    )), !!Co(this.extent_, t.getExtent())) {
      if (this.strokeState_) {
        this.setContextStrokeState_(this.strokeState_);
        const e = this.context_, a = t.getFlatCoordinates();
        e.beginPath(), this.moveToLineTo_(
          a,
          0,
          a.length,
          t.getStride(),
          !1
        ), e.stroke();
      }
      if (this.text_ !== "") {
        const e = t.getFlatMidpoint();
        this.drawText_(e, 0, 2, 2);
      }
    }
  }
  /**
   * Render a MultiLineString geometry into the canvas.  Rendering is immediate
   * and uses the current style.
   *
   * @param {import("../../geom/MultiLineString.js").default|import("../Feature.js").default} geometry MultiLineString geometry.
   * @override
   */
  drawMultiLineString(t) {
    this.squaredTolerance_ && (t = /** @type {import("../../geom/MultiLineString.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    ));
    const e = t.getExtent();
    if (Co(this.extent_, e)) {
      if (this.strokeState_) {
        this.setContextStrokeState_(this.strokeState_);
        const a = this.context_, s = t.getFlatCoordinates();
        let l = 0;
        const f = (
          /** @type {Array<number>} */
          t.getEnds()
        ), h = t.getStride();
        a.beginPath();
        for (let p = 0, y = f.length; p < y; ++p)
          l = this.moveToLineTo_(
            s,
            l,
            f[p],
            h,
            !1
          );
        a.stroke();
      }
      if (this.text_ !== "") {
        const a = t.getFlatMidpoints();
        this.drawText_(a, 0, a.length, 2);
      }
    }
  }
  /**
   * Render a Polygon geometry into the canvas.  Rendering is immediate and uses
   * the current style.
   *
   * @param {import("../../geom/Polygon.js").default|import("../Feature.js").default} geometry Polygon geometry.
   * @override
   */
  drawPolygon(t) {
    if (this.squaredTolerance_ && (t = /** @type {import("../../geom/Polygon.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    )), !!Co(this.extent_, t.getExtent())) {
      if (this.strokeState_ || this.fillState_) {
        this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
        const e = this.context_;
        e.beginPath(), this.drawRings_(
          t.getOrientedFlatCoordinates(),
          0,
          /** @type {Array<number>} */
          t.getEnds(),
          t.getStride()
        ), this.fillState_ && e.fill(), this.strokeState_ && e.stroke();
      }
      if (this.text_ !== "") {
        const e = t.getFlatInteriorPoint();
        this.drawText_(e, 0, 2, 2);
      }
    }
  }
  /**
   * Render MultiPolygon geometry into the canvas.  Rendering is immediate and
   * uses the current style.
   * @param {import("../../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
   * @override
   */
  drawMultiPolygon(t) {
    if (this.squaredTolerance_ && (t = /** @type {import("../../geom/MultiPolygon.js").default} */
    t.simplifyTransformed(
      this.squaredTolerance_,
      this.userTransform_
    )), !!Co(this.extent_, t.getExtent())) {
      if (this.strokeState_ || this.fillState_) {
        this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
        const e = this.context_, a = t.getOrientedFlatCoordinates();
        let s = 0;
        const l = t.getEndss(), f = t.getStride();
        e.beginPath();
        for (let h = 0, p = l.length; h < p; ++h) {
          const y = l[h];
          s = this.drawRings_(a, s, y, f);
        }
        this.fillState_ && e.fill(), this.strokeState_ && e.stroke();
      }
      if (this.text_ !== "") {
        const e = t.getFlatInteriorPoints();
        this.drawText_(e, 0, e.length, 2);
      }
    }
  }
  /**
   * @param {import("../canvas.js").FillState} fillState Fill state.
   * @private
   */
  setContextFillState_(t) {
    const e = this.context_, a = this.contextFillState_;
    a ? a.fillStyle != t.fillStyle && (a.fillStyle = t.fillStyle, e.fillStyle = t.fillStyle) : (e.fillStyle = t.fillStyle, this.contextFillState_ = {
      fillStyle: t.fillStyle
    });
  }
  /**
   * @param {import("../canvas.js").StrokeState} strokeState Stroke state.
   * @private
   */
  setContextStrokeState_(t) {
    const e = this.context_, a = this.contextStrokeState_;
    a ? (a.lineCap != t.lineCap && (a.lineCap = t.lineCap, e.lineCap = t.lineCap), I0(a.lineDash, t.lineDash) || e.setLineDash(
      a.lineDash = t.lineDash
    ), a.lineDashOffset != t.lineDashOffset && (a.lineDashOffset = t.lineDashOffset, e.lineDashOffset = t.lineDashOffset), a.lineJoin != t.lineJoin && (a.lineJoin = t.lineJoin, e.lineJoin = t.lineJoin), a.lineWidth != t.lineWidth && (a.lineWidth = t.lineWidth, e.lineWidth = t.lineWidth), a.miterLimit != t.miterLimit && (a.miterLimit = t.miterLimit, e.miterLimit = t.miterLimit), a.strokeStyle != t.strokeStyle && (a.strokeStyle = t.strokeStyle, e.strokeStyle = t.strokeStyle)) : (e.lineCap = t.lineCap, e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset, e.lineJoin = t.lineJoin, e.lineWidth = t.lineWidth, e.miterLimit = t.miterLimit, e.strokeStyle = t.strokeStyle, this.contextStrokeState_ = {
      lineCap: t.lineCap,
      lineDash: t.lineDash,
      lineDashOffset: t.lineDashOffset,
      lineJoin: t.lineJoin,
      lineWidth: t.lineWidth,
      miterLimit: t.miterLimit,
      strokeStyle: t.strokeStyle
    });
  }
  /**
   * @param {import("../canvas.js").TextState} textState Text state.
   * @private
   */
  setContextTextState_(t) {
    const e = this.context_, a = this.contextTextState_, s = t.textAlign ? t.textAlign : dS;
    a ? (a.font != t.font && (a.font = t.font, e.font = t.font), a.textAlign != s && (a.textAlign = s, e.textAlign = s), a.textBaseline != t.textBaseline && (a.textBaseline = t.textBaseline, e.textBaseline = t.textBaseline)) : (e.font = t.font, e.textAlign = s, e.textBaseline = t.textBaseline, this.contextTextState_ = {
      font: t.font,
      textAlign: s,
      textBaseline: t.textBaseline
    });
  }
  /**
   * Set the fill and stroke style for subsequent draw operations.  To clear
   * either fill or stroke styles, pass null for the appropriate parameter.
   *
   * @param {import("../../style/Fill.js").default} fillStyle Fill style.
   * @param {import("../../style/Stroke.js").default} strokeStyle Stroke style.
   * @override
   */
  setFillStrokeStyle(t, e) {
    if (!t)
      this.fillState_ = null;
    else {
      const a = t.getColor();
      this.fillState_ = {
        fillStyle: rd(
          a || ll
        )
      };
    }
    if (!e)
      this.strokeState_ = null;
    else {
      const a = e.getColor(), s = e.getLineCap(), l = e.getLineDash(), f = e.getLineDashOffset(), h = e.getLineJoin(), p = e.getWidth(), y = e.getMiterLimit(), b = l || lm;
      this.strokeState_ = {
        lineCap: s !== void 0 ? s : hE,
        lineDash: this.pixelRatio_ === 1 ? b : b.map((x) => x * this.pixelRatio_),
        lineDashOffset: (f || um) * this.pixelRatio_,
        lineJoin: h !== void 0 ? h : dE,
        lineWidth: (p !== void 0 ? p : gS) * this.pixelRatio_,
        miterLimit: y !== void 0 ? y : fS,
        strokeStyle: rd(
          a || hS
        )
      };
    }
  }
  /**
   * Set the image style for subsequent draw operations.  Pass null to remove
   * the image style.
   *
   * @param {import("../../style/Image.js").default} imageStyle Image style.
   * @override
   */
  setImageStyle(t) {
    let e;
    if (!t || !(e = t.getSize())) {
      this.image_ = null;
      return;
    }
    const a = t.getPixelRatio(this.pixelRatio_), s = t.getAnchor(), l = t.getOrigin();
    this.image_ = t.getImage(this.pixelRatio_), this.imageAnchorX_ = s[0] * a, this.imageAnchorY_ = s[1] * a, this.imageHeight_ = e[1] * a, this.imageOpacity_ = t.getOpacity(), this.imageOriginX_ = l[0], this.imageOriginY_ = l[1], this.imageRotateWithView_ = t.getRotateWithView(), this.imageRotation_ = t.getRotation();
    const f = t.getScaleArray();
    this.imageScale_ = [
      f[0] * this.pixelRatio_ / a,
      f[1] * this.pixelRatio_ / a
    ], this.imageWidth_ = e[0] * a;
  }
  /**
   * Set the text style for subsequent draw operations.  Pass null to
   * remove the text style.
   *
   * @param {import("../../style/Text.js").default} textStyle Text style.
   * @override
   */
  setTextStyle(t) {
    if (!t)
      this.text_ = "";
    else {
      const e = t.getFill();
      if (!e)
        this.textFillState_ = null;
      else {
        const A = e.getColor();
        this.textFillState_ = {
          fillStyle: rd(
            A || ll
          )
        };
      }
      const a = t.getStroke();
      if (!a)
        this.textStrokeState_ = null;
      else {
        const A = a.getColor(), C = a.getLineCap(), L = a.getLineDash(), N = a.getLineDashOffset(), U = a.getLineJoin(), k = a.getWidth(), H = a.getMiterLimit();
        this.textStrokeState_ = {
          lineCap: C !== void 0 ? C : hE,
          lineDash: L || lm,
          lineDashOffset: N || um,
          lineJoin: U !== void 0 ? U : dE,
          lineWidth: k !== void 0 ? k : gS,
          miterLimit: H !== void 0 ? H : fS,
          strokeStyle: rd(
            A || hS
          )
        };
      }
      const s = t.getFont(), l = t.getOffsetX(), f = t.getOffsetY(), h = t.getRotateWithView(), p = t.getRotation(), y = t.getScaleArray(), b = t.getText(), x = t.getTextAlign(), w = t.getTextBaseline();
      this.textState_ = {
        font: s !== void 0 ? s : Q2,
        textAlign: x !== void 0 ? x : dS,
        textBaseline: w !== void 0 ? w : WT
      }, this.text_ = b !== void 0 ? Array.isArray(b) ? b.reduce((A, C, L) => A += L % 2 ? " " : C, "") : b : "", this.textOffsetX_ = l !== void 0 ? this.pixelRatio_ * l : 0, this.textOffsetY_ = f !== void 0 ? this.pixelRatio_ * f : 0, this.textRotateWithView_ = h !== void 0 ? h : !1, this.textRotation_ = p !== void 0 ? p : 0, this.textScale_ = [
        this.pixelRatio_ * y[0],
        this.pixelRatio_ * y[1]
      ];
    }
  }
}
const DX = 0.5, e5 = {
  Point: jX,
  LineString: zX,
  Polygon: HX,
  MultiPoint: kX,
  MultiLineString: GX,
  MultiPolygon: UX,
  GeometryCollection: PX,
  Circle: LX
};
function NX(n, t) {
  return parseInt(si(n), 10) - parseInt(si(t), 10);
}
function aL(n, t) {
  const e = n5(n, t);
  return e * e;
}
function n5(n, t) {
  return DX * n / t;
}
function LX(n, t, e, a, s) {
  const l = e.getFill(), f = e.getStroke();
  if (l || f) {
    const p = n.getBuilder(e.getZIndex(), "Circle");
    p.setFillStrokeStyle(l, f), p.drawCircle(t, a, s);
  }
  const h = e.getText();
  if (h && h.getText()) {
    const p = n.getBuilder(e.getZIndex(), "Text");
    p.setTextStyle(h), p.drawText(t, a);
  }
}
function rL(n, t, e, a, s, l, f, h) {
  const p = [], y = e.getImage();
  if (y) {
    let w = !0;
    const A = y.getImageState();
    A == xe.LOADED || A == xe.ERROR ? w = !1 : A == xe.IDLE && y.load(), w && p.push(y.ready());
  }
  const b = e.getFill();
  b && b.loading() && p.push(b.ready());
  const x = p.length > 0;
  return x && Promise.all(p).then(() => s(null)), IX(
    n,
    t,
    e,
    a,
    l,
    f,
    h
  ), x;
}
function IX(n, t, e, a, s, l, f) {
  const h = e.getGeometryFunction()(t);
  if (!h)
    return;
  const p = h.simplifyTransformed(
    a,
    s
  );
  if (e.getRenderer())
    i5(n, p, e, t, f);
  else {
    const b = e5[p.getType()];
    b(
      n,
      p,
      e,
      t,
      f,
      l
    );
  }
}
function i5(n, t, e, a, s) {
  if (t.getType() == "GeometryCollection") {
    const f = (
      /** @type {import("../geom/GeometryCollection.js").default} */
      t.getGeometries()
    );
    for (let h = 0, p = f.length; h < p; ++h)
      i5(n, f[h], e, a, s);
    return;
  }
  n.getBuilder(e.getZIndex(), "Default").drawCustom(
    /** @type {import("../geom/SimpleGeometry.js").default} */
    t,
    a,
    e.getRenderer(),
    e.getHitDetectionRenderer(),
    s
  );
}
function PX(n, t, e, a, s, l) {
  const f = t.getGeometriesArray();
  let h, p;
  for (h = 0, p = f.length; h < p; ++h) {
    const y = e5[f[h].getType()];
    y(
      n,
      f[h],
      e,
      a,
      s,
      l
    );
  }
}
function zX(n, t, e, a, s) {
  const l = e.getStroke();
  if (l) {
    const h = n.getBuilder(
      e.getZIndex(),
      "LineString"
    );
    h.setFillStrokeStyle(null, l), h.drawLineString(t, a, s);
  }
  const f = e.getText();
  if (f && f.getText()) {
    const h = n.getBuilder(e.getZIndex(), "Text");
    h.setTextStyle(f), h.drawText(t, a, s);
  }
}
function GX(n, t, e, a, s) {
  const l = e.getStroke();
  if (l) {
    const h = n.getBuilder(
      e.getZIndex(),
      "LineString"
    );
    h.setFillStrokeStyle(null, l), h.drawMultiLineString(t, a, s);
  }
  const f = e.getText();
  if (f && f.getText()) {
    const h = n.getBuilder(e.getZIndex(), "Text");
    h.setTextStyle(f), h.drawText(t, a, s);
  }
}
function UX(n, t, e, a, s) {
  const l = e.getFill(), f = e.getStroke();
  if (f || l) {
    const p = n.getBuilder(e.getZIndex(), "Polygon");
    p.setFillStrokeStyle(l, f), p.drawMultiPolygon(t, a, s);
  }
  const h = e.getText();
  if (h && h.getText()) {
    const p = n.getBuilder(e.getZIndex(), "Text");
    p.setTextStyle(h), p.drawText(t, a, s);
  }
}
function jX(n, t, e, a, s, l) {
  const f = e.getImage(), h = e.getText(), p = h && h.getText(), y = l && f && p ? {} : void 0;
  if (f) {
    if (f.getImageState() != xe.LOADED)
      return;
    const b = n.getBuilder(e.getZIndex(), "Image");
    b.setImageStyle(f, y), b.drawPoint(t, a, s);
  }
  if (p) {
    const b = n.getBuilder(e.getZIndex(), "Text");
    b.setTextStyle(h, y), b.drawText(t, a, s);
  }
}
function kX(n, t, e, a, s, l) {
  const f = e.getImage(), h = f && f.getOpacity() !== 0, p = e.getText(), y = p && p.getText(), b = l && h && y ? {} : void 0;
  if (h) {
    if (f.getImageState() != xe.LOADED)
      return;
    const x = n.getBuilder(e.getZIndex(), "Image");
    x.setImageStyle(f, b), x.drawMultiPoint(t, a, s);
  }
  if (y) {
    const x = n.getBuilder(e.getZIndex(), "Text");
    x.setTextStyle(p, b), x.drawText(t, a, s);
  }
}
function HX(n, t, e, a, s) {
  const l = e.getFill(), f = e.getStroke();
  if (l || f) {
    const p = n.getBuilder(e.getZIndex(), "Polygon");
    p.setFillStrokeStyle(l, f), p.drawPolygon(t, a, s);
  }
  const h = e.getText();
  if (h && h.getText()) {
    const p = n.getBuilder(e.getZIndex(), "Text");
    p.setTextStyle(h), p.drawText(t, a, s);
  }
}
let BX = !1;
function qX(n, t, e, a, s, l, f) {
  const h = new XMLHttpRequest();
  h.open(
    "GET",
    typeof n == "function" ? n(e, a, s) : n,
    !0
  ), t.getType() == "arraybuffer" && (h.responseType = "arraybuffer"), h.withCredentials = BX, h.onload = function(p) {
    if (!h.status || h.status >= 200 && h.status < 300) {
      const y = t.getType();
      try {
        let b;
        y == "text" || y == "json" ? b = h.responseText : y == "xml" ? b = h.responseXML || h.responseText : y == "arraybuffer" && (b = /** @type {ArrayBuffer} */
        h.response), b ? l(
          /** @type {Array<FeatureType>} */
          t.readFeatures(b, {
            extent: e,
            featureProjection: s
          }),
          t.readProjection(b)
        ) : f();
      } catch {
        f();
      }
    } else
      f();
  }, h.onerror = f, h.send();
}
function sL(n, t) {
  return function(e, a, s, l, f) {
    qX(
      n,
      t,
      e,
      a,
      s,
      /**
       * @param {Array<FeatureType>} features The loaded features.
       * @param {import("./proj/Projection.js").default} dataProjection Data
       * projection.
       */
      (h, p) => {
        this.addFeatures(h), l !== void 0 && l(h);
      },
      () => {
        this.changed(), f !== void 0 && f();
      }
    );
  };
}
function VX(n, t) {
  return [[-1 / 0, -1 / 0, 1 / 0, 1 / 0]];
}
function a5(n, t, e, a) {
  const s = [];
  let l = uu();
  for (let f = 0, h = e.length; f < h; ++f) {
    const p = e[f];
    l = sC(
      n,
      t,
      p[0],
      a
    ), s.push((l[0] + l[2]) / 2, (l[1] + l[3]) / 2), t = p[p.length - 1];
  }
  return s;
}
class cO extends US {
  /**
   * @param {Array<import("../coordinate.js").Coordinate>|Array<number>} coordinates Coordinates.
   *     For internal use, flat coordinates in combination with `layout` are also accepted.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   */
  constructor(t, e) {
    super(), e && !Array.isArray(t[0]) ? this.setFlatCoordinates(
      e,
      /** @type {Array<number>} */
      t
    ) : this.setCoordinates(
      /** @type {Array<import("../coordinate.js").Coordinate>} */
      t,
      e
    );
  }
  /**
   * Append the passed point to this multipoint.
   * @param {Point} point Point.
   * @api
   */
  appendPoint(t) {
    uE(this.flatCoordinates, t.getFlatCoordinates()), this.changed();
  }
  /**
   * Make a complete copy of the geometry.
   * @return {!MultiPoint} Clone.
   * @api
   * @override
   */
  clone() {
    const t = new cO(
      this.flatCoordinates.slice(),
      this.layout
    );
    return t.applyProperties(this), t;
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   * @override
   */
  closestPointXY(t, e, a, s) {
    if (s < ow(this.getExtent(), t, e))
      return s;
    const l = this.flatCoordinates, f = this.stride;
    for (let h = 0, p = l.length; h < p; h += f) {
      const y = T_(
        t,
        e,
        l[h],
        l[h + 1]
      );
      if (y < s) {
        s = y;
        for (let b = 0; b < f; ++b)
          a[b] = l[h + b];
        a.length = f;
      }
    }
    return s;
  }
  /**
   * Return the coordinates of the multipoint.
   * @return {Array<import("../coordinate.js").Coordinate>} Coordinates.
   * @api
   * @override
   */
  getCoordinates() {
    return v_(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride
    );
  }
  /**
   * Return the point at the specified index.
   * @param {number} index Index.
   * @return {Point} Point.
   * @api
   */
  getPoint(t) {
    const e = this.flatCoordinates.length / this.stride;
    return t < 0 || e <= t ? null : new cE(
      this.flatCoordinates.slice(
        t * this.stride,
        (t + 1) * this.stride
      ),
      this.layout
    );
  }
  /**
   * Return the points of this multipoint.
   * @return {Array<Point>} Points.
   * @api
   */
  getPoints() {
    const t = this.flatCoordinates, e = this.layout, a = this.stride, s = [];
    for (let l = 0, f = t.length; l < f; l += a) {
      const h = new cE(t.slice(l, l + a), e);
      s.push(h);
    }
    return s;
  }
  /**
   * Get the type of this geometry.
   * @return {import("./Geometry.js").Type} Geometry type.
   * @api
   * @override
   */
  getType() {
    return "MultiPoint";
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   * @api
   * @override
   */
  intersectsExtent(t) {
    const e = this.flatCoordinates, a = this.stride;
    for (let s = 0, l = e.length; s < l; s += a) {
      const f = e[s], h = e[s + 1];
      if (rC(t, f, h))
        return !0;
    }
    return !1;
  }
  /**
   * Set the coordinates of the multipoint.
   * @param {!Array<import("../coordinate.js").Coordinate>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @api
   * @override
   */
  setCoordinates(t, e) {
    this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = WC(
      this.flatCoordinates,
      0,
      t,
      this.stride
    ), this.changed();
  }
}
class QT extends US {
  /**
   * @param {Array<Array<Array<import("../coordinate.js").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.
   *     For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @param {Array<Array<number>>} [endss] Array of ends for internal use with flat coordinates.
   */
  constructor(t, e, a) {
    if (super(), this.endss_ = [], this.flatInteriorPointsRevision_ = -1, this.flatInteriorPoints_ = null, this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, this.orientedRevision_ = -1, this.orientedFlatCoordinates_ = null, !a && !Array.isArray(t[0])) {
      const s = (
        /** @type {Array<Polygon>} */
        t
      ), l = [], f = [];
      for (let h = 0, p = s.length; h < p; ++h) {
        const y = s[h], b = l.length, x = y.getEnds();
        for (let w = 0, A = x.length; w < A; ++w)
          x[w] += b;
        uE(l, y.getFlatCoordinates()), f.push(x);
      }
      e = s.length === 0 ? this.getLayout() : s[0].getLayout(), t = l, a = f;
    }
    e !== void 0 && a ? (this.setFlatCoordinates(
      e,
      /** @type {Array<number>} */
      t
    ), this.endss_ = a) : this.setCoordinates(
      /** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */
      t,
      e
    );
  }
  /**
   * Append the passed polygon to this multipolygon.
   * @param {Polygon} polygon Polygon.
   * @api
   */
  appendPolygon(t) {
    let e;
    if (!this.flatCoordinates)
      this.flatCoordinates = t.getFlatCoordinates().slice(), e = t.getEnds().slice(), this.endss_.push();
    else {
      const a = this.flatCoordinates.length;
      uE(this.flatCoordinates, t.getFlatCoordinates()), e = t.getEnds().slice();
      for (let s = 0, l = e.length; s < l; ++s)
        e[s] += a;
    }
    this.endss_.push(e), this.changed();
  }
  /**
   * Make a complete copy of the geometry.
   * @return {!MultiPolygon} Clone.
   * @api
   * @override
   */
  clone() {
    const t = this.endss_.length, e = new Array(t);
    for (let s = 0; s < t; ++s)
      e[s] = this.endss_[s].slice();
    const a = new QT(
      this.flatCoordinates.slice(),
      this.layout,
      e
    );
    return a.applyProperties(this), a;
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
   * @param {number} minSquaredDistance Minimum squared distance.
   * @return {number} Minimum squared distance.
   * @override
   */
  closestPointXY(t, e, a, s) {
    return s < ow(this.getExtent(), t, e) ? s : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(
      H$(
        this.flatCoordinates,
        0,
        this.endss_,
        this.stride,
        0
      )
    ), this.maxDeltaRevision_ = this.getRevision()), B$(
      this.getOrientedFlatCoordinates(),
      0,
      this.endss_,
      this.stride,
      this.maxDelta_,
      !0,
      t,
      e,
      a,
      s
    ));
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   * @return {boolean} Contains (x, y).
   * @override
   */
  containsXY(t, e) {
    return K$(
      this.getOrientedFlatCoordinates(),
      0,
      this.endss_,
      this.stride,
      t,
      e
    );
  }
  /**
   * Return the area of the multipolygon on projected plane.
   * @return {number} Area (on projected plane).
   * @api
   */
  getArea() {
    return k$(
      this.getOrientedFlatCoordinates(),
      0,
      this.endss_,
      this.stride
    );
  }
  /**
   * Get the coordinate array for this geometry.  This array has the structure
   * of a GeoJSON coordinate array for multi-polygons.
   *
   * @param {boolean} [right] Orient coordinates according to the right-hand
   *     rule (counter-clockwise for exterior and clockwise for interior rings).
   *     If `false`, coordinates will be oriented according to the left-hand rule
   *     (clockwise for exterior and counter-clockwise for interior rings).
   *     By default, coordinate orientation will depend on how the geometry was
   *     constructed.
   * @return {Array<Array<Array<import("../coordinate.js").Coordinate>>>} Coordinates.
   * @api
   * @override
   */
  getCoordinates(t) {
    let e;
    return t !== void 0 ? (e = this.getOrientedFlatCoordinates().slice(), KN(
      e,
      0,
      this.endss_,
      this.stride,
      t
    )) : e = this.flatCoordinates, VM(
      e,
      0,
      this.endss_,
      this.stride
    );
  }
  /**
   * @return {Array<Array<number>>} Endss.
   */
  getEndss() {
    return this.endss_;
  }
  /**
   * @return {Array<number>} Flat interior points.
   */
  getFlatInteriorPoints() {
    if (this.flatInteriorPointsRevision_ != this.getRevision()) {
      const t = a5(
        this.flatCoordinates,
        0,
        this.endss_,
        this.stride
      );
      this.flatInteriorPoints_ = G2(
        this.getOrientedFlatCoordinates(),
        0,
        this.endss_,
        this.stride,
        t
      ), this.flatInteriorPointsRevision_ = this.getRevision();
    }
    return (
      /** @type {Array<number>} */
      this.flatInteriorPoints_
    );
  }
  /**
   * Return the interior points as {@link module:ol/geom/MultiPoint~MultiPoint multipoint}.
   * @return {MultiPoint} Interior points as XYM coordinates, where M is
   * the length of the horizontal intersection that the point belongs to.
   * @api
   */
  getInteriorPoints() {
    return new cO(this.getFlatInteriorPoints().slice(), "XYM");
  }
  /**
   * @return {Array<number>} Oriented flat coordinates.
   */
  getOrientedFlatCoordinates() {
    if (this.orientedRevision_ != this.getRevision()) {
      const t = this.flatCoordinates;
      J$(t, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = KN(
        this.orientedFlatCoordinates_,
        0,
        this.endss_,
        this.stride
      )), this.orientedRevision_ = this.getRevision();
    }
    return (
      /** @type {Array<number>} */
      this.orientedFlatCoordinates_
    );
  }
  /**
   * @param {number} squaredTolerance Squared tolerance.
   * @return {MultiPolygon} Simplified MultiPolygon.
   * @protected
   * @override
   */
  getSimplifiedGeometryInternal(t) {
    const e = [], a = [];
    return e.length = $$(
      this.flatCoordinates,
      0,
      this.endss_,
      this.stride,
      Math.sqrt(t),
      e,
      0,
      a
    ), new QT(e, "XY", a);
  }
  /**
   * Return the polygon at the specified index.
   * @param {number} index Index.
   * @return {Polygon} Polygon.
   * @api
   */
  getPolygon(t) {
    if (t < 0 || this.endss_.length <= t)
      return null;
    let e;
    if (t === 0)
      e = 0;
    else {
      const l = this.endss_[t - 1];
      e = l[l.length - 1];
    }
    const a = this.endss_[t].slice(), s = a[a.length - 1];
    if (e !== 0)
      for (let l = 0, f = a.length; l < f; ++l)
        a[l] -= e;
    return new B_(
      this.flatCoordinates.slice(e, s),
      this.layout,
      a
    );
  }
  /**
   * Return the polygons of this multipolygon.
   * @return {Array<Polygon>} Polygons.
   * @api
   */
  getPolygons() {
    const t = this.layout, e = this.flatCoordinates, a = this.endss_, s = [];
    let l = 0;
    for (let f = 0, h = a.length; f < h; ++f) {
      const p = a[f].slice(), y = p[p.length - 1];
      if (l !== 0)
        for (let x = 0, w = p.length; x < w; ++x)
          p[x] -= l;
      const b = new B_(
        e.slice(l, y),
        t,
        p
      );
      s.push(b), l = y;
    }
    return s;
  }
  /**
   * Get the type of this geometry.
   * @return {import("./Geometry.js").Type} Geometry type.
   * @api
   * @override
   */
  getType() {
    return "MultiPolygon";
  }
  /**
   * Test if the geometry and the passed extent intersect.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {boolean} `true` if the geometry and the extent intersect.
   * @api
   * @override
   */
  intersectsExtent(t) {
    return W$(
      this.getOrientedFlatCoordinates(),
      0,
      this.endss_,
      this.stride,
      t
    );
  }
  /**
   * Set the coordinates of the multipolygon.
   * @param {!Array<Array<Array<import("../coordinate.js").Coordinate>>>} coordinates Coordinates.
   * @param {import("./Geometry.js").GeometryLayout} [layout] Layout.
   * @api
   * @override
   */
  setCoordinates(t, e) {
    this.setLayout(e, t, 3), this.flatCoordinates || (this.flatCoordinates = []);
    const a = V$(
      this.flatCoordinates,
      0,
      t,
      this.stride,
      this.endss_
    );
    if (a.length === 0)
      this.flatCoordinates.length = 0;
    else {
      const s = a[a.length - 1];
      this.flatCoordinates.length = s.length === 0 ? 0 : s[s.length - 1];
    }
    this.changed();
  }
}
const oL = Pf();
class Of {
  /**
   * @param {Type} type Geometry type.
   * @param {Array<number>} flatCoordinates Flat coordinates. These always need
   *     to be right-handed for polygons.
   * @param {Array<number>} ends Ends.
   * @param {number} stride Stride.
   * @param {Object<string, *>} properties Properties.
   * @param {number|string|undefined} id Feature id.
   */
  constructor(t, e, a, s, l, f) {
    this.styleFunction, this.extent_, this.id_ = f, this.type_ = t, this.flatCoordinates_ = e, this.flatInteriorPoints_ = null, this.flatMidpoints_ = null, this.ends_ = a || null, this.properties_ = l, this.squaredTolerance_, this.stride_ = s, this.simplifiedGeometry_;
  }
  /**
   * Get a feature property by its key.
   * @param {string} key Key
   * @return {*} Value for the requested key.
   * @api
   */
  get(t) {
    return this.properties_[t];
  }
  /**
   * Get the extent of this feature's geometry.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getExtent() {
    return this.extent_ || (this.extent_ = this.type_ === "Point" ? JL(this.flatCoordinates_) : sC(
      this.flatCoordinates_,
      0,
      this.flatCoordinates_.length,
      2
    )), this.extent_;
  }
  /**
   * @return {Array<number>} Flat interior points.
   */
  getFlatInteriorPoint() {
    if (!this.flatInteriorPoints_) {
      const t = fm(this.getExtent());
      this.flatInteriorPoints_ = eO(
        this.flatCoordinates_,
        0,
        this.ends_,
        2,
        t,
        0
      );
    }
    return this.flatInteriorPoints_;
  }
  /**
   * @return {Array<number>} Flat interior points.
   */
  getFlatInteriorPoints() {
    if (!this.flatInteriorPoints_) {
      const t = tX(this.flatCoordinates_, this.ends_), e = a5(this.flatCoordinates_, 0, t, 2);
      this.flatInteriorPoints_ = G2(
        this.flatCoordinates_,
        0,
        t,
        2,
        e
      );
    }
    return this.flatInteriorPoints_;
  }
  /**
   * @return {Array<number>} Flat midpoint.
   */
  getFlatMidpoint() {
    return this.flatMidpoints_ || (this.flatMidpoints_ = WN(
      this.flatCoordinates_,
      0,
      this.flatCoordinates_.length,
      2,
      0.5
    )), this.flatMidpoints_;
  }
  /**
   * @return {Array<number>} Flat midpoints.
   */
  getFlatMidpoints() {
    if (!this.flatMidpoints_) {
      this.flatMidpoints_ = [];
      const t = this.flatCoordinates_;
      let e = 0;
      const a = (
        /** @type {Array<number>} */
        this.ends_
      );
      for (let s = 0, l = a.length; s < l; ++s) {
        const f = a[s], h = WN(t, e, f, 2, 0.5);
        uE(this.flatMidpoints_, h), e = f;
      }
    }
    return this.flatMidpoints_;
  }
  /**
   * Get the feature identifier.  This is a stable identifier for the feature and
   * is set when reading data from a remote source.
   * @return {number|string|undefined} Id.
   * @api
   */
  getId() {
    return this.id_;
  }
  /**
   * @return {Array<number>} Flat coordinates.
   */
  getOrientedFlatCoordinates() {
    return this.flatCoordinates_;
  }
  /**
   * For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when
   * determining the geometry type in style function (see {@link #getType}).
   * @return {RenderFeature} Feature.
   * @api
   */
  getGeometry() {
    return this;
  }
  /**
   * @param {number} squaredTolerance Squared tolerance.
   * @return {RenderFeature} Simplified geometry.
   */
  getSimplifiedGeometry(t) {
    return this;
  }
  /**
   * Get a transformed and simplified version of the geometry.
   * @param {number} squaredTolerance Squared tolerance.
   * @param {import("../proj.js").TransformFunction} [transform] Optional transform function.
   * @return {RenderFeature} Simplified geometry.
   */
  simplifyTransformed(t, e) {
    return this;
  }
  /**
   * Get the feature properties.
   * @return {Object<string, *>} Feature properties.
   * @api
   */
  getProperties() {
    return this.properties_;
  }
  /**
   * Get an object of all property names and values.  This has the same behavior as getProperties,
   * but is here to conform with the {@link module:ol/Feature~Feature} interface.
   * @return {Object<string, *>?} Object.
   */
  getPropertiesInternal() {
    return this.properties_;
  }
  /**
   * @return {number} Stride.
   */
  getStride() {
    return this.stride_;
  }
  /**
   * @return {import('../style/Style.js').StyleFunction|undefined} Style
   */
  getStyleFunction() {
    return this.styleFunction;
  }
  /**
   * Get the type of this feature's geometry.
   * @return {Type} Geometry type.
   * @api
   */
  getType() {
    return this.type_;
  }
  /**
   * Transform geometry coordinates from tile pixel space to projected.
   *
   * @param {import("../proj.js").ProjectionLike} projection The data projection
   */
  transform(t) {
    t = $i(t);
    const e = t.getExtent(), a = t.getWorldExtent();
    if (e && a) {
      const s = Ir(a) / Ir(e);
      fd(
        oL,
        a[0],
        a[3],
        s,
        -s,
        0,
        0,
        0
      ), v0(
        this.flatCoordinates_,
        0,
        this.flatCoordinates_.length,
        2,
        oL,
        this.flatCoordinates_
      );
    }
  }
  /**
   * Apply a transform function to the coordinates of the geometry.
   * The geometry is modified in place.
   * If you do not want the geometry modified in place, first `clone()` it and
   * then use this function on the clone.
   * @param {import("../proj.js").TransformFunction} transformFn Transform function.
   */
  applyTransform(t) {
    t(this.flatCoordinates_, this.flatCoordinates_, this.stride_);
  }
  /**
   * @return {RenderFeature} A cloned render feature.
   */
  clone() {
    return new Of(
      this.type_,
      this.flatCoordinates_.slice(),
      this.ends_?.slice(),
      this.stride_,
      Object.assign({}, this.properties_),
      this.id_
    );
  }
  /**
   * @return {Array<number>|null} Ends.
   */
  getEnds() {
    return this.ends_;
  }
  /**
   * Add transform and resolution based geometry simplification to this instance.
   * @return {RenderFeature} This render feature.
   */
  enableSimplifyTransformed() {
    return this.simplifyTransformed = m2((t, e) => {
      if (t === this.squaredTolerance_)
        return this.simplifiedGeometry_;
      this.simplifiedGeometry_ = this.clone(), e && this.simplifiedGeometry_.applyTransform(e);
      const a = this.simplifiedGeometry_.getFlatCoordinates();
      let s;
      switch (this.type_) {
        case "LineString":
          a.length = QC(
            a,
            0,
            this.simplifiedGeometry_.flatCoordinates_.length,
            this.simplifiedGeometry_.stride_,
            t,
            a,
            0
          ), s = [a.length];
          break;
        case "MultiLineString":
          s = [], a.length = Y$(
            a,
            0,
            this.simplifiedGeometry_.ends_,
            this.simplifiedGeometry_.stride_,
            t,
            a,
            0,
            s
          );
          break;
        case "Polygon":
          s = [], a.length = JC(
            a,
            0,
            this.simplifiedGeometry_.ends_,
            this.simplifiedGeometry_.stride_,
            Math.sqrt(t),
            a,
            0,
            s
          );
          break;
      }
      return s && (this.simplifiedGeometry_ = new Of(
        this.type_,
        a,
        s,
        2,
        this.properties_,
        this.id_
      )), this.squaredTolerance_ = t, this.simplifiedGeometry_;
    }), this;
  }
}
Of.prototype.getFlatCoordinates = Of.prototype.getOrientedFlatCoordinates;
function r5(n, t, e = 0, a = n.length - 1, s = YX) {
  for (; a > e; ) {
    if (a - e > 600) {
      const p = a - e + 1, y = t - e + 1, b = Math.log(p), x = 0.5 * Math.exp(2 * b / 3), w = 0.5 * Math.sqrt(b * x * (p - x) / p) * (y - p / 2 < 0 ? -1 : 1), A = Math.max(e, Math.floor(t - y * x / p + w)), C = Math.min(a, Math.floor(t + (p - y) * x / p + w));
      r5(n, t, A, C, s);
    }
    const l = n[t];
    let f = e, h = a;
    for (xb(n, e, t), s(n[a], l) > 0 && xb(n, e, a); f < h; ) {
      for (xb(n, f, h), f++, h--; s(n[f], l) < 0; ) f++;
      for (; s(n[h], l) > 0; ) h--;
    }
    s(n[e], l) === 0 ? xb(n, e, h) : (h++, xb(n, h, a)), h <= t && (e = h + 1), t <= h && (a = h - 1);
  }
}
function xb(n, t, e) {
  const a = n[t];
  n[t] = n[e], n[e] = a;
}
function YX(n, t) {
  return n < t ? -1 : n > t ? 1 : 0;
}
let s5 = class {
  constructor(t = 9) {
    this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
  }
  all() {
    return this._all(this.data, []);
  }
  search(t) {
    let e = this.data;
    const a = [];
    if (!sT(t, e)) return a;
    const s = this.toBBox, l = [];
    for (; e; ) {
      for (let f = 0; f < e.children.length; f++) {
        const h = e.children[f], p = e.leaf ? s(h) : h;
        sT(t, p) && (e.leaf ? a.push(h) : FA(t, p) ? this._all(h, a) : l.push(h));
      }
      e = l.pop();
    }
    return a;
  }
  collides(t) {
    let e = this.data;
    if (!sT(t, e)) return !1;
    const a = [];
    for (; e; ) {
      for (let s = 0; s < e.children.length; s++) {
        const l = e.children[s], f = e.leaf ? this.toBBox(l) : l;
        if (sT(t, f)) {
          if (e.leaf || FA(t, f)) return !0;
          a.push(l);
        }
      }
      e = a.pop();
    }
    return !1;
  }
  load(t) {
    if (!(t && t.length)) return this;
    if (t.length < this._minEntries) {
      for (let a = 0; a < t.length; a++)
        this.insert(t[a]);
      return this;
    }
    let e = this._build(t.slice(), 0, t.length - 1, 0);
    if (!this.data.children.length)
      this.data = e;
    else if (this.data.height === e.height)
      this._splitRoot(this.data, e);
    else {
      if (this.data.height < e.height) {
        const a = this.data;
        this.data = e, e = a;
      }
      this._insert(e, this.data.height - e.height - 1, !0);
    }
    return this;
  }
  insert(t) {
    return t && this._insert(t, this.data.height - 1), this;
  }
  clear() {
    return this.data = L1([]), this;
  }
  remove(t, e) {
    if (!t) return this;
    let a = this.data;
    const s = this.toBBox(t), l = [], f = [];
    let h, p, y;
    for (; a || l.length; ) {
      if (a || (a = l.pop(), p = l[l.length - 1], h = f.pop(), y = !0), a.leaf) {
        const b = FX(t, a.children, e);
        if (b !== -1)
          return a.children.splice(b, 1), l.push(a), this._condense(l), this;
      }
      !y && !a.leaf && FA(a, s) ? (l.push(a), f.push(h), h = 0, p = a, a = a.children[0]) : p ? (h++, a = p.children[h], y = !1) : a = null;
    }
    return this;
  }
  toBBox(t) {
    return t;
  }
  compareMinX(t, e) {
    return t.minX - e.minX;
  }
  compareMinY(t, e) {
    return t.minY - e.minY;
  }
  toJSON() {
    return this.data;
  }
  fromJSON(t) {
    return this.data = t, this;
  }
  _all(t, e) {
    const a = [];
    for (; t; )
      t.leaf ? e.push(...t.children) : a.push(...t.children), t = a.pop();
    return e;
  }
  _build(t, e, a, s) {
    const l = a - e + 1;
    let f = this._maxEntries, h;
    if (l <= f)
      return h = L1(t.slice(e, a + 1)), S1(h, this.toBBox), h;
    s || (s = Math.ceil(Math.log(l) / Math.log(f)), f = Math.ceil(l / Math.pow(f, s - 1))), h = L1([]), h.leaf = !1, h.height = s;
    const p = Math.ceil(l / f), y = p * Math.ceil(Math.sqrt(f));
    lL(t, e, a, y, this.compareMinX);
    for (let b = e; b <= a; b += y) {
      const x = Math.min(b + y - 1, a);
      lL(t, b, x, p, this.compareMinY);
      for (let w = b; w <= x; w += p) {
        const A = Math.min(w + p - 1, x);
        h.children.push(this._build(t, w, A, s - 1));
      }
    }
    return S1(h, this.toBBox), h;
  }
  _chooseSubtree(t, e, a, s) {
    for (; s.push(e), !(e.leaf || s.length - 1 === a); ) {
      let l = 1 / 0, f = 1 / 0, h;
      for (let p = 0; p < e.children.length; p++) {
        const y = e.children[p], b = YA(y), x = KX(t, y) - b;
        x < f ? (f = x, l = b < l ? b : l, h = y) : x === f && b < l && (l = b, h = y);
      }
      e = h || e.children[0];
    }
    return e;
  }
  _insert(t, e, a) {
    const s = a ? t : this.toBBox(t), l = [], f = this._chooseSubtree(s, this.data, e, l);
    for (f.children.push(t), Lb(f, s); e >= 0 && l[e].children.length > this._maxEntries; )
      this._split(l, e), e--;
    this._adjustParentBBoxes(s, l, e);
  }
  // split overflowed node into two
  _split(t, e) {
    const a = t[e], s = a.children.length, l = this._minEntries;
    this._chooseSplitAxis(a, l, s);
    const f = this._chooseSplitIndex(a, l, s), h = L1(a.children.splice(f, a.children.length - f));
    h.height = a.height, h.leaf = a.leaf, S1(a, this.toBBox), S1(h, this.toBBox), e ? t[e - 1].children.push(h) : this._splitRoot(a, h);
  }
  _splitRoot(t, e) {
    this.data = L1([t, e]), this.data.height = t.height + 1, this.data.leaf = !1, S1(this.data, this.toBBox);
  }
  _chooseSplitIndex(t, e, a) {
    let s, l = 1 / 0, f = 1 / 0;
    for (let h = e; h <= a - e; h++) {
      const p = Nb(t, 0, h, this.toBBox), y = Nb(t, h, a, this.toBBox), b = ZX(p, y), x = YA(p) + YA(y);
      b < l ? (l = b, s = h, f = x < f ? x : f) : b === l && x < f && (f = x, s = h);
    }
    return s || a - e;
  }
  // sorts node children by the best axis for split
  _chooseSplitAxis(t, e, a) {
    const s = t.leaf ? this.compareMinX : $X, l = t.leaf ? this.compareMinY : XX, f = this._allDistMargin(t, e, a, s), h = this._allDistMargin(t, e, a, l);
    f < h && t.children.sort(s);
  }
  // total margin of all possible split distributions where each node is at least m full
  _allDistMargin(t, e, a, s) {
    t.children.sort(s);
    const l = this.toBBox, f = Nb(t, 0, e, l), h = Nb(t, a - e, a, l);
    let p = rT(f) + rT(h);
    for (let y = e; y < a - e; y++) {
      const b = t.children[y];
      Lb(f, t.leaf ? l(b) : b), p += rT(f);
    }
    for (let y = a - e - 1; y >= e; y--) {
      const b = t.children[y];
      Lb(h, t.leaf ? l(b) : b), p += rT(h);
    }
    return p;
  }
  _adjustParentBBoxes(t, e, a) {
    for (let s = a; s >= 0; s--)
      Lb(e[s], t);
  }
  _condense(t) {
    for (let e = t.length - 1, a; e >= 0; e--)
      t[e].children.length === 0 ? e > 0 ? (a = t[e - 1].children, a.splice(a.indexOf(t[e]), 1)) : this.clear() : S1(t[e], this.toBBox);
  }
};
function FX(n, t, e) {
  if (!e) return t.indexOf(n);
  for (let a = 0; a < t.length; a++)
    if (e(n, t[a])) return a;
  return -1;
}
function S1(n, t) {
  Nb(n, 0, n.children.length, t, n);
}
function Nb(n, t, e, a, s) {
  s || (s = L1(null)), s.minX = 1 / 0, s.minY = 1 / 0, s.maxX = -1 / 0, s.maxY = -1 / 0;
  for (let l = t; l < e; l++) {
    const f = n.children[l];
    Lb(s, n.leaf ? a(f) : f);
  }
  return s;
}
function Lb(n, t) {
  return n.minX = Math.min(n.minX, t.minX), n.minY = Math.min(n.minY, t.minY), n.maxX = Math.max(n.maxX, t.maxX), n.maxY = Math.max(n.maxY, t.maxY), n;
}
function $X(n, t) {
  return n.minX - t.minX;
}
function XX(n, t) {
  return n.minY - t.minY;
}
function YA(n) {
  return (n.maxX - n.minX) * (n.maxY - n.minY);
}
function rT(n) {
  return n.maxX - n.minX + (n.maxY - n.minY);
}
function KX(n, t) {
  return (Math.max(t.maxX, n.maxX) - Math.min(t.minX, n.minX)) * (Math.max(t.maxY, n.maxY) - Math.min(t.minY, n.minY));
}
function ZX(n, t) {
  const e = Math.max(n.minX, t.minX), a = Math.max(n.minY, t.minY), s = Math.min(n.maxX, t.maxX), l = Math.min(n.maxY, t.maxY);
  return Math.max(0, s - e) * Math.max(0, l - a);
}
function FA(n, t) {
  return n.minX <= t.minX && n.minY <= t.minY && t.maxX <= n.maxX && t.maxY <= n.maxY;
}
function sT(n, t) {
  return t.minX <= n.maxX && t.minY <= n.maxY && t.maxX >= n.minX && t.maxY >= n.minY;
}
function L1(n) {
  return {
    children: n,
    height: 1,
    leaf: !0,
    minX: 1 / 0,
    minY: 1 / 0,
    maxX: -1 / 0,
    maxY: -1 / 0
  };
}
function lL(n, t, e, a, s) {
  const l = [t, e];
  for (; l.length; ) {
    if (e = l.pop(), t = l.pop(), e - t <= a) continue;
    const f = t + Math.ceil((e - t) / a / 2) * a;
    r5(n, f, t, e, s), l.push(t, f, f, e);
  }
}
class uL {
  /**
   * @param {number} [maxEntries] Max entries.
   */
  constructor(t) {
    this.rbush_ = new s5(t), this.items_ = {};
  }
  /**
   * Insert a value into the RBush.
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {T} value Value.
   */
  insert(t, e) {
    const a = {
      minX: t[0],
      minY: t[1],
      maxX: t[2],
      maxY: t[3],
      value: e
    };
    this.rbush_.insert(a), this.items_[si(e)] = a;
  }
  /**
   * Bulk-insert values into the RBush.
   * @param {Array<import("../extent.js").Extent>} extents Extents.
   * @param {Array<T>} values Values.
   */
  load(t, e) {
    const a = new Array(e.length);
    for (let s = 0, l = e.length; s < l; s++) {
      const f = t[s], h = e[s], p = {
        minX: f[0],
        minY: f[1],
        maxX: f[2],
        maxY: f[3],
        value: h
      };
      a[s] = p, this.items_[si(h)] = p;
    }
    this.rbush_.load(a);
  }
  /**
   * Remove a value from the RBush.
   * @param {T} value Value.
   * @return {boolean} Removed.
   */
  remove(t) {
    const e = si(t), a = this.items_[e];
    return delete this.items_[e], this.rbush_.remove(a) !== null;
  }
  /**
   * Update the extent of a value in the RBush.
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {T} value Value.
   */
  update(t, e) {
    const a = this.items_[si(e)], s = [a.minX, a.minY, a.maxX, a.maxY];
    K1(s, t) || (this.remove(e), this.insert(t, e));
  }
  /**
   * Return all values in the RBush.
   * @return {Array<T>} All.
   */
  getAll() {
    return this.rbush_.all().map(function(e) {
      return e.value;
    });
  }
  /**
   * Return all values in the given extent.
   * @param {import("../extent.js").Extent} extent Extent.
   * @return {Array<T>} All in extent.
   */
  getInExtent(t) {
    const e = {
      minX: t[0],
      minY: t[1],
      maxX: t[2],
      maxY: t[3]
    };
    return this.rbush_.search(e).map(function(s) {
      return s.value;
    });
  }
  /**
   * Calls a callback function with each value in the tree.
   * If the callback returns a truthy value, this value is returned without
   * checking the rest of the tree.
   * @param {function(T): R} callback Callback.
   * @return {R|undefined} Callback return value.
   * @template R
   */
  forEach(t) {
    return this.forEach_(this.getAll(), t);
  }
  /**
   * Calls a callback function with each value in the provided extent.
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {function(T): R} callback Callback.
   * @return {R|undefined} Callback return value.
   * @template R
   */
  forEachInExtent(t, e) {
    return this.forEach_(this.getInExtent(t), e);
  }
  /**
   * @param {Array<T>} values Values.
   * @param {function(T): R} callback Callback.
   * @return {R|undefined} Callback return value.
   * @template R
   * @private
   */
  forEach_(t, e) {
    let a;
    for (let s = 0, l = t.length; s < l; s++)
      if (a = e(t[s]), a)
        return a;
    return a;
  }
  /**
   * @return {boolean} Is empty.
   */
  isEmpty() {
    return W1(this.items_);
  }
  /**
   * Remove all values from the RBush.
   */
  clear() {
    this.rbush_.clear(), this.items_ = {};
  }
  /**
   * @param {import("../extent.js").Extent} [extent] Extent.
   * @return {import("../extent.js").Extent} Extent.
   */
  getExtent(t) {
    const e = this.rbush_.toJSON();
    return cm(e.minX, e.minY, e.maxX, e.maxY, t);
  }
  /**
   * @param {RBush<T>} rbush R-Tree.
   */
  concat(t) {
    this.rbush_.load(t.rbush_.all());
    for (const e in t.items_)
      this.items_[e] = t.items_[e];
  }
}
class fO extends Uf {
  /**
   * @param {Options} options Source options.
   */
  constructor(t) {
    super(), this.projection = $i(t.projection), this.attributions_ = cL(t.attributions), this.attributionsCollapsible_ = t.attributionsCollapsible ?? !0, this.loading = !1, this.state_ = t.state !== void 0 ? t.state : "ready", this.wrapX_ = t.wrapX !== void 0 ? t.wrapX : !1, this.interpolate_ = !!t.interpolate, this.viewResolver = null, this.viewRejector = null;
    const e = this;
    this.viewPromise_ = new Promise(function(a, s) {
      e.viewResolver = a, e.viewRejector = s;
    });
  }
  /**
   * Get the attribution function for the source.
   * @return {?Attribution} Attribution function.
   * @api
   */
  getAttributions() {
    return this.attributions_;
  }
  /**
   * @return {boolean} Attributions are collapsible.
   * @api
   */
  getAttributionsCollapsible() {
    return this.attributionsCollapsible_;
  }
  /**
   * Get the projection of the source.
   * @return {import("../proj/Projection.js").default|null} Projection.
   * @api
   */
  getProjection() {
    return this.projection;
  }
  /**
   * @param {import("../proj/Projection").default} [projection] Projection.
   * @return {Array<number>|null} Resolutions.
   */
  getResolutions(t) {
    return null;
  }
  /**
   * @return {Promise<import("../View.js").ViewOptions>} A promise for view-related properties.
   */
  getView() {
    return this.viewPromise_;
  }
  /**
   * Get the state of the source, see {@link import("./Source.js").State} for possible states.
   * @return {import("./Source.js").State} State.
   * @api
   */
  getState() {
    return this.state_;
  }
  /**
   * @return {boolean|undefined} Wrap X.
   */
  getWrapX() {
    return this.wrapX_;
  }
  /**
   * @return {boolean} Use linear interpolation when resampling.
   */
  getInterpolate() {
    return this.interpolate_;
  }
  /**
   * Refreshes the source. The source will be cleared, and data from the server will be reloaded.
   * @api
   */
  refresh() {
    this.changed();
  }
  /**
   * Set the attributions of the source.
   * @param {AttributionLike|undefined} attributions Attributions.
   *     Can be passed as `string`, `Array<string>`, {@link module:ol/source/Source~Attribution},
   *     or `undefined`.
   * @api
   */
  setAttributions(t) {
    this.attributions_ = cL(t), this.changed();
  }
  /**
   * Set the state of the source.
   * @param {import("./Source.js").State} state State.
   */
  setState(t) {
    this.state_ = t, this.changed();
  }
}
function cL(n) {
  return n ? typeof n == "function" ? n : (Array.isArray(n) || (n = [n]), (t) => n) : null;
}
const Sc = {
  /**
   * Triggered when a feature is added to the source.
   * @event module:ol/source/Vector.VectorSourceEvent#addfeature
   * @api
   */
  ADDFEATURE: "addfeature",
  /**
   * Triggered when a feature is updated.
   * @event module:ol/source/Vector.VectorSourceEvent#changefeature
   * @api
   */
  CHANGEFEATURE: "changefeature",
  /**
   * Triggered when the clear method is called on the source.
   * @event module:ol/source/Vector.VectorSourceEvent#clear
   * @api
   */
  CLEAR: "clear",
  /**
   * Triggered when a feature is removed from the source.
   * See {@link module:ol/source/Vector~VectorSource#clear source.clear()} for exceptions.
   * @event module:ol/source/Vector.VectorSourceEvent#removefeature
   * @api
   */
  REMOVEFEATURE: "removefeature",
  /**
   * Triggered when features starts loading.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloadstart
   * @api
   */
  FEATURESLOADSTART: "featuresloadstart",
  /**
   * Triggered when features finishes loading.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloadend
   * @api
   */
  FEATURESLOADEND: "featuresloadend",
  /**
   * Triggered if feature loading results in an error.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloaderror
   * @api
   */
  FEATURESLOADERROR: "featuresloaderror"
};
class i0 extends dd {
  /**
   * @param {string} type Type.
   * @param {FeatureType} [feature] Feature.
   * @param {Array<FeatureType>} [features] Features.
   */
  constructor(t, e, a) {
    super(t), this.feature = e, this.features = a;
  }
}
class WX extends fO {
  /**
   * @param {Options<FeatureType>} [options] Vector source options.
   */
  constructor(t) {
    t = t || {}, super({
      attributions: t.attributions,
      interpolate: !0,
      projection: void 0,
      state: "ready",
      wrapX: t.wrapX !== void 0 ? t.wrapX : !0
    }), this.on, this.once, this.un, this.loader_ = uS, this.format_ = t.format || null, this.overlaps_ = t.overlaps === void 0 ? !0 : t.overlaps, this.url_ = t.url, t.loader !== void 0 ? this.loader_ = t.loader : this.url_ !== void 0 && (Ei(this.format_, "`format` must be set when `url` is set"), this.loader_ = sL(this.url_, this.format_)), this.strategy_ = t.strategy !== void 0 ? t.strategy : VX;
    const e = t.useSpatialIndex !== void 0 ? t.useSpatialIndex : !0;
    this.featuresRtree_ = e ? new uL() : null, this.loadedExtentsRtree_ = new uL(), this.loadingExtentsCount_ = 0, this.nullGeometryFeatures_ = {}, this.idIndex_ = {}, this.uidIndex_ = {}, this.featureChangeKeys_ = {}, this.featuresCollection_ = null;
    let a, s;
    Array.isArray(t.features) ? s = t.features : t.features && (a = t.features, s = a.getArray()), !e && a === void 0 && (a = new Nf(s)), s !== void 0 && this.addFeaturesInternal(s), a !== void 0 && this.bindFeaturesCollection_(a);
  }
  /**
   * Add a single feature to the source.  If you want to add a batch of features
   * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures #addFeatures()}
   * instead. A feature will not be added to the source if feature with
   * the same id is already there. The reason for this behavior is to avoid
   * feature duplication when using bbox or tile loading strategies.
   * Note: this also applies if a {@link module:ol/Collection~Collection} is used for features,
   * meaning that if a feature with a duplicate id is added in the collection, it will
   * be removed from it right away.
   * @param {FeatureType} feature Feature to add.
   * @api
   */
  addFeature(t) {
    this.addFeatureInternal(t), this.changed();
  }
  /**
   * Add a feature without firing a `change` event.
   * @param {FeatureType} feature Feature.
   * @protected
   */
  addFeatureInternal(t) {
    const e = si(t);
    if (!this.addToIndex_(e, t)) {
      this.featuresCollection_ && this.featuresCollection_.remove(t);
      return;
    }
    this.setupChangeEvents_(e, t);
    const a = t.getGeometry();
    if (a) {
      const s = a.getExtent();
      this.featuresRtree_ && this.featuresRtree_.insert(s, t);
    } else
      this.nullGeometryFeatures_[e] = t;
    this.dispatchEvent(
      new i0(Sc.ADDFEATURE, t)
    );
  }
  /**
   * @param {string} featureKey Unique identifier for the feature.
   * @param {FeatureType} feature The feature.
   * @private
   */
  setupChangeEvents_(t, e) {
    e instanceof Of || (this.featureChangeKeys_[t] = [
      Fn(e, ln.CHANGE, this.handleFeatureChange_, this),
      Fn(
        e,
        lE.PROPERTYCHANGE,
        this.handleFeatureChange_,
        this
      )
    ]);
  }
  /**
   * @param {string} featureKey Unique identifier for the feature.
   * @param {FeatureType} feature The feature.
   * @return {boolean} The feature is "valid", in the sense that it is also a
   *     candidate for insertion into the Rtree.
   * @private
   */
  addToIndex_(t, e) {
    let a = !0;
    if (e.getId() !== void 0) {
      const s = String(e.getId());
      if (!(s in this.idIndex_))
        this.idIndex_[s] = e;
      else if (e instanceof Of) {
        const l = this.idIndex_[s];
        l instanceof Of ? Array.isArray(l) ? l.push(e) : this.idIndex_[s] = [l, e] : a = !1;
      } else
        a = !1;
    }
    return a && (Ei(
      !(t in this.uidIndex_),
      "The passed `feature` was already added to the source"
    ), this.uidIndex_[t] = e), a;
  }
  /**
   * Add a batch of features to the source.
   * @param {Array<FeatureType>} features Features to add.
   * @api
   */
  addFeatures(t) {
    this.addFeaturesInternal(t), this.changed();
  }
  /**
   * Add features without firing a `change` event.
   * @param {Array<FeatureType>} features Features.
   * @protected
   */
  addFeaturesInternal(t) {
    const e = [], a = [], s = [];
    for (let l = 0, f = t.length; l < f; l++) {
      const h = t[l], p = si(h);
      this.addToIndex_(p, h) && a.push(h);
    }
    for (let l = 0, f = a.length; l < f; l++) {
      const h = a[l], p = si(h);
      this.setupChangeEvents_(p, h);
      const y = h.getGeometry();
      if (y) {
        const b = y.getExtent();
        e.push(b), s.push(h);
      } else
        this.nullGeometryFeatures_[p] = h;
    }
    if (this.featuresRtree_ && this.featuresRtree_.load(e, s), this.hasListener(Sc.ADDFEATURE))
      for (let l = 0, f = a.length; l < f; l++)
        this.dispatchEvent(
          new i0(Sc.ADDFEATURE, a[l])
        );
  }
  /**
   * @param {!Collection<FeatureType>} collection Collection.
   * @private
   */
  bindFeaturesCollection_(t) {
    let e = !1;
    this.addEventListener(
      Sc.ADDFEATURE,
      /**
       * @param {VectorSourceEvent<FeatureType>} evt The vector source event
       */
      function(a) {
        e || (e = !0, t.push(a.feature), e = !1);
      }
    ), this.addEventListener(
      Sc.REMOVEFEATURE,
      /**
       * @param {VectorSourceEvent<FeatureType>} evt The vector source event
       */
      function(a) {
        e || (e = !0, t.remove(a.feature), e = !1);
      }
    ), t.addEventListener(
      ol.ADD,
      /**
       * @param {import("../Collection.js").CollectionEvent<FeatureType>} evt The collection event
       */
      (a) => {
        e || (e = !0, this.addFeature(a.element), e = !1);
      }
    ), t.addEventListener(
      ol.REMOVE,
      /**
       * @param {import("../Collection.js").CollectionEvent<FeatureType>} evt The collection event
       */
      (a) => {
        e || (e = !0, this.removeFeature(a.element), e = !1);
      }
    ), this.featuresCollection_ = t;
  }
  /**
   * Remove all features from the source.
   * @param {boolean} [fast] Skip dispatching of {@link module:ol/source/Vector.VectorSourceEvent#event:removefeature} events.
   * @api
   */
  clear(t) {
    if (t) {
      for (const a in this.featureChangeKeys_)
        this.featureChangeKeys_[a].forEach(Xi);
      this.featuresCollection_ || (this.featureChangeKeys_ = {}, this.idIndex_ = {}, this.uidIndex_ = {});
    } else if (this.featuresRtree_) {
      this.featuresRtree_.forEach((a) => {
        this.removeFeatureInternal(a);
      });
      for (const a in this.nullGeometryFeatures_)
        this.removeFeatureInternal(this.nullGeometryFeatures_[a]);
    }
    this.featuresCollection_ && this.featuresCollection_.clear(), this.featuresRtree_ && this.featuresRtree_.clear(), this.nullGeometryFeatures_ = {};
    const e = new i0(Sc.CLEAR);
    this.dispatchEvent(e), this.changed();
  }
  /**
   * Iterate through all features on the source, calling the provided callback
   * with each one.  If the callback returns any "truthy" value, iteration will
   * stop and the function will return the same value.
   * Note: this function only iterate through the feature that have a defined geometry.
   *
   * @param {function(FeatureType): T} callback Called with each feature
   *     on the source.  Return a truthy value to stop iteration.
   * @return {T|undefined} The return value from the last call to the callback.
   * @template T
   * @api
   */
  forEachFeature(t) {
    if (this.featuresRtree_)
      return this.featuresRtree_.forEach(t);
    this.featuresCollection_ && this.featuresCollection_.forEach(t);
  }
  /**
   * Iterate through all features whose geometries contain the provided
   * coordinate, calling the callback with each feature.  If the callback returns
   * a "truthy" value, iteration will stop and the function will return the same
   * value.
   *
   * For {@link module:ol/render/Feature~RenderFeature} features, the callback will be
   * called for all features.
   *
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {function(FeatureType): T} callback Called with each feature
   *     whose goemetry contains the provided coordinate.
   * @return {T|undefined} The return value from the last call to the callback.
   * @template T
   */
  forEachFeatureAtCoordinateDirect(t, e) {
    const a = [t[0], t[1], t[0], t[1]];
    return this.forEachFeatureInExtent(a, function(s) {
      const l = s.getGeometry();
      if (l instanceof Of || l.intersectsCoordinate(t))
        return e(s);
    });
  }
  /**
   * Iterate through all features whose bounding box intersects the provided
   * extent (note that the feature's geometry may not intersect the extent),
   * calling the callback with each feature.  If the callback returns a "truthy"
   * value, iteration will stop and the function will return the same value.
   *
   * If you are interested in features whose geometry intersects an extent, call
   * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent #forEachFeatureIntersectingExtent()} method instead.
   *
   * When `useSpatialIndex` is set to false, this method will loop through all
   * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature #forEachFeature()}.
   *
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {function(FeatureType): T} callback Called with each feature
   *     whose bounding box intersects the provided extent.
   * @return {T|undefined} The return value from the last call to the callback.
   * @template T
   * @api
   */
  forEachFeatureInExtent(t, e) {
    if (this.featuresRtree_)
      return this.featuresRtree_.forEachInExtent(t, e);
    this.featuresCollection_ && this.featuresCollection_.forEach(e);
  }
  /**
   * Iterate through all features whose geometry intersects the provided extent,
   * calling the callback with each feature.  If the callback returns a "truthy"
   * value, iteration will stop and the function will return the same value.
   *
   * If you only want to test for bounding box intersection, call the
   * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent #forEachFeatureInExtent()} method instead.
   *
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {function(FeatureType): T} callback Called with each feature
   *     whose geometry intersects the provided extent.
   * @return {T|undefined} The return value from the last call to the callback.
   * @template T
   * @api
   */
  forEachFeatureIntersectingExtent(t, e) {
    return this.forEachFeatureInExtent(
      t,
      /**
       * @param {FeatureType} feature Feature.
       * @return {T|undefined} The return value from the last call to the callback.
       */
      function(a) {
        const s = a.getGeometry();
        if (s instanceof Of || s.intersectsExtent(t)) {
          const l = e(a);
          if (l)
            return l;
        }
      }
    );
  }
  /**
   * Get the features collection associated with this source. Will be `null`
   * unless the source was configured with `useSpatialIndex` set to `false`, or
   * with a {@link module:ol/Collection~Collection} as `features`.
   * @return {Collection<FeatureType>|null} The collection of features.
   * @api
   */
  getFeaturesCollection() {
    return this.featuresCollection_;
  }
  /**
   * Get a snapshot of the features currently on the source in random order. The returned array
   * is a copy, the features are references to the features in the source.
   * @return {Array<FeatureType>} Features.
   * @api
   */
  getFeatures() {
    let t;
    return this.featuresCollection_ ? t = this.featuresCollection_.getArray().slice(0) : this.featuresRtree_ && (t = this.featuresRtree_.getAll(), W1(this.nullGeometryFeatures_) || uE(t, Object.values(this.nullGeometryFeatures_))), t;
  }
  /**
   * Get all features whose geometry intersects the provided coordinate.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @return {Array<FeatureType>} Features.
   * @api
   */
  getFeaturesAtCoordinate(t) {
    const e = [];
    return this.forEachFeatureAtCoordinateDirect(t, function(a) {
      e.push(a);
    }), e;
  }
  /**
   * Get all features whose bounding box intersects the provided extent.  Note that this returns an array of
   * all features intersecting the given extent in random order (so it may include
   * features whose geometries do not intersect the extent).
   *
   * When `useSpatialIndex` is set to false, this method will return all
   * features.
   *
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {import("../proj/Projection.js").default} [projection] Include features
   * where `extent` exceeds the x-axis bounds of `projection` and wraps around the world.
   * @return {Array<FeatureType>} Features.
   * @api
   */
  getFeaturesInExtent(t, e) {
    if (this.featuresRtree_) {
      if (!(e && e.canWrapX() && this.getWrapX()))
        return this.featuresRtree_.getInExtent(t);
      const s = a8(t, e);
      return [].concat(
        ...s.map((l) => this.featuresRtree_.getInExtent(l))
      );
    }
    return this.featuresCollection_ ? this.featuresCollection_.getArray().slice(0) : [];
  }
  /**
   * Get the closest feature to the provided coordinate.
   *
   * This method is not available when the source is configured with
   * `useSpatialIndex` set to `false` and the features in this source are of type
   * {@link module:ol/Feature~Feature}.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {function(FeatureType):boolean} [filter] Feature filter function.
   *     The filter function will receive one argument, the {@link module:ol/Feature~Feature feature}
   *     and it should return a boolean value. By default, no filtering is made.
   * @return {FeatureType|null} Closest feature (or `null` if none found).
   * @api
   */
  getClosestFeatureToCoordinate(t, e) {
    const a = t[0], s = t[1];
    let l = null;
    const f = [NaN, NaN];
    let h = 1 / 0;
    const p = [-1 / 0, -1 / 0, 1 / 0, 1 / 0];
    return e = e || lS, this.featuresRtree_.forEachInExtent(
      p,
      /**
       * @param {FeatureType} feature Feature.
       */
      function(y) {
        if (e(y)) {
          const b = y.getGeometry(), x = h;
          if (h = b instanceof Of ? 0 : b.closestPointXY(a, s, f, h), h < x) {
            l = y;
            const w = Math.sqrt(h);
            p[0] = a - w, p[1] = s - w, p[2] = a + w, p[3] = s + w;
          }
        }
      }
    ), l;
  }
  /**
   * Get the extent of the features currently in the source.
   *
   * This method is not available when the source is configured with
   * `useSpatialIndex` set to `false`.
   * @param {import("../extent.js").Extent} [extent] Destination extent. If provided, no new extent
   *     will be created. Instead, that extent's coordinates will be overwritten.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getExtent(t) {
    return this.featuresRtree_.getExtent(t);
  }
  /**
   * Get a feature by its identifier (the value returned by feature.getId()). When `RenderFeature`s
   * are used, `getFeatureById()` can return an array of `RenderFeature`s. This allows for handling
   * of `GeometryCollection` geometries, where format readers create one `RenderFeature` per
   * `GeometryCollection` member.
   * Note that the index treats string and numeric identifiers as the same.  So
   * `source.getFeatureById(2)` will return a feature with id `'2'` or `2`.
   *
   * @param {string|number} id Feature identifier.
   * @return {FeatureClassOrArrayOfRenderFeatures<FeatureType>|null} The feature (or `null` if not found).
   * @api
   */
  getFeatureById(t) {
    const e = this.idIndex_[t.toString()];
    return e !== void 0 ? (
      /** @type {FeatureClassOrArrayOfRenderFeatures<FeatureType>} */
      e
    ) : null;
  }
  /**
   * Get a feature by its internal unique identifier (using `getUid`).
   *
   * @param {string} uid Feature identifier.
   * @return {FeatureType|null} The feature (or `null` if not found).
   */
  getFeatureByUid(t) {
    const e = this.uidIndex_[t];
    return e !== void 0 ? e : null;
  }
  /**
   * Get the format associated with this source.
   *
   * @return {import("../format/Feature.js").default<FeatureType>|null}} The feature format.
   * @api
   */
  getFormat() {
    return this.format_;
  }
  /**
   * @return {boolean} The source can have overlapping geometries.
   */
  getOverlaps() {
    return this.overlaps_;
  }
  /**
   * Get the url associated with this source.
   *
   * @return {string|import("../featureloader.js").FeatureUrlFunction|undefined} The url.
   * @api
   */
  getUrl() {
    return this.url_;
  }
  /**
   * @param {Event} event Event.
   * @private
   */
  handleFeatureChange_(t) {
    const e = (
      /** @type {FeatureType} */
      t.target
    ), a = si(e), s = e.getGeometry();
    if (!s)
      a in this.nullGeometryFeatures_ || (this.featuresRtree_ && this.featuresRtree_.remove(e), this.nullGeometryFeatures_[a] = e);
    else {
      const f = s.getExtent();
      a in this.nullGeometryFeatures_ ? (delete this.nullGeometryFeatures_[a], this.featuresRtree_ && this.featuresRtree_.insert(f, e)) : this.featuresRtree_ && this.featuresRtree_.update(f, e);
    }
    const l = e.getId();
    if (l !== void 0) {
      const f = l.toString();
      this.idIndex_[f] !== e && (this.removeFromIdIndex_(e), this.idIndex_[f] = e);
    } else
      this.removeFromIdIndex_(e), this.uidIndex_[a] = e;
    this.changed(), this.dispatchEvent(
      new i0(Sc.CHANGEFEATURE, e)
    );
  }
  /**
   * Returns true if the feature is contained within the source.
   * @param {FeatureType} feature Feature.
   * @return {boolean} Has feature.
   * @api
   */
  hasFeature(t) {
    const e = t.getId();
    return e !== void 0 ? e in this.idIndex_ : si(t) in this.uidIndex_;
  }
  /**
   * @return {boolean} Is empty.
   */
  isEmpty() {
    return this.featuresRtree_ ? this.featuresRtree_.isEmpty() && W1(this.nullGeometryFeatures_) : this.featuresCollection_ ? this.featuresCollection_.getLength() === 0 : !0;
  }
  /**
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} resolution Resolution.
   * @param {import("../proj/Projection.js").default} projection Projection.
   */
  loadFeatures(t, e, a) {
    const s = this.loadedExtentsRtree_, l = this.strategy_(t, e, a);
    for (let f = 0, h = l.length; f < h; ++f) {
      const p = l[f];
      s.forEachInExtent(
        p,
        /**
         * @param {{extent: import("../extent.js").Extent}} object Object.
         * @return {boolean} Contains.
         */
        function(b) {
          return nd(b.extent, p);
        }
      ) || (++this.loadingExtentsCount_, this.dispatchEvent(
        new i0(Sc.FEATURESLOADSTART)
      ), this.loader_.call(
        this,
        p,
        e,
        a,
        /**
         * @param {Array<FeatureType>} features Loaded features
         */
        (b) => {
          --this.loadingExtentsCount_, this.dispatchEvent(
            new i0(
              Sc.FEATURESLOADEND,
              void 0,
              b
            )
          );
        },
        () => {
          --this.loadingExtentsCount_, this.dispatchEvent(
            new i0(Sc.FEATURESLOADERROR)
          );
        }
      ), s.insert(p, { extent: p.slice() }));
    }
    this.loading = this.loader_.length < 4 ? !1 : this.loadingExtentsCount_ > 0;
  }
  /**
   * @override
   */
  refresh() {
    this.clear(!0), this.loadedExtentsRtree_.clear(), super.refresh();
  }
  /**
   * Remove an extent from the list of loaded extents.
   * @param {import("../extent.js").Extent} extent Extent.
   * @api
   */
  removeLoadedExtent(t) {
    const e = this.loadedExtentsRtree_, a = e.forEachInExtent(t, function(s) {
      if (K1(s.extent, t))
        return s;
    });
    a && e.remove(a);
  }
  /**
   * Batch remove features from the source.  If you want to remove all features
   * at once, use the {@link module:ol/source/Vector~VectorSource#clear #clear()} method
   * instead.
   * @param {Array<FeatureType>} features Features to remove.
   * @api
   */
  removeFeatures(t) {
    let e = !1;
    for (let a = 0, s = t.length; a < s; ++a)
      e = this.removeFeatureInternal(t[a]) || e;
    e && this.changed();
  }
  /**
   * Remove a single feature from the source. If you want to batch remove
   * features, use the {@link module:ol/source/Vector~VectorSource#removeFeatures #removeFeatures()} method
   * instead.
   * @param {FeatureType} feature Feature to remove.
   * @api
   */
  removeFeature(t) {
    if (!t)
      return;
    this.removeFeatureInternal(t) && this.changed();
  }
  /**
   * Remove feature without firing a `change` event.
   * @param {FeatureType} feature Feature.
   * @return {boolean} True if the feature was removed, false if it was not found.
   * @protected
   */
  removeFeatureInternal(t) {
    const e = si(t);
    if (!(e in this.uidIndex_))
      return !1;
    e in this.nullGeometryFeatures_ ? delete this.nullGeometryFeatures_[e] : this.featuresRtree_ && this.featuresRtree_.remove(t), this.featureChangeKeys_[e]?.forEach(Xi), delete this.featureChangeKeys_[e];
    const s = t.getId();
    if (s !== void 0) {
      const l = s.toString(), f = this.idIndex_[l];
      f === t ? delete this.idIndex_[l] : Array.isArray(f) && (f.splice(f.indexOf(t), 1), f.length === 1 && (this.idIndex_[l] = f[0]));
    }
    return delete this.uidIndex_[e], this.hasListener(Sc.REMOVEFEATURE) && this.dispatchEvent(
      new i0(Sc.REMOVEFEATURE, t)
    ), !0;
  }
  /**
   * Remove a feature from the id index.  Called internally when the feature id
   * may have changed.
   * @param {FeatureType} feature The feature.
   * @private
   */
  removeFromIdIndex_(t) {
    for (const e in this.idIndex_)
      if (this.idIndex_[e] === t) {
        delete this.idIndex_[e];
        break;
      }
  }
  /**
   * Set the new loader of the source. The next render cycle will use the
   * new loader.
   * @param {import("../featureloader.js").FeatureLoader} loader The loader to set.
   * @api
   */
  setLoader(t) {
    this.loader_ = t;
  }
  /**
   * Points the source to a new url. The next render cycle will use the new url.
   * @param {string|import("../featureloader.js").FeatureUrlFunction} url Url.
   * @api
   */
  setUrl(t) {
    Ei(this.format_, "`format` must be set when `url` is set"), this.url_ = t, this.setLoader(sL(t, this.format_));
  }
  /**
   * @param {boolean} overlaps The source can have overlapping geometries.
   */
  setOverlaps(t) {
    this.overlaps_ = t, this.changed();
  }
}
class kS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, this.patternImage_ = null, this.color_ = null, t.color !== void 0 && this.setColor(t.color);
  }
  /**
   * Clones the style. The color is not cloned if it is a {@link module:ol/colorlike~ColorLike}.
   * @return {Fill} The cloned style.
   * @api
   */
  clone() {
    const t = this.getColor();
    return new kS({
      color: Array.isArray(t) ? t.slice() : t || void 0
    });
  }
  /**
   * Get the fill color.
   * @return {import("../color.js").Color|import("../colorlike.js").ColorLike|import('../colorlike.js').PatternDescriptor|null} Color.
   * @api
   */
  getColor() {
    return this.color_;
  }
  /**
   * Set the color.
   *
   * @param {import("../color.js").Color|import("../colorlike.js").ColorLike|import('../colorlike.js').PatternDescriptor|null} color Color.
   * @api
   */
  setColor(t) {
    if (t !== null && typeof t == "object" && "src" in t) {
      const e = lO(
        null,
        t.src,
        "anonymous",
        void 0,
        t.offset ? null : t.color ? t.color : null,
        !(t.offset && t.size)
      );
      e.ready().then(() => {
        this.patternImage_ = null;
      }), e.getImageState() === xe.IDLE && e.load(), e.getImageState() === xe.LOADING && (this.patternImage_ = e);
    }
    this.color_ = t;
  }
  /**
   * @return {string} Key of the fill for cache lookup.
   */
  getKey() {
    const t = this.getColor();
    return t ? t instanceof CanvasPattern || t instanceof CanvasGradient ? si(t) : typeof t == "object" && "src" in t ? t.src + ":" + t.offset : fE(t).toString() : "";
  }
  /**
   * @return {boolean} The fill style is loading an image pattern.
   */
  loading() {
    return !!this.patternImage_;
  }
  /**
   * @return {Promise<void>} `false` or a promise that resolves when the style is ready to use.
   */
  ready() {
    return this.patternImage_ ? this.patternImage_.ready() : Promise.resolve();
  }
}
class HS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, this.color_ = t.color !== void 0 ? t.color : null, this.lineCap_ = t.lineCap, this.lineDash_ = t.lineDash !== void 0 ? t.lineDash : null, this.lineDashOffset_ = t.lineDashOffset, this.lineJoin_ = t.lineJoin, this.miterLimit_ = t.miterLimit, this.width_ = t.width;
  }
  /**
   * Clones the style.
   * @return {Stroke} The cloned style.
   * @api
   */
  clone() {
    const t = this.getColor();
    return new HS({
      color: Array.isArray(t) ? t.slice() : t || void 0,
      lineCap: this.getLineCap(),
      lineDash: this.getLineDash() ? this.getLineDash().slice() : void 0,
      lineDashOffset: this.getLineDashOffset(),
      lineJoin: this.getLineJoin(),
      miterLimit: this.getMiterLimit(),
      width: this.getWidth()
    });
  }
  /**
   * Get the stroke color.
   * @return {import("../color.js").Color|import("../colorlike.js").ColorLike} Color.
   * @api
   */
  getColor() {
    return this.color_;
  }
  /**
   * Get the line cap type for the stroke.
   * @return {CanvasLineCap|undefined} Line cap.
   * @api
   */
  getLineCap() {
    return this.lineCap_;
  }
  /**
   * Get the line dash style for the stroke.
   * @return {Array<number>|null} Line dash.
   * @api
   */
  getLineDash() {
    return this.lineDash_;
  }
  /**
   * Get the line dash offset for the stroke.
   * @return {number|undefined} Line dash offset.
   * @api
   */
  getLineDashOffset() {
    return this.lineDashOffset_;
  }
  /**
   * Get the line join type for the stroke.
   * @return {CanvasLineJoin|undefined} Line join.
   * @api
   */
  getLineJoin() {
    return this.lineJoin_;
  }
  /**
   * Get the miter limit for the stroke.
   * @return {number|undefined} Miter limit.
   * @api
   */
  getMiterLimit() {
    return this.miterLimit_;
  }
  /**
   * Get the stroke width.
   * @return {number|undefined} Width.
   * @api
   */
  getWidth() {
    return this.width_;
  }
  /**
   * Set the color.
   *
   * @param {import("../color.js").Color|import("../colorlike.js").ColorLike} color Color.
   * @api
   */
  setColor(t) {
    this.color_ = t;
  }
  /**
   * Set the line cap.
   *
   * @param {CanvasLineCap|undefined} lineCap Line cap.
   * @api
   */
  setLineCap(t) {
    this.lineCap_ = t;
  }
  /**
   * Set the line dash.
   *
   * @param {Array<number>|null} lineDash Line dash.
   * @api
   */
  setLineDash(t) {
    this.lineDash_ = t;
  }
  /**
   * Set the line dash offset.
   *
   * @param {number|undefined} lineDashOffset Line dash offset.
   * @api
   */
  setLineDashOffset(t) {
    this.lineDashOffset_ = t;
  }
  /**
   * Set the line join.
   *
   * @param {CanvasLineJoin|undefined} lineJoin Line join.
   * @api
   */
  setLineJoin(t) {
    this.lineJoin_ = t;
  }
  /**
   * Set the miter limit.
   *
   * @param {number|undefined} miterLimit Miter limit.
   * @api
   */
  setMiterLimit(t) {
    this.miterLimit_ = t;
  }
  /**
   * Set the width.
   *
   * @param {number|undefined} width Width.
   * @api
   */
  setWidth(t) {
    this.width_ = t;
  }
}
function fL(n) {
  return n[0] > 0 && n[1] > 0;
}
function QX(n, t, e) {
  return e === void 0 && (e = [0, 0]), e[0] = n[0] * t + 0.5 | 0, e[1] = n[1] * t + 0.5 | 0, e;
}
function ml(n, t) {
  return Array.isArray(n) ? n : (t === void 0 ? t = [n, n] : (t[0] = n, t[1] = n), t);
}
class Nw {
  /**
   * @param {Options} options Options.
   */
  constructor(t) {
    this.opacity_ = t.opacity, this.rotateWithView_ = t.rotateWithView, this.rotation_ = t.rotation, this.scale_ = t.scale, this.scaleArray_ = ml(t.scale), this.displacement_ = t.displacement, this.declutterMode_ = t.declutterMode;
  }
  /**
   * Clones the style.
   * @return {ImageStyle} The cloned style.
   * @api
   */
  clone() {
    const t = this.getScale();
    return new Nw({
      opacity: this.getOpacity(),
      scale: Array.isArray(t) ? t.slice() : t,
      rotation: this.getRotation(),
      rotateWithView: this.getRotateWithView(),
      displacement: this.getDisplacement().slice(),
      declutterMode: this.getDeclutterMode()
    });
  }
  /**
   * Get the symbolizer opacity.
   * @return {number} Opacity.
   * @api
   */
  getOpacity() {
    return this.opacity_;
  }
  /**
   * Determine whether the symbolizer rotates with the map.
   * @return {boolean} Rotate with map.
   * @api
   */
  getRotateWithView() {
    return this.rotateWithView_;
  }
  /**
   * Get the symoblizer rotation.
   * @return {number} Rotation.
   * @api
   */
  getRotation() {
    return this.rotation_;
  }
  /**
   * Get the symbolizer scale.
   * @return {number|import("../size.js").Size} Scale.
   * @api
   */
  getScale() {
    return this.scale_;
  }
  /**
   * Get the symbolizer scale array.
   * @return {import("../size.js").Size} Scale array.
   */
  getScaleArray() {
    return this.scaleArray_;
  }
  /**
   * Get the displacement of the shape
   * @return {Array<number>} Shape's center displacement
   * @api
   */
  getDisplacement() {
    return this.displacement_;
  }
  /**
   * Get the declutter mode of the shape
   * @return {import("./Style.js").DeclutterMode} Shape's declutter mode
   * @api
   */
  getDeclutterMode() {
    return this.declutterMode_;
  }
  /**
   * Get the anchor point in pixels. The anchor determines the center point for the
   * symbolizer.
   * @abstract
   * @return {Array<number>} Anchor.
   */
  getAnchor() {
    return Qn();
  }
  /**
   * Get the image element for the symbolizer.
   * @abstract
   * @param {number} pixelRatio Pixel ratio.
   * @return {import('../DataTile.js').ImageLike} Image element.
   */
  getImage(t) {
    return Qn();
  }
  /**
   * @abstract
   * @return {import('../DataTile.js').ImageLike} Image element.
   */
  getHitDetectionImage() {
    return Qn();
  }
  /**
   * Get the image pixel ratio.
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} Pixel ratio.
   */
  getPixelRatio(t) {
    return 1;
  }
  /**
   * @abstract
   * @return {import("../ImageState.js").default} Image state.
   */
  getImageState() {
    return Qn();
  }
  /**
   * @abstract
   * @return {import("../size.js").Size} Image size.
   */
  getImageSize() {
    return Qn();
  }
  /**
   * Get the origin of the symbolizer.
   * @abstract
   * @return {Array<number>} Origin.
   */
  getOrigin() {
    return Qn();
  }
  /**
   * Get the size of the symbolizer (in pixels).
   * @abstract
   * @return {import("../size.js").Size} Size.
   */
  getSize() {
    return Qn();
  }
  /**
   * Set the displacement.
   *
   * @param {Array<number>} displacement Displacement.
   * @api
   */
  setDisplacement(t) {
    this.displacement_ = t;
  }
  /**
   * Set the opacity.
   *
   * @param {number} opacity Opacity.
   * @api
   */
  setOpacity(t) {
    this.opacity_ = t;
  }
  /**
   * Set whether to rotate the style with the view.
   *
   * @param {boolean} rotateWithView Rotate with map.
   * @api
   */
  setRotateWithView(t) {
    this.rotateWithView_ = t;
  }
  /**
   * Set the rotation.
   *
   * @param {number} rotation Rotation.
   * @api
   */
  setRotation(t) {
    this.rotation_ = t;
  }
  /**
   * Set the scale.
   *
   * @param {number|import("../size.js").Size} scale Scale.
   * @api
   */
  setScale(t) {
    this.scale_ = t, this.scaleArray_ = ml(t);
  }
  /**
   * @abstract
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   */
  listenImageChange(t) {
    Qn();
  }
  /**
   * Load not yet loaded URI.
   * @abstract
   */
  load() {
    Qn();
  }
  /**
   * @abstract
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   */
  unlistenImageChange(t) {
    Qn();
  }
  /**
   * @return {Promise<void>} `false` or Promise that resolves when the style is ready to use.
   */
  ready() {
    return Promise.resolve();
  }
}
class Lw extends Nw {
  /**
   * @param {Options} options Options.
   */
  constructor(t) {
    super({
      opacity: 1,
      rotateWithView: t.rotateWithView !== void 0 ? t.rotateWithView : !1,
      rotation: t.rotation !== void 0 ? t.rotation : 0,
      scale: t.scale !== void 0 ? t.scale : 1,
      displacement: t.displacement !== void 0 ? t.displacement : [0, 0],
      declutterMode: t.declutterMode
    }), this.hitDetectionCanvas_ = null, this.fill_ = t.fill !== void 0 ? t.fill : null, this.origin_ = [0, 0], this.points_ = t.points, this.radius = t.radius, this.radius2_ = t.radius2, this.angle_ = t.angle !== void 0 ? t.angle : 0, this.stroke_ = t.stroke !== void 0 ? t.stroke : null, this.size_, this.renderOptions_, this.imageState_ = this.fill_ && this.fill_.loading() ? xe.LOADING : xe.LOADED, this.imageState_ === xe.LOADING && this.ready().then(() => this.imageState_ = xe.LOADED), this.render();
  }
  /**
   * Clones the style.
   * @return {RegularShape} The cloned style.
   * @api
   * @override
   */
  clone() {
    const t = this.getScale(), e = new Lw({
      fill: this.getFill() ? this.getFill().clone() : void 0,
      points: this.getPoints(),
      radius: this.getRadius(),
      radius2: this.getRadius2(),
      angle: this.getAngle(),
      stroke: this.getStroke() ? this.getStroke().clone() : void 0,
      rotation: this.getRotation(),
      rotateWithView: this.getRotateWithView(),
      scale: Array.isArray(t) ? t.slice() : t,
      displacement: this.getDisplacement().slice(),
      declutterMode: this.getDeclutterMode()
    });
    return e.setOpacity(this.getOpacity()), e;
  }
  /**
   * Get the anchor point in pixels. The anchor determines the center point for the
   * symbolizer.
   * @return {Array<number>} Anchor.
   * @api
   * @override
   */
  getAnchor() {
    const t = this.size_, e = this.getDisplacement(), a = this.getScaleArray();
    return [
      t[0] / 2 - e[0] / a[0],
      t[1] / 2 + e[1] / a[1]
    ];
  }
  /**
   * Get the angle used in generating the shape.
   * @return {number} Shape's rotation in radians.
   * @api
   */
  getAngle() {
    return this.angle_;
  }
  /**
   * Get the fill style for the shape.
   * @return {import("./Fill.js").default|null} Fill style.
   * @api
   */
  getFill() {
    return this.fill_;
  }
  /**
   * Set the fill style.
   * @param {import("./Fill.js").default|null} fill Fill style.
   * @api
   */
  setFill(t) {
    this.fill_ = t, this.render();
  }
  /**
   * @return {HTMLCanvasElement} Image element.
   * @override
   */
  getHitDetectionImage() {
    return this.hitDetectionCanvas_ || (this.hitDetectionCanvas_ = this.createHitDetectionCanvas_(
      this.renderOptions_
    )), this.hitDetectionCanvas_;
  }
  /**
   * Get the image icon.
   * @param {number} pixelRatio Pixel ratio.
   * @return {HTMLCanvasElement} Image or Canvas element.
   * @api
   * @override
   */
  getImage(t) {
    const e = this.fill_?.getKey(), a = `${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}` + Object.values(this.renderOptions_).join(",");
    let s = (
      /** @type {HTMLCanvasElement} */
      Rc.get(a, null, null)?.getImage(1)
    );
    if (!s) {
      const l = this.renderOptions_, f = Math.ceil(l.size * t), h = Pr(f, f);
      this.draw_(l, h, t), s = h.canvas, Rc.set(
        a,
        null,
        null,
        new Z2(s, void 0, null, xe.LOADED, null)
      );
    }
    return s;
  }
  /**
   * Get the image pixel ratio.
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} Pixel ratio.
   * @override
   */
  getPixelRatio(t) {
    return t;
  }
  /**
   * @return {import("../size.js").Size} Image size.
   * @override
   */
  getImageSize() {
    return this.size_;
  }
  /**
   * @return {import("../ImageState.js").default} Image state.
   * @override
   */
  getImageState() {
    return this.imageState_;
  }
  /**
   * Get the origin of the symbolizer.
   * @return {Array<number>} Origin.
   * @api
   * @override
   */
  getOrigin() {
    return this.origin_;
  }
  /**
   * Get the number of points for generating the shape.
   * @return {number} Number of points for stars and regular polygons.
   * @api
   */
  getPoints() {
    return this.points_;
  }
  /**
   * Get the (primary) radius for the shape.
   * @return {number} Radius.
   * @api
   */
  getRadius() {
    return this.radius;
  }
  /**
   * Get the secondary radius for the shape.
   * @return {number|undefined} Radius2.
   * @api
   */
  getRadius2() {
    return this.radius2_;
  }
  /**
   * Get the size of the symbolizer (in pixels).
   * @return {import("../size.js").Size} Size.
   * @api
   * @override
   */
  getSize() {
    return this.size_;
  }
  /**
   * Get the stroke style for the shape.
   * @return {import("./Stroke.js").default|null} Stroke style.
   * @api
   */
  getStroke() {
    return this.stroke_;
  }
  /**
   * Set the stroke style.
   * @param {import("./Stroke.js").default|null} stroke Stroke style.
   * @api
   */
  setStroke(t) {
    this.stroke_ = t, this.render();
  }
  /**
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   * @override
   */
  listenImageChange(t) {
  }
  /**
   * Load not yet loaded URI.
   * @override
   */
  load() {
  }
  /**
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   * @override
   */
  unlistenImageChange(t) {
  }
  /**
   * Calculate additional canvas size needed for the miter.
   * @param {string} lineJoin Line join
   * @param {number} strokeWidth Stroke width
   * @param {number} miterLimit Miter limit
   * @return {number} Additional canvas size needed
   * @private
   */
  calculateLineJoinSize_(t, e, a) {
    if (e === 0 || this.points_ === 1 / 0 || t !== "bevel" && t !== "miter")
      return e;
    let s = this.radius, l = this.radius2_ === void 0 ? s : this.radius2_;
    if (s < l) {
      const Q = s;
      s = l, l = Q;
    }
    const f = this.radius2_ === void 0 ? this.points_ : this.points_ * 2, h = 2 * Math.PI / f, p = l * Math.sin(h), y = Math.sqrt(l * l - p * p), b = s - y, x = Math.sqrt(p * p + b * b), w = x / p;
    if (t === "miter" && w <= a)
      return w * e;
    const A = e / 2 / w, C = e / 2 * (b / x), N = Math.sqrt((s + A) * (s + A) + C * C) - s;
    if (this.radius2_ === void 0 || t === "bevel")
      return N * 2;
    const U = s * Math.sin(h), k = Math.sqrt(s * s - U * U), H = l - k, z = Math.sqrt(U * U + H * H) / U;
    if (z <= a) {
      const Q = z * e / 2 - l - s;
      return 2 * Math.max(N, Q);
    }
    return N * 2;
  }
  /**
   * @return {RenderOptions}  The render options
   * @protected
   */
  createRenderOptions() {
    let t = hE, e = dE, a = 0, s = null, l = 0, f, h = 0;
    this.stroke_ && (f = rd(this.stroke_.getColor() ?? hS), h = this.stroke_.getWidth() ?? gS, s = this.stroke_.getLineDash(), l = this.stroke_.getLineDashOffset() ?? 0, e = this.stroke_.getLineJoin() ?? dE, t = this.stroke_.getLineCap() ?? hE, a = this.stroke_.getMiterLimit() ?? fS);
    const p = this.calculateLineJoinSize_(e, h, a), y = Math.max(this.radius, this.radius2_ || 0), b = Math.ceil(2 * y + p);
    return {
      strokeStyle: f,
      strokeWidth: h,
      size: b,
      lineCap: t,
      lineDash: s,
      lineDashOffset: l,
      lineJoin: e,
      miterLimit: a
    };
  }
  /**
   * @protected
   */
  render() {
    this.renderOptions_ = this.createRenderOptions();
    const t = this.renderOptions_.size;
    this.hitDetectionCanvas_ = null, this.size_ = [t, t];
  }
  /**
   * @private
   * @param {RenderOptions} renderOptions Render options.
   * @param {CanvasRenderingContext2D} context The rendering context.
   * @param {number} pixelRatio The pixel ratio.
   */
  draw_(t, e, a) {
    if (e.scale(a, a), e.translate(t.size / 2, t.size / 2), this.createPath_(e), this.fill_) {
      let s = this.fill_.getColor();
      s === null && (s = ll), e.fillStyle = rd(s), e.fill();
    }
    t.strokeStyle && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineCap = t.lineCap, e.lineJoin = t.lineJoin, e.miterLimit = t.miterLimit, e.stroke());
  }
  /**
   * @private
   * @param {RenderOptions} renderOptions Render options.
   * @return {HTMLCanvasElement} Canvas containing the icon
   */
  createHitDetectionCanvas_(t) {
    let e;
    if (this.fill_) {
      let a = this.fill_.getColor(), s = 0;
      typeof a == "string" && (a = fE(a)), a === null ? s = 1 : Array.isArray(a) && (s = a.length === 4 ? a[3] : 1), s === 0 && (e = Pr(t.size, t.size), this.drawHitDetectionCanvas_(t, e));
    }
    return e ? e.canvas : this.getImage(1);
  }
  /**
   * @private
   * @param {CanvasRenderingContext2D} context The context to draw in.
   */
  createPath_(t) {
    let e = this.points_;
    const a = this.radius;
    if (e === 1 / 0)
      t.arc(0, 0, a, 0, 2 * Math.PI);
    else {
      const s = this.radius2_ === void 0 ? a : this.radius2_;
      this.radius2_ !== void 0 && (e *= 2);
      const l = this.angle_ - Math.PI / 2, f = 2 * Math.PI / e;
      for (let h = 0; h < e; h++) {
        const p = l + h * f, y = h % 2 === 0 ? a : s;
        t.lineTo(y * Math.cos(p), y * Math.sin(p));
      }
      t.closePath();
    }
  }
  /**
   * @private
   * @param {RenderOptions} renderOptions Render options.
   * @param {CanvasRenderingContext2D} context The context.
   */
  drawHitDetectionCanvas_(t, e) {
    e.translate(t.size / 2, t.size / 2), this.createPath_(e), e.fillStyle = ll, e.fill(), t.strokeStyle && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineJoin = t.lineJoin, e.miterLimit = t.miterLimit, e.stroke());
  }
  /**
   * @override
   */
  ready() {
    return this.fill_ ? this.fill_.ready() : Promise.resolve();
  }
}
class Iw extends Lw {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || { radius: 5 }, super({
      points: 1 / 0,
      fill: t.fill,
      radius: t.radius,
      stroke: t.stroke,
      scale: t.scale !== void 0 ? t.scale : 1,
      rotation: t.rotation !== void 0 ? t.rotation : 0,
      rotateWithView: t.rotateWithView !== void 0 ? t.rotateWithView : !1,
      displacement: t.displacement !== void 0 ? t.displacement : [0, 0],
      declutterMode: t.declutterMode
    });
  }
  /**
   * Clones the style.
   * @return {CircleStyle} The cloned style.
   * @api
   * @override
   */
  clone() {
    const t = this.getScale(), e = new Iw({
      fill: this.getFill() ? this.getFill().clone() : void 0,
      stroke: this.getStroke() ? this.getStroke().clone() : void 0,
      radius: this.getRadius(),
      scale: Array.isArray(t) ? t.slice() : t,
      rotation: this.getRotation(),
      rotateWithView: this.getRotateWithView(),
      displacement: this.getDisplacement().slice(),
      declutterMode: this.getDeclutterMode()
    });
    return e.setOpacity(this.getOpacity()), e;
  }
  /**
   * Set the circle radius.
   *
   * @param {number} radius Circle radius.
   * @api
   */
  setRadius(t) {
    this.radius = t, this.render();
  }
}
class E0 {
  /**
   * @param {Options} [options] Style options.
   */
  constructor(t) {
    t = t || {}, this.geometry_ = null, this.geometryFunction_ = hL, t.geometry !== void 0 && this.setGeometry(t.geometry), this.fill_ = t.fill !== void 0 ? t.fill : null, this.image_ = t.image !== void 0 ? t.image : null, this.renderer_ = t.renderer !== void 0 ? t.renderer : null, this.hitDetectionRenderer_ = t.hitDetectionRenderer !== void 0 ? t.hitDetectionRenderer : null, this.stroke_ = t.stroke !== void 0 ? t.stroke : null, this.text_ = t.text !== void 0 ? t.text : null, this.zIndex_ = t.zIndex;
  }
  /**
   * Clones the style.
   * @return {Style} The cloned style.
   * @api
   */
  clone() {
    let t = this.getGeometry();
    return t && typeof t == "object" && (t = /** @type {import("../geom/Geometry.js").default} */
    t.clone()), new E0({
      geometry: t ?? void 0,
      fill: this.getFill() ? this.getFill().clone() : void 0,
      image: this.getImage() ? this.getImage().clone() : void 0,
      renderer: this.getRenderer() ?? void 0,
      stroke: this.getStroke() ? this.getStroke().clone() : void 0,
      text: this.getText() ? this.getText().clone() : void 0,
      zIndex: this.getZIndex()
    });
  }
  /**
   * Get the custom renderer function that was configured with
   * {@link #setRenderer} or the `renderer` constructor option.
   * @return {RenderFunction|null} Custom renderer function.
   * @api
   */
  getRenderer() {
    return this.renderer_;
  }
  /**
   * Sets a custom renderer function for this style. When set, `fill`, `stroke`
   * and `image` options of the style will be ignored.
   * @param {RenderFunction|null} renderer Custom renderer function.
   * @api
   */
  setRenderer(t) {
    this.renderer_ = t;
  }
  /**
   * Sets a custom renderer function for this style used
   * in hit detection.
   * @param {RenderFunction|null} renderer Custom renderer function.
   * @api
   */
  setHitDetectionRenderer(t) {
    this.hitDetectionRenderer_ = t;
  }
  /**
   * Get the custom renderer function that was configured with
   * {@link #setHitDetectionRenderer} or the `hitDetectionRenderer` constructor option.
   * @return {RenderFunction|null} Custom renderer function.
   * @api
   */
  getHitDetectionRenderer() {
    return this.hitDetectionRenderer_;
  }
  /**
   * Get the geometry to be rendered.
   * @return {string|import("../geom/Geometry.js").default|GeometryFunction|null}
   * Feature property or geometry or function that returns the geometry that will
   * be rendered with this style.
   * @api
   */
  getGeometry() {
    return this.geometry_;
  }
  /**
   * Get the function used to generate a geometry for rendering.
   * @return {!GeometryFunction} Function that is called with a feature
   * and returns the geometry to render instead of the feature's geometry.
   * @api
   */
  getGeometryFunction() {
    return this.geometryFunction_;
  }
  /**
   * Get the fill style.
   * @return {import("./Fill.js").default|null} Fill style.
   * @api
   */
  getFill() {
    return this.fill_;
  }
  /**
   * Set the fill style.
   * @param {import("./Fill.js").default|null} fill Fill style.
   * @api
   */
  setFill(t) {
    this.fill_ = t;
  }
  /**
   * Get the image style.
   * @return {import("./Image.js").default|null} Image style.
   * @api
   */
  getImage() {
    return this.image_;
  }
  /**
   * Set the image style.
   * @param {import("./Image.js").default} image Image style.
   * @api
   */
  setImage(t) {
    this.image_ = t;
  }
  /**
   * Get the stroke style.
   * @return {import("./Stroke.js").default|null} Stroke style.
   * @api
   */
  getStroke() {
    return this.stroke_;
  }
  /**
   * Set the stroke style.
   * @param {import("./Stroke.js").default|null} stroke Stroke style.
   * @api
   */
  setStroke(t) {
    this.stroke_ = t;
  }
  /**
   * Get the text style.
   * @return {import("./Text.js").default|null} Text style.
   * @api
   */
  getText() {
    return this.text_;
  }
  /**
   * Set the text style.
   * @param {import("./Text.js").default} text Text style.
   * @api
   */
  setText(t) {
    this.text_ = t;
  }
  /**
   * Get the z-index for the style.
   * @return {number|undefined} ZIndex.
   * @api
   */
  getZIndex() {
    return this.zIndex_;
  }
  /**
   * Set a geometry that is rendered instead of the feature's geometry.
   *
   * @param {string|import("../geom/Geometry.js").default|GeometryFunction|null} geometry
   *     Feature property or geometry or function returning a geometry to render
   *     for this style.
   * @api
   */
  setGeometry(t) {
    typeof t == "function" ? this.geometryFunction_ = t : typeof t == "string" ? this.geometryFunction_ = function(e) {
      return (
        /** @type {import("../geom/Geometry.js").default} */
        e.get(t)
      );
    } : t ? t !== void 0 && (this.geometryFunction_ = function() {
      return (
        /** @type {import("../geom/Geometry.js").default} */
        t
      );
    }) : this.geometryFunction_ = hL, this.geometry_ = t;
  }
  /**
   * Set the z-index.
   *
   * @param {number|undefined} zIndex ZIndex.
   * @api
   */
  setZIndex(t) {
    this.zIndex_ = t;
  }
}
function JX(n) {
  let t;
  if (typeof n == "function")
    t = n;
  else {
    let e;
    Array.isArray(n) ? e = n : (Ei(
      typeof /** @type {?} */
      n.getZIndex == "function",
      "Expected an `Style` or an array of `Style`"
    ), e = [
      /** @type {Style} */
      n
    ]), t = function() {
      return e;
    };
  }
  return t;
}
let $A = null;
function o5(n, t) {
  if (!$A) {
    const e = new kS({
      color: "rgba(255,255,255,0.4)"
    }), a = new HS({
      color: "#3399CC",
      width: 1.25
    });
    $A = [
      new E0({
        image: new Iw({
          fill: e,
          stroke: a,
          radius: 5
        }),
        fill: e,
        stroke: a
      })
    ];
  }
  return $A;
}
function hL(n) {
  return n.getGeometry();
}
const tK = "#333";
class hO {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, this.font_ = t.font, this.rotation_ = t.rotation, this.rotateWithView_ = t.rotateWithView, this.keepUpright_ = t.keepUpright, this.scale_ = t.scale, this.scaleArray_ = ml(t.scale !== void 0 ? t.scale : 1), this.text_ = t.text, this.textAlign_ = t.textAlign, this.justify_ = t.justify, this.repeat_ = t.repeat, this.textBaseline_ = t.textBaseline, this.fill_ = t.fill !== void 0 ? t.fill : new kS({ color: tK }), this.maxAngle_ = t.maxAngle !== void 0 ? t.maxAngle : Math.PI / 4, this.placement_ = t.placement !== void 0 ? t.placement : "point", this.overflow_ = !!t.overflow, this.stroke_ = t.stroke !== void 0 ? t.stroke : null, this.offsetX_ = t.offsetX !== void 0 ? t.offsetX : 0, this.offsetY_ = t.offsetY !== void 0 ? t.offsetY : 0, this.backgroundFill_ = t.backgroundFill ? t.backgroundFill : null, this.backgroundStroke_ = t.backgroundStroke ? t.backgroundStroke : null, this.padding_ = t.padding === void 0 ? null : t.padding, this.declutterMode_ = t.declutterMode;
  }
  /**
   * Clones the style.
   * @return {Text} The cloned style.
   * @api
   */
  clone() {
    const t = this.getScale();
    return new hO({
      font: this.getFont(),
      placement: this.getPlacement(),
      repeat: this.getRepeat(),
      maxAngle: this.getMaxAngle(),
      overflow: this.getOverflow(),
      rotation: this.getRotation(),
      rotateWithView: this.getRotateWithView(),
      keepUpright: this.getKeepUpright(),
      scale: Array.isArray(t) ? t.slice() : t,
      text: this.getText(),
      textAlign: this.getTextAlign(),
      justify: this.getJustify(),
      textBaseline: this.getTextBaseline(),
      fill: this.getFill() ? this.getFill().clone() : void 0,
      stroke: this.getStroke() ? this.getStroke().clone() : void 0,
      offsetX: this.getOffsetX(),
      offsetY: this.getOffsetY(),
      backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : void 0,
      backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : void 0,
      padding: this.getPadding() || void 0,
      declutterMode: this.getDeclutterMode()
    });
  }
  /**
   * Get the `overflow` configuration.
   * @return {boolean} Let text overflow the length of the path they follow.
   * @api
   */
  getOverflow() {
    return this.overflow_;
  }
  /**
   * Get the font name.
   * @return {string|undefined} Font.
   * @api
   */
  getFont() {
    return this.font_;
  }
  /**
   * Get the maximum angle between adjacent characters.
   * @return {number} Angle in radians.
   * @api
   */
  getMaxAngle() {
    return this.maxAngle_;
  }
  /**
   * Get the label placement.
   * @return {TextPlacement} Text placement.
   * @api
   */
  getPlacement() {
    return this.placement_;
  }
  /**
   * Get the repeat interval of the text.
   * @return {number|undefined} Repeat interval in pixels.
   * @api
   */
  getRepeat() {
    return this.repeat_;
  }
  /**
   * Get the x-offset for the text.
   * @return {number} Horizontal text offset.
   * @api
   */
  getOffsetX() {
    return this.offsetX_;
  }
  /**
   * Get the y-offset for the text.
   * @return {number} Vertical text offset.
   * @api
   */
  getOffsetY() {
    return this.offsetY_;
  }
  /**
   * Get the fill style for the text.
   * @return {import("./Fill.js").default|null} Fill style.
   * @api
   */
  getFill() {
    return this.fill_;
  }
  /**
   * Determine whether the text rotates with the map.
   * @return {boolean|undefined} Rotate with map.
   * @api
   */
  getRotateWithView() {
    return this.rotateWithView_;
  }
  /**
   * Determine whether the text can be rendered upside down.
   * @return {boolean|undefined} Keep text upright.
   * @api
   */
  getKeepUpright() {
    return this.keepUpright_;
  }
  /**
   * Get the text rotation.
   * @return {number|undefined} Rotation.
   * @api
   */
  getRotation() {
    return this.rotation_;
  }
  /**
   * Get the text scale.
   * @return {number|import("../size.js").Size|undefined} Scale.
   * @api
   */
  getScale() {
    return this.scale_;
  }
  /**
   * Get the symbolizer scale array.
   * @return {import("../size.js").Size} Scale array.
   */
  getScaleArray() {
    return this.scaleArray_;
  }
  /**
   * Get the stroke style for the text.
   * @return {import("./Stroke.js").default|null} Stroke style.
   * @api
   */
  getStroke() {
    return this.stroke_;
  }
  /**
   * Get the text to be rendered.
   * @return {string|Array<string>|undefined} Text.
   * @api
   */
  getText() {
    return this.text_;
  }
  /**
   * Get the text alignment.
   * @return {CanvasTextAlign|undefined} Text align.
   * @api
   */
  getTextAlign() {
    return this.textAlign_;
  }
  /**
   * Get the justification.
   * @return {TextJustify|undefined} Justification.
   * @api
   */
  getJustify() {
    return this.justify_;
  }
  /**
   * Get the text baseline.
   * @return {CanvasTextBaseline|undefined} Text baseline.
   * @api
   */
  getTextBaseline() {
    return this.textBaseline_;
  }
  /**
   * Get the background fill style for the text.
   * @return {import("./Fill.js").default|null} Fill style.
   * @api
   */
  getBackgroundFill() {
    return this.backgroundFill_;
  }
  /**
   * Get the background stroke style for the text.
   * @return {import("./Stroke.js").default|null} Stroke style.
   * @api
   */
  getBackgroundStroke() {
    return this.backgroundStroke_;
  }
  /**
   * Get the padding for the text.
   * @return {Array<number>|null} Padding.
   * @api
   */
  getPadding() {
    return this.padding_;
  }
  /**
   * Get the declutter mode of the shape
   * @return {import("./Style.js").DeclutterMode} Shape's declutter mode
   * @api
   */
  getDeclutterMode() {
    return this.declutterMode_;
  }
  /**
   * Set the `overflow` property.
   *
   * @param {boolean} overflow Let text overflow the path that it follows.
   * @api
   */
  setOverflow(t) {
    this.overflow_ = t;
  }
  /**
   * Set the font.
   *
   * @param {string|undefined} font Font.
   * @api
   */
  setFont(t) {
    this.font_ = t;
  }
  /**
   * Set the maximum angle between adjacent characters.
   *
   * @param {number} maxAngle Angle in radians.
   * @api
   */
  setMaxAngle(t) {
    this.maxAngle_ = t;
  }
  /**
   * Set the x offset.
   *
   * @param {number} offsetX Horizontal text offset.
   * @api
   */
  setOffsetX(t) {
    this.offsetX_ = t;
  }
  /**
   * Set the y offset.
   *
   * @param {number} offsetY Vertical text offset.
   * @api
   */
  setOffsetY(t) {
    this.offsetY_ = t;
  }
  /**
   * Set the text placement.
   *
   * @param {TextPlacement} placement Placement.
   * @api
   */
  setPlacement(t) {
    this.placement_ = t;
  }
  /**
   * Set the repeat interval of the text.
   * @param {number|undefined} [repeat] Repeat interval in pixels.
   * @api
   */
  setRepeat(t) {
    this.repeat_ = t;
  }
  /**
   * Set whether to rotate the text with the view.
   *
   * @param {boolean} rotateWithView Rotate with map.
   * @api
   */
  setRotateWithView(t) {
    this.rotateWithView_ = t;
  }
  /**
   * Set whether the text can be rendered upside down.
   *
   * @param {boolean} keepUpright Keep text upright.
   * @api
   */
  setKeepUpright(t) {
    this.keepUpright_ = t;
  }
  /**
   * Set the fill.
   *
   * @param {import("./Fill.js").default|null} fill Fill style.
   * @api
   */
  setFill(t) {
    this.fill_ = t;
  }
  /**
   * Set the rotation.
   *
   * @param {number|undefined} rotation Rotation.
   * @api
   */
  setRotation(t) {
    this.rotation_ = t;
  }
  /**
   * Set the scale.
   *
   * @param {number|import("../size.js").Size|undefined} scale Scale.
   * @api
   */
  setScale(t) {
    this.scale_ = t, this.scaleArray_ = ml(t !== void 0 ? t : 1);
  }
  /**
   * Set the stroke.
   *
   * @param {import("./Stroke.js").default|null} stroke Stroke style.
   * @api
   */
  setStroke(t) {
    this.stroke_ = t;
  }
  /**
   * Set the text.
   *
   * @param {string|Array<string>|undefined} text Text.
   * @api
   */
  setText(t) {
    this.text_ = t;
  }
  /**
   * Set the text alignment.
   *
   * @param {CanvasTextAlign|undefined} textAlign Text align.
   * @api
   */
  setTextAlign(t) {
    this.textAlign_ = t;
  }
  /**
   * Set the justification.
   *
   * @param {TextJustify|undefined} justify Justification.
   * @api
   */
  setJustify(t) {
    this.justify_ = t;
  }
  /**
   * Set the text baseline.
   *
   * @param {CanvasTextBaseline|undefined} textBaseline Text baseline.
   * @api
   */
  setTextBaseline(t) {
    this.textBaseline_ = t;
  }
  /**
   * Set the background fill.
   *
   * @param {import("./Fill.js").default|null} fill Fill style.
   * @api
   */
  setBackgroundFill(t) {
    this.backgroundFill_ = t;
  }
  /**
   * Set the background stroke.
   *
   * @param {import("./Stroke.js").default|null} stroke Stroke style.
   * @api
   */
  setBackgroundStroke(t) {
    this.backgroundStroke_ = t;
  }
  /**
   * Set the padding (`[top, right, bottom, left]`).
   *
   * @param {Array<number>|null} padding Padding.
   * @api
   */
  setPadding(t) {
    this.padding_ = t;
  }
}
const ss = {
  ANIMATING: 0,
  INTERACTING: 1
}, Le = {
  BEGIN_GEOMETRY: 0,
  BEGIN_PATH: 1,
  CIRCLE: 2,
  CLOSE_PATH: 3,
  CUSTOM: 4,
  DRAW_CHARS: 5,
  DRAW_IMAGE: 6,
  END_GEOMETRY: 7,
  FILL: 8,
  MOVE_TO_LINE_TO: 9,
  SET_FILL_STYLE: 10,
  SET_STROKE_STYLE: 11,
  STROKE: 12
}, oT = [Le.FILL], g0 = [Le.STROKE], S_ = [Le.BEGIN_PATH], dL = [Le.CLOSE_PATH];
class BS extends W2 {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Maximum extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    super(), this.tolerance = t, this.maxExtent = e, this.pixelRatio = s, this.maxLineWidth = 0, this.resolution = a, this.beginGeometryInstruction1_ = null, this.beginGeometryInstruction2_ = null, this.bufferedMaxExtent_ = null, this.instructions = [], this.coordinates = [], this.tmpCoordinate_ = [], this.hitDetectionInstructions = [], this.state = /** @type {import("../canvas.js").FillStrokeState} */
    {};
  }
  /**
   * @protected
   * @param {Array<number>} dashArray Dash array.
   * @return {Array<number>} Dash array with pixel ratio applied
   */
  applyPixelRatio(t) {
    const e = this.pixelRatio;
    return e == 1 ? t : t.map(function(a) {
      return a * e;
    });
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} stride Stride.
   * @protected
   * @return {number} My end
   */
  appendFlatPointCoordinates(t, e) {
    const a = this.getBufferedMaxExtent(), s = this.tmpCoordinate_, l = this.coordinates;
    let f = l.length;
    for (let h = 0, p = t.length; h < p; h += e)
      s[0] = t[h], s[1] = t[h + 1], D_(a, s) && (l[f++] = s[0], l[f++] = s[1]);
    return f;
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {number} end End.
   * @param {number} stride Stride.
   * @param {boolean} closed Last input coordinate equals first.
   * @param {boolean} skipFirst Skip first coordinate.
   * @protected
   * @return {number} My end.
   */
  appendFlatLineCoordinates(t, e, a, s, l, f) {
    const h = this.coordinates;
    let p = h.length;
    const y = this.getBufferedMaxExtent();
    f && (e += s);
    let b = t[e], x = t[e + 1];
    const w = this.tmpCoordinate_;
    let A = !0, C, L, N;
    for (C = e + s; C < a; C += s)
      w[0] = t[C], w[1] = t[C + 1], N = dM(y, w), N !== L ? (A && (h[p++] = b, h[p++] = x, A = !1), h[p++] = w[0], h[p++] = w[1]) : N === rs.INTERSECTING ? (h[p++] = w[0], h[p++] = w[1], A = !1) : A = !0, b = w[0], x = w[1], L = N;
    return (l && A || C === e + s) && (h[p++] = b, h[p++] = x), p;
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {Array<number>} ends Ends.
   * @param {number} stride Stride.
   * @param {Array<number>} builderEnds Builder ends.
   * @return {number} Offset.
   */
  drawCustomCoordinates_(t, e, a, s, l) {
    for (let f = 0, h = a.length; f < h; ++f) {
      const p = a[f], y = this.appendFlatLineCoordinates(
        t,
        e,
        p,
        s,
        !1,
        !1
      );
      l.push(y), e = p;
    }
    return e;
  }
  /**
   * @param {import("../../geom/SimpleGeometry.js").default} geometry Geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {Function} renderer Renderer.
   * @param {Function} hitDetectionRenderer Renderer.
   * @param {number} [index] Render order index.
   * @override
   */
  drawCustom(t, e, a, s, l) {
    this.beginGeometry(t, e, l);
    const f = t.getType(), h = t.getStride(), p = this.coordinates.length;
    let y, b, x, w, A;
    switch (f) {
      case "MultiPolygon":
        y = /** @type {import("../../geom/MultiPolygon.js").default} */
        t.getOrientedFlatCoordinates(), w = [];
        const C = (
          /** @type {import("../../geom/MultiPolygon.js").default} */
          t.getEndss()
        );
        A = 0;
        for (let L = 0, N = C.length; L < N; ++L) {
          const U = [];
          A = this.drawCustomCoordinates_(
            y,
            A,
            C[L],
            h,
            U
          ), w.push(U);
        }
        this.instructions.push([
          Le.CUSTOM,
          p,
          w,
          t,
          a,
          VM,
          l
        ]), this.hitDetectionInstructions.push([
          Le.CUSTOM,
          p,
          w,
          t,
          s || a,
          VM,
          l
        ]);
        break;
      case "Polygon":
      case "MultiLineString":
        x = [], y = f == "Polygon" ? (
          /** @type {import("../../geom/Polygon.js").default} */
          t.getOrientedFlatCoordinates()
        ) : t.getFlatCoordinates(), A = this.drawCustomCoordinates_(
          y,
          0,
          /** @type {import("../../geom/Polygon.js").default|import("../../geom/MultiLineString.js").default} */
          t.getEnds(),
          h,
          x
        ), this.instructions.push([
          Le.CUSTOM,
          p,
          x,
          t,
          a,
          KT,
          l
        ]), this.hitDetectionInstructions.push([
          Le.CUSTOM,
          p,
          x,
          t,
          s || a,
          KT,
          l
        ]);
        break;
      case "LineString":
      case "Circle":
        y = t.getFlatCoordinates(), b = this.appendFlatLineCoordinates(
          y,
          0,
          y.length,
          h,
          !1,
          !1
        ), this.instructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          a,
          v_,
          l
        ]), this.hitDetectionInstructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          s || a,
          v_,
          l
        ]);
        break;
      case "MultiPoint":
        y = t.getFlatCoordinates(), b = this.appendFlatPointCoordinates(y, h), b > p && (this.instructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          a,
          v_,
          l
        ]), this.hitDetectionInstructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          s || a,
          v_,
          l
        ]));
        break;
      case "Point":
        y = t.getFlatCoordinates(), this.coordinates.push(y[0], y[1]), b = this.coordinates.length, this.instructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          a,
          void 0,
          l
        ]), this.hitDetectionInstructions.push([
          Le.CUSTOM,
          p,
          b,
          t,
          s || a,
          void 0,
          l
        ]);
        break;
    }
    this.endGeometry(e);
  }
  /**
   * @protected
   * @param {import("../../geom/Geometry").default|import("../Feature.js").default} geometry The geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} index Render order index
   */
  beginGeometry(t, e, a) {
    this.beginGeometryInstruction1_ = [
      Le.BEGIN_GEOMETRY,
      e,
      0,
      t,
      a
    ], this.instructions.push(this.beginGeometryInstruction1_), this.beginGeometryInstruction2_ = [
      Le.BEGIN_GEOMETRY,
      e,
      0,
      t,
      a
    ], this.hitDetectionInstructions.push(this.beginGeometryInstruction2_);
  }
  /**
   * @return {import("../canvas.js").SerializableInstructions} the serializable instructions.
   */
  finish() {
    return {
      instructions: this.instructions,
      hitDetectionInstructions: this.hitDetectionInstructions,
      coordinates: this.coordinates
    };
  }
  /**
   * Reverse the hit detection instructions.
   */
  reverseHitDetectionInstructions() {
    const t = this.hitDetectionInstructions;
    t.reverse();
    let e;
    const a = t.length;
    let s, l, f = -1;
    for (e = 0; e < a; ++e)
      s = t[e], l = /** @type {import("./Instruction.js").default} */
      s[0], l == Le.END_GEOMETRY ? f = e : l == Le.BEGIN_GEOMETRY && (s[2] = e, ZF(this.hitDetectionInstructions, f, e), f = -1);
  }
  /**
   * @param {import("../../style/Fill.js").default} fillStyle Fill style.
   * @param {import('../canvas.js').FillStrokeState} [state] State.
   * @return {import('../canvas.js').FillStrokeState} State.
   */
  fillStyleToState(t, e = (
    /** @type {import('../canvas.js').FillStrokeState} */
    {}
  )) {
    if (t) {
      const a = t.getColor();
      e.fillPatternScale = a && typeof a == "object" && "src" in a ? this.pixelRatio : 1, e.fillStyle = rd(
        a || ll
      );
    } else
      e.fillStyle = void 0;
    return e;
  }
  /**
   * @param {import("../../style/Stroke.js").default} strokeStyle Stroke style.
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @return {import("../canvas.js").FillStrokeState} State.
   */
  strokeStyleToState(t, e = (
    /** @type {import('../canvas.js').FillStrokeState} */
    {}
  )) {
    if (t) {
      const a = t.getColor();
      e.strokeStyle = rd(
        a || hS
      );
      const s = t.getLineCap();
      e.lineCap = s !== void 0 ? s : hE;
      const l = t.getLineDash();
      e.lineDash = l ? l.slice() : lm;
      const f = t.getLineDashOffset();
      e.lineDashOffset = f || um;
      const h = t.getLineJoin();
      e.lineJoin = h !== void 0 ? h : dE;
      const p = t.getWidth();
      e.lineWidth = p !== void 0 ? p : gS;
      const y = t.getMiterLimit();
      e.miterLimit = y !== void 0 ? y : fS, e.lineWidth > this.maxLineWidth && (this.maxLineWidth = e.lineWidth, this.bufferedMaxExtent_ = null);
    } else
      e.strokeStyle = void 0, e.lineCap = void 0, e.lineDash = null, e.lineDashOffset = void 0, e.lineJoin = void 0, e.lineWidth = void 0, e.miterLimit = void 0;
    return e;
  }
  /**
   * @param {import("../../style/Fill.js").default} fillStyle Fill style.
   * @param {import("../../style/Stroke.js").default} strokeStyle Stroke style.
   * @override
   */
  setFillStrokeStyle(t, e) {
    const a = this.state;
    this.fillStyleToState(t, a), this.strokeStyleToState(e, a);
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @return {Array<*>} Fill instruction.
   */
  createFill(t) {
    const e = t.fillStyle, a = [Le.SET_FILL_STYLE, e];
    return typeof e != "string" && a.push(t.fillPatternScale), a;
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   */
  applyStroke(t) {
    this.instructions.push(this.createStroke(t));
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @return {Array<*>} Stroke instruction.
   */
  createStroke(t) {
    return [
      Le.SET_STROKE_STYLE,
      t.strokeStyle,
      t.lineWidth * this.pixelRatio,
      t.lineCap,
      t.lineJoin,
      t.miterLimit,
      t.lineDash ? this.applyPixelRatio(t.lineDash) : null,
      t.lineDashOffset * this.pixelRatio
    ];
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @param {function(this:CanvasBuilder, import("../canvas.js").FillStrokeState):Array<*>} createFill Create fill.
   */
  updateFillStyle(t, e) {
    const a = t.fillStyle;
    (typeof a != "string" || t.currentFillStyle != a) && (this.instructions.push(e.call(this, t)), t.currentFillStyle = a);
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @param {function(this:CanvasBuilder, import("../canvas.js").FillStrokeState): void} applyStroke Apply stroke.
   */
  updateStrokeStyle(t, e) {
    const a = t.strokeStyle, s = t.lineCap, l = t.lineDash, f = t.lineDashOffset, h = t.lineJoin, p = t.lineWidth, y = t.miterLimit;
    (t.currentStrokeStyle != a || t.currentLineCap != s || l != t.currentLineDash && !I0(t.currentLineDash, l) || t.currentLineDashOffset != f || t.currentLineJoin != h || t.currentLineWidth != p || t.currentMiterLimit != y) && (e.call(this, t), t.currentStrokeStyle = a, t.currentLineCap = s, t.currentLineDash = l, t.currentLineDashOffset = f, t.currentLineJoin = h, t.currentLineWidth = p, t.currentMiterLimit = y);
  }
  /**
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   */
  endGeometry(t) {
    this.beginGeometryInstruction1_[2] = this.instructions.length, this.beginGeometryInstruction1_ = null, this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length, this.beginGeometryInstruction2_ = null;
    const e = [Le.END_GEOMETRY, t];
    this.instructions.push(e), this.hitDetectionInstructions.push(e);
  }
  /**
   * Get the buffered rendering extent.  Rendering will be clipped to the extent
   * provided to the constructor.  To account for symbolizers that may intersect
   * this extent, we calculate a buffered extent (e.g. based on stroke width).
   * @return {import("../../extent.js").Extent} The buffered rendering extent.
   * @protected
   */
  getBufferedMaxExtent() {
    if (!this.bufferedMaxExtent_ && (this.bufferedMaxExtent_ = QL(this.maxExtent), this.maxLineWidth > 0)) {
      const t = this.resolution * (this.maxLineWidth + 1) / 2;
      Wb(this.bufferedMaxExtent_, t, this.bufferedMaxExtent_);
    }
    return this.bufferedMaxExtent_;
  }
}
class eK extends BS {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Maximum extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    super(t, e, a, s), this.hitDetectionImage_ = null, this.image_ = null, this.imagePixelRatio_ = void 0, this.anchorX_ = void 0, this.anchorY_ = void 0, this.height_ = void 0, this.opacity_ = void 0, this.originX_ = void 0, this.originY_ = void 0, this.rotateWithView_ = void 0, this.rotation_ = void 0, this.scale_ = void 0, this.width_ = void 0, this.declutterMode_ = void 0, this.declutterImageWithText_ = void 0;
  }
  /**
   * @param {import("../../geom/Point.js").default|import("../Feature.js").default} pointGeometry Point geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawPoint(t, e, a) {
    if (!this.image_ || this.maxExtent && !D_(this.maxExtent, t.getFlatCoordinates()))
      return;
    this.beginGeometry(t, e, a);
    const s = t.getFlatCoordinates(), l = t.getStride(), f = this.coordinates.length, h = this.appendFlatPointCoordinates(s, l);
    this.instructions.push([
      Le.DRAW_IMAGE,
      f,
      h,
      this.image_,
      // Remaining arguments to DRAW_IMAGE are in alphabetical order
      this.anchorX_ * this.imagePixelRatio_,
      this.anchorY_ * this.imagePixelRatio_,
      Math.ceil(this.height_ * this.imagePixelRatio_),
      this.opacity_,
      this.originX_ * this.imagePixelRatio_,
      this.originY_ * this.imagePixelRatio_,
      this.rotateWithView_,
      this.rotation_,
      [
        this.scale_[0] * this.pixelRatio / this.imagePixelRatio_,
        this.scale_[1] * this.pixelRatio / this.imagePixelRatio_
      ],
      Math.ceil(this.width_ * this.imagePixelRatio_),
      this.declutterMode_,
      this.declutterImageWithText_
    ]), this.hitDetectionInstructions.push([
      Le.DRAW_IMAGE,
      f,
      h,
      this.hitDetectionImage_,
      // Remaining arguments to DRAW_IMAGE are in alphabetical order
      this.anchorX_,
      this.anchorY_,
      this.height_,
      1,
      this.originX_,
      this.originY_,
      this.rotateWithView_,
      this.rotation_,
      this.scale_,
      this.width_,
      this.declutterMode_,
      this.declutterImageWithText_
    ]), this.endGeometry(e);
  }
  /**
   * @param {import("../../geom/MultiPoint.js").default|import("../Feature.js").default} multiPointGeometry MultiPoint geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawMultiPoint(t, e, a) {
    if (!this.image_)
      return;
    this.beginGeometry(t, e, a);
    const s = t.getFlatCoordinates(), l = [];
    for (let p = 0, y = s.length; p < y; p += t.getStride())
      (!this.maxExtent || D_(this.maxExtent, s.slice(p, p + 2))) && l.push(
        s[p],
        s[p + 1]
      );
    const f = this.coordinates.length, h = this.appendFlatPointCoordinates(l, 2);
    this.instructions.push([
      Le.DRAW_IMAGE,
      f,
      h,
      this.image_,
      // Remaining arguments to DRAW_IMAGE are in alphabetical order
      this.anchorX_ * this.imagePixelRatio_,
      this.anchorY_ * this.imagePixelRatio_,
      Math.ceil(this.height_ * this.imagePixelRatio_),
      this.opacity_,
      this.originX_ * this.imagePixelRatio_,
      this.originY_ * this.imagePixelRatio_,
      this.rotateWithView_,
      this.rotation_,
      [
        this.scale_[0] * this.pixelRatio / this.imagePixelRatio_,
        this.scale_[1] * this.pixelRatio / this.imagePixelRatio_
      ],
      Math.ceil(this.width_ * this.imagePixelRatio_),
      this.declutterMode_,
      this.declutterImageWithText_
    ]), this.hitDetectionInstructions.push([
      Le.DRAW_IMAGE,
      f,
      h,
      this.hitDetectionImage_,
      // Remaining arguments to DRAW_IMAGE are in alphabetical order
      this.anchorX_,
      this.anchorY_,
      this.height_,
      1,
      this.originX_,
      this.originY_,
      this.rotateWithView_,
      this.rotation_,
      this.scale_,
      this.width_,
      this.declutterMode_,
      this.declutterImageWithText_
    ]), this.endGeometry(e);
  }
  /**
   * @return {import("../canvas.js").SerializableInstructions} the serializable instructions.
   * @override
   */
  finish() {
    return this.reverseHitDetectionInstructions(), this.anchorX_ = void 0, this.anchorY_ = void 0, this.hitDetectionImage_ = null, this.image_ = null, this.imagePixelRatio_ = void 0, this.height_ = void 0, this.scale_ = void 0, this.opacity_ = void 0, this.originX_ = void 0, this.originY_ = void 0, this.rotateWithView_ = void 0, this.rotation_ = void 0, this.width_ = void 0, super.finish();
  }
  /**
   * @param {import("../../style/Image.js").default} imageStyle Image style.
   * @param {Object} [sharedData] Shared data.
   * @override
   */
  setImageStyle(t, e) {
    const a = t.getAnchor(), s = t.getSize(), l = t.getOrigin();
    this.imagePixelRatio_ = t.getPixelRatio(this.pixelRatio), this.anchorX_ = a[0], this.anchorY_ = a[1], this.hitDetectionImage_ = t.getHitDetectionImage(), this.image_ = t.getImage(this.pixelRatio), this.height_ = s[1], this.opacity_ = t.getOpacity(), this.originX_ = l[0], this.originY_ = l[1], this.rotateWithView_ = t.getRotateWithView(), this.rotation_ = t.getRotation(), this.scale_ = t.getScaleArray(), this.width_ = s[0], this.declutterMode_ = t.getDeclutterMode(), this.declutterImageWithText_ = e;
  }
}
class nK extends BS {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Maximum extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    super(t, e, a, s);
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {number} end End.
   * @param {number} stride Stride.
   * @private
   * @return {number} end.
   */
  drawFlatCoordinates_(t, e, a, s) {
    const l = this.coordinates.length, f = this.appendFlatLineCoordinates(
      t,
      e,
      a,
      s,
      !1,
      !1
    ), h = [
      Le.MOVE_TO_LINE_TO,
      l,
      f
    ];
    return this.instructions.push(h), this.hitDetectionInstructions.push(h), a;
  }
  /**
   * @param {import("../../geom/LineString.js").default|import("../Feature.js").default} lineStringGeometry Line string geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawLineString(t, e, a) {
    const s = this.state, l = s.strokeStyle, f = s.lineWidth;
    if (l === void 0 || f === void 0)
      return;
    this.updateStrokeStyle(s, this.applyStroke), this.beginGeometry(t, e, a), this.hitDetectionInstructions.push(
      [
        Le.SET_STROKE_STYLE,
        s.strokeStyle,
        s.lineWidth,
        s.lineCap,
        s.lineJoin,
        s.miterLimit,
        lm,
        um
      ],
      S_
    );
    const h = t.getFlatCoordinates(), p = t.getStride();
    this.drawFlatCoordinates_(
      h,
      0,
      h.length,
      p
    ), this.hitDetectionInstructions.push(g0), this.endGeometry(e);
  }
  /**
   * @param {import("../../geom/MultiLineString.js").default|import("../Feature.js").default} multiLineStringGeometry MultiLineString geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawMultiLineString(t, e, a) {
    const s = this.state, l = s.strokeStyle, f = s.lineWidth;
    if (l === void 0 || f === void 0)
      return;
    this.updateStrokeStyle(s, this.applyStroke), this.beginGeometry(t, e, a), this.hitDetectionInstructions.push(
      [
        Le.SET_STROKE_STYLE,
        s.strokeStyle,
        s.lineWidth,
        s.lineCap,
        s.lineJoin,
        s.miterLimit,
        lm,
        um
      ],
      S_
    );
    const h = t.getEnds(), p = t.getFlatCoordinates(), y = t.getStride();
    let b = 0;
    for (let x = 0, w = h.length; x < w; ++x)
      b = this.drawFlatCoordinates_(
        p,
        b,
        /** @type {number} */
        h[x],
        y
      );
    this.hitDetectionInstructions.push(g0), this.endGeometry(e);
  }
  /**
   * @return {import("../canvas.js").SerializableInstructions} the serializable instructions.
   * @override
   */
  finish() {
    const t = this.state;
    return t.lastStroke != null && t.lastStroke != this.coordinates.length && this.instructions.push(g0), this.reverseHitDetectionInstructions(), this.state = null, super.finish();
  }
  /**
   * @param {import("../canvas.js").FillStrokeState} state State.
   * @override
   */
  applyStroke(t) {
    t.lastStroke != null && t.lastStroke != this.coordinates.length && (this.instructions.push(g0), t.lastStroke = this.coordinates.length), t.lastStroke = 0, super.applyStroke(t), this.instructions.push(S_);
  }
}
class gL extends BS {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Maximum extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    super(t, e, a, s);
  }
  /**
   * @param {Array<number>} flatCoordinates Flat coordinates.
   * @param {number} offset Offset.
   * @param {Array<number>} ends Ends.
   * @param {number} stride Stride.
   * @private
   * @return {number} End.
   */
  drawFlatCoordinatess_(t, e, a, s) {
    const l = this.state, f = l.fillStyle !== void 0, h = l.strokeStyle !== void 0, p = a.length;
    this.instructions.push(S_), this.hitDetectionInstructions.push(S_);
    for (let y = 0; y < p; ++y) {
      const b = a[y], x = this.coordinates.length, w = this.appendFlatLineCoordinates(
        t,
        e,
        b,
        s,
        !0,
        !h
      ), A = [
        Le.MOVE_TO_LINE_TO,
        x,
        w
      ];
      this.instructions.push(A), this.hitDetectionInstructions.push(A), h && (this.instructions.push(dL), this.hitDetectionInstructions.push(dL)), e = b;
    }
    return f && (this.instructions.push(oT), this.hitDetectionInstructions.push(oT)), h && (this.instructions.push(g0), this.hitDetectionInstructions.push(g0)), e;
  }
  /**
   * @param {import("../../geom/Circle.js").default} circleGeometry Circle geometry.
   * @param {import("../../Feature.js").default} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawCircle(t, e, a) {
    const s = this.state, l = s.fillStyle, f = s.strokeStyle;
    if (l === void 0 && f === void 0)
      return;
    this.setFillStrokeStyles_(), this.beginGeometry(t, e, a), s.fillStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_FILL_STYLE,
      ll
    ]), s.strokeStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_STROKE_STYLE,
      s.strokeStyle,
      s.lineWidth,
      s.lineCap,
      s.lineJoin,
      s.miterLimit,
      lm,
      um
    ]);
    const h = t.getFlatCoordinates(), p = t.getStride(), y = this.coordinates.length;
    this.appendFlatLineCoordinates(
      h,
      0,
      h.length,
      p,
      !1,
      !1
    );
    const b = [Le.CIRCLE, y];
    this.instructions.push(S_, b), this.hitDetectionInstructions.push(S_, b), s.fillStyle !== void 0 && (this.instructions.push(oT), this.hitDetectionInstructions.push(oT)), s.strokeStyle !== void 0 && (this.instructions.push(g0), this.hitDetectionInstructions.push(g0)), this.endGeometry(e);
  }
  /**
   * @param {import("../../geom/Polygon.js").default|import("../Feature.js").default} polygonGeometry Polygon geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawPolygon(t, e, a) {
    const s = this.state, l = s.fillStyle, f = s.strokeStyle;
    if (l === void 0 && f === void 0)
      return;
    this.setFillStrokeStyles_(), this.beginGeometry(t, e, a), s.fillStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_FILL_STYLE,
      ll
    ]), s.strokeStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_STROKE_STYLE,
      s.strokeStyle,
      s.lineWidth,
      s.lineCap,
      s.lineJoin,
      s.miterLimit,
      lm,
      um
    ]);
    const h = t.getEnds(), p = t.getOrientedFlatCoordinates(), y = t.getStride();
    this.drawFlatCoordinatess_(
      p,
      0,
      /** @type {Array<number>} */
      h,
      y
    ), this.endGeometry(e);
  }
  /**
   * @param {import("../../geom/MultiPolygon.js").default} multiPolygonGeometry MultiPolygon geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawMultiPolygon(t, e, a) {
    const s = this.state, l = s.fillStyle, f = s.strokeStyle;
    if (l === void 0 && f === void 0)
      return;
    this.setFillStrokeStyles_(), this.beginGeometry(t, e, a), s.fillStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_FILL_STYLE,
      ll
    ]), s.strokeStyle !== void 0 && this.hitDetectionInstructions.push([
      Le.SET_STROKE_STYLE,
      s.strokeStyle,
      s.lineWidth,
      s.lineCap,
      s.lineJoin,
      s.miterLimit,
      lm,
      um
    ]);
    const h = t.getEndss(), p = t.getOrientedFlatCoordinates(), y = t.getStride();
    let b = 0;
    for (let x = 0, w = h.length; x < w; ++x)
      b = this.drawFlatCoordinatess_(
        p,
        b,
        h[x],
        y
      );
    this.endGeometry(e);
  }
  /**
   * @return {import("../canvas.js").SerializableInstructions} the serializable instructions.
   * @override
   */
  finish() {
    this.reverseHitDetectionInstructions(), this.state = null;
    const t = this.tolerance;
    if (t !== 0) {
      const e = this.coordinates;
      for (let a = 0, s = e.length; a < s; ++a)
        e[a] = g_(e[a], t);
    }
    return super.finish();
  }
  /**
   * @private
   */
  setFillStrokeStyles_() {
    const t = this.state;
    this.updateFillStyle(t, this.createFill), this.updateStrokeStyle(t, this.applyStroke);
  }
}
function iK(n, t, e, a, s) {
  const l = [];
  let f = e, h = 0, p = t.slice(e, 2);
  for (; h < n && f + s < a; ) {
    const [y, b] = p.slice(-2), x = t[f + s], w = t[f + s + 1], A = Math.sqrt(
      (x - y) * (x - y) + (w - b) * (w - b)
    );
    if (h += A, h >= n) {
      const C = (n - h + A) / A, L = Tc(y, x, C), N = Tc(b, w, C);
      p.push(L, N), l.push(p), p = [L, N], h == n && (f += s), h = 0;
    } else if (h < n)
      p.push(
        t[f + s],
        t[f + s + 1]
      ), f += s;
    else {
      const C = A - h, L = Tc(y, x, C / A), N = Tc(b, w, C / A);
      p.push(L, N), l.push(p), p = [L, N], h = 0, f += s;
    }
  }
  return h > 0 && l.push(p), l;
}
function aK(n, t, e, a, s) {
  let l = e, f = e, h = 0, p = 0, y = e, b, x, w, A, C, L, N, U, k, H;
  for (x = e; x < a; x += s) {
    const B = t[x], z = t[x + 1];
    C !== void 0 && (k = B - C, H = z - L, A = Math.sqrt(k * k + H * H), N !== void 0 && (p += w, b = Math.acos((N * k + U * H) / (w * A)), b > n && (p > h && (h = p, l = y, f = x), p = 0, y = x - s)), w = A, N = k, U = H), C = B, L = z;
  }
  return p += A, p > h ? [y, x] : [l, f];
}
const JT = {
  left: 0,
  center: 0.5,
  right: 1,
  top: 0,
  middle: 0.5,
  hanging: 0.2,
  alphabetic: 0.8,
  ideographic: 0.8,
  bottom: 1
};
class rK extends BS {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Maximum extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    super(t, e, a, s), this.labels_ = null, this.text_ = "", this.textOffsetX_ = 0, this.textOffsetY_ = 0, this.textRotateWithView_ = void 0, this.textKeepUpright_ = void 0, this.textRotation_ = 0, this.textFillState_ = null, this.fillStates = {}, this.fillStates[ll] = { fillStyle: ll }, this.textStrokeState_ = null, this.strokeStates = {}, this.textState_ = /** @type {import("../canvas.js").TextState} */
    {}, this.textStates = {}, this.textKey_ = "", this.fillKey_ = "", this.strokeKey_ = "", this.declutterMode_ = void 0, this.declutterImageWithText_ = void 0;
  }
  /**
   * @return {import("../canvas.js").SerializableInstructions} the serializable instructions.
   * @override
   */
  finish() {
    const t = super.finish();
    return t.textStates = this.textStates, t.fillStates = this.fillStates, t.strokeStates = this.strokeStates, t;
  }
  /**
   * @param {import("../../geom/SimpleGeometry.js").default|import("../Feature.js").default} geometry Geometry.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @param {number} [index] Render order index.
   * @override
   */
  drawText(t, e, a) {
    const s = this.textFillState_, l = this.textStrokeState_, f = this.textState_;
    if (this.text_ === "" || !f || !s && !l)
      return;
    const h = this.coordinates;
    let p = h.length;
    const y = t.getType();
    let b = null, x = t.getStride();
    if (f.placement === "line" && (y == "LineString" || y == "MultiLineString" || y == "Polygon" || y == "MultiPolygon")) {
      if (!Co(this.maxExtent, t.getExtent()))
        return;
      let w;
      if (b = t.getFlatCoordinates(), y == "LineString")
        w = [b.length];
      else if (y == "MultiLineString")
        w = /** @type {import("../../geom/MultiLineString.js").default} */
        t.getEnds();
      else if (y == "Polygon")
        w = /** @type {import("../../geom/Polygon.js").default} */
        t.getEnds().slice(0, 1);
      else if (y == "MultiPolygon") {
        const N = (
          /** @type {import("../../geom/MultiPolygon.js").default} */
          t.getEndss()
        );
        w = [];
        for (let U = 0, k = N.length; U < k; ++U)
          w.push(N[U][0]);
      }
      this.beginGeometry(t, e, a);
      const A = f.repeat, C = A ? void 0 : f.textAlign;
      let L = 0;
      for (let N = 0, U = w.length; N < U; ++N) {
        let k;
        A ? k = iK(
          A * this.resolution,
          b,
          L,
          w[N],
          x
        ) : k = [b.slice(L, w[N])];
        for (let H = 0, B = k.length; H < B; ++H) {
          const z = k[H];
          let Q = 0, et = z.length;
          if (C == null) {
            const pt = aK(
              f.maxAngle,
              z,
              0,
              z.length,
              2
            );
            Q = pt[0], et = pt[1];
          }
          for (let pt = Q; pt < et; pt += x)
            h.push(z[pt], z[pt + 1]);
          const ot = h.length;
          L = w[N], this.drawChars_(p, ot), p = ot;
        }
      }
      this.endGeometry(e);
    } else {
      let w = f.overflow ? null : [];
      switch (y) {
        case "Point":
        case "MultiPoint":
          b = /** @type {import("../../geom/MultiPoint.js").default} */
          t.getFlatCoordinates();
          break;
        case "LineString":
          b = /** @type {import("../../geom/LineString.js").default} */
          t.getFlatMidpoint();
          break;
        case "Circle":
          b = /** @type {import("../../geom/Circle.js").default} */
          t.getCenter();
          break;
        case "MultiLineString":
          b = /** @type {import("../../geom/MultiLineString.js").default} */
          t.getFlatMidpoints(), x = 2;
          break;
        case "Polygon":
          b = /** @type {import("../../geom/Polygon.js").default} */
          t.getFlatInteriorPoint(), f.overflow || w.push(b[2] / this.resolution), x = 3;
          break;
        case "MultiPolygon":
          const B = (
            /** @type {import("../../geom/MultiPolygon.js").default} */
            t.getFlatInteriorPoints()
          );
          b = [];
          for (let z = 0, Q = B.length; z < Q; z += 3)
            f.overflow || w.push(B[z + 2] / this.resolution), b.push(B[z], B[z + 1]);
          if (b.length === 0)
            return;
          x = 2;
          break;
      }
      const A = this.appendFlatPointCoordinates(b, x);
      if (A === p)
        return;
      if (w && (A - p) / 2 !== b.length / x) {
        let B = p / 2;
        w = w.filter((z, Q) => {
          const et = h[(B + Q) * 2] === b[Q * x] && h[(B + Q) * 2 + 1] === b[Q * x + 1];
          return et || --B, et;
        });
      }
      this.saveTextStates_();
      const C = f.backgroundFill ? this.createFill(this.fillStyleToState(f.backgroundFill)) : null, L = f.backgroundStroke ? this.createStroke(this.strokeStyleToState(f.backgroundStroke)) : null;
      this.beginGeometry(t, e, a);
      let N = f.padding;
      if (N != b_ && (f.scale[0] < 0 || f.scale[1] < 0)) {
        let B = f.padding[0], z = f.padding[1], Q = f.padding[2], et = f.padding[3];
        f.scale[0] < 0 && (z = -z, et = -et), f.scale[1] < 0 && (B = -B, Q = -Q), N = [B, z, Q, et];
      }
      const U = this.pixelRatio;
      this.instructions.push([
        Le.DRAW_IMAGE,
        p,
        A,
        null,
        NaN,
        NaN,
        NaN,
        1,
        0,
        0,
        this.textRotateWithView_,
        this.textRotation_,
        [1, 1],
        NaN,
        this.declutterMode_,
        this.declutterImageWithText_,
        N == b_ ? b_ : N.map(function(B) {
          return B * U;
        }),
        C,
        L,
        this.text_,
        this.textKey_,
        this.strokeKey_,
        this.fillKey_,
        this.textOffsetX_,
        this.textOffsetY_,
        w
      ]);
      const k = 1 / U, H = C ? C.slice(0) : null;
      H && (H[1] = ll), this.hitDetectionInstructions.push([
        Le.DRAW_IMAGE,
        p,
        A,
        null,
        NaN,
        NaN,
        NaN,
        1,
        0,
        0,
        this.textRotateWithView_,
        this.textRotation_,
        [k, k],
        NaN,
        this.declutterMode_,
        this.declutterImageWithText_,
        N,
        H,
        L,
        this.text_,
        this.textKey_,
        this.strokeKey_,
        this.fillKey_ ? ll : this.fillKey_,
        this.textOffsetX_,
        this.textOffsetY_,
        w
      ]), this.endGeometry(e);
    }
  }
  /**
   * @private
   */
  saveTextStates_() {
    const t = this.textStrokeState_, e = this.textState_, a = this.textFillState_, s = this.strokeKey_;
    t && (s in this.strokeStates || (this.strokeStates[s] = {
      strokeStyle: t.strokeStyle,
      lineCap: t.lineCap,
      lineDashOffset: t.lineDashOffset,
      lineWidth: t.lineWidth,
      lineJoin: t.lineJoin,
      miterLimit: t.miterLimit,
      lineDash: t.lineDash
    }));
    const l = this.textKey_;
    l in this.textStates || (this.textStates[l] = {
      font: e.font,
      textAlign: e.textAlign || dS,
      justify: e.justify,
      textBaseline: e.textBaseline || WT,
      scale: e.scale
    });
    const f = this.fillKey_;
    a && (f in this.fillStates || (this.fillStates[f] = {
      fillStyle: a.fillStyle
    }));
  }
  /**
   * @private
   * @param {number} begin Begin.
   * @param {number} end End.
   */
  drawChars_(t, e) {
    const a = this.textStrokeState_, s = this.textState_, l = this.strokeKey_, f = this.textKey_, h = this.fillKey_;
    this.saveTextStates_();
    const p = this.pixelRatio, y = JT[s.textBaseline], b = this.textOffsetY_ * p, x = this.text_, w = a ? a.lineWidth * Math.abs(s.scale[0]) / 2 : 0;
    this.instructions.push([
      Le.DRAW_CHARS,
      t,
      e,
      y,
      s.overflow,
      h,
      s.maxAngle,
      p,
      b,
      l,
      w * p,
      x,
      f,
      1,
      this.declutterMode_,
      this.textKeepUpright_
    ]), this.hitDetectionInstructions.push([
      Le.DRAW_CHARS,
      t,
      e,
      y,
      s.overflow,
      h && ll,
      s.maxAngle,
      p,
      b,
      l,
      w * p,
      x,
      f,
      1 / p,
      this.declutterMode_,
      this.textKeepUpright_
    ]);
  }
  /**
   * @param {import("../../style/Text.js").default} textStyle Text style.
   * @param {Object} [sharedData] Shared data.
   * @override
   */
  setTextStyle(t, e) {
    let a, s, l;
    if (!t)
      this.text_ = "";
    else {
      const f = t.getFill();
      f ? (s = this.textFillState_, s || (s = /** @type {import("../canvas.js").FillState} */
      {}, this.textFillState_ = s), s.fillStyle = rd(
        f.getColor() || ll
      )) : (s = null, this.textFillState_ = s);
      const h = t.getStroke();
      if (!h)
        l = null, this.textStrokeState_ = l;
      else {
        l = this.textStrokeState_, l || (l = /** @type {import("../canvas.js").StrokeState} */
        {}, this.textStrokeState_ = l);
        const L = h.getLineDash(), N = h.getLineDashOffset(), U = h.getWidth(), k = h.getMiterLimit();
        l.lineCap = h.getLineCap() || hE, l.lineDash = L ? L.slice() : lm, l.lineDashOffset = N === void 0 ? um : N, l.lineJoin = h.getLineJoin() || dE, l.lineWidth = U === void 0 ? gS : U, l.miterLimit = k === void 0 ? fS : k, l.strokeStyle = rd(
          h.getColor() || hS
        );
      }
      a = this.textState_;
      const p = t.getFont() || Q2;
      wX(p);
      const y = t.getScaleArray();
      a.overflow = t.getOverflow(), a.font = p, a.maxAngle = t.getMaxAngle(), a.placement = t.getPlacement(), a.textAlign = t.getTextAlign(), a.repeat = t.getRepeat(), a.justify = t.getJustify(), a.textBaseline = t.getTextBaseline() || WT, a.backgroundFill = t.getBackgroundFill(), a.backgroundStroke = t.getBackgroundStroke(), a.padding = t.getPadding() || b_, a.scale = y === void 0 ? [1, 1] : y;
      const b = t.getOffsetX(), x = t.getOffsetY(), w = t.getRotateWithView(), A = t.getKeepUpright(), C = t.getRotation();
      this.text_ = t.getText() || "", this.textOffsetX_ = b === void 0 ? 0 : b, this.textOffsetY_ = x === void 0 ? 0 : x, this.textRotateWithView_ = w === void 0 ? !1 : w, this.textKeepUpright_ = A === void 0 ? !0 : A, this.textRotation_ = C === void 0 ? 0 : C, this.strokeKey_ = l ? (typeof l.strokeStyle == "string" ? l.strokeStyle : si(l.strokeStyle)) + l.lineCap + l.lineDashOffset + "|" + l.lineWidth + l.lineJoin + l.miterLimit + "[" + l.lineDash.join() + "]" : "", this.textKey_ = a.font + a.scale + (a.textAlign || "?") + (a.repeat || "?") + (a.justify || "?") + (a.textBaseline || "?"), this.fillKey_ = s && s.fillStyle ? typeof s.fillStyle == "string" ? s.fillStyle : "|" + si(s.fillStyle) : "";
    }
    this.declutterMode_ = t.getDeclutterMode(), this.declutterImageWithText_ = e;
  }
}
const sK = {
  Circle: gL,
  Default: BS,
  Image: eK,
  LineString: nK,
  Polygon: gL,
  Text: rK
};
class oK {
  /**
   * @param {number} tolerance Tolerance.
   * @param {import("../../extent.js").Extent} maxExtent Max extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   */
  constructor(t, e, a, s) {
    this.tolerance_ = t, this.maxExtent_ = e, this.pixelRatio_ = s, this.resolution_ = a, this.buildersByZIndex_ = {};
  }
  /**
   * @return {!Object<string, !Object<import("../canvas.js").BuilderType, import("./Builder.js").SerializableInstructions>>} The serializable instructions
   */
  finish() {
    const t = {};
    for (const e in this.buildersByZIndex_) {
      t[e] = t[e] || {};
      const a = this.buildersByZIndex_[e];
      for (const s in a) {
        const l = a[s].finish();
        t[e][s] = l;
      }
    }
    return t;
  }
  /**
   * @param {number|undefined} zIndex Z index.
   * @param {import("../canvas.js").BuilderType} builderType Replay type.
   * @return {import("../VectorContext.js").default} Replay.
   */
  getBuilder(t, e) {
    const a = t !== void 0 ? t.toString() : "0";
    let s = this.buildersByZIndex_[a];
    s === void 0 && (s = {}, this.buildersByZIndex_[a] = s);
    let l = s[e];
    if (l === void 0) {
      const f = sK[e];
      l = new f(
        this.tolerance_,
        this.maxExtent_,
        this.resolution_,
        this.pixelRatio_
      ), s[e] = l;
    }
    return l;
  }
}
function lK(n, t, e, a, s, l, f, h, p, y, b, x, w = !0) {
  let A = n[t], C = n[t + 1], L = 0, N = 0, U = 0, k = 0;
  function H() {
    L = A, N = C, t += a, A = n[t], C = n[t + 1], k += U, U = Math.sqrt((A - L) * (A - L) + (C - N) * (C - N));
  }
  do
    H();
  while (t < e - a && k + U < l);
  let B = U === 0 ? 0 : (l - k) / U;
  const z = Tc(L, A, B), Q = Tc(N, C, B), et = t - a, ot = k, pt = l + h * p(y, s, b);
  for (; t < e - a && k + U < pt; )
    H();
  B = U === 0 ? 0 : (pt - k) / U;
  const ht = Tc(L, A, B), Ct = Tc(N, C, B);
  let mt = !1;
  if (w)
    if (x) {
      const J = [z, Q, ht, Ct];
      C2(J, 0, 4, 2, x, J, J), mt = J[0] > J[2];
    } else
      mt = z > ht;
  const St = Math.PI, Ut = [], Ft = et + a === t;
  t = et, U = 0, k = ot, A = n[t], C = n[t + 1];
  let nt;
  if (Ft) {
    H(), nt = Math.atan2(C - N, A - L), mt && (nt += nt > 0 ? -St : St);
    const J = (ht + z) / 2, gt = (Ct + Q) / 2;
    return Ut[0] = [J, gt, (pt - l) / 2, nt, s], Ut;
  }
  s = s.replace(/\n/g, " ");
  for (let J = 0, gt = s.length; J < gt; ) {
    H();
    let Ot = Math.atan2(C - N, A - L);
    if (mt && (Ot += Ot > 0 ? -St : St), nt !== void 0) {
      let Dt = Ot - nt;
      if (Dt += Dt > St ? -2 * St : Dt < -St ? 2 * St : 0, Math.abs(Dt) > f)
        return null;
    }
    nt = Ot;
    const W = J;
    let j = 0;
    for (; J < gt; ++J) {
      const Dt = mt ? gt - J - 1 : J, It = h * p(y, s[Dt], b);
      if (t + a < e && k + U < l + j + It / 2)
        break;
      j += It;
    }
    if (J === W)
      continue;
    const X = mt ? s.substring(gt - W, gt - J) : s.substring(W, J);
    B = U === 0 ? 0 : (l + j / 2 - k) / U;
    const st = Tc(L, A, B), At = Tc(N, C, B);
    Ut.push([st, At, j / 2, Ot, X]), l += j;
  }
  return Ut;
}
class l5 {
  constructor() {
    this.instructions_ = [], this.zIndex = 0, this.offset_ = 0, this.context_ = /** @type {ZIndexContextProxy} */
    new Proxy(ZT(), {
      get: (t, e) => {
        if (typeof /** @type {*} */
        ZT()[e] == "function")
          return this.push_(e), this.pushMethodArgs_;
      },
      set: (t, e, a) => (this.push_(e, a), !0)
    });
  }
  /**
   * @param {...*} args Arguments to push to the instructions array.
   * @private
   */
  push_(...t) {
    const e = this.instructions_, a = this.zIndex + this.offset_;
    e[a] || (e[a] = []), e[a].push(...t);
  }
  /**
   * @private
   * @param {...*} args Args.
   * @return {ZIndexContext} This.
   */
  pushMethodArgs_ = (...t) => (this.push_(t), this);
  /**
   * Push a function that renders to the context directly.
   * @param {function(CanvasRenderingContext2D): void} render Function.
   */
  pushFunction(t) {
    this.push_(t);
  }
  /**
   * Get a proxy for CanvasRenderingContext2D which does not support getting state
   * (e.g. `context.globalAlpha`, which will return `undefined`). To set state, if it relies on a
   * previous state (e.g. `context.globalAlpha = context.globalAlpha / 2`), set a function,
   * e.g. `context.globalAlpha = (context) => context.globalAlpha / 2`.
   * @return {ZIndexContextProxy} Context.
   */
  getContext() {
    return this.context_;
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   */
  draw(t) {
    this.instructions_.forEach((e) => {
      for (let a = 0, s = e.length; a < s; ++a) {
        const l = e[a];
        if (typeof l == "function") {
          l(t);
          continue;
        }
        const f = e[++a];
        if (typeof /** @type {*} */
        t[l] == "function")
          t[l](...f);
        else {
          if (typeof f == "function") {
            t[l] = f(t);
            continue;
          }
          t[l] = f;
        }
      }
    });
  }
  clear() {
    this.instructions_.length = 0, this.zIndex = 0, this.offset_ = 0;
  }
  /**
   * Offsets the zIndex by the highest current zIndex. Useful for rendering multiple worlds or tiles, to
   * avoid conflicting context.clip() or context.save()/restore() calls.
   */
  offset() {
    this.offset_ = this.instructions_.length, this.zIndex = 0;
  }
}
const x1 = uu(), a0 = [], Qg = [], Jg = [], r0 = [];
function mL(n) {
  return n[3].declutterBox;
}
const pL = new RegExp(
  /* eslint-disable prettier/prettier */
  "[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]"
  /* eslint-enable prettier/prettier */
);
function XA(n, t) {
  return t === "start" ? t = pL.test(n) ? "right" : "left" : t === "end" && (t = pL.test(n) ? "left" : "right"), JT[t];
}
function uK(n, t, e) {
  return e > 0 && n.push(`
`, ""), n.push(t, ""), n;
}
function cK(n, t, e) {
  return e % 2 === 0 && (n += t), n;
}
class fK {
  /**
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {boolean} overlaps The replay can have overlapping geometries.
   * @param {import("../canvas.js").SerializableInstructions} instructions The serializable instructions.
   * @param {boolean} [deferredRendering] Enable deferred rendering.
   */
  constructor(t, e, a, s, l) {
    this.overlaps = a, this.pixelRatio = e, this.resolution = t, this.alignAndScaleFill_, this.instructions = s.instructions, this.coordinates = s.coordinates, this.coordinateCache_ = {}, this.renderedTransform_ = Pf(), this.hitDetectionInstructions = s.hitDetectionInstructions, this.pixelCoordinates_ = null, this.viewRotation_ = 0, this.fillStates = s.fillStates || {}, this.strokeStates = s.strokeStates || {}, this.textStates = s.textStates || {}, this.widths_ = {}, this.labels_ = {}, this.zIndexContext_ = l ? new l5() : null;
  }
  /**
   * @return {ZIndexContext} ZIndex context.
   */
  getZIndexContext() {
    return this.zIndexContext_;
  }
  /**
   * @param {string|Array<string>} text Text.
   * @param {string} textKey Text style key.
   * @param {string} fillKey Fill style key.
   * @param {string} strokeKey Stroke style key.
   * @return {import("../canvas.js").Label} Label.
   */
  createLabel(t, e, a, s) {
    const l = t + e + a + s;
    if (this.labels_[l])
      return this.labels_[l];
    const f = s ? this.strokeStates[s] : null, h = a ? this.fillStates[a] : null, p = this.textStates[e], y = this.pixelRatio, b = [
      p.scale[0] * y,
      p.scale[1] * y
    ], x = p.justify ? JT[p.justify] : XA(
      Array.isArray(t) ? t[0] : t,
      p.textAlign || dS
    ), w = s && f.lineWidth ? f.lineWidth : 0, A = Array.isArray(t) ? t : String(t).split(`
`).reduce(uK, []), { width: C, height: L, widths: N, heights: U, lineWidths: k } = AX(
      p,
      A
    ), H = C + w, B = [], z = (H + 2) * b[0], Q = (L + w) * b[1], et = {
      width: z < 0 ? Math.floor(z) : Math.ceil(z),
      height: Q < 0 ? Math.floor(Q) : Math.ceil(Q),
      contextInstructions: B
    };
    (b[0] != 1 || b[1] != 1) && B.push("scale", b), s && (B.push("strokeStyle", f.strokeStyle), B.push("lineWidth", w), B.push("lineCap", f.lineCap), B.push("lineJoin", f.lineJoin), B.push("miterLimit", f.miterLimit), B.push("setLineDash", [f.lineDash]), B.push("lineDashOffset", f.lineDashOffset)), a && B.push("fillStyle", h.fillStyle), B.push("textBaseline", "middle"), B.push("textAlign", "center");
    const ot = 0.5 - x;
    let pt = x * H + ot * w;
    const ht = [], Ct = [];
    let mt = 0, St = 0, Ut = 0, Ft = 0, nt;
    for (let J = 0, gt = A.length; J < gt; J += 2) {
      const Ot = A[J];
      if (Ot === `
`) {
        St += mt, mt = 0, pt = x * H + ot * w, ++Ft;
        continue;
      }
      const W = A[J + 1] || p.font;
      W !== nt && (s && ht.push("font", W), a && Ct.push("font", W), nt = W), mt = Math.max(mt, U[Ut]);
      const j = [
        Ot,
        pt + ot * N[Ut] + x * (N[Ut] - k[Ft]),
        0.5 * (w + mt) + St
      ];
      pt += N[Ut], s && ht.push("strokeText", j), a && Ct.push("fillText", j), ++Ut;
    }
    return Array.prototype.push.apply(B, ht), Array.prototype.push.apply(B, Ct), this.labels_[l] = et, et;
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../coordinate.js").Coordinate} p1 1st point of the background box.
   * @param {import("../../coordinate.js").Coordinate} p2 2nd point of the background box.
   * @param {import("../../coordinate.js").Coordinate} p3 3rd point of the background box.
   * @param {import("../../coordinate.js").Coordinate} p4 4th point of the background box.
   * @param {Array<*>} fillInstruction Fill instruction.
   * @param {Array<*>} strokeInstruction Stroke instruction.
   */
  replayTextBackground_(t, e, a, s, l, f, h) {
    t.beginPath(), t.moveTo.apply(t, e), t.lineTo.apply(t, a), t.lineTo.apply(t, s), t.lineTo.apply(t, l), t.lineTo.apply(t, e), f && (this.alignAndScaleFill_ = /** @type {number} */
    f[2], t.fillStyle = /** @type {string} */
    f[1], this.fill_(t)), h && (this.setStrokeStyle_(
      t,
      /** @type {Array<*>} */
      h
    ), t.stroke());
  }
  /**
   * @private
   * @param {number} sheetWidth Width of the sprite sheet.
   * @param {number} sheetHeight Height of the sprite sheet.
   * @param {number} centerX X.
   * @param {number} centerY Y.
   * @param {number} width Width.
   * @param {number} height Height.
   * @param {number} anchorX Anchor X.
   * @param {number} anchorY Anchor Y.
   * @param {number} originX Origin X.
   * @param {number} originY Origin Y.
   * @param {number} rotation Rotation.
   * @param {import("../../size.js").Size} scale Scale.
   * @param {boolean} snapToPixel Snap to pixel.
   * @param {Array<number>} padding Padding.
   * @param {boolean} fillStroke Background fill or stroke.
   * @param {import("../../Feature.js").FeatureLike} feature Feature.
   * @return {ImageOrLabelDimensions} Dimensions for positioning and decluttering the image or label.
   */
  calculateImageOrLabelDimensions_(t, e, a, s, l, f, h, p, y, b, x, w, A, C, L, N) {
    h *= w[0], p *= w[1];
    let U = a - h, k = s - p;
    const H = l + y > t ? t - y : l, B = f + b > e ? e - b : f, z = C[3] + H * w[0] + C[1], Q = C[0] + B * w[1] + C[2], et = U - C[3], ot = k - C[0];
    (L || x !== 0) && (a0[0] = et, r0[0] = et, a0[1] = ot, Qg[1] = ot, Qg[0] = et + z, Jg[0] = Qg[0], Jg[1] = ot + Q, r0[1] = Jg[1]);
    let pt;
    return x !== 0 ? (pt = fd(
      Pf(),
      a,
      s,
      1,
      1,
      x,
      -a,
      -s
    ), Lr(pt, a0), Lr(pt, Qg), Lr(pt, Jg), Lr(pt, r0), cm(
      Math.min(a0[0], Qg[0], Jg[0], r0[0]),
      Math.min(a0[1], Qg[1], Jg[1], r0[1]),
      Math.max(a0[0], Qg[0], Jg[0], r0[0]),
      Math.max(a0[1], Qg[1], Jg[1], r0[1]),
      x1
    )) : cm(
      Math.min(et, et + z),
      Math.min(ot, ot + Q),
      Math.max(et, et + z),
      Math.max(ot, ot + Q),
      x1
    ), A && (U = Math.round(U), k = Math.round(k)), {
      drawImageX: U,
      drawImageY: k,
      drawImageW: H,
      drawImageH: B,
      originX: y,
      originY: b,
      declutterBox: {
        minX: x1[0],
        minY: x1[1],
        maxX: x1[2],
        maxY: x1[3],
        value: N
      },
      canvasTransform: pt,
      scale: w
    };
  }
  /**
   * @private
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import('../../size.js').Size} scaledCanvasSize Scaled canvas size.
   * @param {import("../canvas.js").Label|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} imageOrLabel Image.
   * @param {ImageOrLabelDimensions} dimensions Dimensions.
   * @param {number} opacity Opacity.
   * @param {Array<*>} fillInstruction Fill instruction.
   * @param {Array<*>} strokeInstruction Stroke instruction.
   * @return {boolean} The image or label was rendered.
   */
  replayImageOrLabel_(t, e, a, s, l, f, h) {
    const p = !!(f || h), y = s.declutterBox, b = h ? h[2] * s.scale[0] / 2 : 0;
    return y.minX - b <= e[0] && y.maxX + b >= 0 && y.minY - b <= e[1] && y.maxY + b >= 0 && (p && this.replayTextBackground_(
      t,
      a0,
      Qg,
      Jg,
      r0,
      /** @type {Array<*>} */
      f,
      /** @type {Array<*>} */
      h
    ), MX(
      t,
      s.canvasTransform,
      l,
      a,
      s.originX,
      s.originY,
      s.drawImageW,
      s.drawImageH,
      s.drawImageX,
      s.drawImageY,
      s.scale
    )), !0;
  }
  /**
   * @private
   * @param {CanvasRenderingContext2D} context Context.
   */
  fill_(t) {
    const e = this.alignAndScaleFill_;
    if (e) {
      const a = Lr(this.renderedTransform_, [0, 0]), s = 512 * this.pixelRatio;
      t.save(), t.translate(a[0] % s, a[1] % s), e !== 1 && t.scale(e, e), t.rotate(this.viewRotation_);
    }
    t.fill(), e && t.restore();
  }
  /**
   * @private
   * @param {CanvasRenderingContext2D} context Context.
   * @param {Array<*>} instruction Instruction.
   */
  setStrokeStyle_(t, e) {
    t.strokeStyle = /** @type {import("../../colorlike.js").ColorLike} */
    e[1], e[1] && (t.lineWidth = /** @type {number} */
    e[2], t.lineCap = /** @type {CanvasLineCap} */
    e[3], t.lineJoin = /** @type {CanvasLineJoin} */
    e[4], t.miterLimit = /** @type {number} */
    e[5], t.lineDashOffset = /** @type {number} */
    e[7], t.setLineDash(
      /** @type {Array<number>} */
      e[6]
    ));
  }
  /**
   * @private
   * @param {string|Array<string>} text The text to draw.
   * @param {string} textKey The key of the text state.
   * @param {string} strokeKey The key for the stroke state.
   * @param {string} fillKey The key for the fill state.
   * @return {{label: import("../canvas.js").Label, anchorX: number, anchorY: number}} The text image and its anchor.
   */
  drawLabelWithPointPlacement_(t, e, a, s) {
    const l = this.textStates[e], f = this.createLabel(t, e, s, a), h = this.strokeStates[a], p = this.pixelRatio, y = XA(
      Array.isArray(t) ? t[0] : t,
      l.textAlign || dS
    ), b = JT[l.textBaseline || WT], x = h && h.lineWidth ? h.lineWidth : 0, w = f.width / p - 2 * l.scale[0], A = y * w + 2 * (0.5 - y) * x, C = b * f.height / p + 2 * (0.5 - b) * x;
    return {
      label: f,
      anchorX: A,
      anchorY: C
    };
  }
  /**
   * @private
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import('../../size.js').Size} scaledCanvasSize Scaled canvas size
   * @param {import("../../transform.js").Transform} transform Transform.
   * @param {Array<*>} instructions Instructions array.
   * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.
   * @param {FeatureCallback<T>} [featureCallback] Feature callback.
   * @param {import("../../extent.js").Extent} [hitExtent] Only check
   *     features that intersect this extent.
   * @param {import("rbush").default<DeclutterEntry>} [declutterTree] Declutter tree.
   * @return {T|undefined} Callback result.
   * @template T
   */
  execute_(t, e, a, s, l, f, h, p) {
    const y = this.zIndexContext_;
    let b;
    this.pixelCoordinates_ && I0(a, this.renderedTransform_) ? b = this.pixelCoordinates_ : (this.pixelCoordinates_ || (this.pixelCoordinates_ = []), b = v0(
      this.coordinates,
      0,
      this.coordinates.length,
      2,
      a,
      this.pixelCoordinates_
    ), C$(this.renderedTransform_, a));
    let x = 0;
    const w = s.length;
    let A = 0, C, L, N, U, k, H, B, z, Q, et, ot, pt, ht, Ct = 0, mt = 0;
    const St = this.coordinateCache_, Ut = this.viewRotation_, Ft = Math.round(Math.atan2(-a[1], a[0]) * 1e12) / 1e12, nt = (
      /** @type {import("../../render.js").State} */
      {
        context: t,
        pixelRatio: this.pixelRatio,
        resolution: this.resolution,
        rotation: Ut
      }
    ), J = this.instructions != s || this.overlaps ? 0 : 200;
    let gt, Ot, W, j;
    for (; x < w; ) {
      const X = s[x];
      switch (
        /** @type {import("./Instruction.js").default} */
        X[0]
      ) {
        case Le.BEGIN_GEOMETRY:
          gt = /** @type {import("../../Feature.js").FeatureLike} */
          X[1], j = X[3], gt.getGeometry() ? h !== void 0 && !Co(h, j.getExtent()) ? x = /** @type {number} */
          X[2] + 1 : ++x : x = /** @type {number} */
          X[2], y && (y.zIndex = X[4]);
          break;
        case Le.BEGIN_PATH:
          Ct > J && (this.fill_(t), Ct = 0), mt > J && (t.stroke(), mt = 0), !Ct && !mt && (t.beginPath(), k = NaN, H = NaN), ++x;
          break;
        case Le.CIRCLE:
          A = /** @type {number} */
          X[1];
          const At = b[A], Dt = b[A + 1], It = b[A + 2], $t = b[A + 3], Qt = It - At, ee = $t - Dt, ce = Math.sqrt(Qt * Qt + ee * ee);
          t.moveTo(At + ce, Dt), t.arc(At, Dt, ce, 0, 2 * Math.PI, !0), ++x;
          break;
        case Le.CLOSE_PATH:
          t.closePath(), ++x;
          break;
        case Le.CUSTOM:
          A = /** @type {number} */
          X[1], C = X[2];
          const pe = (
            /** @type {import("../../geom/SimpleGeometry.js").default} */
            X[3]
          ), Mn = X[4], te = X[5];
          nt.geometry = pe, nt.feature = gt, x in St || (St[x] = []);
          const tn = St[x];
          te ? te(b, A, C, 2, tn) : (tn[0] = b[A], tn[1] = b[A + 1], tn.length = 2), y && (y.zIndex = X[6]), Mn(tn, nt), ++x;
          break;
        case Le.DRAW_IMAGE:
          A = /** @type {number} */
          X[1], C = /** @type {number} */
          X[2], Q = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */
          X[3], L = /** @type {number} */
          X[4], N = /** @type {number} */
          X[5];
          let Jn = (
            /** @type {number} */
            X[6]
          );
          const Pi = (
            /** @type {number} */
            X[7]
          ), Ge = (
            /** @type {number} */
            X[8]
          ), pa = (
            /** @type {number} */
            X[9]
          ), ka = (
            /** @type {boolean} */
            X[10]
          );
          let Ai = (
            /** @type {number} */
            X[11]
          );
          const fe = (
            /** @type {import("../../size.js").Size} */
            X[12]
          );
          let Zi = (
            /** @type {number} */
            X[13]
          );
          U = X[14] || "declutter";
          const Dn = (
            /** @type {{args: import("../canvas.js").DeclutterImageWithText, declutterMode: import('../../style/Style.js').DeclutterMode}} */
            X[15]
          );
          if (!Q && X.length >= 20) {
            et = /** @type {string} */
            X[19], ot = /** @type {string} */
            X[20], pt = /** @type {string} */
            X[21], ht = /** @type {string} */
            X[22];
            const Pe = this.drawLabelWithPointPlacement_(
              et,
              ot,
              pt,
              ht
            );
            Q = Pe.label, X[3] = Q;
            const Ae = (
              /** @type {number} */
              X[23]
            );
            L = (Pe.anchorX - Ae) * this.pixelRatio, X[4] = L;
            const xn = (
              /** @type {number} */
              X[24]
            );
            N = (Pe.anchorY - xn) * this.pixelRatio, X[5] = N, Jn = Q.height, X[6] = Jn, Zi = Q.width, X[13] = Zi;
          }
          let nr;
          X.length > 25 && (nr = /** @type {number} */
          X[25]);
          let mr, Ha, ti;
          X.length > 17 ? (mr = /** @type {Array<number>} */
          X[16], Ha = /** @type {Array<*>} */
          X[17], ti = /** @type {Array<*>} */
          X[18]) : (mr = b_, Ha = null, ti = null), ka && Ft ? Ai += Ut : !ka && !Ft && (Ai -= Ut);
          let zi = 0;
          for (; A < C; A += 2) {
            if (nr && nr[zi++] < Zi / this.pixelRatio)
              continue;
            const Pe = this.calculateImageOrLabelDimensions_(
              Q.width,
              Q.height,
              b[A],
              b[A + 1],
              Zi,
              Jn,
              L,
              N,
              Ge,
              pa,
              Ai,
              fe,
              l,
              mr,
              !!Ha || !!ti,
              gt
            ), Ae = [
              t,
              e,
              Q,
              Pe,
              Pi,
              Ha,
              ti
            ];
            if (p) {
              let xn, Wi, ar;
              if (Dn) {
                const cn = C - A;
                if (!Dn[cn]) {
                  Dn[cn] = { args: Ae, declutterMode: U };
                  continue;
                }
                const Si = Dn[cn];
                xn = Si.args, Wi = Si.declutterMode, delete Dn[cn], ar = mL(xn);
              }
              let oa, un;
              if (xn && (Wi !== "declutter" || !p.collides(ar)) && (oa = !0), (U !== "declutter" || !p.collides(Pe.declutterBox)) && (un = !0), Wi === "declutter" && U === "declutter") {
                const cn = oa && un;
                oa = cn, un = cn;
              }
              oa && (Wi !== "none" && p.insert(ar), this.replayImageOrLabel_.apply(this, xn)), un && (U !== "none" && p.insert(Pe.declutterBox), this.replayImageOrLabel_.apply(this, Ae));
            } else
              this.replayImageOrLabel_.apply(this, Ae);
          }
          ++x;
          break;
        case Le.DRAW_CHARS:
          const Gi = (
            /** @type {number} */
            X[1]
          ), Io = (
            /** @type {number} */
            X[2]
          ), Ms = (
            /** @type {number} */
            X[3]
          ), _l = (
            /** @type {number} */
            X[4]
          );
          ht = /** @type {string} */
          X[5];
          const ls = (
            /** @type {number} */
            X[6]
          ), ir = (
            /** @type {number} */
            X[7]
          ), Ui = (
            /** @type {number} */
            X[8]
          );
          pt = /** @type {string} */
          X[9];
          const sa = (
            /** @type {number} */
            X[10]
          );
          et = /** @type {string|Array<string>} */
          X[11], Array.isArray(et) && (et = et.reduce(cK, "")), ot = /** @type {string} */
          X[12];
          const Ba = [
            /** @type {number} */
            X[13],
            /** @type {number} */
            X[13]
          ];
          U = X[14] || "declutter";
          const Y = (
            /** @type {boolean} */
            X[15]
          ), dt = this.textStates[ot], Kt = dt.font, Jt = [
            dt.scale[0] * ir,
            dt.scale[1] * ir
          ];
          let oe;
          Kt in this.widths_ ? oe = this.widths_[Kt] : (oe = {}, this.widths_[Kt] = oe);
          const Be = eX(b, Gi, Io, 2), Ue = Math.abs(Jt[0]) * iL(Kt, et, oe);
          if (_l || Ue <= Be) {
            const Pe = this.textStates[ot].textAlign, Ae = (Be - Ue) * XA(et, Pe), xn = lK(
              b,
              Gi,
              Io,
              2,
              et,
              Ae,
              ls,
              Math.abs(Jt[0]),
              iL,
              Kt,
              oe,
              Ft ? 0 : this.viewRotation_,
              Y
            );
            t: if (xn) {
              const Wi = [];
              let ar, oa, un, cn, Si;
              if (pt)
                for (ar = 0, oa = xn.length; ar < oa; ++ar) {
                  Si = xn[ar], un = /** @type {string} */
                  Si[4], cn = this.createLabel(un, ot, "", pt), L = /** @type {number} */
                  Si[2] + (Jt[0] < 0 ? -sa : sa), N = Ms * cn.height + (0.5 - Ms) * 2 * sa * Jt[1] / Jt[0] - Ui;
                  const us = this.calculateImageOrLabelDimensions_(
                    cn.width,
                    cn.height,
                    Si[0],
                    Si[1],
                    cn.width,
                    cn.height,
                    L,
                    N,
                    0,
                    0,
                    Si[3],
                    Ba,
                    !1,
                    b_,
                    !1,
                    gt
                  );
                  if (p && U === "declutter" && p.collides(us.declutterBox))
                    break t;
                  Wi.push([
                    t,
                    e,
                    cn,
                    us,
                    1,
                    null,
                    null
                  ]);
                }
              if (ht)
                for (ar = 0, oa = xn.length; ar < oa; ++ar) {
                  Si = xn[ar], un = /** @type {string} */
                  Si[4], cn = this.createLabel(un, ot, ht, ""), L = /** @type {number} */
                  Si[2], N = Ms * cn.height - Ui;
                  const us = this.calculateImageOrLabelDimensions_(
                    cn.width,
                    cn.height,
                    Si[0],
                    Si[1],
                    cn.width,
                    cn.height,
                    L,
                    N,
                    0,
                    0,
                    Si[3],
                    Ba,
                    !1,
                    b_,
                    !1,
                    gt
                  );
                  if (p && U === "declutter" && p.collides(us.declutterBox))
                    break t;
                  Wi.push([
                    t,
                    e,
                    cn,
                    us,
                    1,
                    null,
                    null
                  ]);
                }
              p && U !== "none" && p.load(Wi.map(mL));
              for (let us = 0, ym = Wi.length; us < ym; ++us)
                this.replayImageOrLabel_.apply(this, Wi[us]);
            }
          }
          ++x;
          break;
        case Le.END_GEOMETRY:
          if (f !== void 0) {
            gt = /** @type {import("../../Feature.js").FeatureLike} */
            X[1];
            const Pe = f(
              gt,
              j,
              U
            );
            if (Pe)
              return Pe;
          }
          ++x;
          break;
        case Le.FILL:
          J ? Ct++ : this.fill_(t), ++x;
          break;
        case Le.MOVE_TO_LINE_TO:
          for (A = /** @type {number} */
          X[1], C = /** @type {number} */
          X[2], Ot = b[A], W = b[A + 1], t.moveTo(Ot, W), k = Ot + 0.5 | 0, H = W + 0.5 | 0, A += 2; A < C; A += 2)
            Ot = b[A], W = b[A + 1], B = Ot + 0.5 | 0, z = W + 0.5 | 0, (A == C - 2 || B !== k || z !== H) && (t.lineTo(Ot, W), k = B, H = z);
          ++x;
          break;
        case Le.SET_FILL_STYLE:
          this.alignAndScaleFill_ = X[2], Ct && (this.fill_(t), Ct = 0, mt && (t.stroke(), mt = 0)), t.fillStyle = X[1], ++x;
          break;
        case Le.SET_STROKE_STYLE:
          mt && (t.stroke(), mt = 0), this.setStrokeStyle_(
            t,
            /** @type {Array<*>} */
            X
          ), ++x;
          break;
        case Le.STROKE:
          J ? mt++ : t.stroke(), ++x;
          break;
        default:
          ++x;
          break;
      }
    }
    Ct && this.fill_(t), mt && t.stroke();
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import('../../size.js').Size} scaledCanvasSize Scaled canvas size.
   * @param {import("../../transform.js").Transform} transform Transform.
   * @param {number} viewRotation View rotation.
   * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.
   * @param {import("rbush").default<DeclutterEntry>} [declutterTree] Declutter tree.
   */
  execute(t, e, a, s, l, f) {
    this.viewRotation_ = s, this.execute_(
      t,
      e,
      a,
      this.instructions,
      l,
      void 0,
      void 0,
      f
    );
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../transform.js").Transform} transform Transform.
   * @param {number} viewRotation View rotation.
   * @param {FeatureCallback<T>} [featureCallback] Feature callback.
   * @param {import("../../extent.js").Extent} [hitExtent] Only check
   *     features that intersect this extent.
   * @return {T|undefined} Callback result.
   * @template T
   */
  executeHitDetection(t, e, a, s, l) {
    return this.viewRotation_ = a, this.execute_(
      t,
      [t.canvas.width, t.canvas.height],
      e,
      this.hitDetectionInstructions,
      !0,
      s,
      l
    );
  }
}
const m_ = [
  "Polygon",
  "Circle",
  "LineString",
  "Image",
  "Text",
  "Default"
], u5 = ["Image", "Text"], hK = m_.filter(
  (n) => !u5.includes(n)
);
class dK {
  /**
   * @param {import("../../extent.js").Extent} maxExtent Max extent for clipping. When a
   * `maxExtent` was set on the Builder for this executor group, the same `maxExtent`
   * should be set here, unless the target context does not exceed that extent (which
   * can be the case when rendering to tiles).
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {boolean} overlaps The executor group can have overlapping geometries.
   * @param {!Object<string, !Object<import("../canvas.js").BuilderType, import("../canvas.js").SerializableInstructions>>} allInstructions
   * The serializable instructions.
   * @param {number} [renderBuffer] Optional rendering buffer.
   * @param {boolean} [deferredRendering] Enable deferred rendering with renderDeferred().
   */
  constructor(t, e, a, s, l, f, h) {
    this.maxExtent_ = t, this.overlaps_ = s, this.pixelRatio_ = a, this.resolution_ = e, this.renderBuffer_ = f, this.executorsByZIndex_ = {}, this.hitDetectionContext_ = null, this.hitDetectionTransform_ = Pf(), this.renderedContext_ = null, this.deferredZIndexContexts_ = {}, this.createExecutors_(l, h);
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../transform.js").Transform} transform Transform.
   */
  clip(t, e) {
    const a = this.getClipCoords(e);
    t.beginPath(), t.moveTo(a[0], a[1]), t.lineTo(a[2], a[3]), t.lineTo(a[4], a[5]), t.lineTo(a[6], a[7]), t.clip();
  }
  /**
   * Create executors and populate them using the provided instructions.
   * @private
   * @param {!Object<string, !Object<string, import("../canvas.js").SerializableInstructions>>} allInstructions The serializable instructions
   * @param {boolean} deferredRendering Enable deferred rendering.
   */
  createExecutors_(t, e) {
    for (const a in t) {
      let s = this.executorsByZIndex_[a];
      s === void 0 && (s = {}, this.executorsByZIndex_[a] = s);
      const l = t[a];
      for (const f in l) {
        const h = l[f];
        s[f] = new fK(
          this.resolution_,
          this.pixelRatio_,
          this.overlaps_,
          h,
          e
        );
      }
    }
  }
  /**
   * @param {Array<import("../canvas.js").BuilderType>} executors Executors.
   * @return {boolean} Has executors of the provided types.
   */
  hasExecutors(t) {
    for (const e in this.executorsByZIndex_) {
      const a = this.executorsByZIndex_[e];
      for (let s = 0, l = t.length; s < l; ++s)
        if (t[s] in a)
          return !0;
    }
    return !1;
  }
  /**
   * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {number} resolution Resolution.
   * @param {number} rotation Rotation.
   * @param {number} hitTolerance Hit tolerance in pixels.
   * @param {function(import("../../Feature.js").FeatureLike, import("../../geom/SimpleGeometry.js").default, number): T} callback Feature callback.
   * @param {Array<import("../../Feature.js").FeatureLike>} declutteredFeatures Decluttered features.
   * @return {T|undefined} Callback result.
   * @template T
   */
  forEachFeatureAtCoordinate(t, e, a, s, l, f) {
    s = Math.round(s);
    const h = s * 2 + 1, p = fd(
      this.hitDetectionTransform_,
      s + 0.5,
      s + 0.5,
      1 / e,
      -1 / e,
      -a,
      -t[0],
      -t[1]
    ), y = !this.hitDetectionContext_;
    y && (this.hitDetectionContext_ = Pr(
      h,
      h
    ));
    const b = this.hitDetectionContext_;
    b.canvas.width !== h || b.canvas.height !== h ? (b.canvas.width = h, b.canvas.height = h) : y || b.clearRect(0, 0, h, h);
    let x;
    this.renderBuffer_ !== void 0 && (x = uu(), jb(x, t), Wb(
      x,
      e * (this.renderBuffer_ + s),
      x
    ));
    const w = gK(s);
    let A;
    function C(z, Q, et) {
      const ot = b.getImageData(
        0,
        0,
        h,
        h
      ).data;
      for (let pt = 0, ht = w.length; pt < ht; pt++)
        if (ot[w[pt]] > 0) {
          if (!f || et === "none" || A !== "Image" && A !== "Text" || f.includes(z)) {
            const Ct = (w[pt] - 3) / 4, mt = s - Ct % h, St = s - (Ct / h | 0), Ut = l(z, Q, mt * mt + St * St);
            if (Ut)
              return Ut;
          }
          b.clearRect(0, 0, h, h);
          break;
        }
    }
    const L = Object.keys(this.executorsByZIndex_).map(Number);
    L.sort(sm);
    let N, U, k, H, B;
    for (N = L.length - 1; N >= 0; --N) {
      const z = L[N].toString();
      for (k = this.executorsByZIndex_[z], U = m_.length - 1; U >= 0; --U)
        if (A = m_[U], H = k[A], H !== void 0 && (B = H.executeHitDetection(
          b,
          p,
          a,
          C,
          x
        ), B))
          return B;
    }
  }
  /**
   * @param {import("../../transform.js").Transform} transform Transform.
   * @return {Array<number>|null} Clip coordinates.
   */
  getClipCoords(t) {
    const e = this.maxExtent_;
    if (!e)
      return null;
    const a = e[0], s = e[1], l = e[2], f = e[3], h = [a, s, a, f, l, f, l, s];
    return v0(h, 0, 8, 2, t, h), h;
  }
  /**
   * @return {boolean} Is empty.
   */
  isEmpty() {
    return W1(this.executorsByZIndex_);
  }
  /**
   * @param {CanvasRenderingContext2D} targetContext Context.
   * @param {import('../../size.js').Size} scaledCanvasSize Scale of the context.
   * @param {import("../../transform.js").Transform} transform Transform.
   * @param {number} viewRotation View rotation.
   * @param {boolean} snapToPixel Snap point symbols and test to integer pixel.
   * @param {Array<import("../canvas.js").BuilderType>} [builderTypes] Ordered replay types to replay.
   *     Default is {@link module:ol/render/replay~ALL}
   * @param {import("rbush").default<import('./Executor.js').DeclutterEntry>|null} [declutterTree] Declutter tree.
   *     When set to null, no decluttering is done, even when the executor group has a `ZIndexContext`.
   */
  execute(t, e, a, s, l, f, h) {
    const p = Object.keys(this.executorsByZIndex_).map(Number);
    p.sort(h ? KF : sm), f = f || m_;
    const y = m_.length;
    for (let b = 0, x = p.length; b < x; ++b) {
      const w = p[b].toString(), A = this.executorsByZIndex_[w];
      for (let C = 0, L = f.length; C < L; ++C) {
        const N = f[C], U = A[N];
        if (U !== void 0) {
          const k = h === null ? void 0 : U.getZIndexContext(), H = k ? k.getContext() : t, B = this.maxExtent_ && N !== "Image" && N !== "Text";
          if (B && (H.save(), this.clip(H, a)), !k || N === "Text" || N === "Image" ? U.execute(
            H,
            e,
            a,
            s,
            l,
            h
          ) : k.pushFunction(
            (z) => U.execute(
              z,
              e,
              a,
              s,
              l,
              h
            )
          ), B && H.restore(), k) {
            k.offset();
            const z = p[b] * y + m_.indexOf(N);
            this.deferredZIndexContexts_[z] || (this.deferredZIndexContexts_[z] = []), this.deferredZIndexContexts_[z].push(k);
          }
        }
      }
    }
    this.renderedContext_ = t;
  }
  getDeferredZIndexContexts() {
    return this.deferredZIndexContexts_;
  }
  getRenderedContext() {
    return this.renderedContext_;
  }
  renderDeferred() {
    const t = this.deferredZIndexContexts_, e = Object.keys(t).map(Number).sort(sm);
    for (let a = 0, s = e.length; a < s; ++a)
      t[e[a]].forEach((l) => {
        l.draw(this.renderedContext_), l.clear();
      }), t[e[a]].length = 0;
  }
}
const KA = {};
function gK(n) {
  if (KA[n] !== void 0)
    return KA[n];
  const t = n * 2 + 1, e = n * n, a = new Array(e + 1);
  for (let l = 0; l <= n; ++l)
    for (let f = 0; f <= n; ++f) {
      const h = l * l + f * f;
      if (h > e)
        break;
      let p = a[h];
      p || (p = [], a[h] = p), p.push(((n + l) * t + (n + f)) * 4 + 3), l > 0 && p.push(((n - l) * t + (n + f)) * 4 + 3), f > 0 && (p.push(((n + l) * t + (n - f)) * 4 + 3), l > 0 && p.push(((n - l) * t + (n - f)) * 4 + 3));
    }
  const s = [];
  for (let l = 0, f = a.length; l < f; ++l)
    a[l] && s.push(...a[l]);
  return KA[n] = s, s;
}
function yL(n, t, e, a) {
  return e !== void 0 && a !== void 0 ? [e / n, a / t] : e !== void 0 ? e / n : a !== void 0 ? a / t : 1;
}
class Pw extends Nw {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {};
    const e = t.opacity !== void 0 ? t.opacity : 1, a = t.rotation !== void 0 ? t.rotation : 0, s = t.scale !== void 0 ? t.scale : 1, l = t.rotateWithView !== void 0 ? t.rotateWithView : !1;
    super({
      opacity: e,
      rotation: a,
      scale: s,
      displacement: t.displacement !== void 0 ? t.displacement : [0, 0],
      rotateWithView: l,
      declutterMode: t.declutterMode
    }), this.anchor_ = t.anchor !== void 0 ? t.anchor : [0.5, 0.5], this.normalizedAnchor_ = null, this.anchorOrigin_ = t.anchorOrigin !== void 0 ? t.anchorOrigin : "top-left", this.anchorXUnits_ = t.anchorXUnits !== void 0 ? t.anchorXUnits : "fraction", this.anchorYUnits_ = t.anchorYUnits !== void 0 ? t.anchorYUnits : "fraction", this.crossOrigin_ = t.crossOrigin !== void 0 ? t.crossOrigin : null;
    const f = t.img !== void 0 ? t.img : null;
    let h = t.src;
    Ei(
      !(h !== void 0 && f),
      "`image` and `src` cannot be provided at the same time"
    ), (h === void 0 || h.length === 0) && f && (h = /** @type {HTMLImageElement} */
    f.src || si(f)), Ei(
      h !== void 0 && h.length > 0,
      "A defined and non-empty `src` or `image` must be provided"
    ), Ei(
      !((t.width !== void 0 || t.height !== void 0) && t.scale !== void 0),
      "`width` or `height` cannot be provided together with `scale`"
    );
    let p;
    if (t.src !== void 0 ? p = xe.IDLE : f !== void 0 && ("complete" in f ? f.complete ? p = f.src ? xe.LOADED : xe.IDLE : p = xe.LOADING : p = xe.LOADED), this.color_ = t.color !== void 0 ? fE(t.color) : null, this.iconImage_ = lO(
      f,
      /** @type {string} */
      h,
      this.crossOrigin_,
      p,
      this.color_
    ), this.offset_ = t.offset !== void 0 ? t.offset : [0, 0], this.offsetOrigin_ = t.offsetOrigin !== void 0 ? t.offsetOrigin : "top-left", this.origin_ = null, this.size_ = t.size !== void 0 ? t.size : null, this.initialOptions_, t.width !== void 0 || t.height !== void 0) {
      let y, b;
      if (t.size)
        [y, b] = t.size;
      else {
        const x = this.getImage(1);
        if (x.width && x.height)
          y = x.width, b = x.height;
        else if (x instanceof HTMLImageElement) {
          this.initialOptions_ = t;
          const w = () => {
            if (this.unlistenImageChange(w), !this.initialOptions_)
              return;
            const A = this.iconImage_.getSize();
            this.setScale(
              yL(
                A[0],
                A[1],
                t.width,
                t.height
              )
            );
          };
          this.listenImageChange(w);
          return;
        }
      }
      y !== void 0 && this.setScale(
        yL(y, b, t.width, t.height)
      );
    }
  }
  /**
   * Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
   * @return {Icon} The cloned style.
   * @api
   * @override
   */
  clone() {
    let t, e, a;
    return this.initialOptions_ ? (e = this.initialOptions_.width, a = this.initialOptions_.height) : (t = this.getScale(), t = Array.isArray(t) ? t.slice() : t), new Pw({
      anchor: this.anchor_.slice(),
      anchorOrigin: this.anchorOrigin_,
      anchorXUnits: this.anchorXUnits_,
      anchorYUnits: this.anchorYUnits_,
      color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || void 0,
      crossOrigin: this.crossOrigin_,
      offset: this.offset_.slice(),
      offsetOrigin: this.offsetOrigin_,
      opacity: this.getOpacity(),
      rotateWithView: this.getRotateWithView(),
      rotation: this.getRotation(),
      scale: t,
      width: e,
      height: a,
      size: this.size_ !== null ? this.size_.slice() : void 0,
      src: this.getSrc(),
      displacement: this.getDisplacement().slice(),
      declutterMode: this.getDeclutterMode()
    });
  }
  /**
   * Get the anchor point in pixels. The anchor determines the center point for the
   * symbolizer.
   * @return {Array<number>} Anchor.
   * @api
   * @override
   */
  getAnchor() {
    let t = this.normalizedAnchor_;
    if (!t) {
      t = this.anchor_;
      const s = this.getSize();
      if (this.anchorXUnits_ == "fraction" || this.anchorYUnits_ == "fraction") {
        if (!s)
          return null;
        t = this.anchor_.slice(), this.anchorXUnits_ == "fraction" && (t[0] *= s[0]), this.anchorYUnits_ == "fraction" && (t[1] *= s[1]);
      }
      if (this.anchorOrigin_ != "top-left") {
        if (!s)
          return null;
        t === this.anchor_ && (t = this.anchor_.slice()), (this.anchorOrigin_ == "top-right" || this.anchorOrigin_ == "bottom-right") && (t[0] = -t[0] + s[0]), (this.anchorOrigin_ == "bottom-left" || this.anchorOrigin_ == "bottom-right") && (t[1] = -t[1] + s[1]);
      }
      this.normalizedAnchor_ = t;
    }
    const e = this.getDisplacement(), a = this.getScaleArray();
    return [
      t[0] - e[0] / a[0],
      t[1] + e[1] / a[1]
    ];
  }
  /**
   * Set the anchor point. The anchor determines the center point for the
   * symbolizer.
   *
   * @param {Array<number>} anchor Anchor.
   * @api
   */
  setAnchor(t) {
    this.anchor_ = t, this.normalizedAnchor_ = null;
  }
  /**
   * Get the icon color.
   * @return {import("../color.js").Color} Color.
   * @api
   */
  getColor() {
    return this.color_;
  }
  /**
   * Get the image icon.
   * @param {number} pixelRatio Pixel ratio.
   * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image or Canvas element. If the Icon
   * style was configured with `src` or with a not let loaded `img`, an `ImageBitmap` will be returned.
   * @api
   * @override
   */
  getImage(t) {
    return this.iconImage_.getImage(t);
  }
  /**
   * Get the pixel ratio.
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} The pixel ratio of the image.
   * @api
   * @override
   */
  getPixelRatio(t) {
    return this.iconImage_.getPixelRatio(t);
  }
  /**
   * @return {import("../size.js").Size} Image size.
   * @override
   */
  getImageSize() {
    return this.iconImage_.getSize();
  }
  /**
   * @return {import("../ImageState.js").default} Image state.
   * @override
   */
  getImageState() {
    return this.iconImage_.getImageState();
  }
  /**
   * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image element.
   * @override
   */
  getHitDetectionImage() {
    return this.iconImage_.getHitDetectionImage();
  }
  /**
   * Get the origin of the symbolizer.
   * @return {Array<number>} Origin.
   * @api
   * @override
   */
  getOrigin() {
    if (this.origin_)
      return this.origin_;
    let t = this.offset_;
    if (this.offsetOrigin_ != "top-left") {
      const e = this.getSize(), a = this.iconImage_.getSize();
      if (!e || !a)
        return null;
      t = t.slice(), (this.offsetOrigin_ == "top-right" || this.offsetOrigin_ == "bottom-right") && (t[0] = a[0] - e[0] - t[0]), (this.offsetOrigin_ == "bottom-left" || this.offsetOrigin_ == "bottom-right") && (t[1] = a[1] - e[1] - t[1]);
    }
    return this.origin_ = t, this.origin_;
  }
  /**
   * Get the image URL.
   * @return {string|undefined} Image src.
   * @api
   */
  getSrc() {
    return this.iconImage_.getSrc();
  }
  /**
   * Get the size of the icon (in pixels).
   * @return {import("../size.js").Size} Image size.
   * @api
   * @override
   */
  getSize() {
    return this.size_ ? this.size_ : this.iconImage_.getSize();
  }
  /**
   * Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
   * @return {number} Icon width (in pixels).
   * @api
   */
  getWidth() {
    const t = this.getScaleArray();
    if (this.size_)
      return this.size_[0] * t[0];
    if (this.iconImage_.getImageState() == xe.LOADED)
      return this.iconImage_.getSize()[0] * t[0];
  }
  /**
   * Get the height of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
   * @return {number} Icon height (in pixels).
   * @api
   */
  getHeight() {
    const t = this.getScaleArray();
    if (this.size_)
      return this.size_[1] * t[1];
    if (this.iconImage_.getImageState() == xe.LOADED)
      return this.iconImage_.getSize()[1] * t[1];
  }
  /**
   * Set the scale.
   *
   * @param {number|import("../size.js").Size} scale Scale.
   * @api
   * @override
   */
  setScale(t) {
    delete this.initialOptions_, super.setScale(t);
  }
  /**
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   * @override
   */
  listenImageChange(t) {
    this.iconImage_.addEventListener(ln.CHANGE, t);
  }
  /**
   * Load not yet loaded URI.
   * When rendering a feature with an icon style, the vector renderer will
   * automatically call this method. However, you might want to call this
   * method yourself for preloading or other purposes.
   * @api
   * @override
   */
  load() {
    this.iconImage_.load();
  }
  /**
   * @param {function(import("../events/Event.js").default): void} listener Listener function.
   * @override
   */
  unlistenImageChange(t) {
    this.iconImage_.removeEventListener(ln.CHANGE, t);
  }
  /**
   * @override
   */
  ready() {
    return this.iconImage_.ready();
  }
}
const Jh = 0.5;
function mK(n, t, e, a, s, l, f, h, p) {
  const y = s, b = n[0] * Jh, x = n[1] * Jh, w = Pr(b, x);
  w.imageSmoothingEnabled = !1;
  const A = w.canvas, C = new OX(
    w,
    Jh,
    s,
    null,
    f,
    h,
    null
  ), L = e.length, N = Math.floor((256 * 256 * 256 - 1) / L), U = {};
  for (let H = 1; H <= L; ++H) {
    const B = e[H - 1], z = B.getStyleFunction() || a;
    if (!z)
      continue;
    let Q = z(B, l);
    if (!Q)
      continue;
    Array.isArray(Q) || (Q = [Q]);
    const ot = (H * N).toString(16).padStart(7, "#00000");
    for (let pt = 0, ht = Q.length; pt < ht; ++pt) {
      const Ct = Q[pt], mt = Ct.getGeometryFunction()(B);
      if (!mt || !Co(y, mt.getExtent()))
        continue;
      const St = Ct.clone(), Ut = St.getFill();
      Ut && Ut.setColor(ot);
      const Ft = St.getStroke();
      Ft && (Ft.setColor(ot), Ft.setLineDash(null)), St.setText(void 0);
      const nt = Ct.getImage();
      if (nt) {
        const W = nt.getImageSize();
        if (!W)
          continue;
        const j = Pr(
          W[0],
          W[1],
          void 0,
          { alpha: !1 }
        ), X = j.canvas;
        j.fillStyle = ot, j.fillRect(0, 0, X.width, X.height), St.setImage(
          new Pw({
            img: X,
            anchor: nt.getAnchor(),
            anchorXUnits: "pixels",
            anchorYUnits: "pixels",
            offset: nt.getOrigin(),
            opacity: 1,
            size: nt.getSize(),
            scale: nt.getScale(),
            rotation: nt.getRotation(),
            rotateWithView: nt.getRotateWithView()
          })
        );
      }
      const J = St.getZIndex() || 0;
      let gt = U[J];
      gt || (gt = {}, U[J] = gt, gt.Polygon = [], gt.Circle = [], gt.LineString = [], gt.Point = []);
      const Ot = mt.getType();
      if (Ot === "GeometryCollection") {
        const W = (
          /** @type {import("../../geom/GeometryCollection.js").default} */
          mt.getGeometriesArrayRecursive()
        );
        for (let j = 0, X = W.length; j < X; ++j) {
          const st = W[j];
          gt[st.getType().replace("Multi", "")].push(
            st,
            St
          );
        }
      } else
        gt[Ot.replace("Multi", "")].push(mt, St);
    }
  }
  const k = Object.keys(U).map(Number).sort(sm);
  for (let H = 0, B = k.length; H < B; ++H) {
    const z = U[k[H]];
    for (const Q in z) {
      const et = z[Q];
      for (let ot = 0, pt = et.length; ot < pt; ot += 2) {
        C.setStyle(et[ot + 1]);
        for (let ht = 0, Ct = t.length; ht < Ct; ++ht)
          C.setTransform(t[ht]), C.drawGeometry(et[ot]);
      }
    }
  }
  return w.getImageData(0, 0, A.width, A.height);
}
function pK(n, t, e) {
  const a = [];
  if (e) {
    const s = Math.floor(Math.round(n[0]) * Jh), l = Math.floor(Math.round(n[1]) * Jh), f = (ra(s, 0, e.width - 1) + ra(l, 0, e.height - 1) * e.width) * 4, h = e.data[f], p = e.data[f + 1], b = e.data[f + 2] + 256 * (p + 256 * h), x = Math.floor((256 * 256 * 256 - 1) / t.length);
    b && b % x === 0 && a.push(t[b / x - 1]);
  }
  return a;
}
class c5 extends dd {
  /**
   * @param {import("./EventType.js").default} type Type.
   * @param {import("../transform.js").Transform} [inversePixelTransform] Transform for
   *     CSS pixels to rendered pixels.
   * @param {import("../Map.js").FrameState} [frameState] Frame state.
   * @param {?(CanvasRenderingContext2D|WebGLRenderingContext)} [context] Context.
   */
  constructor(t, e, a, s) {
    super(t), this.inversePixelTransform = e, this.frameState = a, this.context = s;
  }
}
const yK = 5;
class _K extends zS {
  /**
   * @param {LayerType} layer Layer.
   */
  constructor(t) {
    super(), this.ready = !0, this.boundHandleImageChange_ = this.handleImageChange_.bind(this), this.layer_ = t, this.staleKeys_ = new Array(), this.maxStaleKeys = yK;
  }
  /**
   * @return {Array<string>} Get the list of stale keys.
   */
  getStaleKeys() {
    return this.staleKeys_;
  }
  /**
   * @param {string} key The new stale key.
   */
  prependStaleKey(t) {
    this.staleKeys_.unshift(t), this.staleKeys_.length > this.maxStaleKeys && (this.staleKeys_.length = this.maxStaleKeys);
  }
  /**
   * Asynchronous layer level hit detection.
   * @param {import("../pixel.js").Pixel} pixel Pixel.
   * @return {Promise<Array<import("../Feature").FeatureLike>>} Promise that resolves with
   * an array of features.
   */
  getFeatures(t) {
    return Qn();
  }
  /**
   * @param {import("../pixel.js").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
   */
  getData(t) {
    return null;
  }
  /**
   * Determine whether render should be called.
   * @abstract
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @return {boolean} Layer is ready to be rendered.
   */
  prepareFrame(t) {
    return Qn();
  }
  /**
   * Render the layer.
   * @abstract
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement|null} target Target that may be used to render content to.
   * @return {HTMLElement} The rendered element.
   */
  renderFrame(t, e) {
    return Qn();
  }
  /**
   * @abstract
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @param {number} hitTolerance Hit tolerance in pixels.
   * @param {import("./vector.js").FeatureCallback<T>} callback Feature callback.
   * @param {Array<import("./Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
   * @return {T|undefined} Callback result.
   * @template T
   */
  forEachFeatureAtCoordinate(t, e, a, s, l) {
  }
  /**
   * @return {LayerType} Layer.
   */
  getLayer() {
    return this.layer_;
  }
  /**
   * Perform action necessary to get the layer rendered after new fonts have loaded
   * @abstract
   */
  handleFontsChanged() {
  }
  /**
   * Handle changes in image state.
   * @param {import("../events/Event.js").default} event Image change event.
   * @private
   */
  handleImageChange_(t) {
    const e = (
      /** @type {import("../Image.js").default} */
      t.target
    );
    (e.getState() === xe.LOADED || e.getState() === xe.ERROR) && this.renderIfReadyAndVisible();
  }
  /**
   * Load the image if not already loaded, and register the image change
   * listener if needed.
   * @param {import("../Image.js").default} image Image.
   * @return {boolean} `true` if the image is already loaded, `false` otherwise.
   * @protected
   */
  loadImage(t) {
    let e = t.getState();
    return e != xe.LOADED && e != xe.ERROR && t.addEventListener(ln.CHANGE, this.boundHandleImageChange_), e == xe.IDLE && (t.load(), e = t.getState()), e == xe.LOADED;
  }
  /**
   * @protected
   */
  renderIfReadyAndVisible() {
    const t = this.getLayer();
    t && t.getVisible() && t.getSourceState() === "ready" && t.changed();
  }
  /**
   * @param {import("../Map.js").FrameState} frameState Frame state.
   */
  renderDeferred(t) {
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    delete this.layer_, super.disposeInternal();
  }
}
const _L = [];
let I1 = null;
function vK() {
  I1 = Pr(1, 1, void 0, {
    willReadFrequently: !0
  });
}
class dO extends _K {
  /**
   * @param {LayerType} layer Layer.
   */
  constructor(t) {
    super(t), this.container = null, this.renderedResolution, this.tempTransform = Pf(), this.pixelTransform = Pf(), this.inversePixelTransform = Pf(), this.context = null, this.deferredContext_ = null, this.containerReused = !1, this.frameState = null;
  }
  /**
   * @param {import('../../DataTile.js').ImageLike} image Image.
   * @param {number} col The column index.
   * @param {number} row The row index.
   * @return {Uint8ClampedArray|null} The image data.
   */
  getImageData(t, e, a) {
    I1 || vK(), I1.clearRect(0, 0, 1, 1);
    let s;
    try {
      I1.drawImage(t, e, a, 1, 1, 0, 0, 1, 1), s = I1.getImageData(0, 0, 1, 1).data;
    } catch {
      return I1 = null, null;
    }
    return s;
  }
  /**
   * @param {import('../../Map.js').FrameState} frameState Frame state.
   * @return {string} Background color.
   */
  getBackground(t) {
    let a = this.getLayer().getBackground();
    return typeof a == "function" && (a = a(t.viewState.resolution)), a || void 0;
  }
  /**
   * Get a rendering container from an existing target, if compatible.
   * @param {HTMLElement} target Potential render target.
   * @param {string} transform CSS transform matrix.
   * @param {string} [backgroundColor] Background color.
   */
  useContainer(t, e, a) {
    const s = this.getLayer().getClassName();
    let l, f;
    if (t && t.className === s && (!a || t && t.style.backgroundColor && I0(
      fE(t.style.backgroundColor),
      fE(a)
    ))) {
      const h = t.firstElementChild;
      h instanceof HTMLCanvasElement && (f = h.getContext("2d"));
    }
    if (f && L$(f.canvas.style.transform, e) ? (this.container = t, this.context = f, this.containerReused = !0) : this.containerReused ? (this.container = null, this.context = null, this.containerReused = !1) : this.container && (this.container.style.backgroundColor = null), !this.container) {
      l = document.createElement("div"), l.className = s;
      let h = l.style;
      h.position = "absolute", h.width = "100%", h.height = "100%", f = Pr();
      const p = f.canvas;
      l.appendChild(p), h = p.style, h.position = "absolute", h.left = "0", h.transformOrigin = "top left", this.container = l, this.context = f;
    }
    !this.containerReused && a && !this.container.style.backgroundColor && (this.container.style.backgroundColor = a);
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {import("../../extent.js").Extent} extent Clip extent.
   * @protected
   */
  clipUnrotated(t, e, a) {
    const s = Y_(a), l = cw(a), f = uw(a), h = lw(a);
    Lr(e.coordinateToPixelTransform, s), Lr(e.coordinateToPixelTransform, l), Lr(e.coordinateToPixelTransform, f), Lr(e.coordinateToPixelTransform, h);
    const p = this.inversePixelTransform;
    Lr(p, s), Lr(p, l), Lr(p, f), Lr(p, h), t.save(), t.beginPath(), t.moveTo(Math.round(s[0]), Math.round(s[1])), t.lineTo(Math.round(l[0]), Math.round(l[1])), t.lineTo(Math.round(f[0]), Math.round(f[1])), t.lineTo(Math.round(h[0]), Math.round(h[1])), t.clip();
  }
  /**
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement} target Target that may be used to render content to.
   * @protected
   */
  prepareContainer(t, e) {
    const a = t.extent, s = t.viewState.resolution, l = t.viewState.rotation, f = t.pixelRatio, h = Math.round(Hn(a) / s * f), p = Math.round(Ir(a) / s * f);
    fd(
      this.pixelTransform,
      t.size[0] / 2,
      t.size[1] / 2,
      1 / f,
      1 / f,
      l,
      -h / 2,
      -p / 2
    ), M2(this.inversePixelTransform, this.pixelTransform);
    const y = N$(this.pixelTransform);
    if (this.useContainer(e, y, this.getBackground(t)), !this.containerReused) {
      const b = this.context.canvas;
      b.width != h || b.height != p ? (b.width = h, b.height = p) : this.context.clearRect(0, 0, h, p), y !== b.style.transform && (b.style.transform = y);
    }
  }
  /**
   * @param {import("../../render/EventType.js").default} type Event type.
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @private
   */
  dispatchRenderEvent_(t, e, a) {
    const s = this.getLayer();
    if (s.hasListener(t)) {
      const l = new c5(
        t,
        this.inversePixelTransform,
        a,
        e
      );
      s.dispatchEvent(l);
    }
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @protected
   */
  preRender(t, e) {
    this.frameState = e, !e.declutter && this.dispatchRenderEvent_(wc.PRERENDER, t, e);
  }
  /**
   * @param {CanvasRenderingContext2D} context Context.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @protected
   */
  postRender(t, e) {
    e.declutter || this.dispatchRenderEvent_(wc.POSTRENDER, t, e);
  }
  /**
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   */
  renderDeferredInternal(t) {
  }
  /**
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {import('../../render/canvas/ZIndexContext.js').ZIndexContextProxy} Context.
   */
  getRenderContext(t) {
    return t.declutter && !this.deferredContext_ && (this.deferredContext_ = new l5()), t.declutter ? this.deferredContext_.getContext() : this.context;
  }
  /**
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @override
   */
  renderDeferred(t) {
    t.declutter && (this.dispatchRenderEvent_(
      wc.PRERENDER,
      this.context,
      t
    ), t.declutter && this.deferredContext_ && (this.deferredContext_.draw(this.context), this.deferredContext_.clear()), this.renderDeferredInternal(t), this.dispatchRenderEvent_(
      wc.POSTRENDER,
      this.context,
      t
    ));
  }
  /**
   * Creates a transform for rendering to an element that will be rotated after rendering.
   * @param {import("../../coordinate.js").Coordinate} center Center.
   * @param {number} resolution Resolution.
   * @param {number} rotation Rotation.
   * @param {number} pixelRatio Pixel ratio.
   * @param {number} width Width of the rendered element (in pixels).
   * @param {number} height Height of the rendered element (in pixels).
   * @param {number} offsetX Offset on the x-axis in view coordinates.
   * @protected
   * @return {!import("../../transform.js").Transform} Transform.
   */
  getRenderTransform(t, e, a, s, l, f, h) {
    const p = l / 2, y = f / 2, b = s / e, x = -b, w = -t[0] + h, A = -t[1];
    return fd(
      this.tempTransform,
      p,
      y,
      b,
      x,
      -a,
      w,
      A
    );
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    delete this.frameState, super.disposeInternal();
  }
}
class EK extends dO {
  /**
   * @param {import("../../layer/BaseVector.js").default} vectorLayer Vector layer.
   */
  constructor(t) {
    super(t), this.boundHandleStyleImageChange_ = this.handleStyleImageChange_.bind(this), this.animatingOrInteracting_, this.hitDetectionImageData_ = null, this.clipped_ = !1, this.renderedFeatures_ = null, this.renderedRevision_ = -1, this.renderedResolution_ = NaN, this.renderedExtent_ = uu(), this.wrappedRenderedExtent_ = uu(), this.renderedRotation_, this.renderedCenter_ = null, this.renderedProjection_ = null, this.renderedPixelRatio_ = 1, this.renderedRenderOrder_ = null, this.renderedFrameDeclutter_, this.replayGroup_ = null, this.replayGroupChanged = !0, this.clipping = !0, this.targetContext_ = null, this.opacity_ = 1;
  }
  /**
   * @param {ExecutorGroup} executorGroup Executor group.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {boolean} [declutterable] `true` to only render declutterable items,
   *     `false` to only render non-declutterable items, `undefined` to render all.
   */
  renderWorlds(t, e, a) {
    const s = e.extent, l = e.viewState, f = l.center, h = l.resolution, p = l.projection, y = l.rotation, b = p.getExtent(), x = this.getLayer().getSource(), w = this.getLayer().getDeclutter(), A = e.pixelRatio, C = e.viewHints, L = !(C[ss.ANIMATING] || C[ss.INTERACTING]), N = this.context, U = Math.round(Hn(s) / h * A), k = Math.round(Ir(s) / h * A), H = x.getWrapX() && p.canWrapX(), B = H ? Hn(b) : null, z = H ? Math.ceil((s[2] - b[2]) / B) + 1 : 1;
    let Q = H ? Math.floor((s[0] - b[0]) / B) : 0;
    do {
      let et = this.getRenderTransform(
        f,
        h,
        0,
        A,
        U,
        k,
        Q * B
      );
      e.declutter && (et = et.slice(0)), t.execute(
        N,
        [N.canvas.width, N.canvas.height],
        et,
        y,
        L,
        a === void 0 ? m_ : a ? u5 : hK,
        a ? w && e.declutter[w] : void 0
      );
    } while (++Q < z);
  }
  /**
   * @private
   */
  setDrawContext_() {
    this.opacity_ !== 1 && (this.targetContext_ = this.context, this.context = Pr(
      this.context.canvas.width,
      this.context.canvas.height,
      _L
    ));
  }
  /**
   * @private
   */
  resetDrawContext_() {
    if (this.opacity_ !== 1 && this.targetContext_) {
      const t = this.targetContext_.globalAlpha;
      this.targetContext_.globalAlpha = this.opacity_, this.targetContext_.drawImage(this.context.canvas, 0, 0), this.targetContext_.globalAlpha = t, Dw(this.context), _L.push(this.context.canvas), this.context = this.targetContext_, this.targetContext_ = null;
    }
  }
  /**
   * Render declutter items for this layer
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   */
  renderDeclutter(t) {
    !this.replayGroup_ || !this.getLayer().getDeclutter() || this.renderWorlds(this.replayGroup_, t, !0);
  }
  /**
   * Render deferred instructions.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @override
   */
  renderDeferredInternal(t) {
    this.replayGroup_ && (this.replayGroup_.renderDeferred(), this.clipped_ && this.context.restore(), this.resetDrawContext_());
  }
  /**
   * Render the layer.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement|null} target Target that may be used to render content to.
   * @return {HTMLElement} The rendered element.
   * @override
   */
  renderFrame(t, e) {
    const a = t.layerStatesArray[t.layerIndex];
    this.opacity_ = a.opacity;
    const s = t.viewState;
    this.prepareContainer(t, e);
    const l = this.context, f = this.replayGroup_;
    let h = f && !f.isEmpty();
    if (!h && !(this.getLayer().hasListener(wc.PRERENDER) || this.getLayer().hasListener(wc.POSTRENDER)))
      return this.container;
    if (this.setDrawContext_(), this.preRender(l, t), s.projection, this.clipped_ = !1, h && a.extent && this.clipping) {
      const p = id(a.extent);
      h = Co(p, t.extent), this.clipped_ = h && !nd(p, t.extent), this.clipped_ && this.clipUnrotated(l, t, p);
    }
    return h && this.renderWorlds(
      f,
      t,
      this.getLayer().getDeclutter() ? !1 : void 0
    ), !t.declutter && this.clipped_ && l.restore(), this.postRender(l, t), this.renderedRotation_ !== s.rotation && (this.renderedRotation_ = s.rotation, this.hitDetectionImageData_ = null), t.declutter || this.resetDrawContext_(), this.container;
  }
  /**
   * Asynchronous layer level hit detection.
   * @param {import("../../pixel.js").Pixel} pixel Pixel.
   * @return {Promise<Array<import("../../Feature").default>>} Promise
   * that resolves with an array of features.
   * @override
   */
  getFeatures(t) {
    return new Promise((e) => {
      if (this.frameState && !this.hitDetectionImageData_ && !this.animatingOrInteracting_) {
        const a = this.frameState.size.slice(), s = this.renderedCenter_, l = this.renderedResolution_, f = this.renderedRotation_, h = this.renderedProjection_, p = this.wrappedRenderedExtent_, y = this.getLayer(), b = [], x = a[0] * Jh, w = a[1] * Jh;
        b.push(
          this.getRenderTransform(
            s,
            l,
            f,
            Jh,
            x,
            w,
            0
          ).slice()
        );
        const A = y.getSource(), C = h.getExtent();
        if (A.getWrapX() && h.canWrapX() && !nd(C, p)) {
          let L = p[0];
          const N = Hn(C);
          let U = 0, k;
          for (; L < C[0]; )
            --U, k = N * U, b.push(
              this.getRenderTransform(
                s,
                l,
                f,
                Jh,
                x,
                w,
                k
              ).slice()
            ), L += N;
          for (U = 0, L = p[2]; L > C[2]; )
            ++U, k = N * U, b.push(
              this.getRenderTransform(
                s,
                l,
                f,
                Jh,
                x,
                w,
                k
              ).slice()
            ), L -= N;
        }
        this.hitDetectionImageData_ = mK(
          a,
          b,
          this.renderedFeatures_,
          y.getStyleFunction(),
          p,
          l,
          f,
          aL(l, this.renderedPixelRatio_)
        );
      }
      e(
        pK(t, this.renderedFeatures_, this.hitDetectionImageData_)
      );
    });
  }
  /**
   * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {number} hitTolerance Hit tolerance in pixels.
   * @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
   * @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
   * @return {T|undefined} Callback result.
   * @template T
   * @override
   */
  forEachFeatureAtCoordinate(t, e, a, s, l) {
    if (!this.replayGroup_)
      return;
    const f = e.viewState.resolution, h = e.viewState.rotation, p = this.getLayer(), y = {}, b = function(w, A, C) {
      const L = si(w), N = y[L];
      if (N) {
        if (N !== !0 && C < N.distanceSq) {
          if (C === 0)
            return y[L] = !0, l.splice(l.lastIndexOf(N), 1), s(w, p, A);
          N.geometry = A, N.distanceSq = C;
        }
      } else {
        if (C === 0)
          return y[L] = !0, s(w, p, A);
        l.push(
          y[L] = {
            feature: w,
            layer: p,
            geometry: A,
            distanceSq: C,
            callback: s
          }
        );
      }
    }, x = this.getLayer().getDeclutter();
    return this.replayGroup_.forEachFeatureAtCoordinate(
      t,
      f,
      h,
      a,
      b,
      x ? e.declutter?.[x]?.all().map((w) => w.value) : null
    );
  }
  /**
   * Perform action necessary to get the layer rendered after new fonts have loaded
   * @override
   */
  handleFontsChanged() {
    const t = this.getLayer();
    t.getVisible() && this.replayGroup_ && t.changed();
  }
  /**
   * Handle changes in image style state.
   * @param {import("../../events/Event.js").default} event Image style change event.
   * @private
   */
  handleStyleImageChange_(t) {
    this.renderIfReadyAndVisible();
  }
  /**
   * Determine whether render should be called.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {boolean} Layer is ready to be rendered.
   * @override
   */
  prepareFrame(t) {
    const e = this.getLayer(), a = e.getSource();
    if (!a)
      return !1;
    const s = t.viewHints[ss.ANIMATING], l = t.viewHints[ss.INTERACTING], f = e.getUpdateWhileAnimating(), h = e.getUpdateWhileInteracting();
    if (this.ready && !f && s || !h && l)
      return this.animatingOrInteracting_ = !0, !0;
    this.animatingOrInteracting_ = !1;
    const p = t.extent, y = t.viewState, b = y.projection, x = y.resolution, w = t.pixelRatio, A = e.getRevision(), C = e.getRenderBuffer();
    let L = e.getRenderOrder();
    L === void 0 && (L = NX);
    const N = y.center.slice(), U = Wb(
      p,
      C * x
    ), k = U.slice(), H = [U.slice()], B = b.getExtent();
    if (a.getWrapX() && b.canWrapX() && !nd(B, t.extent)) {
      const Ut = Hn(B), Ft = Math.max(Hn(U) / 2, Ut);
      U[0] = B[0] - Ft, U[2] = B[2] + Ft, r8(N, b);
      const nt = i8(H[0], b);
      nt[0] < B[0] && nt[2] < B[2] ? H.push([
        nt[0] + Ut,
        nt[1],
        nt[2] + Ut,
        nt[3]
      ]) : nt[0] > B[0] && nt[2] > B[2] && H.push([
        nt[0] - Ut,
        nt[1],
        nt[2] - Ut,
        nt[3]
      ]);
    }
    if (this.ready && this.renderedResolution_ == x && this.renderedRevision_ == A && this.renderedRenderOrder_ == L && this.renderedFrameDeclutter_ === !!t.declutter && nd(this.wrappedRenderedExtent_, U))
      return I0(this.renderedExtent_, k) || (this.hitDetectionImageData_ = null, this.renderedExtent_ = k), this.renderedCenter_ = N, this.replayGroupChanged = !1, !0;
    this.replayGroup_ = null;
    const z = new oK(
      n5(x, w),
      U,
      x,
      w
    );
    let Q;
    for (let Ut = 0, Ft = H.length; Ut < Ft; ++Ut)
      a.loadFeatures(H[Ut], x, b);
    const et = aL(x, w);
    let ot = !0;
    const pt = (
      /**
       * @param {import("../../Feature.js").default} feature Feature.
       * @param {number} index Index.
       */
      (Ut, Ft) => {
        let nt;
        const J = Ut.getStyleFunction() || e.getStyleFunction();
        if (J && (nt = J(Ut, x)), nt) {
          const gt = this.renderFeature(
            Ut,
            et,
            nt,
            z,
            Q,
            this.getLayer().getDeclutter(),
            Ft
          );
          ot = ot && !gt;
        }
      }
    ), ht = h8(U), Ct = a.getFeaturesInExtent(ht);
    L && Ct.sort(L);
    for (let Ut = 0, Ft = Ct.length; Ut < Ft; ++Ut)
      pt(Ct[Ut], Ut);
    this.renderedFeatures_ = Ct, this.ready = ot;
    const mt = z.finish(), St = new dK(
      U,
      x,
      w,
      a.getOverlaps(),
      mt,
      e.getRenderBuffer(),
      !!t.declutter
    );
    return this.renderedResolution_ = x, this.renderedRevision_ = A, this.renderedRenderOrder_ = L, this.renderedFrameDeclutter_ = !!t.declutter, this.renderedExtent_ = k, this.wrappedRenderedExtent_ = U, this.renderedCenter_ = N, this.renderedProjection_ = b, this.renderedPixelRatio_ = w, this.replayGroup_ = St, this.hitDetectionImageData_ = null, this.replayGroupChanged = !0, !0;
  }
  /**
   * @param {import("../../Feature.js").default} feature Feature.
   * @param {number} squaredTolerance Squared render tolerance.
   * @param {import("../../style/Style.js").default|Array<import("../../style/Style.js").default>} styles The style or array of styles.
   * @param {import("../../render/canvas/BuilderGroup.js").default} builderGroup Builder group.
   * @param {import("../../proj.js").TransformFunction} [transform] Transform from user to view projection.
   * @param {boolean} [declutter] Enable decluttering.
   * @param {number} [index] Render order index.
   * @return {boolean} `true` if an image is loading.
   */
  renderFeature(t, e, a, s, l, f, h) {
    if (!a)
      return !1;
    let p = !1;
    if (Array.isArray(a))
      for (let y = 0, b = a.length; y < b; ++y)
        p = rL(
          s,
          t,
          a[y],
          e,
          this.boundHandleStyleImageChange_,
          l,
          f,
          h
        ) || p;
    else
      p = rL(
        s,
        t,
        a,
        e,
        this.boundHandleStyleImageChange_,
        l,
        f,
        h
      );
    return p;
  }
}
let Z_ = 0;
const Mo = 1 << Z_++, kn = 1 << Z_++, ul = 1 << Z_++, Df = 1 << Z_++, V_ = 1 << Z_++, Ib = 1 << Z_++, lT = Math.pow(2, Z_) - 1, gO = {
  [Mo]: "boolean",
  [kn]: "number",
  [ul]: "string",
  [Df]: "color",
  [V_]: "number[]",
  [Ib]: "size"
}, bK = Object.keys(gO).map(Number).sort(sm);
function SK(n) {
  return n in gO;
}
function Pb(n) {
  const t = [];
  for (const e of bK)
    zb(n, e) && t.push(gO[e]);
  return t.length === 0 ? "untyped" : t.length < 3 ? t.join(" or ") : t.slice(0, -1).join(", ") + ", or " + t[t.length - 1];
}
function zb(n, t) {
  return (n & t) === t;
}
function s0(n, t) {
  return n === t;
}
class Nr {
  /**
   * @param {number} type The value type.
   * @param {LiteralValue} value The literal value.
   */
  constructor(t, e) {
    if (!SK(t))
      throw new Error(
        `literal expressions must have a specific type, got ${Pb(t)}`
      );
    this.type = t, this.value = e;
  }
}
class xK {
  /**
   * @param {number} type The return type.
   * @param {string} operator The operator.
   * @param {...Expression} args The arguments.
   */
  constructor(t, e, ...a) {
    this.type = t, this.operator = e, this.args = a;
  }
}
function f5() {
  return {
    variables: /* @__PURE__ */ new Set(),
    properties: /* @__PURE__ */ new Set(),
    featureId: !1,
    geometryType: !1,
    mapState: !1
  };
}
function As(n, t, e) {
  switch (typeof n) {
    case "boolean": {
      if (s0(t, ul))
        return new Nr(ul, n ? "true" : "false");
      if (!zb(t, Mo))
        throw new Error(
          `got a boolean, but expected ${Pb(t)}`
        );
      return new Nr(Mo, n);
    }
    case "number": {
      if (s0(t, Ib))
        return new Nr(Ib, ml(n));
      if (s0(t, Mo))
        return new Nr(Mo, !!n);
      if (s0(t, ul))
        return new Nr(ul, n.toString());
      if (!zb(t, kn))
        throw new Error(`got a number, but expected ${Pb(t)}`);
      return new Nr(kn, n);
    }
    case "string": {
      if (s0(t, Df))
        return new Nr(Df, sO(n));
      if (s0(t, Mo))
        return new Nr(Mo, !!n);
      if (!zb(t, ul))
        throw new Error(`got a string, but expected ${Pb(t)}`);
      return new Nr(ul, n);
    }
  }
  if (!Array.isArray(n))
    throw new Error("expression must be an array or a primitive value");
  if (n.length === 0)
    throw new Error("empty expression");
  if (typeof n[0] == "string")
    return IK(n, t, e);
  for (const a of n)
    if (typeof a != "number")
      throw new Error("expected an array of numbers");
  if (s0(t, Ib)) {
    if (n.length !== 2)
      throw new Error(
        `expected an array of two values for a size, got ${n.length}`
      );
    return new Nr(Ib, n);
  }
  if (s0(t, Df)) {
    if (n.length === 3)
      return new Nr(Df, [...n, 1]);
    if (n.length === 4)
      return new Nr(Df, n);
    throw new Error(
      `expected an array of 3 or 4 values for a color, got ${n.length}`
    );
  }
  if (!zb(t, V_))
    throw new Error(
      `got an array of numbers, but expected ${Pb(t)}`
    );
  return new Nr(V_, n);
}
const qt = {
  Get: "get",
  Var: "var",
  Concat: "concat",
  GeometryType: "geometry-type",
  LineMetric: "line-metric",
  Any: "any",
  All: "all",
  Not: "!",
  Resolution: "resolution",
  Zoom: "zoom",
  Time: "time",
  Equal: "==",
  NotEqual: "!=",
  GreaterThan: ">",
  GreaterThanOrEqualTo: ">=",
  LessThan: "<",
  LessThanOrEqualTo: "<=",
  Multiply: "*",
  Divide: "/",
  Add: "+",
  Subtract: "-",
  Clamp: "clamp",
  Mod: "%",
  Pow: "^",
  Abs: "abs",
  Floor: "floor",
  Ceil: "ceil",
  Round: "round",
  Sin: "sin",
  Cos: "cos",
  Atan: "atan",
  Sqrt: "sqrt",
  Match: "match",
  Between: "between",
  Interpolate: "interpolate",
  Coalesce: "coalesce",
  Case: "case",
  In: "in",
  Number: "number",
  String: "string",
  Array: "array",
  Color: "color",
  Id: "id",
  Band: "band",
  Palette: "palette",
  ToString: "to-string",
  Has: "has"
}, TK = {
  [qt.Get]: Ye(En(1, 1 / 0), vL),
  [qt.Var]: Ye(En(1, 1), wK),
  [qt.Has]: Ye(En(1, 1 / 0), vL),
  [qt.Id]: Ye(RK, T1),
  [qt.Concat]: Ye(
    En(2, 1 / 0),
    ci(ul)
  ),
  [qt.GeometryType]: Ye(AK, T1),
  [qt.LineMetric]: Ye(T1),
  [qt.Resolution]: Ye(ZA, T1),
  [qt.Zoom]: Ye(ZA, T1),
  [qt.Time]: Ye(ZA, T1),
  [qt.Any]: Ye(
    En(2, 1 / 0),
    ci(Mo)
  ),
  [qt.All]: Ye(
    En(2, 1 / 0),
    ci(Mo)
  ),
  [qt.Not]: Ye(
    En(1, 1),
    ci(Mo)
  ),
  [qt.Equal]: Ye(
    En(2, 2),
    ci(lT)
  ),
  [qt.NotEqual]: Ye(
    En(2, 2),
    ci(lT)
  ),
  [qt.GreaterThan]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.GreaterThanOrEqualTo]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.LessThan]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.LessThanOrEqualTo]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.Multiply]: Ye(
    En(2, 1 / 0),
    EL
  ),
  [qt.Coalesce]: Ye(
    En(2, 1 / 0),
    EL
  ),
  [qt.Divide]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.Add]: Ye(
    En(2, 1 / 0),
    ci(kn)
  ),
  [qt.Subtract]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.Clamp]: Ye(
    En(3, 3),
    ci(kn)
  ),
  [qt.Mod]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.Pow]: Ye(
    En(2, 2),
    ci(kn)
  ),
  [qt.Abs]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Floor]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Ceil]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Round]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Sin]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Cos]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Atan]: Ye(
    En(1, 2),
    ci(kn)
  ),
  [qt.Sqrt]: Ye(
    En(1, 1),
    ci(kn)
  ),
  [qt.Match]: Ye(
    En(4, 1 / 0),
    bL,
    CK
  ),
  [qt.Between]: Ye(
    En(3, 3),
    ci(kn)
  ),
  [qt.Interpolate]: Ye(
    En(6, 1 / 0),
    bL,
    OK
  ),
  [qt.Case]: Ye(
    En(3, 1 / 0),
    MK,
    DK
  ),
  [qt.In]: Ye(En(2, 2), NK),
  [qt.Number]: Ye(
    En(1, 1 / 0),
    ci(lT)
  ),
  [qt.String]: Ye(
    En(1, 1 / 0),
    ci(lT)
  ),
  [qt.Array]: Ye(
    En(1, 1 / 0),
    ci(kn)
  ),
  [qt.Color]: Ye(
    En(1, 4),
    ci(kn)
  ),
  [qt.Band]: Ye(
    En(1, 3),
    ci(kn)
  ),
  [qt.Palette]: Ye(
    En(2, 2),
    LK
  ),
  [qt.ToString]: Ye(
    En(1, 1),
    ci(Mo | kn | ul | Df)
  )
};
function vL(n, t, e) {
  const a = n.length - 1, s = new Array(a);
  for (let l = 0; l < a; ++l) {
    const f = n[l + 1];
    switch (typeof f) {
      case "number": {
        s[l] = new Nr(kn, f);
        break;
      }
      case "string": {
        s[l] = new Nr(ul, f);
        break;
      }
      default:
        throw new Error(
          `expected a string key or numeric array index for a get operation, got ${f}`
        );
    }
    l === 0 && e.properties.add(String(f));
  }
  return s;
}
function wK(n, t, e) {
  const a = n[1];
  if (typeof a != "string")
    throw new Error("expected a string argument for var operation");
  return e.variables.add(a), [new Nr(ul, a)];
}
function RK(n, t, e) {
  e.featureId = !0;
}
function AK(n, t, e) {
  e.geometryType = !0;
}
function ZA(n, t, e) {
  e.mapState = !0;
}
function T1(n, t, e) {
  const a = n[0];
  if (n.length !== 1)
    throw new Error(`expected no arguments for ${a} operation`);
  return [];
}
function En(n, t) {
  return function(e, a, s) {
    const l = e[0], f = e.length - 1;
    if (n === t) {
      if (f !== n) {
        const h = n === 1 ? "" : "s";
        throw new Error(
          `expected ${n} argument${h} for ${l}, got ${f}`
        );
      }
    } else if (f < n || f > t) {
      const h = t === 1 / 0 ? `${n} or more` : `${n} to ${t}`;
      throw new Error(
        `expected ${h} arguments for ${l}, got ${f}`
      );
    }
  };
}
function EL(n, t, e) {
  const a = n.length - 1, s = new Array(a);
  for (let l = 0; l < a; ++l) {
    const f = As(n[l + 1], t, e);
    s[l] = f;
  }
  return s;
}
function ci(n) {
  return function(t, e, a) {
    const s = t.length - 1, l = new Array(s);
    for (let f = 0; f < s; ++f) {
      const h = As(t[f + 1], n, a);
      l[f] = h;
    }
    return l;
  };
}
function MK(n, t, e) {
  const a = n[0], s = n.length - 1;
  if (s % 2 === 0)
    throw new Error(
      `expected an odd number of arguments for ${a}, got ${s} instead`
    );
}
function bL(n, t, e) {
  const a = n[0], s = n.length - 1;
  if (s % 2 === 1)
    throw new Error(
      `expected an even number of arguments for operation ${a}, got ${s} instead`
    );
}
function CK(n, t, e) {
  const a = n.length - 1, s = ul | kn | Mo, l = As(n[1], s, e), f = As(n[n.length - 1], t, e), h = new Array(a - 2);
  for (let p = 0; p < a - 2; p += 2) {
    try {
      const y = As(n[p + 2], l.type, e);
      h[p] = y;
    } catch (y) {
      throw new Error(
        `failed to parse argument ${p + 1} of match expression: ${y.message}`
      );
    }
    try {
      const y = As(n[p + 3], f.type, e);
      h[p + 1] = y;
    } catch (y) {
      throw new Error(
        `failed to parse argument ${p + 2} of match expression: ${y.message}`
      );
    }
  }
  return [l, ...h, f];
}
function OK(n, t, e) {
  const a = n[1];
  let s;
  switch (a[0]) {
    case "linear":
      s = 1;
      break;
    case "exponential":
      const p = a[1];
      if (typeof p != "number" || p <= 0)
        throw new Error(
          `expected a number base for exponential interpolation, got ${JSON.stringify(p)} instead`
        );
      s = p;
      break;
    default:
      throw new Error(
        `invalid interpolation type: ${JSON.stringify(a)}`
      );
  }
  const l = new Nr(kn, s);
  let f;
  try {
    f = As(n[2], kn, e);
  } catch (p) {
    throw new Error(
      `failed to parse argument 1 in interpolate expression: ${p.message}`
    );
  }
  const h = new Array(n.length - 3);
  for (let p = 0; p < h.length; p += 2) {
    try {
      const y = As(n[p + 3], kn, e);
      h[p] = y;
    } catch (y) {
      throw new Error(
        `failed to parse argument ${p + 2} for interpolate expression: ${y.message}`
      );
    }
    try {
      const y = As(n[p + 4], t, e);
      h[p + 1] = y;
    } catch (y) {
      throw new Error(
        `failed to parse argument ${p + 3} for interpolate expression: ${y.message}`
      );
    }
  }
  return [l, f, ...h];
}
function DK(n, t, e) {
  const a = As(n[n.length - 1], t, e), s = new Array(n.length - 1);
  for (let l = 0; l < s.length - 1; l += 2) {
    try {
      const f = As(n[l + 1], Mo, e);
      s[l] = f;
    } catch (f) {
      throw new Error(
        `failed to parse argument ${l} of case expression: ${f.message}`
      );
    }
    try {
      const f = As(n[l + 2], a.type, e);
      s[l + 1] = f;
    } catch (f) {
      throw new Error(
        `failed to parse argument ${l + 1} of case expression: ${f.message}`
      );
    }
  }
  return s[s.length - 1] = a, s;
}
function NK(n, t, e) {
  let a = n[2];
  if (!Array.isArray(a))
    throw new Error(
      'the second argument for the "in" operator must be an array'
    );
  let s;
  if (typeof a[0] == "string") {
    if (a[0] !== "literal")
      throw new Error(
        'for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions'
      );
    if (!Array.isArray(a[1]))
      throw new Error(
        'failed to parse "in" expression: the literal operator must be followed by an array'
      );
    a = a[1], s = ul;
  } else
    s = kn;
  const l = new Array(a.length);
  for (let h = 0; h < l.length; h++)
    try {
      const p = As(a[h], s, e);
      l[h] = p;
    } catch (p) {
      throw new Error(
        `failed to parse haystack item ${h} for "in" expression: ${p.message}`
      );
    }
  return [As(n[1], s, e), ...l];
}
function LK(n, t, e) {
  let a;
  try {
    a = As(n[1], kn, e);
  } catch (f) {
    throw new Error(
      `failed to parse first argument in palette expression: ${f.message}`
    );
  }
  const s = n[2];
  if (!Array.isArray(s))
    throw new Error("the second argument of palette must be an array");
  const l = new Array(s.length);
  for (let f = 0; f < l.length; f++) {
    let h;
    try {
      h = As(s[f], Df, e);
    } catch (p) {
      throw new Error(
        `failed to parse color at index ${f} in palette expression: ${p.message}`
      );
    }
    if (!(h instanceof Nr))
      throw new Error(
        `the palette color at index ${f} must be a literal value`
      );
    l[f] = h;
  }
  return [a, ...l];
}
function Ye(...n) {
  return function(t, e, a) {
    const s = t[0];
    let l;
    for (let f = 0; f < n.length; f++) {
      const h = n[f](t, e, a);
      if (f == n.length - 1) {
        if (!h)
          throw new Error(
            "expected last argument validator to return the parsed args"
          );
        l = h;
      }
    }
    return new xK(e, s, ...l);
  };
}
function IK(n, t, e) {
  const a = n[0], s = TK[a];
  if (!s)
    throw new Error(`unknown operator: ${a}`);
  return s(n, t, e);
}
function h5(n) {
  if (!n)
    return "";
  const t = n.getType();
  switch (t) {
    case "Point":
    case "LineString":
    case "Polygon":
      return t;
    case "MultiPoint":
    case "MultiLineString":
    case "MultiPolygon":
      return (
        /** @type {'Point'|'LineString'|'Polygon'} */
        t.substring(5)
      );
    case "Circle":
      return "Polygon";
    case "GeometryCollection":
      return h5(
        /** @type {import("../geom/GeometryCollection.js").default} */
        n.getGeometries()[0]
      );
    default:
      return "";
  }
}
function d5() {
  return {
    variables: {},
    properties: {},
    resolution: NaN,
    featureId: null,
    geometryType: ""
  };
}
function pm(n, t, e) {
  const a = As(n, t, e);
  return zf(a);
}
function zf(n, t) {
  if (n instanceof Nr) {
    if (n.type === Df && typeof n.value == "string") {
      const a = sO(n.value);
      return function() {
        return a;
      };
    }
    return function() {
      return n.value;
    };
  }
  const e = n.operator;
  switch (e) {
    case qt.Number:
    case qt.String:
    case qt.Coalesce:
      return PK(n);
    case qt.Get:
    case qt.Var:
    case qt.Has:
      return zK(n);
    case qt.Id:
      return (a) => a.featureId;
    case qt.GeometryType:
      return (a) => a.geometryType;
    case qt.Concat: {
      const a = n.args.map((s) => zf(s));
      return (s) => "".concat(...a.map((l) => l(s).toString()));
    }
    case qt.Resolution:
      return (a) => a.resolution;
    case qt.Any:
    case qt.All:
    case qt.Between:
    case qt.In:
    case qt.Not:
      return UK(n);
    case qt.Equal:
    case qt.NotEqual:
    case qt.LessThan:
    case qt.LessThanOrEqualTo:
    case qt.GreaterThan:
    case qt.GreaterThanOrEqualTo:
      return GK(n);
    case qt.Multiply:
    case qt.Divide:
    case qt.Add:
    case qt.Subtract:
    case qt.Clamp:
    case qt.Mod:
    case qt.Pow:
    case qt.Abs:
    case qt.Floor:
    case qt.Ceil:
    case qt.Round:
    case qt.Sin:
    case qt.Cos:
    case qt.Atan:
    case qt.Sqrt:
      return jK(n);
    case qt.Case:
      return kK(n);
    case qt.Match:
      return HK(n);
    case qt.Interpolate:
      return BK(n);
    case qt.ToString:
      return qK(n);
    default:
      throw new Error(`Unsupported operator ${e}`);
  }
}
function PK(n, t) {
  const e = n.operator, a = n.args.length, s = new Array(a);
  for (let l = 0; l < a; ++l)
    s[l] = zf(n.args[l]);
  switch (e) {
    case qt.Coalesce:
      return (l) => {
        for (let f = 0; f < a; ++f) {
          const h = s[f](l);
          if (typeof h < "u" && h !== null)
            return h;
        }
        throw new Error("Expected one of the values to be non-null");
      };
    case qt.Number:
    case qt.String:
      return (l) => {
        for (let f = 0; f < a; ++f) {
          const h = s[f](l);
          if (typeof h === e)
            return h;
        }
        throw new Error(`Expected one of the values to be a ${e}`);
      };
    default:
      throw new Error(`Unsupported assertion operator ${e}`);
  }
}
function zK(n, t) {
  const a = (
    /** @type {string} */
    /** @type {LiteralExpression} */
    n.args[0].value
  );
  switch (n.operator) {
    case qt.Get:
      return (s) => {
        const l = n.args;
        let f = s.properties[a];
        for (let h = 1, p = l.length; h < p; ++h) {
          const b = (
            /** @type {string|number} */
            /** @type {LiteralExpression} */
            l[h].value
          );
          f = f[b];
        }
        return f;
      };
    case qt.Var:
      return (s) => s.variables[a];
    case qt.Has:
      return (s) => {
        const l = n.args;
        if (!(a in s.properties))
          return !1;
        let f = s.properties[a];
        for (let h = 1, p = l.length; h < p; ++h) {
          const b = (
            /** @type {string|number} */
            /** @type {LiteralExpression} */
            l[h].value
          );
          if (!f || !Object.hasOwn(f, b))
            return !1;
          f = f[b];
        }
        return !0;
      };
    default:
      throw new Error(`Unsupported accessor operator ${n.operator}`);
  }
}
function GK(n, t) {
  const e = n.operator, a = zf(n.args[0]), s = zf(n.args[1]);
  switch (e) {
    case qt.Equal:
      return (l) => a(l) === s(l);
    case qt.NotEqual:
      return (l) => a(l) !== s(l);
    case qt.LessThan:
      return (l) => a(l) < s(l);
    case qt.LessThanOrEqualTo:
      return (l) => a(l) <= s(l);
    case qt.GreaterThan:
      return (l) => a(l) > s(l);
    case qt.GreaterThanOrEqualTo:
      return (l) => a(l) >= s(l);
    default:
      throw new Error(`Unsupported comparison operator ${e}`);
  }
}
function UK(n, t) {
  const e = n.operator, a = n.args.length, s = new Array(a);
  for (let l = 0; l < a; ++l)
    s[l] = zf(n.args[l]);
  switch (e) {
    case qt.Any:
      return (l) => {
        for (let f = 0; f < a; ++f)
          if (s[f](l))
            return !0;
        return !1;
      };
    case qt.All:
      return (l) => {
        for (let f = 0; f < a; ++f)
          if (!s[f](l))
            return !1;
        return !0;
      };
    case qt.Between:
      return (l) => {
        const f = s[0](l), h = s[1](l), p = s[2](l);
        return f >= h && f <= p;
      };
    case qt.In:
      return (l) => {
        const f = s[0](l);
        for (let h = 1; h < a; ++h)
          if (f === s[h](l))
            return !0;
        return !1;
      };
    case qt.Not:
      return (l) => !s[0](l);
    default:
      throw new Error(`Unsupported logical operator ${e}`);
  }
}
function jK(n, t) {
  const e = n.operator, a = n.args.length, s = new Array(a);
  for (let l = 0; l < a; ++l)
    s[l] = zf(n.args[l]);
  switch (e) {
    case qt.Multiply:
      return (l) => {
        let f = 1;
        for (let h = 0; h < a; ++h)
          f *= s[h](l);
        return f;
      };
    case qt.Divide:
      return (l) => s[0](l) / s[1](l);
    case qt.Add:
      return (l) => {
        let f = 0;
        for (let h = 0; h < a; ++h)
          f += s[h](l);
        return f;
      };
    case qt.Subtract:
      return (l) => s[0](l) - s[1](l);
    case qt.Clamp:
      return (l) => {
        const f = s[0](l), h = s[1](l);
        if (f < h)
          return h;
        const p = s[2](l);
        return f > p ? p : f;
      };
    case qt.Mod:
      return (l) => s[0](l) % s[1](l);
    case qt.Pow:
      return (l) => Math.pow(s[0](l), s[1](l));
    case qt.Abs:
      return (l) => Math.abs(s[0](l));
    case qt.Floor:
      return (l) => Math.floor(s[0](l));
    case qt.Ceil:
      return (l) => Math.ceil(s[0](l));
    case qt.Round:
      return (l) => Math.round(s[0](l));
    case qt.Sin:
      return (l) => Math.sin(s[0](l));
    case qt.Cos:
      return (l) => Math.cos(s[0](l));
    case qt.Atan:
      return a === 2 ? (l) => Math.atan2(s[0](l), s[1](l)) : (l) => Math.atan(s[0](l));
    case qt.Sqrt:
      return (l) => Math.sqrt(s[0](l));
    default:
      throw new Error(`Unsupported numeric operator ${e}`);
  }
}
function kK(n, t) {
  const e = n.args.length, a = new Array(e);
  for (let s = 0; s < e; ++s)
    a[s] = zf(n.args[s]);
  return (s) => {
    for (let l = 0; l < e - 1; l += 2)
      if (a[l](s))
        return a[l + 1](s);
    return a[e - 1](s);
  };
}
function HK(n, t) {
  const e = n.args.length, a = new Array(e);
  for (let s = 0; s < e; ++s)
    a[s] = zf(n.args[s]);
  return (s) => {
    const l = a[0](s);
    for (let f = 1; f < e - 1; f += 2)
      if (l === a[f](s))
        return a[f + 1](s);
    return a[e - 1](s);
  };
}
function BK(n, t) {
  const e = n.args.length, a = new Array(e);
  for (let s = 0; s < e; ++s)
    a[s] = zf(n.args[s]);
  return (s) => {
    const l = a[0](s), f = a[1](s);
    let h, p;
    for (let y = 2; y < e; y += 2) {
      const b = a[y](s);
      let x = a[y + 1](s);
      const w = Array.isArray(x);
      if (w && (x = mX(x)), b >= f)
        return y === 2 ? x : w ? VK(
          l,
          f,
          h,
          p,
          b,
          x
        ) : Gb(
          l,
          f,
          h,
          p,
          b,
          x
        );
      h = b, p = x;
    }
    return p;
  };
}
function qK(n, t) {
  const e = n.operator, a = n.args.length, s = new Array(a);
  for (let l = 0; l < a; ++l)
    s[l] = zf(n.args[l]);
  switch (e) {
    case qt.ToString:
      return (l) => {
        const f = s[0](l);
        return n.args[0].type === Df ? oO(f) : f.toString();
      };
    default:
      throw new Error(`Unsupported convert operator ${e}`);
  }
}
function Gb(n, t, e, a, s, l) {
  const f = s - e;
  if (f === 0)
    return a;
  const h = t - e, p = n === 1 ? h / f : (Math.pow(n, h) - 1) / (Math.pow(n, f) - 1);
  return a + p * (l - a);
}
function VK(n, t, e, a, s, l) {
  if (s - e === 0)
    return a;
  const h = JN(a), p = JN(l);
  let y = p[2] - h[2];
  y > 180 ? y -= 360 : y < -180 && (y += 360);
  const b = [
    Gb(n, t, e, h[0], s, p[0]),
    Gb(n, t, e, h[1], s, p[1]),
    h[2] + Gb(n, t, e, 0, s, y),
    Gb(n, t, e, a[3], s, l[3])
  ];
  return pX(b);
}
function YK(n) {
  return !0;
}
function FK(n) {
  const t = f5(), e = $K(n, t), a = d5();
  return function(s, l) {
    if (a.properties = s.getPropertiesInternal(), a.resolution = l, t.featureId) {
      const f = s.getId();
      f !== void 0 ? a.featureId = f : a.featureId = null;
    }
    return t.geometryType && (a.geometryType = h5(
      s.getGeometry()
    )), e(a);
  };
}
function SL(n) {
  const t = f5(), e = n.length, a = new Array(e);
  for (let f = 0; f < e; ++f)
    a[f] = KM(n[f], t);
  const s = d5(), l = new Array(e);
  return function(f, h) {
    if (s.properties = f.getPropertiesInternal(), s.resolution = h, t.featureId) {
      const y = f.getId();
      y !== void 0 ? s.featureId = y : s.featureId = null;
    }
    let p = 0;
    for (let y = 0; y < e; ++y) {
      const b = a[y](s);
      b && (l[p] = b, p += 1);
    }
    return l.length = p, l;
  };
}
function $K(n, t) {
  const e = n.length, a = new Array(e);
  for (let s = 0; s < e; ++s) {
    const l = n[s], f = "filter" in l ? pm(l.filter, Mo, t) : YK;
    let h;
    if (Array.isArray(l.style)) {
      const p = l.style.length;
      h = new Array(p);
      for (let y = 0; y < p; ++y)
        h[y] = KM(l.style[y], t);
    } else
      h = [KM(l.style, t)];
    a[s] = { filter: f, styles: h };
  }
  return function(s) {
    const l = [];
    let f = !1;
    for (let h = 0; h < e; ++h) {
      const p = a[h].filter;
      if (p(s) && !(n[h].else && f)) {
        f = !0;
        for (const y of a[h].styles) {
          const b = y(s);
          b && l.push(b);
        }
      }
    }
    return l;
  };
}
function KM(n, t) {
  const e = mS(n, "", t), a = pS(n, "", t), s = XK(n, t), l = KK(n, t), f = gl(n, "z-index", t);
  if (!e && !a && !s && !l && !W1(n))
    throw new Error(
      "No fill, stroke, point, or text symbolizer properties in style: " + JSON.stringify(n)
    );
  const h = new E0();
  return function(p) {
    let y = !0;
    if (e) {
      const b = e(p);
      b && (y = !1), h.setFill(b);
    }
    if (a) {
      const b = a(p);
      b && (y = !1), h.setStroke(b);
    }
    if (s) {
      const b = s(p);
      b && (y = !1), h.setText(b);
    }
    if (l) {
      const b = l(p);
      b && (y = !1), h.setImage(b);
    }
    return f && h.setZIndex(f(p)), y ? null : h;
  };
}
function mS(n, t, e) {
  let a;
  if (t + "fill-pattern-src" in n)
    a = JK(n, t + "fill-", e);
  else {
    if (n[t + "fill-color"] === "none")
      return (l) => null;
    a = mO(
      n,
      t + "fill-color",
      e
    );
  }
  if (!a)
    return null;
  const s = new kS();
  return function(l) {
    const f = a(l);
    return f === rO ? null : (s.setColor(f), s);
  };
}
function pS(n, t, e) {
  const a = gl(
    n,
    t + "stroke-width",
    e
  ), s = mO(
    n,
    t + "stroke-color",
    e
  );
  if (!a && !s)
    return null;
  const l = nm(
    n,
    t + "stroke-line-cap",
    e
  ), f = nm(
    n,
    t + "stroke-line-join",
    e
  ), h = g5(
    n,
    t + "stroke-line-dash",
    e
  ), p = gl(
    n,
    t + "stroke-line-dash-offset",
    e
  ), y = gl(
    n,
    t + "stroke-miter-limit",
    e
  ), b = new HS();
  return function(x) {
    if (s) {
      const w = s(x);
      if (w === rO)
        return null;
      b.setColor(w);
    }
    if (a && b.setWidth(a(x)), l) {
      const w = l(x);
      if (w !== "butt" && w !== "round" && w !== "square")
        throw new Error("Expected butt, round, or square line cap");
      b.setLineCap(w);
    }
    if (f) {
      const w = f(x);
      if (w !== "bevel" && w !== "round" && w !== "miter")
        throw new Error("Expected bevel, round, or miter line join");
      b.setLineJoin(w);
    }
    return h && b.setLineDash(h(x)), p && b.setLineDashOffset(p(x)), y && b.setMiterLimit(y(x)), b;
  };
}
function XK(n, t) {
  const e = "text-", a = nm(n, e + "value", t);
  if (!a)
    return null;
  const s = mS(n, e, t), l = mS(
    n,
    e + "background-",
    t
  ), f = pS(n, e, t), h = pS(
    n,
    e + "background-",
    t
  ), p = nm(n, e + "font", t), y = gl(
    n,
    e + "max-angle",
    t
  ), b = gl(
    n,
    e + "offset-x",
    t
  ), x = gl(
    n,
    e + "offset-y",
    t
  ), w = F1(
    n,
    e + "overflow",
    t
  ), A = nm(
    n,
    e + "placement",
    t
  ), C = gl(n, e + "repeat", t), L = zw(n, e + "scale", t), N = F1(
    n,
    e + "rotate-with-view",
    t
  ), U = gl(
    n,
    e + "rotation",
    t
  ), k = nm(n, e + "align", t), H = nm(
    n,
    e + "justify",
    t
  ), B = nm(
    n,
    e + "baseline",
    t
  ), z = F1(
    n,
    e + "keep-upright",
    t
  ), Q = g5(
    n,
    e + "padding",
    t
  ), et = Gw(
    n,
    e + "declutter-mode"
  ), ot = new hO({ declutterMode: et });
  return function(pt) {
    if (ot.setText(a(pt)), s && ot.setFill(s(pt)), l && ot.setBackgroundFill(l(pt)), f && ot.setStroke(f(pt)), h && ot.setBackgroundStroke(h(pt)), p && ot.setFont(p(pt)), y && ot.setMaxAngle(y(pt)), b && ot.setOffsetX(b(pt)), x && ot.setOffsetY(x(pt)), w && ot.setOverflow(w(pt)), A) {
      const ht = A(pt);
      if (ht !== "point" && ht !== "line")
        throw new Error("Expected point or line for text-placement");
      ot.setPlacement(ht);
    }
    if (C && ot.setRepeat(C(pt)), L && ot.setScale(L(pt)), N && ot.setRotateWithView(N(pt)), U && ot.setRotation(U(pt)), k) {
      const ht = k(pt);
      if (ht !== "left" && ht !== "center" && ht !== "right" && ht !== "end" && ht !== "start")
        throw new Error(
          "Expected left, right, center, start, or end for text-align"
        );
      ot.setTextAlign(ht);
    }
    if (H) {
      const ht = H(pt);
      if (ht !== "left" && ht !== "right" && ht !== "center")
        throw new Error("Expected left, right, or center for text-justify");
      ot.setJustify(ht);
    }
    if (B) {
      const ht = B(pt);
      if (ht !== "bottom" && ht !== "top" && ht !== "middle" && ht !== "alphabetic" && ht !== "hanging")
        throw new Error(
          "Expected bottom, top, middle, alphabetic, or hanging for text-baseline"
        );
      ot.setTextBaseline(ht);
    }
    return Q && ot.setPadding(Q(pt)), z && ot.setKeepUpright(z(pt)), ot;
  };
}
function KK(n, t) {
  return "icon-src" in n ? ZK(n, t) : "shape-points" in n ? WK(n, t) : "circle-radius" in n ? QK(n, t) : null;
}
function ZK(n, t) {
  const e = "icon-", a = e + "src", s = m5(n[a], a), l = tw(
    n,
    e + "anchor",
    t
  ), f = zw(n, e + "scale", t), h = gl(
    n,
    e + "opacity",
    t
  ), p = tw(
    n,
    e + "displacement",
    t
  ), y = gl(
    n,
    e + "rotation",
    t
  ), b = F1(
    n,
    e + "rotate-with-view",
    t
  ), x = TL(n, e + "anchor-origin"), w = wL(
    n,
    e + "anchor-x-units"
  ), A = wL(
    n,
    e + "anchor-y-units"
  ), C = iZ(n, e + "color"), L = eZ(n, e + "cross-origin"), N = nZ(n, e + "offset"), U = TL(n, e + "offset-origin"), k = ew(n, e + "width"), H = ew(n, e + "height"), B = tZ(n, e + "size"), z = Gw(
    n,
    e + "declutter-mode"
  ), Q = new Pw({
    src: s,
    anchorOrigin: x,
    anchorXUnits: w,
    anchorYUnits: A,
    color: C,
    crossOrigin: L,
    offset: N,
    offsetOrigin: U,
    height: H,
    width: k,
    size: B,
    declutterMode: z
  });
  return function(et) {
    return h && Q.setOpacity(h(et)), p && Q.setDisplacement(p(et)), y && Q.setRotation(y(et)), b && Q.setRotateWithView(b(et)), f && Q.setScale(f(et)), l && Q.setAnchor(l(et)), Q;
  };
}
function WK(n, t) {
  const e = "shape-", a = e + "points", s = e + "radius", l = ZM(n[a], a), f = ZM(n[s], s), h = mS(n, e, t), p = pS(n, e, t), y = zw(n, e + "scale", t), b = tw(
    n,
    e + "displacement",
    t
  ), x = gl(
    n,
    e + "rotation",
    t
  ), w = F1(
    n,
    e + "rotate-with-view",
    t
  ), A = ew(n, e + "radius2"), C = ew(n, e + "angle"), L = Gw(
    n,
    e + "declutter-mode"
  ), N = new Lw({
    points: l,
    radius: f,
    radius2: A,
    angle: C,
    declutterMode: L
  });
  return function(U) {
    return h && N.setFill(h(U)), p && N.setStroke(p(U)), b && N.setDisplacement(b(U)), x && N.setRotation(x(U)), w && N.setRotateWithView(w(U)), y && N.setScale(y(U)), N;
  };
}
function QK(n, t) {
  const e = "circle-", a = mS(n, e, t), s = pS(n, e, t), l = gl(n, e + "radius", t), f = zw(n, e + "scale", t), h = tw(
    n,
    e + "displacement",
    t
  ), p = gl(
    n,
    e + "rotation",
    t
  ), y = F1(
    n,
    e + "rotate-with-view",
    t
  ), b = Gw(
    n,
    e + "declutter-mode"
  ), x = new Iw({
    radius: 5,
    // this is arbitrary, but required - the evaluated radius is used below
    declutterMode: b
  });
  return function(w) {
    return l && x.setRadius(l(w)), a && x.setFill(a(w)), s && x.setStroke(s(w)), h && x.setDisplacement(h(w)), p && x.setRotation(p(w)), y && x.setRotateWithView(y(w)), f && x.setScale(f(w)), x;
  };
}
function gl(n, t, e) {
  if (!(t in n))
    return;
  const a = pm(n[t], kn, e);
  return function(s) {
    return ZM(a(s), t);
  };
}
function nm(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], ul, e);
  return function(s) {
    return m5(a(s), t);
  };
}
function JK(n, t, e) {
  const a = nm(
    n,
    t + "pattern-src",
    e
  ), s = xL(
    n,
    t + "pattern-offset",
    e
  ), l = xL(
    n,
    t + "pattern-size",
    e
  ), f = mO(
    n,
    t + "color",
    e
  );
  return function(h) {
    return {
      src: a(h),
      offset: s && s(h),
      size: l && l(h),
      color: f && f(h)
    };
  };
}
function F1(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], Mo, e);
  return function(s) {
    const l = a(s);
    if (typeof l != "boolean")
      throw new Error(`Expected a boolean for ${t}`);
    return l;
  };
}
function mO(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], Df, e);
  return function(s) {
    return p5(a(s), t);
  };
}
function g5(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], V_, e);
  return function(s) {
    return qS(a(s), t);
  };
}
function tw(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], V_, e);
  return function(s) {
    const l = qS(a(s), t);
    if (l.length !== 2)
      throw new Error(`Expected two numbers for ${t}`);
    return l;
  };
}
function xL(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(n[t], V_, e);
  return function(s) {
    return y5(a(s), t);
  };
}
function zw(n, t, e) {
  if (!(t in n))
    return null;
  const a = pm(
    n[t],
    V_ | kn,
    e
  );
  return function(s) {
    return aZ(a(s), t);
  };
}
function ew(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (typeof e != "number")
      throw new Error(`Expected a number for ${t}`);
    return e;
  }
}
function tZ(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (typeof e == "number")
      return ml(e);
    if (!Array.isArray(e))
      throw new Error(`Expected a number or size array for ${t}`);
    if (e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number")
      throw new Error(`Expected a number or size array for ${t}`);
    return e;
  }
}
function eZ(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (typeof e != "string")
      throw new Error(`Expected a string for ${t}`);
    return e;
  }
}
function TL(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (e !== "bottom-left" && e !== "bottom-right" && e !== "top-left" && e !== "top-right")
      throw new Error(
        `Expected bottom-left, bottom-right, top-left, or top-right for ${t}`
      );
    return e;
  }
}
function wL(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (e !== "pixels" && e !== "fraction")
      throw new Error(`Expected pixels or fraction for ${t}`);
    return e;
  }
}
function nZ(n, t) {
  const e = n[t];
  if (e !== void 0)
    return qS(e, t);
}
function Gw(n, t) {
  const e = n[t];
  if (e !== void 0) {
    if (typeof e != "string")
      throw new Error(`Expected a string for ${t}`);
    if (e !== "declutter" && e !== "obstacle" && e !== "none")
      throw new Error(`Expected declutter, obstacle, or none for ${t}`);
    return e;
  }
}
function iZ(n, t) {
  const e = n[t];
  if (e !== void 0)
    return p5(e, t);
}
function qS(n, t) {
  if (!Array.isArray(n))
    throw new Error(`Expected an array for ${t}`);
  const e = n.length;
  for (let a = 0; a < e; ++a)
    if (typeof n[a] != "number")
      throw new Error(`Expected an array of numbers for ${t}`);
  return n;
}
function m5(n, t) {
  if (typeof n != "string")
    throw new Error(`Expected a string for ${t}`);
  return n;
}
function ZM(n, t) {
  if (typeof n != "number")
    throw new Error(`Expected a number for ${t}`);
  return n;
}
function p5(n, t) {
  if (typeof n == "string")
    return n;
  const e = qS(n, t), a = e.length;
  if (a < 3 || a > 4)
    throw new Error(`Expected a color with 3 or 4 values for ${t}`);
  return e;
}
function y5(n, t) {
  const e = qS(n, t);
  if (e.length !== 2)
    throw new Error(`Expected an array of two numbers for ${t}`);
  return e;
}
function aZ(n, t) {
  return typeof n == "number" ? n : y5(n, t);
}
const Mf = {
  CENTER: "center",
  RESOLUTION: "resolution",
  ROTATION: "rotation"
};
function RL(n, t, e) {
  return (
    /**
     * @param {import("./coordinate.js").Coordinate|undefined} center Center.
     * @param {number|undefined} resolution Resolution.
     * @param {import("./size.js").Size} size Viewport size; unused if `onlyCenter` was specified.
     * @param {boolean} [isMoving] True if an interaction or animation is in progress.
     * @param {Array<number>} [centerShift] Shift between map center and viewport center.
     * @return {import("./coordinate.js").Coordinate|undefined} Center.
     */
    function(a, s, l, f, h) {
      if (!a)
        return;
      if (!s && !t)
        return a;
      const p = t ? 0 : l[0] * s, y = t ? 0 : l[1] * s, b = h ? h[0] : 0, x = h ? h[1] : 0;
      let w = n[0] + p / 2 + b, A = n[2] - p / 2 + b, C = n[1] + y / 2 + x, L = n[3] - y / 2 + x;
      w > A && (w = (A + w) / 2, A = w), C > L && (C = (L + C) / 2, L = C);
      let N = ra(a[0], w, A), U = ra(a[1], C, L);
      if (f && e && s) {
        const k = 30 * s;
        N += -k * Math.log(1 + Math.max(0, w - a[0]) / k) + k * Math.log(1 + Math.max(0, a[0] - A) / k), U += -k * Math.log(1 + Math.max(0, C - a[1]) / k) + k * Math.log(1 + Math.max(0, a[1] - L) / k);
      }
      return [N, U];
    }
  );
}
function rZ(n) {
  return n;
}
function _5(n) {
  return Math.pow(n, 3);
}
function xE(n) {
  return 1 - _5(1 - n);
}
function sZ(n) {
  return 3 * n * n - 2 * n * n * n;
}
function oZ(n) {
  return n;
}
function pO(n, t, e, a) {
  const s = Hn(t) / e[0], l = Ir(t) / e[1];
  return a ? Math.min(n, Math.max(s, l)) : Math.min(n, Math.min(s, l));
}
function yO(n, t, e) {
  let a = Math.min(n, t);
  const s = 50;
  return a *= Math.log(1 + s * Math.max(0, n / t - 1)) / s + 1, e && (a = Math.max(a, e), a /= Math.log(1 + s * Math.max(0, e / n - 1)) / s + 1), ra(a, e / 2, t * 2);
}
function lZ(n, t, e, a) {
  return t = t !== void 0 ? t : !0, /**
   * @param {number|undefined} resolution Resolution.
   * @param {number} direction Direction.
   * @param {import("./size.js").Size} size Viewport size.
   * @param {boolean} [isMoving] True if an interaction or animation is in progress.
   * @return {number|undefined} Resolution.
   */
  function(s, l, f, h) {
    if (s !== void 0) {
      const p = n[0], y = n[n.length - 1], b = e ? pO(
        p,
        e,
        f,
        a
      ) : p;
      if (h)
        return t ? yO(
          s,
          b,
          y
        ) : ra(s, y, b);
      const x = Math.min(b, s), w = Math.floor(Cw(n, x, l));
      return n[w] > b && w < n.length - 1 ? n[w + 1] : n[w];
    }
  };
}
function uZ(n, t, e, a, s, l) {
  return a = a !== void 0 ? a : !0, e = e !== void 0 ? e : 0, /**
   * @param {number|undefined} resolution Resolution.
   * @param {number} direction Direction.
   * @param {import("./size.js").Size} size Viewport size.
   * @param {boolean} [isMoving] True if an interaction or animation is in progress.
   * @return {number|undefined} Resolution.
   */
  function(f, h, p, y) {
    if (f !== void 0) {
      const b = s ? pO(
        t,
        s,
        p,
        l
      ) : t;
      if (y)
        return a ? yO(
          f,
          b,
          e
        ) : ra(f, e, b);
      const x = 1e-9, w = Math.ceil(
        Math.log(t / b) / Math.log(n) - x
      ), A = -h * (0.5 - x) + 0.5, C = Math.min(b, f), L = Math.floor(
        Math.log(t / C) / Math.log(n) + A
      ), N = Math.max(w, L), U = t / Math.pow(n, N);
      return ra(U, e, b);
    }
  };
}
function AL(n, t, e, a, s) {
  return e = e !== void 0 ? e : !0, /**
   * @param {number|undefined} resolution Resolution.
   * @param {number} direction Direction.
   * @param {import("./size.js").Size} size Viewport size.
   * @param {boolean} [isMoving] True if an interaction or animation is in progress.
   * @return {number|undefined} Resolution.
   */
  function(l, f, h, p) {
    if (l !== void 0) {
      const y = a ? pO(
        n,
        a,
        h,
        s
      ) : n;
      return !e || !p ? ra(l, t, y) : yO(
        l,
        y,
        t
      );
    }
  };
}
function _O(n) {
  if (n !== void 0)
    return 0;
}
function ML(n) {
  if (n !== void 0)
    return n;
}
function cZ(n) {
  const t = 2 * Math.PI / n;
  return (
    /**
     * @param {number|undefined} rotation Rotation.
     * @param {boolean} [isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Rotation.
     */
    function(e, a) {
      if (a)
        return e;
      if (e !== void 0)
        return e = Math.floor(e / t + 0.5) * t, e;
    }
  );
}
function fZ(n) {
  const t = y0(5);
  return (
    /**
     * @param {number|undefined} rotation Rotation.
     * @param {boolean} [isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Rotation.
     */
    function(e, a) {
      return a || e === void 0 ? e : Math.abs(e) <= t ? 0 : e;
    }
  );
}
const hZ = 42, vO = 256, WA = 0;
class td extends Uf {
  /**
   * @param {ViewOptions} [options] View options.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, t = Object.assign({}, t), this.hints_ = [0, 0], this.animations_ = [], this.updateAnimationKey_, this.projection_ = hC(t.projection, "EPSG:3857"), this.viewportSize_ = [100, 100], this.targetCenter_ = null, this.targetResolution_, this.targetRotation_, this.nextCenter_ = null, this.nextResolution_, this.nextRotation_, this.cancelAnchor_ = void 0, t.projection && B9(), t.center && (t.center = tm(t.center, this.projection_)), t.extent && (t.extent = id(t.extent, this.projection_)), this.applyOptions_(t);
  }
  /**
   * Set up the view with the given options.
   * @param {ViewOptions} options View options.
   */
  applyOptions_(t) {
    const e = Object.assign({}, t);
    for (const h in Mf)
      delete e[h];
    this.setProperties(e, !0);
    const a = gZ(t);
    this.maxResolution_ = a.maxResolution, this.minResolution_ = a.minResolution, this.zoomFactor_ = a.zoomFactor, this.resolutions_ = t.resolutions, this.padding_ = t.padding, this.minZoom_ = a.minZoom;
    const s = dZ(t), l = a.constraint, f = mZ(t);
    this.constraints_ = {
      center: s,
      resolution: l,
      rotation: f
    }, this.setRotation(t.rotation !== void 0 ? t.rotation : 0), this.setCenterInternal(
      t.center !== void 0 ? t.center : null
    ), t.resolution !== void 0 ? this.setResolution(t.resolution) : t.zoom !== void 0 && this.setZoom(t.zoom);
  }
  /**
   * Padding (in css pixels).
   * If the map viewport is partially covered with other content (overlays) along
   * its edges, this setting allows to shift the center of the viewport away from that
   * content. The order of the values in the array is top, right, bottom, left.
   * The default is no padding, which is equivalent to `[0, 0, 0, 0]`.
   * @type {Array<number>|undefined}
   * @api
   */
  get padding() {
    return this.padding_;
  }
  set padding(t) {
    let e = this.padding_;
    this.padding_ = t;
    const a = this.getCenterInternal();
    if (a) {
      const s = t || [0, 0, 0, 0];
      e = e || [0, 0, 0, 0];
      const l = this.getResolution(), f = l / 2 * (s[3] - e[3] + e[1] - s[1]), h = l / 2 * (s[0] - e[0] + e[2] - s[2]);
      this.setCenterInternal([a[0] + f, a[1] - h]);
    }
  }
  /**
   * Get an updated version of the view options used to construct the view.  The
   * current resolution (or zoom), center, and rotation are applied to any stored
   * options.  The provided options can be used to apply new min/max zoom or
   * resolution limits.
   * @param {ViewOptions} newOptions New options to be applied.
   * @return {ViewOptions} New options updated with the current view state.
   */
  getUpdatedOptions_(t) {
    const e = this.getProperties();
    return e.resolution !== void 0 ? e.resolution = this.getResolution() : e.zoom = this.getZoom(), e.center = this.getCenterInternal(), e.rotation = this.getRotation(), Object.assign({}, e, t);
  }
  /**
   * Animate the view.  The view's center, zoom (or resolution), and rotation
   * can be animated for smooth transitions between view states.  For example,
   * to animate the view to a new zoom level:
   *
   *     view.animate({zoom: view.getZoom() + 1});
   *
   * By default, the animation lasts one second and uses in-and-out easing.  You
   * can customize this behavior by including `duration` (in milliseconds) and
   * `easing` options (see {@link module:ol/easing}).
   *
   * To chain together multiple animations, call the method with multiple
   * animation objects.  For example, to first zoom and then pan:
   *
   *     view.animate({zoom: 10}, {center: [0, 0]});
   *
   * If you provide a function as the last argument to the animate method, it
   * will get called at the end of an animation series.  The callback will be
   * called with `true` if the animation series completed on its own or `false`
   * if it was cancelled.
   *
   * Animations are cancelled by user interactions (e.g. dragging the map) or by
   * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
   * (or another method that calls one of these).
   *
   * @param {...(AnimationOptions|function(boolean): void)} var_args Animation
   *     options.  Multiple animations can be run in series by passing multiple
   *     options objects.  To run multiple animations in parallel, call the method
   *     multiple times.  An optional callback can be provided as a final
   *     argument.  The callback will be called with a boolean indicating whether
   *     the animation completed without being cancelled.
   * @api
   */
  animate(t) {
    this.isDef() && !this.getAnimating() && this.resolveConstraints(0);
    const e = new Array(arguments.length);
    for (let a = 0; a < e.length; ++a) {
      let s = arguments[a];
      s.center && (s = Object.assign({}, s), s.center = tm(
        s.center,
        this.getProjection()
      )), s.anchor && (s = Object.assign({}, s), s.anchor = tm(
        s.anchor,
        this.getProjection()
      )), e[a] = s;
    }
    this.animateInternal.apply(this, e);
  }
  /**
   * @param {...(AnimationOptions|function(boolean): void)} var_args Animation options.
   */
  animateInternal(t) {
    let e = arguments.length, a;
    e > 1 && typeof arguments[e - 1] == "function" && (a = arguments[e - 1], --e);
    let s = 0;
    for (; s < e && !this.isDef(); ++s) {
      const b = arguments[s];
      b.center && this.setCenterInternal(b.center), b.zoom !== void 0 ? this.setZoom(b.zoom) : b.resolution && this.setResolution(b.resolution), b.rotation !== void 0 && this.setRotation(b.rotation);
    }
    if (s === e) {
      a && uT(a, !0);
      return;
    }
    let l = Date.now(), f = this.targetCenter_.slice(), h = this.targetResolution_, p = this.targetRotation_;
    const y = [];
    for (; s < e; ++s) {
      const b = (
        /** @type {AnimationOptions} */
        arguments[s]
      ), x = {
        start: l,
        complete: !1,
        anchor: b.anchor,
        duration: b.duration !== void 0 ? b.duration : 1e3,
        easing: b.easing || sZ,
        callback: a
      };
      if (b.center && (x.sourceCenter = f, x.targetCenter = b.center.slice(), f = x.targetCenter), b.zoom !== void 0 ? (x.sourceResolution = h, x.targetResolution = this.getResolutionForZoom(b.zoom), h = x.targetResolution) : b.resolution && (x.sourceResolution = h, x.targetResolution = b.resolution, h = x.targetResolution), b.rotation !== void 0) {
        x.sourceRotation = p;
        const w = w_(b.rotation - p + Math.PI, 2 * Math.PI) - Math.PI;
        x.targetRotation = p + w, p = x.targetRotation;
      }
      pZ(x) ? x.complete = !0 : l += x.duration, y.push(x);
    }
    this.animations_.push(y), this.setHint(ss.ANIMATING, 1), this.updateAnimations_();
  }
  /**
   * Determine if the view is being animated.
   * @return {boolean} The view is being animated.
   * @api
   */
  getAnimating() {
    return this.hints_[ss.ANIMATING] > 0;
  }
  /**
   * Determine if the user is interacting with the view, such as panning or zooming.
   * @return {boolean} The view is being interacted with.
   * @api
   */
  getInteracting() {
    return this.hints_[ss.INTERACTING] > 0;
  }
  /**
   * Cancel any ongoing animations.
   * @api
   */
  cancelAnimations() {
    this.setHint(ss.ANIMATING, -this.hints_[ss.ANIMATING]);
    let t;
    for (let e = 0, a = this.animations_.length; e < a; ++e) {
      const s = this.animations_[e];
      if (s[0].callback && uT(s[0].callback, !1), !t)
        for (let l = 0, f = s.length; l < f; ++l) {
          const h = s[l];
          if (!h.complete) {
            t = h.anchor;
            break;
          }
        }
    }
    this.animations_.length = 0, this.cancelAnchor_ = t, this.nextCenter_ = null, this.nextResolution_ = NaN, this.nextRotation_ = NaN;
  }
  /**
   * Update all animations.
   */
  updateAnimations_() {
    if (this.updateAnimationKey_ !== void 0 && (cancelAnimationFrame(this.updateAnimationKey_), this.updateAnimationKey_ = void 0), !this.getAnimating())
      return;
    const t = Date.now();
    let e = !1;
    for (let a = this.animations_.length - 1; a >= 0; --a) {
      const s = this.animations_[a];
      let l = !0;
      for (let f = 0, h = s.length; f < h; ++f) {
        const p = s[f];
        if (p.complete)
          continue;
        const y = t - p.start;
        let b = p.duration > 0 ? y / p.duration : 1;
        b >= 1 ? (p.complete = !0, b = 1) : l = !1;
        const x = p.easing(b);
        if (p.sourceCenter) {
          const w = p.sourceCenter[0], A = p.sourceCenter[1], C = p.targetCenter[0], L = p.targetCenter[1];
          this.nextCenter_ = p.targetCenter;
          const N = w + x * (C - w), U = A + x * (L - A);
          this.targetCenter_ = [N, U];
        }
        if (p.sourceResolution && p.targetResolution) {
          const w = x === 1 ? p.targetResolution : p.sourceResolution + x * (p.targetResolution - p.sourceResolution);
          if (p.anchor) {
            const A = this.getViewportSize_(this.getRotation()), C = this.constraints_.resolution(
              w,
              0,
              A,
              !0
            );
            this.targetCenter_ = this.calculateCenterZoom(
              C,
              p.anchor
            );
          }
          this.nextResolution_ = p.targetResolution, this.targetResolution_ = w, this.applyTargetState_(!0);
        }
        if (p.sourceRotation !== void 0 && p.targetRotation !== void 0) {
          const w = x === 1 ? w_(p.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : p.sourceRotation + x * (p.targetRotation - p.sourceRotation);
          if (p.anchor) {
            const A = this.constraints_.rotation(
              w,
              !0
            );
            this.targetCenter_ = this.calculateCenterRotate(
              A,
              p.anchor
            );
          }
          this.nextRotation_ = p.targetRotation, this.targetRotation_ = w;
        }
        if (this.applyTargetState_(!0), e = !0, !p.complete)
          break;
      }
      if (l) {
        this.animations_[a] = null, this.setHint(ss.ANIMATING, -1), this.nextCenter_ = null, this.nextResolution_ = NaN, this.nextRotation_ = NaN;
        const f = s[0].callback;
        f && uT(f, !0);
      }
    }
    this.animations_ = this.animations_.filter(Boolean), e && this.updateAnimationKey_ === void 0 && (this.updateAnimationKey_ = requestAnimationFrame(
      this.updateAnimations_.bind(this)
    ));
  }
  /**
   * @param {number} rotation Target rotation.
   * @param {import("./coordinate.js").Coordinate} anchor Rotation anchor.
   * @return {import("./coordinate.js").Coordinate|undefined} Center for rotation and anchor.
   */
  calculateCenterRotate(t, e) {
    let a;
    const s = this.getCenterInternal();
    return s !== void 0 && (a = [s[0] - e[0], s[1] - e[1]], lC(a, t - this.getRotation()), p9(a, e)), a;
  }
  /**
   * @param {number} resolution Target resolution.
   * @param {import("./coordinate.js").Coordinate} anchor Zoom anchor.
   * @return {import("./coordinate.js").Coordinate|undefined} Center for resolution and anchor.
   */
  calculateCenterZoom(t, e) {
    let a;
    const s = this.getCenterInternal(), l = this.getResolution();
    if (s !== void 0 && l !== void 0) {
      const f = e[0] - t * (e[0] - s[0]) / l, h = e[1] - t * (e[1] - s[1]) / l;
      a = [f, h];
    }
    return a;
  }
  /**
   * Returns the current viewport size.
   * @private
   * @param {number} [rotation] Take into account the rotation of the viewport when giving the size
   * @return {import("./size.js").Size} Viewport size or `[100, 100]` when no viewport is found.
   */
  getViewportSize_(t) {
    const e = this.viewportSize_;
    if (t) {
      const a = e[0], s = e[1];
      return [
        Math.abs(a * Math.cos(t)) + Math.abs(s * Math.sin(t)),
        Math.abs(a * Math.sin(t)) + Math.abs(s * Math.cos(t))
      ];
    }
    return e;
  }
  /**
   * Stores the viewport size on the view. The viewport size is not read every time from the DOM
   * to avoid performance hit and layout reflow.
   * This should be done on map size change.
   * Note: the constraints are not resolved during an animation to avoid stopping it
   * @param {import("./size.js").Size} [size] Viewport size; if undefined, [100, 100] is assumed
   */
  setViewportSize(t) {
    this.viewportSize_ = Array.isArray(t) ? t.slice() : [100, 100], this.getAnimating() || this.resolveConstraints(0);
  }
  /**
   * Get the view center.
   * @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
   * @observable
   * @api
   */
  getCenter() {
    const t = this.getCenterInternal();
    return t && EM(t, this.getProjection());
  }
  /**
   * Get the view center without transforming to user projection.
   * @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
   */
  getCenterInternal() {
    return (
      /** @type {import("./coordinate.js").Coordinate|undefined} */
      this.get(Mf.CENTER)
    );
  }
  /**
   * @return {Constraints} Constraints.
   */
  getConstraints() {
    return this.constraints_;
  }
  /**
   * @return {boolean} Resolution constraint is set
   */
  getConstrainResolution() {
    return this.get("constrainResolution");
  }
  /**
   * @param {Array<number>} [hints] Destination array.
   * @return {Array<number>} Hint.
   */
  getHints(t) {
    return t !== void 0 ? (t[0] = this.hints_[0], t[1] = this.hints_[1], t) : this.hints_.slice();
  }
  /**
   * Calculate the extent for the current view state and the passed box size.
   * @param {import("./size.js").Size} [size] The pixel dimensions of the box
   * into which the calculated extent should fit. Defaults to the size of the
   * map the view is associated with.
   * If no map or multiple maps are connected to the view, provide the desired
   * box size (e.g. `map.getSize()`).
   * @return {import("./extent.js").Extent} Extent.
   * @api
   */
  calculateExtent(t) {
    const e = this.calculateExtentInternal(t);
    return h8(e, this.getProjection());
  }
  /**
   * @param {import("./size.js").Size} [size] Box pixel size. If not provided,
   * the map's last known viewport size will be used.
   * @return {import("./extent.js").Extent} Extent.
   */
  calculateExtentInternal(t) {
    t = t || this.getViewportSizeMinusPadding_();
    const e = (
      /** @type {!import("./coordinate.js").Coordinate} */
      this.getCenterInternal()
    );
    Ei(e, "The view center is not defined");
    const a = (
      /** @type {!number} */
      this.getResolution()
    );
    Ei(a !== void 0, "The view resolution is not defined");
    const s = (
      /** @type {!number} */
      this.getRotation()
    );
    return Ei(s !== void 0, "The view rotation is not defined"), Qb(e, a, s, t);
  }
  /**
   * Get the maximum resolution of the view.
   * @return {number} The maximum resolution of the view.
   * @api
   */
  getMaxResolution() {
    return this.maxResolution_;
  }
  /**
   * Get the minimum resolution of the view.
   * @return {number} The minimum resolution of the view.
   * @api
   */
  getMinResolution() {
    return this.minResolution_;
  }
  /**
   * Get the maximum zoom level for the view.
   * @return {number} The maximum zoom level.
   * @api
   */
  getMaxZoom() {
    return (
      /** @type {number} */
      this.getZoomForResolution(this.minResolution_)
    );
  }
  /**
   * Set a new maximum zoom level for the view.
   * @param {number} zoom The maximum zoom level.
   * @api
   */
  setMaxZoom(t) {
    this.applyOptions_(this.getUpdatedOptions_({ maxZoom: t }));
  }
  /**
   * Get the minimum zoom level for the view.
   * @return {number} The minimum zoom level.
   * @api
   */
  getMinZoom() {
    return (
      /** @type {number} */
      this.getZoomForResolution(this.maxResolution_)
    );
  }
  /**
   * Set a new minimum zoom level for the view.
   * @param {number} zoom The minimum zoom level.
   * @api
   */
  setMinZoom(t) {
    this.applyOptions_(this.getUpdatedOptions_({ minZoom: t }));
  }
  /**
   * Set whether the view should allow intermediary zoom levels.
   * @param {boolean} enabled Whether the resolution is constrained.
   * @api
   */
  setConstrainResolution(t) {
    this.applyOptions_(this.getUpdatedOptions_({ constrainResolution: t }));
  }
  /**
   * Get the view projection.
   * @return {import("./proj/Projection.js").default} The projection of the view.
   * @api
   */
  getProjection() {
    return this.projection_;
  }
  /**
   * Get the view resolution.
   * @return {number|undefined} The resolution of the view.
   * @observable
   * @api
   */
  getResolution() {
    return (
      /** @type {number|undefined} */
      this.get(Mf.RESOLUTION)
    );
  }
  /**
   * Get the resolutions for the view. This returns the array of resolutions
   * passed to the constructor of the View, or undefined if none were given.
   * @return {Array<number>|undefined} The resolutions of the view.
   * @api
   */
  getResolutions() {
    return this.resolutions_;
  }
  /**
   * Get the resolution for a provided extent (in map units) and size (in pixels).
   * @param {import("./extent.js").Extent} extent Extent.
   * @param {import("./size.js").Size} [size] Box pixel size.
   * @return {number} The resolution at which the provided extent will render at
   *     the given size.
   * @api
   */
  getResolutionForExtent(t, e) {
    return this.getResolutionForExtentInternal(
      id(t, this.getProjection()),
      e
    );
  }
  /**
   * Get the resolution for a provided extent (in map units) and size (in pixels).
   * @param {import("./extent.js").Extent} extent Extent.
   * @param {import("./size.js").Size} [size] Box pixel size.
   * @return {number} The resolution at which the provided extent will render at
   *     the given size.
   */
  getResolutionForExtentInternal(t, e) {
    e = e || this.getViewportSizeMinusPadding_();
    const a = Hn(t) / e[0], s = Ir(t) / e[1];
    return Math.max(a, s);
  }
  /**
   * Return a function that returns a value between 0 and 1 for a
   * resolution. Exponential scaling is assumed.
   * @param {number} [power] Power.
   * @return {function(number): number} Resolution for value function.
   */
  getResolutionForValueFunction(t) {
    t = t || 2;
    const e = this.getConstrainedResolution(this.maxResolution_), a = this.minResolution_, s = Math.log(e / a) / Math.log(t);
    return (
      /**
       * @param {number} value Value.
       * @return {number} Resolution.
       */
      function(l) {
        return e / Math.pow(t, l * s);
      }
    );
  }
  /**
   * Get the view rotation.
   * @return {number} The rotation of the view in radians.
   * @observable
   * @api
   */
  getRotation() {
    return (
      /** @type {number} */
      this.get(Mf.ROTATION)
    );
  }
  /**
   * Return a function that returns a resolution for a value between
   * 0 and 1. Exponential scaling is assumed.
   * @param {number} [power] Power.
   * @return {function(number): number} Value for resolution function.
   */
  getValueForResolutionFunction(t) {
    const e = Math.log(t || 2), a = this.getConstrainedResolution(this.maxResolution_), s = this.minResolution_, l = Math.log(a / s) / e;
    return (
      /**
       * @param {number} resolution Resolution.
       * @return {number} Value.
       */
      function(f) {
        return Math.log(a / f) / e / l;
      }
    );
  }
  /**
   * Returns the size of the viewport minus padding.
   * @private
   * @param {number} [rotation] Take into account the rotation of the viewport when giving the size
   * @return {import("./size.js").Size} Viewport size reduced by the padding.
   */
  getViewportSizeMinusPadding_(t) {
    let e = this.getViewportSize_(t);
    const a = this.padding_;
    return a && (e = [
      e[0] - a[1] - a[3],
      e[1] - a[0] - a[2]
    ]), e;
  }
  /**
   * @return {State} View state.
   */
  getState() {
    const t = this.getProjection(), e = this.getResolution(), a = this.getRotation();
    let s = (
      /** @type {import("./coordinate.js").Coordinate} */
      this.getCenterInternal()
    );
    const l = this.padding_;
    if (l) {
      const f = this.getViewportSizeMinusPadding_();
      s = QA(
        s,
        this.getViewportSize_(),
        [f[0] / 2 + l[3], f[1] / 2 + l[0]],
        e,
        a
      );
    }
    return {
      center: s.slice(0),
      projection: t !== void 0 ? t : null,
      resolution: e,
      nextCenter: this.nextCenter_,
      nextResolution: this.nextResolution_,
      nextRotation: this.nextRotation_,
      rotation: a,
      zoom: this.getZoom()
    };
  }
  /**
   * @return {ViewStateLayerStateExtent} Like `FrameState`, but just `viewState` and `extent`.
   */
  getViewStateAndExtent() {
    return {
      viewState: this.getState(),
      extent: this.calculateExtent()
    };
  }
  /**
   * Get the current zoom level. This method may return non-integer zoom levels
   * if the view does not constrain the resolution, or if an interaction or
   * animation is underway.
   * @return {number|undefined} Zoom.
   * @api
   */
  getZoom() {
    let t;
    const e = this.getResolution();
    return e !== void 0 && (t = this.getZoomForResolution(e)), t;
  }
  /**
   * Get the zoom level for a resolution.
   * @param {number} resolution The resolution.
   * @return {number|undefined} The zoom level for the provided resolution.
   * @api
   */
  getZoomForResolution(t) {
    let e = this.minZoom_ || 0, a, s;
    if (this.resolutions_) {
      const l = Cw(this.resolutions_, t, 1);
      e = l, a = this.resolutions_[l], l == this.resolutions_.length - 1 ? s = 2 : s = a / this.resolutions_[l + 1];
    } else
      a = this.maxResolution_, s = this.zoomFactor_;
    return e + Math.log(a / t) / Math.log(s);
  }
  /**
   * Get the resolution for a zoom level.
   * @param {number} zoom Zoom level.
   * @return {number} The view resolution for the provided zoom level.
   * @api
   */
  getResolutionForZoom(t) {
    if (this.resolutions_?.length) {
      if (this.resolutions_.length === 1)
        return this.resolutions_[0];
      const e = ra(
        Math.floor(t),
        0,
        this.resolutions_.length - 2
      ), a = this.resolutions_[e] / this.resolutions_[e + 1];
      return this.resolutions_[e] / Math.pow(a, ra(t - e, 0, 1));
    }
    return this.maxResolution_ / Math.pow(this.zoomFactor_, t - this.minZoom_);
  }
  /**
   * Fit the given geometry or extent based on the given map size and border.
   * The size is pixel dimensions of the box to fit the extent into.
   * In most cases you will want to use the map size, that is `map.getSize()`.
   * Takes care of the map angle.
   * @param {import("./geom/SimpleGeometry.js").default|import("./extent.js").Extent} geometryOrExtent The geometry or
   *     extent to fit the view to.
   * @param {FitOptions} [options] Options.
   * @api
   */
  fit(t, e) {
    let a;
    if (Ei(
      Array.isArray(t) || typeof /** @type {?} */
      t.getSimplifiedGeometry == "function",
      "Invalid extent or geometry provided as `geometry`"
    ), Array.isArray(t)) {
      Ei(
        !F_(t),
        "Cannot fit empty extent provided as `geometry`"
      );
      const s = id(t, this.getProjection());
      a = ZN(s);
    } else if (t.getType() === "Circle") {
      const s = id(
        t.getExtent(),
        this.getProjection()
      );
      a = ZN(s), a.rotate(this.getRotation(), fm(s));
    } else
      a = t;
    this.fitInternal(a, e);
  }
  /**
   * Calculate rotated extent
   * @param {import("./geom/SimpleGeometry.js").default} geometry The geometry.
   * @return {import("./extent").Extent} The rotated extent for the geometry.
   */
  rotatedExtentForGeometry(t) {
    const e = this.getRotation(), a = Math.cos(e), s = Math.sin(-e), l = t.getFlatCoordinates(), f = t.getStride();
    let h = 1 / 0, p = 1 / 0, y = -1 / 0, b = -1 / 0;
    for (let x = 0, w = l.length; x < w; x += f) {
      const A = l[x] * a - l[x + 1] * s, C = l[x] * s + l[x + 1] * a;
      h = Math.min(h, A), p = Math.min(p, C), y = Math.max(y, A), b = Math.max(b, C);
    }
    return [h, p, y, b];
  }
  /**
   * @param {import("./geom/SimpleGeometry.js").default} geometry The geometry.
   * @param {FitOptions} [options] Options.
   */
  fitInternal(t, e) {
    e = e || {};
    let a = e.size;
    a || (a = this.getViewportSizeMinusPadding_());
    const s = e.padding !== void 0 ? e.padding : [0, 0, 0, 0], l = e.nearest !== void 0 ? e.nearest : !1;
    let f;
    e.minResolution !== void 0 ? f = e.minResolution : e.maxZoom !== void 0 ? f = this.getResolutionForZoom(e.maxZoom) : f = 0;
    const h = this.rotatedExtentForGeometry(t);
    let p = this.getResolutionForExtentInternal(h, [
      a[0] - s[1] - s[3],
      a[1] - s[0] - s[2]
    ]);
    p = isNaN(p) ? f : Math.max(p, f), p = this.getConstrainedResolution(p, l ? 0 : 1);
    const y = this.getRotation(), b = Math.sin(y), x = Math.cos(y), w = fm(h);
    w[0] += (s[1] - s[3]) / 2 * p, w[1] += (s[0] - s[2]) / 2 * p;
    const A = w[0] * x - w[1] * b, C = w[1] * x + w[0] * b, L = this.getConstrainedCenter([A, C], p), N = e.callback ? e.callback : uS;
    e.duration !== void 0 ? this.animateInternal(
      {
        resolution: p,
        center: L,
        duration: e.duration,
        easing: e.easing
      },
      N
    ) : (this.targetResolution_ = p, this.targetCenter_ = L, this.applyTargetState_(!1, !0), uT(N, !0));
  }
  /**
   * Center on coordinate and view position.
   * @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("./size.js").Size} size Box pixel size.
   * @param {import("./pixel.js").Pixel} position Position on the view to center on.
   * @api
   */
  centerOn(t, e, a) {
    this.centerOnInternal(
      tm(t, this.getProjection()),
      e,
      a
    );
  }
  /**
   * @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("./size.js").Size} size Box pixel size.
   * @param {import("./pixel.js").Pixel} position Position on the view to center on.
   */
  centerOnInternal(t, e, a) {
    this.setCenterInternal(
      QA(
        t,
        e,
        a,
        this.getResolution(),
        this.getRotation()
      )
    );
  }
  /**
   * Calculates the shift between map and viewport center.
   * @param {import("./coordinate.js").Coordinate} center Center.
   * @param {number} resolution Resolution.
   * @param {number} rotation Rotation.
   * @param {import("./size.js").Size} size Size.
   * @return {Array<number>|undefined} Center shift.
   */
  calculateCenterShift(t, e, a, s) {
    let l;
    const f = this.padding_;
    if (f && t) {
      const h = this.getViewportSizeMinusPadding_(-a), p = QA(
        t,
        s,
        [h[0] / 2 + f[3], h[1] / 2 + f[0]],
        e,
        a
      );
      l = [
        t[0] - p[0],
        t[1] - p[1]
      ];
    }
    return l;
  }
  /**
   * @return {boolean} Is defined.
   */
  isDef() {
    return !!this.getCenterInternal() && this.getResolution() !== void 0;
  }
  /**
   * Adds relative coordinates to the center of the view. Any extent constraint will apply.
   * @param {import("./coordinate.js").Coordinate} deltaCoordinates Relative value to add.
   * @api
   */
  adjustCenter(t) {
    const e = EM(this.targetCenter_, this.getProjection());
    this.setCenter([
      e[0] + t[0],
      e[1] + t[1]
    ]);
  }
  /**
   * Adds relative coordinates to the center of the view. Any extent constraint will apply.
   * @param {import("./coordinate.js").Coordinate} deltaCoordinates Relative value to add.
   */
  adjustCenterInternal(t) {
    const e = this.targetCenter_;
    this.setCenterInternal([
      e[0] + t[0],
      e[1] + t[1]
    ]);
  }
  /**
   * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution
   * constraint will apply.
   * @param {number} ratio The ratio to apply on the view resolution.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   * @api
   */
  adjustResolution(t, e) {
    e = e && tm(e, this.getProjection()), this.adjustResolutionInternal(t, e);
  }
  /**
   * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution
   * constraint will apply.
   * @param {number} ratio The ratio to apply on the view resolution.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   */
  adjustResolutionInternal(t, e) {
    const a = this.getAnimating() || this.getInteracting(), s = this.getViewportSize_(this.getRotation()), l = this.constraints_.resolution(
      this.targetResolution_ * t,
      0,
      s,
      a
    );
    e && (this.targetCenter_ = this.calculateCenterZoom(l, e)), this.targetResolution_ *= t, this.applyTargetState_();
  }
  /**
   * Adds a value to the view zoom level, optionally using an anchor. Any resolution
   * constraint will apply.
   * @param {number} delta Relative value to add to the zoom level.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   * @api
   */
  adjustZoom(t, e) {
    this.adjustResolution(Math.pow(this.zoomFactor_, -t), e);
  }
  /**
   * Adds a value to the view rotation, optionally using an anchor. Any rotation
   * constraint will apply.
   * @param {number} delta Relative value to add to the zoom rotation, in radians.
   * @param {import("./coordinate.js").Coordinate} [anchor] The rotation center.
   * @api
   */
  adjustRotation(t, e) {
    e && (e = tm(e, this.getProjection())), this.adjustRotationInternal(t, e);
  }
  /**
   * @param {number} delta Relative value to add to the zoom rotation, in radians.
   * @param {import("./coordinate.js").Coordinate} [anchor] The rotation center.
   */
  adjustRotationInternal(t, e) {
    const a = this.getAnimating() || this.getInteracting(), s = this.constraints_.rotation(
      this.targetRotation_ + t,
      a
    );
    e && (this.targetCenter_ = this.calculateCenterRotate(s, e)), this.targetRotation_ += t, this.applyTargetState_();
  }
  /**
   * Set the center of the current view. Any extent constraint will apply.
   * @param {import("./coordinate.js").Coordinate|undefined} center The center of the view.
   * @observable
   * @api
   */
  setCenter(t) {
    this.setCenterInternal(
      t && tm(t, this.getProjection())
    );
  }
  /**
   * Set the center using the view projection (not the user projection).
   * @param {import("./coordinate.js").Coordinate|undefined} center The center of the view.
   */
  setCenterInternal(t) {
    this.targetCenter_ = t, this.applyTargetState_();
  }
  /**
   * @param {import("./ViewHint.js").default} hint Hint.
   * @param {number} delta Delta.
   * @return {number} New value.
   */
  setHint(t, e) {
    return this.hints_[t] += e, this.changed(), this.hints_[t];
  }
  /**
   * Set the resolution for this view. Any resolution constraint will apply.
   * @param {number|undefined} resolution The resolution of the view.
   * @observable
   * @api
   */
  setResolution(t) {
    this.targetResolution_ = t, this.applyTargetState_();
  }
  /**
   * Set the rotation for this view. Any rotation constraint will apply.
   * @param {number} rotation The rotation of the view in radians.
   * @observable
   * @api
   */
  setRotation(t) {
    this.targetRotation_ = t, this.applyTargetState_();
  }
  /**
   * Zoom to a specific zoom level. Any resolution constrain will apply.
   * @param {number} zoom Zoom level.
   * @api
   */
  setZoom(t) {
    this.setResolution(this.getResolutionForZoom(t));
  }
  /**
   * Recompute rotation/resolution/center based on target values.
   * Note: we have to compute rotation first, then resolution and center considering that
   * parameters can influence one another in case a view extent constraint is present.
   * @param {boolean} [doNotCancelAnims] Do not cancel animations.
   * @param {boolean} [forceMoving] Apply constraints as if the view is moving.
   * @private
   */
  applyTargetState_(t, e) {
    const a = this.getAnimating() || this.getInteracting() || e, s = this.constraints_.rotation(
      this.targetRotation_,
      a
    ), l = this.getViewportSize_(s), f = this.constraints_.resolution(
      this.targetResolution_,
      0,
      l,
      a
    ), h = this.constraints_.center(
      this.targetCenter_,
      f,
      l,
      a,
      this.calculateCenterShift(
        this.targetCenter_,
        f,
        s,
        l
      )
    );
    this.get(Mf.ROTATION) !== s && this.set(Mf.ROTATION, s), this.get(Mf.RESOLUTION) !== f && (this.set(Mf.RESOLUTION, f), this.set("zoom", this.getZoom(), !0)), (!h || !this.get(Mf.CENTER) || !MT(this.get(Mf.CENTER), h)) && this.set(Mf.CENTER, h), this.getAnimating() && !t && this.cancelAnimations(), this.cancelAnchor_ = void 0;
  }
  /**
   * If any constraints need to be applied, an animation will be triggered.
   * This is typically done on interaction end.
   * Note: calling this with a duration of 0 will apply the constrained values straight away,
   * without animation.
   * @param {number} [duration] The animation duration in ms.
   * @param {number} [resolutionDirection] Which direction to zoom.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   */
  resolveConstraints(t, e, a) {
    t = t !== void 0 ? t : 200;
    const s = e || 0, l = this.constraints_.rotation(this.targetRotation_), f = this.getViewportSize_(l), h = this.constraints_.resolution(
      this.targetResolution_,
      s,
      f
    ), p = this.constraints_.center(
      this.targetCenter_,
      h,
      f,
      !1,
      this.calculateCenterShift(
        this.targetCenter_,
        h,
        l,
        f
      )
    );
    if (t === 0 && !this.cancelAnchor_) {
      this.targetResolution_ = h, this.targetRotation_ = l, this.targetCenter_ = p, this.applyTargetState_();
      return;
    }
    a = a || (t === 0 ? this.cancelAnchor_ : void 0), this.cancelAnchor_ = void 0, (this.getResolution() !== h || this.getRotation() !== l || !this.getCenterInternal() || !MT(this.getCenterInternal(), p)) && (this.getAnimating() && this.cancelAnimations(), this.animateInternal({
      rotation: l,
      center: p,
      resolution: h,
      duration: t,
      easing: xE,
      anchor: a
    }));
  }
  /**
   * Notify the View that an interaction has started.
   * The view state will be resolved to a stable one if needed
   * (depending on its constraints).
   * @api
   */
  beginInteraction() {
    this.resolveConstraints(0), this.setHint(ss.INTERACTING, 1);
  }
  /**
   * Notify the View that an interaction has ended. The view state will be resolved
   * to a stable one if needed (depending on its constraints).
   * @param {number} [duration] Animation duration in ms.
   * @param {number} [resolutionDirection] Which direction to zoom.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   * @api
   */
  endInteraction(t, e, a) {
    a = a && tm(a, this.getProjection()), this.endInteractionInternal(t, e, a);
  }
  /**
   * Notify the View that an interaction has ended. The view state will be resolved
   * to a stable one if needed (depending on its constraints).
   * @param {number} [duration] Animation duration in ms.
   * @param {number} [resolutionDirection] Which direction to zoom.
   * @param {import("./coordinate.js").Coordinate} [anchor] The origin of the transformation.
   */
  endInteractionInternal(t, e, a) {
    this.getInteracting() && (this.setHint(ss.INTERACTING, -1), this.resolveConstraints(t, e, a));
  }
  /**
   * Get a valid position for the view center according to the current constraints.
   * @param {import("./coordinate.js").Coordinate|undefined} targetCenter Target center position.
   * @param {number} [targetResolution] Target resolution. If not supplied, the current one will be used.
   * This is useful to guess a valid center position at a different zoom level.
   * @return {import("./coordinate.js").Coordinate|undefined} Valid center position.
   */
  getConstrainedCenter(t, e) {
    const a = this.getViewportSize_(this.getRotation());
    return this.constraints_.center(
      t,
      e || this.getResolution(),
      a
    );
  }
  /**
   * Get a valid zoom level according to the current view constraints.
   * @param {number|undefined} targetZoom Target zoom.
   * @param {number} [direction] Indicate which resolution should be used
   * by a renderer if the view resolution does not match any resolution of the tile source.
   * If 0, the nearest resolution will be used. If 1, the nearest lower resolution
   * will be used. If -1, the nearest higher resolution will be used.
   * @return {number|undefined} Valid zoom level.
   */
  getConstrainedZoom(t, e) {
    const a = this.getResolutionForZoom(t);
    return this.getZoomForResolution(
      this.getConstrainedResolution(a, e)
    );
  }
  /**
   * Get a valid resolution according to the current view constraints.
   * @param {number|undefined} targetResolution Target resolution.
   * @param {number} [direction] Indicate which resolution should be used
   * by a renderer if the view resolution does not match any resolution of the tile source.
   * If 0, the nearest resolution will be used. If 1, the nearest lower resolution
   * will be used. If -1, the nearest higher resolution will be used.
   * @return {number|undefined} Valid resolution.
   */
  getConstrainedResolution(t, e) {
    e = e || 0;
    const a = this.getViewportSize_(this.getRotation());
    return this.constraints_.resolution(t, e, a);
  }
}
function uT(n, t) {
  setTimeout(function() {
    n(t);
  }, 0);
}
function dZ(n) {
  if (n.extent !== void 0) {
    const e = n.smoothExtentConstraint !== void 0 ? n.smoothExtentConstraint : !0;
    return RL(n.extent, n.constrainOnlyCenter, e);
  }
  const t = hC(n.projection, "EPSG:3857");
  if (n.multiWorld !== !0 && t.isGlobal()) {
    const e = t.getExtent().slice();
    return e[0] = -1 / 0, e[2] = 1 / 0, RL(e, !1, !1);
  }
  return rZ;
}
function gZ(n) {
  let t, e, a, f = n.minZoom !== void 0 ? n.minZoom : WA, h = n.maxZoom !== void 0 ? n.maxZoom : 28;
  const p = n.zoomFactor !== void 0 ? n.zoomFactor : 2, y = n.multiWorld !== void 0 ? n.multiWorld : !1, b = n.smoothResolutionConstraint !== void 0 ? n.smoothResolutionConstraint : !0, x = n.showFullExtent !== void 0 ? n.showFullExtent : !1, w = hC(n.projection, "EPSG:3857"), A = w.getExtent();
  let C = n.constrainOnlyCenter, L = n.extent;
  if (!y && !L && w.isGlobal() && (C = !1, L = A), n.resolutions !== void 0) {
    const N = n.resolutions;
    e = N[f], a = N[h] !== void 0 ? N[h] : N[N.length - 1], n.constrainResolution ? t = lZ(
      N,
      b,
      !C && L,
      x
    ) : t = AL(
      e,
      a,
      b,
      !C && L,
      x
    );
  } else {
    const U = (A ? Math.max(Hn(A), Ir(A)) : (
      // use an extent that can fit the whole world if need be
      360 * Z1.degrees / w.getMetersPerUnit()
    )) / vO / Math.pow(2, WA), k = U / Math.pow(2, 28 - WA);
    e = n.maxResolution, e !== void 0 ? f = 0 : e = U / Math.pow(p, f), a = n.minResolution, a === void 0 && (n.maxZoom !== void 0 ? n.maxResolution !== void 0 ? a = e / Math.pow(p, h) : a = U / Math.pow(p, h) : a = k), h = f + Math.floor(
      Math.log(e / a) / Math.log(p)
    ), a = e / Math.pow(p, h - f), n.constrainResolution ? t = uZ(
      p,
      e,
      a,
      b,
      !C && L,
      x
    ) : t = AL(
      e,
      a,
      b,
      !C && L,
      x
    );
  }
  return {
    constraint: t,
    maxResolution: e,
    minResolution: a,
    minZoom: f,
    zoomFactor: p
  };
}
function mZ(n) {
  if (n.enableRotation !== void 0 ? n.enableRotation : !0) {
    const e = n.constrainRotation;
    return e === void 0 || e === !0 ? fZ() : e === !1 ? ML : typeof e == "number" ? cZ(e) : ML;
  }
  return _O;
}
function pZ(n) {
  return !(n.sourceCenter && n.targetCenter && !MT(n.sourceCenter, n.targetCenter) || n.sourceResolution !== n.targetResolution || n.sourceRotation !== n.targetRotation);
}
function QA(n, t, e, a, s) {
  const l = Math.cos(-s);
  let f = Math.sin(-s), h = n[0] * l - n[1] * f, p = n[1] * l + n[0] * f;
  h += (t[0] / 2 - e[0]) * a, p += (e[1] - t[1] / 2) * a, f = -f;
  const y = h * l - p * f, b = p * l + h * f;
  return [y, b];
}
class VS extends $C {
  /**
   * @param {Options<SourceType>} options Layer options.
   */
  constructor(t) {
    const e = Object.assign({}, t);
    delete e.source, super(e), this.on, this.once, this.un, this.mapPrecomposeKey_ = null, this.mapRenderKey_ = null, this.sourceChangeKey_ = null, this.renderer_ = null, this.sourceReady_ = !1, this.rendered = !1, t.render && (this.render = t.render), t.map && this.setMap(t.map), this.addChangeListener(
      Ri.SOURCE,
      this.handleSourcePropertyChange_
    );
    const a = t.source ? (
      /** @type {SourceType} */
      t.source
    ) : null;
    this.setSource(a);
  }
  /**
   * @param {Array<import("./Layer.js").default>} [array] Array of layers (to be modified in place).
   * @return {Array<import("./Layer.js").default>} Array of layers.
   * @override
   */
  getLayersArray(t) {
    return t = t || [], t.push(this), t;
  }
  /**
   * @param {Array<import("./Layer.js").State>} [states] Optional list of layer states (to be modified in place).
   * @return {Array<import("./Layer.js").State>} List of layer states.
   * @override
   */
  getLayerStatesArray(t) {
    return t = t || [], t.push(this.getLayerState()), t;
  }
  /**
   * Get the layer source.
   * @return {SourceType|null} The layer source (or `null` if not yet set).
   * @observable
   * @api
   */
  getSource() {
    return (
      /** @type {SourceType} */
      this.get(Ri.SOURCE) || null
    );
  }
  /**
   * @return {SourceType|null} The source being rendered.
   */
  getRenderSource() {
    return this.getSource();
  }
  /**
   * @return {import("../source/Source.js").State} Source state.
   * @override
   */
  getSourceState() {
    const t = this.getSource();
    return t ? t.getState() : "undefined";
  }
  /**
   * @private
   */
  handleSourceChange_() {
    this.changed(), !(this.sourceReady_ || this.getSource().getState() !== "ready") && (this.sourceReady_ = !0, this.dispatchEvent("sourceready"));
  }
  /**
   * @private
   */
  handleSourcePropertyChange_() {
    this.sourceChangeKey_ && (Xi(this.sourceChangeKey_), this.sourceChangeKey_ = null), this.sourceReady_ = !1;
    const t = this.getSource();
    t && (this.sourceChangeKey_ = Fn(
      t,
      ln.CHANGE,
      this.handleSourceChange_,
      this
    ), t.getState() === "ready" && (this.sourceReady_ = !0, setTimeout(() => {
      this.dispatchEvent("sourceready");
    }, 0))), this.changed();
  }
  /**
   * @param {import("../pixel").Pixel} pixel Pixel.
   * @return {Promise<Array<import("../Feature").FeatureLike>>} Promise that resolves with
   * an array of features.
   */
  getFeatures(t) {
    return this.renderer_ ? this.renderer_.getFeatures(t) : Promise.resolve([]);
  }
  /**
   * @param {import("../pixel").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
   */
  getData(t) {
    return !this.renderer_ || !this.rendered ? null : this.renderer_.getData(t);
  }
  /**
   * The layer is visible on the map view, i.e. within its min/max resolution or zoom and
   * extent, not set to `visible: false`, and not inside a layer group that is set
   * to `visible: false`.
   * @param {View|import("../View.js").ViewStateLayerStateExtent} [view] View or {@link import("../Map.js").FrameState}.
   * Only required when the layer is not added to a map.
   * @return {boolean} The layer is visible in the map view.
   * @api
   */
  isVisible(t) {
    let e;
    const a = this.getMapInternal();
    !t && a && (t = a.getView()), t instanceof td ? e = {
      viewState: t.getState(),
      extent: t.calculateExtent()
    } : e = t, !e.layerStatesArray && a && (e.layerStatesArray = a.getLayerGroup().getLayerStatesArray());
    let s;
    if (e.layerStatesArray) {
      if (s = e.layerStatesArray.find(
        (f) => f.layer === this
      ), !s)
        return !1;
    } else
      s = this.getLayerState();
    const l = this.getExtent();
    return EO(s, e.viewState) && (!l || Co(l, e.extent));
  }
  /**
   * Get the attributions of the source of this layer for the given view.
   * @param {View|import("../View.js").ViewStateLayerStateExtent} [view] View or {@link import("../Map.js").FrameState}.
   * Only required when the layer is not added to a map.
   * @return {Array<string>} Attributions for this layer at the given view.
   * @api
   */
  getAttributions(t) {
    if (!this.isVisible(t))
      return [];
    const e = this.getSource()?.getAttributions();
    if (!e)
      return [];
    const a = t instanceof td ? t.getViewStateAndExtent() : t;
    let s = e(a);
    return Array.isArray(s) || (s = [s]), s;
  }
  /**
   * In charge to manage the rendering of the layer. One layer type is
   * bounded with one layer renderer.
   * @param {?import("../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement} target Target which the renderer may (but need not) use
   * for rendering its content.
   * @return {HTMLElement|null} The rendered element.
   */
  render(t, e) {
    const a = this.getRenderer();
    return a.prepareFrame(t) ? (this.rendered = !0, a.renderFrame(t, e)) : null;
  }
  /**
   * Called when a layer is not visible during a map render.
   */
  unrender() {
    this.rendered = !1;
  }
  /** @return {string} Declutter */
  getDeclutter() {
  }
  /**
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @param {import("../layer/Layer.js").State} layerState Layer state.
   */
  renderDeclutter(t, e) {
  }
  /**
   * When the renderer follows a layout -> render approach, do the final rendering here.
   * @param {import('../Map.js').FrameState} frameState Frame state
   */
  renderDeferred(t) {
    const e = this.getRenderer();
    e && e.renderDeferred(t);
  }
  /**
   * For use inside the library only.
   * @param {import("../Map.js").default|null} map Map.
   */
  setMapInternal(t) {
    t || this.unrender(), this.set(Ri.MAP, t);
  }
  /**
   * For use inside the library only.
   * @return {import("../Map.js").default|null} Map.
   */
  getMapInternal() {
    return this.get(Ri.MAP);
  }
  /**
   * Sets the layer to be rendered on top of other layers on a map. The map will
   * not manage this layer in its layers collection. This
   * is useful for temporary layers. To remove an unmanaged layer from the map,
   * use `#setMap(null)`.
   *
   * To add the layer to a map and have it managed by the map, use
   * {@link module:ol/Map~Map#addLayer} instead.
   * @param {import("../Map.js").default|null} map Map.
   * @api
   */
  setMap(t) {
    this.mapPrecomposeKey_ && (Xi(this.mapPrecomposeKey_), this.mapPrecomposeKey_ = null), t || this.changed(), this.mapRenderKey_ && (Xi(this.mapRenderKey_), this.mapRenderKey_ = null), t && (this.mapPrecomposeKey_ = Fn(
      t,
      wc.PRECOMPOSE,
      this.handlePrecompose_,
      this
    ), this.mapRenderKey_ = Fn(this, ln.CHANGE, t.render, t), this.changed());
  }
  /**
   * @param {import("../events/Event.js").default} renderEvent Render event
   * @private
   */
  handlePrecompose_(t) {
    const e = (
      /** @type {import("../render/Event.js").default} */
      t.frameState.layerStatesArray
    ), a = this.getLayerState(!1);
    Ei(
      !e.some(
        (s) => s.layer === a.layer
      ),
      "A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."
    ), e.push(a);
  }
  /**
   * Set the layer source.
   * @param {SourceType|null} source The layer source.
   * @observable
   * @api
   */
  setSource(t) {
    this.set(Ri.SOURCE, t);
  }
  /**
   * Get the renderer for this layer.
   * @return {RendererType|null} The layer renderer.
   */
  getRenderer() {
    return this.renderer_ || (this.renderer_ = this.createRenderer()), this.renderer_;
  }
  /**
   * @return {boolean} The layer has a renderer.
   */
  hasRenderer() {
    return !!this.renderer_;
  }
  /**
   * Create a renderer for this layer.
   * @return {RendererType} A layer renderer.
   * @protected
   */
  createRenderer() {
    return null;
  }
  /**
   * This will clear the renderer so that a new one can be created next time it is needed
   */
  clearRenderer() {
    this.renderer_ && (this.renderer_.dispose(), delete this.renderer_);
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.clearRenderer(), this.setSource(null), super.disposeInternal();
  }
}
function EO(n, t) {
  if (!n.visible)
    return !1;
  const e = t.resolution;
  if (e < n.minResolution || e >= n.maxResolution)
    return !1;
  const a = t.zoom;
  return a > n.minZoom && a <= n.maxZoom;
}
const CL = {
  RENDER_ORDER: "renderOrder"
};
class v5 extends VS {
  /**
   * @param {Options<FeatureType, VectorSourceType>} [options] Options.
   */
  constructor(t) {
    t = t || {};
    const e = Object.assign({}, t);
    delete e.style, delete e.renderBuffer, delete e.updateWhileAnimating, delete e.updateWhileInteracting, super(e), this.declutter_ = t.declutter ? String(t.declutter) : void 0, this.renderBuffer_ = t.renderBuffer !== void 0 ? t.renderBuffer : 100, this.style_ = null, this.styleFunction_ = void 0, this.setStyle(t.style), this.updateWhileAnimating_ = t.updateWhileAnimating !== void 0 ? t.updateWhileAnimating : !1, this.updateWhileInteracting_ = t.updateWhileInteracting !== void 0 ? t.updateWhileInteracting : !1;
  }
  /**
   * @return {string} Declutter group.
   * @override
   */
  getDeclutter() {
    return this.declutter_;
  }
  /**
   * Get the topmost feature that intersects the given pixel on the viewport. Returns a promise
   * that resolves with an array of features. The array will either contain the topmost feature
   * when a hit was detected, or it will be empty.
   *
   * The hit detection algorithm used for this method is optimized for performance, but is less
   * accurate than the one used in [map.getFeaturesAtPixel()]{@link import("../Map.js").default#getFeaturesAtPixel}.
   * Text is not considered, and icons are only represented by their bounding box instead of the exact
   * image.
   *
   * @param {import("../pixel.js").Pixel} pixel Pixel.
   * @return {Promise<Array<import("../Feature").FeatureLike>>} Promise that resolves with an array of features.
   * @api
   * @override
   */
  getFeatures(t) {
    return super.getFeatures(t);
  }
  /**
   * @return {number|undefined} Render buffer.
   */
  getRenderBuffer() {
    return this.renderBuffer_;
  }
  /**
   * @return {import("../render.js").OrderFunction|null|undefined} Render order.
   */
  getRenderOrder() {
    return (
      /** @type {import("../render.js").OrderFunction|null|undefined} */
      this.get(CL.RENDER_ORDER)
    );
  }
  /**
   * Get the style for features.  This returns whatever was passed to the `style`
   * option at construction or to the `setStyle` method.
   * @return {import("../style/Style.js").StyleLike|import("../style/flat.js").FlatStyleLike|null|undefined} Layer style.
   * @api
   */
  getStyle() {
    return this.style_;
  }
  /**
   * Get the style function.
   * @return {import("../style/Style.js").StyleFunction|undefined} Layer style function.
   * @api
   */
  getStyleFunction() {
    return this.styleFunction_;
  }
  /**
   * @return {boolean} Whether the rendered layer should be updated while
   *     animating.
   */
  getUpdateWhileAnimating() {
    return this.updateWhileAnimating_;
  }
  /**
   * @return {boolean} Whether the rendered layer should be updated while
   *     interacting.
   */
  getUpdateWhileInteracting() {
    return this.updateWhileInteracting_;
  }
  /**
   * Render declutter items for this layer
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @param {import("../layer/Layer.js").State} layerState Layer state.
   * @override
   */
  renderDeclutter(t, e) {
    const a = this.getDeclutter();
    a in t.declutter || (t.declutter[a] = new s5(9)), this.getRenderer().renderDeclutter(t, e);
  }
  /**
   * @param {import("../render.js").OrderFunction|null|undefined} renderOrder
   *     Render order.
   */
  setRenderOrder(t) {
    this.set(CL.RENDER_ORDER, t);
  }
  /**
   * Set the style for features.  This can be a single style object, an array
   * of styles, or a function that takes a feature and resolution and returns
   * an array of styles. If set to `null`, the layer has no style (a `null` style),
   * so only features that have their own styles will be rendered in the layer. Call
   * `setStyle()` without arguments to reset to the default style. See
   * [the ol/style/Style module]{@link module:ol/style/Style~Style} for information on the default style.
   *
   * If your layer has a static style, you can use [flat style]{@link module:ol/style/flat~FlatStyle} object
   * literals instead of using the `Style` and symbolizer constructors (`Fill`, `Stroke`, etc.):
   * ```js
   * vectorLayer.setStyle({
   *   "fill-color": "yellow",
   *   "stroke-color": "black",
   *   "stroke-width": 4
   * })
   * ```
   *
   * @param {import("../style/Style.js").StyleLike|import("../style/flat.js").FlatStyleLike|null} [style] Layer style.
   * @api
   */
  setStyle(t) {
    this.style_ = t === void 0 ? o5 : t;
    const e = yZ(t);
    this.styleFunction_ = t === null ? void 0 : JX(e), this.changed();
  }
  /**
   * @param {boolean|string|number} declutter Declutter images and text.
   * @api
   */
  setDeclutter(t) {
    this.declutter_ = t ? String(t) : void 0, this.changed();
  }
}
function yZ(n) {
  if (n === void 0)
    return o5;
  if (!n)
    return null;
  if (typeof n == "function" || n instanceof E0)
    return n;
  if (!Array.isArray(n))
    return SL([n]);
  if (n.length === 0)
    return [];
  const t = n.length, e = n[0];
  if (e instanceof E0) {
    const s = new Array(t);
    for (let l = 0; l < t; ++l) {
      const f = n[l];
      if (!(f instanceof E0))
        throw new Error("Expected a list of style instances");
      s[l] = f;
    }
    return s;
  }
  if ("style" in e) {
    const s = new Array(t);
    for (let l = 0; l < t; ++l) {
      const f = n[l];
      if (!("style" in f))
        throw new Error("Expected a list of rules with a style property");
      s[l] = f;
    }
    return FK(s);
  }
  return SL(
    /** @type {Array<import("../style/flat.js").FlatStyle>} */
    n
  );
}
class _Z extends v5 {
  /**
   * @param {Options<VectorSourceType, FeatureType>} [options] Options.
   */
  constructor(t) {
    super(t);
  }
  /**
   * @override
   */
  createRenderer() {
    return new EK(this);
  }
}
const ze = {
  IDLE: 0,
  LOADING: 1,
  LOADED: 2,
  /**
   * Indicates that tile loading failed
   * @type {number}
   */
  ERROR: 3,
  EMPTY: 4
};
class bO extends PS {
  /**
   * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("./TileState.js").default} state State.
   * @param {Options} [options] Tile options.
   */
  constructor(t, e, a) {
    super(), a = a || {}, this.tileCoord = t, this.state = e, this.key = "", this.transition_ = a.transition === void 0 ? 250 : a.transition, this.transitionStarts_ = {}, this.interpolate = !!a.interpolate;
  }
  /**
   * @protected
   */
  changed() {
    this.dispatchEvent(ln.CHANGE);
  }
  /**
   * Called by the tile cache when the tile is removed from the cache due to expiry
   */
  release() {
    this.setState(ze.EMPTY);
  }
  /**
   * @return {string} Key.
   */
  getKey() {
    return this.key + "/" + this.tileCoord;
  }
  /**
   * Get the tile coordinate for this tile.
   * @return {import("./tilecoord.js").TileCoord} The tile coordinate.
   * @api
   */
  getTileCoord() {
    return this.tileCoord;
  }
  /**
   * @return {import("./TileState.js").default} State.
   */
  getState() {
    return this.state;
  }
  /**
   * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,
   * it is important to set the state correctly to {@link module:ol/TileState~ERROR}
   * when the tile cannot be loaded. Otherwise the tile cannot be removed from
   * the tile queue and will block other requests.
   * @param {import("./TileState.js").default} state State.
   * @api
   */
  setState(t) {
    if (this.state !== ze.EMPTY) {
      if (this.state !== ze.ERROR && this.state > t)
        throw new Error("Tile load sequence violation");
      this.state = t, this.changed();
    }
  }
  /**
   * Load the image or retry if loading previously failed.
   * Loading is taken care of by the tile queue, and calling this method is
   * only needed for preloading or for reloading in case of an error.
   * @abstract
   * @api
   */
  load() {
    Qn();
  }
  /**
   * Get the alpha value for rendering.
   * @param {string} id An id for the renderer.
   * @param {number} time The render frame time.
   * @return {number} A number between 0 and 1.
   */
  getAlpha(t, e) {
    if (!this.transition_)
      return 1;
    let a = this.transitionStarts_[t];
    if (!a)
      a = e, this.transitionStarts_[t] = a;
    else if (a === -1)
      return 1;
    const s = e - a + 1e3 / 60;
    return s >= this.transition_ ? 1 : _5(s / this.transition_);
  }
  /**
   * Determine if a tile is in an alpha transition.  A tile is considered in
   * transition if tile.getAlpha() has not yet been called or has been called
   * and returned 1.
   * @param {string} id An id for the renderer.
   * @return {boolean} The tile is in transition.
   */
  inTransition(t) {
    return this.transition_ ? this.transitionStarts_[t] !== -1 : !1;
  }
  /**
   * Mark a transition as complete.
   * @param {string} id An id for the renderer.
   */
  endTransition(t) {
    this.transition_ && (this.transitionStarts_[t] = -1);
  }
  /**
   * @override
   */
  disposeInternal() {
    this.release(), super.disposeInternal();
  }
}
class E5 extends bO {
  /**
   * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("./TileState.js").default} state State.
   * @param {string} src Image source URI.
   * @param {?string} crossOrigin Cross origin.
   * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
   * @param {import("./Tile.js").Options} [options] Tile options.
   */
  constructor(t, e, a, s, l, f) {
    super(t, e, f), this.crossOrigin_ = s, this.src_ = a, this.key = a, this.image_ = new Image(), s !== null && (this.image_.crossOrigin = s), this.unlisten_ = null, this.tileLoadFunction_ = l;
  }
  /**
   * Get the HTML image element for this tile (may be a Canvas, Image, or Video).
   * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.
   * @api
   */
  getImage() {
    return this.image_;
  }
  /**
   * Sets an HTML image element for this tile (may be a Canvas or preloaded Image).
   * @param {HTMLCanvasElement|HTMLImageElement} element Element.
   */
  setImage(t) {
    this.image_ = t, this.state = ze.LOADED, this.unlistenImage_(), this.changed();
  }
  /**
   * Tracks loading or read errors.
   *
   * @private
   */
  handleImageError_() {
    this.state = ze.ERROR, this.unlistenImage_(), this.image_ = vZ(), this.changed();
  }
  /**
   * Tracks successful image load.
   *
   * @private
   */
  handleImageLoad_() {
    const t = (
      /** @type {HTMLImageElement} */
      this.image_
    );
    t.naturalWidth && t.naturalHeight ? this.state = ze.LOADED : this.state = ze.EMPTY, this.unlistenImage_(), this.changed();
  }
  /**
   * Load the image or retry if loading previously failed.
   * Loading is taken care of by the tile queue, and calling this method is
   * only needed for preloading or for reloading in case of an error.
   *
   * To retry loading tiles on failed requests, use a custom `tileLoadFunction`
   * that checks for error status codes and reloads only when the status code is
   * 408, 429, 500, 502, 503 and 504, and only when not too many retries have been
   * made already:
   *
   * ```js
   * const retryCodes = [408, 429, 500, 502, 503, 504];
   * const retries = {};
   * source.setTileLoadFunction((tile, src) => {
   *   const image = tile.getImage();
   *   fetch(src)
   *     .then((response) => {
   *       if (retryCodes.includes(response.status)) {
   *         retries[src] = (retries[src] || 0) + 1;
   *         if (retries[src] <= 3) {
   *           setTimeout(() => tile.load(), retries[src] * 1000);
   *         }
   *         return Promise.reject();
   *       }
   *       return response.blob();
   *     })
   *     .then((blob) => {
   *       const imageUrl = URL.createObjectURL(blob);
   *       image.src = imageUrl;
   *       setTimeout(() => URL.revokeObjectURL(imageUrl), 5000);
   *     })
   *     .catch(() => tile.setState(3)); // error
   * });
   * ```
   * @api
   * @override
   */
  load() {
    this.state == ze.ERROR && (this.state = ze.IDLE, this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_)), this.state == ze.IDLE && (this.state = ze.LOADING, this.changed(), this.tileLoadFunction_(this, this.src_), this.unlisten_ = yX(
      this.image_,
      this.handleImageLoad_.bind(this),
      this.handleImageError_.bind(this)
    ));
  }
  /**
   * Discards event handlers which listen for load completion or errors.
   *
   * @private
   */
  unlistenImage_() {
    this.unlisten_ && (this.unlisten_(), this.unlisten_ = null);
  }
  /**
   * @override
   */
  disposeInternal() {
    this.unlistenImage_(), this.image_ = null, super.disposeInternal();
  }
}
function vZ() {
  const n = Pr(1, 1);
  return n.fillStyle = "rgba(0,0,0,0)", n.fillRect(0, 0, 1, 1), n.canvas;
}
class EZ {
  /**
   * @param {number} decay Rate of decay (must be negative).
   * @param {number} minVelocity Minimum velocity (pixels/millisecond).
   * @param {number} delay Delay to consider to calculate the kinetic
   *     initial values (milliseconds).
   */
  constructor(t, e, a) {
    this.decay_ = t, this.minVelocity_ = e, this.delay_ = a, this.points_ = [], this.angle_ = 0, this.initialVelocity_ = 0;
  }
  /**
   * FIXME empty description for jsdoc
   */
  begin() {
    this.points_.length = 0, this.angle_ = 0, this.initialVelocity_ = 0;
  }
  /**
   * @param {number} x X.
   * @param {number} y Y.
   */
  update(t, e) {
    this.points_.push(t, e, Date.now());
  }
  /**
   * @return {boolean} Whether we should do kinetic animation.
   */
  end() {
    if (this.points_.length < 6)
      return !1;
    const t = Date.now() - this.delay_, e = this.points_.length - 3;
    if (this.points_[e + 2] < t)
      return !1;
    let a = e - 3;
    for (; a > 0 && this.points_[a + 2] > t; )
      a -= 3;
    const s = this.points_[e + 2] - this.points_[a + 2];
    if (s < 1e3 / 60)
      return !1;
    const l = this.points_[e] - this.points_[a], f = this.points_[e + 1] - this.points_[a + 1];
    return this.angle_ = Math.atan2(f, l), this.initialVelocity_ = Math.sqrt(l * l + f * f) / s, this.initialVelocity_ > this.minVelocity_;
  }
  /**
   * @return {number} Total distance travelled (pixels).
   */
  getDistance() {
    return (this.minVelocity_ - this.initialVelocity_) / this.decay_;
  }
  /**
   * @return {number} Angle of the kinetic panning animation (radians).
   */
  getAngle() {
    return this.angle_;
  }
}
class P1 extends dd {
  /**
   * @param {string} type Event type.
   * @param {import("./Map.js").default} map Map.
   * @param {?import("./Map.js").FrameState} [frameState] Frame state.
   */
  constructor(t, e, a) {
    super(t), this.map = e, this.frameState = a !== void 0 ? a : null;
  }
}
class u0 extends P1 {
  /**
   * @param {string} type Event type.
   * @param {import("./Map.js").default} map Map.
   * @param {EVENT} originalEvent Original event.
   * @param {boolean} [dragging] Is the map currently being dragged?
   * @param {import("./Map.js").FrameState} [frameState] Frame state.
   * @param {Array<PointerEvent>} [activePointers] Active pointers.
   */
  constructor(t, e, a, s, l, f) {
    super(t, e, l), this.originalEvent = a, this.pixel_ = null, this.coordinate_ = null, this.dragging = s !== void 0 ? s : !1, this.activePointers = f;
  }
  /**
   * The map pixel relative to the viewport corresponding to the original event.
   * @type {import("./pixel.js").Pixel}
   * @api
   */
  get pixel() {
    return this.pixel_ || (this.pixel_ = this.map.getEventPixel(this.originalEvent)), this.pixel_;
  }
  set pixel(t) {
    this.pixel_ = t;
  }
  /**
   * The coordinate corresponding to the original browser event.  This will be in the user
   * projection if one is set.  Otherwise it will be in the view projection.
   * @type {import("./coordinate.js").Coordinate}
   * @api
   */
  get coordinate() {
    return this.coordinate_ || (this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel)), this.coordinate_;
  }
  set coordinate(t) {
    this.coordinate_ = t;
  }
  /**
   * Prevents the default browser action.
   * See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.
   * @api
   * @override
   */
  preventDefault() {
    super.preventDefault(), "preventDefault" in this.originalEvent && this.originalEvent.preventDefault();
  }
  /**
   * Prevents further propagation of the current event.
   * See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.
   * @api
   * @override
   */
  stopPropagation() {
    super.stopPropagation(), "stopPropagation" in this.originalEvent && this.originalEvent.stopPropagation();
  }
}
const Ua = {
  /**
   * A true single click with no dragging and no double click. Note that this
   * event is delayed by 250 ms to ensure that it is not a double click.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick
   * @api
   */
  SINGLECLICK: "singleclick",
  /**
   * A click with no dragging. A double click will fire two of this.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#click
   * @api
   */
  CLICK: ln.CLICK,
  /**
   * A true double click, with no dragging.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick
   * @api
   */
  DBLCLICK: ln.DBLCLICK,
  /**
   * Triggered when a pointer is dragged.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag
   * @api
   */
  POINTERDRAG: "pointerdrag",
  /**
   * Triggered when a pointer is moved. Note that on touch devices this is
   * triggered when the map is panned, so is not the same as mousemove.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove
   * @api
   */
  POINTERMOVE: "pointermove",
  POINTERDOWN: "pointerdown",
  POINTERUP: "pointerup",
  POINTEROVER: "pointerover",
  POINTEROUT: "pointerout",
  POINTERENTER: "pointerenter",
  POINTERLEAVE: "pointerleave",
  POINTERCANCEL: "pointercancel"
}, WM = {
  POINTERMOVE: "pointermove",
  POINTERDOWN: "pointerdown"
};
class bZ extends PS {
  /**
   * @param {import("./Map.js").default} map The map with the viewport to listen to events on.
   * @param {number} [moveTolerance] The minimal distance the pointer must travel to trigger a move.
   */
  constructor(t, e) {
    super(t), this.map_ = t, this.clickTimeoutId_, this.emulateClicks_ = !1, this.dragging_ = !1, this.dragListenerKeys_ = [], this.moveTolerance_ = e === void 0 ? 1 : e, this.down_ = null;
    const a = this.map_.getViewport();
    this.activePointers_ = [], this.trackedTouches_ = {}, this.element_ = a, this.pointerdownListenerKey_ = Fn(
      a,
      WM.POINTERDOWN,
      this.handlePointerDown_,
      this
    ), this.originalPointerMoveEvent_, this.relayedListenerKey_ = Fn(
      a,
      WM.POINTERMOVE,
      this.relayMoveEvent_,
      this
    ), this.boundHandleTouchMove_ = this.handleTouchMove_.bind(this), this.element_.addEventListener(
      ln.TOUCHMOVE,
      this.boundHandleTouchMove_,
      V2 ? { passive: !1 } : !1
    );
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  emulateClick_(t) {
    let e = new u0(
      Ua.CLICK,
      this.map_,
      t
    );
    this.dispatchEvent(e), this.clickTimeoutId_ !== void 0 ? (clearTimeout(this.clickTimeoutId_), this.clickTimeoutId_ = void 0, e = new u0(
      Ua.DBLCLICK,
      this.map_,
      t
    ), this.dispatchEvent(e)) : this.clickTimeoutId_ = setTimeout(() => {
      this.clickTimeoutId_ = void 0;
      const a = new u0(
        Ua.SINGLECLICK,
        this.map_,
        t
      );
      this.dispatchEvent(a);
    }, 250);
  }
  /**
   * Keeps track on how many pointers are currently active.
   *
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  updateActivePointers_(t) {
    const e = t, a = e.pointerId;
    if (e.type == Ua.POINTERUP || e.type == Ua.POINTERCANCEL) {
      delete this.trackedTouches_[a];
      for (const s in this.trackedTouches_)
        if (this.trackedTouches_[s].target !== e.target) {
          delete this.trackedTouches_[s];
          break;
        }
    } else (e.type == Ua.POINTERDOWN || e.type == Ua.POINTERMOVE) && (this.trackedTouches_[a] = e);
    this.activePointers_ = Object.values(this.trackedTouches_);
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  handlePointerUp_(t) {
    this.updateActivePointers_(t);
    const e = new u0(
      Ua.POINTERUP,
      this.map_,
      t,
      void 0,
      void 0,
      this.activePointers_
    );
    this.dispatchEvent(e), this.emulateClicks_ && !e.defaultPrevented && !this.dragging_ && this.isMouseActionButton_(t) && this.emulateClick_(this.down_), this.activePointers_.length === 0 && (this.dragListenerKeys_.forEach(Xi), this.dragListenerKeys_.length = 0, this.dragging_ = !1, this.down_ = null);
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @return {boolean} If the left mouse button was pressed.
   * @private
   */
  isMouseActionButton_(t) {
    return t.button === 0;
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  handlePointerDown_(t) {
    this.emulateClicks_ = this.activePointers_.length === 0, this.updateActivePointers_(t);
    const e = new u0(
      Ua.POINTERDOWN,
      this.map_,
      t,
      void 0,
      void 0,
      this.activePointers_
    );
    if (this.dispatchEvent(e), this.down_ = new PointerEvent(t.type, t), Object.defineProperty(this.down_, "target", {
      writable: !1,
      value: t.target
    }), this.dragListenerKeys_.length === 0) {
      const a = this.map_.getOwnerDocument();
      this.dragListenerKeys_.push(
        Fn(
          a,
          Ua.POINTERMOVE,
          this.handlePointerMove_,
          this
        ),
        Fn(a, Ua.POINTERUP, this.handlePointerUp_, this),
        /* Note that the listener for `pointercancel is set up on
         * `pointerEventHandler_` and not `documentPointerEventHandler_` like
         * the `pointerup` and `pointermove` listeners.
         *
         * The reason for this is the following: `TouchSource.vacuumTouches_()`
         * issues `pointercancel` events, when there was no `touchend` for a
         * `touchstart`. Now, let's say a first `touchstart` is registered on
         * `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.
         * But `documentPointerEventHandler_` doesn't know about the first
         * `touchstart`. If there is no `touchend` for the `touchstart`, we can
         * only receive a `touchcancel` from `pointerEventHandler_`, because it is
         * only registered there.
         */
        Fn(
          this.element_,
          Ua.POINTERCANCEL,
          this.handlePointerUp_,
          this
        )
      ), this.element_.getRootNode && this.element_.getRootNode() !== a && this.dragListenerKeys_.push(
        Fn(
          this.element_.getRootNode(),
          Ua.POINTERUP,
          this.handlePointerUp_,
          this
        )
      );
    }
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  handlePointerMove_(t) {
    if (this.isMoving_(t)) {
      this.updateActivePointers_(t), this.dragging_ = !0;
      const e = new u0(
        Ua.POINTERDRAG,
        this.map_,
        t,
        this.dragging_,
        void 0,
        this.activePointers_
      );
      this.dispatchEvent(e);
    }
  }
  /**
   * Wrap and relay a pointermove event.
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @private
   */
  relayMoveEvent_(t) {
    this.originalPointerMoveEvent_ = t;
    const e = !!(this.down_ && this.isMoving_(t));
    this.dispatchEvent(
      new u0(
        Ua.POINTERMOVE,
        this.map_,
        t,
        e
      )
    );
  }
  /**
   * Flexible handling of a `touch-action: none` css equivalent: because calling
   * `preventDefault()` on a `pointermove` event does not stop native page scrolling
   * and zooming, we also listen for `touchmove` and call `preventDefault()` on it
   * when an interaction (currently `DragPan` handles the event.
   * @param {TouchEvent} event Event.
   * @private
   */
  handleTouchMove_(t) {
    const e = this.originalPointerMoveEvent_;
    (!e || e.defaultPrevented) && (typeof t.cancelable != "boolean" || t.cancelable === !0) && t.preventDefault();
  }
  /**
   * @param {PointerEvent} pointerEvent Pointer
   * event.
   * @return {boolean} Is moving.
   * @private
   */
  isMoving_(t) {
    return this.dragging_ || Math.abs(t.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(t.clientY - this.down_.clientY) > this.moveTolerance_;
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.relayedListenerKey_ && (Xi(this.relayedListenerKey_), this.relayedListenerKey_ = null), this.element_.removeEventListener(
      ln.TOUCHMOVE,
      this.boundHandleTouchMove_
    ), this.pointerdownListenerKey_ && (Xi(this.pointerdownListenerKey_), this.pointerdownListenerKey_ = null), this.dragListenerKeys_.forEach(Xi), this.dragListenerKeys_.length = 0, this.element_ = null, super.disposeInternal();
  }
}
const em = {
  /**
   * Triggered after a map frame is rendered.
   * @event module:ol/MapEvent~MapEvent#postrender
   * @api
   */
  POSTRENDER: "postrender",
  /**
   * Triggered when the map starts moving.
   * @event module:ol/MapEvent~MapEvent#movestart
   * @api
   */
  MOVESTART: "movestart",
  /**
   * Triggered after the map is moved.
   * @event module:ol/MapEvent~MapEvent#moveend
   * @api
   */
  MOVEEND: "moveend",
  /**
   * Triggered when loading of additional map data (tiles, images, features) starts.
   * @event module:ol/MapEvent~MapEvent#loadstart
   * @api
   */
  LOADSTART: "loadstart",
  /**
   * Triggered when loading of additional map data has completed.
   * @event module:ol/MapEvent~MapEvent#loadend
   * @api
   */
  LOADEND: "loadend"
}, Js = {
  LAYERGROUP: "layergroup",
  SIZE: "size",
  TARGET: "target",
  VIEW: "view"
}, nw = 1 / 0;
class SZ {
  /**
   * @param {function(T): number} priorityFunction Priority function.
   * @param {function(T): string} keyFunction Key function.
   */
  constructor(t, e) {
    this.priorityFunction_ = t, this.keyFunction_ = e, this.elements_ = [], this.priorities_ = [], this.queuedElements_ = {};
  }
  /**
   * FIXME empty description for jsdoc
   */
  clear() {
    this.elements_.length = 0, this.priorities_.length = 0, SS(this.queuedElements_);
  }
  /**
   * Remove and return the highest-priority element. O(log N).
   * @return {T} Element.
   */
  dequeue() {
    const t = this.elements_, e = this.priorities_, a = t[0];
    t.length == 1 ? (t.length = 0, e.length = 0) : (t[0] = /** @type {T} */
    t.pop(), e[0] = /** @type {number} */
    e.pop(), this.siftUp_(0));
    const s = this.keyFunction_(a);
    return delete this.queuedElements_[s], a;
  }
  /**
   * Enqueue an element. O(log N).
   * @param {T} element Element.
   * @return {boolean} The element was added to the queue.
   */
  enqueue(t) {
    Ei(
      !(this.keyFunction_(t) in this.queuedElements_),
      "Tried to enqueue an `element` that was already added to the queue"
    );
    const e = this.priorityFunction_(t);
    return e != nw ? (this.elements_.push(t), this.priorities_.push(e), this.queuedElements_[this.keyFunction_(t)] = !0, this.siftDown_(0, this.elements_.length - 1), !0) : !1;
  }
  /**
   * @return {number} Count.
   */
  getCount() {
    return this.elements_.length;
  }
  /**
   * Gets the index of the left child of the node at the given index.
   * @param {number} index The index of the node to get the left child for.
   * @return {number} The index of the left child.
   * @private
   */
  getLeftChildIndex_(t) {
    return t * 2 + 1;
  }
  /**
   * Gets the index of the right child of the node at the given index.
   * @param {number} index The index of the node to get the right child for.
   * @return {number} The index of the right child.
   * @private
   */
  getRightChildIndex_(t) {
    return t * 2 + 2;
  }
  /**
   * Gets the index of the parent of the node at the given index.
   * @param {number} index The index of the node to get the parent for.
   * @return {number} The index of the parent.
   * @private
   */
  getParentIndex_(t) {
    return t - 1 >> 1;
  }
  /**
   * Make this a heap. O(N).
   * @private
   */
  heapify_() {
    let t;
    for (t = (this.elements_.length >> 1) - 1; t >= 0; t--)
      this.siftUp_(t);
  }
  /**
   * @return {boolean} Is empty.
   */
  isEmpty() {
    return this.elements_.length === 0;
  }
  /**
   * @param {string} key Key.
   * @return {boolean} Is key queued.
   */
  isKeyQueued(t) {
    return t in this.queuedElements_;
  }
  /**
   * @param {T} element Element.
   * @return {boolean} Is queued.
   */
  isQueued(t) {
    return this.isKeyQueued(this.keyFunction_(t));
  }
  /**
   * @param {number} index The index of the node to move down.
   * @private
   */
  siftUp_(t) {
    const e = this.elements_, a = this.priorities_, s = e.length, l = e[t], f = a[t], h = t;
    for (; t < s >> 1; ) {
      const p = this.getLeftChildIndex_(t), y = this.getRightChildIndex_(t), b = y < s && a[y] < a[p] ? y : p;
      e[t] = e[b], a[t] = a[b], t = b;
    }
    e[t] = l, a[t] = f, this.siftDown_(h, t);
  }
  /**
   * @param {number} startIndex The index of the root.
   * @param {number} index The index of the node to move up.
   * @private
   */
  siftDown_(t, e) {
    const a = this.elements_, s = this.priorities_, l = a[e], f = s[e];
    for (; e > t; ) {
      const h = this.getParentIndex_(e);
      if (s[h] > f)
        a[e] = a[h], s[e] = s[h], e = h;
      else
        break;
    }
    a[e] = l, s[e] = f;
  }
  /**
   * FIXME empty description for jsdoc
   */
  reprioritize() {
    const t = this.priorityFunction_, e = this.elements_, a = this.priorities_;
    let s = 0;
    const l = e.length;
    let f, h, p;
    for (h = 0; h < l; ++h)
      f = e[h], p = t(f), p == nw ? delete this.queuedElements_[this.keyFunction_(f)] : (a[s] = p, e[s++] = f);
    e.length = s, a.length = s, this.heapify_();
  }
}
class xZ extends SZ {
  /**
   * @param {PriorityFunction} tilePriorityFunction Tile priority function.
   * @param {function(): ?} tileChangeCallback Function called on each tile change event.
   */
  constructor(t, e) {
    super(
      (a) => t.apply(null, a),
      (a) => a[0].getKey()
    ), this.boundHandleTileChange_ = this.handleTileChange.bind(this), this.tileChangeCallback_ = e, this.tilesLoading_ = 0, this.tilesLoadingKeys_ = {};
  }
  /**
   * @param {TileQueueElement} element Element.
   * @return {boolean} The element was added to the queue.
   * @override
   */
  enqueue(t) {
    const e = super.enqueue(t);
    return e && t[0].addEventListener(ln.CHANGE, this.boundHandleTileChange_), e;
  }
  /**
   * @return {number} Number of tiles loading.
   */
  getTilesLoading() {
    return this.tilesLoading_;
  }
  /**
   * @param {import("./events/Event.js").default} event Event.
   * @protected
   */
  handleTileChange(t) {
    const e = (
      /** @type {import("./Tile.js").default} */
      t.target
    ), a = e.getState();
    if (a === ze.LOADED || a === ze.ERROR || a === ze.EMPTY) {
      a !== ze.ERROR && e.removeEventListener(ln.CHANGE, this.boundHandleTileChange_);
      const s = e.getKey();
      s in this.tilesLoadingKeys_ && (delete this.tilesLoadingKeys_[s], --this.tilesLoading_), this.tileChangeCallback_();
    }
  }
  /**
   * @param {number} maxTotalLoading Maximum number tiles to load simultaneously.
   * @param {number} maxNewLoads Maximum number of new tiles to load.
   */
  loadMoreTiles(t, e) {
    let a = 0;
    for (; this.tilesLoading_ < t && a < e && this.getCount() > 0; ) {
      const s = this.dequeue()[0], l = s.getKey();
      s.getState() === ze.IDLE && !(l in this.tilesLoadingKeys_) && (this.tilesLoadingKeys_[l] = !0, ++this.tilesLoading_, ++a, s.load());
    }
  }
}
function TZ(n, t, e, a, s) {
  if (!n || !(e in n.wantedTiles) || !n.wantedTiles[e][t.getKey()])
    return nw;
  const l = n.viewState.center, f = a[0] - l[0], h = a[1] - l[1];
  return 65536 * Math.log(s) + Math.sqrt(f * f + h * h) / s;
}
class Uw extends Uf {
  /**
   * @param {Options} options Control options.
   */
  constructor(t) {
    super();
    const e = t.element;
    e && !t.target && !e.style.pointerEvents && (e.style.pointerEvents = "auto"), this.element = e || null, this.target_ = null, this.map_ = null, this.listenerKeys = [], t.render && (this.render = t.render), t.target && this.setTarget(t.target);
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.element?.remove(), super.disposeInternal();
  }
  /**
   * Get the map associated with this control.
   * @return {import("../Map.js").default|null} Map.
   * @api
   */
  getMap() {
    return this.map_;
  }
  /**
   * Remove the control from its current map and attach it to the new map.
   * Pass `null` to just remove the control from the current map.
   * Subclasses may set up event handlers to get notified about changes to
   * the map here.
   * @param {import("../Map.js").default|null} map Map.
   * @api
   */
  setMap(t) {
    this.map_ && this.element?.remove();
    for (let e = 0, a = this.listenerKeys.length; e < a; ++e)
      Xi(this.listenerKeys[e]);
    if (this.listenerKeys.length = 0, this.map_ = t, t) {
      const e = this.target_ ?? t.getOverlayContainerStopEvent();
      this.element && e.appendChild(this.element), this.render !== uS && this.listenerKeys.push(
        Fn(t, em.POSTRENDER, this.render, this)
      ), t.render();
    }
  }
  /**
   * Renders the control.
   * @param {import("../MapEvent.js").default} mapEvent Map event.
   * @api
   */
  render(t) {
  }
  /**
   * This function is used to set a target element for the control. It has no
   * effect if it is called after the control has been added to the map (i.e.
   * after `setMap` is called on the control). If no `target` is set in the
   * options passed to the control constructor and if `setTarget` is not called
   * then the control is added to the map's overlay container.
   * @param {HTMLElement|string} target Target.
   * @api
   */
  setTarget(t) {
    this.target_ = typeof t == "string" ? document.getElementById(t) : t;
  }
}
class b5 extends Uw {
  /**
   * @param {Options} [options] Attribution options.
   */
  constructor(t) {
    t = t || {}, super({
      element: document.createElement("div"),
      render: t.render,
      target: t.target
    }), this.ulElement_ = document.createElement("ul"), this.collapsed_ = t.collapsed !== void 0 ? t.collapsed : !0, this.userCollapsed_ = this.collapsed_, this.overrideCollapsible_ = t.collapsible !== void 0, this.collapsible_ = t.collapsible !== void 0 ? t.collapsible : !0, this.collapsible_ || (this.collapsed_ = !1), this.attributions_ = t.attributions;
    const e = t.className !== void 0 ? t.className : "ol-attribution", a = t.tipLabel !== void 0 ? t.tipLabel : "Attributions", s = t.expandClassName !== void 0 ? t.expandClassName : e + "-expand", l = t.collapseLabel !== void 0 ? t.collapseLabel : "›", f = t.collapseClassName !== void 0 ? t.collapseClassName : e + "-collapse";
    typeof l == "string" ? (this.collapseLabel_ = document.createElement("span"), this.collapseLabel_.textContent = l, this.collapseLabel_.className = f) : this.collapseLabel_ = l;
    const h = t.label !== void 0 ? t.label : "i";
    typeof h == "string" ? (this.label_ = document.createElement("span"), this.label_.textContent = h, this.label_.className = s) : this.label_ = h;
    const p = this.collapsible_ && !this.collapsed_ ? this.collapseLabel_ : this.label_;
    this.toggleButton_ = document.createElement("button"), this.toggleButton_.setAttribute("type", "button"), this.toggleButton_.setAttribute("aria-expanded", String(!this.collapsed_)), this.toggleButton_.title = a, this.toggleButton_.appendChild(p), this.toggleButton_.addEventListener(
      ln.CLICK,
      this.handleClick_.bind(this),
      !1
    );
    const y = e + " " + jS + " " + uO + (this.collapsed_ && this.collapsible_ ? " " + tL : "") + (this.collapsible_ ? "" : " ol-uncollapsible"), b = this.element;
    b.className = y, b.appendChild(this.toggleButton_), b.appendChild(this.ulElement_), this.renderedAttributions_ = [], this.renderedVisible_ = !0;
  }
  /**
   * Collect a list of visible attributions and set the collapsible state.
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @return {Array<string>} Attributions.
   * @private
   */
  collectSourceAttributions_(t) {
    const e = this.getMap().getAllLayers(), a = new Set(
      e.flatMap((s) => s.getAttributions(t))
    );
    if (this.attributions_ !== void 0 && (Array.isArray(this.attributions_) ? this.attributions_.forEach((s) => a.add(s)) : a.add(this.attributions_)), !this.overrideCollapsible_) {
      const s = !e.some(
        (l) => l.getSource()?.getAttributionsCollapsible() === !1
      );
      this.setCollapsible(s);
    }
    return Array.from(a);
  }
  /**
   * @private
   * @param {?import("../Map.js").FrameState} frameState Frame state.
   */
  async updateElement_(t) {
    if (!t) {
      this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1);
      return;
    }
    const e = await Promise.all(
      this.collectSourceAttributions_(t).map(
        (s) => p2(() => s)
      )
    ), a = e.length > 0;
    if (this.renderedVisible_ != a && (this.element.style.display = a ? "" : "none", this.renderedVisible_ = a), !I0(e, this.renderedAttributions_)) {
      Y2(this.ulElement_);
      for (let s = 0, l = e.length; s < l; ++s) {
        const f = document.createElement("li");
        f.innerHTML = e[s], this.ulElement_.appendChild(f);
      }
      this.renderedAttributions_ = e;
    }
  }
  /**
   * @param {MouseEvent} event The event to handle
   * @private
   */
  handleClick_(t) {
    t.preventDefault(), this.handleToggle_(), this.userCollapsed_ = this.collapsed_;
  }
  /**
   * @private
   */
  handleToggle_() {
    this.element.classList.toggle(tL), this.collapsed_ ? QN(this.collapseLabel_, this.label_) : QN(this.label_, this.collapseLabel_), this.collapsed_ = !this.collapsed_, this.toggleButton_.setAttribute("aria-expanded", String(!this.collapsed_));
  }
  /**
   * Return `true` if the attribution is collapsible, `false` otherwise.
   * @return {boolean} True if the widget is collapsible.
   * @api
   */
  getCollapsible() {
    return this.collapsible_;
  }
  /**
   * Set whether the attribution should be collapsible.
   * @param {boolean} collapsible True if the widget is collapsible.
   * @api
   */
  setCollapsible(t) {
    this.collapsible_ !== t && (this.collapsible_ = t, this.element.classList.toggle("ol-uncollapsible"), this.userCollapsed_ && this.handleToggle_());
  }
  /**
   * Collapse or expand the attribution according to the passed parameter. Will
   * not do anything if the attribution isn't collapsible or if the current
   * collapsed state is already the one requested.
   * @param {boolean} collapsed True if the widget is collapsed.
   * @api
   */
  setCollapsed(t) {
    this.userCollapsed_ = t, !(!this.collapsible_ || this.collapsed_ === t) && this.handleToggle_();
  }
  /**
   * Return `true` when the attribution is currently collapsed or `false`
   * otherwise.
   * @return {boolean} True if the widget is collapsed.
   * @api
   */
  getCollapsed() {
    return this.collapsed_;
  }
  /**
   * Update the attribution element.
   * @param {import("../MapEvent.js").default} mapEvent Map event.
   * @override
   */
  render(t) {
    this.updateElement_(t.frameState);
  }
}
class S5 extends Uw {
  /**
   * @param {Options} [options] Rotate options.
   */
  constructor(t) {
    t = t || {}, super({
      element: document.createElement("div"),
      render: t.render,
      target: t.target
    });
    const e = t.className !== void 0 ? t.className : "ol-rotate", a = t.label !== void 0 ? t.label : "⇧", s = t.compassClassName !== void 0 ? t.compassClassName : "ol-compass";
    this.label_ = null, typeof a == "string" ? (this.label_ = document.createElement("span"), this.label_.className = s, this.label_.textContent = a) : (this.label_ = a, this.label_.classList.add(s));
    const l = t.tipLabel ? t.tipLabel : "Reset rotation", f = document.createElement("button");
    f.className = e + "-reset", f.setAttribute("type", "button"), f.title = l, f.appendChild(this.label_), f.addEventListener(
      ln.CLICK,
      this.handleClick_.bind(this),
      !1
    );
    const h = e + " " + jS + " " + uO, p = this.element;
    p.className = h, p.appendChild(f), this.callResetNorth_ = t.resetNorth ? t.resetNorth : void 0, this.duration_ = t.duration !== void 0 ? t.duration : 250, this.autoHide_ = t.autoHide !== void 0 ? t.autoHide : !0, this.rotation_ = void 0, this.autoHide_ && this.element.classList.add(aT);
  }
  /**
   * @param {MouseEvent} event The event to handle
   * @private
   */
  handleClick_(t) {
    t.preventDefault(), this.callResetNorth_ !== void 0 ? this.callResetNorth_() : this.resetNorth_();
  }
  /**
   * @private
   */
  resetNorth_() {
    const e = this.getMap().getView();
    if (!e)
      return;
    const a = e.getRotation();
    a !== void 0 && (this.duration_ > 0 && a % (2 * Math.PI) !== 0 ? e.animate({
      rotation: 0,
      duration: this.duration_,
      easing: xE
    }) : e.setRotation(0));
  }
  /**
   * Update the rotate control element.
   * @param {import("../MapEvent.js").default} mapEvent Map event.
   * @override
   */
  render(t) {
    const e = t.frameState;
    if (!e)
      return;
    const a = e.viewState.rotation;
    if (a != this.rotation_) {
      const s = "rotate(" + a + "rad)";
      if (this.autoHide_) {
        const l = this.element.classList.contains(aT);
        !l && a === 0 ? this.element.classList.add(aT) : l && a !== 0 && this.element.classList.remove(aT);
      }
      this.label_.style.transform = s;
    }
    this.rotation_ = a;
  }
}
class wZ extends Uw {
  /**
   * @param {Options} [options] Zoom options.
   */
  constructor(t) {
    t = t || {}, super({
      element: document.createElement("div"),
      target: t.target
    });
    const e = t.className !== void 0 ? t.className : "ol-zoom", a = t.delta !== void 0 ? t.delta : 1, s = t.zoomInClassName !== void 0 ? t.zoomInClassName : e + "-in", l = t.zoomOutClassName !== void 0 ? t.zoomOutClassName : e + "-out", f = t.zoomInLabel !== void 0 ? t.zoomInLabel : "+", h = t.zoomOutLabel !== void 0 ? t.zoomOutLabel : "–", p = t.zoomInTipLabel !== void 0 ? t.zoomInTipLabel : "Zoom in", y = t.zoomOutTipLabel !== void 0 ? t.zoomOutTipLabel : "Zoom out", b = document.createElement("button");
    b.className = s, b.setAttribute("type", "button"), b.title = p, b.appendChild(
      typeof f == "string" ? document.createTextNode(f) : f
    ), b.addEventListener(
      ln.CLICK,
      this.handleClick_.bind(this, a),
      !1
    );
    const x = document.createElement("button");
    x.className = l, x.setAttribute("type", "button"), x.title = y, x.appendChild(
      typeof h == "string" ? document.createTextNode(h) : h
    ), x.addEventListener(
      ln.CLICK,
      this.handleClick_.bind(this, -a),
      !1
    );
    const w = e + " " + jS + " " + uO, A = this.element;
    A.className = w, A.appendChild(b), A.appendChild(x), this.duration_ = t.duration !== void 0 ? t.duration : 250;
  }
  /**
   * @param {number} delta Zoom delta.
   * @param {MouseEvent} event The event to handle
   * @private
   */
  handleClick_(t, e) {
    e.preventDefault(), this.zoomByDelta_(t);
  }
  /**
   * @param {number} delta Zoom delta.
   * @private
   */
  zoomByDelta_(t) {
    const a = this.getMap().getView();
    if (!a)
      return;
    const s = a.getZoom();
    if (s !== void 0) {
      const l = a.getConstrainedZoom(s + t);
      this.duration_ > 0 ? (a.getAnimating() && a.cancelAnimations(), a.animate({
        zoom: l,
        duration: this.duration_,
        easing: xE
      })) : a.setZoom(l);
    }
  }
}
function x5(n) {
  n = n || {};
  const t = new Nf();
  return (n.zoom !== void 0 ? n.zoom : !0) && t.push(new wZ(n.zoomOptions)), (n.rotate !== void 0 ? n.rotate : !0) && t.push(new S5(n.rotateOptions)), (n.attribution !== void 0 ? n.attribution : !0) && t.push(new b5(n.attributionOptions)), t;
}
const OL = {
  ACTIVE: "active"
};
class YS extends Uf {
  /**
   * @param {InteractionOptions} [options] Options.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, t && t.handleEvent && (this.handleEvent = t.handleEvent), this.map_ = null, this.setActive(!0);
  }
  /**
   * Return whether the interaction is currently active.
   * @return {boolean} `true` if the interaction is active, `false` otherwise.
   * @observable
   * @api
   */
  getActive() {
    return (
      /** @type {boolean} */
      this.get(OL.ACTIVE)
    );
  }
  /**
   * Get the map associated with this interaction.
   * @return {import("../Map.js").default|null} Map.
   * @api
   */
  getMap() {
    return this.map_;
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event}.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @api
   */
  handleEvent(t) {
    return !0;
  }
  /**
   * Activate or deactivate the interaction.
   * @param {boolean} active Active.
   * @observable
   * @api
   */
  setActive(t) {
    this.set(OL.ACTIVE, t);
  }
  /**
   * Remove the interaction from its current map and attach it to the new map.
   * Subclasses may set up event handlers to get notified about changes to
   * the map here.
   * @param {import("../Map.js").default|null} map Map.
   */
  setMap(t) {
    this.map_ = t;
  }
}
function RZ(n, t, e) {
  const a = n.getCenterInternal();
  if (a) {
    const s = [a[0] + t[0], a[1] + t[1]];
    n.animateInternal({
      duration: e !== void 0 ? e : 250,
      easing: oZ,
      center: n.getConstrainedCenter(s)
    });
  }
}
function SO(n, t, e, a) {
  const s = n.getZoom();
  if (s === void 0)
    return;
  const l = n.getConstrainedZoom(s + t), f = n.getResolutionForZoom(l);
  n.getAnimating() && n.cancelAnimations(), n.animate({
    resolution: f,
    anchor: e,
    duration: a !== void 0 ? a : 250,
    easing: xE
  });
}
class AZ extends YS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    super(), t = t || {}, this.delta_ = t.delta ? t.delta : 1, this.duration_ = t.duration !== void 0 ? t.duration : 250;
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} (if it was a
   * doubleclick) and eventually zooms the map.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @override
   */
  handleEvent(t) {
    let e = !1;
    if (t.type == Ua.DBLCLICK) {
      const a = (
        /** @type {MouseEvent} */
        t.originalEvent
      ), s = t.map, l = t.coordinate, f = a.shiftKey ? -this.delta_ : this.delta_, h = s.getView();
      SO(h, f, l, this.duration_), a.preventDefault(), e = !0;
    }
    return !e;
  }
}
function QM(n) {
  const t = arguments;
  return function(e) {
    let a = !0;
    for (let s = 0, l = t.length; s < l && (a = a && t[s](e), !!a); ++s)
      ;
    return a;
  };
}
const MZ = function(n) {
  const t = n.originalEvent;
  return t.altKey && !(t.metaKey || t.ctrlKey) && t.shiftKey;
}, CZ = function(n) {
  const t = n.map.getTargetElement(), e = t.getRootNode(), a = n.map.getOwnerDocument().activeElement;
  return e instanceof ShadowRoot ? e.host.contains(a) : t.contains(a);
}, T5 = function(n) {
  const t = n.map.getTargetElement(), e = t.getRootNode();
  return (e instanceof ShadowRoot ? e.host : t).hasAttribute("tabindex") ? CZ(n) : !0;
}, OZ = lS, w5 = function(n) {
  const t = n.originalEvent;
  return "pointerId" in t && t.button == 0 && !(iX && B2 && t.ctrlKey);
}, R5 = function(n) {
  const t = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    n.originalEvent
  );
  return !t.altKey && !(t.metaKey || t.ctrlKey) && !t.shiftKey;
}, DZ = function(n) {
  const t = n.originalEvent;
  return B2 ? t.metaKey : t.ctrlKey;
}, NZ = function(n) {
  const t = n.originalEvent;
  return !t.altKey && !(t.metaKey || t.ctrlKey) && t.shiftKey;
}, A5 = function(n) {
  const t = n.originalEvent, e = (
    /** @type {Element} */
    t.target.tagName
  );
  return e !== "INPUT" && e !== "SELECT" && e !== "TEXTAREA" && // `isContentEditable` is only available on `HTMLElement`, but it may also be a
  // different type like `SVGElement`.
  // @ts-ignore
  !t.target.isContentEditable;
}, JA = function(n) {
  const t = n.originalEvent;
  return "pointerId" in t && t.pointerType == "mouse";
}, LZ = function(n) {
  const t = n.originalEvent;
  return "pointerId" in t && t.isPrimary && t.button === 0;
};
class FS extends YS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, super(
      /** @type {import("./Interaction.js").InteractionOptions} */
      t
    ), t.handleDownEvent && (this.handleDownEvent = t.handleDownEvent), t.handleDragEvent && (this.handleDragEvent = t.handleDragEvent), t.handleMoveEvent && (this.handleMoveEvent = t.handleMoveEvent), t.handleUpEvent && (this.handleUpEvent = t.handleUpEvent), t.stopDown && (this.stopDown = t.stopDown), this.handlingDownUpSequence = !1, this.targetPointers = [];
  }
  /**
   * Returns the current number of pointers involved in the interaction,
   * e.g. `2` when two fingers are used.
   * @return {number} The number of pointers.
   * @api
   */
  getPointerCount() {
    return this.targetPointers.length;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @protected
   */
  handleDownEvent(t) {
    return !1;
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @protected
   */
  handleDragEvent(t) {
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may call into
   * other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are
   * detected.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @api
   * @override
   */
  handleEvent(t) {
    if (!t.originalEvent)
      return !0;
    let e = !1;
    if (this.updateTrackedPointers_(t), this.handlingDownUpSequence) {
      if (t.type == Ua.POINTERDRAG)
        this.handleDragEvent(t), t.originalEvent.preventDefault();
      else if (t.type == Ua.POINTERUP) {
        const a = this.handleUpEvent(t);
        this.handlingDownUpSequence = a && this.targetPointers.length > 0;
      }
    } else if (t.type == Ua.POINTERDOWN) {
      const a = this.handleDownEvent(t);
      this.handlingDownUpSequence = a, e = this.stopDown(a);
    } else t.type == Ua.POINTERMOVE && this.handleMoveEvent(t);
    return !e;
  }
  /**
   * Handle pointer move events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @protected
   */
  handleMoveEvent(t) {
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @protected
   */
  handleUpEvent(t) {
    return !1;
  }
  /**
   * This function is used to determine if "down" events should be propagated
   * to other interactions or should be stopped.
   * @param {boolean} handled Was the event handled by the interaction?
   * @return {boolean} Should the `down` event be stopped?
   */
  stopDown(t) {
    return t;
  }
  /**
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @private
   */
  updateTrackedPointers_(t) {
    t.activePointers && (this.targetPointers = t.activePointers);
  }
}
function xO(n) {
  const t = n.length;
  let e = 0, a = 0;
  for (let s = 0; s < t; s++)
    e += n[s].clientX, a += n[s].clientY;
  return { clientX: e / t, clientY: a / t };
}
class IZ extends FS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    super({
      stopDown: Ow
    }), t = t || {}, this.kinetic_ = t.kinetic, this.lastCentroid = null, this.lastPointersCount_, this.panning_ = !1;
    const e = t.condition ? t.condition : QM(R5, LZ);
    this.condition_ = t.onFocusOnly ? QM(T5, e) : e, this.noKinetic_ = !1;
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @override
   */
  handleDragEvent(t) {
    const e = t.map;
    this.panning_ || (this.panning_ = !0, e.getView().beginInteraction());
    const a = this.targetPointers, s = e.getEventPixel(xO(a));
    if (a.length == this.lastPointersCount_) {
      if (this.kinetic_ && this.kinetic_.update(s[0], s[1]), this.lastCentroid) {
        const l = [
          this.lastCentroid[0] - s[0],
          s[1] - this.lastCentroid[1]
        ], h = t.map.getView();
        y9(l, h.getResolution()), lC(l, h.getRotation()), h.adjustCenterInternal(l);
      }
    } else this.kinetic_ && this.kinetic_.begin();
    this.lastCentroid = s, this.lastPointersCount_ = a.length, t.originalEvent.preventDefault();
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleUpEvent(t) {
    const e = t.map, a = e.getView();
    if (this.targetPointers.length === 0) {
      if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
        const s = this.kinetic_.getDistance(), l = this.kinetic_.getAngle(), f = a.getCenterInternal(), h = e.getPixelFromCoordinateInternal(f), p = e.getCoordinateFromPixelInternal([
          h[0] - s * Math.cos(l),
          h[1] - s * Math.sin(l)
        ]);
        a.animateInternal({
          center: a.getConstrainedCenter(p),
          duration: 500,
          easing: xE
        });
      }
      return this.panning_ && (this.panning_ = !1, a.endInteraction()), !1;
    }
    return this.kinetic_ && this.kinetic_.begin(), this.lastCentroid = null, !0;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleDownEvent(t) {
    if (this.targetPointers.length > 0 && this.condition_(t)) {
      const a = t.map.getView();
      return this.lastCentroid = null, a.getAnimating() && a.cancelAnimations(), this.kinetic_ && this.kinetic_.begin(), this.noKinetic_ = this.targetPointers.length > 1, !0;
    }
    return !1;
  }
}
class PZ extends FS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, super({
      stopDown: Ow
    }), this.condition_ = t.condition ? t.condition : MZ, this.lastAngle_ = void 0, this.duration_ = t.duration !== void 0 ? t.duration : 250;
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @override
   */
  handleDragEvent(t) {
    if (!JA(t))
      return;
    const e = t.map, a = e.getView();
    if (a.getConstraints().rotation === _O)
      return;
    const s = e.getSize(), l = t.pixel, f = Math.atan2(s[1] / 2 - l[1], l[0] - s[0] / 2);
    if (this.lastAngle_ !== void 0) {
      const h = f - this.lastAngle_;
      a.adjustRotationInternal(-h);
    }
    this.lastAngle_ = f;
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleUpEvent(t) {
    return JA(t) ? (t.map.getView().endInteraction(this.duration_), !1) : !0;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleDownEvent(t) {
    return JA(t) && w5(t) && this.condition_(t) ? (t.map.getView().beginInteraction(), this.lastAngle_ = void 0, !0) : !1;
  }
}
class zZ extends Mw {
  /**
   * @param {string} className CSS class name.
   */
  constructor(t) {
    super(), this.geometry_ = null, this.element_ = document.createElement("div"), this.element_.style.position = "absolute", this.element_.style.pointerEvents = "auto", this.element_.className = "ol-box " + t, this.map_ = null, this.startPixel_ = null, this.endPixel_ = null;
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.setMap(null);
  }
  /**
   * @private
   */
  render_() {
    const t = this.startPixel_, e = this.endPixel_, a = "px", s = this.element_.style;
    s.left = Math.min(t[0], e[0]) + a, s.top = Math.min(t[1], e[1]) + a, s.width = Math.abs(e[0] - t[0]) + a, s.height = Math.abs(e[1] - t[1]) + a;
  }
  /**
   * @param {import("../Map.js").default|null} map Map.
   */
  setMap(t) {
    if (this.map_) {
      this.map_.getOverlayContainer().removeChild(this.element_);
      const e = this.element_.style;
      e.left = "inherit", e.top = "inherit", e.width = "inherit", e.height = "inherit";
    }
    this.map_ = t, this.map_ && this.map_.getOverlayContainer().appendChild(this.element_);
  }
  /**
   * @param {import("../pixel.js").Pixel} startPixel Start pixel.
   * @param {import("../pixel.js").Pixel} endPixel End pixel.
   */
  setPixels(t, e) {
    this.startPixel_ = t, this.endPixel_ = e, this.createOrUpdateGeometry(), this.render_();
  }
  /**
   * Creates or updates the cached geometry.
   */
  createOrUpdateGeometry() {
    if (!this.map_)
      return;
    const t = this.startPixel_, e = this.endPixel_, s = [
      t,
      [t[0], e[1]],
      e,
      [e[0], t[1]]
    ].map(
      this.map_.getCoordinateFromPixelInternal,
      this.map_
    );
    s[4] = s[0].slice(), this.geometry_ ? this.geometry_.setCoordinates([s]) : this.geometry_ = new B_([s]);
  }
  /**
   * @return {import("../geom/Polygon.js").default} Geometry.
   */
  getGeometry() {
    return this.geometry_;
  }
}
const w1 = {
  /**
   * Triggered upon drag box start.
   * @event DragBoxEvent#boxstart
   * @api
   */
  BOXSTART: "boxstart",
  /**
   * Triggered on drag when box is active.
   * @event DragBoxEvent#boxdrag
   * @api
   */
  BOXDRAG: "boxdrag",
  /**
   * Triggered upon drag box end.
   * @event DragBoxEvent#boxend
   * @api
   */
  BOXEND: "boxend",
  /**
   * Triggered upon drag box canceled.
   * @event DragBoxEvent#boxcancel
   * @api
   */
  BOXCANCEL: "boxcancel"
};
class Tb extends dd {
  /**
   * @param {string} type The event type.
   * @param {import("../coordinate.js").Coordinate} coordinate The event coordinate.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Originating event.
   */
  constructor(t, e, a) {
    super(t), this.coordinate = e, this.mapBrowserEvent = a;
  }
}
class GZ extends FS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, t = t ?? {}, this.box_ = new zZ(t.className || "ol-dragbox"), this.minArea_ = t.minArea ?? 64, t.onBoxEnd && (this.onBoxEnd = t.onBoxEnd), this.startPixel_ = null, this.condition_ = t.condition ?? w5, this.boxEndCondition_ = t.boxEndCondition ?? this.defaultBoxEndCondition;
  }
  /**
   * The default condition for determining whether the boxend event
   * should fire.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent The originating MapBrowserEvent
   *     leading to the box end.
   * @param {import("../pixel.js").Pixel} startPixel The starting pixel of the box.
   * @param {import("../pixel.js").Pixel} endPixel The end pixel of the box.
   * @return {boolean} Whether or not the boxend condition should be fired.
   */
  defaultBoxEndCondition(t, e, a) {
    const s = a[0] - e[0], l = a[1] - e[1];
    return s * s + l * l >= this.minArea_;
  }
  /**
   * Returns geometry of last drawn box.
   * @return {import("../geom/Polygon.js").default} Geometry.
   * @api
   */
  getGeometry() {
    return this.box_.getGeometry();
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @override
   */
  handleDragEvent(t) {
    this.startPixel_ && (this.box_.setPixels(this.startPixel_, t.pixel), this.dispatchEvent(
      new Tb(
        w1.BOXDRAG,
        t.coordinate,
        t
      )
    ));
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleUpEvent(t) {
    if (!this.startPixel_)
      return !1;
    const e = this.boxEndCondition_(
      t,
      this.startPixel_,
      t.pixel
    );
    return e && this.onBoxEnd(t), this.dispatchEvent(
      new Tb(
        e ? w1.BOXEND : w1.BOXCANCEL,
        t.coordinate,
        t
      )
    ), this.box_.setMap(null), this.startPixel_ = null, !1;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleDownEvent(t) {
    return this.condition_(t) ? (this.startPixel_ = t.pixel, this.box_.setMap(t.map), this.box_.setPixels(this.startPixel_, this.startPixel_), this.dispatchEvent(
      new Tb(
        w1.BOXSTART,
        t.coordinate,
        t
      )
    ), !0) : !1;
  }
  /**
   * Function to execute just before `onboxend` is fired
   * @param {import("../MapBrowserEvent.js").default} event Event.
   */
  onBoxEnd(t) {
  }
  /**
   * Activate or deactivate the interaction.
   * @param {boolean} active Active.
   * @observable
   * @api
   * @override
   */
  setActive(t) {
    t || (this.box_.setMap(null), this.startPixel_ && (this.dispatchEvent(
      new Tb(w1.BOXCANCEL, this.startPixel_, null)
    ), this.startPixel_ = null)), super.setActive(t);
  }
  /**
   * @param {import("../Map.js").default|null} map Map.
   * @override
   */
  setMap(t) {
    this.getMap() && (this.box_.setMap(null), this.startPixel_ && (this.dispatchEvent(
      new Tb(w1.BOXCANCEL, this.startPixel_, null)
    ), this.startPixel_ = null)), super.setMap(t);
  }
}
class UZ extends GZ {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {};
    const e = t.condition ? t.condition : NZ;
    super({
      condition: e,
      className: t.className || "ol-dragzoom",
      minArea: t.minArea
    }), this.duration_ = t.duration !== void 0 ? t.duration : 200, this.out_ = t.out !== void 0 ? t.out : !1;
  }
  /**
   * Function to execute just before `onboxend` is fired
   * @param {import("../MapBrowserEvent.js").default} event Event.
   * @override
   */
  onBoxEnd(t) {
    const a = (
      /** @type {!import("../View.js").default} */
      this.getMap().getView()
    );
    let s = this.getGeometry();
    if (this.out_) {
      const l = a.rotatedExtentForGeometry(s), f = a.getResolutionForExtentInternal(l), h = a.getResolution() / f;
      s = s.clone(), s.scale(h * h);
    }
    a.fitInternal(s, {
      duration: this.duration_,
      easing: xE
    });
  }
}
const f_ = {
  LEFT: "ArrowLeft",
  UP: "ArrowUp",
  RIGHT: "ArrowRight",
  DOWN: "ArrowDown"
};
class jZ extends YS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    super(), t = t || {}, this.defaultCondition_ = function(e) {
      return R5(e) && A5(e);
    }, this.condition_ = t.condition !== void 0 ? t.condition : this.defaultCondition_, this.duration_ = t.duration !== void 0 ? t.duration : 100, this.pixelDelta_ = t.pixelDelta !== void 0 ? t.pixelDelta : 128;
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a
   * `KeyEvent`, and decides the direction to pan to (if an arrow key was
   * pressed).
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @override
   */
  handleEvent(t) {
    let e = !1;
    if (t.type == ln.KEYDOWN) {
      const a = (
        /** @type {KeyboardEvent} */
        t.originalEvent
      ), s = a.key;
      if (this.condition_(t) && (s == f_.DOWN || s == f_.LEFT || s == f_.RIGHT || s == f_.UP)) {
        const f = t.map.getView(), h = f.getResolution() * this.pixelDelta_;
        let p = 0, y = 0;
        s == f_.DOWN ? y = -h : s == f_.LEFT ? p = -h : s == f_.RIGHT ? p = h : y = h;
        const b = [p, y];
        lC(b, f.getRotation()), RZ(f, b, this.duration_), a.preventDefault(), e = !0;
      }
    }
    return !e;
  }
}
class kZ extends YS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    super(), t = t || {}, this.condition_ = t.condition ? t.condition : function(e) {
      return !DZ(e) && A5(e);
    }, this.delta_ = t.delta ? t.delta : 1, this.duration_ = t.duration !== void 0 ? t.duration : 100;
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a
   * `KeyEvent`, and decides whether to zoom in or out (depending on whether the
   * key pressed was '+' or '-').
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @override
   */
  handleEvent(t) {
    let e = !1;
    if (t.type == ln.KEYDOWN || t.type == ln.KEYPRESS) {
      const a = (
        /** @type {KeyboardEvent} */
        t.originalEvent
      ), s = a.key;
      if (this.condition_(t) && (s === "+" || s === "-")) {
        const l = t.map, f = s === "+" ? this.delta_ : -this.delta_, h = l.getView();
        SO(h, f, void 0, this.duration_), a.preventDefault(), e = !0;
      }
    }
    return !e;
  }
}
const HZ = 40, BZ = 300;
class qZ extends YS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {}, super(
      /** @type {import("./Interaction.js").InteractionOptions} */
      t
    ), this.totalDelta_ = 0, this.lastDelta_ = 0, this.maxDelta_ = t.maxDelta !== void 0 ? t.maxDelta : 1, this.duration_ = t.duration !== void 0 ? t.duration : 250, this.timeout_ = t.timeout !== void 0 ? t.timeout : 80, this.useAnchor_ = t.useAnchor !== void 0 ? t.useAnchor : !0, this.constrainResolution_ = t.constrainResolution !== void 0 ? t.constrainResolution : !1;
    const e = t.condition ? t.condition : OZ;
    this.condition_ = t.onFocusOnly ? QM(T5, e) : e, this.lastAnchor_ = null, this.startTime_ = void 0, this.timeoutId_, this.mode_ = void 0, this.trackpadEventGap_ = 400, this.trackpadTimeoutId_, this.deltaPerZoom_ = 300;
  }
  /**
   * @private
   */
  endInteraction_() {
    this.trackpadTimeoutId_ = void 0;
    const t = this.getMap();
    if (!t)
      return;
    t.getView().endInteraction(
      void 0,
      this.lastDelta_ ? this.lastDelta_ > 0 ? 1 : -1 : 0,
      this.lastAnchor_ ? t.getCoordinateFromPixel(this.lastAnchor_) : null
    );
  }
  /**
   * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} (if it was a mousewheel-event) and eventually
   * zooms the map.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
   * @return {boolean} `false` to stop event propagation.
   * @override
   */
  handleEvent(t) {
    if (!this.condition_(t) || t.type !== ln.WHEEL)
      return !0;
    const a = t.map, s = (
      /** @type {WheelEvent} */
      t.originalEvent
    );
    s.preventDefault(), this.useAnchor_ && (this.lastAnchor_ = t.pixel);
    let l = s.deltaY;
    switch (s.deltaMode) {
      case WheelEvent.DOM_DELTA_LINE:
        l *= HZ;
        break;
      case WheelEvent.DOM_DELTA_PAGE:
        l *= BZ;
        break;
    }
    if (l === 0)
      return !1;
    this.lastDelta_ = l;
    const f = Date.now();
    this.startTime_ === void 0 && (this.startTime_ = f), (!this.mode_ || f - this.startTime_ > this.trackpadEventGap_) && (this.mode_ = Math.abs(l) < 4 ? "trackpad" : "wheel");
    const h = a.getView();
    if (this.mode_ === "trackpad" && !(h.getConstrainResolution() || this.constrainResolution_))
      return this.trackpadTimeoutId_ ? clearTimeout(this.trackpadTimeoutId_) : (h.getAnimating() && h.cancelAnimations(), h.beginInteraction()), this.trackpadTimeoutId_ = setTimeout(
        this.endInteraction_.bind(this),
        this.timeout_
      ), h.adjustZoom(
        -l / this.deltaPerZoom_,
        this.lastAnchor_ ? a.getCoordinateFromPixel(this.lastAnchor_) : null
      ), this.startTime_ = f, !1;
    this.totalDelta_ += l;
    const p = Math.max(this.timeout_ - (f - this.startTime_), 0);
    return clearTimeout(this.timeoutId_), this.timeoutId_ = setTimeout(
      this.handleWheelZoom_.bind(this, a),
      p
    ), !1;
  }
  /**
   * @private
   * @param {import("../Map.js").default} map Map.
   */
  handleWheelZoom_(t) {
    const e = t.getView();
    e.getAnimating() && e.cancelAnimations();
    let a = -ra(
      this.totalDelta_,
      -this.maxDelta_ * this.deltaPerZoom_,
      this.maxDelta_ * this.deltaPerZoom_
    ) / this.deltaPerZoom_;
    (e.getConstrainResolution() || this.constrainResolution_) && (a = a ? a > 0 ? 1 : -1 : 0), SO(
      e,
      a,
      this.lastAnchor_ ? t.getCoordinateFromPixel(this.lastAnchor_) : null,
      this.duration_
    ), this.mode_ = void 0, this.totalDelta_ = 0, this.lastAnchor_ = null, this.startTime_ = void 0, this.timeoutId_ = void 0;
  }
  /**
   * Enable or disable using the mouse's location as an anchor when zooming
   * @param {boolean} useAnchor true to zoom to the mouse's location, false
   * to zoom to the center of the map
   * @api
   */
  setMouseAnchor(t) {
    this.useAnchor_ = t, t || (this.lastAnchor_ = null);
  }
}
class VZ extends FS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {};
    const e = (
      /** @type {import("./Pointer.js").Options} */
      t
    );
    e.stopDown || (e.stopDown = Ow), super(e), this.anchor_ = null, this.lastAngle_ = void 0, this.rotating_ = !1, this.rotationDelta_ = 0, this.threshold_ = t.threshold !== void 0 ? t.threshold : 0.3, this.duration_ = t.duration !== void 0 ? t.duration : 250;
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @override
   */
  handleDragEvent(t) {
    let e = 0;
    const a = this.targetPointers[0], s = this.targetPointers[1], l = Math.atan2(
      s.clientY - a.clientY,
      s.clientX - a.clientX
    );
    if (this.lastAngle_ !== void 0) {
      const p = l - this.lastAngle_;
      this.rotationDelta_ += p, !this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_ && (this.rotating_ = !0), e = p;
    }
    this.lastAngle_ = l;
    const f = t.map, h = f.getView();
    h.getConstraints().rotation !== _O && (this.anchor_ = f.getCoordinateFromPixelInternal(
      f.getEventPixel(xO(this.targetPointers))
    ), this.rotating_ && (f.render(), h.adjustRotationInternal(e, this.anchor_)));
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleUpEvent(t) {
    return this.targetPointers.length < 2 ? (t.map.getView().endInteraction(this.duration_), !1) : !0;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleDownEvent(t) {
    if (this.targetPointers.length >= 2) {
      const e = t.map;
      return this.anchor_ = null, this.lastAngle_ = void 0, this.rotating_ = !1, this.rotationDelta_ = 0, this.handlingDownUpSequence || e.getView().beginInteraction(), !0;
    }
    return !1;
  }
}
class YZ extends FS {
  /**
   * @param {Options} [options] Options.
   */
  constructor(t) {
    t = t || {};
    const e = (
      /** @type {import("./Pointer.js").Options} */
      t
    );
    e.stopDown || (e.stopDown = Ow), super(e), this.anchor_ = null, this.duration_ = t.duration !== void 0 ? t.duration : 400, this.lastDistance_ = void 0, this.lastScaleDelta_ = 1;
  }
  /**
   * Handle pointer drag events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @override
   */
  handleDragEvent(t) {
    let e = 1;
    const a = this.targetPointers[0], s = this.targetPointers[1], l = a.clientX - s.clientX, f = a.clientY - s.clientY, h = Math.sqrt(l * l + f * f);
    this.lastDistance_ !== void 0 && (e = this.lastDistance_ / h), this.lastDistance_ = h;
    const p = t.map, y = p.getView();
    e != 1 && (this.lastScaleDelta_ = e), this.anchor_ = p.getCoordinateFromPixelInternal(
      p.getEventPixel(xO(this.targetPointers))
    ), p.render(), y.adjustResolutionInternal(e, this.anchor_);
  }
  /**
   * Handle pointer up events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleUpEvent(t) {
    if (this.targetPointers.length < 2) {
      const a = t.map.getView(), s = this.lastScaleDelta_ > 1 ? 1 : -1;
      return a.endInteraction(this.duration_, s), !1;
    }
    return !0;
  }
  /**
   * Handle pointer down events.
   * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
   * @return {boolean} If the event was consumed.
   * @override
   */
  handleDownEvent(t) {
    if (this.targetPointers.length >= 2) {
      const e = t.map;
      return this.anchor_ = null, this.lastDistance_ = void 0, this.lastScaleDelta_ = 1, this.handlingDownUpSequence || e.getView().beginInteraction(), !0;
    }
    return !1;
  }
}
function M5(n) {
  n = n || {};
  const t = new Nf(), e = new EZ(-5e-3, 0.05, 100);
  return (n.altShiftDragRotate !== void 0 ? n.altShiftDragRotate : !0) && t.push(new PZ()), (n.doubleClickZoom !== void 0 ? n.doubleClickZoom : !0) && t.push(
    new AZ({
      delta: n.zoomDelta,
      duration: n.zoomDuration
    })
  ), (n.dragPan !== void 0 ? n.dragPan : !0) && t.push(
    new IZ({
      onFocusOnly: n.onFocusOnly,
      kinetic: e
    })
  ), (n.pinchRotate !== void 0 ? n.pinchRotate : !0) && t.push(new VZ()), (n.pinchZoom !== void 0 ? n.pinchZoom : !0) && t.push(
    new YZ({
      duration: n.zoomDuration
    })
  ), (n.keyboard !== void 0 ? n.keyboard : !0) && (t.push(new jZ()), t.push(
    new kZ({
      delta: n.zoomDelta,
      duration: n.zoomDuration
    })
  )), (n.mouseWheelZoom !== void 0 ? n.mouseWheelZoom : !0) && t.push(
    new qZ({
      onFocusOnly: n.onFocusOnly,
      duration: n.zoomDuration
    })
  ), (n.shiftDragZoom !== void 0 ? n.shiftDragZoom : !0) && t.push(
    new UZ({
      duration: n.zoomDuration
    })
  ), t;
}
class FZ extends Mw {
  /**
   * @param {import("../Map.js").default} map Map.
   */
  constructor(t) {
    super(), this.map_ = t;
  }
  /**
   * @abstract
   * @param {import("../render/EventType.js").default} type Event type.
   * @param {import("../Map.js").FrameState} frameState Frame state.
   */
  dispatchRenderEvent(t, e) {
    Qn();
  }
  /**
   * @param {import("../Map.js").FrameState} frameState FrameState.
   * @protected
   */
  calculateMatrices2D(t) {
    const e = t.viewState, a = t.coordinateToPixelTransform, s = t.pixelToCoordinateTransform;
    fd(
      a,
      t.size[0] / 2,
      t.size[1] / 2,
      1 / e.resolution,
      -1 / e.resolution,
      -e.rotation,
      -e.center[0],
      -e.center[1]
    ), M2(s, a);
  }
  /**
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("../Map.js").FrameState} frameState FrameState.
   * @param {number} hitTolerance Hit tolerance in pixels.
   * @param {boolean} checkWrapped Check for wrapped geometries.
   * @param {import("./vector.js").FeatureCallback<T>} callback Feature callback.
   * @param {S} thisArg Value to use as `this` when executing `callback`.
   * @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter
   *     function, only layers which are visible and for which this function
   *     returns `true` will be tested for features.  By default, all visible
   *     layers will be tested.
   * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`.
   * @return {T|undefined} Callback result.
   * @template S,T,U
   */
  forEachFeatureAtCoordinate(t, e, a, s, l, f, h, p) {
    let y;
    const b = e.viewState;
    function x(B, z, Q, et) {
      return l.call(f, z, B ? Q : null, et);
    }
    const w = b.projection, A = r8(t.slice(), w), C = [[0, 0]];
    if (w.canWrapX() && s) {
      const B = w.getExtent(), z = Hn(B);
      C.push([-z, 0], [z, 0]);
    }
    const L = e.layerStatesArray, N = L.length, U = (
      /** @type {Array<HitMatch<T>>} */
      []
    ), k = [];
    for (let B = 0; B < C.length; B++)
      for (let z = N - 1; z >= 0; --z) {
        const Q = L[z], et = Q.layer;
        if (et.hasRenderer() && EO(Q, b) && h.call(p, et)) {
          const ot = et.getRenderer(), pt = et.getSource();
          if (ot && pt) {
            const ht = pt.getWrapX() ? A : t, Ct = x.bind(
              null,
              Q.managed
            );
            k[0] = ht[0] + C[B][0], k[1] = ht[1] + C[B][1], y = ot.forEachFeatureAtCoordinate(
              k,
              e,
              a,
              Ct,
              U
            );
          }
          if (y)
            return y;
        }
      }
    if (U.length === 0)
      return;
    const H = 1 / U.length;
    return U.forEach((B, z) => B.distanceSq += z * H), U.sort((B, z) => B.distanceSq - z.distanceSq), U.some((B) => y = B.callback(B.feature, B.layer, B.geometry)), y;
  }
  /**
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {import("../Map.js").FrameState} frameState FrameState.
   * @param {number} hitTolerance Hit tolerance in pixels.
   * @param {boolean} checkWrapped Check for wrapped geometries.
   * @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter
   *     function, only layers which are visible and for which this function
   *     returns `true` will be tested for features.  By default, all visible
   *     layers will be tested.
   * @param {U} thisArg Value to use as `this` when executing `layerFilter`.
   * @return {boolean} Is there a feature at the given coordinate?
   * @template U
   */
  hasFeatureAtCoordinate(t, e, a, s, l, f) {
    return this.forEachFeatureAtCoordinate(
      t,
      e,
      a,
      s,
      lS,
      this,
      l,
      f
    ) !== void 0;
  }
  /**
   * @return {import("../Map.js").default} Map.
   */
  getMap() {
    return this.map_;
  }
  /**
   * Render.
   * @abstract
   * @param {?import("../Map.js").FrameState} frameState Frame state.
   */
  renderFrame(t) {
    Qn();
  }
  /**
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @protected
   */
  scheduleExpireIconCache(t) {
    Rc.canExpireCache() && t.postRenderFunctions.push($Z);
  }
}
function $Z(n, t) {
  Rc.expire();
}
class XZ extends FZ {
  /**
   * @param {import("../Map.js").default} map Map.
   */
  constructor(t) {
    super(t), this.fontChangeListenerKey_ = Fn(
      N1,
      lE.PROPERTYCHANGE,
      t.redrawText,
      t
    ), this.element_ = document.createElement("div");
    const e = this.element_.style;
    e.position = "absolute", e.width = "100%", e.height = "100%", e.zIndex = "0", this.element_.className = jS + " ol-layers";
    const a = t.getViewport();
    a.insertBefore(this.element_, a.firstChild || null), this.children_ = [], this.renderedVisible_ = !0;
  }
  /**
   * @param {import("../render/EventType.js").default} type Event type.
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @override
   */
  dispatchRenderEvent(t, e) {
    const a = this.getMap();
    if (a.hasListener(t)) {
      const s = new c5(t, void 0, e);
      a.dispatchEvent(s);
    }
  }
  /**
   * @override
   */
  disposeInternal() {
    Xi(this.fontChangeListenerKey_), this.element_.remove(), super.disposeInternal();
  }
  /**
   * Render.
   * @param {?import("../Map.js").FrameState} frameState Frame state.
   * @override
   */
  renderFrame(t) {
    if (!t) {
      this.renderedVisible_ && (this.element_.style.display = "none", this.renderedVisible_ = !1);
      return;
    }
    this.calculateMatrices2D(t), this.dispatchRenderEvent(wc.PRECOMPOSE, t);
    const e = t.layerStatesArray.sort(
      (h, p) => h.zIndex - p.zIndex
    );
    e.some(
      (h) => h.layer instanceof v5 && h.layer.getDeclutter()
    ) && (t.declutter = {});
    const s = t.viewState;
    this.children_.length = 0;
    const l = [];
    let f = null;
    for (let h = 0, p = e.length; h < p; ++h) {
      const y = e[h];
      t.layerIndex = h;
      const b = y.layer, x = b.getSourceState();
      if (!EO(y, s) || x != "ready" && x != "undefined") {
        b.unrender();
        continue;
      }
      const w = b.render(t, f);
      w && (w !== f && (this.children_.push(w), f = w), l.push(y));
    }
    this.declutter(t, l), oX(this.element_, this.children_), this.dispatchRenderEvent(wc.POSTCOMPOSE, t), this.renderedVisible_ || (this.element_.style.display = "", this.renderedVisible_ = !0), this.scheduleExpireIconCache(t);
  }
  /**
   * @param {import("../Map.js").FrameState} frameState Frame state.
   * @param {Array<import('../layer/Layer.js').State>} layerStates Layers.
   */
  declutter(t, e) {
    if (t.declutter) {
      for (let a = e.length - 1; a >= 0; --a) {
        const s = e[a], l = s.layer;
        l.getDeclutter() && l.renderDeclutter(t, s);
      }
      e.forEach(
        (a) => a.layer.renderDeferred(t)
      );
    }
  }
}
function C5(n) {
  if (n instanceof VS) {
    n.setMapInternal(null);
    return;
  }
  n instanceof P0 && n.getLayers().forEach(C5);
}
function O5(n, t) {
  if (n instanceof VS) {
    n.setMapInternal(t);
    return;
  }
  if (n instanceof P0) {
    const e = n.getLayers().getArray();
    for (let a = 0, s = e.length; a < s; ++a)
      O5(e[a], t);
  }
}
let DL = class extends Uf {
  /**
   * @param {MapOptions} [options] Map options.
   */
  constructor(t) {
    super(), t = t || {}, this.on, this.once, this.un;
    const e = KZ(t);
    this.renderComplete_ = !1, this.loaded_ = !0, this.boundHandleBrowserEvent_ = this.handleBrowserEvent.bind(this), this.maxTilesLoading_ = t.maxTilesLoading !== void 0 ? t.maxTilesLoading : 16, this.pixelRatio_ = t.pixelRatio !== void 0 ? t.pixelRatio : aX, this.postRenderTimeoutHandle_, this.animationDelayKey_, this.animationDelay_ = this.animationDelay_.bind(this), this.coordinateToPixelTransform_ = Pf(), this.pixelToCoordinateTransform_ = Pf(), this.frameIndex_ = 0, this.frameState_ = null, this.previousExtent_ = null, this.viewPropertyListenerKey_ = null, this.viewChangeListenerKey_ = null, this.layerGroupPropertyListenerKeys_ = null, this.viewport_ = document.createElement("div"), this.viewport_.className = "ol-viewport" + ("ontouchstart" in window ? " ol-touch" : ""), this.viewport_.style.position = "relative", this.viewport_.style.overflow = "hidden", this.viewport_.style.width = "100%", this.viewport_.style.height = "100%", this.overlayContainer_ = document.createElement("div"), this.overlayContainer_.style.position = "absolute", this.overlayContainer_.style.zIndex = "0", this.overlayContainer_.style.width = "100%", this.overlayContainer_.style.height = "100%", this.overlayContainer_.style.pointerEvents = "none", this.overlayContainer_.className = "ol-overlaycontainer", this.viewport_.appendChild(this.overlayContainer_), this.overlayContainerStopEvent_ = document.createElement("div"), this.overlayContainerStopEvent_.style.position = "absolute", this.overlayContainerStopEvent_.style.zIndex = "0", this.overlayContainerStopEvent_.style.width = "100%", this.overlayContainerStopEvent_.style.height = "100%", this.overlayContainerStopEvent_.style.pointerEvents = "none", this.overlayContainerStopEvent_.className = "ol-overlaycontainer-stopevent", this.viewport_.appendChild(this.overlayContainerStopEvent_), this.mapBrowserEventHandler_ = null, this.moveTolerance_ = t.moveTolerance, this.keyboardEventTarget_ = e.keyboardEventTarget, this.targetChangeHandlerKeys_ = null, this.targetElement_ = null, this.resizeObserver_ = new ResizeObserver(() => this.updateSize()), this.controls = e.controls || x5(), this.interactions = e.interactions || M5({
      onFocusOnly: !0
    }), this.overlays_ = e.overlays, this.overlayIdIndex_ = {}, this.renderer_ = null, this.postRenderFunctions_ = [], this.tileQueue_ = new xZ(
      this.getTilePriority.bind(this),
      this.handleTileChange_.bind(this)
    ), this.addChangeListener(
      Js.LAYERGROUP,
      this.handleLayerGroupChanged_
    ), this.addChangeListener(Js.VIEW, this.handleViewChanged_), this.addChangeListener(Js.SIZE, this.handleSizeChanged_), this.addChangeListener(Js.TARGET, this.handleTargetChanged_), this.setProperties(e.values);
    const a = this;
    t.view && !(t.view instanceof td) && t.view.then(function(s) {
      a.setView(new td(s));
    }), this.controls.addEventListener(
      ol.ADD,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./control/Control.js").default>} event CollectionEvent
       */
      (s) => {
        s.element.setMap(this);
      }
    ), this.controls.addEventListener(
      ol.REMOVE,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./control/Control.js").default>} event CollectionEvent.
       */
      (s) => {
        s.element.setMap(null);
      }
    ), this.interactions.addEventListener(
      ol.ADD,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./interaction/Interaction.js").default>} event CollectionEvent.
       */
      (s) => {
        s.element.setMap(this);
      }
    ), this.interactions.addEventListener(
      ol.REMOVE,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./interaction/Interaction.js").default>} event CollectionEvent.
       */
      (s) => {
        s.element.setMap(null);
      }
    ), this.overlays_.addEventListener(
      ol.ADD,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./Overlay.js").default>} event CollectionEvent.
       */
      (s) => {
        this.addOverlayInternal_(s.element);
      }
    ), this.overlays_.addEventListener(
      ol.REMOVE,
      /**
       * @param {import("./Collection.js").CollectionEvent<import("./Overlay.js").default>} event CollectionEvent.
       */
      (s) => {
        const l = s.element.getId();
        l !== void 0 && delete this.overlayIdIndex_[l.toString()], s.element.setMap(null);
      }
    ), this.controls.forEach(
      /**
       * @param {import("./control/Control.js").default} control Control.
       */
      (s) => {
        s.setMap(this);
      }
    ), this.interactions.forEach(
      /**
       * @param {import("./interaction/Interaction.js").default} interaction Interaction.
       */
      (s) => {
        s.setMap(this);
      }
    ), this.overlays_.forEach(this.addOverlayInternal_.bind(this));
  }
  /**
   * Add the given control to the map.
   * @param {import("./control/Control.js").default} control Control.
   * @api
   */
  addControl(t) {
    this.getControls().push(t);
  }
  /**
   * Add the given interaction to the map. If you want to add an interaction
   * at another point of the collection use `getInteractions()` and the methods
   * available on {@link module:ol/Collection~Collection}. This can be used to
   * stop the event propagation from the handleEvent function. The interactions
   * get to handle the events in the reverse order of this collection.
   * @param {import("./interaction/Interaction.js").default} interaction Interaction to add.
   * @api
   */
  addInteraction(t) {
    this.getInteractions().push(t);
  }
  /**
   * Adds the given layer to the top of this map. If you want to add a layer
   * elsewhere in the stack, use `getLayers()` and the methods available on
   * {@link module:ol/Collection~Collection}.
   * @param {import("./layer/Base.js").default} layer Layer.
   * @api
   */
  addLayer(t) {
    this.getLayerGroup().getLayers().push(t);
  }
  /**
   * @param {import("./layer/Group.js").GroupEvent} event The layer add event.
   * @private
   */
  handleLayerAdd_(t) {
    O5(t.layer, this);
  }
  /**
   * Add the given overlay to the map.
   * @param {import("./Overlay.js").default} overlay Overlay.
   * @api
   */
  addOverlay(t) {
    this.getOverlays().push(t);
  }
  /**
   * This deals with map's overlay collection changes.
   * @param {import("./Overlay.js").default} overlay Overlay.
   * @private
   */
  addOverlayInternal_(t) {
    const e = t.getId();
    e !== void 0 && (this.overlayIdIndex_[e.toString()] = t), t.setMap(this);
  }
  /**
   *
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.controls.clear(), this.interactions.clear(), this.overlays_.clear(), this.resizeObserver_.disconnect(), this.setTarget(null), super.disposeInternal();
  }
  /**
   * Detect features that intersect a pixel on the viewport, and execute a
   * callback with each intersecting feature. Layers included in the detection can
   * be configured through the `layerFilter` option in `options`.
   * For polygons without a fill, only the stroke will be used for hit detection.
   * Polygons must have a fill style applied to ensure that pixels inside a polygon are detected.
   * The fill can be transparent.
   * @param {import("./pixel.js").Pixel} pixel Pixel.
   * @param {function(import("./Feature.js").FeatureLike, import("./layer/Layer.js").default<import("./source/Source").default>, import("./geom/SimpleGeometry.js").default): T} callback Feature callback. The callback will be
   *     called with two arguments. The first argument is one
   *     {@link module:ol/Feature~Feature feature} or
   *     {@link module:ol/render/Feature~RenderFeature render feature} at the pixel, the second is
   *     the {@link module:ol/layer/Layer~Layer layer} of the feature and will be null for
   *     unmanaged layers. To stop detection, callback functions can return a
   *     truthy value.
   * @param {AtPixelOptions} [options] Optional options.
   * @return {T|undefined} Callback result, i.e. the return value of last
   * callback execution, or the first truthy callback return value.
   * @template T
   * @api
   */
  forEachFeatureAtPixel(t, e, a) {
    if (!this.frameState_ || !this.renderer_)
      return;
    const s = this.getCoordinateFromPixelInternal(t);
    a = a !== void 0 ? a : {};
    const l = a.hitTolerance !== void 0 ? a.hitTolerance : 0, f = a.layerFilter !== void 0 ? a.layerFilter : lS, h = a.checkWrapped !== !1;
    return this.renderer_.forEachFeatureAtCoordinate(
      s,
      this.frameState_,
      l,
      h,
      e,
      null,
      f,
      null
    );
  }
  /**
   * Get all features that intersect a pixel on the viewport.
   * For polygons without a fill, only the stroke will be used for hit detection.
   * Polygons must have a fill style applied to ensure that pixels inside a polygon are detected.
   * The fill can be transparent.
   * @param {import("./pixel.js").Pixel} pixel Pixel.
   * @param {AtPixelOptions} [options] Optional options.
   * @return {Array<import("./Feature.js").FeatureLike>} The detected features or
   * an empty array if none were found.
   * @api
   */
  getFeaturesAtPixel(t, e) {
    const a = [];
    return this.forEachFeatureAtPixel(
      t,
      function(s) {
        a.push(s);
      },
      e
    ), a;
  }
  /**
   * Get all layers from all layer groups.
   * @return {Array<import("./layer/Layer.js").default>} Layers.
   * @api
   */
  getAllLayers() {
    const t = [];
    function e(a) {
      a.forEach(function(s) {
        s instanceof P0 ? e(s.getLayers()) : t.push(s);
      });
    }
    return e(this.getLayers()), t;
  }
  /**
   * Detect if features intersect a pixel on the viewport. Layers included in the
   * detection can be configured through the `layerFilter` option.
   * For polygons without a fill, only the stroke will be used for hit detection.
   * Polygons must have a fill style applied to ensure that pixels inside a polygon are detected.
   * The fill can be transparent.
   * @param {import("./pixel.js").Pixel} pixel Pixel.
   * @param {AtPixelOptions} [options] Optional options.
   * @return {boolean} Is there a feature at the given pixel?
   * @api
   */
  hasFeatureAtPixel(t, e) {
    if (!this.frameState_ || !this.renderer_)
      return !1;
    const a = this.getCoordinateFromPixelInternal(t);
    e = e !== void 0 ? e : {};
    const s = e.layerFilter !== void 0 ? e.layerFilter : lS, l = e.hitTolerance !== void 0 ? e.hitTolerance : 0, f = e.checkWrapped !== !1;
    return this.renderer_.hasFeatureAtCoordinate(
      a,
      this.frameState_,
      l,
      f,
      s,
      null
    );
  }
  /**
   * Returns the coordinate in user projection for a browser event.
   * @param {MouseEvent} event Event.
   * @return {import("./coordinate.js").Coordinate} Coordinate.
   * @api
   */
  getEventCoordinate(t) {
    return this.getCoordinateFromPixel(this.getEventPixel(t));
  }
  /**
   * Returns the coordinate in view projection for a browser event.
   * @param {MouseEvent} event Event.
   * @return {import("./coordinate.js").Coordinate} Coordinate.
   */
  getEventCoordinateInternal(t) {
    return this.getCoordinateFromPixelInternal(this.getEventPixel(t));
  }
  /**
   * Returns the map pixel position for a browser event relative to the viewport.
   * @param {UIEvent|{clientX: number, clientY: number}} event Event.
   * @return {import("./pixel.js").Pixel} Pixel.
   * @api
   */
  getEventPixel(t) {
    const a = this.viewport_.getBoundingClientRect(), s = this.getSize(), l = a.width / s[0], f = a.height / s[1], h = (
      //FIXME Are we really calling this with a TouchEvent anywhere?
      "changedTouches" in t ? (
        /** @type {TouchEvent} */
        t.changedTouches[0]
      ) : (
        /** @type {MouseEvent} */
        t
      )
    );
    return [
      (h.clientX - a.left) / l,
      (h.clientY - a.top) / f
    ];
  }
  /**
   * Get the target in which this map is rendered.
   * Note that this returns what is entered as an option or in setTarget:
   * if that was an element, it returns an element; if a string, it returns that.
   * @return {HTMLElement|string|undefined} The Element or id of the Element that the
   *     map is rendered in.
   * @observable
   * @api
   */
  getTarget() {
    return (
      /** @type {HTMLElement|string|undefined} */
      this.get(Js.TARGET)
    );
  }
  /**
   * Get the DOM element into which this map is rendered. In contrast to
   * `getTarget` this method always return an `Element`, or `null` if the
   * map has no target.
   * @return {HTMLElement} The element that the map is rendered in.
   * @api
   */
  getTargetElement() {
    return this.targetElement_;
  }
  /**
   * Get the coordinate for a given pixel.  This returns a coordinate in the
   * user projection.
   * @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
   * @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
   * @api
   */
  getCoordinateFromPixel(t) {
    return EM(
      this.getCoordinateFromPixelInternal(t),
      this.getView().getProjection()
    );
  }
  /**
   * Get the coordinate for a given pixel.  This returns a coordinate in the
   * map view projection.
   * @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
   * @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
   */
  getCoordinateFromPixelInternal(t) {
    const e = this.frameState_;
    return e ? Lr(e.pixelToCoordinateTransform, t.slice()) : null;
  }
  /**
   * Get the map controls. Modifying this collection changes the controls
   * associated with the map.
   * @return {Collection<import("./control/Control.js").default>} Controls.
   * @api
   */
  getControls() {
    return this.controls;
  }
  /**
   * Get the map overlays. Modifying this collection changes the overlays
   * associated with the map.
   * @return {Collection<import("./Overlay.js").default>} Overlays.
   * @api
   */
  getOverlays() {
    return this.overlays_;
  }
  /**
   * Get an overlay by its identifier (the value returned by overlay.getId()).
   * Note that the index treats string and numeric identifiers as the same. So
   * `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.
   * @param {string|number} id Overlay identifier.
   * @return {import("./Overlay.js").default|null} Overlay.
   * @api
   */
  getOverlayById(t) {
    const e = this.overlayIdIndex_[t.toString()];
    return e !== void 0 ? e : null;
  }
  /**
   * Get the map interactions. Modifying this collection changes the interactions
   * associated with the map.
   *
   * Interactions are used for e.g. pan, zoom and rotate.
   * @return {Collection<import("./interaction/Interaction.js").default>} Interactions.
   * @api
   */
  getInteractions() {
    return this.interactions;
  }
  /**
   * Get the layergroup associated with this map.
   * @return {LayerGroup} A layer group containing the layers in this map.
   * @observable
   * @api
   */
  getLayerGroup() {
    return (
      /** @type {LayerGroup} */
      this.get(Js.LAYERGROUP)
    );
  }
  /**
   * Clear any existing layers and add layers to the map.
   * @param {Array<import("./layer/Base.js").default>|Collection<import("./layer/Base.js").default>} layers The layers to be added to the map.
   * @api
   */
  setLayers(t) {
    const e = this.getLayerGroup();
    if (t instanceof Nf) {
      e.setLayers(t);
      return;
    }
    const a = e.getLayers();
    a.clear(), a.extend(t);
  }
  /**
   * Get the collection of layers associated with this map.
   * @return {!Collection<import("./layer/Base.js").default>} Layers.
   * @api
   */
  getLayers() {
    return this.getLayerGroup().getLayers();
  }
  /**
   * @return {boolean} Layers have sources that are still loading.
   */
  getLoadingOrNotReady() {
    const t = this.getLayerGroup().getLayerStatesArray();
    for (let e = 0, a = t.length; e < a; ++e) {
      const s = t[e];
      if (!s.visible)
        continue;
      const l = s.layer.getRenderer();
      if (l && !l.ready)
        return !0;
      const f = s.layer.getSource();
      if (f && f.loading)
        return !0;
    }
    return !1;
  }
  /**
   * Get the pixel for a coordinate.  This takes a coordinate in the user
   * projection and returns the corresponding pixel.
   * @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
   * @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
   * @api
   */
  getPixelFromCoordinate(t) {
    const e = tm(
      t,
      this.getView().getProjection()
    );
    return this.getPixelFromCoordinateInternal(e);
  }
  /**
   * Get the pixel for a coordinate.  This takes a coordinate in the map view
   * projection and returns the corresponding pixel.
   * @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
   * @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
   */
  getPixelFromCoordinateInternal(t) {
    const e = this.frameState_;
    return e ? Lr(
      e.coordinateToPixelTransform,
      t.slice(0, 2)
    ) : null;
  }
  /**
   * Get the map renderer.
   * @return {import("./renderer/Map.js").default|null} Renderer
   */
  getRenderer() {
    return this.renderer_;
  }
  /**
   * Get the size of this map.
   * @return {import("./size.js").Size|undefined} The size in pixels of the map in the DOM.
   * @observable
   * @api
   */
  getSize() {
    return (
      /** @type {import("./size.js").Size|undefined} */
      this.get(Js.SIZE)
    );
  }
  /**
   * Get the view associated with this map. A view manages properties such as
   * center and resolution.
   * @return {View} The view that controls this map.
   * @observable
   * @api
   */
  getView() {
    return (
      /** @type {View} */
      this.get(Js.VIEW)
    );
  }
  /**
   * Get the element that serves as the map viewport.
   * @return {HTMLElement} Viewport.
   * @api
   */
  getViewport() {
    return this.viewport_;
  }
  /**
   * Get the element that serves as the container for overlays.  Elements added to
   * this container will let mousedown and touchstart events through to the map,
   * so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}
   * events.
   * @return {!HTMLElement} The map's overlay container.
   */
  getOverlayContainer() {
    return this.overlayContainer_;
  }
  /**
   * Get the element that serves as a container for overlays that don't allow
   * event propagation. Elements added to this container won't let mousedown and
   * touchstart events through to the map, so clicks and gestures on an overlay
   * don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
   * @return {!HTMLElement} The map's overlay container that stops events.
   */
  getOverlayContainerStopEvent() {
    return this.overlayContainerStopEvent_;
  }
  /**
   * @return {!Document} The document where the map is displayed.
   */
  getOwnerDocument() {
    const t = this.getTargetElement();
    return t ? t.ownerDocument : document;
  }
  /**
   * @param {import("./Tile.js").default} tile Tile.
   * @param {string} tileSourceKey Tile source key.
   * @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
   * @param {number} tileResolution Tile resolution.
   * @return {number} Tile priority.
   */
  getTilePriority(t, e, a, s) {
    return TZ(
      this.frameState_,
      t,
      e,
      a,
      s
    );
  }
  /**
   * @param {PointerEvent|KeyboardEvent|WheelEvent} browserEvent Browser event.
   * @param {string} [type] Type.
   */
  handleBrowserEvent(t, e) {
    e = e || t.type;
    const a = new u0(e, this, t);
    this.handleMapBrowserEvent(a);
  }
  /**
   * @param {MapBrowserEvent} mapBrowserEvent The event to handle.
   */
  handleMapBrowserEvent(t) {
    if (!this.frameState_)
      return;
    const e = t.originalEvent, a = e.type;
    if (a === WM.POINTERDOWN || a === ln.WHEEL || a === ln.KEYDOWN) {
      const s = this.getOwnerDocument(), l = this.viewport_.getRootNode ? this.viewport_.getRootNode() : s, f = (
        /** @type {Node} */
        e.target
      ), h = l instanceof ShadowRoot ? l.host === f ? l.host.ownerDocument : l : l === s ? s.documentElement : l;
      if (
        // Abort if the target is a child of the container for elements whose events are not meant
        // to be handled by map interactions.
        this.overlayContainerStopEvent_.contains(f) || // Abort if the event target is a child of the container that is no longer in the page.
        // It's possible for the target to no longer be in the page if it has been removed in an
        // event listener, this might happen in a Control that recreates it's content based on
        // user interaction either manually or via a render in something like https://reactjs.org/
        !h.contains(f)
      )
        return;
    }
    if (t.frameState = this.frameState_, this.dispatchEvent(t) !== !1) {
      const s = this.getInteractions().getArray().slice();
      for (let l = s.length - 1; l >= 0; l--) {
        const f = s[l];
        if (f.getMap() !== this || !f.getActive() || !this.getTargetElement())
          continue;
        if (!f.handleEvent(t) || t.propagationStopped)
          break;
      }
    }
  }
  /**
   * @protected
   */
  handlePostRender() {
    const t = this.frameState_, e = this.tileQueue_;
    if (!e.isEmpty()) {
      let s = this.maxTilesLoading_, l = s;
      if (t) {
        const f = t.viewHints;
        if (f[ss.ANIMATING] || f[ss.INTERACTING]) {
          const h = Date.now() - t.time > 8;
          s = h ? 0 : 8, l = h ? 0 : 2;
        }
      }
      e.getTilesLoading() < s && (e.reprioritize(), e.loadMoreTiles(s, l));
    }
    t && this.renderer_ && !t.animate && (this.renderComplete_ ? (this.hasListener(wc.RENDERCOMPLETE) && this.renderer_.dispatchRenderEvent(
      wc.RENDERCOMPLETE,
      t
    ), this.loaded_ === !1 && (this.loaded_ = !0, this.dispatchEvent(
      new P1(em.LOADEND, this, t)
    ))) : this.loaded_ === !0 && (this.loaded_ = !1, this.dispatchEvent(
      new P1(em.LOADSTART, this, t)
    )));
    const a = this.postRenderFunctions_;
    if (t)
      for (let s = 0, l = a.length; s < l; ++s)
        a[s](this, t);
    a.length = 0;
  }
  /**
   * @private
   */
  handleSizeChanged_() {
    this.getView() && !this.getView().getAnimating() && this.getView().resolveConstraints(0), this.render();
  }
  /**
   * @private
   */
  handleTargetChanged_() {
    if (this.mapBrowserEventHandler_) {
      for (let a = 0, s = this.targetChangeHandlerKeys_.length; a < s; ++a)
        Xi(this.targetChangeHandlerKeys_[a]);
      this.targetChangeHandlerKeys_ = null, this.viewport_.removeEventListener(
        ln.CONTEXTMENU,
        this.boundHandleBrowserEvent_
      ), this.viewport_.removeEventListener(
        ln.WHEEL,
        this.boundHandleBrowserEvent_
      ), this.mapBrowserEventHandler_.dispose(), this.mapBrowserEventHandler_ = null, this.viewport_.remove();
    }
    if (this.targetElement_) {
      this.resizeObserver_.unobserve(this.targetElement_);
      const a = this.targetElement_.getRootNode();
      a instanceof ShadowRoot && this.resizeObserver_.unobserve(a.host), this.setSize(void 0);
    }
    const t = this.getTarget(), e = typeof t == "string" ? document.getElementById(t) : t;
    if (this.targetElement_ = e, !e)
      this.renderer_ && (clearTimeout(this.postRenderTimeoutHandle_), this.postRenderTimeoutHandle_ = void 0, this.postRenderFunctions_.length = 0, this.renderer_.dispose(), this.renderer_ = null), this.animationDelayKey_ && (cancelAnimationFrame(this.animationDelayKey_), this.animationDelayKey_ = void 0);
    else {
      e.appendChild(this.viewport_), this.renderer_ || (this.renderer_ = new XZ(this)), this.mapBrowserEventHandler_ = new bZ(
        this,
        this.moveTolerance_
      );
      for (const l in Ua)
        this.mapBrowserEventHandler_.addEventListener(
          Ua[l],
          this.handleMapBrowserEvent.bind(this)
        );
      this.viewport_.addEventListener(
        ln.CONTEXTMENU,
        this.boundHandleBrowserEvent_,
        !1
      ), this.viewport_.addEventListener(
        ln.WHEEL,
        this.boundHandleBrowserEvent_,
        V2 ? { passive: !1 } : !1
      );
      let a;
      if (this.keyboardEventTarget_)
        a = this.keyboardEventTarget_;
      else {
        const l = e.getRootNode();
        a = l instanceof ShadowRoot ? l.host : e;
      }
      this.targetChangeHandlerKeys_ = [
        Fn(
          a,
          ln.KEYDOWN,
          this.handleBrowserEvent,
          this
        ),
        Fn(
          a,
          ln.KEYPRESS,
          this.handleBrowserEvent,
          this
        )
      ];
      const s = e.getRootNode();
      s instanceof ShadowRoot && this.resizeObserver_.observe(s.host), this.resizeObserver_.observe(e);
    }
    this.updateSize();
  }
  /**
   * @private
   */
  handleTileChange_() {
    this.render();
  }
  /**
   * @private
   */
  handleViewPropertyChanged_() {
    this.render();
  }
  /**
   * @private
   */
  handleViewChanged_() {
    this.viewPropertyListenerKey_ && (Xi(this.viewPropertyListenerKey_), this.viewPropertyListenerKey_ = null), this.viewChangeListenerKey_ && (Xi(this.viewChangeListenerKey_), this.viewChangeListenerKey_ = null);
    const t = this.getView();
    t && (this.updateViewportSize_(this.getSize()), this.viewPropertyListenerKey_ = Fn(
      t,
      lE.PROPERTYCHANGE,
      this.handleViewPropertyChanged_,
      this
    ), this.viewChangeListenerKey_ = Fn(
      t,
      ln.CHANGE,
      this.handleViewPropertyChanged_,
      this
    ), t.resolveConstraints(0)), this.render();
  }
  /**
   * @private
   */
  handleLayerGroupChanged_() {
    this.layerGroupPropertyListenerKeys_ && (this.layerGroupPropertyListenerKeys_.forEach(Xi), this.layerGroupPropertyListenerKeys_ = null);
    const t = this.getLayerGroup();
    t && (this.handleLayerAdd_(new c0("addlayer", t)), this.layerGroupPropertyListenerKeys_ = [
      Fn(t, lE.PROPERTYCHANGE, this.render, this),
      Fn(t, ln.CHANGE, this.render, this),
      Fn(t, "addlayer", this.handleLayerAdd_, this),
      Fn(t, "removelayer", this.handleLayerRemove_, this)
    ]), this.render();
  }
  /**
   * @return {boolean} Is rendered.
   */
  isRendered() {
    return !!this.frameState_;
  }
  /**
   * @private
   */
  animationDelay_() {
    this.animationDelayKey_ = void 0, this.renderFrame_(Date.now());
  }
  /**
   * Requests an immediate render in a synchronous manner.
   * @api
   */
  renderSync() {
    this.animationDelayKey_ && cancelAnimationFrame(this.animationDelayKey_), this.animationDelay_();
  }
  /**
   * Redraws all text after new fonts have loaded
   */
  redrawText() {
    if (!this.frameState_)
      return;
    const t = this.frameState_.layerStatesArray;
    for (let e = 0, a = t.length; e < a; ++e) {
      const s = t[e].layer;
      s.hasRenderer() && s.getRenderer().handleFontsChanged();
    }
  }
  /**
   * Request a map rendering (at the next animation frame).
   * @api
   */
  render() {
    this.renderer_ && this.animationDelayKey_ === void 0 && (this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_));
  }
  /**
   * Remove the given control from the map.
   * @param {import("./control/Control.js").default} control Control.
   * @return {import("./control/Control.js").default|undefined} The removed control (or undefined
   *     if the control was not found).
   * @api
   */
  removeControl(t) {
    return this.getControls().remove(t);
  }
  /**
   * Remove the given interaction from the map.
   * @param {import("./interaction/Interaction.js").default} interaction Interaction to remove.
   * @return {import("./interaction/Interaction.js").default|undefined} The removed interaction (or
   *     undefined if the interaction was not found).
   * @api
   */
  removeInteraction(t) {
    return this.getInteractions().remove(t);
  }
  /**
   * Removes the given layer from the map.
   * @param {import("./layer/Base.js").default} layer Layer.
   * @return {import("./layer/Base.js").default|undefined} The removed layer (or undefined if the
   *     layer was not found).
   * @api
   */
  removeLayer(t) {
    return this.getLayerGroup().getLayers().remove(t);
  }
  /**
   * @param {import("./layer/Group.js").GroupEvent} event The layer remove event.
   * @private
   */
  handleLayerRemove_(t) {
    C5(t.layer);
  }
  /**
   * Remove the given overlay from the map.
   * @param {import("./Overlay.js").default} overlay Overlay.
   * @return {import("./Overlay.js").default|undefined} The removed overlay (or undefined
   *     if the overlay was not found).
   * @api
   */
  removeOverlay(t) {
    return this.getOverlays().remove(t);
  }
  /**
   * @param {number} time Time.
   * @private
   */
  renderFrame_(t) {
    const e = this.getSize(), a = this.getView(), s = this.frameState_;
    let l = null;
    if (e !== void 0 && fL(e) && a && a.isDef()) {
      const f = a.getHints(
        this.frameState_ ? this.frameState_.viewHints : void 0
      ), h = a.getState();
      if (l = {
        animate: !1,
        coordinateToPixelTransform: this.coordinateToPixelTransform_,
        declutter: null,
        extent: Qb(
          h.center,
          h.resolution,
          h.rotation,
          e
        ),
        index: this.frameIndex_++,
        layerIndex: 0,
        layerStatesArray: this.getLayerGroup().getLayerStatesArray(),
        pixelRatio: this.pixelRatio_,
        pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
        postRenderFunctions: [],
        size: e,
        tileQueue: this.tileQueue_,
        time: t,
        usedTiles: {},
        viewState: h,
        viewHints: f,
        wantedTiles: {},
        mapId: si(this),
        renderTargets: {}
      }, h.nextCenter && h.nextResolution) {
        const p = isNaN(h.nextRotation) ? h.rotation : h.nextRotation;
        l.nextExtent = Qb(
          h.nextCenter,
          h.nextResolution,
          p,
          e
        );
      }
    }
    this.frameState_ = l, this.renderer_.renderFrame(l), l && (l.animate && this.render(), Array.prototype.push.apply(
      this.postRenderFunctions_,
      l.postRenderFunctions
    ), s && (!this.previousExtent_ || !F_(this.previousExtent_) && !K1(l.extent, this.previousExtent_)) && (this.dispatchEvent(
      new P1(em.MOVESTART, this, s)
    ), this.previousExtent_ = vS(this.previousExtent_)), this.previousExtent_ && !l.viewHints[ss.ANIMATING] && !l.viewHints[ss.INTERACTING] && !K1(l.extent, this.previousExtent_) && (this.dispatchEvent(
      new P1(em.MOVEEND, this, l)
    ), QL(l.extent, this.previousExtent_))), this.dispatchEvent(new P1(em.POSTRENDER, this, l)), this.renderComplete_ = (this.hasListener(em.LOADSTART) || this.hasListener(em.LOADEND) || this.hasListener(wc.RENDERCOMPLETE)) && !this.tileQueue_.getTilesLoading() && !this.tileQueue_.getCount() && !this.getLoadingOrNotReady(), this.postRenderTimeoutHandle_ || (this.postRenderTimeoutHandle_ = setTimeout(() => {
      this.postRenderTimeoutHandle_ = void 0, this.handlePostRender();
    }, 0));
  }
  /**
   * Sets the layergroup of this map.
   * @param {LayerGroup} layerGroup A layer group containing the layers in this map.
   * @observable
   * @api
   */
  setLayerGroup(t) {
    const e = this.getLayerGroup();
    e && this.handleLayerRemove_(new c0("removelayer", e)), this.set(Js.LAYERGROUP, t);
  }
  /**
   * Set the size of this map.
   * @param {import("./size.js").Size|undefined} size The size in pixels of the map in the DOM.
   * @observable
   * @api
   */
  setSize(t) {
    this.set(Js.SIZE, t);
  }
  /**
   * Set the target element to render this map into.
   * For accessibility (focus and keyboard events for map navigation), the `target` element must have a
   *  properly configured `tabindex` attribute. If the `target` element is inside a Shadow DOM, the
   *  `tabindex` atribute must be set on the custom element's host element.
   * @param {HTMLElement|string} [target] The Element or id of the Element
   *     that the map is rendered in.
   * @observable
   * @api
   */
  setTarget(t) {
    this.set(Js.TARGET, t);
  }
  /**
   * Set the view for this map.
   * @param {View|Promise<import("./View.js").ViewOptions>|null} view The view that controls this map.
   * It is also possible to pass a promise that resolves to options for constructing a view.  This
   * alternative allows view properties to be resolved by sources or other components that load
   * view-related metadata.
   * @observable
   * @api
   */
  setView(t) {
    if (!t || t instanceof td) {
      this.set(Js.VIEW, t);
      return;
    }
    this.set(Js.VIEW, new td());
    const e = this;
    t.then(function(a) {
      e.setView(new td(a));
    });
  }
  /**
   * Force a recalculation of the map viewport size.  This should be called when
   * third-party code changes the size of the map viewport.
   * @api
   */
  updateSize() {
    const t = this.getTargetElement();
    let e;
    if (t) {
      const s = getComputedStyle(t), l = t.offsetWidth - parseFloat(s.borderLeftWidth) - parseFloat(s.paddingLeft) - parseFloat(s.paddingRight) - parseFloat(s.borderRightWidth), f = t.offsetHeight - parseFloat(s.borderTopWidth) - parseFloat(s.paddingTop) - parseFloat(s.paddingBottom) - parseFloat(s.borderBottomWidth);
      !isNaN(l) && !isNaN(f) && (e = [Math.max(0, l), Math.max(0, f)], !fL(e) && (t.offsetWidth || t.offsetHeight || t.getClientRects().length) && WL(
        "No map visible because the map container's width or height are 0."
      ));
    }
    const a = this.getSize();
    e && (!a || !I0(e, a)) && (this.setSize(e), this.updateViewportSize_(e));
  }
  /**
   * Recomputes the viewport size and save it on the view object (if any)
   * @param {import("./size.js").Size|undefined} size The size.
   * @private
   */
  updateViewportSize_(t) {
    const e = this.getView();
    e && e.setViewportSize(t);
  }
};
function KZ(n) {
  let t = null;
  n.keyboardEventTarget !== void 0 && (t = typeof n.keyboardEventTarget == "string" ? document.getElementById(n.keyboardEventTarget) : n.keyboardEventTarget);
  const e = {}, a = n.layers && typeof /** @type {?} */
  n.layers.getLayers == "function" ? (
    /** @type {LayerGroup} */
    n.layers
  ) : new P0({
    layers: (
      /** @type {Collection<import("./layer/Base.js").default>|Array<import("./layer/Base.js").default>} */
      n.layers
    )
  });
  e[Js.LAYERGROUP] = a, e[Js.TARGET] = n.target, e[Js.VIEW] = n.view instanceof td ? n.view : new td();
  let s;
  n.controls !== void 0 && (Array.isArray(n.controls) ? s = new Nf(n.controls.slice()) : (Ei(
    typeof /** @type {?} */
    n.controls.getArray == "function",
    "Expected `controls` to be an array or an `ol/Collection.js`"
  ), s = n.controls));
  let l;
  n.interactions !== void 0 && (Array.isArray(n.interactions) ? l = new Nf(n.interactions.slice()) : (Ei(
    typeof /** @type {?} */
    n.interactions.getArray == "function",
    "Expected `interactions` to be an array or an `ol/Collection.js`"
  ), l = n.interactions));
  let f;
  return n.overlays !== void 0 ? Array.isArray(n.overlays) ? f = new Nf(n.overlays.slice()) : (Ei(
    typeof /** @type {?} */
    n.overlays.getArray == "function",
    "Expected `overlays` to be an array or an `ol/Collection.js`"
  ), f = n.overlays) : f = new Nf(), {
    controls: s,
    interactions: l,
    keyboardEventTarget: t,
    overlays: f,
    values: e
  };
}
const Qs = {
  ELEMENT: "element",
  MAP: "map",
  OFFSET: "offset",
  POSITION: "position",
  POSITIONING: "positioning"
};
class ZZ extends Uf {
  /**
   * @param {Options} options Overlay options.
   */
  constructor(t) {
    super(), this.on, this.once, this.un, this.options = t, this.id = t.id, this.insertFirst = t.insertFirst !== void 0 ? t.insertFirst : !0, this.stopEvent = t.stopEvent !== void 0 ? t.stopEvent : !0, this.element = document.createElement("div"), this.element.className = t.className !== void 0 ? t.className : "ol-overlay-container " + bX, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.autoPan = t.autoPan === !0 ? {} : t.autoPan || void 0, this.rendered = {
      transform_: "",
      visible: !0
    }, this.mapPostrenderListenerKey = null, this.addChangeListener(Qs.ELEMENT, this.handleElementChanged), this.addChangeListener(Qs.MAP, this.handleMapChanged), this.addChangeListener(Qs.OFFSET, this.handleOffsetChanged), this.addChangeListener(Qs.POSITION, this.handlePositionChanged), this.addChangeListener(Qs.POSITIONING, this.handlePositioningChanged), t.element !== void 0 && this.setElement(t.element), this.setOffset(t.offset !== void 0 ? t.offset : [0, 0]), this.setPositioning(t.positioning || "top-left"), t.position !== void 0 && this.setPosition(t.position);
  }
  /**
   * Get the DOM element of this overlay.
   * @return {HTMLElement|undefined} The Element containing the overlay.
   * @observable
   * @api
   */
  getElement() {
    return (
      /** @type {HTMLElement|undefined} */
      this.get(Qs.ELEMENT)
    );
  }
  /**
   * Get the overlay identifier which is set on constructor.
   * @return {number|string|undefined} Id.
   * @api
   */
  getId() {
    return this.id;
  }
  /**
   * Get the map associated with this overlay.
   * @return {import("./Map.js").default|null} The map that the
   * overlay is part of.
   * @observable
   * @api
   */
  getMap() {
    return (
      /** @type {import("./Map.js").default|null} */
      this.get(Qs.MAP) || null
    );
  }
  /**
   * Get the offset of this overlay.
   * @return {Array<number>} The offset.
   * @observable
   * @api
   */
  getOffset() {
    return (
      /** @type {Array<number>} */
      this.get(Qs.OFFSET)
    );
  }
  /**
   * Get the current position of this overlay.
   * @return {import("./coordinate.js").Coordinate|undefined} The spatial point that the overlay is
   *     anchored at.
   * @observable
   * @api
   */
  getPosition() {
    return (
      /** @type {import("./coordinate.js").Coordinate|undefined} */
      this.get(Qs.POSITION)
    );
  }
  /**
   * Get the current positioning of this overlay.
   * @return {Positioning} How the overlay is positioned
   *     relative to its point on the map.
   * @observable
   * @api
   */
  getPositioning() {
    return (
      /** @type {Positioning} */
      this.get(Qs.POSITIONING)
    );
  }
  /**
   * @protected
   */
  handleElementChanged() {
    Y2(this.element);
    const t = this.getElement();
    t && this.element.appendChild(t);
  }
  /**
   * @protected
   */
  handleMapChanged() {
    this.mapPostrenderListenerKey && (this.element?.remove(), Xi(this.mapPostrenderListenerKey), this.mapPostrenderListenerKey = null);
    const t = this.getMap();
    if (t) {
      this.mapPostrenderListenerKey = Fn(
        t,
        em.POSTRENDER,
        this.render,
        this
      ), this.updatePixelPosition();
      const e = this.stopEvent ? t.getOverlayContainerStopEvent() : t.getOverlayContainer();
      this.insertFirst ? e.insertBefore(this.element, e.childNodes[0] || null) : e.appendChild(this.element), this.performAutoPan();
    }
  }
  /**
   * @protected
   */
  render() {
    this.updatePixelPosition();
  }
  /**
   * @protected
   */
  handleOffsetChanged() {
    this.updatePixelPosition();
  }
  /**
   * @protected
   */
  handlePositionChanged() {
    this.updatePixelPosition(), this.performAutoPan();
  }
  /**
   * @protected
   */
  handlePositioningChanged() {
    this.updatePixelPosition();
  }
  /**
   * Set the DOM element to be associated with this overlay.
   * @param {HTMLElement|undefined} element The Element containing the overlay.
   * @observable
   * @api
   */
  setElement(t) {
    this.set(Qs.ELEMENT, t);
  }
  /**
   * Set the map to be associated with this overlay.
   * @param {import("./Map.js").default|null} map The map that the
   * overlay is part of. Pass `null` to just remove the overlay from the current map.
   * @observable
   * @api
   */
  setMap(t) {
    this.set(Qs.MAP, t);
  }
  /**
   * Set the offset for this overlay.
   * @param {Array<number>} offset Offset.
   * @observable
   * @api
   */
  setOffset(t) {
    this.set(Qs.OFFSET, t);
  }
  /**
   * Set the position for this overlay. If the position is `undefined` the
   * overlay is hidden.
   * @param {import("./coordinate.js").Coordinate|undefined} position The spatial point that the overlay
   *     is anchored at.
   * @observable
   * @api
   */
  setPosition(t) {
    this.set(Qs.POSITION, t);
  }
  /**
   * Pan the map so that the overlay is entirely visible in the current viewport
   * (if necessary) using the configured autoPan parameters
   * @protected
   */
  performAutoPan() {
    this.autoPan && this.panIntoView(this.autoPan);
  }
  /**
   * Pan the map so that the overlay is entirely visible in the current viewport
   * (if necessary).
   * @param {PanIntoViewOptions} [panIntoViewOptions] Options for the pan action
   * @api
   */
  panIntoView(t) {
    const e = this.getMap();
    if (!e || !e.getTargetElement() || !this.get(Qs.POSITION))
      return;
    const a = this.getRect(e.getTargetElement(), e.getSize()), s = this.getElement(), l = this.getRect(s, [
      rX(s),
      sX(s)
    ]);
    t = t || {};
    const f = t.margin === void 0 ? 20 : t.margin;
    if (!nd(a, l)) {
      const h = l[0] - a[0], p = a[2] - l[2], y = l[1] - a[1], b = a[3] - l[3], x = [0, 0];
      if (h < 0 ? x[0] = h - f : p < 0 && (x[0] = Math.abs(p) + f), y < 0 ? x[1] = y - f : b < 0 && (x[1] = Math.abs(b) + f), x[0] !== 0 || x[1] !== 0) {
        const w = (
          /** @type {import("./coordinate.js").Coordinate} */
          e.getView().getCenterInternal()
        ), A = e.getPixelFromCoordinateInternal(w);
        if (!A)
          return;
        const C = [A[0] + x[0], A[1] + x[1]], L = t.animation || {};
        e.getView().animateInternal({
          center: e.getCoordinateFromPixelInternal(C),
          duration: L.duration,
          easing: L.easing
        });
      }
    }
  }
  /**
   * Get the extent of an element relative to the document
   * @param {HTMLElement} element The element.
   * @param {import("./size.js").Size} size The size of the element.
   * @return {import("./extent.js").Extent} The extent.
   * @protected
   */
  getRect(t, e) {
    const a = t.getBoundingClientRect(), s = a.left + window.pageXOffset, l = a.top + window.pageYOffset;
    return [s, l, s + e[0], l + e[1]];
  }
  /**
   * Set the positioning for this overlay.
   * @param {Positioning} positioning how the overlay is
   *     positioned relative to its point on the map.
   * @observable
   * @api
   */
  setPositioning(t) {
    this.set(Qs.POSITIONING, t);
  }
  /**
   * Modify the visibility of the element.
   * @param {boolean} visible Element visibility.
   * @protected
   */
  setVisible(t) {
    this.rendered.visible !== t && (this.element.style.display = t ? "" : "none", this.rendered.visible = t);
  }
  /**
   * Update pixel position.
   * @protected
   */
  updatePixelPosition() {
    const t = this.getMap(), e = this.getPosition();
    if (!t || !t.isRendered() || !e) {
      this.setVisible(!1);
      return;
    }
    const a = t.getPixelFromCoordinate(e), s = t.getSize();
    this.updateRenderedPosition(a, s);
  }
  /**
   * @param {import("./pixel.js").Pixel} pixel The pixel location.
   * @param {import("./size.js").Size|undefined} mapSize The map size.
   * @protected
   */
  updateRenderedPosition(t, e) {
    const a = this.element.style, s = this.getOffset(), l = this.getPositioning();
    this.setVisible(!0);
    const f = `${t[0] + s[0]}px`, h = `${t[1] + s[1]}px`;
    let p = "0%", y = "0%";
    l == "bottom-right" || l == "center-right" || l == "top-right" ? p = "-100%" : (l == "bottom-center" || l == "center-center" || l == "top-center") && (p = "-50%"), l == "bottom-left" || l == "bottom-center" || l == "bottom-right" ? y = "-100%" : (l == "center-left" || l == "center-center" || l == "center-right") && (y = "-50%");
    const b = `translate(${p}, ${y}) translate(${f}, ${h})`;
    this.rendered.transform_ != b && (this.rendered.transform_ = b, a.transform = b);
  }
  /**
   * returns the options this Overlay has been created with
   * @return {Options} overlay options
   */
  getOptions() {
    return this.options;
  }
}
class TO {
  /**
   * @param {number} minX Minimum X.
   * @param {number} maxX Maximum X.
   * @param {number} minY Minimum Y.
   * @param {number} maxY Maximum Y.
   */
  constructor(t, e, a, s) {
    this.minX = t, this.maxX = e, this.minY = a, this.maxY = s;
  }
  /**
   * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @return {boolean} Contains tile coordinate.
   */
  contains(t) {
    return this.containsXY(t[1], t[2]);
  }
  /**
   * @param {TileRange} tileRange Tile range.
   * @return {boolean} Contains.
   */
  containsTileRange(t) {
    return this.minX <= t.minX && t.maxX <= this.maxX && this.minY <= t.minY && t.maxY <= this.maxY;
  }
  /**
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @return {boolean} Contains coordinate.
   */
  containsXY(t, e) {
    return this.minX <= t && t <= this.maxX && this.minY <= e && e <= this.maxY;
  }
  /**
   * @param {TileRange} tileRange Tile range.
   * @return {boolean} Equals.
   */
  equals(t) {
    return this.minX == t.minX && this.minY == t.minY && this.maxX == t.maxX && this.maxY == t.maxY;
  }
  /**
   * @param {TileRange} tileRange Tile range.
   */
  extend(t) {
    t.minX < this.minX && (this.minX = t.minX), t.maxX > this.maxX && (this.maxX = t.maxX), t.minY < this.minY && (this.minY = t.minY), t.maxY > this.maxY && (this.maxY = t.maxY);
  }
  /**
   * @return {number} Height.
   */
  getHeight() {
    return this.maxY - this.minY + 1;
  }
  /**
   * @return {import("./size.js").Size} Size.
   */
  getSize() {
    return [this.getWidth(), this.getHeight()];
  }
  /**
   * @return {number} Width.
   */
  getWidth() {
    return this.maxX - this.minX + 1;
  }
  /**
   * @param {TileRange} tileRange Tile range.
   * @return {boolean} Intersects.
   */
  intersects(t) {
    return this.minX <= t.maxX && this.maxX >= t.minX && this.minY <= t.maxY && this.maxY >= t.minY;
  }
}
function R1(n, t, e, a, s) {
  return s !== void 0 ? (s.minX = n, s.maxX = t, s.minY = e, s.maxY = a, s) : new TO(n, t, e, a);
}
const tM = "units", WZ = [1, 2, 5], wb = 25.4 / 0.28;
class QZ extends Uw {
  /**
   * @param {Options} [options] Scale line options.
   */
  constructor(t) {
    t = t || {};
    const e = document.createElement("div");
    e.style.pointerEvents = "none", super({
      element: e,
      render: t.render,
      target: t.target
    }), this.on, this.once, this.un;
    const a = t.className !== void 0 ? t.className : t.bar ? "ol-scale-bar" : "ol-scale-line";
    this.innerElement_ = document.createElement("div"), this.innerElement_.className = a + "-inner", this.element.className = a + " " + jS, this.element.appendChild(this.innerElement_), this.viewState_ = null, this.minWidth_ = t.minWidth !== void 0 ? t.minWidth : 64, this.maxWidth_ = t.maxWidth, this.renderedVisible_ = !1, this.renderedWidth_ = void 0, this.renderedHTML_ = "", this.addChangeListener(tM, this.handleUnitsChanged_), this.setUnits(t.units || "metric"), this.scaleBar_ = t.bar || !1, this.scaleBarSteps_ = t.steps || 4, this.scaleBarText_ = t.text || !1, this.dpi_ = t.dpi || void 0;
  }
  /**
   * Return the units to use in the scale line.
   * @return {Units} The units
   * to use in the scale line.
   * @observable
   * @api
   */
  getUnits() {
    return this.get(tM);
  }
  /**
   * @private
   */
  handleUnitsChanged_() {
    this.updateElement_();
  }
  /**
   * Set the units to use in the scale line.
   * @param {Units} units The units to use in the scale line.
   * @observable
   * @api
   */
  setUnits(t) {
    this.set(tM, t);
  }
  /**
   * Specify the dpi of output device such as printer.
   * @param {number|undefined} dpi The dpi of output device.
   * @api
   */
  setDpi(t) {
    this.dpi_ = t;
  }
  /**
   * @private
   */
  updateElement_() {
    const t = this.viewState_;
    if (!t) {
      this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1);
      return;
    }
    const e = t.center, a = t.projection, s = this.getUnits(), l = s == "degrees" ? "degrees" : "m";
    let f = NT(
      a,
      t.resolution,
      e,
      l
    );
    const h = this.minWidth_ * (this.dpi_ || wb) / wb, p = this.maxWidth_ !== void 0 ? this.maxWidth_ * (this.dpi_ || wb) / wb : void 0;
    let y = h * f, b = "";
    if (s == "degrees") {
      const H = Z1.degrees;
      y *= H, y < H / 60 ? (b = "″", f *= 3600) : y < H ? (b = "′", f *= 60) : b = "°";
    } else if (s == "imperial")
      y < 0.9144 ? (b = "in", f /= 0.0254) : y < 1609.344 ? (b = "ft", f /= 0.3048) : (b = "mi", f /= 1609.344);
    else if (s == "nautical")
      f /= 1852, b = "NM";
    else if (s == "metric")
      y < 1e-6 ? (b = "nm", f *= 1e9) : y < 1e-3 ? (b = "μm", f *= 1e6) : y < 1 ? (b = "mm", f *= 1e3) : y < 1e3 ? b = "m" : (b = "km", f /= 1e3);
    else if (s == "us")
      y < 0.9144 ? (b = "in", f *= 39.37) : y < 1609.344 ? (b = "ft", f /= 0.30480061) : (b = "mi", f /= 1609.3472);
    else
      throw new Error("Invalid units");
    let x = 3 * Math.floor(Math.log(h * f) / Math.log(10)), w, A, C, L = 0, N, U;
    for (; ; ) {
      C = Math.floor(x / 3);
      const H = Math.pow(10, C);
      if (w = WZ[(x % 3 + 3) % 3] * H, A = Math.round(w / f), isNaN(A)) {
        this.element.style.display = "none", this.renderedVisible_ = !1;
        return;
      }
      if (p !== void 0 && A >= p) {
        w = L, A = N, C = U;
        break;
      } else if (A >= h)
        break;
      L = w, N = A, U = C, ++x;
    }
    const k = this.scaleBar_ ? this.createScaleBar(A, w, b) : w.toFixed(C < 0 ? -C : 0) + " " + b;
    this.renderedHTML_ != k && (this.innerElement_.innerHTML = k, this.renderedHTML_ = k), this.renderedWidth_ != A && (this.innerElement_.style.width = A + "px", this.renderedWidth_ = A), this.renderedVisible_ || (this.element.style.display = "", this.renderedVisible_ = !0);
  }
  /**
   * @private
   * @param {number} width The current width of the scalebar.
   * @param {number} scale The current scale.
   * @param {string} suffix The suffix to append to the scale text.
   * @return {string} The stringified HTML of the scalebar.
   */
  createScaleBar(t, e, a) {
    const s = this.getScaleForResolution(), l = s < 1 ? Math.round(1 / s).toLocaleString() + " : 1" : "1 : " + Math.round(s).toLocaleString(), f = this.scaleBarSteps_, h = t / f, p = [this.createMarker("absolute")];
    for (let b = 0; b < f; ++b) {
      const x = b % 2 === 0 ? "ol-scale-singlebar-odd" : "ol-scale-singlebar-even";
      p.push(
        `<div><div class="ol-scale-singlebar ${x}" style="width: ${h}px;"></div>` + this.createMarker("relative") + // render text every second step, except when only 2 steps
        (b % 2 === 0 || f === 2 ? this.createStepText(b, t, !1, e, a) : "") + "</div>"
      );
    }
    return p.push(this.createStepText(f, t, !0, e, a)), (this.scaleBarText_ ? `<div class="ol-scale-text" style="width: ${t}px;">` + l + "</div>" : "") + p.join("");
  }
  /**
   * Creates a marker at given position
   * @param {'absolute'|'relative'} position The position, absolute or relative
   * @return {string} The stringified div containing the marker
   */
  createMarker(t) {
    return `<div class="ol-scale-step-marker" style="position: ${t}; top: ${t === "absolute" ? 3 : -10}px;"></div>`;
  }
  /**
   * Creates the label for a marker marker at given position
   * @param {number} i The iterator
   * @param {number} width The width the scalebar will currently use
   * @param {boolean} isLast Flag indicating if we add the last step text
   * @param {number} scale The current scale for the whole scalebar
   * @param {string} suffix The suffix for the scale
   * @return {string} The stringified div containing the step text
   */
  createStepText(t, e, a, s, l) {
    const h = (t === 0 ? 0 : Math.round(s / this.scaleBarSteps_ * t * 100) / 100) + (t === 0 ? "" : " " + l), p = t === 0 ? -3 : e / this.scaleBarSteps_ * -1, y = t === 0 ? 0 : e / this.scaleBarSteps_ * 2;
    return `<div class="ol-scale-step-text" style="margin-left: ${p}px;text-align: ${t === 0 ? "left" : "center"};min-width: ${y}px;left: ${a ? e + "px" : "unset"};">` + h + "</div>";
  }
  /**
   * Returns the appropriate scale for the given resolution and units.
   * @return {number} The appropriate scale.
   */
  getScaleForResolution() {
    const t = NT(
      this.viewState_.projection,
      this.viewState_.resolution,
      this.viewState_.center,
      "m"
    ), e = this.dpi_ || wb, a = 1e3 / 25.4;
    return t * a * e;
  }
  /**
   * Update the scale line element.
   * @param {import("../MapEvent.js").default} mapEvent Map event.
   * @override
   */
  render(t) {
    const e = t.frameState;
    e ? this.viewState_ = e.viewState : this.viewState_ = null, this.updateElement_();
  }
}
function wO(n, t) {
  return D5(n, t, []).join("");
}
function D5(n, t, e) {
  if (n.nodeType == Node.CDATA_SECTION_NODE || n.nodeType == Node.TEXT_NODE)
    e.push(n.nodeValue);
  else {
    let a;
    for (a = n.firstChild; a; a = a.nextSibling)
      D5(a, t, e);
  }
  return e;
}
function JZ(n) {
  return "documentElement" in n;
}
function tW(n) {
  return new DOMParser().parseFromString(n, "application/xml");
}
function JM(n, t) {
  return (
    /**
     * @param {Element} node Node.
     * @param {Array<*>} objectStack Object stack.
     * @this {*}
     */
    function(e, a) {
      const s = n.call(this, e, a);
      s !== void 0 && /** @type {Array<*>} */
      a[a.length - 1].push(s);
    }
  );
}
function cl(n, t, e) {
  return (
    /**
     * @param {Element} node Node.
     * @param {Array<*>} objectStack Object stack.
     * @this {*}
     */
    function(a, s) {
      const l = n.call(this, a, s);
      if (l !== void 0) {
        const f = (
          /** @type {!Object} */
          s[s.length - 1]
        ), h = a.localName;
        let p;
        h in f ? p = f[h] : (p = [], f[h] = p), p.push(l);
      }
    }
  );
}
function Ce(n, t, e) {
  return (
    /**
     * @param {Element} node Node.
     * @param {Array<*>} objectStack Object stack.
     * @this {*}
     */
    function(a, s) {
      const l = n.call(this, a, s);
      if (l !== void 0) {
        const f = (
          /** @type {!Object} */
          s[s.length - 1]
        ), h = a.localName;
        f[h] = l;
      }
    }
  );
}
function bi(n, t, e) {
  e = e !== void 0 ? e : {};
  let a, s;
  for (a = 0, s = n.length; a < s; ++a)
    e[n[a]] = t;
  return e;
}
function eW(n, t, e, a) {
  let s;
  for (s = t.firstElementChild; s; s = s.nextElementSibling) {
    const l = n[s.namespaceURI];
    if (l !== void 0) {
      const f = l[s.localName];
      f !== void 0 && f.call(a, s, e);
    }
  }
}
function Ki(n, t, e, a, s) {
  return a.push(n), eW(t, e, a, s), /** @type {T} */
  a.pop();
}
class N5 {
  /**
   * Read the source document.
   *
   * @param {Document|Element|string} source The XML source.
   * @return {Object|null} An object representing the source.
   * @api
   */
  read(t) {
    if (!t)
      return null;
    if (typeof t == "string") {
      const e = tW(t);
      return this.readFromDocument(e);
    }
    return JZ(t) ? this.readFromDocument(
      /** @type {Document} */
      t
    ) : this.readFromNode(
      /** @type {Element} */
      t
    );
  }
  /**
   * @param {Document} doc Document.
   * @return {Object|null} Object
   */
  readFromDocument(t) {
    for (let e = t.firstChild; e; e = e.nextSibling)
      if (e.nodeType == Node.ELEMENT_NODE)
        return this.readFromNode(
          /** @type {Element} */
          e
        );
    return null;
  }
  /**
   * @abstract
   * @param {Element} node Node.
   * @return {Object|null} Object
   */
  readFromNode(t) {
    Qn();
  }
}
const nW = "http://www.w3.org/1999/xlink";
function RO(n) {
  return n.getAttributeNS(nW, "href");
}
function iW(n) {
  const t = wO(n, !1);
  return aW(t);
}
function aW(n) {
  const t = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);
  if (t)
    return parseFloat(t[1]);
}
function m0(n) {
  const t = wO(n, !1);
  return rW(t);
}
function rW(n) {
  const t = /^\s*(\d+)\s*$/.exec(n);
  if (t)
    return parseInt(t[1], 10);
}
function $n(n) {
  return wO(n, !1).trim();
}
const yl = [null, "http://www.opengis.net/ows/1.1"], sW = bi(yl, {
  ServiceIdentification: Ce(DW),
  ServiceProvider: Ce(LW),
  OperationsMetadata: Ce(CW)
});
class oW extends N5 {
  constructor() {
    super();
  }
  /**
   * @param {Element} node Node.
   * @return {Object|null} Object
   * @override
   */
  readFromNode(t) {
    const e = Ki({}, sW, t, []);
    return e || null;
  }
}
const lW = bi(yl, {
  DeliveryPoint: Ce($n),
  City: Ce($n),
  AdministrativeArea: Ce($n),
  PostalCode: Ce($n),
  Country: Ce($n),
  ElectronicMailAddress: Ce($n)
}), uW = bi(yl, {
  Value: cl(IW)
}), cW = bi(yl, {
  AllowedValues: Ce(SW)
}), fW = bi(yl, {
  Phone: Ce(OW),
  Address: Ce(bW)
}), hW = bi(yl, {
  HTTP: Ce(AW)
}), dW = bi(yl, {
  Get: cl(RW),
  Post: void 0
  // TODO
}), gW = bi(yl, {
  DCP: Ce(wW)
}), mW = bi(yl, {
  Operation: MW
}), pW = bi(yl, {
  Voice: Ce($n),
  Facsimile: Ce($n)
}), yW = bi(yl, {
  Constraint: cl(xW)
}), _W = bi(yl, {
  IndividualName: Ce($n),
  PositionName: Ce($n),
  ContactInfo: Ce(TW)
}), vW = bi(yl, {
  Abstract: Ce($n),
  AccessConstraints: Ce($n),
  Fees: Ce($n),
  Title: Ce($n),
  ServiceTypeVersion: Ce($n),
  ServiceType: Ce($n)
}), EW = bi(yl, {
  ProviderName: Ce($n),
  ProviderSite: Ce(RO),
  ServiceContact: Ce(NW)
});
function bW(n, t) {
  return Ki({}, lW, n, t);
}
function SW(n, t) {
  return Ki({}, uW, n, t);
}
function xW(n, t) {
  const e = n.getAttribute("name");
  if (e)
    return Ki({ name: e }, cW, n, t);
}
function TW(n, t) {
  return Ki({}, fW, n, t);
}
function wW(n, t) {
  return Ki({}, hW, n, t);
}
function RW(n, t) {
  const e = RO(n);
  if (e)
    return Ki(
      { href: e },
      yW,
      n,
      t
    );
}
function AW(n, t) {
  return Ki({}, dW, n, t);
}
function MW(n, t) {
  const e = n.getAttribute("name"), a = Ki({}, gW, n, t);
  if (!a)
    return;
  const s = (
    /** @type {Object} */
    t[t.length - 1]
  );
  s[e] = a;
}
function CW(n, t) {
  return Ki({}, mW, n, t);
}
function OW(n, t) {
  return Ki({}, pW, n, t);
}
function DW(n, t) {
  return Ki({}, vW, n, t);
}
function NW(n, t) {
  return Ki({}, _W, n, t);
}
function LW(n, t) {
  return Ki({}, EW, n, t);
}
function IW(n, t) {
  return $n(n);
}
const gd = [null, "http://www.opengis.net/wmts/1.0"], TE = [null, "http://www.opengis.net/ows/1.1"], PW = bi(gd, {
  Contents: Ce(FW)
});
class zW extends N5 {
  constructor() {
    super(), this.owsParser_ = new oW();
  }
  /**
   * @param {Element} node Node.
   * @return {Object|null} Object
   * @override
   */
  readFromNode(t) {
    let e = t.getAttribute("version");
    e && (e = e.trim());
    let a = this.owsParser_.readFromNode(t);
    return a ? (a.version = e, a = Ki(
      a,
      PW,
      t,
      []
    ), a || null) : null;
  }
}
const GW = bi(gd, {
  Layer: cl($W),
  TileMatrixSet: cl(XW)
}), UW = bi(
  gd,
  {
    Style: cl(KW),
    Format: cl($n),
    TileMatrixSetLink: cl(ZW),
    Dimension: cl(WW),
    ResourceURL: cl(QW)
  },
  bi(TE, {
    Title: Ce($n),
    Abstract: Ce($n),
    WGS84BoundingBox: Ce(I5),
    BoundingBox: cl(JW),
    Identifier: Ce($n)
  })
), jW = bi(
  gd,
  {
    LegendURL: cl(tQ)
  },
  bi(TE, {
    Title: Ce($n),
    Identifier: Ce($n)
  })
), kW = bi(gd, {
  TileMatrixSet: Ce($n),
  TileMatrixSetLimits: Ce(nQ)
}), HW = bi(gd, {
  TileMatrixLimits: JM(iQ)
}), BW = bi(gd, {
  TileMatrix: Ce($n),
  MinTileRow: Ce(m0),
  MaxTileRow: Ce(m0),
  MinTileCol: Ce(m0),
  MaxTileCol: Ce(m0)
}), qW = bi(
  gd,
  {
    Default: Ce($n),
    Value: cl($n)
  },
  bi(TE, {
    Identifier: Ce($n)
  })
), L5 = bi(TE, {
  LowerCorner: JM(tC),
  UpperCorner: JM(tC)
}), VW = bi(
  gd,
  {
    WellKnownScaleSet: Ce($n),
    TileMatrix: cl(eQ)
  },
  bi(TE, {
    SupportedCRS: Ce($n),
    Identifier: Ce($n),
    BoundingBox: Ce(I5)
  })
), YW = bi(
  gd,
  {
    TopLeftCorner: Ce(tC),
    ScaleDenominator: Ce(iW),
    TileWidth: Ce(m0),
    TileHeight: Ce(m0),
    MatrixWidth: Ce(m0),
    MatrixHeight: Ce(m0)
  },
  bi(TE, {
    Identifier: Ce($n)
  })
);
function FW(n, t) {
  return Ki({}, GW, n, t);
}
function $W(n, t) {
  return Ki({}, UW, n, t);
}
function XW(n, t) {
  return Ki({}, VW, n, t);
}
function KW(n, t) {
  const e = Ki({}, jW, n, t);
  if (!e)
    return;
  const a = n.getAttribute("isDefault") === "true";
  return e.isDefault = a, e;
}
function ZW(n, t) {
  return Ki({}, kW, n, t);
}
function WW(n, t) {
  return Ki({}, qW, n, t);
}
function QW(n, t) {
  const e = n.getAttribute("format"), a = n.getAttribute("template"), s = n.getAttribute("resourceType"), l = {};
  return e && (l.format = e), a && (l.template = a), s && (l.resourceType = s), l;
}
function I5(n, t) {
  const e = Ki(
    [],
    L5,
    n,
    t
  );
  if (e.length == 2)
    return AT(e);
}
function JW(n, t) {
  const e = n.getAttribute("crs"), a = Ki(
    [],
    L5,
    n,
    t
  );
  if (a.length == 2)
    return { extent: AT(a), crs: e };
}
function tQ(n, t) {
  const e = {};
  return e.format = n.getAttribute("format"), e.href = RO(n), e;
}
function tC(n, t) {
  const e = $n(n).split(/\s+/);
  if (!e || e.length != 2)
    return;
  const a = +e[0], s = +e[1];
  if (!(isNaN(a) || isNaN(s)))
    return [a, s];
}
function eQ(n, t) {
  return Ki({}, YW, n, t);
}
function nQ(n, t) {
  return Ki([], HW, n, t);
}
function iQ(n, t) {
  return Ki({}, BW, n, t);
}
class aQ extends dO {
  /**
   * @param {import("../../layer/Image.js").default} imageLayer Image layer.
   */
  constructor(t) {
    super(t), this.image = null;
  }
  /**
   * @return {import('../../DataTile.js').ImageLike} Image.
   */
  getImage() {
    return this.image ? this.image.getImage() : null;
  }
  /**
   * Determine whether render should be called.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {boolean} Layer is ready to be rendered.
   * @override
   */
  prepareFrame(t) {
    const e = t.layerStatesArray[t.layerIndex], a = t.pixelRatio, s = t.viewState, l = s.resolution, f = this.getLayer().getSource(), h = t.viewHints;
    let p = t.extent;
    if (e.extent !== void 0 && (p = im(
      p,
      id(e.extent, s.projection)
    )), !h[ss.ANIMATING] && !h[ss.INTERACTING] && !F_(p))
      if (f) {
        const y = s.projection, b = f.getImage(
          p,
          l,
          a,
          y
        );
        b && (this.loadImage(b) ? this.image = b : b.getState() === xe.EMPTY && (this.image = null));
      } else
        this.image = null;
    return !!this.image;
  }
  /**
   * @param {import("../../pixel.js").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray} Data at the pixel location.
   * @override
   */
  getData(t) {
    const e = this.frameState;
    if (!e)
      return null;
    const a = this.getLayer(), s = Lr(
      e.pixelToCoordinateTransform,
      t.slice()
    ), l = a.getExtent();
    if (l && !D_(l, s))
      return null;
    const f = this.image.getExtent(), h = this.image.getImage(), p = Hn(f), y = Math.floor(
      h.width * ((s[0] - f[0]) / p)
    );
    if (y < 0 || y >= h.width)
      return null;
    const b = Ir(f), x = Math.floor(
      h.height * ((f[3] - s[1]) / b)
    );
    return x < 0 || x >= h.height ? null : this.getImageData(h, y, x);
  }
  /**
   * Render the layer.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement} target Target that may be used to render content to.
   * @return {HTMLElement} The rendered element.
   * @override
   */
  renderFrame(t, e) {
    const a = this.image, s = a.getExtent(), l = a.getResolution(), [f, h] = Array.isArray(l) ? l : [l, l], p = a.getPixelRatio(), y = t.layerStatesArray[t.layerIndex], b = t.pixelRatio, x = t.viewState, w = x.center, A = x.resolution, C = b * f / (A * p), L = b * h / (A * p);
    this.prepareContainer(t, e);
    const N = this.context.canvas.width, U = this.context.canvas.height, k = this.getRenderContext(t);
    let H = !1, B = !0;
    if (y.extent) {
      const pt = id(
        y.extent,
        x.projection
      );
      B = Co(pt, t.extent), H = B && !nd(pt, t.extent), H && this.clipUnrotated(k, t, pt);
    }
    const z = a.getImage(), Q = fd(
      this.tempTransform,
      N / 2,
      U / 2,
      C,
      L,
      0,
      p * (s[0] - w[0]) / f,
      p * (w[1] - s[3]) / h
    );
    this.renderedResolution = h * b / p;
    const et = z.width * Q[0], ot = z.height * Q[3];
    if (this.getLayer().getSource().getInterpolate() || (k.imageSmoothingEnabled = !1), this.preRender(k, t), B && et >= 0.5 && ot >= 0.5) {
      const pt = Q[4], ht = Q[5], Ct = y.opacity;
      Ct !== 1 && (k.save(), k.globalAlpha = Ct), k.drawImage(z, 0, 0, +z.width, +z.height, pt, ht, et, ot), Ct !== 1 && k.restore();
    }
    return this.postRender(this.context, t), H && k.restore(), k.imageSmoothingEnabled = !0, this.container;
  }
}
class rQ extends VS {
  /**
   * @param {Options<ImageSourceType>} [options] Layer options.
   */
  constructor(t) {
    t = t || {}, super(t);
  }
}
class P5 extends rQ {
  /**
   * @param {import("./BaseImage.js").Options<ImageSourceType>} [options] Layer options.
   */
  constructor(t) {
    super(t);
  }
  /**
   * @override
   */
  createRenderer() {
    return new aQ(this);
  }
  /**
   * Get data for a pixel location.  A four element RGBA array will be returned.  For requests outside the
   * layer extent, `null` will be returned.  Data for an image can only be retrieved if the
   * source's `crossOrigin` property is set.
   *
   * ```js
   * // display layer data on every pointer move
   * map.on('pointermove', (event) => {
   *   console.log(layer.getData(event.pixel));
   * });
   * ```
   * @param {import("../pixel").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
   * @api
   * @override
   */
  getData(t) {
    return super.getData(t);
  }
}
function eC(n) {
  return n instanceof Image || n instanceof HTMLCanvasElement || n instanceof HTMLVideoElement || n instanceof ImageBitmap ? n : null;
}
const sQ = new Error("disposed"), oQ = [256, 256];
class NL extends bO {
  /**
   * @param {Options} options Tile options.
   */
  constructor(t) {
    const e = ze.IDLE;
    super(t.tileCoord, e, {
      transition: t.transition,
      interpolate: t.interpolate
    }), this.loader_ = t.loader, this.data_ = null, this.error_ = null, this.size_ = t.size || null, this.controller_ = t.controller || null;
  }
  /**
   * Get the tile size.
   * @return {import('./size.js').Size} Tile size.
   */
  getSize() {
    if (this.size_)
      return this.size_;
    const t = eC(this.data_);
    return t ? [t.width, t.height] : oQ;
  }
  /**
   * Get the data for the tile.
   * @return {Data} Tile data.
   * @api
   */
  getData() {
    return this.data_;
  }
  /**
   * Get any loading error.
   * @return {Error} Loading error.
   * @api
   */
  getError() {
    return this.error_;
  }
  /**
   * Load the tile data.
   * @api
   * @override
   */
  load() {
    if (this.state !== ze.IDLE && this.state !== ze.ERROR)
      return;
    this.state = ze.LOADING, this.changed();
    const t = this;
    this.loader_().then(function(e) {
      t.data_ = e, t.state = ze.LOADED, t.changed();
    }).catch(function(e) {
      t.error_ = e, t.state = ze.ERROR, t.changed();
    });
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.controller_ && (this.controller_.abort(sQ), this.controller_ = null), super.disposeInternal();
  }
}
let eM;
const $1 = [];
function LL(n, t, e, a, s) {
  n.beginPath(), n.moveTo(0, 0), n.lineTo(t, e), n.lineTo(a, s), n.closePath(), n.save(), n.clip(), n.fillRect(0, 0, Math.max(t, a) + 1, Math.max(e, s)), n.restore();
}
function nM(n, t) {
  return Math.abs(n[t * 4] - 210) > 2 || Math.abs(n[t * 4 + 3] - 0.75 * 255) > 2;
}
function lQ() {
  if (eM === void 0) {
    const n = Pr(6, 6, $1);
    n.globalCompositeOperation = "lighter", n.fillStyle = "rgba(210, 0, 0, 0.75)", LL(n, 4, 5, 4, 0), LL(n, 4, 5, 0, 5);
    const t = n.getImageData(0, 0, 3, 3).data;
    eM = nM(t, 0) || nM(t, 4) || nM(t, 8), Dw(n), $1.push(n.canvas);
  }
  return eM;
}
function yS(n, t, e, a) {
  const s = gw(e, t, n);
  let l = NT(
    t,
    a,
    e
  );
  const f = t.getMetersPerUnit();
  f !== void 0 && (l *= f);
  const h = n.getMetersPerUnit();
  h !== void 0 && (l /= h);
  const p = n.getExtent();
  if (!p || D_(p, s)) {
    const y = NT(n, l, s) / l;
    isFinite(y) && y > 0 && (l /= y);
  }
  return l;
}
function uQ(n, t, e, a) {
  const s = fm(e);
  let l = yS(
    n,
    t,
    s,
    a
  );
  return (!isFinite(l) || l <= 0) && e8(e, function(f) {
    return l = yS(
      n,
      t,
      f,
      a
    ), isFinite(l) && l > 0;
  }), l;
}
function z5(n, t, e, a, s, l, f, h, p, y, b, x, w, A) {
  const C = Pr(
    Math.round(e * n),
    Math.round(e * t),
    $1
  );
  if (x || (C.imageSmoothingEnabled = !1), p.length === 0)
    return C.canvas;
  C.scale(e, e);
  function L(z) {
    return Math.round(z * e) / e;
  }
  C.globalCompositeOperation = "lighter";
  const N = uu();
  p.forEach(function(z, Q, et) {
    l9(N, z.extent);
  });
  let U;
  const k = e / a, H = (x ? 1 : 1 + Math.pow(2, -24)) / k;
  (!w || p.length !== 1 || y !== 0) && (U = Pr(
    Math.round(Hn(N) * k),
    Math.round(Ir(N) * k),
    $1
  ), x || (U.imageSmoothingEnabled = !1), p.forEach(function(z, Q, et) {
    if (z.image.width > 0 && z.image.height > 0) {
      if (z.clipExtent) {
        U.save();
        const mt = (z.clipExtent[0] - N[0]) * k, St = -(z.clipExtent[3] - N[3]) * k, Ut = Hn(z.clipExtent) * k, Ft = Ir(z.clipExtent) * k;
        U.rect(
          x ? mt : Math.round(mt),
          x ? St : Math.round(St),
          x ? Ut : Math.round(mt + Ut) - Math.round(mt),
          x ? Ft : Math.round(St + Ft) - Math.round(St)
        ), U.clip();
      }
      const ot = (z.extent[0] - N[0]) * k, pt = -(z.extent[3] - N[3]) * k, ht = Hn(z.extent) * k, Ct = Ir(z.extent) * k;
      U.drawImage(
        z.image,
        y,
        y,
        z.image.width - 2 * y,
        z.image.height - 2 * y,
        x ? ot : Math.round(ot),
        x ? pt : Math.round(pt),
        x ? ht : Math.round(ot + ht) - Math.round(ot),
        x ? Ct : Math.round(pt + Ct) - Math.round(pt)
      ), z.clipExtent && U.restore();
    }
  }));
  const B = Y_(f);
  return h.getTriangles().forEach(function(z, Q, et) {
    const ot = z.source, pt = z.target;
    let ht = ot[0][0], Ct = ot[0][1], mt = ot[1][0], St = ot[1][1], Ut = ot[2][0], Ft = ot[2][1];
    const nt = L((pt[0][0] - B[0]) / l), J = L(
      -(pt[0][1] - B[1]) / l
    ), gt = L((pt[1][0] - B[0]) / l), Ot = L(
      -(pt[1][1] - B[1]) / l
    ), W = L((pt[2][0] - B[0]) / l), j = L(
      -(pt[2][1] - B[1]) / l
    ), X = ht, st = Ct;
    ht = 0, Ct = 0, mt -= X, St -= st, Ut -= X, Ft -= st;
    const At = [
      [mt, St, 0, 0, gt - nt],
      [Ut, Ft, 0, 0, W - nt],
      [0, 0, mt, St, Ot - J],
      [0, 0, Ut, Ft, j - J]
    ], Dt = m9(At);
    if (!Dt)
      return;
    if (C.save(), C.beginPath(), lQ() || !x) {
      C.moveTo(gt, Ot);
      const $t = 4, Qt = nt - gt, ee = J - Ot;
      for (let ce = 0; ce < $t; ce++)
        C.lineTo(
          gt + L((ce + 1) * Qt / $t),
          Ot + L(ce * ee / ($t - 1))
        ), ce != $t - 1 && C.lineTo(
          gt + L((ce + 1) * Qt / $t),
          Ot + L((ce + 1) * ee / ($t - 1))
        );
      C.lineTo(W, j);
    } else
      C.moveTo(gt, Ot), C.lineTo(nt, J), C.lineTo(W, j);
    C.clip(), C.transform(
      Dt[0],
      Dt[2],
      Dt[1],
      Dt[3],
      nt,
      J
    ), C.translate(
      N[0] - X,
      N[3] - st
    );
    let It;
    if (U)
      It = U.canvas, C.scale(H, -H);
    else {
      const $t = p[0], Qt = $t.extent;
      It = $t.image, C.scale(
        Hn(Qt) / It.width,
        -Ir(Qt) / It.height
      );
    }
    C.drawImage(It, 0, 0), C.restore();
  }), U && (Dw(U), $1.push(U.canvas)), b && (C.save(), C.globalCompositeOperation = "source-over", C.strokeStyle = "black", C.lineWidth = 1, h.getTriangles().forEach(function(z, Q, et) {
    const ot = z.target, pt = (ot[0][0] - B[0]) / l, ht = -(ot[0][1] - B[1]) / l, Ct = (ot[1][0] - B[0]) / l, mt = -(ot[1][1] - B[1]) / l, St = (ot[2][0] - B[0]) / l, Ut = -(ot[2][1] - B[1]) / l;
    C.beginPath(), C.moveTo(Ct, mt), C.lineTo(pt, ht), C.lineTo(St, Ut), C.closePath(), C.stroke();
  }), C.restore()), C.canvas;
}
const cQ = 10, IL = 0.25;
class G5 {
  /**
   * @param {import("../proj/Projection.js").default} sourceProj Source projection.
   * @param {import("../proj/Projection.js").default} targetProj Target projection.
   * @param {import("../extent.js").Extent} targetExtent Target extent to triangulate.
   * @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
   * @param {number} errorThreshold Acceptable error (in source units).
   * @param {?number} destinationResolution The (optional) resolution of the destination.
   * @param {import("../transform.js").Transform} [sourceMatrix] Source transform matrix.
   */
  constructor(t, e, a, s, l, f, h) {
    this.sourceProj_ = t, this.targetProj_ = e;
    let p = {};
    const y = h ? vM(
      (H) => Lr(
        h,
        gw(H, this.targetProj_, this.sourceProj_)
      )
    ) : Jb(this.targetProj_, this.sourceProj_);
    this.transformInv_ = function(H) {
      const B = H[0] + "/" + H[1];
      return p[B] || (p[B] = y(H)), p[B];
    }, this.maxSourceExtent_ = s, this.errorThresholdSquared_ = l * l, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!s && !!this.sourceProj_.getExtent() && Hn(s) >= Hn(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? Hn(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? Hn(this.targetProj_.getExtent()) : null;
    const b = Y_(a), x = cw(a), w = uw(a), A = lw(a), C = this.transformInv_(b), L = this.transformInv_(x), N = this.transformInv_(w), U = this.transformInv_(A), k = cQ + (f ? Math.max(
      0,
      Math.ceil(
        Math.log2(
          gM(a) / (f * f * 256 * 256)
        )
      )
    ) : 0);
    if (this.addQuad_(
      b,
      x,
      w,
      A,
      C,
      L,
      N,
      U,
      k
    ), this.wrapsXInSource_) {
      let H = 1 / 0;
      this.triangles_.forEach(function(B, z, Q) {
        H = Math.min(
          H,
          B.source[0][0],
          B.source[1][0],
          B.source[2][0]
        );
      }), this.triangles_.forEach((B) => {
        if (Math.max(
          B.source[0][0],
          B.source[1][0],
          B.source[2][0]
        ) - H > this.sourceWorldWidth_ / 2) {
          const z = [
            [B.source[0][0], B.source[0][1]],
            [B.source[1][0], B.source[1][1]],
            [B.source[2][0], B.source[2][1]]
          ];
          z[0][0] - H > this.sourceWorldWidth_ / 2 && (z[0][0] -= this.sourceWorldWidth_), z[1][0] - H > this.sourceWorldWidth_ / 2 && (z[1][0] -= this.sourceWorldWidth_), z[2][0] - H > this.sourceWorldWidth_ / 2 && (z[2][0] -= this.sourceWorldWidth_);
          const Q = Math.min(
            z[0][0],
            z[1][0],
            z[2][0]
          );
          Math.max(
            z[0][0],
            z[1][0],
            z[2][0]
          ) - Q < this.sourceWorldWidth_ / 2 && (B.source = z);
        }
      });
    }
    p = {};
  }
  /**
   * Adds triangle to the triangulation.
   * @param {import("../coordinate.js").Coordinate} a The target a coordinate.
   * @param {import("../coordinate.js").Coordinate} b The target b coordinate.
   * @param {import("../coordinate.js").Coordinate} c The target c coordinate.
   * @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
   * @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
   * @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
   * @private
   */
  addTriangle_(t, e, a, s, l, f) {
    this.triangles_.push({
      source: [s, l, f],
      target: [t, e, a]
    });
  }
  /**
   * Adds quad (points in clock-wise order) to the triangulation
   * (and reprojects the vertices) if valid.
   * Performs quad subdivision if needed to increase precision.
   *
   * @param {import("../coordinate.js").Coordinate} a The target a coordinate.
   * @param {import("../coordinate.js").Coordinate} b The target b coordinate.
   * @param {import("../coordinate.js").Coordinate} c The target c coordinate.
   * @param {import("../coordinate.js").Coordinate} d The target d coordinate.
   * @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
   * @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
   * @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
   * @param {import("../coordinate.js").Coordinate} dSrc The source d coordinate.
   * @param {number} maxSubdivision Maximal allowed subdivision of the quad.
   * @private
   */
  addQuad_(t, e, a, s, l, f, h, p, y) {
    const b = AT([l, f, h, p]), x = this.sourceWorldWidth_ ? Hn(b) / this.sourceWorldWidth_ : null, w = (
      /** @type {number} */
      this.sourceWorldWidth_
    ), A = this.sourceProj_.canWrapX() && x > 0.5 && x < 1;
    let C = !1;
    if (y > 0) {
      if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
        const N = AT([t, e, a, s]);
        C = Hn(N) / this.targetWorldWidth_ > IL || C;
      }
      !A && this.sourceProj_.isGlobal() && x && (C = x > IL || C);
    }
    if (!C && this.maxSourceExtent_ && isFinite(b[0]) && isFinite(b[1]) && isFinite(b[2]) && isFinite(b[3]) && !Co(b, this.maxSourceExtent_))
      return;
    let L = 0;
    if (!C && (!isFinite(l[0]) || !isFinite(l[1]) || !isFinite(f[0]) || !isFinite(f[1]) || !isFinite(h[0]) || !isFinite(h[1]) || !isFinite(p[0]) || !isFinite(p[1]))) {
      if (y > 0)
        C = !0;
      else if (L = (!isFinite(l[0]) || !isFinite(l[1]) ? 8 : 0) + (!isFinite(f[0]) || !isFinite(f[1]) ? 4 : 0) + (!isFinite(h[0]) || !isFinite(h[1]) ? 2 : 0) + (!isFinite(p[0]) || !isFinite(p[1]) ? 1 : 0), L != 1 && L != 2 && L != 4 && L != 8)
        return;
    }
    if (y > 0) {
      if (!C) {
        const N = [(t[0] + a[0]) / 2, (t[1] + a[1]) / 2], U = this.transformInv_(N);
        let k;
        A ? k = (w_(l[0], w) + w_(h[0], w)) / 2 - w_(U[0], w) : k = (l[0] + h[0]) / 2 - U[0];
        const H = (l[1] + h[1]) / 2 - U[1];
        C = k * k + H * H > this.errorThresholdSquared_;
      }
      if (C) {
        if (Math.abs(t[0] - a[0]) <= Math.abs(t[1] - a[1])) {
          const N = [(e[0] + a[0]) / 2, (e[1] + a[1]) / 2], U = this.transformInv_(N), k = [(s[0] + t[0]) / 2, (s[1] + t[1]) / 2], H = this.transformInv_(k);
          this.addQuad_(
            t,
            e,
            N,
            k,
            l,
            f,
            U,
            H,
            y - 1
          ), this.addQuad_(
            k,
            N,
            a,
            s,
            H,
            U,
            h,
            p,
            y - 1
          );
        } else {
          const N = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], U = this.transformInv_(N), k = [(a[0] + s[0]) / 2, (a[1] + s[1]) / 2], H = this.transformInv_(k);
          this.addQuad_(
            t,
            N,
            k,
            s,
            l,
            U,
            H,
            p,
            y - 1
          ), this.addQuad_(
            N,
            e,
            a,
            k,
            U,
            f,
            h,
            H,
            y - 1
          );
        }
        return;
      }
    }
    if (A) {
      if (!this.canWrapXInSource_)
        return;
      this.wrapsXInSource_ = !0;
    }
    (L & 11) == 0 && this.addTriangle_(t, a, s, l, h, p), (L & 14) == 0 && this.addTriangle_(t, a, e, l, h, f), L && ((L & 13) == 0 && this.addTriangle_(e, s, t, f, p, l), (L & 7) == 0 && this.addTriangle_(e, s, a, f, p, h));
  }
  /**
   * Calculates extent of the `source` coordinates from all the triangles.
   *
   * @return {import("../extent.js").Extent} Calculated extent.
   */
  calculateSourceExtent() {
    const t = uu();
    return this.triangles_.forEach(function(e, a, s) {
      const l = e.source;
      jb(t, l[0]), jb(t, l[1]), jb(t, l[2]);
    }), t;
  }
  /**
   * @return {Array<Triangle>} Array of the calculated triangles.
   */
  getTriangles() {
    return this.triangles_;
  }
}
const U5 = 0.5;
class j5 extends bO {
  /**
   * @param {import("../proj/Projection.js").default} sourceProj Source projection.
   * @param {import("../tilegrid/TileGrid.js").default} sourceTileGrid Source tile grid.
   * @param {import("../proj/Projection.js").default} targetProj Target projection.
   * @param {import("../tilegrid/TileGrid.js").default} targetTileGrid Target tile grid.
   * @param {import("../tilecoord.js").TileCoord} tileCoord Coordinate of the tile.
   * @param {import("../tilecoord.js").TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
   * @param {number} pixelRatio Pixel ratio.
   * @param {number} gutter Gutter of the source tiles.
   * @param {FunctionType} getTileFunction
   *     Function returning source tiles (z, x, y, pixelRatio).
   * @param {number} [errorThreshold] Acceptable reprojection error (in px).
   * @param {boolean} [renderEdges] Render reprojection edges.
   * @param {import("../Tile.js").Options} [options] Tile options.
   */
  constructor(t, e, a, s, l, f, h, p, y, b, x, w) {
    super(l, ze.IDLE, w), this.renderEdges_ = x !== void 0 ? x : !1, this.pixelRatio_ = h, this.gutter_ = p, this.canvas_ = null, this.sourceTileGrid_ = e, this.targetTileGrid_ = s, this.wrappedTileCoord_ = f || l, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0, this.clipExtent_ = t.canWrapX() ? t.getExtent() : void 0;
    const A = s.getTileCoordExtent(
      this.wrappedTileCoord_
    ), C = this.targetTileGrid_.getExtent();
    let L = this.sourceTileGrid_.getExtent();
    const N = C ? im(A, C) : A;
    if (gM(N) === 0) {
      this.state = ze.EMPTY;
      return;
    }
    const U = t.getExtent();
    U && (L ? L = im(L, U) : L = U);
    const k = s.getResolution(
      this.wrappedTileCoord_[0]
    ), H = uQ(
      t,
      a,
      N,
      k
    );
    if (!isFinite(H) || H <= 0) {
      this.state = ze.EMPTY;
      return;
    }
    const B = b !== void 0 ? b : U5;
    if (this.triangulation_ = new G5(
      t,
      a,
      N,
      L,
      H * B,
      k
    ), this.triangulation_.getTriangles().length === 0) {
      this.state = ze.EMPTY;
      return;
    }
    this.sourceZ_ = e.getZForResolution(H);
    let z = this.triangulation_.calculateSourceExtent();
    if (L && (t.canWrapX() ? (z[1] = ra(
      z[1],
      L[1],
      L[3]
    ), z[3] = ra(
      z[3],
      L[1],
      L[3]
    )) : z = im(z, L)), !gM(z))
      this.state = ze.EMPTY;
    else {
      let Q = 0, et = 0;
      t.canWrapX() && (Q = Hn(U), et = Math.floor(
        (z[0] - U[0]) / Q
      )), a8(
        z.slice(),
        t,
        !0
      ).forEach((pt) => {
        const ht = e.getTileRangeForExtentAndZ(
          pt,
          this.sourceZ_
        );
        for (let Ct = ht.minX; Ct <= ht.maxX; Ct++)
          for (let mt = ht.minY; mt <= ht.maxY; mt++) {
            const St = y(this.sourceZ_, Ct, mt, h);
            if (St) {
              const Ut = et * Q;
              this.sourceTiles_.push({ tile: St, offset: Ut });
            }
          }
        ++et;
      }), this.sourceTiles_.length === 0 && (this.state = ze.EMPTY);
    }
  }
  /**
   * Get the HTML Canvas element for this tile.
   * @return {HTMLCanvasElement} Canvas.
   */
  getImage() {
    return this.canvas_;
  }
  /**
   * @private
   */
  reproject_() {
    const t = [];
    if (this.sourceTiles_.forEach((e) => {
      const a = e.tile;
      if (a && a.getState() == ze.LOADED) {
        const s = this.sourceTileGrid_.getTileCoordExtent(a.tileCoord);
        s[0] += e.offset, s[2] += e.offset;
        const l = this.clipExtent_?.slice();
        l && (l[0] += e.offset, l[2] += e.offset), t.push({
          extent: s,
          clipExtent: l,
          image: a.getImage()
        });
      }
    }), this.sourceTiles_.length = 0, t.length === 0)
      this.state = ze.ERROR;
    else {
      const e = this.wrappedTileCoord_[0], a = this.targetTileGrid_.getTileSize(e), s = typeof a == "number" ? a : a[0], l = typeof a == "number" ? a : a[1], f = this.targetTileGrid_.getResolution(e), h = this.sourceTileGrid_.getResolution(
        this.sourceZ_
      ), p = this.targetTileGrid_.getTileCoordExtent(
        this.wrappedTileCoord_
      );
      this.canvas_ = z5(
        s,
        l,
        this.pixelRatio_,
        h,
        this.sourceTileGrid_.getExtent(),
        f,
        p,
        this.triangulation_,
        t,
        this.gutter_,
        this.renderEdges_,
        this.interpolate
      ), this.state = ze.LOADED;
    }
    this.changed();
  }
  /**
   * Load not yet loaded URI.
   * @override
   */
  load() {
    if (this.state == ze.IDLE) {
      this.state = ze.LOADING, this.changed();
      let t = 0;
      this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(({ tile: e }) => {
        const a = e.getState();
        if (a == ze.IDLE || a == ze.LOADING) {
          t++;
          const s = Fn(e, ln.CHANGE, (l) => {
            const f = e.getState();
            (f == ze.LOADED || f == ze.ERROR || f == ze.EMPTY) && (Xi(s), t--, t === 0 && (this.unlistenSources_(), this.reproject_()));
          });
          this.sourcesListenerKeys_.push(s);
        }
      }), t === 0 ? setTimeout(this.reproject_.bind(this), 0) : this.sourceTiles_.forEach(function({ tile: e }, a, s) {
        e.getState() == ze.IDLE && e.load();
      });
    }
  }
  /**
   * @private
   */
  unlistenSources_() {
    this.sourcesListenerKeys_.forEach(Xi), this.sourcesListenerKeys_ = null;
  }
  /**
   * Remove from the cache due to expiry
   * @override
   */
  release() {
    this.canvas_ && (Dw(this.canvas_.getContext("2d")), $1.push(this.canvas_), this.canvas_ = null), super.release();
  }
}
class fQ {
  /**
   * @param {number} [highWaterMark] High water mark.
   */
  constructor(t) {
    this.highWaterMark = t !== void 0 ? t : 2048, this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null;
  }
  deleteOldest() {
    const t = this.pop();
    t instanceof Mw && t.dispose();
  }
  /**
   * @return {boolean} Can expire cache.
   */
  canExpireCache() {
    return this.highWaterMark > 0 && this.getCount() > this.highWaterMark;
  }
  /**
   * Expire the cache. When the cache entry is a {@link module:ol/Disposable~Disposable},
   * the entry will be disposed.
   * @param {!Object<string, boolean>} [keep] Keys to keep. To be implemented by subclasses.
   */
  expireCache(t) {
    for (; this.canExpireCache(); )
      this.deleteOldest();
  }
  /**
   * FIXME empty description for jsdoc
   */
  clear() {
    for (; this.oldest_; )
      this.deleteOldest();
  }
  /**
   * @param {string} key Key.
   * @return {boolean} Contains key.
   */
  containsKey(t) {
    return this.entries_.hasOwnProperty(t);
  }
  /**
   * @param {function(T, string, LRUCache<T>): ?} f The function
   *     to call for every entry from the oldest to the newer. This function takes
   *     3 arguments (the entry value, the entry key and the LRUCache object).
   *     The return value is ignored.
   */
  forEach(t) {
    let e = this.oldest_;
    for (; e; )
      t(e.value_, e.key_, this), e = e.newer;
  }
  /**
   * @param {string} key Key.
   * @param {*} [options] Options (reserved for subclasses).
   * @return {T} Value.
   */
  get(t, e) {
    const a = this.entries_[t];
    return Ei(
      a !== void 0,
      "Tried to get a value for a key that does not exist in the cache"
    ), a === this.newest_ || (a === this.oldest_ ? (this.oldest_ = /** @type {Entry} */
    this.oldest_.newer, this.oldest_.older = null) : (a.newer.older = a.older, a.older.newer = a.newer), a.newer = null, a.older = this.newest_, this.newest_.newer = a, this.newest_ = a), a.value_;
  }
  /**
   * Remove an entry from the cache.
   * @param {string} key The entry key.
   * @return {T} The removed entry.
   */
  remove(t) {
    const e = this.entries_[t];
    return Ei(
      e !== void 0,
      "Tried to get a value for a key that does not exist in the cache"
    ), e === this.newest_ ? (this.newest_ = /** @type {Entry} */
    e.older, this.newest_ && (this.newest_.newer = null)) : e === this.oldest_ ? (this.oldest_ = /** @type {Entry} */
    e.newer, this.oldest_ && (this.oldest_.older = null)) : (e.newer.older = e.older, e.older.newer = e.newer), delete this.entries_[t], --this.count_, e.value_;
  }
  /**
   * @return {number} Count.
   */
  getCount() {
    return this.count_;
  }
  /**
   * @return {Array<string>} Keys.
   */
  getKeys() {
    const t = new Array(this.count_);
    let e = 0, a;
    for (a = this.newest_; a; a = a.older)
      t[e++] = a.key_;
    return t;
  }
  /**
   * @return {Array<T>} Values.
   */
  getValues() {
    const t = new Array(this.count_);
    let e = 0, a;
    for (a = this.newest_; a; a = a.older)
      t[e++] = a.value_;
    return t;
  }
  /**
   * @return {T} Last value.
   */
  peekLast() {
    return this.oldest_.value_;
  }
  /**
   * @return {string} Last key.
   */
  peekLastKey() {
    return this.oldest_.key_;
  }
  /**
   * Get the key of the newest item in the cache.  Throws if the cache is empty.
   * @return {string} The newest key.
   */
  peekFirstKey() {
    return this.newest_.key_;
  }
  /**
   * Return an entry without updating least recently used time.
   * @param {string} key Key.
   * @return {T|undefined} Value.
   */
  peek(t) {
    return this.entries_[t]?.value_;
  }
  /**
   * @return {T} value Value.
   */
  pop() {
    const t = this.oldest_;
    return delete this.entries_[t.key_], t.newer && (t.newer.older = null), this.oldest_ = /** @type {Entry} */
    t.newer, this.oldest_ || (this.newest_ = null), --this.count_, t.value_;
  }
  /**
   * @param {string} key Key.
   * @param {T} value Value.
   */
  replace(t, e) {
    this.get(t), this.entries_[t].value_ = e;
  }
  /**
   * @param {string} key Key.
   * @param {T} value Value.
   */
  set(t, e) {
    Ei(
      !(t in this.entries_),
      "Tried to set a value for a key that is used already"
    );
    const a = {
      key_: t,
      newer: null,
      older: this.newest_,
      value_: e
    };
    this.newest_ ? this.newest_.newer = a : this.oldest_ = a, this.newest_ = a, this.entries_[t] = a, ++this.count_;
  }
  /**
   * Set a maximum number of entries for the cache.
   * @param {number} size Cache size.
   * @api
   */
  setSize(t) {
    this.highWaterMark = t;
  }
}
function iw(n, t, e, a) {
  return a !== void 0 ? (a[0] = n, a[1] = t, a[2] = e, a) : [n, t, e];
}
function hQ(n, t, e) {
  return n + "/" + t + "/" + e;
}
function k5(n) {
  return dQ(n[0], n[1], n[2]);
}
function dQ(n, t, e) {
  return (t << n) + e;
}
function gQ(n, t) {
  const e = n[0], a = n[1], s = n[2];
  if (t.getMinZoom() > e || e > t.getMaxZoom())
    return !1;
  const l = t.getFullTileRange(e);
  return l ? l.containsXY(a, s) : !0;
}
function iM(n, t, e, a, s) {
  return `${si(n)},${t},${hQ(e, a, s)}`;
}
function aM(n, t, e) {
  if (!(e in n))
    return n[e] = /* @__PURE__ */ new Set([t]), !0;
  const a = n[e], s = a.has(t);
  return s || a.add(t), !s;
}
function mQ(n, t, e) {
  const a = n[e];
  return a ? a.delete(t) : !1;
}
function PL(n, t) {
  const e = n.layerStatesArray[n.layerIndex];
  e.extent && (t = im(
    t,
    id(e.extent, n.viewState.projection)
  ));
  const a = (
    /** @type {import("../../source/Tile.js").default} */
    e.layer.getRenderSource()
  );
  if (!a.getWrapX()) {
    const s = a.getTileGridForProjection(n.viewState.projection).getExtent();
    s && (t = im(t, s));
  }
  return t;
}
class pQ extends dO {
  /**
   * @param {LayerType} tileLayer Tile layer.
   * @param {Options} [options] Options.
   */
  constructor(t, e) {
    super(t), e = e || {}, this.extentChanged = !0, this.renderComplete = !1, this.renderedExtent_ = null, this.renderedPixelRatio, this.renderedProjection = null, this.renderedTiles = [], this.renderedSourceKey_, this.renderedSourceRevision_, this.tempExtent = uu(), this.tempTileRange_ = new TO(0, 0, 0, 0), this.tempTileCoord_ = iw(0, 0, 0);
    const a = e.cacheSize !== void 0 ? e.cacheSize : 512;
    this.tileCache_ = new fQ(a), this.maxStaleKeys = a * 0.5;
  }
  /**
   * @return {LRUCache} Tile cache.
   */
  getTileCache() {
    return this.tileCache_;
  }
  /**
   * Get a tile from the cache or create one if needed.
   *
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {import("../../Tile.js").default|null} Tile (or null if outside source extent).
   * @protected
   */
  getOrCreateTile(t, e, a, s) {
    const l = this.tileCache_, h = this.getLayer().getSource(), p = iM(h, h.getKey(), t, e, a);
    let y;
    if (l.containsKey(p))
      y = l.get(p);
    else {
      if (y = h.getTile(
        t,
        e,
        a,
        s.pixelRatio,
        s.viewState.projection
      ), !y)
        return null;
      l.set(p, y);
    }
    return y;
  }
  /**
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {import("../../Tile.js").default|null} Tile (or null if outside source extent).
   * @protected
   */
  getTile(t, e, a, s) {
    const l = this.getOrCreateTile(t, e, a, s);
    return l || null;
  }
  /**
   * @param {import("../../pixel.js").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray} Data at the pixel location.
   * @override
   */
  getData(t) {
    const e = this.frameState;
    if (!e)
      return null;
    const a = this.getLayer(), s = Lr(
      e.pixelToCoordinateTransform,
      t.slice()
    ), l = a.getExtent();
    if (l && !D_(l, s))
      return null;
    const f = e.viewState, h = a.getRenderSource(), p = h.getTileGridForProjection(f.projection), y = h.getTilePixelRatio(e.pixelRatio);
    for (let b = p.getZForResolution(f.resolution); b >= p.getMinZoom(); --b) {
      const x = p.getTileCoordForCoordAndZ(s, b), w = this.getTile(b, x[1], x[2], e);
      if (!w || w.getState() !== ze.LOADED)
        continue;
      const A = p.getOrigin(b), C = ml(p.getTileSize(b)), L = p.getResolution(b);
      let N;
      if (w instanceof E5 || w instanceof j5)
        N = w.getImage();
      else if (w instanceof NL) {
        if (N = eC(w.getData()), !N)
          continue;
      } else
        continue;
      const U = Math.floor(
        y * ((s[0] - A[0]) / L - x[1] * C[0])
      ), k = Math.floor(
        y * ((A[1] - s[1]) / L - x[2] * C[1])
      ), H = Math.round(
        y * h.getGutterForProjection(f.projection)
      );
      return this.getImageData(N, U + H, k + H);
    }
    return null;
  }
  /**
   * Determine whether render should be called.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @return {boolean} Layer is ready to be rendered.
   * @override
   */
  prepareFrame(t) {
    this.renderedProjection ? t.viewState.projection !== this.renderedProjection && (this.tileCache_.clear(), this.renderedProjection = t.viewState.projection) : this.renderedProjection = t.viewState.projection;
    const e = this.getLayer().getSource();
    if (!e)
      return !1;
    const a = e.getRevision();
    return this.renderedSourceRevision_ ? this.renderedSourceRevision_ !== a && (this.renderedSourceRevision_ = a, this.renderedSourceKey_ === e.getKey() && this.tileCache_.clear()) : this.renderedSourceRevision_ = a, !0;
  }
  /**
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {import("../../extent.js").Extent} extent The extent to be rendered.
   * @param {number} initialZ The zoom level.
   * @param {TileLookup} tilesByZ Lookup of tiles by zoom level.
   * @param {number} preload Number of additional levels to load.
   */
  enqueueTiles(t, e, a, s, l) {
    const f = t.viewState, h = this.getLayer(), p = h.getRenderSource(), y = p.getTileGridForProjection(f.projection), b = si(p);
    b in t.wantedTiles || (t.wantedTiles[b] = {});
    const x = t.wantedTiles[b], w = h.getMapInternal(), A = Math.max(
      a - l,
      y.getMinZoom(),
      y.getZForResolution(
        Math.min(
          h.getMaxResolution(),
          w ? w.getView().getResolutionForZoom(Math.max(h.getMinZoom(), 0)) : y.getResolution(0)
        ),
        p.zDirection
      )
    ), C = f.rotation, L = C ? n8(
      f.center,
      f.resolution,
      C,
      t.size
    ) : void 0;
    for (let N = a; N >= A; --N) {
      const U = y.getTileRangeForExtentAndZ(
        e,
        N,
        this.tempTileRange_
      ), k = y.getResolution(N);
      for (let H = U.minX; H <= U.maxX; ++H)
        for (let B = U.minY; B <= U.maxY; ++B) {
          if (C && !y.tileCoordIntersectsViewport([N, H, B], L))
            continue;
          const z = this.getTile(N, H, B, t);
          if (!z || !aM(s, z, N))
            continue;
          const et = z.getKey();
          if (x[et] = !0, z.getState() === ze.IDLE && !t.tileQueue.isKeyQueued(et)) {
            const ot = iw(N, H, B, this.tempTileCoord_);
            t.tileQueue.enqueue([
              z,
              b,
              y.getTileCoordCenter(ot),
              k
            ]);
          }
        }
    }
  }
  /**
   * Look for tiles covering the provided tile coordinate at an alternate
   * zoom level.  Loaded tiles will be added to the provided tile texture lookup.
   * @param {import("../../tilecoord.js").TileCoord} tileCoord The target tile coordinate.
   * @param {TileLookup} tilesByZ Lookup of tiles by zoom level.
   * @return {boolean} The tile coordinate is covered by loaded tiles at the alternate zoom level.
   * @private
   */
  findStaleTile_(t, e) {
    const a = this.tileCache_, s = t[0], l = t[1], f = t[2], h = this.getStaleKeys();
    for (let p = 0; p < h.length; ++p) {
      const y = iM(
        this.getLayer().getSource(),
        h[p],
        s,
        l,
        f
      );
      if (a.containsKey(y)) {
        const b = a.peek(y);
        if (b.getState() === ze.LOADED)
          return b.endTransition(si(this)), aM(e, b, s), !0;
      }
    }
    return !1;
  }
  /**
   * Look for tiles covering the provided tile coordinate at an alternate
   * zoom level.  Loaded tiles will be added to the provided tile texture lookup.
   * @param {import("../../tilegrid/TileGrid.js").default} tileGrid The tile grid.
   * @param {import("../../tilecoord.js").TileCoord} tileCoord The target tile coordinate.
   * @param {number} altZ The alternate zoom level.
   * @param {TileLookup} tilesByZ Lookup of tiles by zoom level.
   * @return {boolean} The tile coordinate is covered by loaded tiles at the alternate zoom level.
   * @private
   */
  findAltTiles_(t, e, a, s) {
    const l = t.getTileRangeForTileCoordAndZ(
      e,
      a,
      this.tempTileRange_
    );
    if (!l)
      return !1;
    let f = !0;
    const h = this.tileCache_, p = this.getLayer().getRenderSource(), y = p.getKey();
    for (let b = l.minX; b <= l.maxX; ++b)
      for (let x = l.minY; x <= l.maxY; ++x) {
        const w = iM(p, y, a, b, x);
        let A = !1;
        if (h.containsKey(w)) {
          const C = h.peek(w);
          C.getState() === ze.LOADED && (aM(s, C, a), A = !0);
        }
        A || (f = !1);
      }
    return f;
  }
  /**
   * Render the layer.
   *
   * The frame rendering logic has three parts:
   *
   *  1. Enqueue tiles
   *  2. Find alt tiles for those that are not yet loaded
   *  3. Render loaded tiles
   *
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {HTMLElement} target Target that may be used to render content to.
   * @return {HTMLElement} The rendered element.
   * @override
   */
  renderFrame(t, e) {
    this.renderComplete = !0;
    const a = t.layerStatesArray[t.layerIndex], s = t.viewState, l = s.projection, f = s.resolution, h = s.center, p = t.pixelRatio, y = this.getLayer(), b = y.getSource(), x = b.getTileGridForProjection(l), w = x.getZForResolution(f, b.zDirection), A = x.getResolution(w), C = b.getKey();
    this.renderedSourceKey_ ? this.renderedSourceKey_ !== C && (this.prependStaleKey(this.renderedSourceKey_), this.renderedSourceKey_ = C) : this.renderedSourceKey_ = C;
    let L = t.extent;
    const N = b.getTilePixelRatio(p);
    this.prepareContainer(t, e);
    const U = this.context.canvas.width, k = this.context.canvas.height, H = a.extent && id(a.extent);
    H && (L = im(
      L,
      id(a.extent)
    ));
    const B = A * U / 2 / N, z = A * k / 2 / N, Q = [
      h[0] - B,
      h[1] - z,
      h[0] + B,
      h[1] + z
    ], et = {};
    this.renderedTiles.length = 0;
    const ot = y.getPreload();
    if (t.nextExtent) {
      const gt = x.getZForResolution(
        s.nextResolution,
        b.zDirection
      ), Ot = PL(t, t.nextExtent);
      this.enqueueTiles(t, Ot, gt, et, ot);
    }
    const pt = PL(t, L);
    if (this.enqueueTiles(t, pt, w, et, 0), ot > 0 && setTimeout(() => {
      this.enqueueTiles(
        t,
        pt,
        w - 1,
        et,
        ot - 1
      );
    }, 0), !(w in et))
      return this.container;
    const ht = si(this), Ct = t.time;
    for (const gt of et[w]) {
      const Ot = gt.getState();
      if (Ot === ze.EMPTY)
        continue;
      const W = gt.tileCoord;
      if (Ot === ze.LOADED && gt.getAlpha(ht, Ct) === 1) {
        gt.endTransition(ht);
        continue;
      }
      if (Ot !== ze.ERROR && (this.renderComplete = !1), this.findStaleTile_(W, et)) {
        mQ(et, gt, w), t.animate = !0;
        continue;
      }
      if (this.findAltTiles_(
        x,
        W,
        w + 1,
        et
      ))
        continue;
      const st = x.getMinZoom();
      for (let At = w - 1; At >= st && !this.findAltTiles_(
        x,
        W,
        At,
        et
      ); --At)
        ;
    }
    const mt = A / f * p / N, St = this.getRenderContext(t);
    fd(
      this.tempTransform,
      U / 2,
      k / 2,
      mt,
      mt,
      0,
      -U / 2,
      -k / 2
    ), a.extent && this.clipUnrotated(St, t, H), b.getInterpolate() || (St.imageSmoothingEnabled = !1), this.preRender(St, t);
    const Ut = Object.keys(et).map(Number);
    Ut.sort(sm);
    let Ft;
    const nt = [], J = [];
    for (let gt = Ut.length - 1; gt >= 0; --gt) {
      const Ot = Ut[gt], W = b.getTilePixelSize(
        Ot,
        p,
        l
      ), X = x.getResolution(Ot) / A, st = W[0] * X * mt, At = W[1] * X * mt, Dt = x.getTileCoordForCoordAndZ(
        Y_(Q),
        Ot
      ), It = x.getTileCoordExtent(Dt), $t = Lr(this.tempTransform, [
        N * (It[0] - Q[0]) / A,
        N * (Q[3] - It[3]) / A
      ]), Qt = N * b.getGutterForProjection(l);
      for (const ee of et[Ot]) {
        if (ee.getState() !== ze.LOADED)
          continue;
        const ce = ee.tileCoord, pe = Dt[1] - ce[1], Mn = Math.round($t[0] - (pe - 1) * st), te = Dt[2] - ce[2], tn = Math.round($t[1] - (te - 1) * At), Jn = Math.round($t[0] - pe * st), Pi = Math.round($t[1] - te * At), Ge = Mn - Jn, pa = tn - Pi, ka = Ut.length === 1;
        let Ai = !1;
        Ft = [Jn, Pi, Jn + Ge, Pi, Jn + Ge, Pi + pa, Jn, Pi + pa];
        for (let fe = 0, Zi = nt.length; fe < Zi; ++fe)
          if (!ka && Ot < J[fe]) {
            const Dn = nt[fe];
            Co(
              [Jn, Pi, Jn + Ge, Pi + pa],
              [Dn[0], Dn[3], Dn[4], Dn[7]]
            ) && (Ai || (St.save(), Ai = !0), St.beginPath(), St.moveTo(Ft[0], Ft[1]), St.lineTo(Ft[2], Ft[3]), St.lineTo(Ft[4], Ft[5]), St.lineTo(Ft[6], Ft[7]), St.moveTo(Dn[6], Dn[7]), St.lineTo(Dn[4], Dn[5]), St.lineTo(Dn[2], Dn[3]), St.lineTo(Dn[0], Dn[1]), St.clip());
          }
        nt.push(Ft), J.push(Ot), this.drawTile(ee, t, Jn, Pi, Ge, pa, Qt, ka), Ai && St.restore(), this.renderedTiles.unshift(ee), this.updateUsedTiles(t.usedTiles, b, ee);
      }
    }
    if (this.renderedResolution = A, this.extentChanged = !this.renderedExtent_ || !K1(this.renderedExtent_, Q), this.renderedExtent_ = Q, this.renderedPixelRatio = p, this.postRender(this.context, t), a.extent && St.restore(), St.imageSmoothingEnabled = !0, this.renderComplete) {
      const gt = (Ot, W) => {
        const j = si(b), X = W.wantedTiles[j], st = X ? Object.keys(X).length : 0;
        this.updateCacheSize(st), this.tileCache_.expireCache();
      };
      t.postRenderFunctions.push(gt);
    }
    return this.container;
  }
  /**
   * Increases the cache size if needed
   * @param {number} tileCount Minimum number of tiles needed.
   */
  updateCacheSize(t) {
    this.tileCache_.highWaterMark = Math.max(
      this.tileCache_.highWaterMark,
      t * 2
    );
  }
  /**
   * @param {import("../../Tile.js").default} tile Tile.
   * @param {import("../../Map.js").FrameState} frameState Frame state.
   * @param {number} x Left of the tile.
   * @param {number} y Top of the tile.
   * @param {number} w Width of the tile.
   * @param {number} h Height of the tile.
   * @param {number} gutter Tile gutter.
   * @param {boolean} transition Apply an alpha transition.
   * @protected
   */
  drawTile(t, e, a, s, l, f, h, p) {
    let y;
    if (t instanceof NL) {
      if (y = eC(t.getData()), !y)
        throw new Error("Rendering array data is not yet supported");
    } else
      y = this.getTileImage(
        /** @type {import("../../ImageTile.js").default} */
        t
      );
    if (!y)
      return;
    const b = this.getRenderContext(e), x = si(this), w = e.layerStatesArray[e.layerIndex], A = w.opacity * (p ? t.getAlpha(x, e.time) : 1), C = A !== b.globalAlpha;
    C && (b.save(), b.globalAlpha = A), b.drawImage(
      y,
      h,
      h,
      y.width - 2 * h,
      y.height - 2 * h,
      a,
      s,
      l,
      f
    ), C && b.restore(), A !== w.opacity ? e.animate = !0 : p && t.endTransition(x);
  }
  /**
   * @return {HTMLCanvasElement} Image
   */
  getImage() {
    const t = this.context;
    return t ? t.canvas : null;
  }
  /**
   * Get the image from a tile.
   * @param {import("../../ImageTile.js").default} tile Tile.
   * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.
   * @protected
   */
  getTileImage(t) {
    return t.getImage();
  }
  /**
   * @param {!Object<string, !Object<string, boolean>>} usedTiles Used tiles.
   * @param {import("../../source/Tile.js").default} tileSource Tile source.
   * @param {import('../../Tile.js').default} tile Tile.
   * @protected
   */
  updateUsedTiles(t, e, a) {
    const s = si(e);
    s in t || (t[s] = {}), t[s][a.getKey()] = !0;
  }
}
const cT = {
  PRELOAD: "preload",
  USE_INTERIM_TILES_ON_ERROR: "useInterimTilesOnError"
};
class yQ extends VS {
  /**
   * @param {Options<TileSourceType>} [options] Tile layer options.
   */
  constructor(t) {
    t = t || {};
    const e = Object.assign({}, t), a = t.cacheSize;
    delete t.cacheSize, delete e.preload, delete e.useInterimTilesOnError, super(e), this.on, this.once, this.un, this.cacheSize_ = a, this.setPreload(t.preload !== void 0 ? t.preload : 0), this.setUseInterimTilesOnError(
      t.useInterimTilesOnError !== void 0 ? t.useInterimTilesOnError : !0
    );
  }
  /**
   * @return {number|undefined} The suggested cache size
   * @protected
   */
  getCacheSize() {
    return this.cacheSize_;
  }
  /**
   * Return the level as number to which we will preload tiles up to.
   * @return {number} The level to preload tiles up to.
   * @observable
   * @api
   */
  getPreload() {
    return (
      /** @type {number} */
      this.get(cT.PRELOAD)
    );
  }
  /**
   * Set the level as number to which we will preload tiles up to.
   * @param {number} preload The level to preload tiles up to.
   * @observable
   * @api
   */
  setPreload(t) {
    this.set(cT.PRELOAD, t);
  }
  /**
   * Deprecated.  Whether we use interim tiles on error.
   * @return {boolean} Use interim tiles on error.
   * @observable
   * @api
   */
  getUseInterimTilesOnError() {
    return (
      /** @type {boolean} */
      this.get(cT.USE_INTERIM_TILES_ON_ERROR)
    );
  }
  /**
   * Deprecated.  Set whether we use interim tiles on error.
   * @param {boolean} useInterimTilesOnError Use interim tiles on error.
   * @observable
   * @api
   */
  setUseInterimTilesOnError(t) {
    this.set(cT.USE_INTERIM_TILES_ON_ERROR, t);
  }
  /**
   * Get data for a pixel location.  The return type depends on the source data.  For image tiles,
   * a four element RGBA array will be returned.  For data tiles, the array length will match the
   * number of bands in the dataset.  For requests outside the layer extent, `null` will be returned.
   * Data for a image tiles can only be retrieved if the source's `crossOrigin` property is set.
   *
   * ```js
   * // display layer data on every pointer move
   * map.on('pointermove', (event) => {
   *   console.log(layer.getData(event.pixel));
   * });
   * ```
   * @param {import("../pixel").Pixel} pixel Pixel.
   * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
   * @api
   * @override
   */
  getData(t) {
    return super.getData(t);
  }
}
class nC extends yQ {
  /**
   * @param {import("./BaseTile.js").Options<TileSourceType>} [options] Tile layer options.
   */
  constructor(t) {
    super(t);
  }
  /**
   * @override
   */
  createRenderer() {
    return new pQ(this, {
      cacheSize: this.getCacheSize()
    });
  }
}
function iC(n) {
  return Array.isArray(n) ? Math.min(...n) : n;
}
class _Q extends $2 {
  /**
   * @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
   * @param {import("../proj/Projection.js").default} targetProj Target projection.
   * @param {import("../extent.js").Extent} targetExtent Target extent.
   * @param {number} targetResolution Target resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {FunctionType} getImageFunction
   *     Function returning source images (extent, resolution, pixelRatio).
   * @param {boolean} interpolate Use linear interpolation when resampling.
   */
  constructor(t, e, a, s, l, f, h) {
    let p = t.getExtent();
    p && t.canWrapX() && (p = p.slice(), p[0] = -1 / 0, p[2] = 1 / 0);
    let y = e.getExtent();
    y && e.canWrapX() && (y = y.slice(), y[0] = -1 / 0, y[2] = 1 / 0);
    const b = y ? im(a, y) : a, x = fm(b), w = yS(
      t,
      e,
      x,
      s
    ), A = U5, C = new G5(
      t,
      e,
      b,
      p,
      w * A,
      s
    ), L = C.calculateSourceExtent(), N = F_(L) ? null : f(L, w, l), U = N ? xe.IDLE : xe.EMPTY, k = N ? N.getPixelRatio() : 1;
    super(a, s, k, U), this.targetProj_ = e, this.maxSourceExtent_ = p, this.triangulation_ = C, this.targetResolution_ = s, this.targetExtent_ = a, this.sourceImage_ = N, this.sourcePixelRatio_ = k, this.interpolate_ = h, this.canvas_ = null, this.sourceListenerKey_ = null;
  }
  /**
   * Clean up.
   * @override
   */
  disposeInternal() {
    this.state == xe.LOADING && this.unlistenSource_(), super.disposeInternal();
  }
  /**
   * @return {HTMLCanvasElement} Image.
   * @override
   */
  getImage() {
    return this.canvas_;
  }
  /**
   * @return {import("../proj/Projection.js").default} Projection.
   */
  getProjection() {
    return this.targetProj_;
  }
  /**
   * @private
   */
  reproject_() {
    const t = this.sourceImage_.getState();
    if (t == xe.LOADED) {
      const e = Hn(this.targetExtent_) / this.targetResolution_, a = Ir(this.targetExtent_) / this.targetResolution_;
      this.canvas_ = z5(
        e,
        a,
        this.sourcePixelRatio_,
        iC(this.sourceImage_.getResolution()),
        this.maxSourceExtent_,
        this.targetResolution_,
        this.targetExtent_,
        this.triangulation_,
        [
          {
            extent: this.sourceImage_.getExtent(),
            image: this.sourceImage_.getImage()
          }
        ],
        0,
        void 0,
        this.interpolate_,
        !0
      );
    }
    this.state = t, this.changed();
  }
  /**
   * Load not yet loaded URI.
   * @override
   */
  load() {
    if (this.state == xe.IDLE) {
      this.state = xe.LOADING, this.changed();
      const t = this.sourceImage_.getState();
      t == xe.LOADED || t == xe.ERROR ? this.reproject_() : (this.sourceListenerKey_ = Fn(
        this.sourceImage_,
        ln.CHANGE,
        (e) => {
          const a = this.sourceImage_.getState();
          (a == xe.LOADED || a == xe.ERROR) && (this.unlistenSource_(), this.reproject_());
        }
      ), this.sourceImage_.load());
    }
  }
  /**
   * @private
   */
  unlistenSource_() {
    Xi(
      /** @type {!import("../events.js").EventsKey} */
      this.sourceListenerKey_
    ), this.sourceListenerKey_ = null;
  }
}
const p0 = 4, rM = {
  /**
   * Triggered when an image starts loading.
   * @event module:ol/source/Image.ImageSourceEvent#imageloadstart
   * @api
   */
  IMAGELOADSTART: "imageloadstart",
  /**
   * Triggered when an image finishes loading.
   * @event module:ol/source/Image.ImageSourceEvent#imageloadend
   * @api
   */
  IMAGELOADEND: "imageloadend",
  /**
   * Triggered if image loading results in an error.
   * @event module:ol/source/Image.ImageSourceEvent#imageloaderror
   * @api
   */
  IMAGELOADERROR: "imageloaderror"
};
class vQ extends dd {
  /**
   * @param {string} type Type.
   * @param {import("../Image.js").default} image The image.
   */
  constructor(t, e) {
    super(t), this.image = e;
  }
}
class EQ extends fO {
  /**
   * @param {Options} options Single image source options.
   */
  constructor(t) {
    super({
      attributions: t.attributions,
      projection: t.projection,
      state: t.state,
      interpolate: t.interpolate !== void 0 ? t.interpolate : !0
    }), this.on, this.once, this.un, this.loader = t.loader || null, this.resolutions_ = t.resolutions !== void 0 ? t.resolutions : null, this.reprojectedImage_ = null, this.reprojectedRevision_ = 0, this.image = null, this.wantedExtent_, this.wantedResolution_, this.static_ = t.loader ? t.loader.length === 0 : !1, this.wantedProjection_ = null;
  }
  /**
   * @return {Array<number>|null} Resolutions.
   * @override
   */
  getResolutions() {
    return this.resolutions_;
  }
  /**
   * @param {Array<number>|null} resolutions Resolutions.
   */
  setResolutions(t) {
    this.resolutions_ = t;
  }
  /**
   * @protected
   * @param {number} resolution Resolution.
   * @return {number} Resolution.
   */
  findNearestResolution(t) {
    const e = this.getResolutions();
    if (e) {
      const a = Cw(e, t, 0);
      t = e[a];
    }
    return t;
  }
  /**
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {import("../Image.js").default} Single image.
   */
  getImage(t, e, a, s) {
    const l = this.getProjection();
    if (!l || !s || R_(l, s))
      return l && (s = l), this.getImageInternal(t, e, a, s);
    if (this.reprojectedImage_) {
      if (this.reprojectedRevision_ == this.getRevision() && R_(this.reprojectedImage_.getProjection(), s) && this.reprojectedImage_.getResolution() == e && K1(this.reprojectedImage_.getExtent(), t))
        return this.reprojectedImage_;
      this.reprojectedImage_.dispose(), this.reprojectedImage_ = null;
    }
    return this.reprojectedImage_ = new _Q(
      l,
      s,
      t,
      e,
      a,
      (f, h, p) => this.getImageInternal(f, h, p, l),
      this.getInterpolate()
    ), this.reprojectedRevision_ = this.getRevision(), this.reprojectedImage_;
  }
  /**
   * @abstract
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {import("../Image.js").default} Single image.
   * @protected
   */
  getImageInternal(t, e, a, s) {
    if (this.loader) {
      const l = H5(t, e, a, 1), f = this.findNearestResolution(e);
      if (this.image && (this.static_ || this.wantedProjection_ === s && (this.wantedExtent_ && nd(this.wantedExtent_, l) || nd(this.image.getExtent(), l)) && (this.wantedResolution_ && iC(this.wantedResolution_) === f || iC(this.image.getResolution()) === f)))
        return this.image;
      this.wantedProjection_ = s, this.wantedExtent_ = l, this.wantedResolution_ = f, this.image = new $2(
        l,
        f,
        a,
        this.loader
      ), this.image.addEventListener(
        ln.CHANGE,
        this.handleImageChange.bind(this)
      );
    }
    return this.image;
  }
  /**
   * Handle image change events.
   * @param {import("../events/Event.js").default} event Event.
   * @protected
   */
  handleImageChange(t) {
    const e = (
      /** @type {import("../Image.js").default} */
      t.target
    );
    let a;
    switch (e.getState()) {
      case xe.LOADING:
        this.loading = !0, a = rM.IMAGELOADSTART;
        break;
      case xe.LOADED:
        this.loading = !1, a = rM.IMAGELOADEND;
        break;
      case xe.ERROR:
        this.loading = !1, a = rM.IMAGELOADERROR;
        break;
      default:
        return;
    }
    this.hasListener(a) && this.dispatchEvent(new vQ(a, e));
  }
}
function bQ(n, t) {
  n.getImage().src = t;
}
function H5(n, t, e, a) {
  const s = t / e, l = fm(n), f = h0(Hn(n) / s, p0), h = h0(Ir(n) / s, p0), p = h0((a - 1) * f / 2, p0), y = f + 2 * p, b = h0((a - 1) * h / 2, p0), x = h + 2 * b;
  return Qb(l, s, 0, [
    y,
    x
  ]);
}
function _S(n, t) {
  const e = [];
  Object.keys(t).forEach(function(s) {
    t[s] !== null && t[s] !== void 0 && e.push(s + "=" + encodeURIComponent(t[s]));
  });
  const a = e.join("&");
  return n = n.replace(/[?&]$/, ""), n += n.includes("?") ? "&" : "?", n + a;
}
const SQ = /\{z\}/g, xQ = /\{x\}/g, TQ = /\{y\}/g, wQ = /\{-y\}/g;
function RQ(n, t, e, a, s) {
  return n.replace(SQ, t.toString()).replace(xQ, e.toString()).replace(TQ, a.toString()).replace(wQ, function() {
    if (s === void 0)
      throw new Error(
        "If the URL template has a {-y} placeholder, the grid extent must be known"
      );
    return (s - a).toString();
  });
}
function B5(n) {
  const t = [];
  let e = /\{([a-z])-([a-z])\}/.exec(n);
  if (e) {
    const a = e[1].charCodeAt(0), s = e[2].charCodeAt(0);
    let l;
    for (l = a; l <= s; ++l)
      t.push(n.replace(e[0], String.fromCharCode(l)));
    return t;
  }
  if (e = /\{(\d+)-(\d+)\}/.exec(n), e) {
    const a = parseInt(e[2], 10);
    for (let s = parseInt(e[1], 10); s <= a; s++)
      t.push(n.replace(e[0], s.toString()));
    return t;
  }
  return t.push(n), t;
}
const aw = "1.3.0", zL = [101, 101];
function q5(n, t, e, a, s) {
  s.WIDTH = e[0], s.HEIGHT = e[1];
  const l = a.getAxisOrientation(), f = oC(s.VERSION, "1.3") >= 0;
  s[f ? "CRS" : "SRS"] = a.getCode();
  const h = f && l.startsWith("ne") ? [t[1], t[0], t[3], t[2]] : t;
  return s.BBOX = h.join(","), _S(n, s);
}
function V5(n, t, e, a, s, l, f) {
  l = Object.assign({ REQUEST: "GetMap" }, l);
  const h = t / e, p = [
    $3(Hn(n) / h, p0),
    $3(Ir(n) / h, p0)
  ];
  if (e != 1)
    switch (f) {
      case "geoserver":
        const b = 90 * e + 0.5 | 0;
        "FORMAT_OPTIONS" in l ? l.FORMAT_OPTIONS += ";dpi:" + b : l.FORMAT_OPTIONS = "dpi:" + b;
        break;
      case "mapserver":
        l.MAP_RESOLUTION = 90 * e;
        break;
      case "carmentaserver":
      case "qgis":
        l.DPI = 90 * e;
        break;
      default:
        throw new Error("Unknown `serverType` configured");
    }
  return q5(s, n, p, a, l);
}
function rw(n, t) {
  return Object.assign(
    {
      REQUEST: t,
      SERVICE: "WMS",
      VERSION: aw,
      FORMAT: "image/png",
      STYLES: "",
      TRANSPARENT: "TRUE"
    },
    n
  );
}
function AQ(n) {
  const t = n.hidpi === void 0 ? !0 : n.hidpi, e = $i(n.projection || "EPSG:3857"), a = n.ratio || 1.5, s = n.load || K2, l = n.crossOrigin ?? null;
  return (f, h, p) => {
    f = H5(f, h, p, a), p != 1 && (!t || n.serverType === void 0) && (p = 1);
    const y = V5(
      f,
      h,
      p,
      e,
      n.url,
      rw(n.params, "GetMap"),
      n.serverType
    ), b = new Image();
    return b.crossOrigin = l, s(b, y).then((x) => ({ image: x, extent: f, pixelRatio: p }));
  };
}
function MQ(n, t, e) {
  if (n.url === void 0)
    return;
  const a = $i(n.projection || "EPSG:3857"), s = Qb(
    t,
    e,
    0,
    zL
  ), l = {
    QUERY_LAYERS: n.params.LAYERS,
    INFO_FORMAT: "application/json"
  };
  Object.assign(
    l,
    rw(n.params, "GetFeatureInfo"),
    n.params
  );
  const f = z1((t[0] - s[0]) / e, p0), h = z1((s[3] - t[1]) / e, p0), p = oC(l.VERSION, "1.3") >= 0;
  return l[p ? "I" : "X"] = f, l[p ? "J" : "Y"] = h, q5(
    n.url,
    s,
    zL,
    a,
    l
  );
}
function CQ(n, t) {
  if (n.url === void 0)
    return;
  const e = {
    SERVICE: "WMS",
    VERSION: aw,
    REQUEST: "GetLegendGraphic",
    FORMAT: "image/png"
  };
  if (t !== void 0) {
    const a = $i(n.projection || "EPSG:3857").getMetersPerUnit() || 1, s = 28e-5;
    e.SCALE = t * a / s;
  }
  if (Object.assign(e, n.params), n.params !== void 0 && e.LAYER === void 0) {
    const a = e.LAYERS;
    if (!(!Array.isArray(a) || a.length !== 1))
      return;
    e.LAYER = a;
  }
  return _S(n.url, e);
}
class Y5 extends EQ {
  /**
   * @param {Options} [options] ImageWMS options.
   */
  constructor(t) {
    t = t || {}, super({
      attributions: t.attributions,
      interpolate: t.interpolate,
      projection: t.projection,
      resolutions: t.resolutions
    }), this.crossOrigin_ = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.url_ = t.url, this.imageLoadFunction_ = t.imageLoadFunction !== void 0 ? t.imageLoadFunction : bQ, this.params_ = Object.assign({}, t.params), this.serverType_ = t.serverType, this.hidpi_ = t.hidpi !== void 0 ? t.hidpi : !0, this.renderedRevision_ = 0, this.ratio_ = t.ratio !== void 0 ? t.ratio : 1.5, this.loaderProjection_ = null;
  }
  /**
   * Return the GetFeatureInfo URL for the passed coordinate, resolution, and
   * projection. Return `undefined` if the GetFeatureInfo URL cannot be
   * constructed.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {number} resolution Resolution.
   * @param {import("../proj.js").ProjectionLike} projection Projection.
   * @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should
   *     be provided. If `QUERY_LAYERS` is not provided then the layers specified
   *     in the `LAYERS` parameter will be used. `VERSION` should not be
   *     specified here.
   * @return {string|undefined} GetFeatureInfo URL.
   * @api
   */
  getFeatureInfoUrl(t, e, a, s) {
    const l = $i(a), f = this.getProjection();
    f && f !== l && (e = yS(
      f,
      l,
      t,
      e
    ), t = gw(t, l, f));
    const h = {
      url: this.url_,
      params: {
        ...this.params_,
        ...s
      },
      projection: f || l
    };
    return MQ(h, t, e);
  }
  /**
   * Return the GetLegendGraphic URL, optionally optimized for the passed
   * resolution and possibly including any passed specific parameters. Returns
   * `undefined` if the GetLegendGraphic URL cannot be constructed.
   *
   * @param {number} [resolution] Resolution. If set to undefined, `SCALE`
   *     will not be calculated and included in URL.
   * @param {Object} [params] GetLegendGraphic params. If `LAYER` is set, the
   *     request is generated for this wms layer, else it will try to use the
   *     configured wms layer. Default `FORMAT` is `image/png`.
   *     `VERSION` should not be specified here.
   * @return {string|undefined} GetLegendGraphic URL.
   * @api
   */
  getLegendUrl(t, e) {
    return CQ(
      {
        url: this.url_,
        params: {
          ...this.params_,
          ...e
        }
      },
      t
    );
  }
  /**
   * Get the user-provided params, i.e. those passed to the constructor through
   * the "params" option, and possibly updated using the updateParams method.
   * @return {Object} Params.
   * @api
   */
  getParams() {
    return this.params_;
  }
  /**
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} resolution Resolution.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {import("../Image.js").default} Single image.
   * @override
   */
  getImageInternal(t, e, a, s) {
    return this.url_ === void 0 ? null : ((!this.loader || this.loaderProjection_ !== s) && (this.loaderProjection_ = s, this.loader = AQ({
      crossOrigin: this.crossOrigin_,
      params: this.params_,
      projection: s,
      serverType: this.serverType_,
      hidpi: this.hidpi_,
      url: this.url_,
      ratio: this.ratio_,
      load: (l, f) => (this.image.setImage(l), this.imageLoadFunction_(this.image, f), K2(l))
    })), super.getImageInternal(t, e, a, s));
  }
  /**
   * Return the image load function of the source.
   * @return {import("../Image.js").LoadFunction} The image load function.
   * @api
   */
  getImageLoadFunction() {
    return this.imageLoadFunction_;
  }
  /**
   * Return the URL used for this WMS source.
   * @return {string|undefined} URL.
   * @api
   */
  getUrl() {
    return this.url_;
  }
  /**
   * Set the image load function of the source.
   * @param {import("../Image.js").LoadFunction} imageLoadFunction Image load function.
   * @api
   */
  setImageLoadFunction(t) {
    this.imageLoadFunction_ = t, this.changed();
  }
  /**
   * Set the URL to use for requests.
   * @param {string|undefined} url URL.
   * @api
   */
  setUrl(t) {
    t != this.url_ && (this.url_ = t, this.loader = null, this.changed());
  }
  /**
   * Set the user-provided params.
   * @param {Object} params Params.
   * @api
   */
  setParams(t) {
    this.params_ = Object.assign({}, t), this.changed();
  }
  /**
   * Update the user-provided params.
   * @param {Object} params Params.
   * @api
   */
  updateParams(t) {
    Object.assign(this.params_, t), this.changed();
  }
  /**
   * @override
   */
  changed() {
    this.image = null, super.changed();
  }
}
const A1 = [0, 0, 0], o0 = 5;
class F5 {
  /**
   * @param {Options} options Tile grid options.
   */
  constructor(t) {
    this.minZoom = t.minZoom !== void 0 ? t.minZoom : 0, this.resolutions_ = t.resolutions, Ei(
      WF(
        this.resolutions_,
        /**
         * @param {number} a First resolution
         * @param {number} b Second resolution
         * @return {number} Comparison result
         */
        (s, l) => l - s
      ),
      "`resolutions` must be sorted in descending order"
    );
    let e;
    if (!t.origins) {
      for (let s = 0, l = this.resolutions_.length - 1; s < l; ++s)
        if (!e)
          e = this.resolutions_[s] / this.resolutions_[s + 1];
        else if (this.resolutions_[s] / this.resolutions_[s + 1] !== e) {
          e = void 0;
          break;
        }
    }
    this.zoomFactor_ = e, this.maxZoom = this.resolutions_.length - 1, this.origin_ = t.origin !== void 0 ? t.origin : null, this.origins_ = null, t.origins !== void 0 && (this.origins_ = t.origins, Ei(
      this.origins_.length == this.resolutions_.length,
      "Number of `origins` and `resolutions` must be equal"
    ));
    const a = t.extent;
    a !== void 0 && !this.origin_ && !this.origins_ && (this.origin_ = Y_(a)), Ei(
      !this.origin_ && this.origins_ || this.origin_ && !this.origins_,
      "Either `origin` or `origins` must be configured, never both"
    ), this.tileSizes_ = null, t.tileSizes !== void 0 && (this.tileSizes_ = t.tileSizes, Ei(
      this.tileSizes_.length == this.resolutions_.length,
      "Number of `tileSizes` and `resolutions` must be equal"
    )), this.tileSize_ = t.tileSize !== void 0 ? t.tileSize : this.tileSizes_ ? null : vO, Ei(
      !this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_,
      "Either `tileSize` or `tileSizes` must be configured, never both"
    ), this.extent_ = a !== void 0 ? a : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], this.tmpExtent_ = [0, 0, 0, 0], t.sizes !== void 0 ? this.fullTileRanges_ = t.sizes.map((s, l) => {
      const f = new TO(
        Math.min(0, s[0]),
        Math.max(s[0] - 1, -1),
        Math.min(0, s[1]),
        Math.max(s[1] - 1, -1)
      );
      if (a) {
        const h = this.getTileRangeForExtentAndZ(a, l);
        f.minX = Math.max(h.minX, f.minX), f.maxX = Math.min(h.maxX, f.maxX), f.minY = Math.max(h.minY, f.minY), f.maxY = Math.min(h.maxY, f.maxY);
      }
      return f;
    }) : a && this.calculateTileRanges_(a);
  }
  /**
   * Call a function with each tile coordinate for a given extent and zoom level.
   *
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} zoom Integer zoom level.
   * @param {function(import("../tilecoord.js").TileCoord): void} callback Function called with each tile coordinate.
   * @api
   */
  forEachTileCoord(t, e, a) {
    const s = this.getTileRangeForExtentAndZ(t, e);
    for (let l = s.minX, f = s.maxX; l <= f; ++l)
      for (let h = s.minY, p = s.maxY; h <= p; ++h)
        a([e, l, h]);
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {function(number, import("../TileRange.js").default): boolean} callback Callback.
   * @param {import("../TileRange.js").default} [tempTileRange] Temporary import("../TileRange.js").default object.
   * @param {import("../extent.js").Extent} [tempExtent] Temporary import("../extent.js").Extent object.
   * @return {boolean} Callback succeeded.
   */
  forEachTileCoordParentTileRange(t, e, a, s) {
    let l, f, h, p = null, y = t[0] - 1;
    for (this.zoomFactor_ === 2 ? (f = t[1], h = t[2]) : p = this.getTileCoordExtent(t, s); y >= this.minZoom; ) {
      if (f !== void 0 && h !== void 0 ? (f = Math.floor(f / 2), h = Math.floor(h / 2), l = R1(f, f, h, h, a)) : l = this.getTileRangeForExtentAndZ(
        p,
        y,
        a
      ), e(y, l))
        return !0;
      --y;
    }
    return !1;
  }
  /**
   * Get the extent for this tile grid, if it was configured.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getExtent() {
    return this.extent_;
  }
  /**
   * Get the maximum zoom level for the grid.
   * @return {number} Max zoom.
   * @api
   */
  getMaxZoom() {
    return this.maxZoom;
  }
  /**
   * Get the minimum zoom level for the grid.
   * @return {number} Min zoom.
   * @api
   */
  getMinZoom() {
    return this.minZoom;
  }
  /**
   * Get the origin for the grid at the given zoom level.
   * @param {number} z Integer zoom level.
   * @return {import("../coordinate.js").Coordinate} Origin.
   * @api
   */
  getOrigin(t) {
    return this.origin_ ? this.origin_ : this.origins_[t];
  }
  /**
   * Get the resolution for the given zoom level.
   * @param {number} z Integer zoom level.
   * @return {number} Resolution.
   * @api
   */
  getResolution(t) {
    return this.resolutions_[t];
  }
  /**
   * Get the list of resolutions for the tile grid.
   * @return {Array<number>} Resolutions.
   * @api
   */
  getResolutions() {
    return this.resolutions_;
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("../TileRange.js").default} [tempTileRange] Temporary import("../TileRange.js").default object.
   * @param {import("../extent.js").Extent} [tempExtent] Temporary import("../extent.js").Extent object.
   * @return {import("../TileRange.js").default|null} Tile range.
   */
  getTileCoordChildTileRange(t, e, a) {
    if (t[0] < this.maxZoom) {
      if (this.zoomFactor_ === 2) {
        const l = t[1] * 2, f = t[2] * 2;
        return R1(
          l,
          l + 1,
          f,
          f + 1,
          e
        );
      }
      const s = this.getTileCoordExtent(
        t,
        a || this.tmpExtent_
      );
      return this.getTileRangeForExtentAndZ(
        s,
        t[0] + 1,
        e
      );
    }
    return null;
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {number} z Integer zoom level.
   * @param {import("../TileRange.js").default} [tempTileRange] Temporary import("../TileRange.js").default object.
   * @return {import("../TileRange.js").default|null} Tile range.
   */
  getTileRangeForTileCoordAndZ(t, e, a) {
    if (e > this.maxZoom || e < this.minZoom)
      return null;
    const s = t[0], l = t[1], f = t[2];
    if (e === s)
      return R1(
        l,
        f,
        l,
        f,
        a
      );
    if (this.zoomFactor_) {
      const p = Math.pow(this.zoomFactor_, e - s), y = Math.floor(l * p), b = Math.floor(f * p);
      if (e < s)
        return R1(y, y, b, b, a);
      const x = Math.floor(p * (l + 1)) - 1, w = Math.floor(p * (f + 1)) - 1;
      return R1(y, x, b, w, a);
    }
    const h = this.getTileCoordExtent(t, this.tmpExtent_);
    return this.getTileRangeForExtentAndZ(h, e, a);
  }
  /**
   * Get a tile range for the given extent and integer zoom level.
   * @param {import("../extent.js").Extent} extent Extent.
   * @param {number} z Integer zoom level.
   * @param {import("../TileRange.js").default} [tempTileRange] Temporary tile range object.
   * @return {import("../TileRange.js").default} Tile range.
   */
  getTileRangeForExtentAndZ(t, e, a) {
    this.getTileCoordForXYAndZ_(t[0], t[3], e, !1, A1);
    const s = A1[1], l = A1[2];
    this.getTileCoordForXYAndZ_(t[2], t[1], e, !0, A1);
    const f = A1[1], h = A1[2];
    return R1(s, f, l, h, a);
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @return {import("../coordinate.js").Coordinate} Tile center.
   */
  getTileCoordCenter(t) {
    const e = this.getOrigin(t[0]), a = this.getResolution(t[0]), s = ml(this.getTileSize(t[0]), this.tmpSize_);
    return [
      e[0] + (t[1] + 0.5) * s[0] * a,
      e[1] - (t[2] + 0.5) * s[1] * a
    ];
  }
  /**
   * Get the extent of a tile coordinate.
   *
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("../extent.js").Extent} [tempExtent] Temporary extent object.
   * @return {import("../extent.js").Extent} Extent.
   * @api
   */
  getTileCoordExtent(t, e) {
    const a = this.getOrigin(t[0]), s = this.getResolution(t[0]), l = ml(this.getTileSize(t[0]), this.tmpSize_), f = a[0] + t[1] * l[0] * s, h = a[1] - (t[2] + 1) * l[1] * s, p = f + l[0] * s, y = h + l[1] * s;
    return cm(f, h, p, y, e);
  }
  /**
   * Get the tile coordinate for the given map coordinate and resolution.  This
   * method considers that coordinates that intersect tile boundaries should be
   * assigned the higher tile coordinate.
   *
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {number} resolution Resolution.
   * @param {import("../tilecoord.js").TileCoord} [opt_tileCoord] Destination import("../tilecoord.js").TileCoord object.
   * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
   * @api
   */
  getTileCoordForCoordAndResolution(t, e, a) {
    return this.getTileCoordForXYAndResolution_(
      t[0],
      t[1],
      e,
      !1,
      a
    );
  }
  /**
   * Note that this method should not be called for resolutions that correspond
   * to an integer zoom level.  Instead call the `getTileCoordForXYAndZ_` method.
   * @param {number} x X.
   * @param {number} y Y.
   * @param {number} resolution Resolution (for a non-integer zoom level).
   * @param {boolean} reverseIntersectionPolicy Instead of letting edge
   *     intersections go to the higher tile coordinate, let edge intersections
   *     go to the lower tile coordinate.
   * @param {import("../tilecoord.js").TileCoord} [opt_tileCoord] Temporary import("../tilecoord.js").TileCoord object.
   * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
   * @private
   */
  getTileCoordForXYAndResolution_(t, e, a, s, l) {
    const f = this.getZForResolution(a), h = a / this.getResolution(f), p = this.getOrigin(f), y = ml(this.getTileSize(f), this.tmpSize_);
    let b = h * (t - p[0]) / a / y[0], x = h * (p[1] - e) / a / y[1];
    return s ? (b = h0(b, o0) - 1, x = h0(x, o0) - 1) : (b = z1(b, o0), x = z1(x, o0)), iw(f, b, x, l);
  }
  /**
   * Although there is repetition between this method and `getTileCoordForXYAndResolution_`,
   * they should have separate implementations.  This method is for integer zoom
   * levels.  The other method should only be called for resolutions corresponding
   * to non-integer zoom levels.
   * @param {number} x Map x coordinate.
   * @param {number} y Map y coordinate.
   * @param {number} z Integer zoom level.
   * @param {boolean} reverseIntersectionPolicy Instead of letting edge
   *     intersections go to the higher tile coordinate, let edge intersections
   *     go to the lower tile coordinate.
   * @param {import("../tilecoord.js").TileCoord} [opt_tileCoord] Temporary import("../tilecoord.js").TileCoord object.
   * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
   * @private
   */
  getTileCoordForXYAndZ_(t, e, a, s, l) {
    const f = this.getOrigin(a), h = this.getResolution(a), p = ml(this.getTileSize(a), this.tmpSize_);
    let y = (t - f[0]) / h / p[0], b = (f[1] - e) / h / p[1];
    return s ? (y = h0(y, o0) - 1, b = h0(b, o0) - 1) : (y = z1(y, o0), b = z1(b, o0)), iw(a, y, b, l);
  }
  /**
   * Get a tile coordinate given a map coordinate and zoom level.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {number} z Integer zoom level, e.g. the result of a `getZForResolution()` method call
   * @param {import("../tilecoord.js").TileCoord} [opt_tileCoord] Destination import("../tilecoord.js").TileCoord object.
   * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
   * @api
   */
  getTileCoordForCoordAndZ(t, e, a) {
    return this.getTileCoordForXYAndZ_(
      t[0],
      t[1],
      e,
      !1,
      a
    );
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @return {number} Tile resolution.
   */
  getTileCoordResolution(t) {
    return this.resolutions_[t[0]];
  }
  /**
   * Get the tile size for a zoom level. The type of the return value matches the
   * `tileSize` or `tileSizes` that the tile grid was configured with. To always
   * get an {@link import("../size.js").Size}, run the result through {@link module:ol/size.toSize}.
   * @param {number} z Z.
   * @return {number|import("../size.js").Size} Tile size.
   * @api
   */
  getTileSize(t) {
    return this.tileSize_ ? this.tileSize_ : this.tileSizes_[t];
  }
  /**
   * @param {number} z Zoom level.
   * @return {import("../TileRange.js").default|null} Extent tile range for the specified zoom level.
   */
  getFullTileRange(t) {
    return this.fullTileRanges_ ? this.fullTileRanges_[t] : this.extent_ ? this.getTileRangeForExtentAndZ(this.extent_, t) : null;
  }
  /**
   * @param {number} resolution Resolution.
   * @param {number|import("../array.js").NearestDirectionFunction} [opt_direction]
   *     If 0, the nearest resolution will be used.
   *     If 1, the nearest higher resolution (lower Z) will be used. If -1, the
   *     nearest lower resolution (higher Z) will be used. Default is 0.
   *     Use a {@link module:ol/array~NearestDirectionFunction} for more precise control.
   *
   * For example to change tile Z at the midpoint of zoom levels
   * ```js
   * function(value, high, low) {
   *   return value - low * Math.sqrt(high / low);
   * }
   * ```
   * @return {number} Z.
   * @api
   */
  getZForResolution(t, e) {
    const a = Cw(
      this.resolutions_,
      t,
      e || 0
    );
    return ra(a, this.minZoom, this.maxZoom);
  }
  /**
   * The tile with the provided tile coordinate intersects the given viewport.
   * @param {import('../tilecoord.js').TileCoord} tileCoord Tile coordinate.
   * @param {Array<number>} viewport Viewport as returned from {@link module:ol/extent.getRotatedViewport}.
   * @return {boolean} The tile with the provided tile coordinate intersects the given viewport.
   */
  tileCoordIntersectsViewport(t, e) {
    return j2(
      e,
      0,
      e.length,
      2,
      this.getTileCoordExtent(t)
    );
  }
  /**
   * @param {!import("../extent.js").Extent} extent Extent for this tile grid.
   * @private
   */
  calculateTileRanges_(t) {
    const e = this.resolutions_.length, a = new Array(e);
    for (let s = this.minZoom; s < e; ++s)
      a[s] = this.getTileRangeForExtentAndZ(t, s);
    this.fullTileRanges_ = a;
  }
}
class OQ extends F5 {
  /**
   * @param {Options} options WMTS options.
   */
  constructor(t) {
    super({
      extent: t.extent,
      origin: t.origin,
      origins: t.origins,
      resolutions: t.resolutions,
      tileSize: t.tileSize,
      tileSizes: t.tileSizes,
      sizes: t.sizes
    }), this.matrixIds_ = t.matrixIds;
  }
  /**
   * @param {number} z Z.
   * @return {string} MatrixId..
   */
  getMatrixId(t) {
    return this.matrixIds_[t];
  }
  /**
   * Get the list of matrix identifiers.
   * @return {Array<string>} MatrixIds.
   * @api
   */
  getMatrixIds() {
    return this.matrixIds_;
  }
}
function DQ(n, t, e) {
  const a = [], s = [], l = [], f = [], h = [];
  e = e !== void 0 ? e : [];
  const p = "SupportedCRS", y = "TileMatrix", b = "Identifier", x = "ScaleDenominator", w = "TopLeftCorner", A = "TileWidth", C = "TileHeight", L = n[p], N = $i(L), U = N.getMetersPerUnit(), k = N.getAxisOrientation().startsWith("ne");
  return n[y].sort(function(H, B) {
    return B[x] - H[x];
  }), n[y].forEach(function(H) {
    let B;
    if (e.length > 0 ? B = e.find(function(z) {
      return H[b] == z[y] ? !0 : H[b].includes(":") ? !1 : n[b] + ":" + H[b] === z[y];
    }) : B = !0, B) {
      s.push(H[b]);
      const z = H[x] * 28e-5 / U, Q = H[A], et = H[C];
      k ? l.push([
        H[w][1],
        H[w][0]
      ]) : l.push(H[w]), a.push(z), f.push(
        Q == et ? Q : [Q, et]
      ), h.push([H.MatrixWidth, H.MatrixHeight]);
    }
  }), new OQ({
    extent: t,
    origins: l,
    resolutions: a,
    matrixIds: s,
    tileSizes: f,
    sizes: h
  });
}
function $5(n) {
  let t = n.getDefaultTileGrid();
  return t || (t = PQ(n), n.setDefaultTileGrid(t)), t;
}
function NQ(n, t, e) {
  const a = t[0], s = n.getTileCoordCenter(t), l = X5(e);
  if (!D_(l, s)) {
    const f = Hn(l), h = Math.ceil(
      (l[0] - s[0]) / f
    );
    return s[0] += f * h, n.getTileCoordForCoordAndZ(s, a);
  }
  return t;
}
function LQ(n, t, e, a) {
  a = a !== void 0 ? a : "top-left";
  const s = IQ(n, t, e);
  return new F5({
    extent: n,
    origin: c9(n, a),
    resolutions: s,
    tileSize: e
  });
}
function IQ(n, t, e, a) {
  t = t !== void 0 ? t : hZ, e = ml(e !== void 0 ? e : vO);
  const s = Ir(n), l = Hn(n);
  a = a > 0 ? a : Math.max(l / e[0], s / e[1]);
  const f = t + 1, h = new Array(f);
  for (let p = 0; p < f; ++p)
    h[p] = a / Math.pow(2, p);
  return h;
}
function PQ(n, t, e, a) {
  const s = X5(n);
  return LQ(s, t, e, a);
}
function X5(n) {
  n = $i(n);
  let t = n.getExtent();
  if (!t) {
    const e = 180 * Z1.degrees / n.getMetersPerUnit();
    t = cm(-e, -e, e, e);
  }
  return t;
}
function zQ(n, t) {
  return (
    /**
     * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
     * @param {number} pixelRatio Pixel ratio.
     * @param {import("./proj/Projection.js").default} projection Projection.
     * @return {string|undefined} Tile URL.
     */
    function(e, a, s) {
      if (!e)
        return;
      let l;
      const f = e[0];
      if (t) {
        const h = t.getFullTileRange(f);
        h && (l = h.getHeight() - 1);
      }
      return RQ(n, f, e[1], e[2], l);
    }
  );
}
function GQ(n, t) {
  const e = n.length, a = new Array(e);
  for (let s = 0; s < e; ++s)
    a[s] = zQ(n[s], t);
  return aC(a);
}
function aC(n) {
  return n.length === 1 ? n[0] : (
    /**
     * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
     * @param {number} pixelRatio Pixel ratio.
     * @param {import("./proj/Projection.js").default} projection Projection.
     * @return {string|undefined} Tile URL.
     */
    function(t, e, a) {
      if (!t)
        return;
      const s = k5(t), l = w_(s, n.length);
      return n[l](t, e, a);
    }
  );
}
class UQ extends fO {
  /**
   * @param {Options} options SourceTile source options.
   */
  constructor(t) {
    super({
      attributions: t.attributions,
      attributionsCollapsible: t.attributionsCollapsible,
      projection: t.projection,
      state: t.state,
      wrapX: t.wrapX,
      interpolate: t.interpolate
    }), this.on, this.once, this.un, this.tilePixelRatio_ = t.tilePixelRatio !== void 0 ? t.tilePixelRatio : 1, this.tileGrid = t.tileGrid !== void 0 ? t.tileGrid : null;
    const e = [256, 256];
    this.tileGrid && ml(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()), e), this.tmpSize = [0, 0], this.key_ = t.key || si(this), this.tileOptions = {
      transition: t.transition,
      interpolate: t.interpolate
    }, this.zDirection = t.zDirection ? t.zDirection : 0;
  }
  /**
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {number} Gutter.
   */
  getGutterForProjection(t) {
    return 0;
  }
  /**
   * Return the key to be used for all tiles in the source.
   * @return {string} The key for all tiles.
   */
  getKey() {
    return this.key_;
  }
  /**
   * Set the value to be used as the key for all tiles in the source.
   * @param {string} key The key for tiles.
   * @protected
   */
  setKey(t) {
    this.key_ !== t && (this.key_ = t, this.changed());
  }
  /**
   * @param {import("../proj/Projection").default} [projection] Projection.
   * @return {Array<number>|null} Resolutions.
   * @override
   */
  getResolutions(t) {
    const e = t ? this.getTileGridForProjection(t) : this.tileGrid;
    return e ? e.getResolutions() : null;
  }
  /**
   * @abstract
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {TileType|null} Tile.
   */
  getTile(t, e, a, s, l) {
    return Qn();
  }
  /**
   * Return the tile grid of the tile source.
   * @return {import("../tilegrid/TileGrid.js").default|null} Tile grid.
   * @api
   */
  getTileGrid() {
    return this.tileGrid;
  }
  /**
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {!import("../tilegrid/TileGrid.js").default} Tile grid.
   */
  getTileGridForProjection(t) {
    return this.tileGrid ? this.tileGrid : $5(t);
  }
  /**
   * Get the tile pixel ratio for this source. Subclasses may override this
   * method, which is meant to return a supported pixel ratio that matches the
   * provided `pixelRatio` as close as possible.
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} Tile pixel ratio.
   */
  getTilePixelRatio(t) {
    return this.tilePixelRatio_;
  }
  /**
   * @param {number} z Z.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {import("../size.js").Size} Tile size.
   */
  getTilePixelSize(t, e, a) {
    const s = this.getTileGridForProjection(a), l = this.getTilePixelRatio(e), f = ml(s.getTileSize(t), this.tmpSize);
    return l == 1 ? f : QX(f, l, this.tmpSize);
  }
  /**
   * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate
   * is outside the resolution and extent range of the tile grid, `null` will be
   * returned.
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("../proj/Projection.js").default} [projection] Projection.
   * @return {import("../tilecoord.js").TileCoord} Tile coordinate to be passed to the tileUrlFunction or
   *     null if no tile URL should be created for the passed `tileCoord`.
   */
  getTileCoordForTileUrlFunction(t, e) {
    const a = e !== void 0 ? e : this.getProjection(), s = e !== void 0 ? this.getTileGridForProjection(a) : this.tileGrid || this.getTileGridForProjection(a);
    return this.getWrapX() && a.isGlobal() && (t = NQ(s, t, a)), gQ(t, s) ? t : null;
  }
  /**
   * Remove all cached reprojected tiles from the source. The next render cycle will create new tiles.
   * @api
   */
  clear() {
  }
  /**
   * @override
   */
  refresh() {
    this.clear(), super.refresh();
  }
}
class jQ extends dd {
  /**
   * @param {string} type Type.
   * @param {import("../Tile.js").default} tile The tile.
   */
  constructor(t, e) {
    super(t), this.tile = e;
  }
}
const sM = {
  /**
   * Triggered when a tile starts loading.
   * @event module:ol/source/Tile.TileSourceEvent#tileloadstart
   * @api
   */
  TILELOADSTART: "tileloadstart",
  /**
   * Triggered when a tile finishes loading, either when its data is loaded,
   * or when loading was aborted because the tile is no longer needed.
   * @event module:ol/source/Tile.TileSourceEvent#tileloadend
   * @api
   */
  TILELOADEND: "tileloadend",
  /**
   * Triggered if tile loading results in an error. Note that this is not the
   * right place to re-fetch tiles. See {@link module:ol/ImageTile~ImageTile#load}
   * for details.
   * @event module:ol/source/Tile.TileSourceEvent#tileloaderror
   * @api
   */
  TILELOADERROR: "tileloaderror"
};
class AO extends UQ {
  /**
   * @param {Options} options Image tile options.
   */
  constructor(t) {
    super({
      attributions: t.attributions,
      cacheSize: t.cacheSize,
      projection: t.projection,
      state: t.state,
      tileGrid: t.tileGrid,
      tilePixelRatio: t.tilePixelRatio,
      wrapX: t.wrapX,
      transition: t.transition,
      interpolate: t.interpolate,
      key: t.key,
      attributionsCollapsible: t.attributionsCollapsible,
      zDirection: t.zDirection
    }), this.generateTileUrlFunction_ = this.tileUrlFunction === AO.prototype.tileUrlFunction, this.tileLoadFunction = t.tileLoadFunction, t.tileUrlFunction && (this.tileUrlFunction = t.tileUrlFunction), this.urls = null, t.urls ? this.setUrls(t.urls) : t.url && this.setUrl(t.url), this.tileLoadingKeys_ = {};
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Return the tile load function of the source.
   * @return {import("../Tile.js").LoadFunction} TileLoadFunction
   * @api
   */
  getTileLoadFunction() {
    return this.tileLoadFunction;
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Return the tile URL function of the source.
   * @return {import("../Tile.js").UrlFunction} TileUrlFunction
   * @api
   */
  getTileUrlFunction() {
    return Object.getPrototypeOf(this).tileUrlFunction === this.tileUrlFunction ? this.tileUrlFunction.bind(this) : this.tileUrlFunction;
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Return the URLs used for this source.
   * When a tileUrlFunction is used instead of url or urls,
   * null will be returned.
   * @return {!Array<string>|null} URLs.
   * @api
   */
  getUrls() {
    return this.urls;
  }
  /**
   * Handle tile change events.
   * @param {import("../events/Event.js").default} event Event.
   * @protected
   */
  handleTileChange(t) {
    const e = (
      /** @type {import("../Tile.js").default} */
      t.target
    ), a = si(e), s = e.getState();
    let l;
    s == ze.LOADING ? (this.tileLoadingKeys_[a] = !0, l = sM.TILELOADSTART) : a in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[a], l = s == ze.ERROR ? sM.TILELOADERROR : s == ze.LOADED ? sM.TILELOADEND : void 0), l != null && this.dispatchEvent(new jQ(l, e));
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Set the tile load function of the source.
   * @param {import("../Tile.js").LoadFunction} tileLoadFunction Tile load function.
   * @api
   */
  setTileLoadFunction(t) {
    this.tileLoadFunction = t, this.changed();
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Set the tile URL function of the source.
   * @param {import("../Tile.js").UrlFunction} tileUrlFunction Tile URL function.
   * @param {string} [key] Optional new tile key for the source.
   * @api
   */
  setTileUrlFunction(t, e) {
    this.tileUrlFunction = t, typeof e < "u" ? this.setKey(e) : this.changed();
  }
  /**
   * Set the URL to use for requests.
   * @param {string} url URL.
   * @api
   */
  setUrl(t) {
    const e = B5(t);
    this.urls = e, this.setUrls(e);
  }
  /**
   * Deprecated.  Use an ImageTile source instead.
   * Set the URLs to use for requests.
   * @param {Array<string>} urls URLs.
   * @api
   */
  setUrls(t) {
    this.urls = t;
    const e = t.join(`
`);
    this.generateTileUrlFunction_ ? this.setTileUrlFunction(GQ(t, this.tileGrid), e) : this.setKey(e);
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {string|undefined} Tile URL.
   */
  tileUrlFunction(t, e, a) {
  }
}
class K5 extends AO {
  /**
   * @param {!Options} options Image tile options.
   */
  constructor(t) {
    super({
      attributions: t.attributions,
      cacheSize: t.cacheSize,
      projection: t.projection,
      state: t.state,
      tileGrid: t.tileGrid,
      tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : kQ,
      tilePixelRatio: t.tilePixelRatio,
      tileUrlFunction: t.tileUrlFunction,
      url: t.url,
      urls: t.urls,
      wrapX: t.wrapX,
      transition: t.transition,
      interpolate: t.interpolate !== void 0 ? t.interpolate : !0,
      key: t.key,
      attributionsCollapsible: t.attributionsCollapsible,
      zDirection: t.zDirection
    }), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.tileClass = t.tileClass !== void 0 ? t.tileClass : E5, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
  }
  /**
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {number} Gutter.
   * @override
   */
  getGutterForProjection(t) {
    return this.getProjection() && t && !R_(this.getProjection(), t) ? 0 : this.getGutter();
  }
  /**
   * @return {number} Gutter.
   */
  getGutter() {
    return 0;
  }
  /**
   * Return the key to be used for all tiles in the source.
   * @return {string} The key for all tiles.
   * @override
   */
  getKey() {
    let t = super.getKey();
    return this.getInterpolate() || (t += ":disable-interpolation"), t;
  }
  /**
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {!import("../tilegrid/TileGrid.js").default} Tile grid.
   * @override
   */
  getTileGridForProjection(t) {
    const e = this.getProjection();
    if (this.tileGrid && (!e || R_(e, t)))
      return this.tileGrid;
    const a = si(t);
    return a in this.tileGridForProjection || (this.tileGridForProjection[a] = $5(t)), this.tileGridForProjection[a];
  }
  /**
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @param {string} key The key set on the tile.
   * @return {!ImageTile} Tile.
   * @private
   */
  createTile_(t, e, a, s, l, f) {
    const h = [t, e, a], p = this.getTileCoordForTileUrlFunction(
      h,
      l
    ), y = p ? this.tileUrlFunction(p, s, l) : void 0, b = new this.tileClass(
      h,
      y !== void 0 ? ze.IDLE : ze.EMPTY,
      y !== void 0 ? y : "",
      this.crossOrigin,
      this.tileLoadFunction,
      this.tileOptions
    );
    return b.key = f, b.addEventListener(ln.CHANGE, this.handleTileChange.bind(this)), b;
  }
  /**
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @return {!(ImageTile|ReprojTile)} Tile.
   * @override
   */
  getTile(t, e, a, s, l) {
    const f = this.getProjection();
    if (!f || !l || R_(f, l))
      return this.getTileInternal(
        t,
        e,
        a,
        s,
        f || l
      );
    const h = [t, e, a], p = this.getKey(), y = this.getTileGridForProjection(f), b = this.getTileGridForProjection(l), x = this.getTileCoordForTileUrlFunction(
      h,
      l
    ), w = new j5(
      f,
      y,
      l,
      b,
      h,
      x,
      this.getTilePixelRatio(s),
      this.getGutter(),
      (A, C, L, N) => this.getTileInternal(A, C, L, N, f),
      this.reprojectionErrorThreshold_,
      this.renderReprojectionEdges_,
      this.tileOptions
    );
    return w.key = p, w;
  }
  /**
   * @param {number} z Tile coordinate z.
   * @param {number} x Tile coordinate x.
   * @param {number} y Tile coordinate y.
   * @param {number} pixelRatio Pixel ratio.
   * @param {!import("../proj/Projection.js").default} projection Projection.
   * @return {!ImageTile} Tile.
   * @protected
   */
  getTileInternal(t, e, a, s, l) {
    const f = this.getKey();
    return this.createTile_(t, e, a, s, l, f);
  }
  /**
   * Sets whether to render reprojection edges or not (usually for debugging).
   * @param {boolean} render Render the edges.
   * @api
   */
  setRenderReprojectionEdges(t) {
    this.renderReprojectionEdges_ != t && (this.renderReprojectionEdges_ = t, this.changed());
  }
  /**
   * Sets the tile grid to use when reprojecting the tiles to the given
   * projection instead of the default tile grid for the projection.
   *
   * This can be useful when the default tile grid cannot be created
   * (e.g. projection has no extent defined) or
   * for optimization reasons (custom tile size, resolutions, ...).
   *
   * @param {import("../proj.js").ProjectionLike} projection Projection.
   * @param {import("../tilegrid/TileGrid.js").default} tilegrid Tile grid to use for the projection.
   * @api
   */
  setTileGridForProjection(t, e) {
    const a = $i(t);
    if (a) {
      const s = si(a);
      s in this.tileGridForProjection || (this.tileGridForProjection[s] = e);
    }
  }
}
function kQ(n, t) {
  n.getImage().src = t;
}
class MO extends K5 {
  /**
   * @param {Options} [options] Tile WMS options.
   */
  constructor(t) {
    t = t || /** @type {Options} */
    {};
    const e = Object.assign({}, t.params);
    super({
      attributions: t.attributions,
      attributionsCollapsible: t.attributionsCollapsible,
      cacheSize: t.cacheSize,
      crossOrigin: t.crossOrigin,
      interpolate: t.interpolate,
      projection: t.projection,
      reprojectionErrorThreshold: t.reprojectionErrorThreshold,
      tileClass: t.tileClass,
      tileGrid: t.tileGrid,
      tileLoadFunction: t.tileLoadFunction,
      url: t.url,
      urls: t.urls,
      wrapX: t.wrapX !== void 0 ? t.wrapX : !0,
      transition: t.transition,
      zDirection: t.zDirection
    }), this.gutter_ = t.gutter !== void 0 ? t.gutter : 0, this.params_ = e, this.v13_ = !0, this.serverType_ = t.serverType, this.hidpi_ = t.hidpi !== void 0 ? t.hidpi : !0, this.tmpExtent_ = uu(), this.updateV13_(), this.setKey(this.getKeyForParams_());
  }
  /**
   * Return the GetFeatureInfo URL for the passed coordinate, resolution, and
   * projection. Return `undefined` if the GetFeatureInfo URL cannot be
   * constructed.
   * @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
   * @param {number} resolution Resolution.
   * @param {import("../proj.js").ProjectionLike} projection Projection.
   * @param {!Object} params GetFeatureInfo params. `INFO_FORMAT` at least should
   *     be provided. If `QUERY_LAYERS` is not provided then the layers specified
   *     in the `LAYERS` parameter will be used. `VERSION` should not be
   *     specified here.
   * @return {string|undefined} GetFeatureInfo URL.
   * @api
   */
  getFeatureInfoUrl(t, e, a, s) {
    const l = $i(a), f = this.getProjection() || l;
    let h = this.getTileGrid();
    h || (h = this.getTileGridForProjection(f));
    const p = gw(
      t,
      l,
      f
    ), y = yS(
      f,
      l,
      t,
      e
    ), b = h.getZForResolution(y, this.zDirection), x = h.getResolution(b), w = h.getTileCoordForCoordAndZ(p, b);
    if (h.getResolutions().length <= w[0])
      return;
    let A = h.getTileCoordExtent(w, this.tmpExtent_);
    const C = this.gutter_;
    C !== 0 && (A = Wb(A, x * C, A));
    const L = {
      QUERY_LAYERS: this.params_.LAYERS
    };
    Object.assign(
      L,
      rw(this.params_, "GetFeatureInfo"),
      s
    );
    const N = Math.floor((p[0] - A[0]) / x), U = Math.floor((A[3] - p[1]) / x);
    return L[this.v13_ ? "I" : "X"] = N, L[this.v13_ ? "J" : "Y"] = U, this.getRequestUrl_(
      w,
      A,
      1,
      f || l,
      L
    );
  }
  /**
   * Return the GetLegendGraphic URL, optionally optimized for the passed
   * resolution and possibly including any passed specific parameters. Returns
   * `undefined` if the GetLegendGraphic URL cannot be constructed.
   *
   * @param {number} [resolution] Resolution. If set to undefined, `SCALE`
   *     will not be calculated and included in URL.
   * @param {Object} [params] GetLegendGraphic params. If `LAYER` is set, the
   *     request is generated for this wms layer, else it will try to use the
   *     configured wms layer. Default `FORMAT` is `image/png`.
   *     `VERSION` should not be specified here.
   * @return {string|undefined} GetLegendGraphic URL.
   * @api
   */
  getLegendUrl(t, e) {
    if (this.urls[0] === void 0)
      return;
    const a = {
      SERVICE: "WMS",
      VERSION: aw,
      REQUEST: "GetLegendGraphic",
      FORMAT: "image/png"
    };
    if (e === void 0 || e.LAYER === void 0) {
      const s = this.params_.LAYERS;
      if (!(!Array.isArray(s) || s.length === 1))
        return;
      a.LAYER = s;
    }
    if (t !== void 0) {
      const s = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1, l = 28e-5;
      a.SCALE = t * s / l;
    }
    return Object.assign(a, e), _S(
      /** @type {string} */
      this.urls[0],
      a
    );
  }
  /**
   * @return {number} Gutter.
   * @override
   */
  getGutter() {
    return this.gutter_;
  }
  /**
   * Get the user-provided params, i.e. those passed to the constructor through
   * the "params" option, and possibly updated using the updateParams method.
   * @return {Object} Params.
   * @api
   */
  getParams() {
    return this.params_;
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
   * @param {import("../extent.js").Extent} tileExtent Tile extent.
   * @param {number} pixelRatio Pixel ratio.
   * @param {import("../proj/Projection.js").default} projection Projection.
   * @param {Object} params Params.
   * @return {string|undefined} Request URL.
   * @private
   */
  getRequestUrl_(t, e, a, s, l) {
    const f = this.urls;
    if (!f)
      return;
    let h;
    if (f.length == 1)
      h = f[0];
    else {
      const p = w_(k5(t), f.length);
      h = f[p];
    }
    return V5(
      e,
      (this.tileGrid || this.getTileGridForProjection(s)).getResolution(t[0]),
      a,
      s,
      h,
      l,
      this.serverType_
    );
  }
  /**
   * Get the tile pixel ratio for this source.
   * @param {number} pixelRatio Pixel ratio.
   * @return {number} Tile pixel ratio.
   * @override
   */
  getTilePixelRatio(t) {
    return !this.hidpi_ || this.serverType_ === void 0 ? 1 : t;
  }
  /**
   * @private
   * @return {string} The key for the current params.
   */
  getKeyForParams_() {
    let t = 0;
    const e = [];
    for (const a in this.params_)
      e[t++] = a + "-" + this.params_[a];
    return e.join("/");
  }
  /**
   * @param {Object} params New URL paremeters.
   * @private
   */
  setParams_(t) {
    this.params_ = t, this.updateV13_(), this.setKey(this.getKeyForParams_());
  }
  /**
   * Set the URL parameters passed to the WMS source.
   * @param {Object} params New URL paremeters.
   * @api
   */
  setParams(t) {
    this.setParams_(Object.assign({}, t));
  }
  /**
   * Update the URL parameters. This method can be used to update a subset of the WMS
   * parameters. Call `setParams` to set all of the parameters.
   * @param {Object} params Updated URL parameters.
   * @api
   */
  updateParams(t) {
    this.setParams_(Object.assign(this.params_, t));
  }
  /**
   * @private
   */
  updateV13_() {
    const t = this.params_.VERSION || aw;
    this.v13_ = oC(t, "1.3") >= 0;
  }
  /**
   * @param {import("../tilecoord.js").TileCoord} tileCoord The tile coordinate
   * @param {number} pixelRatio The pixel ratio
   * @param {import("../proj/Projection.js").default} projection The projection
   * @return {string|undefined} The tile URL
   * @override
   */
  tileUrlFunction(t, e, a) {
    let s = this.getTileGrid();
    if (s || (s = this.getTileGridForProjection(a)), s.getResolutions().length <= t[0])
      return;
    e != 1 && (!this.hidpi_ || this.serverType_ === void 0) && (e = 1);
    const l = s.getResolution(t[0]);
    let f = s.getTileCoordExtent(t, this.tmpExtent_);
    const h = this.gutter_;
    h !== 0 && (f = Wb(f, l * h, f));
    const p = Object.assign(
      {},
      rw(this.params_, "GetMap")
    );
    return this.getRequestUrl_(
      t,
      f,
      e,
      a,
      p
    );
  }
}
class HQ extends K5 {
  /**
   * @param {Options} options WMTS options.
   */
  constructor(t) {
    const e = t.requestEncoding !== void 0 ? t.requestEncoding : "KVP", a = t.tileGrid;
    let s = t.urls;
    s === void 0 && t.url !== void 0 && (s = B5(t.url)), super({
      attributions: t.attributions,
      attributionsCollapsible: t.attributionsCollapsible,
      cacheSize: t.cacheSize,
      crossOrigin: t.crossOrigin,
      interpolate: t.interpolate,
      projection: t.projection,
      reprojectionErrorThreshold: t.reprojectionErrorThreshold,
      tileClass: t.tileClass,
      tileGrid: a,
      tileLoadFunction: t.tileLoadFunction,
      tilePixelRatio: t.tilePixelRatio,
      urls: s,
      wrapX: t.wrapX !== void 0 ? t.wrapX : !1,
      transition: t.transition,
      zDirection: t.zDirection
    }), this.version_ = t.version !== void 0 ? t.version : "1.0.0", this.format_ = t.format !== void 0 ? t.format : "image/jpeg", this.dimensions_ = t.dimensions !== void 0 ? t.dimensions : {}, this.layer_ = t.layer, this.matrixSet_ = t.matrixSet, this.style_ = t.style, this.requestEncoding_ = e, this.setKey(this.getKeyForDimensions_()), s && s.length > 0 && (this.tileUrlFunction = aC(
      s.map(this.createFromWMTSTemplate.bind(this))
    ));
  }
  /**
   * Set the URLs to use for requests.
   * URLs may contain OGC conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}.
   * @param {Array<string>} urls URLs.
   * @override
   */
  setUrls(t) {
    this.urls = t;
    const e = t.join(`
`);
    this.setTileUrlFunction(
      aC(
        t.map(this.createFromWMTSTemplate.bind(this))
      ),
      e
    );
  }
  /**
   * Get the dimensions, i.e. those passed to the constructor through the
   * "dimensions" option, and possibly updated using the updateDimensions
   * method.
   * @return {!Object} Dimensions.
   * @api
   */
  getDimensions() {
    return this.dimensions_;
  }
  /**
   * Return the image format of the WMTS source.
   * @return {string} Format.
   * @api
   */
  getFormat() {
    return this.format_;
  }
  /**
   * Return the layer of the WMTS source.
   * @return {string} Layer.
   * @api
   */
  getLayer() {
    return this.layer_;
  }
  /**
   * Return the matrix set of the WMTS source.
   * @return {string} MatrixSet.
   * @api
   */
  getMatrixSet() {
    return this.matrixSet_;
  }
  /**
   * Return the request encoding, either "KVP" or "REST".
   * @return {RequestEncoding} Request encoding.
   * @api
   */
  getRequestEncoding() {
    return this.requestEncoding_;
  }
  /**
   * Return the style of the WMTS source.
   * @return {string} Style.
   * @api
   */
  getStyle() {
    return this.style_;
  }
  /**
   * Return the version of the WMTS source.
   * @return {string} Version.
   * @api
   */
  getVersion() {
    return this.version_;
  }
  /**
   * @private
   * @return {string} The key for the current dimensions.
   */
  getKeyForDimensions_() {
    const t = this.urls ? this.urls.slice(0) : [];
    for (const e in this.dimensions_)
      t.push(e + "-" + this.dimensions_[e]);
    return t.join("/");
  }
  /**
   * Update the dimensions.
   * @param {Object} dimensions Dimensions.
   * @api
   */
  updateDimensions(t) {
    Object.assign(this.dimensions_, t), this.setKey(this.getKeyForDimensions_());
  }
  /**
   * @param {string} template Template.
   * @return {import("../Tile.js").UrlFunction} Tile URL function.
   */
  createFromWMTSTemplate(t) {
    const e = this.requestEncoding_, a = {
      layer: this.layer_,
      style: this.style_,
      tilematrixset: this.matrixSet_
    };
    e == "KVP" && Object.assign(a, {
      Service: "WMTS",
      Request: "GetTile",
      Version: this.version_,
      Format: this.format_
    }), t = e == "KVP" ? _S(t, a) : t.replace(/\{(\w+?)\}/g, function(f, h) {
      return h.toLowerCase() in a ? a[h.toLowerCase()] : f;
    });
    const s = (
      /** @type {import("../tilegrid/WMTS.js").default} */
      this.tileGrid
    ), l = this.dimensions_;
    return (
      /**
       * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
       * @param {number} pixelRatio Pixel ratio.
       * @param {import("../proj/Projection.js").default} projection Projection.
       * @return {string|undefined} Tile URL.
       */
      function(f, h, p) {
        if (!f)
          return;
        const y = {
          TileMatrix: s.getMatrixId(f[0]),
          TileCol: f[1],
          TileRow: f[2]
        };
        Object.assign(y, l);
        let b = t;
        return e == "KVP" ? b = _S(b, y) : b = b.replace(/\{(\w+?)\}/g, function(x, w) {
          return encodeURIComponent(y[w]);
        }), b;
      }
    );
  }
}
function BQ(n, t) {
  const a = n.Contents.Layer?.find(function(mt) {
    return mt.Identifier == t.layer;
  });
  if (!a)
    return null;
  const s = n.Contents.TileMatrixSet;
  let l;
  a.TileMatrixSetLink.length > 1 ? "projection" in t ? l = a.TileMatrixSetLink.findIndex(function(mt) {
    const Ut = s.find(function(J) {
      return J.Identifier == mt.TileMatrixSet;
    }).SupportedCRS, Ft = $i(Ut), nt = $i(t.projection);
    return Ft && nt ? R_(Ft, nt) : Ut == t.projection;
  }) : l = a.TileMatrixSetLink.findIndex(function(mt) {
    return mt.TileMatrixSet == t.matrixSet;
  }) : l = 0, l < 0 && (l = 0);
  const f = (
    /** @type {string} */
    a.TileMatrixSetLink[l].TileMatrixSet
  ), h = (
    /** @type {Array<Object>} */
    a.TileMatrixSetLink[l].TileMatrixSetLimits
  );
  let p = (
    /** @type {string} */
    a.Format[0]
  );
  "format" in t && (p = t.format), l = a.Style.findIndex(function(mt) {
    return "style" in t ? mt.Title == t.style : mt.isDefault;
  }), l < 0 && (l = 0);
  const y = (
    /** @type {string} */
    a.Style[l].Identifier
  ), b = {};
  "Dimension" in a && a.Dimension.forEach(function(mt, St, Ut) {
    const Ft = mt.Identifier;
    let nt = mt.Default;
    nt === void 0 && (nt = mt.Value[0]), b[Ft] = nt;
  });
  const w = n.Contents.TileMatrixSet.find(function(mt) {
    return mt.Identifier == f;
  });
  let A;
  const C = w.SupportedCRS;
  if (C && (A = $i(C)), "projection" in t) {
    const mt = $i(t.projection);
    mt && (!A || R_(mt, A)) && (A = mt);
  }
  let L = !1;
  const N = A.getAxisOrientation().startsWith("ne");
  let U = w.TileMatrix[0], k = {
    MinTileCol: 0,
    MinTileRow: 0,
    // subtract one to end up at tile top left
    MaxTileCol: U.MatrixWidth - 1,
    MaxTileRow: U.MatrixHeight - 1
  };
  if (h) {
    k = h[h.length - 1];
    const mt = w.TileMatrix.find(
      (St) => St.Identifier === k.TileMatrix || w.Identifier + ":" + St.Identifier === k.TileMatrix
    );
    mt && (U = mt);
  }
  const H = U.ScaleDenominator * 28e-5 / A.getMetersPerUnit(), B = N ? [U.TopLeftCorner[1], U.TopLeftCorner[0]] : U.TopLeftCorner, z = U.TileWidth * H, Q = U.TileHeight * H;
  let et = w.BoundingBox;
  et && N && (et = [
    et[1],
    et[0],
    et[3],
    et[2]
  ]);
  let ot = [
    B[0] + z * k.MinTileCol,
    // add one to get proper bottom/right coordinate
    B[1] - Q * (1 + k.MaxTileRow),
    B[0] + z * (1 + k.MaxTileCol),
    B[1] - Q * k.MinTileRow
  ];
  if (et !== void 0 && !nd(et, ot)) {
    const mt = a.WGS84BoundingBox, St = $i("EPSG:4326").getExtent();
    if (ot = et, mt)
      L = mt[0] === St[0] && mt[2] === St[2];
    else {
      const Ut = F9(
        et,
        w.SupportedCRS,
        "EPSG:4326"
      );
      L = Ut[0] - 1e-10 <= St[0] && Ut[2] + 1e-10 >= St[2];
    }
  }
  const pt = DQ(
    w,
    ot,
    h
  ), ht = [];
  let Ct = t.requestEncoding;
  if (Ct = Ct !== void 0 ? Ct : "", "OperationsMetadata" in n && "GetTile" in n.OperationsMetadata) {
    const mt = n.OperationsMetadata.GetTile.DCP.HTTP.Get;
    for (let St = 0, Ut = mt.length; St < Ut; ++St)
      if (mt[St].Constraint) {
        const nt = mt[St].Constraint.find(function(J) {
          return J.name == "GetEncoding";
        }).AllowedValues.Value;
        if (Ct === "" && (Ct = nt[0]), Ct === "KVP")
          nt.includes("KVP") && ht.push(
            /** @type {string} */
            mt[St].href
          );
        else
          break;
      } else mt[St].href && (Ct = "KVP", ht.push(
        /** @type {string} */
        mt[St].href
      ));
  }
  return ht.length === 0 && (Ct = "REST", a.ResourceURL.forEach(function(mt) {
    mt.resourceType === "tile" && (p = mt.format, ht.push(
      /** @type {string} */
      mt.template
    ));
  })), {
    urls: ht,
    layer: t.layer,
    matrixSet: f,
    format: p,
    projection: A,
    requestEncoding: Ct,
    tileGrid: pt,
    style: y,
    dimensions: b,
    wrapX: L,
    crossOrigin: t.crossOrigin
  };
}
const Z5 = hd({
  name: "map",
  initialState: {
    map: null,
    topicLayers: null,
    baseLayer: null
  },
  reducers: {
    initMap: (n, t) => {
      n.map = t.payload.map, n.topicLayers = t.payload.topicLayers, n.baseLayer = t.payload.baseLayer;
    }
  }
}), { initMap: qQ } = Z5.actions, VQ = Z5.reducer, W5 = hd({
  name: "mapQuery",
  initialState: {
    loading: !1,
    visible: !1,
    posX: 0,
    posY: 0,
    results: []
  },
  reducers: {
    loadAt: (n, t) => {
      n.loading || (n.loading = !0, n.visible = !1, n.posX = t.payload.posX, n.posY = t.payload.posY, n.results = []);
    },
    show: (n, t) => {
      n.loading = !1, n.visible = !0, n.results = t.payload.results;
    },
    hide: (n) => {
      n.loading = !1, n.visible = !1;
    }
  }
}), { loadAt: Q5, show: J5, hide: C_ } = W5.actions, YQ = W5.reducer, tI = function(n, t) {
  const e = new URL(n + "getegrid/json/");
  return e.searchParams.append("EN", "" + t[0] + "," + t[1]), e.searchParams.append("_dc", (/* @__PURE__ */ new Date()).getTime()), new Promise((a, s) => {
    fetch(e.toString()).then((l) => {
      l.status === 204 || l.status >= 400 ? s(l) : a(l.json());
    });
  });
}, eI = function(n) {
  const t = Te((a) => a.availability).visible;
  return n.availabilityLayer.setVisible(t), null;
};
eI.propTypes = {
  availabilityLayer: wa.object.isRequired
};
const nI = function(n) {
  const t = Lo(), e = Te((N) => N.config).config, a = Te((N) => N.mapQuery), s = Se.useRef(null), l = Te((N) => N.language), f = l.current, h = l.default, [p, y] = Se.useState(null), { t: b } = gr(), x = e.service_url, w = n.map;
  Se.useEffect(() => {
    if (p === null) {
      const N = new ZZ({
        element: s.current,
        autoPan: {
          animation: !0,
          margin: Math.min(document.body.offsetWidth, document.body.offsetHeight) / 2
        },
        offset: [-17, -17]
      });
      w.addOverlay(N), y(N);
    }
  });
  const A = function() {
    t(C_());
  }, C = function(N, U, k) {
    t(C_()), t(G_([])), t(mE({
      egrid: N,
      identdn: U,
      number: k,
      zoom: !1
    })), _E(x, N, U, k, e.extract_json_timeout, f).then((H) => {
      t(pE(H)), t(yE(H));
    }).catch((H) => {
      H instanceof sd ? (t(w0()), t(om(b("extract.error.too_many_requests"), !0))) : t($_());
    });
  }, L = a.results.map((N, U) => {
    const k = N.egrid, H = N.identDN, B = N.number, z = ja(N.type.Text, f, h);
    return /* @__PURE__ */ Z.jsx(
      "button",
      {
        onClick: C.bind(this, k, H, B),
        type: "button",
        className: "list-group-item list-group-item-action",
        children: /* @__PURE__ */ Z.jsxs("small", { children: [
          z,
          " ",
          B
        ] })
      },
      U
    );
  });
  return a.loading ? (p.setPosition([a.posX, a.posY]), /* @__PURE__ */ Z.jsx("div", { className: "oereb-client-overlay", ref: s, children: /* @__PURE__ */ Z.jsx("div", { className: "loader", children: /* @__PURE__ */ Z.jsx("div", { className: "spinner-grow" }) }) })) : a.visible ? (p.setPosition([a.posX, a.posY]), /* @__PURE__ */ Z.jsx("div", { className: "oereb-client-overlay", ref: s, children: /* @__PURE__ */ Z.jsxs("div", { className: "results", children: [
    /* @__PURE__ */ Z.jsx("div", { className: "background-icon" }),
    /* @__PURE__ */ Z.jsxs("div", { className: "content list-group", children: [
      /* @__PURE__ */ Z.jsx(
        "button",
        {
          onClick: A,
          type: "button",
          className: "list-group-item list-group-item-action text-end",
          children: /* @__PURE__ */ Z.jsx("strong", { className: "bi bi-x" })
        }
      ),
      L
    ] }),
    /* @__PURE__ */ Z.jsx("div", { className: "icon", children: /* @__PURE__ */ Z.jsx("div", { className: "icon-outer", children: /* @__PURE__ */ Z.jsx("div", { className: "icon-inner" }) }) })
  ] }) })) : /* @__PURE__ */ Z.jsx("div", { className: "oereb-client-overlay", ref: s });
};
nI.propTypes = {
  /** The OpenLayers map instance. */
  map: wa.object.isRequired
};
const iI = function(n) {
  const t = Te((f) => f.extract).data, e = Te((f) => f.extract).highlight, a = Te((f) => f.extract).zoom, s = n.realEstateLayer, l = n.map;
  if (s.getSource().clear(), s.setVisible(e), Reflect.apply(Object.prototype.hasOwnProperty, t, ["GetExtractByIdResponse"])) {
    const f = t.GetExtractByIdResponse.extract.RealEstate.Limit, h = new QT(f.coordinates);
    if (s.getSource().addFeature(new ZC(h)), a) {
      let p = [10, 10, 10, 500];
      document.body.offsetWidth < 1200 && (p = [190, 10, 10, 10]), l.getView().fit(h, {
        padding: p
      });
    }
  }
  return null;
};
iI.propTypes = {
  map: wa.object.isRequired,
  realEstateLayer: wa.object.isRequired
};
const FQ = function(n, t, e) {
  const a = ja(
    n.ReferenceWMS,
    t,
    e
  ).split("?"), l = {
    url: a[0],
    params: {},
    opacity: n.layerOpacity,
    zIndex: 21e3 + n.layerIndex
  }, f = a[1].split("&");
  for (let h = 0; h < f.length; h++) {
    const p = [
      "SERVICE",
      "VERSION",
      "REQUEST",
      "FORMAT",
      "CRS",
      "SRS",
      "LAYERS",
      "STYLES",
      "BBOX",
      "WIDTH",
      "HEIGHT",
      "TRANSPARENT"
    ], y = f[h].split("="), b = y[0], x = y[1];
    p.indexOf(b.toUpperCase()) > -1 ? l.params[b.toUpperCase()] = decodeURIComponent(x) : l.params[b] = x;
  }
  return l;
}, aI = function(n) {
  const t = n.topicLayers, e = n.tiled, a = Te((y) => y.accordion).viewServices, s = Te((y) => y.accordion).callback, l = Te((y) => y.extract).visible, f = Te((y) => y.language), h = f.current, p = f.default;
  if (t.setVisible(!1), t.getLayers().clear(), l && Re.isArray(a) && a.length > 0) {
    const y = a.map((b) => {
      const x = FQ(b, h, p);
      let w = P5, A = Y5;
      e && (w = nC, A = MO);
      const C = Re.isNumber(x.opacity) ? x.opacity : 1, L = Re.isNumber(x.zIndex) ? x.zIndex : 1, N = new A({
        url: x.url,
        params: x.params,
        projection: "EPSG:2056"
      });
      return Re.isFunction(s) && (N.on("imageloadstart", () => {
        s(!0);
      }), N.on("imageloadend", () => {
        s(!1);
      }), N.on("imageloaderror", () => {
        s(!1);
      })), new w({
        preload: 1 / 0,
        visible: !0,
        opacity: C,
        zIndex: L,
        source: N
      });
    });
    t.getLayers().extend(y), t.setVisible(!0);
  }
  return null;
};
aI.propTypes = {
  topicLayers: wa.object.isRequired,
  tiled: wa.bool.isRequired
};
const $Q = function(n) {
  const t = {
    url: n.url,
    params: n.params,
    projection: "EPSG:2056"
  };
  return (Re.isString(n.attributions) || Re.isArray(n.attributions)) && (t.attributions = n.attributions), Promise.resolve(new MO(t));
}, XQ = function(n) {
  const t = new zW();
  return new Promise(function(e, a) {
    fetch(n.url).then((s) => s.text()).then((s) => {
      const l = t.read(s), f = {};
      Object.entries(n).forEach(([p, y]) => {
        p !== "url" && (f[p] = y);
      });
      const h = BQ(l, f);
      (Re.isString(n.attributions) || Re.isArray(n.attributions)) && (h.attributions = n.attributions), e(new HQ(h));
    }).catch((s) => {
      a(s);
    });
  });
}, KQ = function(n) {
  return n.type.toLowerCase() === "wms" ? $Q(n) : n.type.toLowerCase() === "wmts" ? XQ(n) : Promise.reject(new Error("Invalid base layer type"));
}, ZQ = function() {
  const { t: n } = gr(), t = Se.useRef(null), e = Te((Ct) => Ct.config).config, a = Te((Ct) => Ct.language), s = Te((Ct) => Ct.extract).background, l = Te((Ct) => Ct.map).baseLayer, f = a.current, h = Lo(), p = new URLSearchParams(window.location.search), y = e.service_url, [b, x] = Se.useState(null), w = e.use_tile_wms, A = e.show_scale_bar, C = e.enable_rotation;
  let L = P5, N = Y5;
  w && (L = nC, N = MO);
  const U = {
    preload: 1 / 0,
    source: new N({
      url: e.availability.url,
      params: e.availability.params
    }),
    zIndex: 1e4
  };
  (Re.isString(e.availability.attributions) || Re.isArray(e.availability.attributions)) && (U.attributions = e.availability.attributions);
  const [k] = Se.useState(new L(U));
  let H = null;
  if (Re.isObject(e.mask_surrounding)) {
    const Ct = {
      preload: 1 / 0,
      source: new N({
        url: e.mask_surrounding.url,
        params: e.mask_surrounding.params
      }),
      opacity: e.mask_surrounding.opacity,
      zIndex: 4e4
    };
    (Re.isString(e.mask_surrounding.attributions) || Re.isArray(e.mask_surrounding.attributions)) && (Ct.attributions = e.mask_surrounding.attributions), H = new L(Ct);
  }
  const [B] = Se.useState(H), [z] = Se.useState(new P0({
    layers: new Nf([]),
    visible: !1,
    zIndex: 2e4
  })), [Q] = Se.useState(new _Z({
    source: new WX({}),
    style: new E0({
      fill: void 0,
      stroke: new HS({
        color: [255, 0, 0, 0.75],
        width: 7,
        lineCap: "square",
        lineJoin: "miter"
      })
    }),
    zIndex: 3e4
  }));
  if (b === null) {
    const Ct = parseFloat(p.get("map_x")) || e.view.map_x, mt = parseFloat(p.get("map_y")) || e.view.map_y, St = parseFloat(p.get("map_zoom")) || e.view.map_zoom, Ut = [];
    if (Ut.push(new b5({
      collapsible: document.body.offsetWidth < 1200
    })), A && Ut.push(new QZ({
      units: "metric",
      bar: !0,
      steps: 1
    })), C) {
      const nt = document.createElement("i");
      nt.setAttribute("class", "bi bi-arrow-up-circle"), Ut.push(new S5({
        label: nt
      }));
    }
    const Ft = new DL({
      controls: x5({
        attribution: !1,
        rotate: !1
      }).extend(Ut),
      interactions: M5({
        altShiftDragRotate: C,
        pinchRotate: C
      }),
      view: new td({
        center: [Ct, mt],
        zoom: St,
        resolutions: e.view.resolutions,
        projection: "EPSG:2056"
      })
    });
    KQ(e.base_layer).then(function(nt) {
      const J = new nC({
        preload: 1 / 0,
        visible: !0,
        source: nt,
        zIndex: 0
      });
      Ft.addLayer(J), Ft.addLayer(k), B !== null && Ft.addLayer(B), Ft.addLayer(z), Ft.addLayer(Q), h(qQ({
        map: Ft,
        topicLayers: z,
        baseLayer: J
      }));
    }), Ft.on("moveend", function() {
      const nt = new URLSearchParams(window.location.search);
      nt.set("map_x", Ft.getView().getCenter()[0].toFixed(3)), nt.set("map_y", Ft.getView().getCenter()[1].toFixed(3)), nt.set("map_zoom", Ft.getView().getZoom().toFixed(0)), window.history.pushState(null, null, "?" + nt.toString());
    }), Ft.on("singleclick", function(nt) {
      const J = Ft.getEventCoordinate(nt.originalEvent);
      h(Q5({
        posX: J[0],
        posY: J[1]
      })), tI(y, J).then((gt) => {
        const Ot = gt.GetEGRIDResponse;
        if (Ot.length > 1)
          h(J5({
            results: Ot
          }));
        else if (Ot.length === 1) {
          const W = Ot[0].egrid, j = Ot[0].identDN, X = Ot[0].number;
          h(C_()), h(mE({
            egrid: W,
            identdn: j,
            number: X,
            zoom: !1
          })), _E(y, W, j, X, e.extract_json_timeout, f).then((st) => {
            h(pE(st)), h(yE(st));
          }).catch((st) => {
            st instanceof sd ? (h(w0()), h(om(n("extract.error.too_many_requests"), !0))) : h($_());
          });
        } else
          throw new pA("No data available");
      }, (gt) => {
        throw gt.status === 204 ? new pA("No data available") : gt.status === 429 ? new sd("Too many requests") : new Error();
      }).catch((gt) => {
        gt instanceof pA ? h(om(n("map.warning.no_data"))) : gt instanceof sd ? h(om(n("extract.error.too_many_requests"), !0)) : h(v$(n("map.error.unknown"))), h(C_());
      });
    }), x(Ft);
  }
  Se.useEffect(() => {
    b.setTarget(t.current);
  });
  let et = null, ot = null, pt = null, ht = null;
  return b instanceof DL && (et = /* @__PURE__ */ Z.jsx(nI, { map: b }), ot = /* @__PURE__ */ Z.jsx(iI, { map: b, realEstateLayer: Q }), pt = /* @__PURE__ */ Z.jsx(aI, { topicLayers: z, tiled: w }), ht = /* @__PURE__ */ Z.jsx(eI, { availabilityLayer: k })), l instanceof $C && l.setVisible(s), /* @__PURE__ */ Z.jsxs("div", { className: "oereb-client-map-wrapper", children: [
    et,
    ot,
    pt,
    ht,
    /* @__PURE__ */ Z.jsx("div", { ref: t, className: "oereb-client-map" })
  ] });
}, WQ = function(n, t, e) {
  const a = new URL(n);
  a.searchParams.append("term", t), a.searchParams.append("lang", e);
  let s;
  return {
    promise: new Promise((f, h) => {
      fetch(a.toString()).then((p) => p.json()).then((p) => {
        f(p);
      }).catch((p) => {
        h(p);
      }), s = function() {
        h(new Error("Request canceled"));
      };
    }),
    cancel: s
  };
}, rI = new RegExp("^(\\d{7}(\\.\\d+)?)(\\s|,\\s?|;\\s?)(\\d{7}(\\.\\d+)?)"), sI = new RegExp("^(\\d{1}(\\.\\d+)?)(\\s|,\\s?|;\\s?)(\\d{2}(\\.\\d+)?)"), GL = function(n) {
  return Re.isArray(n) ? [
    parseFloat(n[1]),
    parseFloat(n[4])
  ] : null;
}, oI = function(n) {
  return rI.test(n);
}, lI = function(n) {
  return sI.test(n);
}, UL = function(n) {
  if (lI(n)) {
    const t = GL(sI.exec(n));
    return new cE(t).transform("EPSG:4326", "EPSG:2056").getCoordinates();
  } else if (oI(n))
    return GL(rI.exec(n));
  return null;
}, QQ = function() {
  const { t: n } = gr(), t = Lo(), e = Te((b) => b.config).config, a = e.service_url, s = Te((b) => b.language), l = s.current, f = s.available, h = Te((b) => b.extract), p = function(b) {
    b !== l && (t(jH(b)), h.visible && (t(mE({
      egrid: h.egrid,
      identdn: h.identdn,
      number: h.number,
      zoom: !1
    })), _E(
      a,
      h.egrid,
      h.identdn,
      h.number,
      e.extract_json_timeout,
      b
    ).then((x) => {
      t(pE(x)), t(yE(x));
    }).catch((x) => {
      x instanceof sd ? (t(w0()), t(om(n("extract.error.too_many_requests"), !0))) : t($_());
    })));
  }, y = f.map(
    (b, x) => /* @__PURE__ */ Z.jsx("li", { children: /* @__PURE__ */ Z.jsx("button", { className: "dropdown-item", onClick: p.bind(this, b), children: b.toUpperCase() }) }, x)
  );
  return /* @__PURE__ */ Z.jsxs("div", { className: "oereb-client-language-selector", children: [
    /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: "btn btn-outline-secondary dropdown-toggle",
        type: "button",
        "data-bs-toggle": "dropdown",
        "aria-expanded": "false",
        title: n("menu.language.title"),
        children: l.toUpperCase()
      }
    ),
    /* @__PURE__ */ Z.jsx("ul", { className: "dropdown-menu", children: y })
  ] });
}, JQ = function() {
  const { t: n } = gr(), t = Te((s) => s.config).config, e = Te((s) => s.language).current;
  if (!Re.isString(t.user_guide))
    return null;
  const a = function() {
    const s = {
      lang: e
    }, l = t.user_guide;
    window.open(encodeURI(S2(l, s)), "_blank");
  };
  return /* @__PURE__ */ Z.jsx(
    "button",
    {
      type: "button",
      className: "btn btn-outline-secondary oereb-client-user-guide",
      title: n("menu.user_guide.title"),
      onClick: a,
      children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-question-circle" })
    }
  );
}, tJ = function() {
  const { t: n } = gr(), t = Te((j) => j.config).config, e = Te((j) => j.availability).visible, a = Te((j) => j.symbolZoom).enabled;
  Te((j) => j.extract).highlight, Te((j) => j.extract).background;
  const s = Te((j) => j.history).elements.slice().reverse(), l = Lo(), f = t.search_url, h = t.service_url, p = Te((j) => j.language), y = p.current, b = p.default, x = p.available, [w, A] = Se.useState(""), [C, L] = Se.useState(null), [N, U] = Se.useState([]), [k, H] = Se.useState(!1), B = jN(t.application.logo_oereb, y, b), z = jN(t.application.logo_canton, y, b);
  let Q = null;
  Re.isArray(x) && x.length > 1 && (Q = /* @__PURE__ */ Z.jsx(QQ, {}));
  const et = function(j, X, st) {
    l(G_([])), l(mE({
      egrid: j,
      identdn: X,
      number: st,
      zoom: !0
    })), _E(h, j, X, st, t.extract_json_timeout, y).then((At) => {
      l(pE(At)), l(yE(At));
    }).catch((At) => {
      At instanceof sd ? (l(w0()), l(om(n("extract.error.too_many_requests"), !0))) : l($_());
    });
  }, ot = function(j) {
    l(Q5({
      posX: j[0],
      posY: j[1]
    })), tI(h, j).then((X) => {
      const st = X.GetEGRIDResponse;
      st.length > 1 ? l(J5({
        results: st
      })) : st.length === 1 ? (l(C_()), et(st[0].egrid)) : l(C_());
    }).catch((X) => {
      X.status === 429 && l(om(n("extract.error.too_many_requests")), !0), l(C_());
    });
  }, pt = function() {
    A(""), U([]);
  }, ht = function(j) {
    pt(), Re.isString(j.egrid) ? et(j.egrid, null, null) : Re.isString(j.identdn) && Re.isString(j.number) ? et(null, j.identdn, j.number) : Re.isArray(j.coordinates) && ot(j.coordinates);
  }, Ct = function(j) {
    const X = j.target.value;
    if (A(X), C !== null && C.cancel(), X.length > 0) {
      H(!0);
      const st = WQ(f, X, y), At = st.promise;
      L(st), At.then((Dt) => {
        let It = [];
        oI(X) && (It = It.concat([{
          title: n("menu.search.title.coordinates.lv95"),
          results: [{
            label: X,
            coordinates: UL(X)
          }]
        }])), lI(X) && (It = It.concat([{
          title: n("menu.search.title.coordinates.wgs84"),
          results: [{
            label: X,
            coordinates: UL(X)
          }]
        }])), It = It.concat(Dt), U(It), H(!1);
      }).catch(() => {
        H(!1);
      });
    } else
      pt();
  }, mt = N.map((j, X) => {
    if (j.results.length > 0) {
      const st = j.results.map(
        (Dt, It) => /* @__PURE__ */ Z.jsx(
          "button",
          {
            className: "list-group-item list-group-item-action search-result text-start",
            onClick: ht.bind(this, Dt),
            children: Dt.label
          },
          It
        )
      );
      return /* @__PURE__ */ Z.jsxs("div", { className: "list-group result-list", children: [
        /* @__PURE__ */ Z.jsxs("div", { className: "list-group-item", children: [
          /* @__PURE__ */ Z.jsx("strong", { children: j.title }),
          /* @__PURE__ */ Z.jsx("span", { className: "badge bg-secondary float-end", children: j.results.length })
        ] }),
        st
      ] }, X);
    }
    return null;
  }), Ut = function() {
    return w.length === 0 ? /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: "btn btn-outline-secondary",
        type: "button",
        title: n("menu.search.reset"),
        disabled: !0,
        children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-trash" })
      }
    ) : k ? /* @__PURE__ */ Z.jsx(
      "button",
      {
        className: "btn btn-outline-secondary",
        type: "button",
        disabled: !0,
        children: /* @__PURE__ */ Z.jsx("span", { className: "spinner-grow spinner-grow-sm", role: "status" })
      }
    ) : /* @__PURE__ */ Z.jsx(
      "button",
      {
        onClick: pt,
        className: "btn btn-outline-secondary",
        title: n("menu.search.reset"),
        type: "button",
        children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-trash" })
      }
    );
  }(), Ft = e ? /* @__PURE__ */ Z.jsxs("span", { children: [
    /* @__PURE__ */ Z.jsx("i", { className: "bi bi-check-square" }),
    " ",
    n("menu.settings.availability")
  ] }) : /* @__PURE__ */ Z.jsxs("span", { children: [
    /* @__PURE__ */ Z.jsx("i", { className: "bi bi-square" }),
    " ",
    n("menu.settings.availability")
  ] }), nt = function() {
    l(RH(!e));
  }, J = a ? /* @__PURE__ */ Z.jsxs("span", { children: [
    /* @__PURE__ */ Z.jsx("i", { className: "bi bi-check-square" }),
    " ",
    n("menu.settings.symbol_zoom")
  ] }) : /* @__PURE__ */ Z.jsxs("span", { children: [
    /* @__PURE__ */ Z.jsx("i", { className: "bi bi-square" }),
    " ",
    n("menu.settings.symbol_zoom")
  ] }), gt = function() {
    l(qH(!a));
  }, Ot = s.map(
    (j, X) => /* @__PURE__ */ Z.jsx("li", { children: /* @__PURE__ */ Z.jsxs(
      "button",
      {
        className: "dropdown-item",
        onClick: et.bind(this, j.EGRID, j.IdentDN, j.Number),
        children: [
          j.Municipality,
          " ",
          j.Number,
          " (",
          j.EGRID,
          ")"
        ]
      }
    ) }, X)
  );
  let W = "btn btn-outline-secondary dropdown-toggle";
  return s.length < 1 && (W += " disabled"), /* @__PURE__ */ Z.jsxs("div", { className: "oereb-client-menu d-flex flex-column pb-3", children: [
    /* @__PURE__ */ Z.jsxs("div", { className: "flex-grow-1 row justify-content-evenly", children: [
      /* @__PURE__ */ Z.jsx("div", { className: "col", children: /* @__PURE__ */ Z.jsx("img", { className: "img-fluid p-2", src: B }) }),
      /* @__PURE__ */ Z.jsx("div", { className: "col text-end", children: /* @__PURE__ */ Z.jsx("img", { className: "img-fluid p-2", src: z }) })
    ] }),
    /* @__PURE__ */ Z.jsx("div", { className: "container-fluid", children: /* @__PURE__ */ Z.jsxs("div", { className: "input-group", children: [
      Q,
      /* @__PURE__ */ Z.jsx(
        "button",
        {
          className: "btn btn-outline-secondary dropdown-toggle",
          type: "button",
          "data-bs-toggle": "dropdown",
          "aria-expanded": "false",
          title: n("menu.settings.title"),
          children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-gear-fill" })
        }
      ),
      /* @__PURE__ */ Z.jsxs("ul", { className: "dropdown-menu", children: [
        /* @__PURE__ */ Z.jsx("li", { children: /* @__PURE__ */ Z.jsx("button", { className: "dropdown-item", onClick: nt, children: Ft }) }),
        /* @__PURE__ */ Z.jsx("li", { children: /* @__PURE__ */ Z.jsx("button", { className: "dropdown-item", onClick: gt, children: J }) })
      ] }),
      /* @__PURE__ */ Z.jsx(
        "button",
        {
          className: W,
          type: "button",
          "data-bs-toggle": "dropdown",
          "aria-expanded": "false",
          title: n("menu.history.title"),
          children: /* @__PURE__ */ Z.jsx("i", { className: "bi bi-clock-history" })
        }
      ),
      /* @__PURE__ */ Z.jsx("ul", { className: "dropdown-menu", children: Ot }),
      /* @__PURE__ */ Z.jsx(
        "input",
        {
          type: "text",
          className: "form-control",
          value: w,
          onChange: Ct,
          placeholder: n("menu.search.placeholder")
        }
      ),
      Ut,
      /* @__PURE__ */ Z.jsx(JQ, {})
    ] }) }),
    /* @__PURE__ */ Z.jsx("div", { className: "container-fluid", children: mt })
  ] });
}, uI = function() {
  const n = Se.useRef(null), t = Te((h) => h.message).messages, e = Te((h) => h.language), a = Lo(), { t: s } = gr(), l = function(h) {
    document.body.querySelectorAll(".toast").forEach((y) => {
      y.getAttribute("data-oereb-message-id") === h && oE.getOrCreateInstance(y).hide();
    }), setTimeout(() => {
      a(y$(h));
    }, 500);
  }, f = t.map((h, p) => {
    let y, b;
    h.type === "warning" ? (b = /* @__PURE__ */ Z.jsx("i", { className: "bi bi-exclamation-triangle-fill text-warning me-2" }), y = s("message.warning")) : h.type === "error" ? (b = /* @__PURE__ */ Z.jsx("i", { className: "bi bi-x-octagon-fill text-danger me-2" }), y = s("message.error")) : (b = /* @__PURE__ */ Z.jsx("i", { className: "bi bi-info-circle-fill text-primary me-2" }), y = s("message.info"));
    let x;
    return Re.isString(h.text) ? x = h.text : x = h.text[e.current] || h.text[e.default], /* @__PURE__ */ Z.jsxs(
      "div",
      {
        className: "toast",
        role: "alert",
        "aria-live": "assertive",
        "aria-atomic": "true",
        "data-bs-autohide": "false",
        "data-oereb-message-id": h.id,
        "data-oereb-message-confirm": h.confirmation,
        children: [
          /* @__PURE__ */ Z.jsxs("div", { className: "toast-header", children: [
            b,
            /* @__PURE__ */ Z.jsx("strong", { className: "me-auto", children: y }),
            /* @__PURE__ */ Z.jsx(
              "button",
              {
                type: "button",
                className: "btn-close",
                "aria-label": "Close",
                onClick: l.bind(this, h.id)
              }
            )
          ] }),
          /* @__PURE__ */ Z.jsx("div", { className: "toast-body", children: x })
        ]
      },
      h.id
    );
  });
  return Se.useEffect(() => {
    n.current.querySelectorAll(".toast").forEach((p) => {
      if (!p.hasAttribute("initialized")) {
        const y = oE.getOrCreateInstance(p);
        y.show(), p.getAttribute("data-oereb-message-confirm") !== "true" && setTimeout(() => {
          y.hide();
        }, GS - 500);
      }
      p.setAttribute("initialized", !0);
    });
  }, [f]), /* @__PURE__ */ Z.jsx("div", { ref: n, className: "toast-container position-absolute bottom-0 end-0 mb-3 me-3", children: f });
};
uI.propTypes = {};
const cI = ({ matomoUrl: n, siteId: t }) => (Se.useEffect(() => {
  const e = document.createElement("script");
  e.type = "text/javascript", e.async = !0, e.defer = !0, e.src = `${n}/matomo.js`, document.body.appendChild(e), window._paq = window._paq || [], window._paq.push(["trackPageView"]), window._paq.push(["enableLinkTracking"]), window._paq.push(["setTrackerUrl", `${n}/matomo.php`]), window._paq.push(["setSiteId", t]);
}, [n, t]), null);
cI.propTypes = {
  matomoUrl: wa.string.isRequired,
  siteId: wa.number.isRequired
};
const fI = function(n) {
  const t = Lo(), e = n.config, a = new URLSearchParams(window.location.search);
  if (t(UH({
    available: e.application.languages,
    default: e.application.default_language
  })), t(MH(e)), Re.isString(e.application.local_storage_prefix)) {
    const h = e.application.local_storage_prefix;
    t(PH(h)), t(TH(h)), t(HH(h));
  }
  t(zH()), t(wH()), t(BH());
  const s = a.has("egrid"), l = a.has("identdn") && a.has("number");
  if (s || l) {
    const h = a.get("egrid") || null, p = a.get("identdn") || null, y = a.get("number") || null;
    t(mE({
      egrid: h,
      identdn: p,
      number: y,
      zoom: !0
    })), _E(
      e.service_url,
      h,
      p,
      y,
      e.extract_json_timeout,
      a.get("lang")
    ).then((b) => {
      t(pE(b)), t(yE(b));
    }).catch(() => {
      t($_());
    });
  }
  let f = null;
  return e.matomo && e.matomo.url && e.matomo.site_id && (f = /* @__PURE__ */ Z.jsx(cI, { matomoUrl: e.matomo.url, siteId: e.matomo.site_id })), Re.isArray(e.messages) && e.messages.forEach((h) => {
    t(_$(h.text, !0));
  }), /* @__PURE__ */ Z.jsxs("div", { className: "oereb-client-app", children: [
    /* @__PURE__ */ Z.jsx(ZQ, {}),
    /* @__PURE__ */ Z.jsx(A$, {}),
    /* @__PURE__ */ Z.jsx(w$, {}),
    /* @__PURE__ */ Z.jsx(tJ, {}),
    /* @__PURE__ */ Z.jsx(uI, {}),
    f
  ] });
};
fI.propTypes = {
  config: wa.object.isRequired
};
const eJ = hH({
  reducer: {
    config: CH,
    map: VQ,
    mapQuery: YQ,
    extract: IH,
    accordion: XH,
    language: kH,
    availability: AH,
    symbolZoom: VH,
    history: GH,
    message: E$
  },
  middleware: (n) => n({
    serializableCheck: !1
  })
});
TC.defs(
  "EPSG:2056",
  "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs"
);
X9(TC);
const nJ = document.getElementById("app"), iJ = Wj.createRoot(nJ);
iJ.render(
  /* @__PURE__ */ Z.jsx(mk, { store: eJ, children: /* @__PURE__ */ Z.jsx(fI, { config: JSON.parse(document.getElementById("config").textContent) }) })
);
export {
  f0 as c,
  FI as g
};
