(function () {
  const J = document.createElement("link").relList;
  if (J && J.supports && J.supports("modulepreload")) return;
  for (const V of document.querySelectorAll('link[rel="modulepreload"]')) b(V);
  new MutationObserver((V) => {
    for (const ue of V)
      if (ue.type === "childList")
        for (const re of ue.addedNodes)
          re.tagName === "LINK" && re.rel === "modulepreload" && b(re);
  }).observe(document, { childList: !0, subtree: !0 });
  function S(V) {
    const ue = {};
    return (
      V.integrity && (ue.integrity = V.integrity),
      V.referrerPolicy && (ue.referrerPolicy = V.referrerPolicy),
      V.crossOrigin === "use-credentials"
        ? (ue.credentials = "include")
        : V.crossOrigin === "anonymous"
          ? (ue.credentials = "omit")
          : (ue.credentials = "same-origin"),
      ue
    );
  }
  function b(V) {
    if (V.ep) return;
    V.ep = !0;
    const ue = S(V);
    fetch(V.href, ue);
  }
})();
function ef(w) {
  return w && w.__esModule && Object.prototype.hasOwnProperty.call(w, "default")
    ? w.default
    : w;
}
var au = { exports: {} },
  Xr = {};
/**
 * @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 dp;
function tf() {
  if (dp) return Xr;
  dp = 1;
  var w = Symbol.for("react.transitional.element"),
    J = Symbol.for("react.fragment");
  function S(b, V, ue) {
    var re = null;
    if (
      (ue !== void 0 && (re = "" + ue),
      V.key !== void 0 && (re = "" + V.key),
      "key" in V)
    ) {
      ue = {};
      for (var ee in V) ee !== "key" && (ue[ee] = V[ee]);
    } else ue = V;
    return (
      (V = ue.ref),
      { $$typeof: w, type: b, key: re, ref: V !== void 0 ? V : null, props: ue }
    );
  }
  return ((Xr.Fragment = J), (Xr.jsx = S), (Xr.jsxs = S), Xr);
}
var up;
function af() {
  return (up || ((up = 1), (au.exports = tf())), au.exports);
}
var e = af(),
  su = { exports: {} },
  Qe = {};
/**
 * @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 hp;
function sf() {
  if (hp) return Qe;
  hp = 1;
  var w = Symbol.for("react.transitional.element"),
    J = Symbol.for("react.portal"),
    S = Symbol.for("react.fragment"),
    b = Symbol.for("react.strict_mode"),
    V = Symbol.for("react.profiler"),
    ue = Symbol.for("react.consumer"),
    re = Symbol.for("react.context"),
    ee = Symbol.for("react.forward_ref"),
    B = Symbol.for("react.suspense"),
    T = Symbol.for("react.memo"),
    fe = Symbol.for("react.lazy"),
    G = Symbol.for("react.activity"),
    F = Symbol.iterator;
  function ce(g) {
    return g === null || typeof g != "object"
      ? null
      : ((g = (F && g[F]) || g["@@iterator"]),
        typeof g == "function" ? g : null);
  }
  var ve = {
      isMounted: function () {
        return !1;
      },
      enqueueForceUpdate: function () {},
      enqueueReplaceState: function () {},
      enqueueSetState: function () {},
    },
    Y = Object.assign,
    Ee = {};
  function Se(g, C, I) {
    ((this.props = g),
      (this.context = C),
      (this.refs = Ee),
      (this.updater = I || ve));
  }
  ((Se.prototype.isReactComponent = {}),
    (Se.prototype.setState = function (g, C) {
      if (typeof g != "object" && typeof g != "function" && g != 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, g, C, "setState");
    }),
    (Se.prototype.forceUpdate = function (g) {
      this.updater.enqueueForceUpdate(this, g, "forceUpdate");
    }));
  function le() {}
  le.prototype = Se.prototype;
  function ie(g, C, I) {
    ((this.props = g),
      (this.context = C),
      (this.refs = Ee),
      (this.updater = I || ve));
  }
  var $ = (ie.prototype = new le());
  (($.constructor = ie), Y($, Se.prototype), ($.isPureReactComponent = !0));
  var de = Array.isArray;
  function oe() {}
  var be = { H: null, A: null, T: null, S: null },
    Ye = Object.prototype.hasOwnProperty;
  function Te(g, C, I) {
    var X = I.ref;
    return {
      $$typeof: w,
      type: g,
      key: C,
      ref: X !== void 0 ? X : null,
      props: I,
    };
  }
  function Ie(g, C) {
    return Te(g.type, C, g.props);
  }
  function me(g) {
    return typeof g == "object" && g !== null && g.$$typeof === w;
  }
  function Oe(g) {
    var C = { "=": "=0", ":": "=2" };
    return (
      "$" +
      g.replace(/[=:]/g, function (I) {
        return C[I];
      })
    );
  }
  var te = /\/+/g;
  function Ae(g, C) {
    return typeof g == "object" && g !== null && g.key != null
      ? Oe("" + g.key)
      : C.toString(36);
  }
  function Ue(g) {
    switch (g.status) {
      case "fulfilled":
        return g.value;
      case "rejected":
        throw g.reason;
      default:
        switch (
          (typeof g.status == "string"
            ? g.then(oe, oe)
            : ((g.status = "pending"),
              g.then(
                function (C) {
                  g.status === "pending" &&
                    ((g.status = "fulfilled"), (g.value = C));
                },
                function (C) {
                  g.status === "pending" &&
                    ((g.status = "rejected"), (g.reason = C));
                },
              )),
          g.status)
        ) {
          case "fulfilled":
            return g.value;
          case "rejected":
            throw g.reason;
        }
    }
    throw g;
  }
  function y(g, C, I, X, pe) {
    var he = typeof g;
    (he === "undefined" || he === "boolean") && (g = null);
    var Ne = !1;
    if (g === null) Ne = !0;
    else
      switch (he) {
        case "bigint":
        case "string":
        case "number":
          Ne = !0;
          break;
        case "object":
          switch (g.$$typeof) {
            case w:
            case J:
              Ne = !0;
              break;
            case fe:
              return ((Ne = g._init), y(Ne(g._payload), C, I, X, pe));
          }
      }
    if (Ne)
      return (
        (pe = pe(g)),
        (Ne = X === "" ? "." + Ae(g, 0) : X),
        de(pe)
          ? ((I = ""),
            Ne != null && (I = Ne.replace(te, "$&/") + "/"),
            y(pe, C, I, "", function (ze) {
              return ze;
            }))
          : pe != null &&
            (me(pe) &&
              (pe = Ie(
                pe,
                I +
                  (pe.key == null || (g && g.key === pe.key)
                    ? ""
                    : ("" + pe.key).replace(te, "$&/") + "/") +
                  Ne,
              )),
            C.push(pe)),
        1
      );
    Ne = 0;
    var $e = X === "" ? "." : X + ":";
    if (de(g))
      for (var ae = 0; ae < g.length; ae++)
        ((X = g[ae]), (he = $e + Ae(X, ae)), (Ne += y(X, C, I, he, pe)));
    else if (((ae = ce(g)), typeof ae == "function"))
      for (g = ae.call(g), ae = 0; !(X = g.next()).done; )
        ((X = X.value), (he = $e + Ae(X, ae++)), (Ne += y(X, C, I, he, pe)));
    else if (he === "object") {
      if (typeof g.then == "function") return y(Ue(g), C, I, X, pe);
      throw (
        (C = String(g)),
        Error(
          "Objects are not valid as a React child (found: " +
            (C === "[object Object]"
              ? "object with keys {" + Object.keys(g).join(", ") + "}"
              : C) +
            "). If you meant to render a collection of children, use an array instead.",
        )
      );
    }
    return Ne;
  }
  function K(g, C, I) {
    if (g == null) return g;
    var X = [],
      pe = 0;
    return (
      y(g, X, "", "", function (he) {
        return C.call(I, he, pe++);
      }),
      X
    );
  }
  function O(g) {
    if (g._status === -1) {
      var C = g._result;
      ((C = C()),
        C.then(
          function (I) {
            (g._status === 0 || g._status === -1) &&
              ((g._status = 1), (g._result = I));
          },
          function (I) {
            (g._status === 0 || g._status === -1) &&
              ((g._status = 2), (g._result = I));
          },
        ),
        g._status === -1 && ((g._status = 0), (g._result = C)));
    }
    if (g._status === 1) return g._result.default;
    throw g._result;
  }
  var P =
      typeof reportError == "function"
        ? reportError
        : function (g) {
            if (
              typeof window == "object" &&
              typeof window.ErrorEvent == "function"
            ) {
              var C = new window.ErrorEvent("error", {
                bubbles: !0,
                cancelable: !0,
                message:
                  typeof g == "object" &&
                  g !== null &&
                  typeof g.message == "string"
                    ? String(g.message)
                    : String(g),
                error: g,
              });
              if (!window.dispatchEvent(C)) return;
            } else if (
              typeof process == "object" &&
              typeof process.emit == "function"
            ) {
              process.emit("uncaughtException", g);
              return;
            }
            console.error(g);
          },
    z = {
      map: K,
      forEach: function (g, C, I) {
        K(
          g,
          function () {
            C.apply(this, arguments);
          },
          I,
        );
      },
      count: function (g) {
        var C = 0;
        return (
          K(g, function () {
            C++;
          }),
          C
        );
      },
      toArray: function (g) {
        return (
          K(g, function (C) {
            return C;
          }) || []
        );
      },
      only: function (g) {
        if (!me(g))
          throw Error(
            "React.Children.only expected to receive a single React element child.",
          );
        return g;
      },
    };
  return (
    (Qe.Activity = G),
    (Qe.Children = z),
    (Qe.Component = Se),
    (Qe.Fragment = S),
    (Qe.Profiler = V),
    (Qe.PureComponent = ie),
    (Qe.StrictMode = b),
    (Qe.Suspense = B),
    (Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = be),
    (Qe.__COMPILER_RUNTIME = {
      __proto__: null,
      c: function (g) {
        return be.H.useMemoCache(g);
      },
    }),
    (Qe.cache = function (g) {
      return function () {
        return g.apply(null, arguments);
      };
    }),
    (Qe.cacheSignal = function () {
      return null;
    }),
    (Qe.cloneElement = function (g, C, I) {
      if (g == null)
        throw Error(
          "The argument must be a React element, but you passed " + g + ".",
        );
      var X = Y({}, g.props),
        pe = g.key;
      if (C != null)
        for (he in (C.key !== void 0 && (pe = "" + C.key), C))
          !Ye.call(C, he) ||
            he === "key" ||
            he === "__self" ||
            he === "__source" ||
            (he === "ref" && C.ref === void 0) ||
            (X[he] = C[he]);
      var he = arguments.length - 2;
      if (he === 1) X.children = I;
      else if (1 < he) {
        for (var Ne = Array(he), $e = 0; $e < he; $e++)
          Ne[$e] = arguments[$e + 2];
        X.children = Ne;
      }
      return Te(g.type, pe, X);
    }),
    (Qe.createContext = function (g) {
      return (
        (g = {
          $$typeof: re,
          _currentValue: g,
          _currentValue2: g,
          _threadCount: 0,
          Provider: null,
          Consumer: null,
        }),
        (g.Provider = g),
        (g.Consumer = { $$typeof: ue, _context: g }),
        g
      );
    }),
    (Qe.createElement = function (g, C, I) {
      var X,
        pe = {},
        he = null;
      if (C != null)
        for (X in (C.key !== void 0 && (he = "" + C.key), C))
          Ye.call(C, X) &&
            X !== "key" &&
            X !== "__self" &&
            X !== "__source" &&
            (pe[X] = C[X]);
      var Ne = arguments.length - 2;
      if (Ne === 1) pe.children = I;
      else if (1 < Ne) {
        for (var $e = Array(Ne), ae = 0; ae < Ne; ae++)
          $e[ae] = arguments[ae + 2];
        pe.children = $e;
      }
      if (g && g.defaultProps)
        for (X in ((Ne = g.defaultProps), Ne))
          pe[X] === void 0 && (pe[X] = Ne[X]);
      return Te(g, he, pe);
    }),
    (Qe.createRef = function () {
      return { current: null };
    }),
    (Qe.forwardRef = function (g) {
      return { $$typeof: ee, render: g };
    }),
    (Qe.isValidElement = me),
    (Qe.lazy = function (g) {
      return { $$typeof: fe, _payload: { _status: -1, _result: g }, _init: O };
    }),
    (Qe.memo = function (g, C) {
      return { $$typeof: T, type: g, compare: C === void 0 ? null : C };
    }),
    (Qe.startTransition = function (g) {
      var C = be.T,
        I = {};
      be.T = I;
      try {
        var X = g(),
          pe = be.S;
        (pe !== null && pe(I, X),
          typeof X == "object" &&
            X !== null &&
            typeof X.then == "function" &&
            X.then(oe, P));
      } catch (he) {
        P(he);
      } finally {
        (C !== null && I.types !== null && (C.types = I.types), (be.T = C));
      }
    }),
    (Qe.unstable_useCacheRefresh = function () {
      return be.H.useCacheRefresh();
    }),
    (Qe.use = function (g) {
      return be.H.use(g);
    }),
    (Qe.useActionState = function (g, C, I) {
      return be.H.useActionState(g, C, I);
    }),
    (Qe.useCallback = function (g, C) {
      return be.H.useCallback(g, C);
    }),
    (Qe.useContext = function (g) {
      return be.H.useContext(g);
    }),
    (Qe.useDebugValue = function () {}),
    (Qe.useDeferredValue = function (g, C) {
      return be.H.useDeferredValue(g, C);
    }),
    (Qe.useEffect = function (g, C) {
      return be.H.useEffect(g, C);
    }),
    (Qe.useEffectEvent = function (g) {
      return be.H.useEffectEvent(g);
    }),
    (Qe.useId = function () {
      return be.H.useId();
    }),
    (Qe.useImperativeHandle = function (g, C, I) {
      return be.H.useImperativeHandle(g, C, I);
    }),
    (Qe.useInsertionEffect = function (g, C) {
      return be.H.useInsertionEffect(g, C);
    }),
    (Qe.useLayoutEffect = function (g, C) {
      return be.H.useLayoutEffect(g, C);
    }),
    (Qe.useMemo = function (g, C) {
      return be.H.useMemo(g, C);
    }),
    (Qe.useOptimistic = function (g, C) {
      return be.H.useOptimistic(g, C);
    }),
    (Qe.useReducer = function (g, C, I) {
      return be.H.useReducer(g, C, I);
    }),
    (Qe.useRef = function (g) {
      return be.H.useRef(g);
    }),
    (Qe.useState = function (g) {
      return be.H.useState(g);
    }),
    (Qe.useSyncExternalStore = function (g, C, I) {
      return be.H.useSyncExternalStore(g, C, I);
    }),
    (Qe.useTransition = function () {
      return be.H.useTransition();
    }),
    (Qe.version = "19.2.7"),
    Qe
  );
}
var mp;
function uu() {
  return (mp || ((mp = 1), (su.exports = sf())), su.exports);
}
var f = uu(),
  nu = { exports: {} },
  $r = {},
  iu = { exports: {} },
  lu = {};
/**
 * @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 pp;
function nf() {
  return (
    pp ||
      ((pp = 1),
      (function (w) {
        function J(y, K) {
          var O = y.length;
          y.push(K);
          e: for (; 0 < O; ) {
            var P = (O - 1) >>> 1,
              z = y[P];
            if (0 < V(z, K)) ((y[P] = K), (y[O] = z), (O = P));
            else break e;
          }
        }
        function S(y) {
          return y.length === 0 ? null : y[0];
        }
        function b(y) {
          if (y.length === 0) return null;
          var K = y[0],
            O = y.pop();
          if (O !== K) {
            y[0] = O;
            e: for (var P = 0, z = y.length, g = z >>> 1; P < g; ) {
              var C = 2 * (P + 1) - 1,
                I = y[C],
                X = C + 1,
                pe = y[X];
              if (0 > V(I, O))
                X < z && 0 > V(pe, I)
                  ? ((y[P] = pe), (y[X] = O), (P = X))
                  : ((y[P] = I), (y[C] = O), (P = C));
              else if (X < z && 0 > V(pe, O))
                ((y[P] = pe), (y[X] = O), (P = X));
              else break e;
            }
          }
          return K;
        }
        function V(y, K) {
          var O = y.sortIndex - K.sortIndex;
          return O !== 0 ? O : y.id - K.id;
        }
        if (
          ((w.unstable_now = void 0),
          typeof performance == "object" &&
            typeof performance.now == "function")
        ) {
          var ue = performance;
          w.unstable_now = function () {
            return ue.now();
          };
        } else {
          var re = Date,
            ee = re.now();
          w.unstable_now = function () {
            return re.now() - ee;
          };
        }
        var B = [],
          T = [],
          fe = 1,
          G = null,
          F = 3,
          ce = !1,
          ve = !1,
          Y = !1,
          Ee = !1,
          Se = typeof setTimeout == "function" ? setTimeout : null,
          le = typeof clearTimeout == "function" ? clearTimeout : null,
          ie = typeof setImmediate < "u" ? setImmediate : null;
        function $(y) {
          for (var K = S(T); K !== null; ) {
            if (K.callback === null) b(T);
            else if (K.startTime <= y)
              (b(T), (K.sortIndex = K.expirationTime), J(B, K));
            else break;
            K = S(T);
          }
        }
        function de(y) {
          if (((Y = !1), $(y), !ve))
            if (S(B) !== null) ((ve = !0), oe || ((oe = !0), Oe()));
            else {
              var K = S(T);
              K !== null && Ue(de, K.startTime - y);
            }
        }
        var oe = !1,
          be = -1,
          Ye = 5,
          Te = -1;
        function Ie() {
          return Ee ? !0 : !(w.unstable_now() - Te < Ye);
        }
        function me() {
          if (((Ee = !1), oe)) {
            var y = w.unstable_now();
            Te = y;
            var K = !0;
            try {
              e: {
                ((ve = !1), Y && ((Y = !1), le(be), (be = -1)), (ce = !0));
                var O = F;
                try {
                  t: {
                    for (
                      $(y), G = S(B);
                      G !== null && !(G.expirationTime > y && Ie());
                    ) {
                      var P = G.callback;
                      if (typeof P == "function") {
                        ((G.callback = null), (F = G.priorityLevel));
                        var z = P(G.expirationTime <= y);
                        if (((y = w.unstable_now()), typeof z == "function")) {
                          ((G.callback = z), $(y), (K = !0));
                          break t;
                        }
                        (G === S(B) && b(B), $(y));
                      } else b(B);
                      G = S(B);
                    }
                    if (G !== null) K = !0;
                    else {
                      var g = S(T);
                      (g !== null && Ue(de, g.startTime - y), (K = !1));
                    }
                  }
                  break e;
                } finally {
                  ((G = null), (F = O), (ce = !1));
                }
                K = void 0;
              }
            } finally {
              K ? Oe() : (oe = !1);
            }
          }
        }
        var Oe;
        if (typeof ie == "function")
          Oe = function () {
            ie(me);
          };
        else if (typeof MessageChannel < "u") {
          var te = new MessageChannel(),
            Ae = te.port2;
          ((te.port1.onmessage = me),
            (Oe = function () {
              Ae.postMessage(null);
            }));
        } else
          Oe = function () {
            Se(me, 0);
          };
        function Ue(y, K) {
          be = Se(function () {
            y(w.unstable_now());
          }, K);
        }
        ((w.unstable_IdlePriority = 5),
          (w.unstable_ImmediatePriority = 1),
          (w.unstable_LowPriority = 4),
          (w.unstable_NormalPriority = 3),
          (w.unstable_Profiling = null),
          (w.unstable_UserBlockingPriority = 2),
          (w.unstable_cancelCallback = function (y) {
            y.callback = null;
          }),
          (w.unstable_forceFrameRate = function (y) {
            0 > y || 125 < y
              ? console.error(
                  "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported",
                )
              : (Ye = 0 < y ? Math.floor(1e3 / y) : 5);
          }),
          (w.unstable_getCurrentPriorityLevel = function () {
            return F;
          }),
          (w.unstable_next = function (y) {
            switch (F) {
              case 1:
              case 2:
              case 3:
                var K = 3;
                break;
              default:
                K = F;
            }
            var O = F;
            F = K;
            try {
              return y();
            } finally {
              F = O;
            }
          }),
          (w.unstable_requestPaint = function () {
            Ee = !0;
          }),
          (w.unstable_runWithPriority = function (y, K) {
            switch (y) {
              case 1:
              case 2:
              case 3:
              case 4:
              case 5:
                break;
              default:
                y = 3;
            }
            var O = F;
            F = y;
            try {
              return K();
            } finally {
              F = O;
            }
          }),
          (w.unstable_scheduleCallback = function (y, K, O) {
            var P = w.unstable_now();
            switch (
              (typeof O == "object" && O !== null
                ? ((O = O.delay),
                  (O = typeof O == "number" && 0 < O ? P + O : P))
                : (O = P),
              y)
            ) {
              case 1:
                var z = -1;
                break;
              case 2:
                z = 250;
                break;
              case 5:
                z = 1073741823;
                break;
              case 4:
                z = 1e4;
                break;
              default:
                z = 5e3;
            }
            return (
              (z = O + z),
              (y = {
                id: fe++,
                callback: K,
                priorityLevel: y,
                startTime: O,
                expirationTime: z,
                sortIndex: -1,
              }),
              O > P
                ? ((y.sortIndex = O),
                  J(T, y),
                  S(B) === null &&
                    y === S(T) &&
                    (Y ? (le(be), (be = -1)) : (Y = !0), Ue(de, O - P)))
                : ((y.sortIndex = z),
                  J(B, y),
                  ve || ce || ((ve = !0), oe || ((oe = !0), Oe()))),
              y
            );
          }),
          (w.unstable_shouldYield = Ie),
          (w.unstable_wrapCallback = function (y) {
            var K = F;
            return function () {
              var O = F;
              F = K;
              try {
                return y.apply(this, arguments);
              } finally {
                F = O;
              }
            };
          }));
      })(lu)),
    lu
  );
}
var xp;
function lf() {
  return (xp || ((xp = 1), (iu.exports = nf())), iu.exports);
}
var ru = { exports: {} },
  qa = {};
/**
 * @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 fp;
function rf() {
  if (fp) return qa;
  fp = 1;
  var w = uu();
  function J(B) {
    var T = "https://react.dev/errors/" + B;
    if (1 < arguments.length) {
      T += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var fe = 2; fe < arguments.length; fe++)
        T += "&args[]=" + encodeURIComponent(arguments[fe]);
    }
    return (
      "Minified React error #" +
      B +
      "; visit " +
      T +
      " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
    );
  }
  function S() {}
  var b = {
      d: {
        f: S,
        r: function () {
          throw Error(J(522));
        },
        D: S,
        C: S,
        L: S,
        m: S,
        X: S,
        S,
        M: S,
      },
      p: 0,
      findDOMNode: null,
    },
    V = Symbol.for("react.portal");
  function ue(B, T, fe) {
    var G =
      3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return {
      $$typeof: V,
      key: G == null ? null : "" + G,
      children: B,
      containerInfo: T,
      implementation: fe,
    };
  }
  var re = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
  function ee(B, T) {
    if (B === "font") return "";
    if (typeof T == "string") return T === "use-credentials" ? T : "";
  }
  return (
    (qa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = b),
    (qa.createPortal = function (B, T) {
      var fe =
        2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
      if (!T || (T.nodeType !== 1 && T.nodeType !== 9 && T.nodeType !== 11))
        throw Error(J(299));
      return ue(B, T, null, fe);
    }),
    (qa.flushSync = function (B) {
      var T = re.T,
        fe = b.p;
      try {
        if (((re.T = null), (b.p = 2), B)) return B();
      } finally {
        ((re.T = T), (b.p = fe), b.d.f());
      }
    }),
    (qa.preconnect = function (B, T) {
      typeof B == "string" &&
        (T
          ? ((T = T.crossOrigin),
            (T =
              typeof T == "string"
                ? T === "use-credentials"
                  ? T
                  : ""
                : void 0))
          : (T = null),
        b.d.C(B, T));
    }),
    (qa.prefetchDNS = function (B) {
      typeof B == "string" && b.d.D(B);
    }),
    (qa.preinit = function (B, T) {
      if (typeof B == "string" && T && typeof T.as == "string") {
        var fe = T.as,
          G = ee(fe, T.crossOrigin),
          F = typeof T.integrity == "string" ? T.integrity : void 0,
          ce = typeof T.fetchPriority == "string" ? T.fetchPriority : void 0;
        fe === "style"
          ? b.d.S(B, typeof T.precedence == "string" ? T.precedence : void 0, {
              crossOrigin: G,
              integrity: F,
              fetchPriority: ce,
            })
          : fe === "script" &&
            b.d.X(B, {
              crossOrigin: G,
              integrity: F,
              fetchPriority: ce,
              nonce: typeof T.nonce == "string" ? T.nonce : void 0,
            });
      }
    }),
    (qa.preinitModule = function (B, T) {
      if (typeof B == "string")
        if (typeof T == "object" && T !== null) {
          if (T.as == null || T.as === "script") {
            var fe = ee(T.as, T.crossOrigin);
            b.d.M(B, {
              crossOrigin: fe,
              integrity: typeof T.integrity == "string" ? T.integrity : void 0,
              nonce: typeof T.nonce == "string" ? T.nonce : void 0,
            });
          }
        } else T == null && b.d.M(B);
    }),
    (qa.preload = function (B, T) {
      if (
        typeof B == "string" &&
        typeof T == "object" &&
        T !== null &&
        typeof T.as == "string"
      ) {
        var fe = T.as,
          G = ee(fe, T.crossOrigin);
        b.d.L(B, fe, {
          crossOrigin: G,
          integrity: typeof T.integrity == "string" ? T.integrity : void 0,
          nonce: typeof T.nonce == "string" ? T.nonce : void 0,
          type: typeof T.type == "string" ? T.type : void 0,
          fetchPriority:
            typeof T.fetchPriority == "string" ? T.fetchPriority : void 0,
          referrerPolicy:
            typeof T.referrerPolicy == "string" ? T.referrerPolicy : void 0,
          imageSrcSet:
            typeof T.imageSrcSet == "string" ? T.imageSrcSet : void 0,
          imageSizes: typeof T.imageSizes == "string" ? T.imageSizes : void 0,
          media: typeof T.media == "string" ? T.media : void 0,
        });
      }
    }),
    (qa.preloadModule = function (B, T) {
      if (typeof B == "string")
        if (T) {
          var fe = ee(T.as, T.crossOrigin);
          b.d.m(B, {
            as: typeof T.as == "string" && T.as !== "script" ? T.as : void 0,
            crossOrigin: fe,
            integrity: typeof T.integrity == "string" ? T.integrity : void 0,
          });
        } else b.d.m(B);
    }),
    (qa.requestFormReset = function (B) {
      b.d.r(B);
    }),
    (qa.unstable_batchedUpdates = function (B, T) {
      return B(T);
    }),
    (qa.useFormState = function (B, T, fe) {
      return re.H.useFormState(B, T, fe);
    }),
    (qa.useFormStatus = function () {
      return re.H.useHostTransitionStatus();
    }),
    (qa.version = "19.2.7"),
    qa
  );
}
var gp;
function of() {
  if (gp) return ru.exports;
  gp = 1;
  function w() {
    if (
      !(
        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" ||
        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"
      )
    )
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w);
      } catch (J) {
        console.error(J);
      }
  }
  return (w(), (ru.exports = rf()), ru.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 bp;
function cf() {
  if (bp) return $r;
  bp = 1;
  var w = lf(),
    J = uu(),
    S = of();
  function b(t) {
    var a = "https://react.dev/errors/" + t;
    if (1 < arguments.length) {
      a += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var n = 2; n < arguments.length; n++)
        a += "&args[]=" + encodeURIComponent(arguments[n]);
    }
    return (
      "Minified React error #" +
      t +
      "; visit " +
      a +
      " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
    );
  }
  function V(t) {
    return !(!t || (t.nodeType !== 1 && t.nodeType !== 9 && t.nodeType !== 11));
  }
  function ue(t) {
    var a = t,
      n = t;
    if (t.alternate) for (; a.return; ) a = a.return;
    else {
      t = a;
      do ((a = t), (a.flags & 4098) !== 0 && (n = a.return), (t = a.return));
      while (t);
    }
    return a.tag === 3 ? n : null;
  }
  function re(t) {
    if (t.tag === 13) {
      var a = t.memoizedState;
      if (
        (a === null && ((t = t.alternate), t !== null && (a = t.memoizedState)),
        a !== null)
      )
        return a.dehydrated;
    }
    return null;
  }
  function ee(t) {
    if (t.tag === 31) {
      var a = t.memoizedState;
      if (
        (a === null && ((t = t.alternate), t !== null && (a = t.memoizedState)),
        a !== null)
      )
        return a.dehydrated;
    }
    return null;
  }
  function B(t) {
    if (ue(t) !== t) throw Error(b(188));
  }
  function T(t) {
    var a = t.alternate;
    if (!a) {
      if (((a = ue(t)), a === null)) throw Error(b(188));
      return a !== t ? null : t;
    }
    for (var n = t, l = a; ; ) {
      var o = n.return;
      if (o === null) break;
      var c = o.alternate;
      if (c === null) {
        if (((l = o.return), l !== null)) {
          n = l;
          continue;
        }
        break;
      }
      if (o.child === c.child) {
        for (c = o.child; c; ) {
          if (c === n) return (B(o), t);
          if (c === l) return (B(o), a);
          c = c.sibling;
        }
        throw Error(b(188));
      }
      if (n.return !== l.return) ((n = o), (l = c));
      else {
        for (var m = !1, x = o.child; x; ) {
          if (x === n) {
            ((m = !0), (n = o), (l = c));
            break;
          }
          if (x === l) {
            ((m = !0), (l = o), (n = c));
            break;
          }
          x = x.sibling;
        }
        if (!m) {
          for (x = c.child; x; ) {
            if (x === n) {
              ((m = !0), (n = c), (l = o));
              break;
            }
            if (x === l) {
              ((m = !0), (l = c), (n = o));
              break;
            }
            x = x.sibling;
          }
          if (!m) throw Error(b(189));
        }
      }
      if (n.alternate !== l) throw Error(b(190));
    }
    if (n.tag !== 3) throw Error(b(188));
    return n.stateNode.current === n ? t : a;
  }
  function fe(t) {
    var a = t.tag;
    if (a === 5 || a === 26 || a === 27 || a === 6) return t;
    for (t = t.child; t !== null; ) {
      if (((a = fe(t)), a !== null)) return a;
      t = t.sibling;
    }
    return null;
  }
  var G = Object.assign,
    F = Symbol.for("react.element"),
    ce = Symbol.for("react.transitional.element"),
    ve = Symbol.for("react.portal"),
    Y = Symbol.for("react.fragment"),
    Ee = Symbol.for("react.strict_mode"),
    Se = Symbol.for("react.profiler"),
    le = Symbol.for("react.consumer"),
    ie = Symbol.for("react.context"),
    $ = Symbol.for("react.forward_ref"),
    de = Symbol.for("react.suspense"),
    oe = Symbol.for("react.suspense_list"),
    be = Symbol.for("react.memo"),
    Ye = Symbol.for("react.lazy"),
    Te = Symbol.for("react.activity"),
    Ie = Symbol.for("react.memo_cache_sentinel"),
    me = Symbol.iterator;
  function Oe(t) {
    return t === null || typeof t != "object"
      ? null
      : ((t = (me && t[me]) || t["@@iterator"]),
        typeof t == "function" ? t : null);
  }
  var te = Symbol.for("react.client.reference");
  function Ae(t) {
    if (t == null) return null;
    if (typeof t == "function")
      return t.$$typeof === te ? null : t.displayName || t.name || null;
    if (typeof t == "string") return t;
    switch (t) {
      case Y:
        return "Fragment";
      case Se:
        return "Profiler";
      case Ee:
        return "StrictMode";
      case de:
        return "Suspense";
      case oe:
        return "SuspenseList";
      case Te:
        return "Activity";
    }
    if (typeof t == "object")
      switch (t.$$typeof) {
        case ve:
          return "Portal";
        case ie:
          return t.displayName || "Context";
        case le:
          return (t._context.displayName || "Context") + ".Consumer";
        case $:
          var a = t.render;
          return (
            (t = t.displayName),
            t ||
              ((t = a.displayName || a.name || ""),
              (t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef")),
            t
          );
        case be:
          return (
            (a = t.displayName || null),
            a !== null ? a : Ae(t.type) || "Memo"
          );
        case Ye:
          ((a = t._payload), (t = t._init));
          try {
            return Ae(t(a));
          } catch {}
      }
    return null;
  }
  var Ue = Array.isArray,
    y = J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
    K = S.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
    O = { pending: !1, data: null, method: null, action: null },
    P = [],
    z = -1;
  function g(t) {
    return { current: t };
  }
  function C(t) {
    0 > z || ((t.current = P[z]), (P[z] = null), z--);
  }
  function I(t, a) {
    (z++, (P[z] = t.current), (t.current = a));
  }
  var X = g(null),
    pe = g(null),
    he = g(null),
    Ne = g(null);
  function $e(t, a) {
    switch ((I(he, a), I(pe, t), I(X, null), a.nodeType)) {
      case 9:
      case 11:
        t = (t = a.documentElement) && (t = t.namespaceURI) ? Em(t) : 0;
        break;
      default:
        if (((t = a.tagName), (a = a.namespaceURI)))
          ((a = Em(a)), (t = Om(a, t)));
        else
          switch (t) {
            case "svg":
              t = 1;
              break;
            case "math":
              t = 2;
              break;
            default:
              t = 0;
          }
    }
    (C(X), I(X, t));
  }
  function ae() {
    (C(X), C(pe), C(he));
  }
  function ze(t) {
    t.memoizedState !== null && I(Ne, t);
    var a = X.current,
      n = Om(a, t.type);
    a !== n && (I(pe, t), I(X, n));
  }
  function at(t) {
    (pe.current === t && (C(X), C(pe)),
      Ne.current === t && (C(Ne), (Zr._currentValue = O)));
  }
  var bt, Mt;
  function ge(t) {
    if (bt === void 0)
      try {
        throw Error();
      } catch (n) {
        var a = n.stack.trim().match(/\n( *(at )?)/);
        ((bt = (a && a[1]) || ""),
          (Mt =
            -1 <
            n.stack.indexOf(`
    at`)
              ? " (<anonymous>)"
              : -1 < n.stack.indexOf("@")
                ? "@unknown:0:0"
                : ""));
      }
    return (
      `
` +
      bt +
      t +
      Mt
    );
  }
  var Me = !1;
  function mt(t, a) {
    if (!t || Me) return "";
    Me = !0;
    var n = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      var l = {
        DetermineComponentFrameRoot: function () {
          try {
            if (a) {
              var ne = function () {
                throw Error();
              };
              if (
                (Object.defineProperty(ne.prototype, "props", {
                  set: function () {
                    throw Error();
                  },
                }),
                typeof Reflect == "object" && Reflect.construct)
              ) {
                try {
                  Reflect.construct(ne, []);
                } catch (q) {
                  var U = q;
                }
                Reflect.construct(t, [], ne);
              } else {
                try {
                  ne.call();
                } catch (q) {
                  U = q;
                }
                t.call(ne.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (q) {
                U = q;
              }
              (ne = t()) &&
                typeof ne.catch == "function" &&
                ne.catch(function () {});
            }
          } catch (q) {
            if (q && U && typeof q.stack == "string") return [q.stack, U.stack];
          }
          return [null, null];
        },
      };
      l.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
      var o = Object.getOwnPropertyDescriptor(
        l.DetermineComponentFrameRoot,
        "name",
      );
      o &&
        o.configurable &&
        Object.defineProperty(l.DetermineComponentFrameRoot, "name", {
          value: "DetermineComponentFrameRoot",
        });
      var c = l.DetermineComponentFrameRoot(),
        m = c[0],
        x = c[1];
      if (m && x) {
        var N = m.split(`
`),
          R = x.split(`
`);
        for (
          o = l = 0;
          l < N.length && !N[l].includes("DetermineComponentFrameRoot");
        )
          l++;
        for (; o < R.length && !R[o].includes("DetermineComponentFrameRoot"); )
          o++;
        if (l === N.length || o === R.length)
          for (
            l = N.length - 1, o = R.length - 1;
            1 <= l && 0 <= o && N[l] !== R[o];
          )
            o--;
        for (; 1 <= l && 0 <= o; l--, o--)
          if (N[l] !== R[o]) {
            if (l !== 1 || o !== 1)
              do
                if ((l--, o--, 0 > o || N[l] !== R[o])) {
                  var Q =
                    `
` + N[l].replace(" at new ", " at ");
                  return (
                    t.displayName &&
                      Q.includes("<anonymous>") &&
                      (Q = Q.replace("<anonymous>", t.displayName)),
                    Q
                  );
                }
              while (1 <= l && 0 <= o);
            break;
          }
      }
    } finally {
      ((Me = !1), (Error.prepareStackTrace = n));
    }
    return (n = t ? t.displayName || t.name : "") ? ge(n) : "";
  }
  function st(t, a) {
    switch (t.tag) {
      case 26:
      case 27:
      case 5:
        return ge(t.type);
      case 16:
        return ge("Lazy");
      case 13:
        return t.child !== a && a !== null
          ? ge("Suspense Fallback")
          : ge("Suspense");
      case 19:
        return ge("SuspenseList");
      case 0:
      case 15:
        return mt(t.type, !1);
      case 11:
        return mt(t.type.render, !1);
      case 1:
        return mt(t.type, !0);
      case 31:
        return ge("Activity");
      default:
        return "";
    }
  }
  function Z(t) {
    try {
      var a = "",
        n = null;
      do ((a += st(t, n)), (n = t), (t = t.return));
      while (t);
      return a;
    } catch (l) {
      return (
        `
Error generating stack: ` +
        l.message +
        `
` +
        l.stack
      );
    }
  }
  var _e = Object.prototype.hasOwnProperty,
    Ze = w.unstable_scheduleCallback,
    Xe = w.unstable_cancelCallback,
    Ht = w.unstable_shouldYield,
    St = w.unstable_requestPaint,
    E = w.unstable_now,
    Re = w.unstable_getCurrentPriorityLevel,
    qe = w.unstable_ImmediatePriority,
    Fe = w.unstable_UserBlockingPriority,
    fa = w.unstable_NormalPriority,
    Aa = w.unstable_LowPriority,
    ps = w.unstable_IdlePriority,
    ra = w.log,
    es = w.unstable_setDisableYieldValue,
    Ft = null,
    Tt = null;
  function oa(t) {
    if (
      (typeof ra == "function" && es(t),
      Tt && typeof Tt.setStrictMode == "function")
    )
      try {
        Tt.setStrictMode(Ft, t);
      } catch {}
  }
  var Zt = Math.clz32 ? Math.clz32 : _s,
    ts = Math.log,
    ja = Math.LN2;
  function _s(t) {
    return ((t >>>= 0), t === 0 ? 32 : (31 - ((ts(t) / ja) | 0)) | 0);
  }
  var xe = 256,
    pt = 262144,
    Xt = 4194304;
  function Pt(t) {
    var a = t & 42;
    if (a !== 0) return a;
    switch (t & -t) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
        return 64;
      case 128:
        return 128;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
        return t & 261888;
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return t & 3932160;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return t & 62914560;
      case 67108864:
        return 67108864;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 0;
      default:
        return t;
    }
  }
  function Ya(t, a, n) {
    var l = t.pendingLanes;
    if (l === 0) return 0;
    var o = 0,
      c = t.suspendedLanes,
      m = t.pingedLanes;
    t = t.warmLanes;
    var x = l & 134217727;
    return (
      x !== 0
        ? ((l = x & ~c),
          l !== 0
            ? (o = Pt(l))
            : ((m &= x),
              m !== 0
                ? (o = Pt(m))
                : n || ((n = x & ~t), n !== 0 && (o = Pt(n)))))
        : ((x = l & ~c),
          x !== 0
            ? (o = Pt(x))
            : m !== 0
              ? (o = Pt(m))
              : n || ((n = l & ~t), n !== 0 && (o = Pt(n)))),
      o === 0
        ? 0
        : a !== 0 &&
            a !== o &&
            (a & c) === 0 &&
            ((c = o & -o),
            (n = a & -a),
            c >= n || (c === 32 && (n & 4194048) !== 0))
          ? a
          : o
    );
  }
  function Xa(t, a) {
    return (t.pendingLanes & ~(t.suspendedLanes & ~t.pingedLanes) & a) === 0;
  }
  function an(t, a) {
    switch (t) {
      case 1:
      case 2:
      case 4:
      case 8:
      case 64:
        return a + 250;
      case 16:
      case 32:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return a + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return -1;
      case 67108864:
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function ws() {
    var t = Xt;
    return ((Xt <<= 1), (Xt & 62914560) === 0 && (Xt = 4194304), t);
  }
  function ks(t) {
    for (var a = [], n = 0; 31 > n; n++) a.push(t);
    return a;
  }
  function Na(t, a) {
    ((t.pendingLanes |= a),
      a !== 268435456 &&
        ((t.suspendedLanes = 0), (t.pingedLanes = 0), (t.warmLanes = 0)));
  }
  function $t(t, a, n, l, o, c) {
    var m = t.pendingLanes;
    ((t.pendingLanes = n),
      (t.suspendedLanes = 0),
      (t.pingedLanes = 0),
      (t.warmLanes = 0),
      (t.expiredLanes &= n),
      (t.entangledLanes &= n),
      (t.errorRecoveryDisabledLanes &= n),
      (t.shellSuspendCounter = 0));
    var x = t.entanglements,
      N = t.expirationTimes,
      R = t.hiddenUpdates;
    for (n = m & ~n; 0 < n; ) {
      var Q = 31 - Zt(n),
        ne = 1 << Q;
      ((x[Q] = 0), (N[Q] = -1));
      var U = R[Q];
      if (U !== null)
        for (R[Q] = null, Q = 0; Q < U.length; Q++) {
          var q = U[Q];
          q !== null && (q.lane &= -536870913);
        }
      n &= ~ne;
    }
    (l !== 0 && sn(t, l, 0),
      c !== 0 && o === 0 && t.tag !== 0 && (t.suspendedLanes |= c & ~(m & ~a)));
  }
  function sn(t, a, n) {
    ((t.pendingLanes |= a), (t.suspendedLanes &= ~a));
    var l = 31 - Zt(a);
    ((t.entangledLanes |= a),
      (t.entanglements[l] = t.entanglements[l] | 1073741824 | (n & 261930)));
  }
  function Qn(t, a) {
    var n = (t.entangledLanes |= a);
    for (t = t.entanglements; n; ) {
      var l = 31 - Zt(n),
        o = 1 << l;
      ((o & a) | (t[l] & a) && (t[l] |= a), (n &= ~o));
    }
  }
  function _n(t, a) {
    var n = a & -a;
    return (
      (n = (n & 42) !== 0 ? 1 : ga(n)),
      (n & (t.suspendedLanes | a)) !== 0 ? 0 : n
    );
  }
  function ga(t) {
    switch (t) {
      case 2:
        t = 1;
        break;
      case 8:
        t = 4;
        break;
      case 32:
        t = 16;
        break;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        t = 128;
        break;
      case 268435456:
        t = 134217728;
        break;
      default:
        t = 0;
    }
    return t;
  }
  function v(t) {
    return (
      (t &= -t),
      2 < t ? (8 < t ? ((t & 134217727) !== 0 ? 32 : 268435456) : 8) : 2
    );
  }
  function Pe() {
    var t = K.p;
    return t !== 0 ? t : ((t = window.event), t === void 0 ? 32 : sp(t.type));
  }
  function vt(t, a) {
    var n = K.p;
    try {
      return ((K.p = t), a());
    } finally {
      K.p = n;
    }
  }
  var Ut = Math.random().toString(36).slice(2),
    we = "__reactFiber$" + Ut,
    Ve = "__reactProps$" + Ut,
    rt = "__reactContainer$" + Ut,
    We = "__reactEvents$" + Ut,
    nt = "__reactListeners$" + Ut,
    ea = "__reactHandles$" + Ut,
    as = "__reactResources$" + Ut,
    Ot = "__reactMarker$" + Ut;
  function Ra(t) {
    (delete t[we], delete t[Ve], delete t[We], delete t[nt], delete t[ea]);
  }
  function It(t) {
    var a = t[we];
    if (a) return a;
    for (var n = t.parentNode; n; ) {
      if ((a = n[rt] || n[we])) {
        if (
          ((n = a.alternate),
          a.child !== null || (n !== null && n.child !== null))
        )
          for (t = Im(t); t !== null; ) {
            if ((n = t[we])) return n;
            t = Im(t);
          }
        return a;
      }
      ((t = n), (n = t.parentNode));
    }
    return null;
  }
  function _a(t) {
    if ((t = t[we] || t[rt])) {
      var a = t.tag;
      if (
        a === 5 ||
        a === 6 ||
        a === 13 ||
        a === 31 ||
        a === 26 ||
        a === 27 ||
        a === 3
      )
        return t;
    }
    return null;
  }
  function qt(t) {
    var a = t.tag;
    if (a === 5 || a === 26 || a === 27 || a === 6) return t.stateNode;
    throw Error(b(33));
  }
  function Ss(t) {
    var a = t[as];
    return (
      a ||
        (a = t[as] =
          { hoistableStyles: new Map(), hoistableScripts: new Map() }),
      a
    );
  }
  function ca(t) {
    t[Ot] = !0;
  }
  var Ma = new Set(),
    Ts = {};
  function aa(t, a) {
    (wa(t, a), wa(t + "Capture", a));
  }
  function wa(t, a) {
    for (Ts[t] = a, t = 0; t < a.length; t++) Ma.add(a[t]);
  }
  var ka = 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]*$",
    ),
    Hs = {},
    ba = {};
  function za(t) {
    return _e.call(ba, t)
      ? !0
      : _e.call(Hs, t)
        ? !1
        : ka.test(t)
          ? (ba[t] = !0)
          : ((Hs[t] = !0), !1);
  }
  function Be(t, a, n) {
    if (za(a))
      if (n === null) t.removeAttribute(a);
      else {
        switch (typeof n) {
          case "undefined":
          case "function":
          case "symbol":
            t.removeAttribute(a);
            return;
          case "boolean":
            var l = a.toLowerCase().slice(0, 5);
            if (l !== "data-" && l !== "aria-") {
              t.removeAttribute(a);
              return;
            }
        }
        t.setAttribute(a, "" + n);
      }
  }
  function ot(t, a, n) {
    if (n === null) t.removeAttribute(a);
    else {
      switch (typeof n) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          t.removeAttribute(a);
          return;
      }
      t.setAttribute(a, "" + n);
    }
  }
  function yt(t, a, n, l) {
    if (l === null) t.removeAttribute(n);
    else {
      switch (typeof l) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          t.removeAttribute(n);
          return;
      }
      t.setAttributeNS(a, n, "" + l);
    }
  }
  function Ct(t) {
    switch (typeof t) {
      case "bigint":
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return t;
      case "object":
        return t;
      default:
        return "";
    }
  }
  function xs(t) {
    var a = t.type;
    return (
      (t = t.nodeName) &&
      t.toLowerCase() === "input" &&
      (a === "checkbox" || a === "radio")
    );
  }
  function Us(t, a, n) {
    var l = Object.getOwnPropertyDescriptor(t.constructor.prototype, a);
    if (
      !t.hasOwnProperty(a) &&
      typeof l < "u" &&
      typeof l.get == "function" &&
      typeof l.set == "function"
    ) {
      var o = l.get,
        c = l.set;
      return (
        Object.defineProperty(t, a, {
          configurable: !0,
          get: function () {
            return o.call(this);
          },
          set: function (m) {
            ((n = "" + m), c.call(this, m));
          },
        }),
        Object.defineProperty(t, a, { enumerable: l.enumerable }),
        {
          getValue: function () {
            return n;
          },
          setValue: function (m) {
            n = "" + m;
          },
          stopTracking: function () {
            ((t._valueTracker = null), delete t[a]);
          },
        }
      );
    }
  }
  function Je(t) {
    if (!t._valueTracker) {
      var a = xs(t) ? "checked" : "value";
      t._valueTracker = Us(t, a, "" + t[a]);
    }
  }
  function Kt(t) {
    if (!t) return !1;
    var a = t._valueTracker;
    if (!a) return !0;
    var n = a.getValue(),
      l = "";
    return (
      t && (l = xs(t) ? (t.checked ? "true" : "false") : t.value),
      (t = l),
      t !== n ? (a.setValue(t), !0) : !1
    );
  }
  function nn(t) {
    if (
      ((t = t || (typeof document < "u" ? document : void 0)), typeof t > "u")
    )
      return null;
    try {
      return t.activeElement || t.body;
    } catch {
      return t.body;
    }
  }
  var Wn = /[\n"\\]/g;
  function Dt(t) {
    return t.replace(Wn, function (a) {
      return "\\" + a.charCodeAt(0).toString(16) + " ";
    });
  }
  function Li(t, a, n, l, o, c, m, x) {
    ((t.name = ""),
      m != null &&
      typeof m != "function" &&
      typeof m != "symbol" &&
      typeof m != "boolean"
        ? (t.type = m)
        : t.removeAttribute("type"),
      a != null
        ? m === "number"
          ? ((a === 0 && t.value === "") || t.value != a) &&
            (t.value = "" + Ct(a))
          : t.value !== "" + Ct(a) && (t.value = "" + Ct(a))
        : (m !== "submit" && m !== "reset") || t.removeAttribute("value"),
      a != null
        ? $a(t, m, Ct(a))
        : n != null
          ? $a(t, m, Ct(n))
          : l != null && t.removeAttribute("value"),
      o == null && c != null && (t.defaultChecked = !!c),
      o != null &&
        (t.checked = o && typeof o != "function" && typeof o != "symbol"),
      x != null &&
      typeof x != "function" &&
      typeof x != "symbol" &&
      typeof x != "boolean"
        ? (t.name = "" + Ct(x))
        : t.removeAttribute("name"));
  }
  function ln(t, a, n, l, o, c, m, x) {
    if (
      (c != null &&
        typeof c != "function" &&
        typeof c != "symbol" &&
        typeof c != "boolean" &&
        (t.type = c),
      a != null || n != null)
    ) {
      if (!((c !== "submit" && c !== "reset") || a != null)) {
        Je(t);
        return;
      }
      ((n = n != null ? "" + Ct(n) : ""),
        (a = a != null ? "" + Ct(a) : n),
        x || a === t.value || (t.value = a),
        (t.defaultValue = a));
    }
    ((l = l ?? o),
      (l = typeof l != "function" && typeof l != "symbol" && !!l),
      (t.checked = x ? t.checked : !!l),
      (t.defaultChecked = !!l),
      m != null &&
        typeof m != "function" &&
        typeof m != "symbol" &&
        typeof m != "boolean" &&
        (t.name = m),
      Je(t));
  }
  function $a(t, a, n) {
    (a === "number" && nn(t.ownerDocument) === t) ||
      t.defaultValue === "" + n ||
      (t.defaultValue = "" + n);
  }
  function At(t, a, n, l) {
    if (((t = t.options), a)) {
      a = {};
      for (var o = 0; o < n.length; o++) a["$" + n[o]] = !0;
      for (n = 0; n < t.length; n++)
        ((o = a.hasOwnProperty("$" + t[n].value)),
          t[n].selected !== o && (t[n].selected = o),
          o && l && (t[n].defaultSelected = !0));
    } else {
      for (n = "" + Ct(n), a = null, o = 0; o < t.length; o++) {
        if (t[o].value === n) {
          ((t[o].selected = !0), l && (t[o].defaultSelected = !0));
          return;
        }
        a !== null || t[o].disabled || (a = t[o]);
      }
      a !== null && (a.selected = !0);
    }
  }
  function Cs(t, a, n) {
    if (
      a != null &&
      ((a = "" + Ct(a)), a !== t.value && (t.value = a), n == null)
    ) {
      t.defaultValue !== a && (t.defaultValue = a);
      return;
    }
    t.defaultValue = n != null ? "" + Ct(n) : "";
  }
  function Is(t, a, n, l) {
    if (a == null) {
      if (l != null) {
        if (n != null) throw Error(b(92));
        if (Ue(l)) {
          if (1 < l.length) throw Error(b(93));
          l = l[0];
        }
        n = l;
      }
      (n == null && (n = ""), (a = n));
    }
    ((n = Ct(a)),
      (t.defaultValue = n),
      (l = t.textContent),
      l === n && l !== "" && l !== null && (t.value = l),
      Je(t));
  }
  function Ba(t, a) {
    if (a) {
      var n = t.firstChild;
      if (n && n === t.lastChild && n.nodeType === 3) {
        n.nodeValue = a;
        return;
      }
    }
    t.textContent = a;
  }
  var Fn = 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 rn(t, a, n) {
    var l = a.indexOf("--") === 0;
    n == null || typeof n == "boolean" || n === ""
      ? l
        ? t.setProperty(a, "")
        : a === "float"
          ? (t.cssFloat = "")
          : (t[a] = "")
      : l
        ? t.setProperty(a, n)
        : typeof n != "number" || n === 0 || Fn.has(a)
          ? a === "float"
            ? (t.cssFloat = n)
            : (t[a] = ("" + n).trim())
          : (t[a] = n + "px");
  }
  function wn(t, a, n) {
    if (a != null && typeof a != "object") throw Error(b(62));
    if (((t = t.style), n != null)) {
      for (var l in n)
        !n.hasOwnProperty(l) ||
          (a != null && a.hasOwnProperty(l)) ||
          (l.indexOf("--") === 0
            ? t.setProperty(l, "")
            : l === "float"
              ? (t.cssFloat = "")
              : (t[l] = ""));
      for (var o in a)
        ((l = a[o]), a.hasOwnProperty(o) && n[o] !== l && rn(t, o, l));
    } else for (var c in a) a.hasOwnProperty(c) && rn(t, c, a[c]);
  }
  function kn(t) {
    if (t.indexOf("-") === -1) return !1;
    switch (t) {
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return !1;
      default:
        return !0;
    }
  }
  var Sn = 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"],
    ]),
    Ei =
      /^[\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 Gs(t) {
    return Ei.test("" + t)
      ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
      : t;
  }
  function Ha() {}
  var Tn = null;
  function Cn(t) {
    return (
      (t = t.target || t.srcElement || window),
      t.correspondingUseElement && (t = t.correspondingUseElement),
      t.nodeType === 3 ? t.parentNode : t
    );
  }
  var Ks = null,
    Ge = null;
  function Jt(t) {
    var a = _a(t);
    if (a && (t = a.stateNode)) {
      var n = t[Ve] || null;
      e: switch (((t = a.stateNode), a.type)) {
        case "input":
          if (
            (Li(
              t,
              n.value,
              n.defaultValue,
              n.defaultValue,
              n.checked,
              n.defaultChecked,
              n.type,
              n.name,
            ),
            (a = n.name),
            n.type === "radio" && a != null)
          ) {
            for (n = t; n.parentNode; ) n = n.parentNode;
            for (
              n = n.querySelectorAll(
                'input[name="' + Dt("" + a) + '"][type="radio"]',
              ),
                a = 0;
              a < n.length;
              a++
            ) {
              var l = n[a];
              if (l !== t && l.form === t.form) {
                var o = l[Ve] || null;
                if (!o) throw Error(b(90));
                Li(
                  l,
                  o.value,
                  o.defaultValue,
                  o.defaultValue,
                  o.checked,
                  o.defaultChecked,
                  o.type,
                  o.name,
                );
              }
            }
            for (a = 0; a < n.length; a++)
              ((l = n[a]), l.form === t.form && Kt(l));
          }
          break e;
        case "textarea":
          Cs(t, n.value, n.defaultValue);
          break e;
        case "select":
          ((a = n.value), a != null && At(t, !!n.multiple, a, !1));
      }
    }
  }
  var xt = !1;
  function hl(t, a, n) {
    if (xt) return t(a, n);
    xt = !0;
    try {
      var l = t(a);
      return l;
    } finally {
      if (
        ((xt = !1),
        (Ks !== null || Ge !== null) &&
          (Ko(), Ks && ((a = Ks), (t = Ge), (Ge = Ks = null), Jt(a), t)))
      )
        for (a = 0; a < t.length; a++) Jt(t[a]);
    }
  }
  function on(t, a) {
    var n = t.stateNode;
    if (n === null) return null;
    var l = n[Ve] || null;
    if (l === null) return null;
    n = l[a];
    e: switch (a) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        ((l = !l.disabled) ||
          ((t = t.type),
          (l = !(
            t === "button" ||
            t === "input" ||
            t === "select" ||
            t === "textarea"
          ))),
          (t = !l));
        break e;
      default:
        t = !1;
    }
    if (t) return null;
    if (n && typeof n != "function") throw Error(b(231, a, typeof n));
    return n;
  }
  var Ua = !(
      typeof window > "u" ||
      typeof window.document > "u" ||
      typeof window.document.createElement > "u"
    ),
    An = !1;
  if (Ua)
    try {
      var Ia = {};
      (Object.defineProperty(Ia, "passive", {
        get: function () {
          An = !0;
        },
      }),
        window.addEventListener("test", Ia, Ia),
        window.removeEventListener("test", Ia, Ia));
    } catch {
      An = !1;
    }
  var ss = null,
    As = null,
    Vt = null;
  function Ja() {
    if (Vt) return Vt;
    var t,
      a = As,
      n = a.length,
      l,
      o = "value" in ss ? ss.value : ss.textContent,
      c = o.length;
    for (t = 0; t < n && a[t] === o[t]; t++);
    var m = n - t;
    for (l = 1; l <= m && a[n - l] === o[c - l]; l++);
    return (Vt = o.slice(t, 1 < l ? 1 - l : void 0));
  }
  function Zs(t) {
    var a = t.keyCode;
    return (
      "charCode" in t
        ? ((t = t.charCode), t === 0 && a === 13 && (t = 13))
        : (t = a),
      t === 10 && (t = 13),
      32 <= t || t === 13 ? t : 0
    );
  }
  function qs() {
    return !0;
  }
  function ml() {
    return !1;
  }
  function Qt(t) {
    function a(n, l, o, c, m) {
      ((this._reactName = n),
        (this._targetInst = o),
        (this.type = l),
        (this.nativeEvent = c),
        (this.target = m),
        (this.currentTarget = null));
      for (var x in t)
        t.hasOwnProperty(x) && ((n = t[x]), (this[x] = n ? n(c) : c[x]));
      return (
        (this.isDefaultPrevented = (
          c.defaultPrevented != null ? c.defaultPrevented : c.returnValue === !1
        )
          ? qs
          : ml),
        (this.isPropagationStopped = ml),
        this
      );
    }
    return (
      G(a.prototype, {
        preventDefault: function () {
          this.defaultPrevented = !0;
          var n = this.nativeEvent;
          n &&
            (n.preventDefault
              ? n.preventDefault()
              : typeof n.returnValue != "unknown" && (n.returnValue = !1),
            (this.isDefaultPrevented = qs));
        },
        stopPropagation: function () {
          var n = this.nativeEvent;
          n &&
            (n.stopPropagation
              ? n.stopPropagation()
              : typeof n.cancelBubble != "unknown" && (n.cancelBubble = !0),
            (this.isPropagationStopped = qs));
        },
        persist: function () {},
        isPersistent: qs,
      }),
      a
    );
  }
  var Ga = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function (t) {
        return t.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0,
    },
    ei = Qt(Ga),
    cn = G({}, Ga, { view: 0, detail: 0 }),
    et = Qt(cn),
    ti,
    Pa,
    fs,
    Mn = G({}, cn, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: Hi,
      button: 0,
      buttons: 0,
      relatedTarget: function (t) {
        return t.relatedTarget === void 0
          ? t.fromElement === t.srcElement
            ? t.toElement
            : t.fromElement
          : t.relatedTarget;
      },
      movementX: function (t) {
        return "movementX" in t
          ? t.movementX
          : (t !== fs &&
              (fs && t.type === "mousemove"
                ? ((ti = t.screenX - fs.screenX), (Pa = t.screenY - fs.screenY))
                : (Pa = ti = 0),
              (fs = t)),
            ti);
      },
      movementY: function (t) {
        return "movementY" in t ? t.movementY : Pa;
      },
    }),
    pl = Qt(Mn),
    Oi = G({}, Mn, { dataTransfer: 0 }),
    lr = Qt(Oi),
    xl = G({}, cn, { relatedTarget: 0 }),
    Di = Qt(xl),
    rr = G({}, Ga, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }),
    Ri = Qt(rr),
    or = G({}, Ga, {
      clipboardData: function (t) {
        return "clipboardData" in t ? t.clipboardData : window.clipboardData;
      },
    }),
    ns = Qt(or),
    cr = G({}, Ga, { data: 0 }),
    zi = Qt(cr),
    Ms = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified",
    },
    fl = {
      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",
    },
    gl = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey",
    };
  function Bi(t) {
    var a = this.nativeEvent;
    return a.getModifierState
      ? a.getModifierState(t)
      : (t = gl[t])
        ? !!a[t]
        : !1;
  }
  function Hi() {
    return Bi;
  }
  var bl = G({}, cn, {
      key: function (t) {
        if (t.key) {
          var a = Ms[t.key] || t.key;
          if (a !== "Unidentified") return a;
        }
        return t.type === "keypress"
          ? ((t = Zs(t)), t === 13 ? "Enter" : String.fromCharCode(t))
          : t.type === "keydown" || t.type === "keyup"
            ? fl[t.keyCode] || "Unidentified"
            : "";
      },
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: Hi,
      charCode: function (t) {
        return t.type === "keypress" ? Zs(t) : 0;
      },
      keyCode: function (t) {
        return t.type === "keydown" || t.type === "keyup" ? t.keyCode : 0;
      },
      which: function (t) {
        return t.type === "keypress"
          ? Zs(t)
          : t.type === "keydown" || t.type === "keyup"
            ? t.keyCode
            : 0;
      },
    }),
    vl = Qt(bl),
    dr = G({}, Mn, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0,
    }),
    yl = Qt(dr),
    Pn = G({}, cn, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: Hi,
    }),
    ur = Qt(Pn),
    ai = G({}, Ga, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }),
    jl = Qt(ai),
    u = G({}, Mn, {
      deltaX: function (t) {
        return "deltaX" in t
          ? t.deltaX
          : "wheelDeltaX" in t
            ? -t.wheelDeltaX
            : 0;
      },
      deltaY: function (t) {
        return "deltaY" in t
          ? t.deltaY
          : "wheelDeltaY" in t
            ? -t.wheelDeltaY
            : "wheelDelta" in t
              ? -t.wheelDelta
              : 0;
      },
      deltaZ: 0,
      deltaMode: 0,
    }),
    _ = Qt(u),
    Ce = G({}, Ga, { newState: 0, oldState: 0 }),
    ct = Qt(Ce),
    La = [9, 13, 27, 32],
    Ln = Ua && "CompositionEvent" in window,
    Vs = null;
  Ua && "documentMode" in document && (Vs = document.documentMode);
  var Ui = Ua && "TextEvent" in window && !Vs,
    Qa = Ua && (!Ln || (Vs && 8 < Vs && 11 >= Vs)),
    Ys = " ",
    Nl = !1;
  function dn(t, a) {
    switch (t) {
      case "keyup":
        return La.indexOf(a.keyCode) !== -1;
      case "keydown":
        return a.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function Xs(t) {
    return (
      (t = t.detail),
      typeof t == "object" && "data" in t ? t.data : null
    );
  }
  var si = !1;
  function gs(t, a) {
    switch (t) {
      case "compositionend":
        return Xs(a);
      case "keypress":
        return a.which !== 32 ? null : ((Nl = !0), Ys);
      case "textInput":
        return ((t = a.data), t === Ys && Nl ? null : t);
      default:
        return null;
    }
  }
  function ni(t, a) {
    if (si)
      return t === "compositionend" || (!Ln && dn(t, a))
        ? ((t = Ja()), (Vt = As = ss = null), (si = !1), t)
        : null;
    switch (t) {
      case "paste":
        return null;
      case "keypress":
        if (!(a.ctrlKey || a.altKey || a.metaKey) || (a.ctrlKey && a.altKey)) {
          if (a.char && 1 < a.char.length) return a.char;
          if (a.which) return String.fromCharCode(a.which);
        }
        return null;
      case "compositionend":
        return Qa && a.locale !== "ko" ? null : a.data;
      default:
        return null;
    }
  }
  var yc = {
    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 Ps(t) {
    var a = t && t.nodeName && t.nodeName.toLowerCase();
    return a === "input" ? !!yc[t.type] : a === "textarea";
  }
  function io(t, a, n, l) {
    (Ks ? (Ge ? Ge.push(l) : (Ge = [l])) : (Ks = l),
      (a = Jo(a, "onChange")),
      0 < a.length &&
        ((n = new ei("onChange", "change", null, n, l)),
        t.push({ event: n, listeners: a })));
  }
  var Ls = null,
    Ii = null;
  function Gi(t) {
    Tm(t, 0);
  }
  function Ki(t) {
    var a = qt(t);
    if (Kt(a)) return t;
  }
  function Zi(t, a) {
    if (t === "change") return a;
  }
  var lo = !1;
  if (Ua) {
    var Es;
    if (Ua) {
      var ii = "oninput" in document;
      if (!ii) {
        var ro = document.createElement("div");
        (ro.setAttribute("oninput", "return;"),
          (ii = typeof ro.oninput == "function"));
      }
      Es = ii;
    } else Es = !1;
    lo = Es && (!document.documentMode || 9 < document.documentMode);
  }
  function _l() {
    Ls && (Ls.detachEvent("onpropertychange", oo), (Ii = Ls = null));
  }
  function oo(t) {
    if (t.propertyName === "value" && Ki(Ii)) {
      var a = [];
      (io(a, Ii, t, Cn(t)), hl(Gi, a));
    }
  }
  function $s(t, a, n) {
    t === "focusin"
      ? (_l(), (Ls = a), (Ii = n), Ls.attachEvent("onpropertychange", oo))
      : t === "focusout" && _l();
  }
  function jc(t) {
    if (t === "selectionchange" || t === "keyup" || t === "keydown")
      return Ki(Ii);
  }
  function li(t, a) {
    if (t === "click") return Ki(a);
  }
  function Nc(t, a) {
    if (t === "input" || t === "change") return Ki(a);
  }
  function Js(t, a) {
    return (t === a && (t !== 0 || 1 / t === 1 / a)) || (t !== t && a !== a);
  }
  var Sa = typeof Object.is == "function" ? Object.is : Js;
  function ri(t, a) {
    if (Sa(t, a)) return !0;
    if (
      typeof t != "object" ||
      t === null ||
      typeof a != "object" ||
      a === null
    )
      return !1;
    var n = Object.keys(t),
      l = Object.keys(a);
    if (n.length !== l.length) return !1;
    for (l = 0; l < n.length; l++) {
      var o = n[l];
      if (!_e.call(a, o) || !Sa(t[o], a[o])) return !1;
    }
    return !0;
  }
  function wl(t) {
    for (; t && t.firstChild; ) t = t.firstChild;
    return t;
  }
  function qi(t, a) {
    var n = wl(t);
    t = 0;
    for (var l; n; ) {
      if (n.nodeType === 3) {
        if (((l = t + n.textContent.length), t <= a && l >= a))
          return { node: n, offset: a - t };
        t = l;
      }
      e: {
        for (; n; ) {
          if (n.nextSibling) {
            n = n.nextSibling;
            break e;
          }
          n = n.parentNode;
        }
        n = void 0;
      }
      n = wl(n);
    }
  }
  function kl(t, a) {
    return t && a
      ? t === a
        ? !0
        : t && t.nodeType === 3
          ? !1
          : a && a.nodeType === 3
            ? kl(t, a.parentNode)
            : "contains" in t
              ? t.contains(a)
              : t.compareDocumentPosition
                ? !!(t.compareDocumentPosition(a) & 16)
                : !1
      : !1;
  }
  function Vi(t) {
    t =
      t != null &&
      t.ownerDocument != null &&
      t.ownerDocument.defaultView != null
        ? t.ownerDocument.defaultView
        : window;
    for (var a = nn(t.document); a instanceof t.HTMLIFrameElement; ) {
      try {
        var n = typeof a.contentWindow.location.href == "string";
      } catch {
        n = !1;
      }
      if (n) t = a.contentWindow;
      else break;
      a = nn(t.document);
    }
    return a;
  }
  function un(t) {
    var a = t && t.nodeName && t.nodeName.toLowerCase();
    return (
      a &&
      ((a === "input" &&
        (t.type === "text" ||
          t.type === "search" ||
          t.type === "tel" ||
          t.type === "url" ||
          t.type === "password")) ||
        a === "textarea" ||
        t.contentEditable === "true")
    );
  }
  var Sl = Ua && "documentMode" in document && 11 >= document.documentMode,
    hn = null,
    Tl = null,
    Yi = null,
    oi = !1;
  function co(t, a, n) {
    var l =
      n.window === n ? n.document : n.nodeType === 9 ? n : n.ownerDocument;
    oi ||
      hn == null ||
      hn !== nn(l) ||
      ((l = hn),
      "selectionStart" in l && un(l)
        ? (l = { start: l.selectionStart, end: l.selectionEnd })
        : ((l = (
            (l.ownerDocument && l.ownerDocument.defaultView) ||
            window
          ).getSelection()),
          (l = {
            anchorNode: l.anchorNode,
            anchorOffset: l.anchorOffset,
            focusNode: l.focusNode,
            focusOffset: l.focusOffset,
          })),
      (Yi && ri(Yi, l)) ||
        ((Yi = l),
        (l = Jo(Tl, "onSelect")),
        0 < l.length &&
          ((a = new ei("onSelect", "select", null, a, n)),
          t.push({ event: a, listeners: l }),
          (a.target = hn))));
  }
  function mn(t, a) {
    var n = {};
    return (
      (n[t.toLowerCase()] = a.toLowerCase()),
      (n["Webkit" + t] = "webkit" + a),
      (n["Moz" + t] = "moz" + a),
      n
    );
  }
  var ci = {
      animationend: mn("Animation", "AnimationEnd"),
      animationiteration: mn("Animation", "AnimationIteration"),
      animationstart: mn("Animation", "AnimationStart"),
      transitionrun: mn("Transition", "TransitionRun"),
      transitionstart: mn("Transition", "TransitionStart"),
      transitioncancel: mn("Transition", "TransitionCancel"),
      transitionend: mn("Transition", "TransitionEnd"),
    },
    Cl = {},
    uo = {};
  Ua &&
    ((uo = document.createElement("div").style),
    "AnimationEvent" in window ||
      (delete ci.animationend.animation,
      delete ci.animationiteration.animation,
      delete ci.animationstart.animation),
    "TransitionEvent" in window || delete ci.transitionend.transition);
  function Ta(t) {
    if (Cl[t]) return Cl[t];
    if (!ci[t]) return t;
    var a = ci[t],
      n;
    for (n in a) if (a.hasOwnProperty(n) && n in uo) return (Cl[t] = a[n]);
    return t;
  }
  var Xi = Ta("animationend"),
    ho = Ta("animationiteration"),
    $i = Ta("animationstart"),
    _c = Ta("transitionrun"),
    mo = Ta("transitionstart"),
    wc = Ta("transitioncancel"),
    di = Ta("transitionend"),
    po = new Map(),
    pn =
      "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(
        " ",
      );
  pn.push("scrollEnd");
  function is(t, a) {
    (po.set(t, a), aa(a, [t]));
  }
  var Ji =
      typeof reportError == "function"
        ? reportError
        : function (t) {
            if (
              typeof window == "object" &&
              typeof window.ErrorEvent == "function"
            ) {
              var a = new window.ErrorEvent("error", {
                bubbles: !0,
                cancelable: !0,
                message:
                  typeof t == "object" &&
                  t !== null &&
                  typeof t.message == "string"
                    ? String(t.message)
                    : String(t),
                error: t,
              });
              if (!window.dispatchEvent(a)) return;
            } else if (
              typeof process == "object" &&
              typeof process.emit == "function"
            ) {
              process.emit("uncaughtException", t);
              return;
            }
            console.error(t);
          },
    ls = [],
    Ka = 0,
    Al = 0;
  function Qi() {
    for (var t = Ka, a = (Al = Ka = 0); a < t; ) {
      var n = ls[a];
      ls[a++] = null;
      var l = ls[a];
      ls[a++] = null;
      var o = ls[a];
      ls[a++] = null;
      var c = ls[a];
      if (((ls[a++] = null), l !== null && o !== null)) {
        var m = l.pending;
        (m === null ? (o.next = o) : ((o.next = m.next), (m.next = o)),
          (l.pending = o));
      }
      c !== 0 && ui(n, o, c);
    }
  }
  function xn(t, a, n, l) {
    ((ls[Ka++] = t),
      (ls[Ka++] = a),
      (ls[Ka++] = n),
      (ls[Ka++] = l),
      (Al |= l),
      (t.lanes |= l),
      (t = t.alternate),
      t !== null && (t.lanes |= l));
  }
  function hr(t, a, n, l) {
    return (xn(t, a, n, l), Wi(t));
  }
  function Os(t, a) {
    return (xn(t, null, null, a), Wi(t));
  }
  function ui(t, a, n) {
    t.lanes |= n;
    var l = t.alternate;
    l !== null && (l.lanes |= n);
    for (var o = !1, c = t.return; c !== null; )
      ((c.childLanes |= n),
        (l = c.alternate),
        l !== null && (l.childLanes |= n),
        c.tag === 22 &&
          ((t = c.stateNode), t === null || t._visibility & 1 || (o = !0)),
        (t = c),
        (c = c.return));
    return t.tag === 3
      ? ((c = t.stateNode),
        o &&
          a !== null &&
          ((o = 31 - Zt(n)),
          (t = c.hiddenUpdates),
          (l = t[o]),
          l === null ? (t[o] = [a]) : l.push(a),
          (a.lane = n | 536870912)),
        c)
      : null;
  }
  function Wi(t) {
    if (50 < zr) throw ((zr = 0), (Sd = null), Error(b(185)));
    for (var a = t.return; a !== null; ) ((t = a), (a = t.return));
    return t.tag === 3 ? t.stateNode : null;
  }
  var En = {};
  function kc(t, a, n, l) {
    ((this.tag = t),
      (this.key = n),
      (this.sibling =
        this.child =
        this.return =
        this.stateNode =
        this.type =
        this.elementType =
          null),
      (this.index = 0),
      (this.refCleanup = this.ref = null),
      (this.pendingProps = a),
      (this.dependencies =
        this.memoizedState =
        this.updateQueue =
        this.memoizedProps =
          null),
      (this.mode = l),
      (this.subtreeFlags = this.flags = 0),
      (this.deletions = null),
      (this.childLanes = this.lanes = 0),
      (this.alternate = null));
  }
  function Za(t, a, n, l) {
    return new kc(t, a, n, l);
  }
  function Ml(t) {
    return ((t = t.prototype), !(!t || !t.isReactComponent));
  }
  function Ds(t, a) {
    var n = t.alternate;
    return (
      n === null
        ? ((n = Za(t.tag, a, t.key, t.mode)),
          (n.elementType = t.elementType),
          (n.type = t.type),
          (n.stateNode = t.stateNode),
          (n.alternate = t),
          (t.alternate = n))
        : ((n.pendingProps = a),
          (n.type = t.type),
          (n.flags = 0),
          (n.subtreeFlags = 0),
          (n.deletions = null)),
      (n.flags = t.flags & 65011712),
      (n.childLanes = t.childLanes),
      (n.lanes = t.lanes),
      (n.child = t.child),
      (n.memoizedProps = t.memoizedProps),
      (n.memoizedState = t.memoizedState),
      (n.updateQueue = t.updateQueue),
      (a = t.dependencies),
      (n.dependencies =
        a === null ? null : { lanes: a.lanes, firstContext: a.firstContext }),
      (n.sibling = t.sibling),
      (n.index = t.index),
      (n.ref = t.ref),
      (n.refCleanup = t.refCleanup),
      n
    );
  }
  function mr(t, a) {
    t.flags &= 65011714;
    var n = t.alternate;
    return (
      n === null
        ? ((t.childLanes = 0),
          (t.lanes = a),
          (t.child = null),
          (t.subtreeFlags = 0),
          (t.memoizedProps = null),
          (t.memoizedState = null),
          (t.updateQueue = null),
          (t.dependencies = null),
          (t.stateNode = null))
        : ((t.childLanes = n.childLanes),
          (t.lanes = n.lanes),
          (t.child = n.child),
          (t.subtreeFlags = 0),
          (t.deletions = null),
          (t.memoizedProps = n.memoizedProps),
          (t.memoizedState = n.memoizedState),
          (t.updateQueue = n.updateQueue),
          (t.type = n.type),
          (a = n.dependencies),
          (t.dependencies =
            a === null
              ? null
              : { lanes: a.lanes, firstContext: a.firstContext })),
      t
    );
  }
  function Fi(t, a, n, l, o, c) {
    var m = 0;
    if (((l = t), typeof t == "function")) Ml(t) && (m = 1);
    else if (typeof t == "string")
      m = Gx(t, n, X.current)
        ? 26
        : t === "html" || t === "head" || t === "body"
          ? 27
          : 5;
    else
      e: switch (t) {
        case Te:
          return (
            (t = Za(31, n, a, o)),
            (t.elementType = Te),
            (t.lanes = c),
            t
          );
        case Y:
          return On(n.children, o, c, a);
        case Ee:
          ((m = 8), (o |= 24));
          break;
        case Se:
          return (
            (t = Za(12, n, a, o | 2)),
            (t.elementType = Se),
            (t.lanes = c),
            t
          );
        case de:
          return (
            (t = Za(13, n, a, o)),
            (t.elementType = de),
            (t.lanes = c),
            t
          );
        case oe:
          return (
            (t = Za(19, n, a, o)),
            (t.elementType = oe),
            (t.lanes = c),
            t
          );
        default:
          if (typeof t == "object" && t !== null)
            switch (t.$$typeof) {
              case ie:
                m = 10;
                break e;
              case le:
                m = 9;
                break e;
              case $:
                m = 11;
                break e;
              case be:
                m = 14;
                break e;
              case Ye:
                ((m = 16), (l = null));
                break e;
            }
          ((m = 29),
            (n = Error(b(130, t === null ? "null" : typeof t, ""))),
            (l = null));
      }
    return (
      (a = Za(m, n, a, o)),
      (a.elementType = t),
      (a.type = l),
      (a.lanes = c),
      a
    );
  }
  function On(t, a, n, l) {
    return ((t = Za(7, t, l, a)), (t.lanes = n), t);
  }
  function Pl(t, a, n) {
    return ((t = Za(6, t, null, a)), (t.lanes = n), t);
  }
  function pr(t) {
    var a = Za(18, null, null, 0);
    return ((a.stateNode = t), a);
  }
  function xr(t, a, n) {
    return (
      (a = Za(4, t.children !== null ? t.children : [], t.key, a)),
      (a.lanes = n),
      (a.stateNode = {
        containerInfo: t.containerInfo,
        pendingChildren: null,
        implementation: t.implementation,
      }),
      a
    );
  }
  var s = new WeakMap();
  function i(t, a) {
    if (typeof t == "object" && t !== null) {
      var n = s.get(t);
      return n !== void 0
        ? n
        : ((a = { value: t, source: a, stack: Z(a) }), s.set(t, a), a);
    }
    return { value: t, source: a, stack: Z(a) };
  }
  var r = [],
    d = 0,
    h = null,
    p = 0,
    j = [],
    M = 0,
    H = null,
    se = 1,
    ye = "";
  function De(t, a) {
    ((r[d++] = p), (r[d++] = h), (h = t), (p = a));
  }
  function it(t, a, n) {
    ((j[M++] = se), (j[M++] = ye), (j[M++] = H), (H = t));
    var l = se;
    t = ye;
    var o = 32 - Zt(l) - 1;
    ((l &= ~(1 << o)), (n += 1));
    var c = 32 - Zt(a) + o;
    if (30 < c) {
      var m = o - (o % 5);
      ((c = (l & ((1 << m) - 1)).toString(32)),
        (l >>= m),
        (o -= m),
        (se = (1 << (32 - Zt(a) + o)) | (n << o) | l),
        (ye = c + t));
    } else ((se = (1 << c) | (n << o) | l), (ye = t));
  }
  function va(t) {
    t.return !== null && (De(t, 1), it(t, 1, 0));
  }
  function sa(t) {
    for (; t === h; )
      ((h = r[--d]), (r[d] = null), (p = r[--d]), (r[d] = null));
    for (; t === H; )
      ((H = j[--M]),
        (j[M] = null),
        (ye = j[--M]),
        (j[M] = null),
        (se = j[--M]),
        (j[M] = null));
  }
  function Wa(t, a) {
    ((j[M++] = se),
      (j[M++] = ye),
      (j[M++] = H),
      (se = a.id),
      (ye = a.overflow),
      (H = t));
  }
  var jt = null,
    Nt = null,
    dt = !1,
    fn = null,
    rs = !1,
    Ll = Error(b(519));
  function gn(t) {
    var a = Error(
      b(
        418,
        1 < arguments.length && arguments[1] !== void 0 && arguments[1]
          ? "text"
          : "HTML",
        "",
      ),
    );
    throw (el(i(a, t)), Ll);
  }
  function fr(t) {
    var a = t.stateNode,
      n = t.type,
      l = t.memoizedProps;
    switch (((a[we] = t), (a[Ve] = l), n)) {
      case "dialog":
        (ht("cancel", a), ht("close", a));
        break;
      case "iframe":
      case "object":
      case "embed":
        ht("load", a);
        break;
      case "video":
      case "audio":
        for (n = 0; n < Hr.length; n++) ht(Hr[n], a);
        break;
      case "source":
        ht("error", a);
        break;
      case "img":
      case "image":
      case "link":
        (ht("error", a), ht("load", a));
        break;
      case "details":
        ht("toggle", a);
        break;
      case "input":
        (ht("invalid", a),
          ln(
            a,
            l.value,
            l.defaultValue,
            l.checked,
            l.defaultChecked,
            l.type,
            l.name,
            !0,
          ));
        break;
      case "select":
        ht("invalid", a);
        break;
      case "textarea":
        (ht("invalid", a), Is(a, l.value, l.defaultValue, l.children));
    }
    ((n = l.children),
      (typeof n != "string" && typeof n != "number" && typeof n != "bigint") ||
      a.textContent === "" + n ||
      l.suppressHydrationWarning === !0 ||
      Pm(a.textContent, n)
        ? (l.popover != null && (ht("beforetoggle", a), ht("toggle", a)),
          l.onScroll != null && ht("scroll", a),
          l.onScrollEnd != null && ht("scrollend", a),
          l.onClick != null && (a.onclick = Ha),
          (a = !0))
        : (a = !1),
      a || gn(t, !0));
  }
  function ta(t) {
    for (jt = t.return; jt; )
      switch (jt.tag) {
        case 5:
        case 31:
        case 13:
          rs = !1;
          return;
        case 27:
        case 3:
          rs = !0;
          return;
        default:
          jt = jt.return;
      }
  }
  function Qs(t) {
    if (t !== jt) return !1;
    if (!dt) return (ta(t), (dt = !0), !1);
    var a = t.tag,
      n;
    if (
      ((n = a !== 3 && a !== 27) &&
        ((n = a === 5) &&
          ((n = t.type),
          (n =
            !(n !== "form" && n !== "button") || Id(t.type, t.memoizedProps))),
        (n = !n)),
      n && Nt && gn(t),
      ta(t),
      a === 13)
    ) {
      if (((t = t.memoizedState), (t = t !== null ? t.dehydrated : null), !t))
        throw Error(b(317));
      Nt = Um(t);
    } else if (a === 31) {
      if (((t = t.memoizedState), (t = t !== null ? t.dehydrated : null), !t))
        throw Error(b(317));
      Nt = Um(t);
    } else
      a === 27
        ? ((a = Nt), ki(t.type) ? ((t = Vd), (Vd = null), (Nt = t)) : (Nt = a))
        : (Nt = jt ? zs(t.stateNode.nextSibling) : null);
    return !0;
  }
  function Dn() {
    ((Nt = jt = null), (dt = !1));
  }
  function gr() {
    var t = fn;
    return (
      t !== null &&
        (us === null ? (us = t) : us.push.apply(us, t), (fn = null)),
      t
    );
  }
  function el(t) {
    fn === null ? (fn = [t]) : fn.push(t);
  }
  var tl = g(null),
    bn = null,
    Ws = null;
  function hi(t, a, n) {
    (I(tl, a._currentValue), (a._currentValue = n));
  }
  function Rn(t) {
    ((t._currentValue = tl.current), C(tl));
  }
  function Sc(t, a, n) {
    for (; t !== null; ) {
      var l = t.alternate;
      if (
        ((t.childLanes & a) !== a
          ? ((t.childLanes |= a), l !== null && (l.childLanes |= a))
          : l !== null && (l.childLanes & a) !== a && (l.childLanes |= a),
        t === n)
      )
        break;
      t = t.return;
    }
  }
  function Tc(t, a, n, l) {
    var o = t.child;
    for (o !== null && (o.return = t); o !== null; ) {
      var c = o.dependencies;
      if (c !== null) {
        var m = o.child;
        c = c.firstContext;
        e: for (; c !== null; ) {
          var x = c;
          c = o;
          for (var N = 0; N < a.length; N++)
            if (x.context === a[N]) {
              ((c.lanes |= n),
                (x = c.alternate),
                x !== null && (x.lanes |= n),
                Sc(c.return, n, t),
                l || (m = null));
              break e;
            }
          c = x.next;
        }
      } else if (o.tag === 18) {
        if (((m = o.return), m === null)) throw Error(b(341));
        ((m.lanes |= n),
          (c = m.alternate),
          c !== null && (c.lanes |= n),
          Sc(m, n, t),
          (m = null));
      } else m = o.child;
      if (m !== null) m.return = o;
      else
        for (m = o; m !== null; ) {
          if (m === t) {
            m = null;
            break;
          }
          if (((o = m.sibling), o !== null)) {
            ((o.return = m.return), (m = o));
            break;
          }
          m = m.return;
        }
      o = m;
    }
  }
  function El(t, a, n, l) {
    t = null;
    for (var o = a, c = !1; o !== null; ) {
      if (!c) {
        if ((o.flags & 524288) !== 0) c = !0;
        else if ((o.flags & 262144) !== 0) break;
      }
      if (o.tag === 10) {
        var m = o.alternate;
        if (m === null) throw Error(b(387));
        if (((m = m.memoizedProps), m !== null)) {
          var x = o.type;
          Sa(o.pendingProps.value, m.value) ||
            (t !== null ? t.push(x) : (t = [x]));
        }
      } else if (o === Ne.current) {
        if (((m = o.alternate), m === null)) throw Error(b(387));
        m.memoizedState.memoizedState !== o.memoizedState.memoizedState &&
          (t !== null ? t.push(Zr) : (t = [Zr]));
      }
      o = o.return;
    }
    (t !== null && Tc(a, t, n, l), (a.flags |= 262144));
  }
  function xo(t) {
    for (t = t.firstContext; t !== null; ) {
      if (!Sa(t.context._currentValue, t.memoizedValue)) return !0;
      t = t.next;
    }
    return !1;
  }
  function al(t) {
    ((bn = t),
      (Ws = null),
      (t = t.dependencies),
      t !== null && (t.firstContext = null));
  }
  function Ea(t) {
    return fu(bn, t);
  }
  function fo(t, a) {
    return (bn === null && al(t), fu(t, a));
  }
  function fu(t, a) {
    var n = a._currentValue;
    if (((a = { context: a, memoizedValue: n, next: null }), Ws === null)) {
      if (t === null) throw Error(b(308));
      ((Ws = a),
        (t.dependencies = { lanes: 0, firstContext: a }),
        (t.flags |= 524288));
    } else Ws = Ws.next = a;
    return n;
  }
  var Bp =
      typeof AbortController < "u"
        ? AbortController
        : function () {
            var t = [],
              a = (this.signal = {
                aborted: !1,
                addEventListener: function (n, l) {
                  t.push(l);
                },
              });
            this.abort = function () {
              ((a.aborted = !0),
                t.forEach(function (n) {
                  return n();
                }));
            };
          },
    Hp = w.unstable_scheduleCallback,
    Up = w.unstable_NormalPriority,
    ha = {
      $$typeof: ie,
      Consumer: null,
      Provider: null,
      _currentValue: null,
      _currentValue2: null,
      _threadCount: 0,
    };
  function Cc() {
    return { controller: new Bp(), data: new Map(), refCount: 0 };
  }
  function br(t) {
    (t.refCount--,
      t.refCount === 0 &&
        Hp(Up, function () {
          t.controller.abort();
        }));
  }
  var vr = null,
    Ac = 0,
    Ol = 0,
    Dl = null;
  function Ip(t, a) {
    if (vr === null) {
      var n = (vr = []);
      ((Ac = 0),
        (Ol = Ld()),
        (Dl = {
          status: "pending",
          value: void 0,
          then: function (l) {
            n.push(l);
          },
        }));
    }
    return (Ac++, a.then(gu, gu), a);
  }
  function gu() {
    if (--Ac === 0 && vr !== null) {
      Dl !== null && (Dl.status = "fulfilled");
      var t = vr;
      ((vr = null), (Ol = 0), (Dl = null));
      for (var a = 0; a < t.length; a++) (0, t[a])();
    }
  }
  function Gp(t, a) {
    var n = [],
      l = {
        status: "pending",
        value: null,
        reason: null,
        then: function (o) {
          n.push(o);
        },
      };
    return (
      t.then(
        function () {
          ((l.status = "fulfilled"), (l.value = a));
          for (var o = 0; o < n.length; o++) (0, n[o])(a);
        },
        function (o) {
          for (l.status = "rejected", l.reason = o, o = 0; o < n.length; o++)
            (0, n[o])(void 0);
        },
      ),
      l
    );
  }
  var bu = y.S;
  y.S = function (t, a) {
    ((tm = E()),
      typeof a == "object" &&
        a !== null &&
        typeof a.then == "function" &&
        Ip(t, a),
      bu !== null && bu(t, a));
  };
  var sl = g(null);
  function Mc() {
    var t = sl.current;
    return t !== null ? t : Gt.pooledCache;
  }
  function go(t, a) {
    a === null ? I(sl, sl.current) : I(sl, a.pool);
  }
  function vu() {
    var t = Mc();
    return t === null ? null : { parent: ha._currentValue, pool: t };
  }
  var Rl = Error(b(460)),
    Pc = Error(b(474)),
    bo = Error(b(542)),
    vo = { then: function () {} };
  function yu(t) {
    return ((t = t.status), t === "fulfilled" || t === "rejected");
  }
  function ju(t, a, n) {
    switch (
      ((n = t[n]),
      n === void 0 ? t.push(a) : n !== a && (a.then(Ha, Ha), (a = n)),
      a.status)
    ) {
      case "fulfilled":
        return a.value;
      case "rejected":
        throw ((t = a.reason), _u(t), t);
      default:
        if (typeof a.status == "string") a.then(Ha, Ha);
        else {
          if (((t = Gt), t !== null && 100 < t.shellSuspendCounter))
            throw Error(b(482));
          ((t = a),
            (t.status = "pending"),
            t.then(
              function (l) {
                if (a.status === "pending") {
                  var o = a;
                  ((o.status = "fulfilled"), (o.value = l));
                }
              },
              function (l) {
                if (a.status === "pending") {
                  var o = a;
                  ((o.status = "rejected"), (o.reason = l));
                }
              },
            ));
        }
        switch (a.status) {
          case "fulfilled":
            return a.value;
          case "rejected":
            throw ((t = a.reason), _u(t), t);
        }
        throw ((il = a), Rl);
    }
  }
  function nl(t) {
    try {
      var a = t._init;
      return a(t._payload);
    } catch (n) {
      throw n !== null && typeof n == "object" && typeof n.then == "function"
        ? ((il = n), Rl)
        : n;
    }
  }
  var il = null;
  function Nu() {
    if (il === null) throw Error(b(459));
    var t = il;
    return ((il = null), t);
  }
  function _u(t) {
    if (t === Rl || t === bo) throw Error(b(483));
  }
  var zl = null,
    yr = 0;
  function yo(t) {
    var a = yr;
    return ((yr += 1), zl === null && (zl = []), ju(zl, t, a));
  }
  function jr(t, a) {
    ((a = a.props.ref), (t.ref = a !== void 0 ? a : null));
  }
  function jo(t, a) {
    throw a.$$typeof === F
      ? Error(b(525))
      : ((t = Object.prototype.toString.call(a)),
        Error(
          b(
            31,
            t === "[object Object]"
              ? "object with keys {" + Object.keys(a).join(", ") + "}"
              : t,
          ),
        ));
  }
  function wu(t) {
    function a(A, k) {
      if (t) {
        var D = A.deletions;
        D === null ? ((A.deletions = [k]), (A.flags |= 16)) : D.push(k);
      }
    }
    function n(A, k) {
      if (!t) return null;
      for (; k !== null; ) (a(A, k), (k = k.sibling));
      return null;
    }
    function l(A) {
      for (var k = new Map(); A !== null; )
        (A.key !== null ? k.set(A.key, A) : k.set(A.index, A), (A = A.sibling));
      return k;
    }
    function o(A, k) {
      return ((A = Ds(A, k)), (A.index = 0), (A.sibling = null), A);
    }
    function c(A, k, D) {
      return (
        (A.index = D),
        t
          ? ((D = A.alternate),
            D !== null
              ? ((D = D.index), D < k ? ((A.flags |= 67108866), k) : D)
              : ((A.flags |= 67108866), k))
          : ((A.flags |= 1048576), k)
      );
    }
    function m(A) {
      return (t && A.alternate === null && (A.flags |= 67108866), A);
    }
    function x(A, k, D, W) {
      return k === null || k.tag !== 6
        ? ((k = Pl(D, A.mode, W)), (k.return = A), k)
        : ((k = o(k, D)), (k.return = A), k);
    }
    function N(A, k, D, W) {
      var He = D.type;
      return He === Y
        ? Q(A, k, D.props.children, W, D.key)
        : k !== null &&
            (k.elementType === He ||
              (typeof He == "object" &&
                He !== null &&
                He.$$typeof === Ye &&
                nl(He) === k.type))
          ? ((k = o(k, D.props)), jr(k, D), (k.return = A), k)
          : ((k = Fi(D.type, D.key, D.props, null, A.mode, W)),
            jr(k, D),
            (k.return = A),
            k);
    }
    function R(A, k, D, W) {
      return k === null ||
        k.tag !== 4 ||
        k.stateNode.containerInfo !== D.containerInfo ||
        k.stateNode.implementation !== D.implementation
        ? ((k = xr(D, A.mode, W)), (k.return = A), k)
        : ((k = o(k, D.children || [])), (k.return = A), k);
    }
    function Q(A, k, D, W, He) {
      return k === null || k.tag !== 7
        ? ((k = On(D, A.mode, W, He)), (k.return = A), k)
        : ((k = o(k, D)), (k.return = A), k);
    }
    function ne(A, k, D) {
      if (
        (typeof k == "string" && k !== "") ||
        typeof k == "number" ||
        typeof k == "bigint"
      )
        return ((k = Pl("" + k, A.mode, D)), (k.return = A), k);
      if (typeof k == "object" && k !== null) {
        switch (k.$$typeof) {
          case ce:
            return (
              (D = Fi(k.type, k.key, k.props, null, A.mode, D)),
              jr(D, k),
              (D.return = A),
              D
            );
          case ve:
            return ((k = xr(k, A.mode, D)), (k.return = A), k);
          case Ye:
            return ((k = nl(k)), ne(A, k, D));
        }
        if (Ue(k) || Oe(k))
          return ((k = On(k, A.mode, D, null)), (k.return = A), k);
        if (typeof k.then == "function") return ne(A, yo(k), D);
        if (k.$$typeof === ie) return ne(A, fo(A, k), D);
        jo(A, k);
      }
      return null;
    }
    function U(A, k, D, W) {
      var He = k !== null ? k.key : null;
      if (
        (typeof D == "string" && D !== "") ||
        typeof D == "number" ||
        typeof D == "bigint"
      )
        return He !== null ? null : x(A, k, "" + D, W);
      if (typeof D == "object" && D !== null) {
        switch (D.$$typeof) {
          case ce:
            return D.key === He ? N(A, k, D, W) : null;
          case ve:
            return D.key === He ? R(A, k, D, W) : null;
          case Ye:
            return ((D = nl(D)), U(A, k, D, W));
        }
        if (Ue(D) || Oe(D)) return He !== null ? null : Q(A, k, D, W, null);
        if (typeof D.then == "function") return U(A, k, yo(D), W);
        if (D.$$typeof === ie) return U(A, k, fo(A, D), W);
        jo(A, D);
      }
      return null;
    }
    function q(A, k, D, W, He) {
      if (
        (typeof W == "string" && W !== "") ||
        typeof W == "number" ||
        typeof W == "bigint"
      )
        return ((A = A.get(D) || null), x(k, A, "" + W, He));
      if (typeof W == "object" && W !== null) {
        switch (W.$$typeof) {
          case ce:
            return (
              (A = A.get(W.key === null ? D : W.key) || null),
              N(k, A, W, He)
            );
          case ve:
            return (
              (A = A.get(W.key === null ? D : W.key) || null),
              R(k, A, W, He)
            );
          case Ye:
            return ((W = nl(W)), q(A, k, D, W, He));
        }
        if (Ue(W) || Oe(W))
          return ((A = A.get(D) || null), Q(k, A, W, He, null));
        if (typeof W.then == "function") return q(A, k, D, yo(W), He);
        if (W.$$typeof === ie) return q(A, k, D, fo(k, W), He);
        jo(k, W);
      }
      return null;
    }
    function ke(A, k, D, W) {
      for (
        var He = null, _t = null, Le = k, lt = (k = 0), gt = null;
        Le !== null && lt < D.length;
        lt++
      ) {
        Le.index > lt ? ((gt = Le), (Le = null)) : (gt = Le.sibling);
        var wt = U(A, Le, D[lt], W);
        if (wt === null) {
          Le === null && (Le = gt);
          break;
        }
        (t && Le && wt.alternate === null && a(A, Le),
          (k = c(wt, k, lt)),
          _t === null ? (He = wt) : (_t.sibling = wt),
          (_t = wt),
          (Le = gt));
      }
      if (lt === D.length) return (n(A, Le), dt && De(A, lt), He);
      if (Le === null) {
        for (; lt < D.length; lt++)
          ((Le = ne(A, D[lt], W)),
            Le !== null &&
              ((k = c(Le, k, lt)),
              _t === null ? (He = Le) : (_t.sibling = Le),
              (_t = Le)));
        return (dt && De(A, lt), He);
      }
      for (Le = l(Le); lt < D.length; lt++)
        ((gt = q(Le, A, lt, D[lt], W)),
          gt !== null &&
            (t &&
              gt.alternate !== null &&
              Le.delete(gt.key === null ? lt : gt.key),
            (k = c(gt, k, lt)),
            _t === null ? (He = gt) : (_t.sibling = gt),
            (_t = gt)));
      return (
        t &&
          Le.forEach(function (Mi) {
            return a(A, Mi);
          }),
        dt && De(A, lt),
        He
      );
    }
    function Ke(A, k, D, W) {
      if (D == null) throw Error(b(151));
      for (
        var He = null,
          _t = null,
          Le = k,
          lt = (k = 0),
          gt = null,
          wt = D.next();
        Le !== null && !wt.done;
        lt++, wt = D.next()
      ) {
        Le.index > lt ? ((gt = Le), (Le = null)) : (gt = Le.sibling);
        var Mi = U(A, Le, wt.value, W);
        if (Mi === null) {
          Le === null && (Le = gt);
          break;
        }
        (t && Le && Mi.alternate === null && a(A, Le),
          (k = c(Mi, k, lt)),
          _t === null ? (He = Mi) : (_t.sibling = Mi),
          (_t = Mi),
          (Le = gt));
      }
      if (wt.done) return (n(A, Le), dt && De(A, lt), He);
      if (Le === null) {
        for (; !wt.done; lt++, wt = D.next())
          ((wt = ne(A, wt.value, W)),
            wt !== null &&
              ((k = c(wt, k, lt)),
              _t === null ? (He = wt) : (_t.sibling = wt),
              (_t = wt)));
        return (dt && De(A, lt), He);
      }
      for (Le = l(Le); !wt.done; lt++, wt = D.next())
        ((wt = q(Le, A, lt, wt.value, W)),
          wt !== null &&
            (t &&
              wt.alternate !== null &&
              Le.delete(wt.key === null ? lt : wt.key),
            (k = c(wt, k, lt)),
            _t === null ? (He = wt) : (_t.sibling = wt),
            (_t = wt)));
      return (
        t &&
          Le.forEach(function (Fx) {
            return a(A, Fx);
          }),
        dt && De(A, lt),
        He
      );
    }
    function Bt(A, k, D, W) {
      if (
        (typeof D == "object" &&
          D !== null &&
          D.type === Y &&
          D.key === null &&
          (D = D.props.children),
        typeof D == "object" && D !== null)
      ) {
        switch (D.$$typeof) {
          case ce:
            e: {
              for (var He = D.key; k !== null; ) {
                if (k.key === He) {
                  if (((He = D.type), He === Y)) {
                    if (k.tag === 7) {
                      (n(A, k.sibling),
                        (W = o(k, D.props.children)),
                        (W.return = A),
                        (A = W));
                      break e;
                    }
                  } else if (
                    k.elementType === He ||
                    (typeof He == "object" &&
                      He !== null &&
                      He.$$typeof === Ye &&
                      nl(He) === k.type)
                  ) {
                    (n(A, k.sibling),
                      (W = o(k, D.props)),
                      jr(W, D),
                      (W.return = A),
                      (A = W));
                    break e;
                  }
                  n(A, k);
                  break;
                } else a(A, k);
                k = k.sibling;
              }
              D.type === Y
                ? ((W = On(D.props.children, A.mode, W, D.key)),
                  (W.return = A),
                  (A = W))
                : ((W = Fi(D.type, D.key, D.props, null, A.mode, W)),
                  jr(W, D),
                  (W.return = A),
                  (A = W));
            }
            return m(A);
          case ve:
            e: {
              for (He = D.key; k !== null; ) {
                if (k.key === He)
                  if (
                    k.tag === 4 &&
                    k.stateNode.containerInfo === D.containerInfo &&
                    k.stateNode.implementation === D.implementation
                  ) {
                    (n(A, k.sibling),
                      (W = o(k, D.children || [])),
                      (W.return = A),
                      (A = W));
                    break e;
                  } else {
                    n(A, k);
                    break;
                  }
                else a(A, k);
                k = k.sibling;
              }
              ((W = xr(D, A.mode, W)), (W.return = A), (A = W));
            }
            return m(A);
          case Ye:
            return ((D = nl(D)), Bt(A, k, D, W));
        }
        if (Ue(D)) return ke(A, k, D, W);
        if (Oe(D)) {
          if (((He = Oe(D)), typeof He != "function")) throw Error(b(150));
          return ((D = He.call(D)), Ke(A, k, D, W));
        }
        if (typeof D.then == "function") return Bt(A, k, yo(D), W);
        if (D.$$typeof === ie) return Bt(A, k, fo(A, D), W);
        jo(A, D);
      }
      return (typeof D == "string" && D !== "") ||
        typeof D == "number" ||
        typeof D == "bigint"
        ? ((D = "" + D),
          k !== null && k.tag === 6
            ? (n(A, k.sibling), (W = o(k, D)), (W.return = A), (A = W))
            : (n(A, k), (W = Pl(D, A.mode, W)), (W.return = A), (A = W)),
          m(A))
        : n(A, k);
    }
    return function (A, k, D, W) {
      try {
        yr = 0;
        var He = Bt(A, k, D, W);
        return ((zl = null), He);
      } catch (Le) {
        if (Le === Rl || Le === bo) throw Le;
        var _t = Za(29, Le, null, A.mode);
        return ((_t.lanes = W), (_t.return = A), _t);
      } finally {
      }
    };
  }
  var ll = wu(!0),
    ku = wu(!1),
    mi = !1;
  function Lc(t) {
    t.updateQueue = {
      baseState: t.memoizedState,
      firstBaseUpdate: null,
      lastBaseUpdate: null,
      shared: { pending: null, lanes: 0, hiddenCallbacks: null },
      callbacks: null,
    };
  }
  function Ec(t, a) {
    ((t = t.updateQueue),
      a.updateQueue === t &&
        (a.updateQueue = {
          baseState: t.baseState,
          firstBaseUpdate: t.firstBaseUpdate,
          lastBaseUpdate: t.lastBaseUpdate,
          shared: t.shared,
          callbacks: null,
        }));
  }
  function pi(t) {
    return { lane: t, tag: 0, payload: null, callback: null, next: null };
  }
  function xi(t, a, n) {
    var l = t.updateQueue;
    if (l === null) return null;
    if (((l = l.shared), (kt & 2) !== 0)) {
      var o = l.pending;
      return (
        o === null ? (a.next = a) : ((a.next = o.next), (o.next = a)),
        (l.pending = a),
        (a = Wi(t)),
        ui(t, null, n),
        a
      );
    }
    return (xn(t, l, a, n), Wi(t));
  }
  function Nr(t, a, n) {
    if (
      ((a = a.updateQueue), a !== null && ((a = a.shared), (n & 4194048) !== 0))
    ) {
      var l = a.lanes;
      ((l &= t.pendingLanes), (n |= l), (a.lanes = n), Qn(t, n));
    }
  }
  function Oc(t, a) {
    var n = t.updateQueue,
      l = t.alternate;
    if (l !== null && ((l = l.updateQueue), n === l)) {
      var o = null,
        c = null;
      if (((n = n.firstBaseUpdate), n !== null)) {
        do {
          var m = {
            lane: n.lane,
            tag: n.tag,
            payload: n.payload,
            callback: null,
            next: null,
          };
          (c === null ? (o = c = m) : (c = c.next = m), (n = n.next));
        } while (n !== null);
        c === null ? (o = c = a) : (c = c.next = a);
      } else o = c = a;
      ((n = {
        baseState: l.baseState,
        firstBaseUpdate: o,
        lastBaseUpdate: c,
        shared: l.shared,
        callbacks: l.callbacks,
      }),
        (t.updateQueue = n));
      return;
    }
    ((t = n.lastBaseUpdate),
      t === null ? (n.firstBaseUpdate = a) : (t.next = a),
      (n.lastBaseUpdate = a));
  }
  var Dc = !1;
  function _r() {
    if (Dc) {
      var t = Dl;
      if (t !== null) throw t;
    }
  }
  function wr(t, a, n, l) {
    Dc = !1;
    var o = t.updateQueue;
    mi = !1;
    var c = o.firstBaseUpdate,
      m = o.lastBaseUpdate,
      x = o.shared.pending;
    if (x !== null) {
      o.shared.pending = null;
      var N = x,
        R = N.next;
      ((N.next = null), m === null ? (c = R) : (m.next = R), (m = N));
      var Q = t.alternate;
      Q !== null &&
        ((Q = Q.updateQueue),
        (x = Q.lastBaseUpdate),
        x !== m &&
          (x === null ? (Q.firstBaseUpdate = R) : (x.next = R),
          (Q.lastBaseUpdate = N)));
    }
    if (c !== null) {
      var ne = o.baseState;
      ((m = 0), (Q = R = N = null), (x = c));
      do {
        var U = x.lane & -536870913,
          q = U !== x.lane;
        if (q ? (ft & U) === U : (l & U) === U) {
          (U !== 0 && U === Ol && (Dc = !0),
            Q !== null &&
              (Q = Q.next =
                {
                  lane: 0,
                  tag: x.tag,
                  payload: x.payload,
                  callback: null,
                  next: null,
                }));
          e: {
            var ke = t,
              Ke = x;
            U = a;
            var Bt = n;
            switch (Ke.tag) {
              case 1:
                if (((ke = Ke.payload), typeof ke == "function")) {
                  ne = ke.call(Bt, ne, U);
                  break e;
                }
                ne = ke;
                break e;
              case 3:
                ke.flags = (ke.flags & -65537) | 128;
              case 0:
                if (
                  ((ke = Ke.payload),
                  (U = typeof ke == "function" ? ke.call(Bt, ne, U) : ke),
                  U == null)
                )
                  break e;
                ne = G({}, ne, U);
                break e;
              case 2:
                mi = !0;
            }
          }
          ((U = x.callback),
            U !== null &&
              ((t.flags |= 64),
              q && (t.flags |= 8192),
              (q = o.callbacks),
              q === null ? (o.callbacks = [U]) : q.push(U)));
        } else
          ((q = {
            lane: U,
            tag: x.tag,
            payload: x.payload,
            callback: x.callback,
            next: null,
          }),
            Q === null ? ((R = Q = q), (N = ne)) : (Q = Q.next = q),
            (m |= U));
        if (((x = x.next), x === null)) {
          if (((x = o.shared.pending), x === null)) break;
          ((q = x),
            (x = q.next),
            (q.next = null),
            (o.lastBaseUpdate = q),
            (o.shared.pending = null));
        }
      } while (!0);
      (Q === null && (N = ne),
        (o.baseState = N),
        (o.firstBaseUpdate = R),
        (o.lastBaseUpdate = Q),
        c === null && (o.shared.lanes = 0),
        (yi |= m),
        (t.lanes = m),
        (t.memoizedState = ne));
    }
  }
  function Su(t, a) {
    if (typeof t != "function") throw Error(b(191, t));
    t.call(a);
  }
  function Tu(t, a) {
    var n = t.callbacks;
    if (n !== null)
      for (t.callbacks = null, t = 0; t < n.length; t++) Su(n[t], a);
  }
  var Bl = g(null),
    No = g(0);
  function Cu(t, a) {
    ((t = qn), I(No, t), I(Bl, a), (qn = t | a.baseLanes));
  }
  function Rc() {
    (I(No, qn), I(Bl, Bl.current));
  }
  function zc() {
    ((qn = No.current), C(Bl), C(No));
  }
  var bs = g(null),
    Rs = null;
  function fi(t) {
    var a = t.alternate;
    (I(da, da.current & 1),
      I(bs, t),
      Rs === null &&
        (a === null || Bl.current !== null || a.memoizedState !== null) &&
        (Rs = t));
  }
  function Bc(t) {
    (I(da, da.current), I(bs, t), Rs === null && (Rs = t));
  }
  function Au(t) {
    t.tag === 22
      ? (I(da, da.current), I(bs, t), Rs === null && (Rs = t))
      : gi();
  }
  function gi() {
    (I(da, da.current), I(bs, bs.current));
  }
  function vs(t) {
    (C(bs), Rs === t && (Rs = null), C(da));
  }
  var da = g(0);
  function _o(t) {
    for (var a = t; a !== null; ) {
      if (a.tag === 13) {
        var n = a.memoizedState;
        if (n !== null && ((n = n.dehydrated), n === null || Zd(n) || qd(n)))
          return a;
      } else if (
        a.tag === 19 &&
        (a.memoizedProps.revealOrder === "forwards" ||
          a.memoizedProps.revealOrder === "backwards" ||
          a.memoizedProps.revealOrder === "unstable_legacy-backwards" ||
          a.memoizedProps.revealOrder === "together")
      ) {
        if ((a.flags & 128) !== 0) return a;
      } else if (a.child !== null) {
        ((a.child.return = a), (a = a.child));
        continue;
      }
      if (a === t) break;
      for (; a.sibling === null; ) {
        if (a.return === null || a.return === t) return null;
        a = a.return;
      }
      ((a.sibling.return = a.return), (a = a.sibling));
    }
    return null;
  }
  var zn = 0,
    tt = null,
    Rt = null,
    ma = null,
    wo = !1,
    Hl = !1,
    rl = !1,
    ko = 0,
    kr = 0,
    Ul = null,
    Kp = 0;
  function na() {
    throw Error(b(321));
  }
  function Hc(t, a) {
    if (a === null) return !1;
    for (var n = 0; n < a.length && n < t.length; n++)
      if (!Sa(t[n], a[n])) return !1;
    return !0;
  }
  function Uc(t, a, n, l, o, c) {
    return (
      (zn = c),
      (tt = a),
      (a.memoizedState = null),
      (a.updateQueue = null),
      (a.lanes = 0),
      (y.H = t === null || t.memoizedState === null ? hh : td),
      (rl = !1),
      (c = n(l, o)),
      (rl = !1),
      Hl && (c = Pu(a, n, l, o)),
      Mu(t),
      c
    );
  }
  function Mu(t) {
    y.H = Cr;
    var a = Rt !== null && Rt.next !== null;
    if (((zn = 0), (ma = Rt = tt = null), (wo = !1), (kr = 0), (Ul = null), a))
      throw Error(b(300));
    t === null ||
      pa ||
      ((t = t.dependencies), t !== null && xo(t) && (pa = !0));
  }
  function Pu(t, a, n, l) {
    tt = t;
    var o = 0;
    do {
      if ((Hl && (Ul = null), (kr = 0), (Hl = !1), 25 <= o))
        throw Error(b(301));
      if (((o += 1), (ma = Rt = null), t.updateQueue != null)) {
        var c = t.updateQueue;
        ((c.lastEffect = null),
          (c.events = null),
          (c.stores = null),
          c.memoCache != null && (c.memoCache.index = 0));
      }
      ((y.H = mh), (c = a(n, l)));
    } while (Hl);
    return c;
  }
  function Zp() {
    var t = y.H,
      a = t.useState()[0];
    return (
      (a = typeof a.then == "function" ? Sr(a) : a),
      (t = t.useState()[0]),
      (Rt !== null ? Rt.memoizedState : null) !== t && (tt.flags |= 1024),
      a
    );
  }
  function Ic() {
    var t = ko !== 0;
    return ((ko = 0), t);
  }
  function Gc(t, a, n) {
    ((a.updateQueue = t.updateQueue), (a.flags &= -2053), (t.lanes &= ~n));
  }
  function Kc(t) {
    if (wo) {
      for (t = t.memoizedState; t !== null; ) {
        var a = t.queue;
        (a !== null && (a.pending = null), (t = t.next));
      }
      wo = !1;
    }
    ((zn = 0), (ma = Rt = tt = null), (Hl = !1), (kr = ko = 0), (Ul = null));
  }
  function Fa() {
    var t = {
      memoizedState: null,
      baseState: null,
      baseQueue: null,
      queue: null,
      next: null,
    };
    return (ma === null ? (tt.memoizedState = ma = t) : (ma = ma.next = t), ma);
  }
  function ua() {
    if (Rt === null) {
      var t = tt.alternate;
      t = t !== null ? t.memoizedState : null;
    } else t = Rt.next;
    var a = ma === null ? tt.memoizedState : ma.next;
    if (a !== null) ((ma = a), (Rt = t));
    else {
      if (t === null)
        throw tt.alternate === null ? Error(b(467)) : Error(b(310));
      ((Rt = t),
        (t = {
          memoizedState: Rt.memoizedState,
          baseState: Rt.baseState,
          baseQueue: Rt.baseQueue,
          queue: Rt.queue,
          next: null,
        }),
        ma === null ? (tt.memoizedState = ma = t) : (ma = ma.next = t));
    }
    return ma;
  }
  function So() {
    return { lastEffect: null, events: null, stores: null, memoCache: null };
  }
  function Sr(t) {
    var a = kr;
    return (
      (kr += 1),
      Ul === null && (Ul = []),
      (t = ju(Ul, t, a)),
      (a = tt),
      (ma === null ? a.memoizedState : ma.next) === null &&
        ((a = a.alternate),
        (y.H = a === null || a.memoizedState === null ? hh : td)),
      t
    );
  }
  function To(t) {
    if (t !== null && typeof t == "object") {
      if (typeof t.then == "function") return Sr(t);
      if (t.$$typeof === ie) return Ea(t);
    }
    throw Error(b(438, String(t)));
  }
  function Zc(t) {
    var a = null,
      n = tt.updateQueue;
    if ((n !== null && (a = n.memoCache), a == null)) {
      var l = tt.alternate;
      l !== null &&
        ((l = l.updateQueue),
        l !== null &&
          ((l = l.memoCache),
          l != null &&
            (a = {
              data: l.data.map(function (o) {
                return o.slice();
              }),
              index: 0,
            })));
    }
    if (
      (a == null && (a = { data: [], index: 0 }),
      n === null && ((n = So()), (tt.updateQueue = n)),
      (n.memoCache = a),
      (n = a.data[a.index]),
      n === void 0)
    )
      for (n = a.data[a.index] = Array(t), l = 0; l < t; l++) n[l] = Ie;
    return (a.index++, n);
  }
  function Bn(t, a) {
    return typeof a == "function" ? a(t) : a;
  }
  function Co(t) {
    var a = ua();
    return qc(a, Rt, t);
  }
  function qc(t, a, n) {
    var l = t.queue;
    if (l === null) throw Error(b(311));
    l.lastRenderedReducer = n;
    var o = t.baseQueue,
      c = l.pending;
    if (c !== null) {
      if (o !== null) {
        var m = o.next;
        ((o.next = c.next), (c.next = m));
      }
      ((a.baseQueue = o = c), (l.pending = null));
    }
    if (((c = t.baseState), o === null)) t.memoizedState = c;
    else {
      a = o.next;
      var x = (m = null),
        N = null,
        R = a,
        Q = !1;
      do {
        var ne = R.lane & -536870913;
        if (ne !== R.lane ? (ft & ne) === ne : (zn & ne) === ne) {
          var U = R.revertLane;
          if (U === 0)
            (N !== null &&
              (N = N.next =
                {
                  lane: 0,
                  revertLane: 0,
                  gesture: null,
                  action: R.action,
                  hasEagerState: R.hasEagerState,
                  eagerState: R.eagerState,
                  next: null,
                }),
              ne === Ol && (Q = !0));
          else if ((zn & U) === U) {
            ((R = R.next), U === Ol && (Q = !0));
            continue;
          } else
            ((ne = {
              lane: 0,
              revertLane: R.revertLane,
              gesture: null,
              action: R.action,
              hasEagerState: R.hasEagerState,
              eagerState: R.eagerState,
              next: null,
            }),
              N === null ? ((x = N = ne), (m = c)) : (N = N.next = ne),
              (tt.lanes |= U),
              (yi |= U));
          ((ne = R.action),
            rl && n(c, ne),
            (c = R.hasEagerState ? R.eagerState : n(c, ne)));
        } else
          ((U = {
            lane: ne,
            revertLane: R.revertLane,
            gesture: R.gesture,
            action: R.action,
            hasEagerState: R.hasEagerState,
            eagerState: R.eagerState,
            next: null,
          }),
            N === null ? ((x = N = U), (m = c)) : (N = N.next = U),
            (tt.lanes |= ne),
            (yi |= ne));
        R = R.next;
      } while (R !== null && R !== a);
      if (
        (N === null ? (m = c) : (N.next = x),
        !Sa(c, t.memoizedState) && ((pa = !0), Q && ((n = Dl), n !== null)))
      )
        throw n;
      ((t.memoizedState = c),
        (t.baseState = m),
        (t.baseQueue = N),
        (l.lastRenderedState = c));
    }
    return (o === null && (l.lanes = 0), [t.memoizedState, l.dispatch]);
  }
  function Vc(t) {
    var a = ua(),
      n = a.queue;
    if (n === null) throw Error(b(311));
    n.lastRenderedReducer = t;
    var l = n.dispatch,
      o = n.pending,
      c = a.memoizedState;
    if (o !== null) {
      n.pending = null;
      var m = (o = o.next);
      do ((c = t(c, m.action)), (m = m.next));
      while (m !== o);
      (Sa(c, a.memoizedState) || (pa = !0),
        (a.memoizedState = c),
        a.baseQueue === null && (a.baseState = c),
        (n.lastRenderedState = c));
    }
    return [c, l];
  }
  function Lu(t, a, n) {
    var l = tt,
      o = ua(),
      c = dt;
    if (c) {
      if (n === void 0) throw Error(b(407));
      n = n();
    } else n = a();
    var m = !Sa((Rt || o).memoizedState, n);
    if (
      (m && ((o.memoizedState = n), (pa = !0)),
      (o = o.queue),
      $c(Du.bind(null, l, o, t), [t]),
      o.getSnapshot !== a || m || (ma !== null && ma.memoizedState.tag & 1))
    ) {
      if (
        ((l.flags |= 2048),
        Il(9, { destroy: void 0 }, Ou.bind(null, l, o, n, a), null),
        Gt === null)
      )
        throw Error(b(349));
      c || (zn & 127) !== 0 || Eu(l, a, n);
    }
    return n;
  }
  function Eu(t, a, n) {
    ((t.flags |= 16384),
      (t = { getSnapshot: a, value: n }),
      (a = tt.updateQueue),
      a === null
        ? ((a = So()), (tt.updateQueue = a), (a.stores = [t]))
        : ((n = a.stores), n === null ? (a.stores = [t]) : n.push(t)));
  }
  function Ou(t, a, n, l) {
    ((a.value = n), (a.getSnapshot = l), Ru(a) && zu(t));
  }
  function Du(t, a, n) {
    return n(function () {
      Ru(a) && zu(t);
    });
  }
  function Ru(t) {
    var a = t.getSnapshot;
    t = t.value;
    try {
      var n = a();
      return !Sa(t, n);
    } catch {
      return !0;
    }
  }
  function zu(t) {
    var a = Os(t, 2);
    a !== null && hs(a, t, 2);
  }
  function Yc(t) {
    var a = Fa();
    if (typeof t == "function") {
      var n = t;
      if (((t = n()), rl)) {
        oa(!0);
        try {
          n();
        } finally {
          oa(!1);
        }
      }
    }
    return (
      (a.memoizedState = a.baseState = t),
      (a.queue = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: Bn,
        lastRenderedState: t,
      }),
      a
    );
  }
  function Bu(t, a, n, l) {
    return ((t.baseState = n), qc(t, Rt, typeof l == "function" ? l : Bn));
  }
  function qp(t, a, n, l, o) {
    if (Po(t)) throw Error(b(485));
    if (((t = a.action), t !== null)) {
      var c = {
        payload: o,
        action: t,
        next: null,
        isTransition: !0,
        status: "pending",
        value: null,
        reason: null,
        listeners: [],
        then: function (m) {
          c.listeners.push(m);
        },
      };
      (y.T !== null ? n(!0) : (c.isTransition = !1),
        l(c),
        (n = a.pending),
        n === null
          ? ((c.next = a.pending = c), Hu(a, c))
          : ((c.next = n.next), (a.pending = n.next = c)));
    }
  }
  function Hu(t, a) {
    var n = a.action,
      l = a.payload,
      o = t.state;
    if (a.isTransition) {
      var c = y.T,
        m = {};
      y.T = m;
      try {
        var x = n(o, l),
          N = y.S;
        (N !== null && N(m, x), Uu(t, a, x));
      } catch (R) {
        Xc(t, a, R);
      } finally {
        (c !== null && m.types !== null && (c.types = m.types), (y.T = c));
      }
    } else
      try {
        ((c = n(o, l)), Uu(t, a, c));
      } catch (R) {
        Xc(t, a, R);
      }
  }
  function Uu(t, a, n) {
    n !== null && typeof n == "object" && typeof n.then == "function"
      ? n.then(
          function (l) {
            Iu(t, a, l);
          },
          function (l) {
            return Xc(t, a, l);
          },
        )
      : Iu(t, a, n);
  }
  function Iu(t, a, n) {
    ((a.status = "fulfilled"),
      (a.value = n),
      Gu(a),
      (t.state = n),
      (a = t.pending),
      a !== null &&
        ((n = a.next),
        n === a ? (t.pending = null) : ((n = n.next), (a.next = n), Hu(t, n))));
  }
  function Xc(t, a, n) {
    var l = t.pending;
    if (((t.pending = null), l !== null)) {
      l = l.next;
      do ((a.status = "rejected"), (a.reason = n), Gu(a), (a = a.next));
      while (a !== l);
    }
    t.action = null;
  }
  function Gu(t) {
    t = t.listeners;
    for (var a = 0; a < t.length; a++) (0, t[a])();
  }
  function Ku(t, a) {
    return a;
  }
  function Zu(t, a) {
    if (dt) {
      var n = Gt.formState;
      if (n !== null) {
        e: {
          var l = tt;
          if (dt) {
            if (Nt) {
              t: {
                for (var o = Nt, c = rs; o.nodeType !== 8; ) {
                  if (!c) {
                    o = null;
                    break t;
                  }
                  if (((o = zs(o.nextSibling)), o === null)) {
                    o = null;
                    break t;
                  }
                }
                ((c = o.data), (o = c === "F!" || c === "F" ? o : null));
              }
              if (o) {
                ((Nt = zs(o.nextSibling)), (l = o.data === "F!"));
                break e;
              }
            }
            gn(l);
          }
          l = !1;
        }
        l && (a = n[0]);
      }
    }
    return (
      (n = Fa()),
      (n.memoizedState = n.baseState = a),
      (l = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: Ku,
        lastRenderedState: a,
      }),
      (n.queue = l),
      (n = ch.bind(null, tt, l)),
      (l.dispatch = n),
      (l = Yc(!1)),
      (c = ed.bind(null, tt, !1, l.queue)),
      (l = Fa()),
      (o = { state: a, dispatch: null, action: t, pending: null }),
      (l.queue = o),
      (n = qp.bind(null, tt, o, c, n)),
      (o.dispatch = n),
      (l.memoizedState = t),
      [a, n, !1]
    );
  }
  function qu(t) {
    var a = ua();
    return Vu(a, Rt, t);
  }
  function Vu(t, a, n) {
    if (
      ((a = qc(t, a, Ku)[0]),
      (t = Co(Bn)[0]),
      typeof a == "object" && a !== null && typeof a.then == "function")
    )
      try {
        var l = Sr(a);
      } catch (m) {
        throw m === Rl ? bo : m;
      }
    else l = a;
    a = ua();
    var o = a.queue,
      c = o.dispatch;
    return (
      n !== a.memoizedState &&
        ((tt.flags |= 2048),
        Il(9, { destroy: void 0 }, Vp.bind(null, o, n), null)),
      [l, c, t]
    );
  }
  function Vp(t, a) {
    t.action = a;
  }
  function Yu(t) {
    var a = ua(),
      n = Rt;
    if (n !== null) return Vu(a, n, t);
    (ua(), (a = a.memoizedState), (n = ua()));
    var l = n.queue.dispatch;
    return ((n.memoizedState = t), [a, l, !1]);
  }
  function Il(t, a, n, l) {
    return (
      (t = { tag: t, create: n, deps: l, inst: a, next: null }),
      (a = tt.updateQueue),
      a === null && ((a = So()), (tt.updateQueue = a)),
      (n = a.lastEffect),
      n === null
        ? (a.lastEffect = t.next = t)
        : ((l = n.next), (n.next = t), (t.next = l), (a.lastEffect = t)),
      t
    );
  }
  function Xu() {
    return ua().memoizedState;
  }
  function Ao(t, a, n, l) {
    var o = Fa();
    ((tt.flags |= t),
      (o.memoizedState = Il(
        1 | a,
        { destroy: void 0 },
        n,
        l === void 0 ? null : l,
      )));
  }
  function Mo(t, a, n, l) {
    var o = ua();
    l = l === void 0 ? null : l;
    var c = o.memoizedState.inst;
    Rt !== null && l !== null && Hc(l, Rt.memoizedState.deps)
      ? (o.memoizedState = Il(a, c, n, l))
      : ((tt.flags |= t), (o.memoizedState = Il(1 | a, c, n, l)));
  }
  function $u(t, a) {
    Ao(8390656, 8, t, a);
  }
  function $c(t, a) {
    Mo(2048, 8, t, a);
  }
  function Yp(t) {
    tt.flags |= 4;
    var a = tt.updateQueue;
    if (a === null) ((a = So()), (tt.updateQueue = a), (a.events = [t]));
    else {
      var n = a.events;
      n === null ? (a.events = [t]) : n.push(t);
    }
  }
  function Ju(t) {
    var a = ua().memoizedState;
    return (
      Yp({ ref: a, nextImpl: t }),
      function () {
        if ((kt & 2) !== 0) throw Error(b(440));
        return a.impl.apply(void 0, arguments);
      }
    );
  }
  function Qu(t, a) {
    return Mo(4, 2, t, a);
  }
  function Wu(t, a) {
    return Mo(4, 4, t, a);
  }
  function Fu(t, a) {
    if (typeof a == "function") {
      t = t();
      var n = a(t);
      return function () {
        typeof n == "function" ? n() : a(null);
      };
    }
    if (a != null)
      return (
        (t = t()),
        (a.current = t),
        function () {
          a.current = null;
        }
      );
  }
  function eh(t, a, n) {
    ((n = n != null ? n.concat([t]) : null), Mo(4, 4, Fu.bind(null, a, t), n));
  }
  function Jc() {}
  function th(t, a) {
    var n = ua();
    a = a === void 0 ? null : a;
    var l = n.memoizedState;
    return a !== null && Hc(a, l[1]) ? l[0] : ((n.memoizedState = [t, a]), t);
  }
  function ah(t, a) {
    var n = ua();
    a = a === void 0 ? null : a;
    var l = n.memoizedState;
    if (a !== null && Hc(a, l[1])) return l[0];
    if (((l = t()), rl)) {
      oa(!0);
      try {
        t();
      } finally {
        oa(!1);
      }
    }
    return ((n.memoizedState = [l, a]), l);
  }
  function Qc(t, a, n) {
    return n === void 0 || ((zn & 1073741824) !== 0 && (ft & 261930) === 0)
      ? (t.memoizedState = a)
      : ((t.memoizedState = n), (t = sm()), (tt.lanes |= t), (yi |= t), n);
  }
  function sh(t, a, n, l) {
    return Sa(n, a)
      ? n
      : Bl.current !== null
        ? ((t = Qc(t, n, l)), Sa(t, a) || (pa = !0), t)
        : (zn & 42) === 0 || ((zn & 1073741824) !== 0 && (ft & 261930) === 0)
          ? ((pa = !0), (t.memoizedState = n))
          : ((t = sm()), (tt.lanes |= t), (yi |= t), a);
  }
  function nh(t, a, n, l, o) {
    var c = K.p;
    K.p = c !== 0 && 8 > c ? c : 8;
    var m = y.T,
      x = {};
    ((y.T = x), ed(t, !1, a, n));
    try {
      var N = o(),
        R = y.S;
      if (
        (R !== null && R(x, N),
        N !== null && typeof N == "object" && typeof N.then == "function")
      ) {
        var Q = Gp(N, l);
        Tr(t, a, Q, Ns(t));
      } else Tr(t, a, l, Ns(t));
    } catch (ne) {
      Tr(t, a, { then: function () {}, status: "rejected", reason: ne }, Ns());
    } finally {
      ((K.p = c),
        m !== null && x.types !== null && (m.types = x.types),
        (y.T = m));
    }
  }
  function Xp() {}
  function Wc(t, a, n, l) {
    if (t.tag !== 5) throw Error(b(476));
    var o = ih(t).queue;
    nh(
      t,
      o,
      a,
      O,
      n === null
        ? Xp
        : function () {
            return (lh(t), n(l));
          },
    );
  }
  function ih(t) {
    var a = t.memoizedState;
    if (a !== null) return a;
    a = {
      memoizedState: O,
      baseState: O,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: Bn,
        lastRenderedState: O,
      },
      next: null,
    };
    var n = {};
    return (
      (a.next = {
        memoizedState: n,
        baseState: n,
        baseQueue: null,
        queue: {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: Bn,
          lastRenderedState: n,
        },
        next: null,
      }),
      (t.memoizedState = a),
      (t = t.alternate),
      t !== null && (t.memoizedState = a),
      a
    );
  }
  function lh(t) {
    var a = ih(t);
    (a.next === null && (a = t.alternate.memoizedState),
      Tr(t, a.next.queue, {}, Ns()));
  }
  function Fc() {
    return Ea(Zr);
  }
  function rh() {
    return ua().memoizedState;
  }
  function oh() {
    return ua().memoizedState;
  }
  function $p(t) {
    for (var a = t.return; a !== null; ) {
      switch (a.tag) {
        case 24:
        case 3:
          var n = Ns();
          t = pi(n);
          var l = xi(a, t, n);
          (l !== null && (hs(l, a, n), Nr(l, a, n)),
            (a = { cache: Cc() }),
            (t.payload = a));
          return;
      }
      a = a.return;
    }
  }
  function Jp(t, a, n) {
    var l = Ns();
    ((n = {
      lane: l,
      revertLane: 0,
      gesture: null,
      action: n,
      hasEagerState: !1,
      eagerState: null,
      next: null,
    }),
      Po(t)
        ? dh(a, n)
        : ((n = hr(t, a, n, l)), n !== null && (hs(n, t, l), uh(n, a, l))));
  }
  function ch(t, a, n) {
    var l = Ns();
    Tr(t, a, n, l);
  }
  function Tr(t, a, n, l) {
    var o = {
      lane: l,
      revertLane: 0,
      gesture: null,
      action: n,
      hasEagerState: !1,
      eagerState: null,
      next: null,
    };
    if (Po(t)) dh(a, o);
    else {
      var c = t.alternate;
      if (
        t.lanes === 0 &&
        (c === null || c.lanes === 0) &&
        ((c = a.lastRenderedReducer), c !== null)
      )
        try {
          var m = a.lastRenderedState,
            x = c(m, n);
          if (((o.hasEagerState = !0), (o.eagerState = x), Sa(x, m)))
            return (xn(t, a, o, 0), Gt === null && Qi(), !1);
        } catch {
        } finally {
        }
      if (((n = hr(t, a, o, l)), n !== null))
        return (hs(n, t, l), uh(n, a, l), !0);
    }
    return !1;
  }
  function ed(t, a, n, l) {
    if (
      ((l = {
        lane: 2,
        revertLane: Ld(),
        gesture: null,
        action: l,
        hasEagerState: !1,
        eagerState: null,
        next: null,
      }),
      Po(t))
    ) {
      if (a) throw Error(b(479));
    } else ((a = hr(t, n, l, 2)), a !== null && hs(a, t, 2));
  }
  function Po(t) {
    var a = t.alternate;
    return t === tt || (a !== null && a === tt);
  }
  function dh(t, a) {
    Hl = wo = !0;
    var n = t.pending;
    (n === null ? (a.next = a) : ((a.next = n.next), (n.next = a)),
      (t.pending = a));
  }
  function uh(t, a, n) {
    if ((n & 4194048) !== 0) {
      var l = a.lanes;
      ((l &= t.pendingLanes), (n |= l), (a.lanes = n), Qn(t, n));
    }
  }
  var Cr = {
    readContext: Ea,
    use: To,
    useCallback: na,
    useContext: na,
    useEffect: na,
    useImperativeHandle: na,
    useLayoutEffect: na,
    useInsertionEffect: na,
    useMemo: na,
    useReducer: na,
    useRef: na,
    useState: na,
    useDebugValue: na,
    useDeferredValue: na,
    useTransition: na,
    useSyncExternalStore: na,
    useId: na,
    useHostTransitionStatus: na,
    useFormState: na,
    useActionState: na,
    useOptimistic: na,
    useMemoCache: na,
    useCacheRefresh: na,
  };
  Cr.useEffectEvent = na;
  var hh = {
      readContext: Ea,
      use: To,
      useCallback: function (t, a) {
        return ((Fa().memoizedState = [t, a === void 0 ? null : a]), t);
      },
      useContext: Ea,
      useEffect: $u,
      useImperativeHandle: function (t, a, n) {
        ((n = n != null ? n.concat([t]) : null),
          Ao(4194308, 4, Fu.bind(null, a, t), n));
      },
      useLayoutEffect: function (t, a) {
        return Ao(4194308, 4, t, a);
      },
      useInsertionEffect: function (t, a) {
        Ao(4, 2, t, a);
      },
      useMemo: function (t, a) {
        var n = Fa();
        a = a === void 0 ? null : a;
        var l = t();
        if (rl) {
          oa(!0);
          try {
            t();
          } finally {
            oa(!1);
          }
        }
        return ((n.memoizedState = [l, a]), l);
      },
      useReducer: function (t, a, n) {
        var l = Fa();
        if (n !== void 0) {
          var o = n(a);
          if (rl) {
            oa(!0);
            try {
              n(a);
            } finally {
              oa(!1);
            }
          }
        } else o = a;
        return (
          (l.memoizedState = l.baseState = o),
          (t = {
            pending: null,
            lanes: 0,
            dispatch: null,
            lastRenderedReducer: t,
            lastRenderedState: o,
          }),
          (l.queue = t),
          (t = t.dispatch = Jp.bind(null, tt, t)),
          [l.memoizedState, t]
        );
      },
      useRef: function (t) {
        var a = Fa();
        return ((t = { current: t }), (a.memoizedState = t));
      },
      useState: function (t) {
        t = Yc(t);
        var a = t.queue,
          n = ch.bind(null, tt, a);
        return ((a.dispatch = n), [t.memoizedState, n]);
      },
      useDebugValue: Jc,
      useDeferredValue: function (t, a) {
        var n = Fa();
        return Qc(n, t, a);
      },
      useTransition: function () {
        var t = Yc(!1);
        return (
          (t = nh.bind(null, tt, t.queue, !0, !1)),
          (Fa().memoizedState = t),
          [!1, t]
        );
      },
      useSyncExternalStore: function (t, a, n) {
        var l = tt,
          o = Fa();
        if (dt) {
          if (n === void 0) throw Error(b(407));
          n = n();
        } else {
          if (((n = a()), Gt === null)) throw Error(b(349));
          (ft & 127) !== 0 || Eu(l, a, n);
        }
        o.memoizedState = n;
        var c = { value: n, getSnapshot: a };
        return (
          (o.queue = c),
          $u(Du.bind(null, l, c, t), [t]),
          (l.flags |= 2048),
          Il(9, { destroy: void 0 }, Ou.bind(null, l, c, n, a), null),
          n
        );
      },
      useId: function () {
        var t = Fa(),
          a = Gt.identifierPrefix;
        if (dt) {
          var n = ye,
            l = se;
          ((n = (l & ~(1 << (32 - Zt(l) - 1))).toString(32) + n),
            (a = "_" + a + "R_" + n),
            (n = ko++),
            0 < n && (a += "H" + n.toString(32)),
            (a += "_"));
        } else ((n = Kp++), (a = "_" + a + "r_" + n.toString(32) + "_"));
        return (t.memoizedState = a);
      },
      useHostTransitionStatus: Fc,
      useFormState: Zu,
      useActionState: Zu,
      useOptimistic: function (t) {
        var a = Fa();
        a.memoizedState = a.baseState = t;
        var n = {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: null,
          lastRenderedState: null,
        };
        return (
          (a.queue = n),
          (a = ed.bind(null, tt, !0, n)),
          (n.dispatch = a),
          [t, a]
        );
      },
      useMemoCache: Zc,
      useCacheRefresh: function () {
        return (Fa().memoizedState = $p.bind(null, tt));
      },
      useEffectEvent: function (t) {
        var a = Fa(),
          n = { impl: t };
        return (
          (a.memoizedState = n),
          function () {
            if ((kt & 2) !== 0) throw Error(b(440));
            return n.impl.apply(void 0, arguments);
          }
        );
      },
    },
    td = {
      readContext: Ea,
      use: To,
      useCallback: th,
      useContext: Ea,
      useEffect: $c,
      useImperativeHandle: eh,
      useInsertionEffect: Qu,
      useLayoutEffect: Wu,
      useMemo: ah,
      useReducer: Co,
      useRef: Xu,
      useState: function () {
        return Co(Bn);
      },
      useDebugValue: Jc,
      useDeferredValue: function (t, a) {
        var n = ua();
        return sh(n, Rt.memoizedState, t, a);
      },
      useTransition: function () {
        var t = Co(Bn)[0],
          a = ua().memoizedState;
        return [typeof t == "boolean" ? t : Sr(t), a];
      },
      useSyncExternalStore: Lu,
      useId: rh,
      useHostTransitionStatus: Fc,
      useFormState: qu,
      useActionState: qu,
      useOptimistic: function (t, a) {
        var n = ua();
        return Bu(n, Rt, t, a);
      },
      useMemoCache: Zc,
      useCacheRefresh: oh,
    };
  td.useEffectEvent = Ju;
  var mh = {
    readContext: Ea,
    use: To,
    useCallback: th,
    useContext: Ea,
    useEffect: $c,
    useImperativeHandle: eh,
    useInsertionEffect: Qu,
    useLayoutEffect: Wu,
    useMemo: ah,
    useReducer: Vc,
    useRef: Xu,
    useState: function () {
      return Vc(Bn);
    },
    useDebugValue: Jc,
    useDeferredValue: function (t, a) {
      var n = ua();
      return Rt === null ? Qc(n, t, a) : sh(n, Rt.memoizedState, t, a);
    },
    useTransition: function () {
      var t = Vc(Bn)[0],
        a = ua().memoizedState;
      return [typeof t == "boolean" ? t : Sr(t), a];
    },
    useSyncExternalStore: Lu,
    useId: rh,
    useHostTransitionStatus: Fc,
    useFormState: Yu,
    useActionState: Yu,
    useOptimistic: function (t, a) {
      var n = ua();
      return Rt !== null
        ? Bu(n, Rt, t, a)
        : ((n.baseState = t), [t, n.queue.dispatch]);
    },
    useMemoCache: Zc,
    useCacheRefresh: oh,
  };
  mh.useEffectEvent = Ju;
  function ad(t, a, n, l) {
    ((a = t.memoizedState),
      (n = n(l, a)),
      (n = n == null ? a : G({}, a, n)),
      (t.memoizedState = n),
      t.lanes === 0 && (t.updateQueue.baseState = n));
  }
  var sd = {
    enqueueSetState: function (t, a, n) {
      t = t._reactInternals;
      var l = Ns(),
        o = pi(l);
      ((o.payload = a),
        n != null && (o.callback = n),
        (a = xi(t, o, l)),
        a !== null && (hs(a, t, l), Nr(a, t, l)));
    },
    enqueueReplaceState: function (t, a, n) {
      t = t._reactInternals;
      var l = Ns(),
        o = pi(l);
      ((o.tag = 1),
        (o.payload = a),
        n != null && (o.callback = n),
        (a = xi(t, o, l)),
        a !== null && (hs(a, t, l), Nr(a, t, l)));
    },
    enqueueForceUpdate: function (t, a) {
      t = t._reactInternals;
      var n = Ns(),
        l = pi(n);
      ((l.tag = 2),
        a != null && (l.callback = a),
        (a = xi(t, l, n)),
        a !== null && (hs(a, t, n), Nr(a, t, n)));
    },
  };
  function ph(t, a, n, l, o, c, m) {
    return (
      (t = t.stateNode),
      typeof t.shouldComponentUpdate == "function"
        ? t.shouldComponentUpdate(l, c, m)
        : a.prototype && a.prototype.isPureReactComponent
          ? !ri(n, l) || !ri(o, c)
          : !0
    );
  }
  function xh(t, a, n, l) {
    ((t = a.state),
      typeof a.componentWillReceiveProps == "function" &&
        a.componentWillReceiveProps(n, l),
      typeof a.UNSAFE_componentWillReceiveProps == "function" &&
        a.UNSAFE_componentWillReceiveProps(n, l),
      a.state !== t && sd.enqueueReplaceState(a, a.state, null));
  }
  function ol(t, a) {
    var n = a;
    if ("ref" in a) {
      n = {};
      for (var l in a) l !== "ref" && (n[l] = a[l]);
    }
    if ((t = t.defaultProps)) {
      n === a && (n = G({}, n));
      for (var o in t) n[o] === void 0 && (n[o] = t[o]);
    }
    return n;
  }
  function fh(t) {
    Ji(t);
  }
  function gh(t) {
    console.error(t);
  }
  function bh(t) {
    Ji(t);
  }
  function Lo(t, a) {
    try {
      var n = t.onUncaughtError;
      n(a.value, { componentStack: a.stack });
    } catch (l) {
      setTimeout(function () {
        throw l;
      });
    }
  }
  function vh(t, a, n) {
    try {
      var l = t.onCaughtError;
      l(n.value, {
        componentStack: n.stack,
        errorBoundary: a.tag === 1 ? a.stateNode : null,
      });
    } catch (o) {
      setTimeout(function () {
        throw o;
      });
    }
  }
  function nd(t, a, n) {
    return (
      (n = pi(n)),
      (n.tag = 3),
      (n.payload = { element: null }),
      (n.callback = function () {
        Lo(t, a);
      }),
      n
    );
  }
  function yh(t) {
    return ((t = pi(t)), (t.tag = 3), t);
  }
  function jh(t, a, n, l) {
    var o = n.type.getDerivedStateFromError;
    if (typeof o == "function") {
      var c = l.value;
      ((t.payload = function () {
        return o(c);
      }),
        (t.callback = function () {
          vh(a, n, l);
        }));
    }
    var m = n.stateNode;
    m !== null &&
      typeof m.componentDidCatch == "function" &&
      (t.callback = function () {
        (vh(a, n, l),
          typeof o != "function" &&
            (ji === null ? (ji = new Set([this])) : ji.add(this)));
        var x = l.stack;
        this.componentDidCatch(l.value, {
          componentStack: x !== null ? x : "",
        });
      });
  }
  function Qp(t, a, n, l, o) {
    if (
      ((n.flags |= 32768),
      l !== null && typeof l == "object" && typeof l.then == "function")
    ) {
      if (
        ((a = n.alternate),
        a !== null && El(a, n, o, !0),
        (n = bs.current),
        n !== null)
      ) {
        switch (n.tag) {
          case 31:
          case 13:
            return (
              Rs === null ? Zo() : n.alternate === null && ia === 0 && (ia = 3),
              (n.flags &= -257),
              (n.flags |= 65536),
              (n.lanes = o),
              l === vo
                ? (n.flags |= 16384)
                : ((a = n.updateQueue),
                  a === null ? (n.updateQueue = new Set([l])) : a.add(l),
                  Ad(t, l, o)),
              !1
            );
          case 22:
            return (
              (n.flags |= 65536),
              l === vo
                ? (n.flags |= 16384)
                : ((a = n.updateQueue),
                  a === null
                    ? ((a = {
                        transitions: null,
                        markerInstances: null,
                        retryQueue: new Set([l]),
                      }),
                      (n.updateQueue = a))
                    : ((n = a.retryQueue),
                      n === null ? (a.retryQueue = new Set([l])) : n.add(l)),
                  Ad(t, l, o)),
              !1
            );
        }
        throw Error(b(435, n.tag));
      }
      return (Ad(t, l, o), Zo(), !1);
    }
    if (dt)
      return (
        (a = bs.current),
        a !== null
          ? ((a.flags & 65536) === 0 && (a.flags |= 256),
            (a.flags |= 65536),
            (a.lanes = o),
            l !== Ll && ((t = Error(b(422), { cause: l })), el(i(t, n))))
          : (l !== Ll && ((a = Error(b(423), { cause: l })), el(i(a, n))),
            (t = t.current.alternate),
            (t.flags |= 65536),
            (o &= -o),
            (t.lanes |= o),
            (l = i(l, n)),
            (o = nd(t.stateNode, l, o)),
            Oc(t, o),
            ia !== 4 && (ia = 2)),
        !1
      );
    var c = Error(b(520), { cause: l });
    if (
      ((c = i(c, n)),
      Rr === null ? (Rr = [c]) : Rr.push(c),
      ia !== 4 && (ia = 2),
      a === null)
    )
      return !0;
    ((l = i(l, n)), (n = a));
    do {
      switch (n.tag) {
        case 3:
          return (
            (n.flags |= 65536),
            (t = o & -o),
            (n.lanes |= t),
            (t = nd(n.stateNode, l, t)),
            Oc(n, t),
            !1
          );
        case 1:
          if (
            ((a = n.type),
            (c = n.stateNode),
            (n.flags & 128) === 0 &&
              (typeof a.getDerivedStateFromError == "function" ||
                (c !== null &&
                  typeof c.componentDidCatch == "function" &&
                  (ji === null || !ji.has(c)))))
          )
            return (
              (n.flags |= 65536),
              (o &= -o),
              (n.lanes |= o),
              (o = yh(o)),
              jh(o, t, n, l),
              Oc(n, o),
              !1
            );
      }
      n = n.return;
    } while (n !== null);
    return !1;
  }
  var id = Error(b(461)),
    pa = !1;
  function Oa(t, a, n, l) {
    a.child = t === null ? ku(a, null, n, l) : ll(a, t.child, n, l);
  }
  function Nh(t, a, n, l, o) {
    n = n.render;
    var c = a.ref;
    if ("ref" in l) {
      var m = {};
      for (var x in l) x !== "ref" && (m[x] = l[x]);
    } else m = l;
    return (
      al(a),
      (l = Uc(t, a, n, m, c, o)),
      (x = Ic()),
      t !== null && !pa
        ? (Gc(t, a, o), Hn(t, a, o))
        : (dt && x && va(a), (a.flags |= 1), Oa(t, a, l, o), a.child)
    );
  }
  function _h(t, a, n, l, o) {
    if (t === null) {
      var c = n.type;
      return typeof c == "function" &&
        !Ml(c) &&
        c.defaultProps === void 0 &&
        n.compare === null
        ? ((a.tag = 15), (a.type = c), wh(t, a, c, l, o))
        : ((t = Fi(n.type, null, l, a, a.mode, o)),
          (t.ref = a.ref),
          (t.return = a),
          (a.child = t));
    }
    if (((c = t.child), !md(t, o))) {
      var m = c.memoizedProps;
      if (
        ((n = n.compare), (n = n !== null ? n : ri), n(m, l) && t.ref === a.ref)
      )
        return Hn(t, a, o);
    }
    return (
      (a.flags |= 1),
      (t = Ds(c, l)),
      (t.ref = a.ref),
      (t.return = a),
      (a.child = t)
    );
  }
  function wh(t, a, n, l, o) {
    if (t !== null) {
      var c = t.memoizedProps;
      if (ri(c, l) && t.ref === a.ref)
        if (((pa = !1), (a.pendingProps = l = c), md(t, o)))
          (t.flags & 131072) !== 0 && (pa = !0);
        else return ((a.lanes = t.lanes), Hn(t, a, o));
    }
    return ld(t, a, n, l, o);
  }
  function kh(t, a, n, l) {
    var o = l.children,
      c = t !== null ? t.memoizedState : null;
    if (
      (t === null &&
        a.stateNode === null &&
        (a.stateNode = {
          _visibility: 1,
          _pendingMarkers: null,
          _retryCache: null,
          _transitions: null,
        }),
      l.mode === "hidden")
    ) {
      if ((a.flags & 128) !== 0) {
        if (((c = c !== null ? c.baseLanes | n : n), t !== null)) {
          for (l = a.child = t.child, o = 0; l !== null; )
            ((o = o | l.lanes | l.childLanes), (l = l.sibling));
          l = o & ~c;
        } else ((l = 0), (a.child = null));
        return Sh(t, a, c, n, l);
      }
      if ((n & 536870912) !== 0)
        ((a.memoizedState = { baseLanes: 0, cachePool: null }),
          t !== null && go(a, c !== null ? c.cachePool : null),
          c !== null ? Cu(a, c) : Rc(),
          Au(a));
      else
        return (
          (l = a.lanes = 536870912),
          Sh(t, a, c !== null ? c.baseLanes | n : n, n, l)
        );
    } else
      c !== null
        ? (go(a, c.cachePool), Cu(a, c), gi(), (a.memoizedState = null))
        : (t !== null && go(a, null), Rc(), gi());
    return (Oa(t, a, o, n), a.child);
  }
  function Ar(t, a) {
    return (
      (t !== null && t.tag === 22) ||
        a.stateNode !== null ||
        (a.stateNode = {
          _visibility: 1,
          _pendingMarkers: null,
          _retryCache: null,
          _transitions: null,
        }),
      a.sibling
    );
  }
  function Sh(t, a, n, l, o) {
    var c = Mc();
    return (
      (c = c === null ? null : { parent: ha._currentValue, pool: c }),
      (a.memoizedState = { baseLanes: n, cachePool: c }),
      t !== null && go(a, null),
      Rc(),
      Au(a),
      t !== null && El(t, a, l, !0),
      (a.childLanes = o),
      null
    );
  }
  function Eo(t, a) {
    return (
      (a = Do({ mode: a.mode, children: a.children }, t.mode)),
      (a.ref = t.ref),
      (t.child = a),
      (a.return = t),
      a
    );
  }
  function Th(t, a, n) {
    return (
      ll(a, t.child, null, n),
      (t = Eo(a, a.pendingProps)),
      (t.flags |= 2),
      vs(a),
      (a.memoizedState = null),
      t
    );
  }
  function Wp(t, a, n) {
    var l = a.pendingProps,
      o = (a.flags & 128) !== 0;
    if (((a.flags &= -129), t === null)) {
      if (dt) {
        if (l.mode === "hidden")
          return ((t = Eo(a, l)), (a.lanes = 536870912), Ar(null, t));
        if (
          (Bc(a),
          (t = Nt)
            ? ((t = Hm(t, rs)),
              (t = t !== null && t.data === "&" ? t : null),
              t !== null &&
                ((a.memoizedState = {
                  dehydrated: t,
                  treeContext: H !== null ? { id: se, overflow: ye } : null,
                  retryLane: 536870912,
                  hydrationErrors: null,
                }),
                (n = pr(t)),
                (n.return = a),
                (a.child = n),
                (jt = a),
                (Nt = null)))
            : (t = null),
          t === null)
        )
          throw gn(a);
        return ((a.lanes = 536870912), null);
      }
      return Eo(a, l);
    }
    var c = t.memoizedState;
    if (c !== null) {
      var m = c.dehydrated;
      if ((Bc(a), o))
        if (a.flags & 256) ((a.flags &= -257), (a = Th(t, a, n)));
        else if (a.memoizedState !== null)
          ((a.child = t.child), (a.flags |= 128), (a = null));
        else throw Error(b(558));
      else if (
        (pa || El(t, a, n, !1), (o = (n & t.childLanes) !== 0), pa || o)
      ) {
        if (
          ((l = Gt),
          l !== null && ((m = _n(l, n)), m !== 0 && m !== c.retryLane))
        )
          throw ((c.retryLane = m), Os(t, m), hs(l, t, m), id);
        (Zo(), (a = Th(t, a, n)));
      } else
        ((t = c.treeContext),
          (Nt = zs(m.nextSibling)),
          (jt = a),
          (dt = !0),
          (fn = null),
          (rs = !1),
          t !== null && Wa(a, t),
          (a = Eo(a, l)),
          (a.flags |= 4096));
      return a;
    }
    return (
      (t = Ds(t.child, { mode: l.mode, children: l.children })),
      (t.ref = a.ref),
      (a.child = t),
      (t.return = a),
      t
    );
  }
  function Oo(t, a) {
    var n = a.ref;
    if (n === null) t !== null && t.ref !== null && (a.flags |= 4194816);
    else {
      if (typeof n != "function" && typeof n != "object") throw Error(b(284));
      (t === null || t.ref !== n) && (a.flags |= 4194816);
    }
  }
  function ld(t, a, n, l, o) {
    return (
      al(a),
      (n = Uc(t, a, n, l, void 0, o)),
      (l = Ic()),
      t !== null && !pa
        ? (Gc(t, a, o), Hn(t, a, o))
        : (dt && l && va(a), (a.flags |= 1), Oa(t, a, n, o), a.child)
    );
  }
  function Ch(t, a, n, l, o, c) {
    return (
      al(a),
      (a.updateQueue = null),
      (n = Pu(a, l, n, o)),
      Mu(t),
      (l = Ic()),
      t !== null && !pa
        ? (Gc(t, a, c), Hn(t, a, c))
        : (dt && l && va(a), (a.flags |= 1), Oa(t, a, n, c), a.child)
    );
  }
  function Ah(t, a, n, l, o) {
    if ((al(a), a.stateNode === null)) {
      var c = En,
        m = n.contextType;
      (typeof m == "object" && m !== null && (c = Ea(m)),
        (c = new n(l, c)),
        (a.memoizedState =
          c.state !== null && c.state !== void 0 ? c.state : null),
        (c.updater = sd),
        (a.stateNode = c),
        (c._reactInternals = a),
        (c = a.stateNode),
        (c.props = l),
        (c.state = a.memoizedState),
        (c.refs = {}),
        Lc(a),
        (m = n.contextType),
        (c.context = typeof m == "object" && m !== null ? Ea(m) : En),
        (c.state = a.memoizedState),
        (m = n.getDerivedStateFromProps),
        typeof m == "function" && (ad(a, n, m, l), (c.state = a.memoizedState)),
        typeof n.getDerivedStateFromProps == "function" ||
          typeof c.getSnapshotBeforeUpdate == "function" ||
          (typeof c.UNSAFE_componentWillMount != "function" &&
            typeof c.componentWillMount != "function") ||
          ((m = c.state),
          typeof c.componentWillMount == "function" && c.componentWillMount(),
          typeof c.UNSAFE_componentWillMount == "function" &&
            c.UNSAFE_componentWillMount(),
          m !== c.state && sd.enqueueReplaceState(c, c.state, null),
          wr(a, l, c, o),
          _r(),
          (c.state = a.memoizedState)),
        typeof c.componentDidMount == "function" && (a.flags |= 4194308),
        (l = !0));
    } else if (t === null) {
      c = a.stateNode;
      var x = a.memoizedProps,
        N = ol(n, x);
      c.props = N;
      var R = c.context,
        Q = n.contextType;
      ((m = En), typeof Q == "object" && Q !== null && (m = Ea(Q)));
      var ne = n.getDerivedStateFromProps;
      ((Q =
        typeof ne == "function" ||
        typeof c.getSnapshotBeforeUpdate == "function"),
        (x = a.pendingProps !== x),
        Q ||
          (typeof c.UNSAFE_componentWillReceiveProps != "function" &&
            typeof c.componentWillReceiveProps != "function") ||
          ((x || R !== m) && xh(a, c, l, m)),
        (mi = !1));
      var U = a.memoizedState;
      ((c.state = U),
        wr(a, l, c, o),
        _r(),
        (R = a.memoizedState),
        x || U !== R || mi
          ? (typeof ne == "function" &&
              (ad(a, n, ne, l), (R = a.memoizedState)),
            (N = mi || ph(a, n, N, l, U, R, m))
              ? (Q ||
                  (typeof c.UNSAFE_componentWillMount != "function" &&
                    typeof c.componentWillMount != "function") ||
                  (typeof c.componentWillMount == "function" &&
                    c.componentWillMount(),
                  typeof c.UNSAFE_componentWillMount == "function" &&
                    c.UNSAFE_componentWillMount()),
                typeof c.componentDidMount == "function" &&
                  (a.flags |= 4194308))
              : (typeof c.componentDidMount == "function" &&
                  (a.flags |= 4194308),
                (a.memoizedProps = l),
                (a.memoizedState = R)),
            (c.props = l),
            (c.state = R),
            (c.context = m),
            (l = N))
          : (typeof c.componentDidMount == "function" && (a.flags |= 4194308),
            (l = !1)));
    } else {
      ((c = a.stateNode),
        Ec(t, a),
        (m = a.memoizedProps),
        (Q = ol(n, m)),
        (c.props = Q),
        (ne = a.pendingProps),
        (U = c.context),
        (R = n.contextType),
        (N = En),
        typeof R == "object" && R !== null && (N = Ea(R)),
        (x = n.getDerivedStateFromProps),
        (R =
          typeof x == "function" ||
          typeof c.getSnapshotBeforeUpdate == "function") ||
          (typeof c.UNSAFE_componentWillReceiveProps != "function" &&
            typeof c.componentWillReceiveProps != "function") ||
          ((m !== ne || U !== N) && xh(a, c, l, N)),
        (mi = !1),
        (U = a.memoizedState),
        (c.state = U),
        wr(a, l, c, o),
        _r());
      var q = a.memoizedState;
      m !== ne ||
      U !== q ||
      mi ||
      (t !== null && t.dependencies !== null && xo(t.dependencies))
        ? (typeof x == "function" && (ad(a, n, x, l), (q = a.memoizedState)),
          (Q =
            mi ||
            ph(a, n, Q, l, U, q, N) ||
            (t !== null && t.dependencies !== null && xo(t.dependencies)))
            ? (R ||
                (typeof c.UNSAFE_componentWillUpdate != "function" &&
                  typeof c.componentWillUpdate != "function") ||
                (typeof c.componentWillUpdate == "function" &&
                  c.componentWillUpdate(l, q, N),
                typeof c.UNSAFE_componentWillUpdate == "function" &&
                  c.UNSAFE_componentWillUpdate(l, q, N)),
              typeof c.componentDidUpdate == "function" && (a.flags |= 4),
              typeof c.getSnapshotBeforeUpdate == "function" &&
                (a.flags |= 1024))
            : (typeof c.componentDidUpdate != "function" ||
                (m === t.memoizedProps && U === t.memoizedState) ||
                (a.flags |= 4),
              typeof c.getSnapshotBeforeUpdate != "function" ||
                (m === t.memoizedProps && U === t.memoizedState) ||
                (a.flags |= 1024),
              (a.memoizedProps = l),
              (a.memoizedState = q)),
          (c.props = l),
          (c.state = q),
          (c.context = N),
          (l = Q))
        : (typeof c.componentDidUpdate != "function" ||
            (m === t.memoizedProps && U === t.memoizedState) ||
            (a.flags |= 4),
          typeof c.getSnapshotBeforeUpdate != "function" ||
            (m === t.memoizedProps && U === t.memoizedState) ||
            (a.flags |= 1024),
          (l = !1));
    }
    return (
      (c = l),
      Oo(t, a),
      (l = (a.flags & 128) !== 0),
      c || l
        ? ((c = a.stateNode),
          (n =
            l && typeof n.getDerivedStateFromError != "function"
              ? null
              : c.render()),
          (a.flags |= 1),
          t !== null && l
            ? ((a.child = ll(a, t.child, null, o)),
              (a.child = ll(a, null, n, o)))
            : Oa(t, a, n, o),
          (a.memoizedState = c.state),
          (t = a.child))
        : (t = Hn(t, a, o)),
      t
    );
  }
  function Mh(t, a, n, l) {
    return (Dn(), (a.flags |= 256), Oa(t, a, n, l), a.child);
  }
  var rd = {
    dehydrated: null,
    treeContext: null,
    retryLane: 0,
    hydrationErrors: null,
  };
  function od(t) {
    return { baseLanes: t, cachePool: vu() };
  }
  function cd(t, a, n) {
    return ((t = t !== null ? t.childLanes & ~n : 0), a && (t |= js), t);
  }
  function Ph(t, a, n) {
    var l = a.pendingProps,
      o = !1,
      c = (a.flags & 128) !== 0,
      m;
    if (
      ((m = c) ||
        (m =
          t !== null && t.memoizedState === null ? !1 : (da.current & 2) !== 0),
      m && ((o = !0), (a.flags &= -129)),
      (m = (a.flags & 32) !== 0),
      (a.flags &= -33),
      t === null)
    ) {
      if (dt) {
        if (
          (o ? fi(a) : gi(),
          (t = Nt)
            ? ((t = Hm(t, rs)),
              (t = t !== null && t.data !== "&" ? t : null),
              t !== null &&
                ((a.memoizedState = {
                  dehydrated: t,
                  treeContext: H !== null ? { id: se, overflow: ye } : null,
                  retryLane: 536870912,
                  hydrationErrors: null,
                }),
                (n = pr(t)),
                (n.return = a),
                (a.child = n),
                (jt = a),
                (Nt = null)))
            : (t = null),
          t === null)
        )
          throw gn(a);
        return (qd(t) ? (a.lanes = 32) : (a.lanes = 536870912), null);
      }
      var x = l.children;
      return (
        (l = l.fallback),
        o
          ? (gi(),
            (o = a.mode),
            (x = Do({ mode: "hidden", children: x }, o)),
            (l = On(l, o, n, null)),
            (x.return = a),
            (l.return = a),
            (x.sibling = l),
            (a.child = x),
            (l = a.child),
            (l.memoizedState = od(n)),
            (l.childLanes = cd(t, m, n)),
            (a.memoizedState = rd),
            Ar(null, l))
          : (fi(a), dd(a, x))
      );
    }
    var N = t.memoizedState;
    if (N !== null && ((x = N.dehydrated), x !== null)) {
      if (c)
        a.flags & 256
          ? (fi(a), (a.flags &= -257), (a = ud(t, a, n)))
          : a.memoizedState !== null
            ? (gi(), (a.child = t.child), (a.flags |= 128), (a = null))
            : (gi(),
              (x = l.fallback),
              (o = a.mode),
              (l = Do({ mode: "visible", children: l.children }, o)),
              (x = On(x, o, n, null)),
              (x.flags |= 2),
              (l.return = a),
              (x.return = a),
              (l.sibling = x),
              (a.child = l),
              ll(a, t.child, null, n),
              (l = a.child),
              (l.memoizedState = od(n)),
              (l.childLanes = cd(t, m, n)),
              (a.memoizedState = rd),
              (a = Ar(null, l)));
      else if ((fi(a), qd(x))) {
        if (((m = x.nextSibling && x.nextSibling.dataset), m)) var R = m.dgst;
        ((m = R),
          (l = Error(b(419))),
          (l.stack = ""),
          (l.digest = m),
          el({ value: l, source: null, stack: null }),
          (a = ud(t, a, n)));
      } else if (
        (pa || El(t, a, n, !1), (m = (n & t.childLanes) !== 0), pa || m)
      ) {
        if (
          ((m = Gt),
          m !== null && ((l = _n(m, n)), l !== 0 && l !== N.retryLane))
        )
          throw ((N.retryLane = l), Os(t, l), hs(m, t, l), id);
        (Zd(x) || Zo(), (a = ud(t, a, n)));
      } else
        Zd(x)
          ? ((a.flags |= 192), (a.child = t.child), (a = null))
          : ((t = N.treeContext),
            (Nt = zs(x.nextSibling)),
            (jt = a),
            (dt = !0),
            (fn = null),
            (rs = !1),
            t !== null && Wa(a, t),
            (a = dd(a, l.children)),
            (a.flags |= 4096));
      return a;
    }
    return o
      ? (gi(),
        (x = l.fallback),
        (o = a.mode),
        (N = t.child),
        (R = N.sibling),
        (l = Ds(N, { mode: "hidden", children: l.children })),
        (l.subtreeFlags = N.subtreeFlags & 65011712),
        R !== null ? (x = Ds(R, x)) : ((x = On(x, o, n, null)), (x.flags |= 2)),
        (x.return = a),
        (l.return = a),
        (l.sibling = x),
        (a.child = l),
        Ar(null, l),
        (l = a.child),
        (x = t.child.memoizedState),
        x === null
          ? (x = od(n))
          : ((o = x.cachePool),
            o !== null
              ? ((N = ha._currentValue),
                (o = o.parent !== N ? { parent: N, pool: N } : o))
              : (o = vu()),
            (x = { baseLanes: x.baseLanes | n, cachePool: o })),
        (l.memoizedState = x),
        (l.childLanes = cd(t, m, n)),
        (a.memoizedState = rd),
        Ar(t.child, l))
      : (fi(a),
        (n = t.child),
        (t = n.sibling),
        (n = Ds(n, { mode: "visible", children: l.children })),
        (n.return = a),
        (n.sibling = null),
        t !== null &&
          ((m = a.deletions),
          m === null ? ((a.deletions = [t]), (a.flags |= 16)) : m.push(t)),
        (a.child = n),
        (a.memoizedState = null),
        n);
  }
  function dd(t, a) {
    return (
      (a = Do({ mode: "visible", children: a }, t.mode)),
      (a.return = t),
      (t.child = a)
    );
  }
  function Do(t, a) {
    return ((t = Za(22, t, null, a)), (t.lanes = 0), t);
  }
  function ud(t, a, n) {
    return (
      ll(a, t.child, null, n),
      (t = dd(a, a.pendingProps.children)),
      (t.flags |= 2),
      (a.memoizedState = null),
      t
    );
  }
  function Lh(t, a, n) {
    t.lanes |= a;
    var l = t.alternate;
    (l !== null && (l.lanes |= a), Sc(t.return, a, n));
  }
  function hd(t, a, n, l, o, c) {
    var m = t.memoizedState;
    m === null
      ? (t.memoizedState = {
          isBackwards: a,
          rendering: null,
          renderingStartTime: 0,
          last: l,
          tail: n,
          tailMode: o,
          treeForkCount: c,
        })
      : ((m.isBackwards = a),
        (m.rendering = null),
        (m.renderingStartTime = 0),
        (m.last = l),
        (m.tail = n),
        (m.tailMode = o),
        (m.treeForkCount = c));
  }
  function Eh(t, a, n) {
    var l = a.pendingProps,
      o = l.revealOrder,
      c = l.tail;
    l = l.children;
    var m = da.current,
      x = (m & 2) !== 0;
    if (
      (x ? ((m = (m & 1) | 2), (a.flags |= 128)) : (m &= 1),
      I(da, m),
      Oa(t, a, l, n),
      (l = dt ? p : 0),
      !x && t !== null && (t.flags & 128) !== 0)
    )
      e: for (t = a.child; t !== null; ) {
        if (t.tag === 13) t.memoizedState !== null && Lh(t, n, a);
        else if (t.tag === 19) Lh(t, n, a);
        else if (t.child !== null) {
          ((t.child.return = t), (t = t.child));
          continue;
        }
        if (t === a) break e;
        for (; t.sibling === null; ) {
          if (t.return === null || t.return === a) break e;
          t = t.return;
        }
        ((t.sibling.return = t.return), (t = t.sibling));
      }
    switch (o) {
      case "forwards":
        for (n = a.child, o = null; n !== null; )
          ((t = n.alternate),
            t !== null && _o(t) === null && (o = n),
            (n = n.sibling));
        ((n = o),
          n === null
            ? ((o = a.child), (a.child = null))
            : ((o = n.sibling), (n.sibling = null)),
          hd(a, !1, o, n, c, l));
        break;
      case "backwards":
      case "unstable_legacy-backwards":
        for (n = null, o = a.child, a.child = null; o !== null; ) {
          if (((t = o.alternate), t !== null && _o(t) === null)) {
            a.child = o;
            break;
          }
          ((t = o.sibling), (o.sibling = n), (n = o), (o = t));
        }
        hd(a, !0, n, null, c, l);
        break;
      case "together":
        hd(a, !1, null, null, void 0, l);
        break;
      default:
        a.memoizedState = null;
    }
    return a.child;
  }
  function Hn(t, a, n) {
    if (
      (t !== null && (a.dependencies = t.dependencies),
      (yi |= a.lanes),
      (n & a.childLanes) === 0)
    )
      if (t !== null) {
        if ((El(t, a, n, !1), (n & a.childLanes) === 0)) return null;
      } else return null;
    if (t !== null && a.child !== t.child) throw Error(b(153));
    if (a.child !== null) {
      for (
        t = a.child, n = Ds(t, t.pendingProps), a.child = n, n.return = a;
        t.sibling !== null;
      )
        ((t = t.sibling),
          (n = n.sibling = Ds(t, t.pendingProps)),
          (n.return = a));
      n.sibling = null;
    }
    return a.child;
  }
  function md(t, a) {
    return (t.lanes & a) !== 0
      ? !0
      : ((t = t.dependencies), !!(t !== null && xo(t)));
  }
  function Fp(t, a, n) {
    switch (a.tag) {
      case 3:
        ($e(a, a.stateNode.containerInfo),
          hi(a, ha, t.memoizedState.cache),
          Dn());
        break;
      case 27:
      case 5:
        ze(a);
        break;
      case 4:
        $e(a, a.stateNode.containerInfo);
        break;
      case 10:
        hi(a, a.type, a.memoizedProps.value);
        break;
      case 31:
        if (a.memoizedState !== null) return ((a.flags |= 128), Bc(a), null);
        break;
      case 13:
        var l = a.memoizedState;
        if (l !== null)
          return l.dehydrated !== null
            ? (fi(a), (a.flags |= 128), null)
            : (n & a.child.childLanes) !== 0
              ? Ph(t, a, n)
              : (fi(a), (t = Hn(t, a, n)), t !== null ? t.sibling : null);
        fi(a);
        break;
      case 19:
        var o = (t.flags & 128) !== 0;
        if (
          ((l = (n & a.childLanes) !== 0),
          l || (El(t, a, n, !1), (l = (n & a.childLanes) !== 0)),
          o)
        ) {
          if (l) return Eh(t, a, n);
          a.flags |= 128;
        }
        if (
          ((o = a.memoizedState),
          o !== null &&
            ((o.rendering = null), (o.tail = null), (o.lastEffect = null)),
          I(da, da.current),
          l)
        )
          break;
        return null;
      case 22:
        return ((a.lanes = 0), kh(t, a, n, a.pendingProps));
      case 24:
        hi(a, ha, t.memoizedState.cache);
    }
    return Hn(t, a, n);
  }
  function Oh(t, a, n) {
    if (t !== null)
      if (t.memoizedProps !== a.pendingProps) pa = !0;
      else {
        if (!md(t, n) && (a.flags & 128) === 0) return ((pa = !1), Fp(t, a, n));
        pa = (t.flags & 131072) !== 0;
      }
    else ((pa = !1), dt && (a.flags & 1048576) !== 0 && it(a, p, a.index));
    switch (((a.lanes = 0), a.tag)) {
      case 16:
        e: {
          var l = a.pendingProps;
          if (((t = nl(a.elementType)), (a.type = t), typeof t == "function"))
            Ml(t)
              ? ((l = ol(t, l)), (a.tag = 1), (a = Ah(null, a, t, l, n)))
              : ((a.tag = 0), (a = ld(null, a, t, l, n)));
          else {
            if (t != null) {
              var o = t.$$typeof;
              if (o === $) {
                ((a.tag = 11), (a = Nh(null, a, t, l, n)));
                break e;
              } else if (o === be) {
                ((a.tag = 14), (a = _h(null, a, t, l, n)));
                break e;
              }
            }
            throw ((a = Ae(t) || t), Error(b(306, a, "")));
          }
        }
        return a;
      case 0:
        return ld(t, a, a.type, a.pendingProps, n);
      case 1:
        return ((l = a.type), (o = ol(l, a.pendingProps)), Ah(t, a, l, o, n));
      case 3:
        e: {
          if (($e(a, a.stateNode.containerInfo), t === null))
            throw Error(b(387));
          l = a.pendingProps;
          var c = a.memoizedState;
          ((o = c.element), Ec(t, a), wr(a, l, null, n));
          var m = a.memoizedState;
          if (
            ((l = m.cache),
            hi(a, ha, l),
            l !== c.cache && Tc(a, [ha], n, !0),
            _r(),
            (l = m.element),
            c.isDehydrated)
          )
            if (
              ((c = { element: l, isDehydrated: !1, cache: m.cache }),
              (a.updateQueue.baseState = c),
              (a.memoizedState = c),
              a.flags & 256)
            ) {
              a = Mh(t, a, l, n);
              break e;
            } else if (l !== o) {
              ((o = i(Error(b(424)), a)), el(o), (a = Mh(t, a, l, n)));
              break e;
            } else {
              switch (((t = a.stateNode.containerInfo), t.nodeType)) {
                case 9:
                  t = t.body;
                  break;
                default:
                  t = t.nodeName === "HTML" ? t.ownerDocument.body : t;
              }
              for (
                Nt = zs(t.firstChild),
                  jt = a,
                  dt = !0,
                  fn = null,
                  rs = !0,
                  n = ku(a, null, l, n),
                  a.child = n;
                n;
              )
                ((n.flags = (n.flags & -3) | 4096), (n = n.sibling));
            }
          else {
            if ((Dn(), l === o)) {
              a = Hn(t, a, n);
              break e;
            }
            Oa(t, a, l, n);
          }
          a = a.child;
        }
        return a;
      case 26:
        return (
          Oo(t, a),
          t === null
            ? (n = qm(a.type, null, a.pendingProps, null))
              ? (a.memoizedState = n)
              : dt ||
                ((n = a.type),
                (t = a.pendingProps),
                (l = Qo(he.current).createElement(n)),
                (l[we] = a),
                (l[Ve] = t),
                Da(l, n, t),
                ca(l),
                (a.stateNode = l))
            : (a.memoizedState = qm(
                a.type,
                t.memoizedProps,
                a.pendingProps,
                t.memoizedState,
              )),
          null
        );
      case 27:
        return (
          ze(a),
          t === null &&
            dt &&
            ((l = a.stateNode = Gm(a.type, a.pendingProps, he.current)),
            (jt = a),
            (rs = !0),
            (o = Nt),
            ki(a.type) ? ((Vd = o), (Nt = zs(l.firstChild))) : (Nt = o)),
          Oa(t, a, a.pendingProps.children, n),
          Oo(t, a),
          t === null && (a.flags |= 4194304),
          a.child
        );
      case 5:
        return (
          t === null &&
            dt &&
            ((o = l = Nt) &&
              ((l = Ax(l, a.type, a.pendingProps, rs)),
              l !== null
                ? ((a.stateNode = l),
                  (jt = a),
                  (Nt = zs(l.firstChild)),
                  (rs = !1),
                  (o = !0))
                : (o = !1)),
            o || gn(a)),
          ze(a),
          (o = a.type),
          (c = a.pendingProps),
          (m = t !== null ? t.memoizedProps : null),
          (l = c.children),
          Id(o, c) ? (l = null) : m !== null && Id(o, m) && (a.flags |= 32),
          a.memoizedState !== null &&
            ((o = Uc(t, a, Zp, null, null, n)), (Zr._currentValue = o)),
          Oo(t, a),
          Oa(t, a, l, n),
          a.child
        );
      case 6:
        return (
          t === null &&
            dt &&
            ((t = n = Nt) &&
              ((n = Mx(n, a.pendingProps, rs)),
              n !== null
                ? ((a.stateNode = n), (jt = a), (Nt = null), (t = !0))
                : (t = !1)),
            t || gn(a)),
          null
        );
      case 13:
        return Ph(t, a, n);
      case 4:
        return (
          $e(a, a.stateNode.containerInfo),
          (l = a.pendingProps),
          t === null ? (a.child = ll(a, null, l, n)) : Oa(t, a, l, n),
          a.child
        );
      case 11:
        return Nh(t, a, a.type, a.pendingProps, n);
      case 7:
        return (Oa(t, a, a.pendingProps, n), a.child);
      case 8:
        return (Oa(t, a, a.pendingProps.children, n), a.child);
      case 12:
        return (Oa(t, a, a.pendingProps.children, n), a.child);
      case 10:
        return (
          (l = a.pendingProps),
          hi(a, a.type, l.value),
          Oa(t, a, l.children, n),
          a.child
        );
      case 9:
        return (
          (o = a.type._context),
          (l = a.pendingProps.children),
          al(a),
          (o = Ea(o)),
          (l = l(o)),
          (a.flags |= 1),
          Oa(t, a, l, n),
          a.child
        );
      case 14:
        return _h(t, a, a.type, a.pendingProps, n);
      case 15:
        return wh(t, a, a.type, a.pendingProps, n);
      case 19:
        return Eh(t, a, n);
      case 31:
        return Wp(t, a, n);
      case 22:
        return kh(t, a, n, a.pendingProps);
      case 24:
        return (
          al(a),
          (l = Ea(ha)),
          t === null
            ? ((o = Mc()),
              o === null &&
                ((o = Gt),
                (c = Cc()),
                (o.pooledCache = c),
                c.refCount++,
                c !== null && (o.pooledCacheLanes |= n),
                (o = c)),
              (a.memoizedState = { parent: l, cache: o }),
              Lc(a),
              hi(a, ha, o))
            : ((t.lanes & n) !== 0 && (Ec(t, a), wr(a, null, null, n), _r()),
              (o = t.memoizedState),
              (c = a.memoizedState),
              o.parent !== l
                ? ((o = { parent: l, cache: l }),
                  (a.memoizedState = o),
                  a.lanes === 0 &&
                    (a.memoizedState = a.updateQueue.baseState = o),
                  hi(a, ha, l))
                : ((l = c.cache),
                  hi(a, ha, l),
                  l !== o.cache && Tc(a, [ha], n, !0))),
          Oa(t, a, a.pendingProps.children, n),
          a.child
        );
      case 29:
        throw a.pendingProps;
    }
    throw Error(b(156, a.tag));
  }
  function Un(t) {
    t.flags |= 4;
  }
  function pd(t, a, n, l, o) {
    if (((a = (t.mode & 32) !== 0) && (a = !1), a)) {
      if (((t.flags |= 16777216), (o & 335544128) === o))
        if (t.stateNode.complete) t.flags |= 8192;
        else if (rm()) t.flags |= 8192;
        else throw ((il = vo), Pc);
    } else t.flags &= -16777217;
  }
  function Dh(t, a) {
    if (a.type !== "stylesheet" || (a.state.loading & 4) !== 0)
      t.flags &= -16777217;
    else if (((t.flags |= 16777216), !Jm(a)))
      if (rm()) t.flags |= 8192;
      else throw ((il = vo), Pc);
  }
  function Ro(t, a) {
    (a !== null && (t.flags |= 4),
      t.flags & 16384 &&
        ((a = t.tag !== 22 ? ws() : 536870912), (t.lanes |= a), (ql |= a)));
  }
  function Mr(t, a) {
    if (!dt)
      switch (t.tailMode) {
        case "hidden":
          a = t.tail;
          for (var n = null; a !== null; )
            (a.alternate !== null && (n = a), (a = a.sibling));
          n === null ? (t.tail = null) : (n.sibling = null);
          break;
        case "collapsed":
          n = t.tail;
          for (var l = null; n !== null; )
            (n.alternate !== null && (l = n), (n = n.sibling));
          l === null
            ? a || t.tail === null
              ? (t.tail = null)
              : (t.tail.sibling = null)
            : (l.sibling = null);
      }
  }
  function Yt(t) {
    var a = t.alternate !== null && t.alternate.child === t.child,
      n = 0,
      l = 0;
    if (a)
      for (var o = t.child; o !== null; )
        ((n |= o.lanes | o.childLanes),
          (l |= o.subtreeFlags & 65011712),
          (l |= o.flags & 65011712),
          (o.return = t),
          (o = o.sibling));
    else
      for (o = t.child; o !== null; )
        ((n |= o.lanes | o.childLanes),
          (l |= o.subtreeFlags),
          (l |= o.flags),
          (o.return = t),
          (o = o.sibling));
    return ((t.subtreeFlags |= l), (t.childLanes = n), a);
  }
  function ex(t, a, n) {
    var l = a.pendingProps;
    switch ((sa(a), a.tag)) {
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return (Yt(a), null);
      case 1:
        return (Yt(a), null);
      case 3:
        return (
          (n = a.stateNode),
          (l = null),
          t !== null && (l = t.memoizedState.cache),
          a.memoizedState.cache !== l && (a.flags |= 2048),
          Rn(ha),
          ae(),
          n.pendingContext &&
            ((n.context = n.pendingContext), (n.pendingContext = null)),
          (t === null || t.child === null) &&
            (Qs(a)
              ? Un(a)
              : t === null ||
                (t.memoizedState.isDehydrated && (a.flags & 256) === 0) ||
                ((a.flags |= 1024), gr())),
          Yt(a),
          null
        );
      case 26:
        var o = a.type,
          c = a.memoizedState;
        return (
          t === null
            ? (Un(a),
              c !== null ? (Yt(a), Dh(a, c)) : (Yt(a), pd(a, o, null, l, n)))
            : c
              ? c !== t.memoizedState
                ? (Un(a), Yt(a), Dh(a, c))
                : (Yt(a), (a.flags &= -16777217))
              : ((t = t.memoizedProps),
                t !== l && Un(a),
                Yt(a),
                pd(a, o, t, l, n)),
          null
        );
      case 27:
        if (
          (at(a),
          (n = he.current),
          (o = a.type),
          t !== null && a.stateNode != null)
        )
          t.memoizedProps !== l && Un(a);
        else {
          if (!l) {
            if (a.stateNode === null) throw Error(b(166));
            return (Yt(a), null);
          }
          ((t = X.current),
            Qs(a) ? fr(a) : ((t = Gm(o, l, n)), (a.stateNode = t), Un(a)));
        }
        return (Yt(a), null);
      case 5:
        if ((at(a), (o = a.type), t !== null && a.stateNode != null))
          t.memoizedProps !== l && Un(a);
        else {
          if (!l) {
            if (a.stateNode === null) throw Error(b(166));
            return (Yt(a), null);
          }
          if (((c = X.current), Qs(a))) fr(a);
          else {
            var m = Qo(he.current);
            switch (c) {
              case 1:
                c = m.createElementNS("http://www.w3.org/2000/svg", o);
                break;
              case 2:
                c = m.createElementNS("http://www.w3.org/1998/Math/MathML", o);
                break;
              default:
                switch (o) {
                  case "svg":
                    c = m.createElementNS("http://www.w3.org/2000/svg", o);
                    break;
                  case "math":
                    c = m.createElementNS(
                      "http://www.w3.org/1998/Math/MathML",
                      o,
                    );
                    break;
                  case "script":
                    ((c = m.createElement("div")),
                      (c.innerHTML = "<script><\/script>"),
                      (c = c.removeChild(c.firstChild)));
                    break;
                  case "select":
                    ((c =
                      typeof l.is == "string"
                        ? m.createElement("select", { is: l.is })
                        : m.createElement("select")),
                      l.multiple
                        ? (c.multiple = !0)
                        : l.size && (c.size = l.size));
                    break;
                  default:
                    c =
                      typeof l.is == "string"
                        ? m.createElement(o, { is: l.is })
                        : m.createElement(o);
                }
            }
            ((c[we] = a), (c[Ve] = l));
            e: for (m = a.child; m !== null; ) {
              if (m.tag === 5 || m.tag === 6) c.appendChild(m.stateNode);
              else if (m.tag !== 4 && m.tag !== 27 && m.child !== null) {
                ((m.child.return = m), (m = m.child));
                continue;
              }
              if (m === a) break e;
              for (; m.sibling === null; ) {
                if (m.return === null || m.return === a) break e;
                m = m.return;
              }
              ((m.sibling.return = m.return), (m = m.sibling));
            }
            a.stateNode = c;
            e: switch ((Da(c, o, l), o)) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                l = !!l.autoFocus;
                break e;
              case "img":
                l = !0;
                break e;
              default:
                l = !1;
            }
            l && Un(a);
          }
        }
        return (
          Yt(a),
          pd(a, a.type, t === null ? null : t.memoizedProps, a.pendingProps, n),
          null
        );
      case 6:
        if (t && a.stateNode != null) t.memoizedProps !== l && Un(a);
        else {
          if (typeof l != "string" && a.stateNode === null) throw Error(b(166));
          if (((t = he.current), Qs(a))) {
            if (
              ((t = a.stateNode),
              (n = a.memoizedProps),
              (l = null),
              (o = jt),
              o !== null)
            )
              switch (o.tag) {
                case 27:
                case 5:
                  l = o.memoizedProps;
              }
            ((t[we] = a),
              (t = !!(
                t.nodeValue === n ||
                (l !== null && l.suppressHydrationWarning === !0) ||
                Pm(t.nodeValue, n)
              )),
              t || gn(a, !0));
          } else
            ((t = Qo(t).createTextNode(l)), (t[we] = a), (a.stateNode = t));
        }
        return (Yt(a), null);
      case 31:
        if (((n = a.memoizedState), t === null || t.memoizedState !== null)) {
          if (((l = Qs(a)), n !== null)) {
            if (t === null) {
              if (!l) throw Error(b(318));
              if (
                ((t = a.memoizedState),
                (t = t !== null ? t.dehydrated : null),
                !t)
              )
                throw Error(b(557));
              t[we] = a;
            } else
              (Dn(),
                (a.flags & 128) === 0 && (a.memoizedState = null),
                (a.flags |= 4));
            (Yt(a), (t = !1));
          } else
            ((n = gr()),
              t !== null &&
                t.memoizedState !== null &&
                (t.memoizedState.hydrationErrors = n),
              (t = !0));
          if (!t) return a.flags & 256 ? (vs(a), a) : (vs(a), null);
          if ((a.flags & 128) !== 0) throw Error(b(558));
        }
        return (Yt(a), null);
      case 13:
        if (
          ((l = a.memoizedState),
          t === null ||
            (t.memoizedState !== null && t.memoizedState.dehydrated !== null))
        ) {
          if (((o = Qs(a)), l !== null && l.dehydrated !== null)) {
            if (t === null) {
              if (!o) throw Error(b(318));
              if (
                ((o = a.memoizedState),
                (o = o !== null ? o.dehydrated : null),
                !o)
              )
                throw Error(b(317));
              o[we] = a;
            } else
              (Dn(),
                (a.flags & 128) === 0 && (a.memoizedState = null),
                (a.flags |= 4));
            (Yt(a), (o = !1));
          } else
            ((o = gr()),
              t !== null &&
                t.memoizedState !== null &&
                (t.memoizedState.hydrationErrors = o),
              (o = !0));
          if (!o) return a.flags & 256 ? (vs(a), a) : (vs(a), null);
        }
        return (
          vs(a),
          (a.flags & 128) !== 0
            ? ((a.lanes = n), a)
            : ((n = l !== null),
              (t = t !== null && t.memoizedState !== null),
              n &&
                ((l = a.child),
                (o = null),
                l.alternate !== null &&
                  l.alternate.memoizedState !== null &&
                  l.alternate.memoizedState.cachePool !== null &&
                  (o = l.alternate.memoizedState.cachePool.pool),
                (c = null),
                l.memoizedState !== null &&
                  l.memoizedState.cachePool !== null &&
                  (c = l.memoizedState.cachePool.pool),
                c !== o && (l.flags |= 2048)),
              n !== t && n && (a.child.flags |= 8192),
              Ro(a, a.updateQueue),
              Yt(a),
              null)
        );
      case 4:
        return (ae(), t === null && Rd(a.stateNode.containerInfo), Yt(a), null);
      case 10:
        return (Rn(a.type), Yt(a), null);
      case 19:
        if ((C(da), (l = a.memoizedState), l === null)) return (Yt(a), null);
        if (((o = (a.flags & 128) !== 0), (c = l.rendering), c === null))
          if (o) Mr(l, !1);
          else {
            if (ia !== 0 || (t !== null && (t.flags & 128) !== 0))
              for (t = a.child; t !== null; ) {
                if (((c = _o(t)), c !== null)) {
                  for (
                    a.flags |= 128,
                      Mr(l, !1),
                      t = c.updateQueue,
                      a.updateQueue = t,
                      Ro(a, t),
                      a.subtreeFlags = 0,
                      t = n,
                      n = a.child;
                    n !== null;
                  )
                    (mr(n, t), (n = n.sibling));
                  return (
                    I(da, (da.current & 1) | 2),
                    dt && De(a, l.treeForkCount),
                    a.child
                  );
                }
                t = t.sibling;
              }
            l.tail !== null &&
              E() > Io &&
              ((a.flags |= 128), (o = !0), Mr(l, !1), (a.lanes = 4194304));
          }
        else {
          if (!o)
            if (((t = _o(c)), t !== null)) {
              if (
                ((a.flags |= 128),
                (o = !0),
                (t = t.updateQueue),
                (a.updateQueue = t),
                Ro(a, t),
                Mr(l, !0),
                l.tail === null &&
                  l.tailMode === "hidden" &&
                  !c.alternate &&
                  !dt)
              )
                return (Yt(a), null);
            } else
              2 * E() - l.renderingStartTime > Io &&
                n !== 536870912 &&
                ((a.flags |= 128), (o = !0), Mr(l, !1), (a.lanes = 4194304));
          l.isBackwards
            ? ((c.sibling = a.child), (a.child = c))
            : ((t = l.last),
              t !== null ? (t.sibling = c) : (a.child = c),
              (l.last = c));
        }
        return l.tail !== null
          ? ((t = l.tail),
            (l.rendering = t),
            (l.tail = t.sibling),
            (l.renderingStartTime = E()),
            (t.sibling = null),
            (n = da.current),
            I(da, o ? (n & 1) | 2 : n & 1),
            dt && De(a, l.treeForkCount),
            t)
          : (Yt(a), null);
      case 22:
      case 23:
        return (
          vs(a),
          zc(),
          (l = a.memoizedState !== null),
          t !== null
            ? (t.memoizedState !== null) !== l && (a.flags |= 8192)
            : l && (a.flags |= 8192),
          l
            ? (n & 536870912) !== 0 &&
              (a.flags & 128) === 0 &&
              (Yt(a), a.subtreeFlags & 6 && (a.flags |= 8192))
            : Yt(a),
          (n = a.updateQueue),
          n !== null && Ro(a, n.retryQueue),
          (n = null),
          t !== null &&
            t.memoizedState !== null &&
            t.memoizedState.cachePool !== null &&
            (n = t.memoizedState.cachePool.pool),
          (l = null),
          a.memoizedState !== null &&
            a.memoizedState.cachePool !== null &&
            (l = a.memoizedState.cachePool.pool),
          l !== n && (a.flags |= 2048),
          t !== null && C(sl),
          null
        );
      case 24:
        return (
          (n = null),
          t !== null && (n = t.memoizedState.cache),
          a.memoizedState.cache !== n && (a.flags |= 2048),
          Rn(ha),
          Yt(a),
          null
        );
      case 25:
        return null;
      case 30:
        return null;
    }
    throw Error(b(156, a.tag));
  }
  function tx(t, a) {
    switch ((sa(a), a.tag)) {
      case 1:
        return (
          (t = a.flags),
          t & 65536 ? ((a.flags = (t & -65537) | 128), a) : null
        );
      case 3:
        return (
          Rn(ha),
          ae(),
          (t = a.flags),
          (t & 65536) !== 0 && (t & 128) === 0
            ? ((a.flags = (t & -65537) | 128), a)
            : null
        );
      case 26:
      case 27:
      case 5:
        return (at(a), null);
      case 31:
        if (a.memoizedState !== null) {
          if ((vs(a), a.alternate === null)) throw Error(b(340));
          Dn();
        }
        return (
          (t = a.flags),
          t & 65536 ? ((a.flags = (t & -65537) | 128), a) : null
        );
      case 13:
        if (
          (vs(a), (t = a.memoizedState), t !== null && t.dehydrated !== null)
        ) {
          if (a.alternate === null) throw Error(b(340));
          Dn();
        }
        return (
          (t = a.flags),
          t & 65536 ? ((a.flags = (t & -65537) | 128), a) : null
        );
      case 19:
        return (C(da), null);
      case 4:
        return (ae(), null);
      case 10:
        return (Rn(a.type), null);
      case 22:
      case 23:
        return (
          vs(a),
          zc(),
          t !== null && C(sl),
          (t = a.flags),
          t & 65536 ? ((a.flags = (t & -65537) | 128), a) : null
        );
      case 24:
        return (Rn(ha), null);
      case 25:
        return null;
      default:
        return null;
    }
  }
  function Rh(t, a) {
    switch ((sa(a), a.tag)) {
      case 3:
        (Rn(ha), ae());
        break;
      case 26:
      case 27:
      case 5:
        at(a);
        break;
      case 4:
        ae();
        break;
      case 31:
        a.memoizedState !== null && vs(a);
        break;
      case 13:
        vs(a);
        break;
      case 19:
        C(da);
        break;
      case 10:
        Rn(a.type);
        break;
      case 22:
      case 23:
        (vs(a), zc(), t !== null && C(sl));
        break;
      case 24:
        Rn(ha);
    }
  }
  function Pr(t, a) {
    try {
      var n = a.updateQueue,
        l = n !== null ? n.lastEffect : null;
      if (l !== null) {
        var o = l.next;
        n = o;
        do {
          if ((n.tag & t) === t) {
            l = void 0;
            var c = n.create,
              m = n.inst;
            ((l = c()), (m.destroy = l));
          }
          n = n.next;
        } while (n !== o);
      }
    } catch (x) {
      Et(a, a.return, x);
    }
  }
  function bi(t, a, n) {
    try {
      var l = a.updateQueue,
        o = l !== null ? l.lastEffect : null;
      if (o !== null) {
        var c = o.next;
        l = c;
        do {
          if ((l.tag & t) === t) {
            var m = l.inst,
              x = m.destroy;
            if (x !== void 0) {
              ((m.destroy = void 0), (o = a));
              var N = n,
                R = x;
              try {
                R();
              } catch (Q) {
                Et(o, N, Q);
              }
            }
          }
          l = l.next;
        } while (l !== c);
      }
    } catch (Q) {
      Et(a, a.return, Q);
    }
  }
  function zh(t) {
    var a = t.updateQueue;
    if (a !== null) {
      var n = t.stateNode;
      try {
        Tu(a, n);
      } catch (l) {
        Et(t, t.return, l);
      }
    }
  }
  function Bh(t, a, n) {
    ((n.props = ol(t.type, t.memoizedProps)), (n.state = t.memoizedState));
    try {
      n.componentWillUnmount();
    } catch (l) {
      Et(t, a, l);
    }
  }
  function Lr(t, a) {
    try {
      var n = t.ref;
      if (n !== null) {
        switch (t.tag) {
          case 26:
          case 27:
          case 5:
            var l = t.stateNode;
            break;
          case 30:
            l = t.stateNode;
            break;
          default:
            l = t.stateNode;
        }
        typeof n == "function" ? (t.refCleanup = n(l)) : (n.current = l);
      }
    } catch (o) {
      Et(t, a, o);
    }
  }
  function vn(t, a) {
    var n = t.ref,
      l = t.refCleanup;
    if (n !== null)
      if (typeof l == "function")
        try {
          l();
        } catch (o) {
          Et(t, a, o);
        } finally {
          ((t.refCleanup = null),
            (t = t.alternate),
            t != null && (t.refCleanup = null));
        }
      else if (typeof n == "function")
        try {
          n(null);
        } catch (o) {
          Et(t, a, o);
        }
      else n.current = null;
  }
  function Hh(t) {
    var a = t.type,
      n = t.memoizedProps,
      l = t.stateNode;
    try {
      e: switch (a) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          n.autoFocus && l.focus();
          break e;
        case "img":
          n.src ? (l.src = n.src) : n.srcSet && (l.srcset = n.srcSet);
      }
    } catch (o) {
      Et(t, t.return, o);
    }
  }
  function xd(t, a, n) {
    try {
      var l = t.stateNode;
      (_x(l, t.type, n, a), (l[Ve] = a));
    } catch (o) {
      Et(t, t.return, o);
    }
  }
  function Uh(t) {
    return (
      t.tag === 5 ||
      t.tag === 3 ||
      t.tag === 26 ||
      (t.tag === 27 && ki(t.type)) ||
      t.tag === 4
    );
  }
  function fd(t) {
    e: for (;;) {
      for (; t.sibling === null; ) {
        if (t.return === null || Uh(t.return)) return null;
        t = t.return;
      }
      for (
        t.sibling.return = t.return, t = t.sibling;
        t.tag !== 5 && t.tag !== 6 && t.tag !== 18;
      ) {
        if (
          (t.tag === 27 && ki(t.type)) ||
          t.flags & 2 ||
          t.child === null ||
          t.tag === 4
        )
          continue e;
        ((t.child.return = t), (t = t.child));
      }
      if (!(t.flags & 2)) return t.stateNode;
    }
  }
  function gd(t, a, n) {
    var l = t.tag;
    if (l === 5 || l === 6)
      ((t = t.stateNode),
        a
          ? (n.nodeType === 9
              ? n.body
              : n.nodeName === "HTML"
                ? n.ownerDocument.body
                : n
            ).insertBefore(t, a)
          : ((a =
              n.nodeType === 9
                ? n.body
                : n.nodeName === "HTML"
                  ? n.ownerDocument.body
                  : n),
            a.appendChild(t),
            (n = n._reactRootContainer),
            n != null || a.onclick !== null || (a.onclick = Ha)));
    else if (
      l !== 4 &&
      (l === 27 && ki(t.type) && ((n = t.stateNode), (a = null)),
      (t = t.child),
      t !== null)
    )
      for (gd(t, a, n), t = t.sibling; t !== null; )
        (gd(t, a, n), (t = t.sibling));
  }
  function zo(t, a, n) {
    var l = t.tag;
    if (l === 5 || l === 6)
      ((t = t.stateNode), a ? n.insertBefore(t, a) : n.appendChild(t));
    else if (
      l !== 4 &&
      (l === 27 && ki(t.type) && (n = t.stateNode), (t = t.child), t !== null)
    )
      for (zo(t, a, n), t = t.sibling; t !== null; )
        (zo(t, a, n), (t = t.sibling));
  }
  function Ih(t) {
    var a = t.stateNode,
      n = t.memoizedProps;
    try {
      for (var l = t.type, o = a.attributes; o.length; )
        a.removeAttributeNode(o[0]);
      (Da(a, l, n), (a[we] = t), (a[Ve] = n));
    } catch (c) {
      Et(t, t.return, c);
    }
  }
  var In = !1,
    xa = !1,
    bd = !1,
    Gh = typeof WeakSet == "function" ? WeakSet : Set,
    Ca = null;
  function ax(t, a) {
    if (((t = t.containerInfo), (Hd = nc), (t = Vi(t)), un(t))) {
      if ("selectionStart" in t)
        var n = { start: t.selectionStart, end: t.selectionEnd };
      else
        e: {
          n = ((n = t.ownerDocument) && n.defaultView) || window;
          var l = n.getSelection && n.getSelection();
          if (l && l.rangeCount !== 0) {
            n = l.anchorNode;
            var o = l.anchorOffset,
              c = l.focusNode;
            l = l.focusOffset;
            try {
              (n.nodeType, c.nodeType);
            } catch {
              n = null;
              break e;
            }
            var m = 0,
              x = -1,
              N = -1,
              R = 0,
              Q = 0,
              ne = t,
              U = null;
            t: for (;;) {
              for (
                var q;
                ne !== n || (o !== 0 && ne.nodeType !== 3) || (x = m + o),
                  ne !== c || (l !== 0 && ne.nodeType !== 3) || (N = m + l),
                  ne.nodeType === 3 && (m += ne.nodeValue.length),
                  (q = ne.firstChild) !== null;
              )
                ((U = ne), (ne = q));
              for (;;) {
                if (ne === t) break t;
                if (
                  (U === n && ++R === o && (x = m),
                  U === c && ++Q === l && (N = m),
                  (q = ne.nextSibling) !== null)
                )
                  break;
                ((ne = U), (U = ne.parentNode));
              }
              ne = q;
            }
            n = x === -1 || N === -1 ? null : { start: x, end: N };
          } else n = null;
        }
      n = n || { start: 0, end: 0 };
    } else n = null;
    for (
      Ud = { focusedElem: t, selectionRange: n }, nc = !1, Ca = a;
      Ca !== null;
    )
      if (
        ((a = Ca), (t = a.child), (a.subtreeFlags & 1028) !== 0 && t !== null)
      )
        ((t.return = a), (Ca = t));
      else
        for (; Ca !== null; ) {
          switch (((a = Ca), (c = a.alternate), (t = a.flags), a.tag)) {
            case 0:
              if (
                (t & 4) !== 0 &&
                ((t = a.updateQueue),
                (t = t !== null ? t.events : null),
                t !== null)
              )
                for (n = 0; n < t.length; n++)
                  ((o = t[n]), (o.ref.impl = o.nextImpl));
              break;
            case 11:
            case 15:
              break;
            case 1:
              if ((t & 1024) !== 0 && c !== null) {
                ((t = void 0),
                  (n = a),
                  (o = c.memoizedProps),
                  (c = c.memoizedState),
                  (l = n.stateNode));
                try {
                  var ke = ol(n.type, o);
                  ((t = l.getSnapshotBeforeUpdate(ke, c)),
                    (l.__reactInternalSnapshotBeforeUpdate = t));
                } catch (Ke) {
                  Et(n, n.return, Ke);
                }
              }
              break;
            case 3:
              if ((t & 1024) !== 0) {
                if (
                  ((t = a.stateNode.containerInfo), (n = t.nodeType), n === 9)
                )
                  Kd(t);
                else if (n === 1)
                  switch (t.nodeName) {
                    case "HEAD":
                    case "HTML":
                    case "BODY":
                      Kd(t);
                      break;
                    default:
                      t.textContent = "";
                  }
              }
              break;
            case 5:
            case 26:
            case 27:
            case 6:
            case 4:
            case 17:
              break;
            default:
              if ((t & 1024) !== 0) throw Error(b(163));
          }
          if (((t = a.sibling), t !== null)) {
            ((t.return = a.return), (Ca = t));
            break;
          }
          Ca = a.return;
        }
  }
  function Kh(t, a, n) {
    var l = n.flags;
    switch (n.tag) {
      case 0:
      case 11:
      case 15:
        (Kn(t, n), l & 4 && Pr(5, n));
        break;
      case 1:
        if ((Kn(t, n), l & 4))
          if (((t = n.stateNode), a === null))
            try {
              t.componentDidMount();
            } catch (m) {
              Et(n, n.return, m);
            }
          else {
            var o = ol(n.type, a.memoizedProps);
            a = a.memoizedState;
            try {
              t.componentDidUpdate(o, a, t.__reactInternalSnapshotBeforeUpdate);
            } catch (m) {
              Et(n, n.return, m);
            }
          }
        (l & 64 && zh(n), l & 512 && Lr(n, n.return));
        break;
      case 3:
        if ((Kn(t, n), l & 64 && ((t = n.updateQueue), t !== null))) {
          if (((a = null), n.child !== null))
            switch (n.child.tag) {
              case 27:
              case 5:
                a = n.child.stateNode;
                break;
              case 1:
                a = n.child.stateNode;
            }
          try {
            Tu(t, a);
          } catch (m) {
            Et(n, n.return, m);
          }
        }
        break;
      case 27:
        a === null && l & 4 && Ih(n);
      case 26:
      case 5:
        (Kn(t, n), a === null && l & 4 && Hh(n), l & 512 && Lr(n, n.return));
        break;
      case 12:
        Kn(t, n);
        break;
      case 31:
        (Kn(t, n), l & 4 && Vh(t, n));
        break;
      case 13:
        (Kn(t, n),
          l & 4 && Yh(t, n),
          l & 64 &&
            ((t = n.memoizedState),
            t !== null &&
              ((t = t.dehydrated),
              t !== null && ((n = ux.bind(null, n)), Px(t, n)))));
        break;
      case 22:
        if (((l = n.memoizedState !== null || In), !l)) {
          ((a = (a !== null && a.memoizedState !== null) || xa), (o = In));
          var c = xa;
          ((In = l),
            (xa = a) && !c ? Zn(t, n, (n.subtreeFlags & 8772) !== 0) : Kn(t, n),
            (In = o),
            (xa = c));
        }
        break;
      case 30:
        break;
      default:
        Kn(t, n);
    }
  }
  function Zh(t) {
    var a = t.alternate;
    (a !== null && ((t.alternate = null), Zh(a)),
      (t.child = null),
      (t.deletions = null),
      (t.sibling = null),
      t.tag === 5 && ((a = t.stateNode), a !== null && Ra(a)),
      (t.stateNode = null),
      (t.return = null),
      (t.dependencies = null),
      (t.memoizedProps = null),
      (t.memoizedState = null),
      (t.pendingProps = null),
      (t.stateNode = null),
      (t.updateQueue = null));
  }
  var Wt = null,
    os = !1;
  function Gn(t, a, n) {
    for (n = n.child; n !== null; ) (qh(t, a, n), (n = n.sibling));
  }
  function qh(t, a, n) {
    if (Tt && typeof Tt.onCommitFiberUnmount == "function")
      try {
        Tt.onCommitFiberUnmount(Ft, n);
      } catch {}
    switch (n.tag) {
      case 26:
        (xa || vn(n, a),
          Gn(t, a, n),
          n.memoizedState
            ? n.memoizedState.count--
            : n.stateNode && ((n = n.stateNode), n.parentNode.removeChild(n)));
        break;
      case 27:
        xa || vn(n, a);
        var l = Wt,
          o = os;
        (ki(n.type) && ((Wt = n.stateNode), (os = !1)),
          Gn(t, a, n),
          Ir(n.stateNode),
          (Wt = l),
          (os = o));
        break;
      case 5:
        xa || vn(n, a);
      case 6:
        if (
          ((l = Wt),
          (o = os),
          (Wt = null),
          Gn(t, a, n),
          (Wt = l),
          (os = o),
          Wt !== null)
        )
          if (os)
            try {
              (Wt.nodeType === 9
                ? Wt.body
                : Wt.nodeName === "HTML"
                  ? Wt.ownerDocument.body
                  : Wt
              ).removeChild(n.stateNode);
            } catch (c) {
              Et(n, a, c);
            }
          else
            try {
              Wt.removeChild(n.stateNode);
            } catch (c) {
              Et(n, a, c);
            }
        break;
      case 18:
        Wt !== null &&
          (os
            ? ((t = Wt),
              zm(
                t.nodeType === 9
                  ? t.body
                  : t.nodeName === "HTML"
                    ? t.ownerDocument.body
                    : t,
                n.stateNode,
              ),
              Fl(t))
            : zm(Wt, n.stateNode));
        break;
      case 4:
        ((l = Wt),
          (o = os),
          (Wt = n.stateNode.containerInfo),
          (os = !0),
          Gn(t, a, n),
          (Wt = l),
          (os = o));
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        (bi(2, n, a), xa || bi(4, n, a), Gn(t, a, n));
        break;
      case 1:
        (xa ||
          (vn(n, a),
          (l = n.stateNode),
          typeof l.componentWillUnmount == "function" && Bh(n, a, l)),
          Gn(t, a, n));
        break;
      case 21:
        Gn(t, a, n);
        break;
      case 22:
        ((xa = (l = xa) || n.memoizedState !== null), Gn(t, a, n), (xa = l));
        break;
      default:
        Gn(t, a, n);
    }
  }
  function Vh(t, a) {
    if (
      a.memoizedState === null &&
      ((t = a.alternate), t !== null && ((t = t.memoizedState), t !== null))
    ) {
      t = t.dehydrated;
      try {
        Fl(t);
      } catch (n) {
        Et(a, a.return, n);
      }
    }
  }
  function Yh(t, a) {
    if (
      a.memoizedState === null &&
      ((t = a.alternate),
      t !== null &&
        ((t = t.memoizedState), t !== null && ((t = t.dehydrated), t !== null)))
    )
      try {
        Fl(t);
      } catch (n) {
        Et(a, a.return, n);
      }
  }
  function sx(t) {
    switch (t.tag) {
      case 31:
      case 13:
      case 19:
        var a = t.stateNode;
        return (a === null && (a = t.stateNode = new Gh()), a);
      case 22:
        return (
          (t = t.stateNode),
          (a = t._retryCache),
          a === null && (a = t._retryCache = new Gh()),
          a
        );
      default:
        throw Error(b(435, t.tag));
    }
  }
  function Bo(t, a) {
    var n = sx(t);
    a.forEach(function (l) {
      if (!n.has(l)) {
        n.add(l);
        var o = hx.bind(null, t, l);
        l.then(o, o);
      }
    });
  }
  function cs(t, a) {
    var n = a.deletions;
    if (n !== null)
      for (var l = 0; l < n.length; l++) {
        var o = n[l],
          c = t,
          m = a,
          x = m;
        e: for (; x !== null; ) {
          switch (x.tag) {
            case 27:
              if (ki(x.type)) {
                ((Wt = x.stateNode), (os = !1));
                break e;
              }
              break;
            case 5:
              ((Wt = x.stateNode), (os = !1));
              break e;
            case 3:
            case 4:
              ((Wt = x.stateNode.containerInfo), (os = !0));
              break e;
          }
          x = x.return;
        }
        if (Wt === null) throw Error(b(160));
        (qh(c, m, o),
          (Wt = null),
          (os = !1),
          (c = o.alternate),
          c !== null && (c.return = null),
          (o.return = null));
      }
    if (a.subtreeFlags & 13886)
      for (a = a.child; a !== null; ) (Xh(a, t), (a = a.sibling));
  }
  var Fs = null;
  function Xh(t, a) {
    var n = t.alternate,
      l = t.flags;
    switch (t.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        (cs(a, t),
          ds(t),
          l & 4 && (bi(3, t, t.return), Pr(3, t), bi(5, t, t.return)));
        break;
      case 1:
        (cs(a, t),
          ds(t),
          l & 512 && (xa || n === null || vn(n, n.return)),
          l & 64 &&
            In &&
            ((t = t.updateQueue),
            t !== null &&
              ((l = t.callbacks),
              l !== null &&
                ((n = t.shared.hiddenCallbacks),
                (t.shared.hiddenCallbacks = n === null ? l : n.concat(l))))));
        break;
      case 26:
        var o = Fs;
        if (
          (cs(a, t),
          ds(t),
          l & 512 && (xa || n === null || vn(n, n.return)),
          l & 4)
        ) {
          var c = n !== null ? n.memoizedState : null;
          if (((l = t.memoizedState), n === null))
            if (l === null)
              if (t.stateNode === null) {
                e: {
                  ((l = t.type),
                    (n = t.memoizedProps),
                    (o = o.ownerDocument || o));
                  t: switch (l) {
                    case "title":
                      ((c = o.getElementsByTagName("title")[0]),
                        (!c ||
                          c[Ot] ||
                          c[we] ||
                          c.namespaceURI === "http://www.w3.org/2000/svg" ||
                          c.hasAttribute("itemprop")) &&
                          ((c = o.createElement(l)),
                          o.head.insertBefore(
                            c,
                            o.querySelector("head > title"),
                          )),
                        Da(c, l, n),
                        (c[we] = t),
                        ca(c),
                        (l = c));
                      break e;
                    case "link":
                      var m = Xm("link", "href", o).get(l + (n.href || ""));
                      if (m) {
                        for (var x = 0; x < m.length; x++)
                          if (
                            ((c = m[x]),
                            c.getAttribute("href") ===
                              (n.href == null || n.href === ""
                                ? null
                                : n.href) &&
                              c.getAttribute("rel") ===
                                (n.rel == null ? null : n.rel) &&
                              c.getAttribute("title") ===
                                (n.title == null ? null : n.title) &&
                              c.getAttribute("crossorigin") ===
                                (n.crossOrigin == null ? null : n.crossOrigin))
                          ) {
                            m.splice(x, 1);
                            break t;
                          }
                      }
                      ((c = o.createElement(l)),
                        Da(c, l, n),
                        o.head.appendChild(c));
                      break;
                    case "meta":
                      if (
                        (m = Xm("meta", "content", o).get(
                          l + (n.content || ""),
                        ))
                      ) {
                        for (x = 0; x < m.length; x++)
                          if (
                            ((c = m[x]),
                            c.getAttribute("content") ===
                              (n.content == null ? null : "" + n.content) &&
                              c.getAttribute("name") ===
                                (n.name == null ? null : n.name) &&
                              c.getAttribute("property") ===
                                (n.property == null ? null : n.property) &&
                              c.getAttribute("http-equiv") ===
                                (n.httpEquiv == null ? null : n.httpEquiv) &&
                              c.getAttribute("charset") ===
                                (n.charSet == null ? null : n.charSet))
                          ) {
                            m.splice(x, 1);
                            break t;
                          }
                      }
                      ((c = o.createElement(l)),
                        Da(c, l, n),
                        o.head.appendChild(c));
                      break;
                    default:
                      throw Error(b(468, l));
                  }
                  ((c[we] = t), ca(c), (l = c));
                }
                t.stateNode = l;
              } else $m(o, t.type, t.stateNode);
            else t.stateNode = Ym(o, l, t.memoizedProps);
          else
            c !== l
              ? (c === null
                  ? n.stateNode !== null &&
                    ((n = n.stateNode), n.parentNode.removeChild(n))
                  : c.count--,
                l === null
                  ? $m(o, t.type, t.stateNode)
                  : Ym(o, l, t.memoizedProps))
              : l === null &&
                t.stateNode !== null &&
                xd(t, t.memoizedProps, n.memoizedProps);
        }
        break;
      case 27:
        (cs(a, t),
          ds(t),
          l & 512 && (xa || n === null || vn(n, n.return)),
          n !== null && l & 4 && xd(t, t.memoizedProps, n.memoizedProps));
        break;
      case 5:
        if (
          (cs(a, t),
          ds(t),
          l & 512 && (xa || n === null || vn(n, n.return)),
          t.flags & 32)
        ) {
          o = t.stateNode;
          try {
            Ba(o, "");
          } catch (ke) {
            Et(t, t.return, ke);
          }
        }
        (l & 4 &&
          t.stateNode != null &&
          ((o = t.memoizedProps), xd(t, o, n !== null ? n.memoizedProps : o)),
          l & 1024 && (bd = !0));
        break;
      case 6:
        if ((cs(a, t), ds(t), l & 4)) {
          if (t.stateNode === null) throw Error(b(162));
          ((l = t.memoizedProps), (n = t.stateNode));
          try {
            n.nodeValue = l;
          } catch (ke) {
            Et(t, t.return, ke);
          }
        }
        break;
      case 3:
        if (
          ((ec = null),
          (o = Fs),
          (Fs = Wo(a.containerInfo)),
          cs(a, t),
          (Fs = o),
          ds(t),
          l & 4 && n !== null && n.memoizedState.isDehydrated)
        )
          try {
            Fl(a.containerInfo);
          } catch (ke) {
            Et(t, t.return, ke);
          }
        bd && ((bd = !1), $h(t));
        break;
      case 4:
        ((l = Fs),
          (Fs = Wo(t.stateNode.containerInfo)),
          cs(a, t),
          ds(t),
          (Fs = l));
        break;
      case 12:
        (cs(a, t), ds(t));
        break;
      case 31:
        (cs(a, t),
          ds(t),
          l & 4 &&
            ((l = t.updateQueue),
            l !== null && ((t.updateQueue = null), Bo(t, l))));
        break;
      case 13:
        (cs(a, t),
          ds(t),
          t.child.flags & 8192 &&
            (t.memoizedState !== null) !=
              (n !== null && n.memoizedState !== null) &&
            (Uo = E()),
          l & 4 &&
            ((l = t.updateQueue),
            l !== null && ((t.updateQueue = null), Bo(t, l))));
        break;
      case 22:
        o = t.memoizedState !== null;
        var N = n !== null && n.memoizedState !== null,
          R = In,
          Q = xa;
        if (
          ((In = R || o),
          (xa = Q || N),
          cs(a, t),
          (xa = Q),
          (In = R),
          ds(t),
          l & 8192)
        )
          e: for (
            a = t.stateNode,
              a._visibility = o ? a._visibility & -2 : a._visibility | 1,
              o && (n === null || N || In || xa || cl(t)),
              n = null,
              a = t;
            ;
          ) {
            if (a.tag === 5 || a.tag === 26) {
              if (n === null) {
                N = n = a;
                try {
                  if (((c = N.stateNode), o))
                    ((m = c.style),
                      typeof m.setProperty == "function"
                        ? m.setProperty("display", "none", "important")
                        : (m.display = "none"));
                  else {
                    x = N.stateNode;
                    var ne = N.memoizedProps.style,
                      U =
                        ne != null && ne.hasOwnProperty("display")
                          ? ne.display
                          : null;
                    x.style.display =
                      U == null || typeof U == "boolean" ? "" : ("" + U).trim();
                  }
                } catch (ke) {
                  Et(N, N.return, ke);
                }
              }
            } else if (a.tag === 6) {
              if (n === null) {
                N = a;
                try {
                  N.stateNode.nodeValue = o ? "" : N.memoizedProps;
                } catch (ke) {
                  Et(N, N.return, ke);
                }
              }
            } else if (a.tag === 18) {
              if (n === null) {
                N = a;
                try {
                  var q = N.stateNode;
                  o ? Bm(q, !0) : Bm(N.stateNode, !1);
                } catch (ke) {
                  Et(N, N.return, ke);
                }
              }
            } else if (
              ((a.tag !== 22 && a.tag !== 23) ||
                a.memoizedState === null ||
                a === t) &&
              a.child !== null
            ) {
              ((a.child.return = a), (a = a.child));
              continue;
            }
            if (a === t) break e;
            for (; a.sibling === null; ) {
              if (a.return === null || a.return === t) break e;
              (n === a && (n = null), (a = a.return));
            }
            (n === a && (n = null),
              (a.sibling.return = a.return),
              (a = a.sibling));
          }
        l & 4 &&
          ((l = t.updateQueue),
          l !== null &&
            ((n = l.retryQueue),
            n !== null && ((l.retryQueue = null), Bo(t, n))));
        break;
      case 19:
        (cs(a, t),
          ds(t),
          l & 4 &&
            ((l = t.updateQueue),
            l !== null && ((t.updateQueue = null), Bo(t, l))));
        break;
      case 30:
        break;
      case 21:
        break;
      default:
        (cs(a, t), ds(t));
    }
  }
  function ds(t) {
    var a = t.flags;
    if (a & 2) {
      try {
        for (var n, l = t.return; l !== null; ) {
          if (Uh(l)) {
            n = l;
            break;
          }
          l = l.return;
        }
        if (n == null) throw Error(b(160));
        switch (n.tag) {
          case 27:
            var o = n.stateNode,
              c = fd(t);
            zo(t, c, o);
            break;
          case 5:
            var m = n.stateNode;
            n.flags & 32 && (Ba(m, ""), (n.flags &= -33));
            var x = fd(t);
            zo(t, x, m);
            break;
          case 3:
          case 4:
            var N = n.stateNode.containerInfo,
              R = fd(t);
            gd(t, R, N);
            break;
          default:
            throw Error(b(161));
        }
      } catch (Q) {
        Et(t, t.return, Q);
      }
      t.flags &= -3;
    }
    a & 4096 && (t.flags &= -4097);
  }
  function $h(t) {
    if (t.subtreeFlags & 1024)
      for (t = t.child; t !== null; ) {
        var a = t;
        ($h(a),
          a.tag === 5 && a.flags & 1024 && a.stateNode.reset(),
          (t = t.sibling));
      }
  }
  function Kn(t, a) {
    if (a.subtreeFlags & 8772)
      for (a = a.child; a !== null; ) (Kh(t, a.alternate, a), (a = a.sibling));
  }
  function cl(t) {
    for (t = t.child; t !== null; ) {
      var a = t;
      switch (a.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          (bi(4, a, a.return), cl(a));
          break;
        case 1:
          vn(a, a.return);
          var n = a.stateNode;
          (typeof n.componentWillUnmount == "function" && Bh(a, a.return, n),
            cl(a));
          break;
        case 27:
          Ir(a.stateNode);
        case 26:
        case 5:
          (vn(a, a.return), cl(a));
          break;
        case 22:
          a.memoizedState === null && cl(a);
          break;
        case 30:
          cl(a);
          break;
        default:
          cl(a);
      }
      t = t.sibling;
    }
  }
  function Zn(t, a, n) {
    for (n = n && (a.subtreeFlags & 8772) !== 0, a = a.child; a !== null; ) {
      var l = a.alternate,
        o = t,
        c = a,
        m = c.flags;
      switch (c.tag) {
        case 0:
        case 11:
        case 15:
          (Zn(o, c, n), Pr(4, c));
          break;
        case 1:
          if (
            (Zn(o, c, n),
            (l = c),
            (o = l.stateNode),
            typeof o.componentDidMount == "function")
          )
            try {
              o.componentDidMount();
            } catch (R) {
              Et(l, l.return, R);
            }
          if (((l = c), (o = l.updateQueue), o !== null)) {
            var x = l.stateNode;
            try {
              var N = o.shared.hiddenCallbacks;
              if (N !== null)
                for (o.shared.hiddenCallbacks = null, o = 0; o < N.length; o++)
                  Su(N[o], x);
            } catch (R) {
              Et(l, l.return, R);
            }
          }
          (n && m & 64 && zh(c), Lr(c, c.return));
          break;
        case 27:
          Ih(c);
        case 26:
        case 5:
          (Zn(o, c, n), n && l === null && m & 4 && Hh(c), Lr(c, c.return));
          break;
        case 12:
          Zn(o, c, n);
          break;
        case 31:
          (Zn(o, c, n), n && m & 4 && Vh(o, c));
          break;
        case 13:
          (Zn(o, c, n), n && m & 4 && Yh(o, c));
          break;
        case 22:
          (c.memoizedState === null && Zn(o, c, n), Lr(c, c.return));
          break;
        case 30:
          break;
        default:
          Zn(o, c, n);
      }
      a = a.sibling;
    }
  }
  function vd(t, a) {
    var n = null;
    (t !== null &&
      t.memoizedState !== null &&
      t.memoizedState.cachePool !== null &&
      (n = t.memoizedState.cachePool.pool),
      (t = null),
      a.memoizedState !== null &&
        a.memoizedState.cachePool !== null &&
        (t = a.memoizedState.cachePool.pool),
      t !== n && (t != null && t.refCount++, n != null && br(n)));
  }
  function yd(t, a) {
    ((t = null),
      a.alternate !== null && (t = a.alternate.memoizedState.cache),
      (a = a.memoizedState.cache),
      a !== t && (a.refCount++, t != null && br(t)));
  }
  function en(t, a, n, l) {
    if (a.subtreeFlags & 10256)
      for (a = a.child; a !== null; ) (Jh(t, a, n, l), (a = a.sibling));
  }
  function Jh(t, a, n, l) {
    var o = a.flags;
    switch (a.tag) {
      case 0:
      case 11:
      case 15:
        (en(t, a, n, l), o & 2048 && Pr(9, a));
        break;
      case 1:
        en(t, a, n, l);
        break;
      case 3:
        (en(t, a, n, l),
          o & 2048 &&
            ((t = null),
            a.alternate !== null && (t = a.alternate.memoizedState.cache),
            (a = a.memoizedState.cache),
            a !== t && (a.refCount++, t != null && br(t))));
        break;
      case 12:
        if (o & 2048) {
          (en(t, a, n, l), (t = a.stateNode));
          try {
            var c = a.memoizedProps,
              m = c.id,
              x = c.onPostCommit;
            typeof x == "function" &&
              x(
                m,
                a.alternate === null ? "mount" : "update",
                t.passiveEffectDuration,
                -0,
              );
          } catch (N) {
            Et(a, a.return, N);
          }
        } else en(t, a, n, l);
        break;
      case 31:
        en(t, a, n, l);
        break;
      case 13:
        en(t, a, n, l);
        break;
      case 23:
        break;
      case 22:
        ((c = a.stateNode),
          (m = a.alternate),
          a.memoizedState !== null
            ? c._visibility & 2
              ? en(t, a, n, l)
              : Er(t, a)
            : c._visibility & 2
              ? en(t, a, n, l)
              : ((c._visibility |= 2),
                Gl(t, a, n, l, (a.subtreeFlags & 10256) !== 0 || !1)),
          o & 2048 && vd(m, a));
        break;
      case 24:
        (en(t, a, n, l), o & 2048 && yd(a.alternate, a));
        break;
      default:
        en(t, a, n, l);
    }
  }
  function Gl(t, a, n, l, o) {
    for (
      o = o && ((a.subtreeFlags & 10256) !== 0 || !1), a = a.child;
      a !== null;
    ) {
      var c = t,
        m = a,
        x = n,
        N = l,
        R = m.flags;
      switch (m.tag) {
        case 0:
        case 11:
        case 15:
          (Gl(c, m, x, N, o), Pr(8, m));
          break;
        case 23:
          break;
        case 22:
          var Q = m.stateNode;
          (m.memoizedState !== null
            ? Q._visibility & 2
              ? Gl(c, m, x, N, o)
              : Er(c, m)
            : ((Q._visibility |= 2), Gl(c, m, x, N, o)),
            o && R & 2048 && vd(m.alternate, m));
          break;
        case 24:
          (Gl(c, m, x, N, o), o && R & 2048 && yd(m.alternate, m));
          break;
        default:
          Gl(c, m, x, N, o);
      }
      a = a.sibling;
    }
  }
  function Er(t, a) {
    if (a.subtreeFlags & 10256)
      for (a = a.child; a !== null; ) {
        var n = t,
          l = a,
          o = l.flags;
        switch (l.tag) {
          case 22:
            (Er(n, l), o & 2048 && vd(l.alternate, l));
            break;
          case 24:
            (Er(n, l), o & 2048 && yd(l.alternate, l));
            break;
          default:
            Er(n, l);
        }
        a = a.sibling;
      }
  }
  var Or = 8192;
  function Kl(t, a, n) {
    if (t.subtreeFlags & Or)
      for (t = t.child; t !== null; ) (Qh(t, a, n), (t = t.sibling));
  }
  function Qh(t, a, n) {
    switch (t.tag) {
      case 26:
        (Kl(t, a, n),
          t.flags & Or &&
            t.memoizedState !== null &&
            Kx(n, Fs, t.memoizedState, t.memoizedProps));
        break;
      case 5:
        Kl(t, a, n);
        break;
      case 3:
      case 4:
        var l = Fs;
        ((Fs = Wo(t.stateNode.containerInfo)), Kl(t, a, n), (Fs = l));
        break;
      case 22:
        t.memoizedState === null &&
          ((l = t.alternate),
          l !== null && l.memoizedState !== null
            ? ((l = Or), (Or = 16777216), Kl(t, a, n), (Or = l))
            : Kl(t, a, n));
        break;
      default:
        Kl(t, a, n);
    }
  }
  function Wh(t) {
    var a = t.alternate;
    if (a !== null && ((t = a.child), t !== null)) {
      a.child = null;
      do ((a = t.sibling), (t.sibling = null), (t = a));
      while (t !== null);
    }
  }
  function Dr(t) {
    var a = t.deletions;
    if ((t.flags & 16) !== 0) {
      if (a !== null)
        for (var n = 0; n < a.length; n++) {
          var l = a[n];
          ((Ca = l), em(l, t));
        }
      Wh(t);
    }
    if (t.subtreeFlags & 10256)
      for (t = t.child; t !== null; ) (Fh(t), (t = t.sibling));
  }
  function Fh(t) {
    switch (t.tag) {
      case 0:
      case 11:
      case 15:
        (Dr(t), t.flags & 2048 && bi(9, t, t.return));
        break;
      case 3:
        Dr(t);
        break;
      case 12:
        Dr(t);
        break;
      case 22:
        var a = t.stateNode;
        t.memoizedState !== null &&
        a._visibility & 2 &&
        (t.return === null || t.return.tag !== 13)
          ? ((a._visibility &= -3), Ho(t))
          : Dr(t);
        break;
      default:
        Dr(t);
    }
  }
  function Ho(t) {
    var a = t.deletions;
    if ((t.flags & 16) !== 0) {
      if (a !== null)
        for (var n = 0; n < a.length; n++) {
          var l = a[n];
          ((Ca = l), em(l, t));
        }
      Wh(t);
    }
    for (t = t.child; t !== null; ) {
      switch (((a = t), a.tag)) {
        case 0:
        case 11:
        case 15:
          (bi(8, a, a.return), Ho(a));
          break;
        case 22:
          ((n = a.stateNode),
            n._visibility & 2 && ((n._visibility &= -3), Ho(a)));
          break;
        default:
          Ho(a);
      }
      t = t.sibling;
    }
  }
  function em(t, a) {
    for (; Ca !== null; ) {
      var n = Ca;
      switch (n.tag) {
        case 0:
        case 11:
        case 15:
          bi(8, n, a);
          break;
        case 23:
        case 22:
          if (n.memoizedState !== null && n.memoizedState.cachePool !== null) {
            var l = n.memoizedState.cachePool.pool;
            l != null && l.refCount++;
          }
          break;
        case 24:
          br(n.memoizedState.cache);
      }
      if (((l = n.child), l !== null)) ((l.return = n), (Ca = l));
      else
        e: for (n = t; Ca !== null; ) {
          l = Ca;
          var o = l.sibling,
            c = l.return;
          if ((Zh(l), l === n)) {
            Ca = null;
            break e;
          }
          if (o !== null) {
            ((o.return = c), (Ca = o));
            break e;
          }
          Ca = c;
        }
    }
  }
  var nx = {
      getCacheForType: function (t) {
        var a = Ea(ha),
          n = a.data.get(t);
        return (n === void 0 && ((n = t()), a.data.set(t, n)), n);
      },
      cacheSignal: function () {
        return Ea(ha).controller.signal;
      },
    },
    ix = typeof WeakMap == "function" ? WeakMap : Map,
    kt = 0,
    Gt = null,
    ut = null,
    ft = 0,
    Lt = 0,
    ys = null,
    vi = !1,
    Zl = !1,
    jd = !1,
    qn = 0,
    ia = 0,
    yi = 0,
    dl = 0,
    Nd = 0,
    js = 0,
    ql = 0,
    Rr = null,
    us = null,
    _d = !1,
    Uo = 0,
    tm = 0,
    Io = 1 / 0,
    Go = null,
    ji = null,
    ya = 0,
    Ni = null,
    Vl = null,
    Vn = 0,
    wd = 0,
    kd = null,
    am = null,
    zr = 0,
    Sd = null;
  function Ns() {
    return (kt & 2) !== 0 && ft !== 0 ? ft & -ft : y.T !== null ? Ld() : Pe();
  }
  function sm() {
    if (js === 0)
      if ((ft & 536870912) === 0 || dt) {
        var t = pt;
        ((pt <<= 1), (pt & 3932160) === 0 && (pt = 262144), (js = t));
      } else js = 536870912;
    return ((t = bs.current), t !== null && (t.flags |= 32), js);
  }
  function hs(t, a, n) {
    (((t === Gt && (Lt === 2 || Lt === 9)) || t.cancelPendingCommit !== null) &&
      (Yl(t, 0), _i(t, ft, js, !1)),
      Na(t, n),
      ((kt & 2) === 0 || t !== Gt) &&
        (t === Gt &&
          ((kt & 2) === 0 && (dl |= n), ia === 4 && _i(t, ft, js, !1)),
        yn(t)));
  }
  function nm(t, a, n) {
    if ((kt & 6) !== 0) throw Error(b(327));
    var l = (!n && (a & 127) === 0 && (a & t.expiredLanes) === 0) || Xa(t, a),
      o = l ? ox(t, a) : Cd(t, a, !0),
      c = l;
    do {
      if (o === 0) {
        Zl && !l && _i(t, a, 0, !1);
        break;
      } else {
        if (((n = t.current.alternate), c && !lx(n))) {
          ((o = Cd(t, a, !1)), (c = !1));
          continue;
        }
        if (o === 2) {
          if (((c = a), t.errorRecoveryDisabledLanes & c)) var m = 0;
          else
            ((m = t.pendingLanes & -536870913),
              (m = m !== 0 ? m : m & 536870912 ? 536870912 : 0));
          if (m !== 0) {
            a = m;
            e: {
              var x = t;
              o = Rr;
              var N = x.current.memoizedState.isDehydrated;
              if ((N && (Yl(x, m).flags |= 256), (m = Cd(x, m, !1)), m !== 2)) {
                if (jd && !N) {
                  ((x.errorRecoveryDisabledLanes |= c), (dl |= c), (o = 4));
                  break e;
                }
                ((c = us),
                  (us = o),
                  c !== null &&
                    (us === null ? (us = c) : us.push.apply(us, c)));
              }
              o = m;
            }
            if (((c = !1), o !== 2)) continue;
          }
        }
        if (o === 1) {
          (Yl(t, 0), _i(t, a, 0, !0));
          break;
        }
        e: {
          switch (((l = t), (c = o), c)) {
            case 0:
            case 1:
              throw Error(b(345));
            case 4:
              if ((a & 4194048) !== a) break;
            case 6:
              _i(l, a, js, !vi);
              break e;
            case 2:
              us = null;
              break;
            case 3:
            case 5:
              break;
            default:
              throw Error(b(329));
          }
          if ((a & 62914560) === a && ((o = Uo + 300 - E()), 10 < o)) {
            if ((_i(l, a, js, !vi), Ya(l, 0, !0) !== 0)) break e;
            ((Vn = a),
              (l.timeoutHandle = Dm(
                im.bind(
                  null,
                  l,
                  n,
                  us,
                  Go,
                  _d,
                  a,
                  js,
                  dl,
                  ql,
                  vi,
                  c,
                  "Throttled",
                  -0,
                  0,
                ),
                o,
              )));
            break e;
          }
          im(l, n, us, Go, _d, a, js, dl, ql, vi, c, null, -0, 0);
        }
      }
      break;
    } while (!0);
    yn(t);
  }
  function im(t, a, n, l, o, c, m, x, N, R, Q, ne, U, q) {
    if (
      ((t.timeoutHandle = -1),
      (ne = a.subtreeFlags),
      ne & 8192 || (ne & 16785408) === 16785408)
    ) {
      ((ne = {
        stylesheets: null,
        count: 0,
        imgCount: 0,
        imgBytes: 0,
        suspenseyImages: [],
        waitingForImages: !0,
        waitingForViewTransition: !1,
        unsuspend: Ha,
      }),
        Qh(a, c, ne));
      var ke =
        (c & 62914560) === c ? Uo - E() : (c & 4194048) === c ? tm - E() : 0;
      if (((ke = Zx(ne, ke)), ke !== null)) {
        ((Vn = c),
          (t.cancelPendingCommit = ke(
            mm.bind(null, t, a, c, n, l, o, m, x, N, Q, ne, null, U, q),
          )),
          _i(t, c, m, !R));
        return;
      }
    }
    mm(t, a, c, n, l, o, m, x, N);
  }
  function lx(t) {
    for (var a = t; ; ) {
      var n = a.tag;
      if (
        (n === 0 || n === 11 || n === 15) &&
        a.flags & 16384 &&
        ((n = a.updateQueue), n !== null && ((n = n.stores), n !== null))
      )
        for (var l = 0; l < n.length; l++) {
          var o = n[l],
            c = o.getSnapshot;
          o = o.value;
          try {
            if (!Sa(c(), o)) return !1;
          } catch {
            return !1;
          }
        }
      if (((n = a.child), a.subtreeFlags & 16384 && n !== null))
        ((n.return = a), (a = n));
      else {
        if (a === t) break;
        for (; a.sibling === null; ) {
          if (a.return === null || a.return === t) return !0;
          a = a.return;
        }
        ((a.sibling.return = a.return), (a = a.sibling));
      }
    }
    return !0;
  }
  function _i(t, a, n, l) {
    ((a &= ~Nd),
      (a &= ~dl),
      (t.suspendedLanes |= a),
      (t.pingedLanes &= ~a),
      l && (t.warmLanes |= a),
      (l = t.expirationTimes));
    for (var o = a; 0 < o; ) {
      var c = 31 - Zt(o),
        m = 1 << c;
      ((l[c] = -1), (o &= ~m));
    }
    n !== 0 && sn(t, n, a);
  }
  function Ko() {
    return (kt & 6) === 0 ? (Br(0), !1) : !0;
  }
  function Td() {
    if (ut !== null) {
      if (Lt === 0) var t = ut.return;
      else ((t = ut), (Ws = bn = null), Kc(t), (zl = null), (yr = 0), (t = ut));
      for (; t !== null; ) (Rh(t.alternate, t), (t = t.return));
      ut = null;
    }
  }
  function Yl(t, a) {
    var n = t.timeoutHandle;
    (n !== -1 && ((t.timeoutHandle = -1), Sx(n)),
      (n = t.cancelPendingCommit),
      n !== null && ((t.cancelPendingCommit = null), n()),
      (Vn = 0),
      Td(),
      (Gt = t),
      (ut = n = Ds(t.current, null)),
      (ft = a),
      (Lt = 0),
      (ys = null),
      (vi = !1),
      (Zl = Xa(t, a)),
      (jd = !1),
      (ql = js = Nd = dl = yi = ia = 0),
      (us = Rr = null),
      (_d = !1),
      (a & 8) !== 0 && (a |= a & 32));
    var l = t.entangledLanes;
    if (l !== 0)
      for (t = t.entanglements, l &= a; 0 < l; ) {
        var o = 31 - Zt(l),
          c = 1 << o;
        ((a |= t[o]), (l &= ~c));
      }
    return ((qn = a), Qi(), n);
  }
  function lm(t, a) {
    ((tt = null),
      (y.H = Cr),
      a === Rl || a === bo
        ? ((a = Nu()), (Lt = 3))
        : a === Pc
          ? ((a = Nu()), (Lt = 4))
          : (Lt =
              a === id
                ? 8
                : a !== null &&
                    typeof a == "object" &&
                    typeof a.then == "function"
                  ? 6
                  : 1),
      (ys = a),
      ut === null && ((ia = 1), Lo(t, i(a, t.current))));
  }
  function rm() {
    var t = bs.current;
    return t === null
      ? !0
      : (ft & 4194048) === ft
        ? Rs === null
        : (ft & 62914560) === ft || (ft & 536870912) !== 0
          ? t === Rs
          : !1;
  }
  function om() {
    var t = y.H;
    return ((y.H = Cr), t === null ? Cr : t);
  }
  function cm() {
    var t = y.A;
    return ((y.A = nx), t);
  }
  function Zo() {
    ((ia = 4),
      vi || ((ft & 4194048) !== ft && bs.current !== null) || (Zl = !0),
      ((yi & 134217727) === 0 && (dl & 134217727) === 0) ||
        Gt === null ||
        _i(Gt, ft, js, !1));
  }
  function Cd(t, a, n) {
    var l = kt;
    kt |= 2;
    var o = om(),
      c = cm();
    ((Gt !== t || ft !== a) && ((Go = null), Yl(t, a)), (a = !1));
    var m = ia;
    e: do
      try {
        if (Lt !== 0 && ut !== null) {
          var x = ut,
            N = ys;
          switch (Lt) {
            case 8:
              (Td(), (m = 6));
              break e;
            case 3:
            case 2:
            case 9:
            case 6:
              bs.current === null && (a = !0);
              var R = Lt;
              if (((Lt = 0), (ys = null), Xl(t, x, N, R), n && Zl)) {
                m = 0;
                break e;
              }
              break;
            default:
              ((R = Lt), (Lt = 0), (ys = null), Xl(t, x, N, R));
          }
        }
        (rx(), (m = ia));
        break;
      } catch (Q) {
        lm(t, Q);
      }
    while (!0);
    return (
      a && t.shellSuspendCounter++,
      (Ws = bn = null),
      (kt = l),
      (y.H = o),
      (y.A = c),
      ut === null && ((Gt = null), (ft = 0), Qi()),
      m
    );
  }
  function rx() {
    for (; ut !== null; ) dm(ut);
  }
  function ox(t, a) {
    var n = kt;
    kt |= 2;
    var l = om(),
      o = cm();
    Gt !== t || ft !== a
      ? ((Go = null), (Io = E() + 500), Yl(t, a))
      : (Zl = Xa(t, a));
    e: do
      try {
        if (Lt !== 0 && ut !== null) {
          a = ut;
          var c = ys;
          t: switch (Lt) {
            case 1:
              ((Lt = 0), (ys = null), Xl(t, a, c, 1));
              break;
            case 2:
            case 9:
              if (yu(c)) {
                ((Lt = 0), (ys = null), um(a));
                break;
              }
              ((a = function () {
                ((Lt !== 2 && Lt !== 9) || Gt !== t || (Lt = 7), yn(t));
              }),
                c.then(a, a));
              break e;
            case 3:
              Lt = 7;
              break e;
            case 4:
              Lt = 5;
              break e;
            case 7:
              yu(c)
                ? ((Lt = 0), (ys = null), um(a))
                : ((Lt = 0), (ys = null), Xl(t, a, c, 7));
              break;
            case 5:
              var m = null;
              switch (ut.tag) {
                case 26:
                  m = ut.memoizedState;
                case 5:
                case 27:
                  var x = ut;
                  if (m ? Jm(m) : x.stateNode.complete) {
                    ((Lt = 0), (ys = null));
                    var N = x.sibling;
                    if (N !== null) ut = N;
                    else {
                      var R = x.return;
                      R !== null ? ((ut = R), qo(R)) : (ut = null);
                    }
                    break t;
                  }
              }
              ((Lt = 0), (ys = null), Xl(t, a, c, 5));
              break;
            case 6:
              ((Lt = 0), (ys = null), Xl(t, a, c, 6));
              break;
            case 8:
              (Td(), (ia = 6));
              break e;
            default:
              throw Error(b(462));
          }
        }
        cx();
        break;
      } catch (Q) {
        lm(t, Q);
      }
    while (!0);
    return (
      (Ws = bn = null),
      (y.H = l),
      (y.A = o),
      (kt = n),
      ut !== null ? 0 : ((Gt = null), (ft = 0), Qi(), ia)
    );
  }
  function cx() {
    for (; ut !== null && !Ht(); ) dm(ut);
  }
  function dm(t) {
    var a = Oh(t.alternate, t, qn);
    ((t.memoizedProps = t.pendingProps), a === null ? qo(t) : (ut = a));
  }
  function um(t) {
    var a = t,
      n = a.alternate;
    switch (a.tag) {
      case 15:
      case 0:
        a = Ch(n, a, a.pendingProps, a.type, void 0, ft);
        break;
      case 11:
        a = Ch(n, a, a.pendingProps, a.type.render, a.ref, ft);
        break;
      case 5:
        Kc(a);
      default:
        (Rh(n, a), (a = ut = mr(a, qn)), (a = Oh(n, a, qn)));
    }
    ((t.memoizedProps = t.pendingProps), a === null ? qo(t) : (ut = a));
  }
  function Xl(t, a, n, l) {
    ((Ws = bn = null), Kc(a), (zl = null), (yr = 0));
    var o = a.return;
    try {
      if (Qp(t, o, a, n, ft)) {
        ((ia = 1), Lo(t, i(n, t.current)), (ut = null));
        return;
      }
    } catch (c) {
      if (o !== null) throw ((ut = o), c);
      ((ia = 1), Lo(t, i(n, t.current)), (ut = null));
      return;
    }
    a.flags & 32768
      ? (dt || l === 1
          ? (t = !0)
          : Zl || (ft & 536870912) !== 0
            ? (t = !1)
            : ((vi = t = !0),
              (l === 2 || l === 9 || l === 3 || l === 6) &&
                ((l = bs.current),
                l !== null && l.tag === 13 && (l.flags |= 16384))),
        hm(a, t))
      : qo(a);
  }
  function qo(t) {
    var a = t;
    do {
      if ((a.flags & 32768) !== 0) {
        hm(a, vi);
        return;
      }
      t = a.return;
      var n = ex(a.alternate, a, qn);
      if (n !== null) {
        ut = n;
        return;
      }
      if (((a = a.sibling), a !== null)) {
        ut = a;
        return;
      }
      ut = a = t;
    } while (a !== null);
    ia === 0 && (ia = 5);
  }
  function hm(t, a) {
    do {
      var n = tx(t.alternate, t);
      if (n !== null) {
        ((n.flags &= 32767), (ut = n));
        return;
      }
      if (
        ((n = t.return),
        n !== null &&
          ((n.flags |= 32768), (n.subtreeFlags = 0), (n.deletions = null)),
        !a && ((t = t.sibling), t !== null))
      ) {
        ut = t;
        return;
      }
      ut = t = n;
    } while (t !== null);
    ((ia = 6), (ut = null));
  }
  function mm(t, a, n, l, o, c, m, x, N) {
    t.cancelPendingCommit = null;
    do Vo();
    while (ya !== 0);
    if ((kt & 6) !== 0) throw Error(b(327));
    if (a !== null) {
      if (a === t.current) throw Error(b(177));
      if (
        ((c = a.lanes | a.childLanes),
        (c |= Al),
        $t(t, n, c, m, x, N),
        t === Gt && ((ut = Gt = null), (ft = 0)),
        (Vl = a),
        (Ni = t),
        (Vn = n),
        (wd = c),
        (kd = o),
        (am = l),
        (a.subtreeFlags & 10256) !== 0 || (a.flags & 10256) !== 0
          ? ((t.callbackNode = null),
            (t.callbackPriority = 0),
            mx(fa, function () {
              return (bm(), null);
            }))
          : ((t.callbackNode = null), (t.callbackPriority = 0)),
        (l = (a.flags & 13878) !== 0),
        (a.subtreeFlags & 13878) !== 0 || l)
      ) {
        ((l = y.T), (y.T = null), (o = K.p), (K.p = 2), (m = kt), (kt |= 4));
        try {
          ax(t, a, n);
        } finally {
          ((kt = m), (K.p = o), (y.T = l));
        }
      }
      ((ya = 1), pm(), xm(), fm());
    }
  }
  function pm() {
    if (ya === 1) {
      ya = 0;
      var t = Ni,
        a = Vl,
        n = (a.flags & 13878) !== 0;
      if ((a.subtreeFlags & 13878) !== 0 || n) {
        ((n = y.T), (y.T = null));
        var l = K.p;
        K.p = 2;
        var o = kt;
        kt |= 4;
        try {
          Xh(a, t);
          var c = Ud,
            m = Vi(t.containerInfo),
            x = c.focusedElem,
            N = c.selectionRange;
          if (
            m !== x &&
            x &&
            x.ownerDocument &&
            kl(x.ownerDocument.documentElement, x)
          ) {
            if (N !== null && un(x)) {
              var R = N.start,
                Q = N.end;
              if ((Q === void 0 && (Q = R), "selectionStart" in x))
                ((x.selectionStart = R),
                  (x.selectionEnd = Math.min(Q, x.value.length)));
              else {
                var ne = x.ownerDocument || document,
                  U = (ne && ne.defaultView) || window;
                if (U.getSelection) {
                  var q = U.getSelection(),
                    ke = x.textContent.length,
                    Ke = Math.min(N.start, ke),
                    Bt = N.end === void 0 ? Ke : Math.min(N.end, ke);
                  !q.extend && Ke > Bt && ((m = Bt), (Bt = Ke), (Ke = m));
                  var A = qi(x, Ke),
                    k = qi(x, Bt);
                  if (
                    A &&
                    k &&
                    (q.rangeCount !== 1 ||
                      q.anchorNode !== A.node ||
                      q.anchorOffset !== A.offset ||
                      q.focusNode !== k.node ||
                      q.focusOffset !== k.offset)
                  ) {
                    var D = ne.createRange();
                    (D.setStart(A.node, A.offset),
                      q.removeAllRanges(),
                      Ke > Bt
                        ? (q.addRange(D), q.extend(k.node, k.offset))
                        : (D.setEnd(k.node, k.offset), q.addRange(D)));
                  }
                }
              }
            }
            for (ne = [], q = x; (q = q.parentNode); )
              q.nodeType === 1 &&
                ne.push({ element: q, left: q.scrollLeft, top: q.scrollTop });
            for (
              typeof x.focus == "function" && x.focus(), x = 0;
              x < ne.length;
              x++
            ) {
              var W = ne[x];
              ((W.element.scrollLeft = W.left), (W.element.scrollTop = W.top));
            }
          }
          ((nc = !!Hd), (Ud = Hd = null));
        } finally {
          ((kt = o), (K.p = l), (y.T = n));
        }
      }
      ((t.current = a), (ya = 2));
    }
  }
  function xm() {
    if (ya === 2) {
      ya = 0;
      var t = Ni,
        a = Vl,
        n = (a.flags & 8772) !== 0;
      if ((a.subtreeFlags & 8772) !== 0 || n) {
        ((n = y.T), (y.T = null));
        var l = K.p;
        K.p = 2;
        var o = kt;
        kt |= 4;
        try {
          Kh(t, a.alternate, a);
        } finally {
          ((kt = o), (K.p = l), (y.T = n));
        }
      }
      ya = 3;
    }
  }
  function fm() {
    if (ya === 4 || ya === 3) {
      ((ya = 0), St());
      var t = Ni,
        a = Vl,
        n = Vn,
        l = am;
      (a.subtreeFlags & 10256) !== 0 || (a.flags & 10256) !== 0
        ? (ya = 5)
        : ((ya = 0), (Vl = Ni = null), gm(t, t.pendingLanes));
      var o = t.pendingLanes;
      if (
        (o === 0 && (ji = null),
        v(n),
        (a = a.stateNode),
        Tt && typeof Tt.onCommitFiberRoot == "function")
      )
        try {
          Tt.onCommitFiberRoot(Ft, a, void 0, (a.current.flags & 128) === 128);
        } catch {}
      if (l !== null) {
        ((a = y.T), (o = K.p), (K.p = 2), (y.T = null));
        try {
          for (var c = t.onRecoverableError, m = 0; m < l.length; m++) {
            var x = l[m];
            c(x.value, { componentStack: x.stack });
          }
        } finally {
          ((y.T = a), (K.p = o));
        }
      }
      ((Vn & 3) !== 0 && Vo(),
        yn(t),
        (o = t.pendingLanes),
        (n & 261930) !== 0 && (o & 42) !== 0
          ? t === Sd
            ? zr++
            : ((zr = 0), (Sd = t))
          : (zr = 0),
        Br(0));
    }
  }
  function gm(t, a) {
    (t.pooledCacheLanes &= a) === 0 &&
      ((a = t.pooledCache), a != null && ((t.pooledCache = null), br(a)));
  }
  function Vo() {
    return (pm(), xm(), fm(), bm());
  }
  function bm() {
    if (ya !== 5) return !1;
    var t = Ni,
      a = wd;
    wd = 0;
    var n = v(Vn),
      l = y.T,
      o = K.p;
    try {
      ((K.p = 32 > n ? 32 : n), (y.T = null), (n = kd), (kd = null));
      var c = Ni,
        m = Vn;
      if (((ya = 0), (Vl = Ni = null), (Vn = 0), (kt & 6) !== 0))
        throw Error(b(331));
      var x = kt;
      if (
        ((kt |= 4),
        Fh(c.current),
        Jh(c, c.current, m, n),
        (kt = x),
        Br(0, !1),
        Tt && typeof Tt.onPostCommitFiberRoot == "function")
      )
        try {
          Tt.onPostCommitFiberRoot(Ft, c);
        } catch {}
      return !0;
    } finally {
      ((K.p = o), (y.T = l), gm(t, a));
    }
  }
  function vm(t, a, n) {
    ((a = i(n, a)),
      (a = nd(t.stateNode, a, 2)),
      (t = xi(t, a, 2)),
      t !== null && (Na(t, 2), yn(t)));
  }
  function Et(t, a, n) {
    if (t.tag === 3) vm(t, t, n);
    else
      for (; a !== null; ) {
        if (a.tag === 3) {
          vm(a, t, n);
          break;
        } else if (a.tag === 1) {
          var l = a.stateNode;
          if (
            typeof a.type.getDerivedStateFromError == "function" ||
            (typeof l.componentDidCatch == "function" &&
              (ji === null || !ji.has(l)))
          ) {
            ((t = i(n, t)),
              (n = yh(2)),
              (l = xi(a, n, 2)),
              l !== null && (jh(n, l, a, t), Na(l, 2), yn(l)));
            break;
          }
        }
        a = a.return;
      }
  }
  function Ad(t, a, n) {
    var l = t.pingCache;
    if (l === null) {
      l = t.pingCache = new ix();
      var o = new Set();
      l.set(a, o);
    } else ((o = l.get(a)), o === void 0 && ((o = new Set()), l.set(a, o)));
    o.has(n) ||
      ((jd = !0), o.add(n), (t = dx.bind(null, t, a, n)), a.then(t, t));
  }
  function dx(t, a, n) {
    var l = t.pingCache;
    (l !== null && l.delete(a),
      (t.pingedLanes |= t.suspendedLanes & n),
      (t.warmLanes &= ~n),
      Gt === t &&
        (ft & n) === n &&
        (ia === 4 || (ia === 3 && (ft & 62914560) === ft && 300 > E() - Uo)
          ? (kt & 2) === 0 && Yl(t, 0)
          : (Nd |= n),
        ql === ft && (ql = 0)),
      yn(t));
  }
  function ym(t, a) {
    (a === 0 && (a = ws()), (t = Os(t, a)), t !== null && (Na(t, a), yn(t)));
  }
  function ux(t) {
    var a = t.memoizedState,
      n = 0;
    (a !== null && (n = a.retryLane), ym(t, n));
  }
  function hx(t, a) {
    var n = 0;
    switch (t.tag) {
      case 31:
      case 13:
        var l = t.stateNode,
          o = t.memoizedState;
        o !== null && (n = o.retryLane);
        break;
      case 19:
        l = t.stateNode;
        break;
      case 22:
        l = t.stateNode._retryCache;
        break;
      default:
        throw Error(b(314));
    }
    (l !== null && l.delete(a), ym(t, n));
  }
  function mx(t, a) {
    return Ze(t, a);
  }
  var Yo = null,
    $l = null,
    Md = !1,
    Xo = !1,
    Pd = !1,
    wi = 0;
  function yn(t) {
    (t !== $l &&
      t.next === null &&
      ($l === null ? (Yo = $l = t) : ($l = $l.next = t)),
      (Xo = !0),
      Md || ((Md = !0), xx()));
  }
  function Br(t, a) {
    if (!Pd && Xo) {
      Pd = !0;
      do
        for (var n = !1, l = Yo; l !== null; ) {
          if (t !== 0) {
            var o = l.pendingLanes;
            if (o === 0) var c = 0;
            else {
              var m = l.suspendedLanes,
                x = l.pingedLanes;
              ((c = (1 << (31 - Zt(42 | t) + 1)) - 1),
                (c &= o & ~(m & ~x)),
                (c = c & 201326741 ? (c & 201326741) | 1 : c ? c | 2 : 0));
            }
            c !== 0 && ((n = !0), wm(l, c));
          } else
            ((c = ft),
              (c = Ya(
                l,
                l === Gt ? c : 0,
                l.cancelPendingCommit !== null || l.timeoutHandle !== -1,
              )),
              (c & 3) === 0 || Xa(l, c) || ((n = !0), wm(l, c)));
          l = l.next;
        }
      while (n);
      Pd = !1;
    }
  }
  function px() {
    jm();
  }
  function jm() {
    Xo = Md = !1;
    var t = 0;
    wi !== 0 && kx() && (t = wi);
    for (var a = E(), n = null, l = Yo; l !== null; ) {
      var o = l.next,
        c = Nm(l, a);
      (c === 0
        ? ((l.next = null),
          n === null ? (Yo = o) : (n.next = o),
          o === null && ($l = n))
        : ((n = l), (t !== 0 || (c & 3) !== 0) && (Xo = !0)),
        (l = o));
    }
    ((ya !== 0 && ya !== 5) || Br(t), wi !== 0 && (wi = 0));
  }
  function Nm(t, a) {
    for (
      var n = t.suspendedLanes,
        l = t.pingedLanes,
        o = t.expirationTimes,
        c = t.pendingLanes & -62914561;
      0 < c;
    ) {
      var m = 31 - Zt(c),
        x = 1 << m,
        N = o[m];
      (N === -1
        ? ((x & n) === 0 || (x & l) !== 0) && (o[m] = an(x, a))
        : N <= a && (t.expiredLanes |= x),
        (c &= ~x));
    }
    if (
      ((a = Gt),
      (n = ft),
      (n = Ya(
        t,
        t === a ? n : 0,
        t.cancelPendingCommit !== null || t.timeoutHandle !== -1,
      )),
      (l = t.callbackNode),
      n === 0 ||
        (t === a && (Lt === 2 || Lt === 9)) ||
        t.cancelPendingCommit !== null)
    )
      return (
        l !== null && l !== null && Xe(l),
        (t.callbackNode = null),
        (t.callbackPriority = 0)
      );
    if ((n & 3) === 0 || Xa(t, n)) {
      if (((a = n & -n), a === t.callbackPriority)) return a;
      switch ((l !== null && Xe(l), v(n))) {
        case 2:
        case 8:
          n = Fe;
          break;
        case 32:
          n = fa;
          break;
        case 268435456:
          n = ps;
          break;
        default:
          n = fa;
      }
      return (
        (l = _m.bind(null, t)),
        (n = Ze(n, l)),
        (t.callbackPriority = a),
        (t.callbackNode = n),
        a
      );
    }
    return (
      l !== null && l !== null && Xe(l),
      (t.callbackPriority = 2),
      (t.callbackNode = null),
      2
    );
  }
  function _m(t, a) {
    if (ya !== 0 && ya !== 5)
      return ((t.callbackNode = null), (t.callbackPriority = 0), null);
    var n = t.callbackNode;
    if (Vo() && t.callbackNode !== n) return null;
    var l = ft;
    return (
      (l = Ya(
        t,
        t === Gt ? l : 0,
        t.cancelPendingCommit !== null || t.timeoutHandle !== -1,
      )),
      l === 0
        ? null
        : (nm(t, l, a),
          Nm(t, E()),
          t.callbackNode != null && t.callbackNode === n
            ? _m.bind(null, t)
            : null)
    );
  }
  function wm(t, a) {
    if (Vo()) return null;
    nm(t, a, !0);
  }
  function xx() {
    Tx(function () {
      (kt & 6) !== 0 ? Ze(qe, px) : jm();
    });
  }
  function Ld() {
    if (wi === 0) {
      var t = Ol;
      (t === 0 && ((t = xe), (xe <<= 1), (xe & 261888) === 0 && (xe = 256)),
        (wi = t));
    }
    return wi;
  }
  function km(t) {
    return t == null || typeof t == "symbol" || typeof t == "boolean"
      ? null
      : typeof t == "function"
        ? t
        : Gs("" + t);
  }
  function Sm(t, a) {
    var n = a.ownerDocument.createElement("input");
    return (
      (n.name = a.name),
      (n.value = a.value),
      t.id && n.setAttribute("form", t.id),
      a.parentNode.insertBefore(n, a),
      (t = new FormData(t)),
      n.parentNode.removeChild(n),
      t
    );
  }
  function fx(t, a, n, l, o) {
    if (a === "submit" && n && n.stateNode === o) {
      var c = km((o[Ve] || null).action),
        m = l.submitter;
      m &&
        ((a = (a = m[Ve] || null)
          ? km(a.formAction)
          : m.getAttribute("formAction")),
        a !== null && ((c = a), (m = null)));
      var x = new ei("action", "action", null, l, o);
      t.push({
        event: x,
        listeners: [
          {
            instance: null,
            listener: function () {
              if (l.defaultPrevented) {
                if (wi !== 0) {
                  var N = m ? Sm(o, m) : new FormData(o);
                  Wc(
                    n,
                    { pending: !0, data: N, method: o.method, action: c },
                    null,
                    N,
                  );
                }
              } else
                typeof c == "function" &&
                  (x.preventDefault(),
                  (N = m ? Sm(o, m) : new FormData(o)),
                  Wc(
                    n,
                    { pending: !0, data: N, method: o.method, action: c },
                    c,
                    N,
                  ));
            },
            currentTarget: o,
          },
        ],
      });
    }
  }
  for (var Ed = 0; Ed < pn.length; Ed++) {
    var Od = pn[Ed],
      gx = Od.toLowerCase(),
      bx = Od[0].toUpperCase() + Od.slice(1);
    is(gx, "on" + bx);
  }
  (is(Xi, "onAnimationEnd"),
    is(ho, "onAnimationIteration"),
    is($i, "onAnimationStart"),
    is("dblclick", "onDoubleClick"),
    is("focusin", "onFocus"),
    is("focusout", "onBlur"),
    is(_c, "onTransitionRun"),
    is(mo, "onTransitionStart"),
    is(wc, "onTransitionCancel"),
    is(di, "onTransitionEnd"),
    wa("onMouseEnter", ["mouseout", "mouseover"]),
    wa("onMouseLeave", ["mouseout", "mouseover"]),
    wa("onPointerEnter", ["pointerout", "pointerover"]),
    wa("onPointerLeave", ["pointerout", "pointerover"]),
    aa(
      "onChange",
      "change click focusin focusout input keydown keyup selectionchange".split(
        " ",
      ),
    ),
    aa(
      "onSelect",
      "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
        " ",
      ),
    ),
    aa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]),
    aa(
      "onCompositionEnd",
      "compositionend focusout keydown keypress keyup mousedown".split(" "),
    ),
    aa(
      "onCompositionStart",
      "compositionstart focusout keydown keypress keyup mousedown".split(" "),
    ),
    aa(
      "onCompositionUpdate",
      "compositionupdate focusout keydown keypress keyup mousedown".split(" "),
    ));
  var Hr =
      "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(
        " ",
      ),
    vx = new Set(
      "beforetoggle cancel close invalid load scroll scrollend toggle"
        .split(" ")
        .concat(Hr),
    );
  function Tm(t, a) {
    a = (a & 4) !== 0;
    for (var n = 0; n < t.length; n++) {
      var l = t[n],
        o = l.event;
      l = l.listeners;
      e: {
        var c = void 0;
        if (a)
          for (var m = l.length - 1; 0 <= m; m--) {
            var x = l[m],
              N = x.instance,
              R = x.currentTarget;
            if (((x = x.listener), N !== c && o.isPropagationStopped()))
              break e;
            ((c = x), (o.currentTarget = R));
            try {
              c(o);
            } catch (Q) {
              Ji(Q);
            }
            ((o.currentTarget = null), (c = N));
          }
        else
          for (m = 0; m < l.length; m++) {
            if (
              ((x = l[m]),
              (N = x.instance),
              (R = x.currentTarget),
              (x = x.listener),
              N !== c && o.isPropagationStopped())
            )
              break e;
            ((c = x), (o.currentTarget = R));
            try {
              c(o);
            } catch (Q) {
              Ji(Q);
            }
            ((o.currentTarget = null), (c = N));
          }
      }
    }
  }
  function ht(t, a) {
    var n = a[We];
    n === void 0 && (n = a[We] = new Set());
    var l = t + "__bubble";
    n.has(l) || (Cm(a, t, 2, !1), n.add(l));
  }
  function Dd(t, a, n) {
    var l = 0;
    (a && (l |= 4), Cm(n, t, l, a));
  }
  var $o = "_reactListening" + Math.random().toString(36).slice(2);
  function Rd(t) {
    if (!t[$o]) {
      ((t[$o] = !0),
        Ma.forEach(function (n) {
          n !== "selectionchange" && (vx.has(n) || Dd(n, !1, t), Dd(n, !0, t));
        }));
      var a = t.nodeType === 9 ? t : t.ownerDocument;
      a === null || a[$o] || ((a[$o] = !0), Dd("selectionchange", !1, a));
    }
  }
  function Cm(t, a, n, l) {
    switch (sp(a)) {
      case 2:
        var o = Yx;
        break;
      case 8:
        o = Xx;
        break;
      default:
        o = Qd;
    }
    ((n = o.bind(null, a, n, t)),
      (o = void 0),
      !An ||
        (a !== "touchstart" && a !== "touchmove" && a !== "wheel") ||
        (o = !0),
      l
        ? o !== void 0
          ? t.addEventListener(a, n, { capture: !0, passive: o })
          : t.addEventListener(a, n, !0)
        : o !== void 0
          ? t.addEventListener(a, n, { passive: o })
          : t.addEventListener(a, n, !1));
  }
  function zd(t, a, n, l, o) {
    var c = l;
    if ((a & 1) === 0 && (a & 2) === 0 && l !== null)
      e: for (;;) {
        if (l === null) return;
        var m = l.tag;
        if (m === 3 || m === 4) {
          var x = l.stateNode.containerInfo;
          if (x === o) break;
          if (m === 4)
            for (m = l.return; m !== null; ) {
              var N = m.tag;
              if ((N === 3 || N === 4) && m.stateNode.containerInfo === o)
                return;
              m = m.return;
            }
          for (; x !== null; ) {
            if (((m = It(x)), m === null)) return;
            if (((N = m.tag), N === 5 || N === 6 || N === 26 || N === 27)) {
              l = c = m;
              continue e;
            }
            x = x.parentNode;
          }
        }
        l = l.return;
      }
    hl(function () {
      var R = c,
        Q = Cn(n),
        ne = [];
      e: {
        var U = po.get(t);
        if (U !== void 0) {
          var q = ei,
            ke = t;
          switch (t) {
            case "keypress":
              if (Zs(n) === 0) break e;
            case "keydown":
            case "keyup":
              q = vl;
              break;
            case "focusin":
              ((ke = "focus"), (q = Di));
              break;
            case "focusout":
              ((ke = "blur"), (q = Di));
              break;
            case "beforeblur":
            case "afterblur":
              q = Di;
              break;
            case "click":
              if (n.button === 2) break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              q = pl;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              q = lr;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              q = ur;
              break;
            case Xi:
            case ho:
            case $i:
              q = Ri;
              break;
            case di:
              q = jl;
              break;
            case "scroll":
            case "scrollend":
              q = et;
              break;
            case "wheel":
              q = _;
              break;
            case "copy":
            case "cut":
            case "paste":
              q = ns;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              q = yl;
              break;
            case "toggle":
            case "beforetoggle":
              q = ct;
          }
          var Ke = (a & 4) !== 0,
            Bt = !Ke && (t === "scroll" || t === "scrollend"),
            A = Ke ? (U !== null ? U + "Capture" : null) : U;
          Ke = [];
          for (var k = R, D; k !== null; ) {
            var W = k;
            if (
              ((D = W.stateNode),
              (W = W.tag),
              (W !== 5 && W !== 26 && W !== 27) ||
                D === null ||
                A === null ||
                ((W = on(k, A)), W != null && Ke.push(Ur(k, W, D))),
              Bt)
            )
              break;
            k = k.return;
          }
          0 < Ke.length &&
            ((U = new q(U, ke, null, n, Q)),
            ne.push({ event: U, listeners: Ke }));
        }
      }
      if ((a & 7) === 0) {
        e: {
          if (
            ((U = t === "mouseover" || t === "pointerover"),
            (q = t === "mouseout" || t === "pointerout"),
            U &&
              n !== Tn &&
              (ke = n.relatedTarget || n.fromElement) &&
              (It(ke) || ke[rt]))
          )
            break e;
          if (
            (q || U) &&
            ((U =
              Q.window === Q
                ? Q
                : (U = Q.ownerDocument)
                  ? U.defaultView || U.parentWindow
                  : window),
            q
              ? ((ke = n.relatedTarget || n.toElement),
                (q = R),
                (ke = ke ? It(ke) : null),
                ke !== null &&
                  ((Bt = ue(ke)),
                  (Ke = ke.tag),
                  ke !== Bt || (Ke !== 5 && Ke !== 27 && Ke !== 6)) &&
                  (ke = null))
              : ((q = null), (ke = R)),
            q !== ke)
          ) {
            if (
              ((Ke = pl),
              (W = "onMouseLeave"),
              (A = "onMouseEnter"),
              (k = "mouse"),
              (t === "pointerout" || t === "pointerover") &&
                ((Ke = yl),
                (W = "onPointerLeave"),
                (A = "onPointerEnter"),
                (k = "pointer")),
              (Bt = q == null ? U : qt(q)),
              (D = ke == null ? U : qt(ke)),
              (U = new Ke(W, k + "leave", q, n, Q)),
              (U.target = Bt),
              (U.relatedTarget = D),
              (W = null),
              It(Q) === R &&
                ((Ke = new Ke(A, k + "enter", ke, n, Q)),
                (Ke.target = D),
                (Ke.relatedTarget = Bt),
                (W = Ke)),
              (Bt = W),
              q && ke)
            )
              t: {
                for (Ke = yx, A = q, k = ke, D = 0, W = A; W; W = Ke(W)) D++;
                W = 0;
                for (var He = k; He; He = Ke(He)) W++;
                for (; 0 < D - W; ) ((A = Ke(A)), D--);
                for (; 0 < W - D; ) ((k = Ke(k)), W--);
                for (; D--; ) {
                  if (A === k || (k !== null && A === k.alternate)) {
                    Ke = A;
                    break t;
                  }
                  ((A = Ke(A)), (k = Ke(k)));
                }
                Ke = null;
              }
            else Ke = null;
            (q !== null && Am(ne, U, q, Ke, !1),
              ke !== null && Bt !== null && Am(ne, Bt, ke, Ke, !0));
          }
        }
        e: {
          if (
            ((U = R ? qt(R) : window),
            (q = U.nodeName && U.nodeName.toLowerCase()),
            q === "select" || (q === "input" && U.type === "file"))
          )
            var _t = Zi;
          else if (Ps(U))
            if (lo) _t = Nc;
            else {
              _t = jc;
              var Le = $s;
            }
          else
            ((q = U.nodeName),
              !q ||
              q.toLowerCase() !== "input" ||
              (U.type !== "checkbox" && U.type !== "radio")
                ? R && kn(R.elementType) && (_t = Zi)
                : (_t = li));
          if (_t && (_t = _t(t, R))) {
            io(ne, _t, n, Q);
            break e;
          }
          (Le && Le(t, U, R),
            t === "focusout" &&
              R &&
              U.type === "number" &&
              R.memoizedProps.value != null &&
              $a(U, "number", U.value));
        }
        switch (((Le = R ? qt(R) : window), t)) {
          case "focusin":
            (Ps(Le) || Le.contentEditable === "true") &&
              ((hn = Le), (Tl = R), (Yi = null));
            break;
          case "focusout":
            Yi = Tl = hn = null;
            break;
          case "mousedown":
            oi = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            ((oi = !1), co(ne, n, Q));
            break;
          case "selectionchange":
            if (Sl) break;
          case "keydown":
          case "keyup":
            co(ne, n, Q);
        }
        var lt;
        if (Ln)
          e: {
            switch (t) {
              case "compositionstart":
                var gt = "onCompositionStart";
                break e;
              case "compositionend":
                gt = "onCompositionEnd";
                break e;
              case "compositionupdate":
                gt = "onCompositionUpdate";
                break e;
            }
            gt = void 0;
          }
        else
          si
            ? dn(t, n) && (gt = "onCompositionEnd")
            : t === "keydown" &&
              n.keyCode === 229 &&
              (gt = "onCompositionStart");
        (gt &&
          (Qa &&
            n.locale !== "ko" &&
            (si || gt !== "onCompositionStart"
              ? gt === "onCompositionEnd" && si && (lt = Ja())
              : ((ss = Q),
                (As = "value" in ss ? ss.value : ss.textContent),
                (si = !0))),
          (Le = Jo(R, gt)),
          0 < Le.length &&
            ((gt = new zi(gt, t, null, n, Q)),
            ne.push({ event: gt, listeners: Le }),
            lt
              ? (gt.data = lt)
              : ((lt = Xs(n)), lt !== null && (gt.data = lt)))),
          (lt = Ui ? gs(t, n) : ni(t, n)) &&
            ((gt = Jo(R, "onBeforeInput")),
            0 < gt.length &&
              ((Le = new zi("onBeforeInput", "beforeinput", null, n, Q)),
              ne.push({ event: Le, listeners: gt }),
              (Le.data = lt))),
          fx(ne, t, R, n, Q));
      }
      Tm(ne, a);
    });
  }
  function Ur(t, a, n) {
    return { instance: t, listener: a, currentTarget: n };
  }
  function Jo(t, a) {
    for (var n = a + "Capture", l = []; t !== null; ) {
      var o = t,
        c = o.stateNode;
      if (
        ((o = o.tag),
        (o !== 5 && o !== 26 && o !== 27) ||
          c === null ||
          ((o = on(t, n)),
          o != null && l.unshift(Ur(t, o, c)),
          (o = on(t, a)),
          o != null && l.push(Ur(t, o, c))),
        t.tag === 3)
      )
        return l;
      t = t.return;
    }
    return [];
  }
  function yx(t) {
    if (t === null) return null;
    do t = t.return;
    while (t && t.tag !== 5 && t.tag !== 27);
    return t || null;
  }
  function Am(t, a, n, l, o) {
    for (var c = a._reactName, m = []; n !== null && n !== l; ) {
      var x = n,
        N = x.alternate,
        R = x.stateNode;
      if (((x = x.tag), N !== null && N === l)) break;
      ((x !== 5 && x !== 26 && x !== 27) ||
        R === null ||
        ((N = R),
        o
          ? ((R = on(n, c)), R != null && m.unshift(Ur(n, R, N)))
          : o || ((R = on(n, c)), R != null && m.push(Ur(n, R, N)))),
        (n = n.return));
    }
    m.length !== 0 && t.push({ event: a, listeners: m });
  }
  var jx = /\r\n?/g,
    Nx = /\u0000|\uFFFD/g;
  function Mm(t) {
    return (typeof t == "string" ? t : "" + t)
      .replace(
        jx,
        `
`,
      )
      .replace(Nx, "");
  }
  function Pm(t, a) {
    return ((a = Mm(a)), Mm(t) === a);
  }
  function zt(t, a, n, l, o, c) {
    switch (n) {
      case "children":
        typeof l == "string"
          ? a === "body" || (a === "textarea" && l === "") || Ba(t, l)
          : (typeof l == "number" || typeof l == "bigint") &&
            a !== "body" &&
            Ba(t, "" + l);
        break;
      case "className":
        ot(t, "class", l);
        break;
      case "tabIndex":
        ot(t, "tabindex", l);
        break;
      case "dir":
      case "role":
      case "viewBox":
      case "width":
      case "height":
        ot(t, n, l);
        break;
      case "style":
        wn(t, l, c);
        break;
      case "data":
        if (a !== "object") {
          ot(t, "data", l);
          break;
        }
      case "src":
      case "href":
        if (l === "" && (a !== "a" || n !== "href")) {
          t.removeAttribute(n);
          break;
        }
        if (
          l == null ||
          typeof l == "function" ||
          typeof l == "symbol" ||
          typeof l == "boolean"
        ) {
          t.removeAttribute(n);
          break;
        }
        ((l = Gs("" + l)), t.setAttribute(n, l));
        break;
      case "action":
      case "formAction":
        if (typeof l == "function") {
          t.setAttribute(
            n,
            "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 c == "function" &&
            (n === "formAction"
              ? (a !== "input" && zt(t, a, "name", o.name, o, null),
                zt(t, a, "formEncType", o.formEncType, o, null),
                zt(t, a, "formMethod", o.formMethod, o, null),
                zt(t, a, "formTarget", o.formTarget, o, null))
              : (zt(t, a, "encType", o.encType, o, null),
                zt(t, a, "method", o.method, o, null),
                zt(t, a, "target", o.target, o, null)));
        if (l == null || typeof l == "symbol" || typeof l == "boolean") {
          t.removeAttribute(n);
          break;
        }
        ((l = Gs("" + l)), t.setAttribute(n, l));
        break;
      case "onClick":
        l != null && (t.onclick = Ha);
        break;
      case "onScroll":
        l != null && ht("scroll", t);
        break;
      case "onScrollEnd":
        l != null && ht("scrollend", t);
        break;
      case "dangerouslySetInnerHTML":
        if (l != null) {
          if (typeof l != "object" || !("__html" in l)) throw Error(b(61));
          if (((n = l.__html), n != null)) {
            if (o.children != null) throw Error(b(60));
            t.innerHTML = n;
          }
        }
        break;
      case "multiple":
        t.multiple = l && typeof l != "function" && typeof l != "symbol";
        break;
      case "muted":
        t.muted = l && typeof l != "function" && typeof l != "symbol";
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "ref":
        break;
      case "autoFocus":
        break;
      case "xlinkHref":
        if (
          l == null ||
          typeof l == "function" ||
          typeof l == "boolean" ||
          typeof l == "symbol"
        ) {
          t.removeAttribute("xlink:href");
          break;
        }
        ((n = Gs("" + l)),
          t.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", n));
        break;
      case "contentEditable":
      case "spellCheck":
      case "draggable":
      case "value":
      case "autoReverse":
      case "externalResourcesRequired":
      case "focusable":
      case "preserveAlpha":
        l != null && typeof l != "function" && typeof l != "symbol"
          ? t.setAttribute(n, "" + l)
          : t.removeAttribute(n);
        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":
        l && typeof l != "function" && typeof l != "symbol"
          ? t.setAttribute(n, "")
          : t.removeAttribute(n);
        break;
      case "capture":
      case "download":
        l === !0
          ? t.setAttribute(n, "")
          : l !== !1 &&
              l != null &&
              typeof l != "function" &&
              typeof l != "symbol"
            ? t.setAttribute(n, l)
            : t.removeAttribute(n);
        break;
      case "cols":
      case "rows":
      case "size":
      case "span":
        l != null &&
        typeof l != "function" &&
        typeof l != "symbol" &&
        !isNaN(l) &&
        1 <= l
          ? t.setAttribute(n, l)
          : t.removeAttribute(n);
        break;
      case "rowSpan":
      case "start":
        l == null || typeof l == "function" || typeof l == "symbol" || isNaN(l)
          ? t.removeAttribute(n)
          : t.setAttribute(n, l);
        break;
      case "popover":
        (ht("beforetoggle", t), ht("toggle", t), Be(t, "popover", l));
        break;
      case "xlinkActuate":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:actuate", l);
        break;
      case "xlinkArcrole":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:arcrole", l);
        break;
      case "xlinkRole":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:role", l);
        break;
      case "xlinkShow":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:show", l);
        break;
      case "xlinkTitle":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:title", l);
        break;
      case "xlinkType":
        yt(t, "http://www.w3.org/1999/xlink", "xlink:type", l);
        break;
      case "xmlBase":
        yt(t, "http://www.w3.org/XML/1998/namespace", "xml:base", l);
        break;
      case "xmlLang":
        yt(t, "http://www.w3.org/XML/1998/namespace", "xml:lang", l);
        break;
      case "xmlSpace":
        yt(t, "http://www.w3.org/XML/1998/namespace", "xml:space", l);
        break;
      case "is":
        Be(t, "is", l);
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        (!(2 < n.length) ||
          (n[0] !== "o" && n[0] !== "O") ||
          (n[1] !== "n" && n[1] !== "N")) &&
          ((n = Sn.get(n) || n), Be(t, n, l));
    }
  }
  function Bd(t, a, n, l, o, c) {
    switch (n) {
      case "style":
        wn(t, l, c);
        break;
      case "dangerouslySetInnerHTML":
        if (l != null) {
          if (typeof l != "object" || !("__html" in l)) throw Error(b(61));
          if (((n = l.__html), n != null)) {
            if (o.children != null) throw Error(b(60));
            t.innerHTML = n;
          }
        }
        break;
      case "children":
        typeof l == "string"
          ? Ba(t, l)
          : (typeof l == "number" || typeof l == "bigint") && Ba(t, "" + l);
        break;
      case "onScroll":
        l != null && ht("scroll", t);
        break;
      case "onScrollEnd":
        l != null && ht("scrollend", t);
        break;
      case "onClick":
        l != null && (t.onclick = Ha);
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "innerHTML":
      case "ref":
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        if (!Ts.hasOwnProperty(n))
          e: {
            if (
              n[0] === "o" &&
              n[1] === "n" &&
              ((o = n.endsWith("Capture")),
              (a = n.slice(2, o ? n.length - 7 : void 0)),
              (c = t[Ve] || null),
              (c = c != null ? c[n] : null),
              typeof c == "function" && t.removeEventListener(a, c, o),
              typeof l == "function")
            ) {
              (typeof c != "function" &&
                c !== null &&
                (n in t
                  ? (t[n] = null)
                  : t.hasAttribute(n) && t.removeAttribute(n)),
                t.addEventListener(a, l, o));
              break e;
            }
            n in t
              ? (t[n] = l)
              : l === !0
                ? t.setAttribute(n, "")
                : Be(t, n, l);
          }
    }
  }
  function Da(t, a, n) {
    switch (a) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "img":
        (ht("error", t), ht("load", t));
        var l = !1,
          o = !1,
          c;
        for (c in n)
          if (n.hasOwnProperty(c)) {
            var m = n[c];
            if (m != null)
              switch (c) {
                case "src":
                  l = !0;
                  break;
                case "srcSet":
                  o = !0;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(b(137, a));
                default:
                  zt(t, a, c, m, n, null);
              }
          }
        (o && zt(t, a, "srcSet", n.srcSet, n, null),
          l && zt(t, a, "src", n.src, n, null));
        return;
      case "input":
        ht("invalid", t);
        var x = (c = m = o = null),
          N = null,
          R = null;
        for (l in n)
          if (n.hasOwnProperty(l)) {
            var Q = n[l];
            if (Q != null)
              switch (l) {
                case "name":
                  o = Q;
                  break;
                case "type":
                  m = Q;
                  break;
                case "checked":
                  N = Q;
                  break;
                case "defaultChecked":
                  R = Q;
                  break;
                case "value":
                  c = Q;
                  break;
                case "defaultValue":
                  x = Q;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (Q != null) throw Error(b(137, a));
                  break;
                default:
                  zt(t, a, l, Q, n, null);
              }
          }
        ln(t, c, x, N, R, m, o, !1);
        return;
      case "select":
        (ht("invalid", t), (l = m = c = null));
        for (o in n)
          if (n.hasOwnProperty(o) && ((x = n[o]), x != null))
            switch (o) {
              case "value":
                c = x;
                break;
              case "defaultValue":
                m = x;
                break;
              case "multiple":
                l = x;
              default:
                zt(t, a, o, x, n, null);
            }
        ((a = c),
          (n = m),
          (t.multiple = !!l),
          a != null ? At(t, !!l, a, !1) : n != null && At(t, !!l, n, !0));
        return;
      case "textarea":
        (ht("invalid", t), (c = o = l = null));
        for (m in n)
          if (n.hasOwnProperty(m) && ((x = n[m]), x != null))
            switch (m) {
              case "value":
                l = x;
                break;
              case "defaultValue":
                o = x;
                break;
              case "children":
                c = x;
                break;
              case "dangerouslySetInnerHTML":
                if (x != null) throw Error(b(91));
                break;
              default:
                zt(t, a, m, x, n, null);
            }
        Is(t, l, o, c);
        return;
      case "option":
        for (N in n)
          if (n.hasOwnProperty(N) && ((l = n[N]), l != null))
            switch (N) {
              case "selected":
                t.selected =
                  l && typeof l != "function" && typeof l != "symbol";
                break;
              default:
                zt(t, a, N, l, n, null);
            }
        return;
      case "dialog":
        (ht("beforetoggle", t),
          ht("toggle", t),
          ht("cancel", t),
          ht("close", t));
        break;
      case "iframe":
      case "object":
        ht("load", t);
        break;
      case "video":
      case "audio":
        for (l = 0; l < Hr.length; l++) ht(Hr[l], t);
        break;
      case "image":
        (ht("error", t), ht("load", t));
        break;
      case "details":
        ht("toggle", t);
        break;
      case "embed":
      case "source":
      case "link":
        (ht("error", t), ht("load", t));
      case "area":
      case "base":
      case "br":
      case "col":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "track":
      case "wbr":
      case "menuitem":
        for (R in n)
          if (n.hasOwnProperty(R) && ((l = n[R]), l != null))
            switch (R) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(b(137, a));
              default:
                zt(t, a, R, l, n, null);
            }
        return;
      default:
        if (kn(a)) {
          for (Q in n)
            n.hasOwnProperty(Q) &&
              ((l = n[Q]), l !== void 0 && Bd(t, a, Q, l, n, void 0));
          return;
        }
    }
    for (x in n)
      n.hasOwnProperty(x) && ((l = n[x]), l != null && zt(t, a, x, l, n, null));
  }
  function _x(t, a, n, l) {
    switch (a) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "input":
        var o = null,
          c = null,
          m = null,
          x = null,
          N = null,
          R = null,
          Q = null;
        for (q in n) {
          var ne = n[q];
          if (n.hasOwnProperty(q) && ne != null)
            switch (q) {
              case "checked":
                break;
              case "value":
                break;
              case "defaultValue":
                N = ne;
              default:
                l.hasOwnProperty(q) || zt(t, a, q, null, l, ne);
            }
        }
        for (var U in l) {
          var q = l[U];
          if (((ne = n[U]), l.hasOwnProperty(U) && (q != null || ne != null)))
            switch (U) {
              case "type":
                c = q;
                break;
              case "name":
                o = q;
                break;
              case "checked":
                R = q;
                break;
              case "defaultChecked":
                Q = q;
                break;
              case "value":
                m = q;
                break;
              case "defaultValue":
                x = q;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                if (q != null) throw Error(b(137, a));
                break;
              default:
                q !== ne && zt(t, a, U, q, l, ne);
            }
        }
        Li(t, m, x, N, R, Q, c, o);
        return;
      case "select":
        q = m = x = U = null;
        for (c in n)
          if (((N = n[c]), n.hasOwnProperty(c) && N != null))
            switch (c) {
              case "value":
                break;
              case "multiple":
                q = N;
              default:
                l.hasOwnProperty(c) || zt(t, a, c, null, l, N);
            }
        for (o in l)
          if (
            ((c = l[o]),
            (N = n[o]),
            l.hasOwnProperty(o) && (c != null || N != null))
          )
            switch (o) {
              case "value":
                U = c;
                break;
              case "defaultValue":
                x = c;
                break;
              case "multiple":
                m = c;
              default:
                c !== N && zt(t, a, o, c, l, N);
            }
        ((a = x),
          (n = m),
          (l = q),
          U != null
            ? At(t, !!n, U, !1)
            : !!l != !!n &&
              (a != null ? At(t, !!n, a, !0) : At(t, !!n, n ? [] : "", !1)));
        return;
      case "textarea":
        q = U = null;
        for (x in n)
          if (
            ((o = n[x]),
            n.hasOwnProperty(x) && o != null && !l.hasOwnProperty(x))
          )
            switch (x) {
              case "value":
                break;
              case "children":
                break;
              default:
                zt(t, a, x, null, l, o);
            }
        for (m in l)
          if (
            ((o = l[m]),
            (c = n[m]),
            l.hasOwnProperty(m) && (o != null || c != null))
          )
            switch (m) {
              case "value":
                U = o;
                break;
              case "defaultValue":
                q = o;
                break;
              case "children":
                break;
              case "dangerouslySetInnerHTML":
                if (o != null) throw Error(b(91));
                break;
              default:
                o !== c && zt(t, a, m, o, l, c);
            }
        Cs(t, U, q);
        return;
      case "option":
        for (var ke in n)
          if (
            ((U = n[ke]),
            n.hasOwnProperty(ke) && U != null && !l.hasOwnProperty(ke))
          )
            switch (ke) {
              case "selected":
                t.selected = !1;
                break;
              default:
                zt(t, a, ke, null, l, U);
            }
        for (N in l)
          if (
            ((U = l[N]),
            (q = n[N]),
            l.hasOwnProperty(N) && U !== q && (U != null || q != null))
          )
            switch (N) {
              case "selected":
                t.selected =
                  U && typeof U != "function" && typeof U != "symbol";
                break;
              default:
                zt(t, a, N, U, l, q);
            }
        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 n)
          ((U = n[Ke]),
            n.hasOwnProperty(Ke) &&
              U != null &&
              !l.hasOwnProperty(Ke) &&
              zt(t, a, Ke, null, l, U));
        for (R in l)
          if (
            ((U = l[R]),
            (q = n[R]),
            l.hasOwnProperty(R) && U !== q && (U != null || q != null))
          )
            switch (R) {
              case "children":
              case "dangerouslySetInnerHTML":
                if (U != null) throw Error(b(137, a));
                break;
              default:
                zt(t, a, R, U, l, q);
            }
        return;
      default:
        if (kn(a)) {
          for (var Bt in n)
            ((U = n[Bt]),
              n.hasOwnProperty(Bt) &&
                U !== void 0 &&
                !l.hasOwnProperty(Bt) &&
                Bd(t, a, Bt, void 0, l, U));
          for (Q in l)
            ((U = l[Q]),
              (q = n[Q]),
              !l.hasOwnProperty(Q) ||
                U === q ||
                (U === void 0 && q === void 0) ||
                Bd(t, a, Q, U, l, q));
          return;
        }
    }
    for (var A in n)
      ((U = n[A]),
        n.hasOwnProperty(A) &&
          U != null &&
          !l.hasOwnProperty(A) &&
          zt(t, a, A, null, l, U));
    for (ne in l)
      ((U = l[ne]),
        (q = n[ne]),
        !l.hasOwnProperty(ne) ||
          U === q ||
          (U == null && q == null) ||
          zt(t, a, ne, U, l, q));
  }
  function Lm(t) {
    switch (t) {
      case "css":
      case "script":
      case "font":
      case "img":
      case "image":
      case "input":
      case "link":
        return !0;
      default:
        return !1;
    }
  }
  function wx() {
    if (typeof performance.getEntriesByType == "function") {
      for (
        var t = 0, a = 0, n = performance.getEntriesByType("resource"), l = 0;
        l < n.length;
        l++
      ) {
        var o = n[l],
          c = o.transferSize,
          m = o.initiatorType,
          x = o.duration;
        if (c && x && Lm(m)) {
          for (m = 0, x = o.responseEnd, l += 1; l < n.length; l++) {
            var N = n[l],
              R = N.startTime;
            if (R > x) break;
            var Q = N.transferSize,
              ne = N.initiatorType;
            Q &&
              Lm(ne) &&
              ((N = N.responseEnd), (m += Q * (N < x ? 1 : (x - R) / (N - R))));
          }
          if ((--l, (a += (8 * (c + m)) / (o.duration / 1e3)), t++, 10 < t))
            break;
        }
      }
      if (0 < t) return a / t / 1e6;
    }
    return navigator.connection &&
      ((t = navigator.connection.downlink), typeof t == "number")
      ? t
      : 5;
  }
  var Hd = null,
    Ud = null;
  function Qo(t) {
    return t.nodeType === 9 ? t : t.ownerDocument;
  }
  function Em(t) {
    switch (t) {
      case "http://www.w3.org/2000/svg":
        return 1;
      case "http://www.w3.org/1998/Math/MathML":
        return 2;
      default:
        return 0;
    }
  }
  function Om(t, a) {
    if (t === 0)
      switch (a) {
        case "svg":
          return 1;
        case "math":
          return 2;
        default:
          return 0;
      }
    return t === 1 && a === "foreignObject" ? 0 : t;
  }
  function Id(t, a) {
    return (
      t === "textarea" ||
      t === "noscript" ||
      typeof a.children == "string" ||
      typeof a.children == "number" ||
      typeof a.children == "bigint" ||
      (typeof a.dangerouslySetInnerHTML == "object" &&
        a.dangerouslySetInnerHTML !== null &&
        a.dangerouslySetInnerHTML.__html != null)
    );
  }
  var Gd = null;
  function kx() {
    var t = window.event;
    return t && t.type === "popstate"
      ? t === Gd
        ? !1
        : ((Gd = t), !0)
      : ((Gd = null), !1);
  }
  var Dm = typeof setTimeout == "function" ? setTimeout : void 0,
    Sx = typeof clearTimeout == "function" ? clearTimeout : void 0,
    Rm = typeof Promise == "function" ? Promise : void 0,
    Tx =
      typeof queueMicrotask == "function"
        ? queueMicrotask
        : typeof Rm < "u"
          ? function (t) {
              return Rm.resolve(null).then(t).catch(Cx);
            }
          : Dm;
  function Cx(t) {
    setTimeout(function () {
      throw t;
    });
  }
  function ki(t) {
    return t === "head";
  }
  function zm(t, a) {
    var n = a,
      l = 0;
    do {
      var o = n.nextSibling;
      if ((t.removeChild(n), o && o.nodeType === 8))
        if (((n = o.data), n === "/$" || n === "/&")) {
          if (l === 0) {
            (t.removeChild(o), Fl(a));
            return;
          }
          l--;
        } else if (
          n === "$" ||
          n === "$?" ||
          n === "$~" ||
          n === "$!" ||
          n === "&"
        )
          l++;
        else if (n === "html") Ir(t.ownerDocument.documentElement);
        else if (n === "head") {
          ((n = t.ownerDocument.head), Ir(n));
          for (var c = n.firstChild; c; ) {
            var m = c.nextSibling,
              x = c.nodeName;
            (c[Ot] ||
              x === "SCRIPT" ||
              x === "STYLE" ||
              (x === "LINK" && c.rel.toLowerCase() === "stylesheet") ||
              n.removeChild(c),
              (c = m));
          }
        } else n === "body" && Ir(t.ownerDocument.body);
      n = o;
    } while (n);
    Fl(a);
  }
  function Bm(t, a) {
    var n = t;
    t = 0;
    do {
      var l = n.nextSibling;
      if (
        (n.nodeType === 1
          ? a
            ? ((n._stashedDisplay = n.style.display),
              (n.style.display = "none"))
            : ((n.style.display = n._stashedDisplay || ""),
              n.getAttribute("style") === "" && n.removeAttribute("style"))
          : n.nodeType === 3 &&
            (a
              ? ((n._stashedText = n.nodeValue), (n.nodeValue = ""))
              : (n.nodeValue = n._stashedText || "")),
        l && l.nodeType === 8)
      )
        if (((n = l.data), n === "/$")) {
          if (t === 0) break;
          t--;
        } else (n !== "$" && n !== "$?" && n !== "$~" && n !== "$!") || t++;
      n = l;
    } while (n);
  }
  function Kd(t) {
    var a = t.firstChild;
    for (a && a.nodeType === 10 && (a = a.nextSibling); a; ) {
      var n = a;
      switch (((a = a.nextSibling), n.nodeName)) {
        case "HTML":
        case "HEAD":
        case "BODY":
          (Kd(n), Ra(n));
          continue;
        case "SCRIPT":
        case "STYLE":
          continue;
        case "LINK":
          if (n.rel.toLowerCase() === "stylesheet") continue;
      }
      t.removeChild(n);
    }
  }
  function Ax(t, a, n, l) {
    for (; t.nodeType === 1; ) {
      var o = n;
      if (t.nodeName.toLowerCase() !== a.toLowerCase()) {
        if (!l && (t.nodeName !== "INPUT" || t.type !== "hidden")) break;
      } else if (l) {
        if (!t[Ot])
          switch (a) {
            case "meta":
              if (!t.hasAttribute("itemprop")) break;
              return t;
            case "link":
              if (
                ((c = t.getAttribute("rel")),
                c === "stylesheet" && t.hasAttribute("data-precedence"))
              )
                break;
              if (
                c !== o.rel ||
                t.getAttribute("href") !==
                  (o.href == null || o.href === "" ? null : o.href) ||
                t.getAttribute("crossorigin") !==
                  (o.crossOrigin == null ? null : o.crossOrigin) ||
                t.getAttribute("title") !== (o.title == null ? null : o.title)
              )
                break;
              return t;
            case "style":
              if (t.hasAttribute("data-precedence")) break;
              return t;
            case "script":
              if (
                ((c = t.getAttribute("src")),
                (c !== (o.src == null ? null : o.src) ||
                  t.getAttribute("type") !== (o.type == null ? null : o.type) ||
                  t.getAttribute("crossorigin") !==
                    (o.crossOrigin == null ? null : o.crossOrigin)) &&
                  c &&
                  t.hasAttribute("async") &&
                  !t.hasAttribute("itemprop"))
              )
                break;
              return t;
            default:
              return t;
          }
      } else if (a === "input" && t.type === "hidden") {
        var c = o.name == null ? null : "" + o.name;
        if (o.type === "hidden" && t.getAttribute("name") === c) return t;
      } else return t;
      if (((t = zs(t.nextSibling)), t === null)) break;
    }
    return null;
  }
  function Mx(t, a, n) {
    if (a === "") return null;
    for (; t.nodeType !== 3; )
      if (
        ((t.nodeType !== 1 || t.nodeName !== "INPUT" || t.type !== "hidden") &&
          !n) ||
        ((t = zs(t.nextSibling)), t === null)
      )
        return null;
    return t;
  }
  function Hm(t, a) {
    for (; t.nodeType !== 8; )
      if (
        ((t.nodeType !== 1 || t.nodeName !== "INPUT" || t.type !== "hidden") &&
          !a) ||
        ((t = zs(t.nextSibling)), t === null)
      )
        return null;
    return t;
  }
  function Zd(t) {
    return t.data === "$?" || t.data === "$~";
  }
  function qd(t) {
    return (
      t.data === "$!" ||
      (t.data === "$?" && t.ownerDocument.readyState !== "loading")
    );
  }
  function Px(t, a) {
    var n = t.ownerDocument;
    if (t.data === "$~") t._reactRetry = a;
    else if (t.data !== "$?" || n.readyState !== "loading") a();
    else {
      var l = function () {
        (a(), n.removeEventListener("DOMContentLoaded", l));
      };
      (n.addEventListener("DOMContentLoaded", l), (t._reactRetry = l));
    }
  }
  function zs(t) {
    for (; t != null; t = t.nextSibling) {
      var a = t.nodeType;
      if (a === 1 || a === 3) break;
      if (a === 8) {
        if (
          ((a = t.data),
          a === "$" ||
            a === "$!" ||
            a === "$?" ||
            a === "$~" ||
            a === "&" ||
            a === "F!" ||
            a === "F")
        )
          break;
        if (a === "/$" || a === "/&") return null;
      }
    }
    return t;
  }
  var Vd = null;
  function Um(t) {
    t = t.nextSibling;
    for (var a = 0; t; ) {
      if (t.nodeType === 8) {
        var n = t.data;
        if (n === "/$" || n === "/&") {
          if (a === 0) return zs(t.nextSibling);
          a--;
        } else
          (n !== "$" && n !== "$!" && n !== "$?" && n !== "$~" && n !== "&") ||
            a++;
      }
      t = t.nextSibling;
    }
    return null;
  }
  function Im(t) {
    t = t.previousSibling;
    for (var a = 0; t; ) {
      if (t.nodeType === 8) {
        var n = t.data;
        if (n === "$" || n === "$!" || n === "$?" || n === "$~" || n === "&") {
          if (a === 0) return t;
          a--;
        } else (n !== "/$" && n !== "/&") || a++;
      }
      t = t.previousSibling;
    }
    return null;
  }
  function Gm(t, a, n) {
    switch (((a = Qo(n)), t)) {
      case "html":
        if (((t = a.documentElement), !t)) throw Error(b(452));
        return t;
      case "head":
        if (((t = a.head), !t)) throw Error(b(453));
        return t;
      case "body":
        if (((t = a.body), !t)) throw Error(b(454));
        return t;
      default:
        throw Error(b(451));
    }
  }
  function Ir(t) {
    for (var a = t.attributes; a.length; ) t.removeAttributeNode(a[0]);
    Ra(t);
  }
  var Bs = new Map(),
    Km = new Set();
  function Wo(t) {
    return typeof t.getRootNode == "function"
      ? t.getRootNode()
      : t.nodeType === 9
        ? t
        : t.ownerDocument;
  }
  var Yn = K.d;
  K.d = { f: Lx, r: Ex, D: Ox, C: Dx, L: Rx, m: zx, X: Hx, S: Bx, M: Ux };
  function Lx() {
    var t = Yn.f(),
      a = Ko();
    return t || a;
  }
  function Ex(t) {
    var a = _a(t);
    a !== null && a.tag === 5 && a.type === "form" ? lh(a) : Yn.r(t);
  }
  var Jl = typeof document > "u" ? null : document;
  function Zm(t, a, n) {
    var l = Jl;
    if (l && typeof a == "string" && a) {
      var o = Dt(a);
      ((o = 'link[rel="' + t + '"][href="' + o + '"]'),
        typeof n == "string" && (o += '[crossorigin="' + n + '"]'),
        Km.has(o) ||
          (Km.add(o),
          (t = { rel: t, crossOrigin: n, href: a }),
          l.querySelector(o) === null &&
            ((a = l.createElement("link")),
            Da(a, "link", t),
            ca(a),
            l.head.appendChild(a))));
    }
  }
  function Ox(t) {
    (Yn.D(t), Zm("dns-prefetch", t, null));
  }
  function Dx(t, a) {
    (Yn.C(t, a), Zm("preconnect", t, a));
  }
  function Rx(t, a, n) {
    Yn.L(t, a, n);
    var l = Jl;
    if (l && t && a) {
      var o = 'link[rel="preload"][as="' + Dt(a) + '"]';
      a === "image" && n && n.imageSrcSet
        ? ((o += '[imagesrcset="' + Dt(n.imageSrcSet) + '"]'),
          typeof n.imageSizes == "string" &&
            (o += '[imagesizes="' + Dt(n.imageSizes) + '"]'))
        : (o += '[href="' + Dt(t) + '"]');
      var c = o;
      switch (a) {
        case "style":
          c = Ql(t);
          break;
        case "script":
          c = Wl(t);
      }
      Bs.has(c) ||
        ((t = G(
          {
            rel: "preload",
            href: a === "image" && n && n.imageSrcSet ? void 0 : t,
            as: a,
          },
          n,
        )),
        Bs.set(c, t),
        l.querySelector(o) !== null ||
          (a === "style" && l.querySelector(Gr(c))) ||
          (a === "script" && l.querySelector(Kr(c))) ||
          ((a = l.createElement("link")),
          Da(a, "link", t),
          ca(a),
          l.head.appendChild(a)));
    }
  }
  function zx(t, a) {
    Yn.m(t, a);
    var n = Jl;
    if (n && t) {
      var l = a && typeof a.as == "string" ? a.as : "script",
        o =
          'link[rel="modulepreload"][as="' + Dt(l) + '"][href="' + Dt(t) + '"]',
        c = o;
      switch (l) {
        case "audioworklet":
        case "paintworklet":
        case "serviceworker":
        case "sharedworker":
        case "worker":
        case "script":
          c = Wl(t);
      }
      if (
        !Bs.has(c) &&
        ((t = G({ rel: "modulepreload", href: t }, a)),
        Bs.set(c, t),
        n.querySelector(o) === null)
      ) {
        switch (l) {
          case "audioworklet":
          case "paintworklet":
          case "serviceworker":
          case "sharedworker":
          case "worker":
          case "script":
            if (n.querySelector(Kr(c))) return;
        }
        ((l = n.createElement("link")),
          Da(l, "link", t),
          ca(l),
          n.head.appendChild(l));
      }
    }
  }
  function Bx(t, a, n) {
    Yn.S(t, a, n);
    var l = Jl;
    if (l && t) {
      var o = Ss(l).hoistableStyles,
        c = Ql(t);
      a = a || "default";
      var m = o.get(c);
      if (!m) {
        var x = { loading: 0, preload: null };
        if ((m = l.querySelector(Gr(c)))) x.loading = 5;
        else {
          ((t = G({ rel: "stylesheet", href: t, "data-precedence": a }, n)),
            (n = Bs.get(c)) && Yd(t, n));
          var N = (m = l.createElement("link"));
          (ca(N),
            Da(N, "link", t),
            (N._p = new Promise(function (R, Q) {
              ((N.onload = R), (N.onerror = Q));
            })),
            N.addEventListener("load", function () {
              x.loading |= 1;
            }),
            N.addEventListener("error", function () {
              x.loading |= 2;
            }),
            (x.loading |= 4),
            Fo(m, a, l));
        }
        ((m = { type: "stylesheet", instance: m, count: 1, state: x }),
          o.set(c, m));
      }
    }
  }
  function Hx(t, a) {
    Yn.X(t, a);
    var n = Jl;
    if (n && t) {
      var l = Ss(n).hoistableScripts,
        o = Wl(t),
        c = l.get(o);
      c ||
        ((c = n.querySelector(Kr(o))),
        c ||
          ((t = G({ src: t, async: !0 }, a)),
          (a = Bs.get(o)) && Xd(t, a),
          (c = n.createElement("script")),
          ca(c),
          Da(c, "link", t),
          n.head.appendChild(c)),
        (c = { type: "script", instance: c, count: 1, state: null }),
        l.set(o, c));
    }
  }
  function Ux(t, a) {
    Yn.M(t, a);
    var n = Jl;
    if (n && t) {
      var l = Ss(n).hoistableScripts,
        o = Wl(t),
        c = l.get(o);
      c ||
        ((c = n.querySelector(Kr(o))),
        c ||
          ((t = G({ src: t, async: !0, type: "module" }, a)),
          (a = Bs.get(o)) && Xd(t, a),
          (c = n.createElement("script")),
          ca(c),
          Da(c, "link", t),
          n.head.appendChild(c)),
        (c = { type: "script", instance: c, count: 1, state: null }),
        l.set(o, c));
    }
  }
  function qm(t, a, n, l) {
    var o = (o = he.current) ? Wo(o) : null;
    if (!o) throw Error(b(446));
    switch (t) {
      case "meta":
      case "title":
        return null;
      case "style":
        return typeof n.precedence == "string" && typeof n.href == "string"
          ? ((a = Ql(n.href)),
            (n = Ss(o).hoistableStyles),
            (l = n.get(a)),
            l ||
              ((l = { type: "style", instance: null, count: 0, state: null }),
              n.set(a, l)),
            l)
          : { type: "void", instance: null, count: 0, state: null };
      case "link":
        if (
          n.rel === "stylesheet" &&
          typeof n.href == "string" &&
          typeof n.precedence == "string"
        ) {
          t = Ql(n.href);
          var c = Ss(o).hoistableStyles,
            m = c.get(t);
          if (
            (m ||
              ((o = o.ownerDocument || o),
              (m = {
                type: "stylesheet",
                instance: null,
                count: 0,
                state: { loading: 0, preload: null },
              }),
              c.set(t, m),
              (c = o.querySelector(Gr(t))) &&
                !c._p &&
                ((m.instance = c), (m.state.loading = 5)),
              Bs.has(t) ||
                ((n = {
                  rel: "preload",
                  as: "style",
                  href: n.href,
                  crossOrigin: n.crossOrigin,
                  integrity: n.integrity,
                  media: n.media,
                  hrefLang: n.hrefLang,
                  referrerPolicy: n.referrerPolicy,
                }),
                Bs.set(t, n),
                c || Ix(o, t, n, m.state))),
            a && l === null)
          )
            throw Error(b(528, ""));
          return m;
        }
        if (a && l !== null) throw Error(b(529, ""));
        return null;
      case "script":
        return (
          (a = n.async),
          (n = n.src),
          typeof n == "string" &&
          a &&
          typeof a != "function" &&
          typeof a != "symbol"
            ? ((a = Wl(n)),
              (n = Ss(o).hoistableScripts),
              (l = n.get(a)),
              l ||
                ((l = {
                  type: "script",
                  instance: null,
                  count: 0,
                  state: null,
                }),
                n.set(a, l)),
              l)
            : { type: "void", instance: null, count: 0, state: null }
        );
      default:
        throw Error(b(444, t));
    }
  }
  function Ql(t) {
    return 'href="' + Dt(t) + '"';
  }
  function Gr(t) {
    return 'link[rel="stylesheet"][' + t + "]";
  }
  function Vm(t) {
    return G({}, t, { "data-precedence": t.precedence, precedence: null });
  }
  function Ix(t, a, n, l) {
    t.querySelector('link[rel="preload"][as="style"][' + a + "]")
      ? (l.loading = 1)
      : ((a = t.createElement("link")),
        (l.preload = a),
        a.addEventListener("load", function () {
          return (l.loading |= 1);
        }),
        a.addEventListener("error", function () {
          return (l.loading |= 2);
        }),
        Da(a, "link", n),
        ca(a),
        t.head.appendChild(a));
  }
  function Wl(t) {
    return '[src="' + Dt(t) + '"]';
  }
  function Kr(t) {
    return "script[async]" + t;
  }
  function Ym(t, a, n) {
    if ((a.count++, a.instance === null))
      switch (a.type) {
        case "style":
          var l = t.querySelector('style[data-href~="' + Dt(n.href) + '"]');
          if (l) return ((a.instance = l), ca(l), l);
          var o = G({}, n, {
            "data-href": n.href,
            "data-precedence": n.precedence,
            href: null,
            precedence: null,
          });
          return (
            (l = (t.ownerDocument || t).createElement("style")),
            ca(l),
            Da(l, "style", o),
            Fo(l, n.precedence, t),
            (a.instance = l)
          );
        case "stylesheet":
          o = Ql(n.href);
          var c = t.querySelector(Gr(o));
          if (c) return ((a.state.loading |= 4), (a.instance = c), ca(c), c);
          ((l = Vm(n)),
            (o = Bs.get(o)) && Yd(l, o),
            (c = (t.ownerDocument || t).createElement("link")),
            ca(c));
          var m = c;
          return (
            (m._p = new Promise(function (x, N) {
              ((m.onload = x), (m.onerror = N));
            })),
            Da(c, "link", l),
            (a.state.loading |= 4),
            Fo(c, n.precedence, t),
            (a.instance = c)
          );
        case "script":
          return (
            (c = Wl(n.src)),
            (o = t.querySelector(Kr(c)))
              ? ((a.instance = o), ca(o), o)
              : ((l = n),
                (o = Bs.get(c)) && ((l = G({}, n)), Xd(l, o)),
                (t = t.ownerDocument || t),
                (o = t.createElement("script")),
                ca(o),
                Da(o, "link", l),
                t.head.appendChild(o),
                (a.instance = o))
          );
        case "void":
          return null;
        default:
          throw Error(b(443, a.type));
      }
    else
      a.type === "stylesheet" &&
        (a.state.loading & 4) === 0 &&
        ((l = a.instance), (a.state.loading |= 4), Fo(l, n.precedence, t));
    return a.instance;
  }
  function Fo(t, a, n) {
    for (
      var l = n.querySelectorAll(
          'link[rel="stylesheet"][data-precedence],style[data-precedence]',
        ),
        o = l.length ? l[l.length - 1] : null,
        c = o,
        m = 0;
      m < l.length;
      m++
    ) {
      var x = l[m];
      if (x.dataset.precedence === a) c = x;
      else if (c !== o) break;
    }
    c
      ? c.parentNode.insertBefore(t, c.nextSibling)
      : ((a = n.nodeType === 9 ? n.head : n), a.insertBefore(t, a.firstChild));
  }
  function Yd(t, a) {
    (t.crossOrigin == null && (t.crossOrigin = a.crossOrigin),
      t.referrerPolicy == null && (t.referrerPolicy = a.referrerPolicy),
      t.title == null && (t.title = a.title));
  }
  function Xd(t, a) {
    (t.crossOrigin == null && (t.crossOrigin = a.crossOrigin),
      t.referrerPolicy == null && (t.referrerPolicy = a.referrerPolicy),
      t.integrity == null && (t.integrity = a.integrity));
  }
  var ec = null;
  function Xm(t, a, n) {
    if (ec === null) {
      var l = new Map(),
        o = (ec = new Map());
      o.set(n, l);
    } else ((o = ec), (l = o.get(n)), l || ((l = new Map()), o.set(n, l)));
    if (l.has(t)) return l;
    for (
      l.set(t, null), n = n.getElementsByTagName(t), o = 0;
      o < n.length;
      o++
    ) {
      var c = n[o];
      if (
        !(
          c[Ot] ||
          c[we] ||
          (t === "link" && c.getAttribute("rel") === "stylesheet")
        ) &&
        c.namespaceURI !== "http://www.w3.org/2000/svg"
      ) {
        var m = c.getAttribute(a) || "";
        m = t + m;
        var x = l.get(m);
        x ? x.push(c) : l.set(m, [c]);
      }
    }
    return l;
  }
  function $m(t, a, n) {
    ((t = t.ownerDocument || t),
      t.head.insertBefore(
        n,
        a === "title" ? t.querySelector("head > title") : null,
      ));
  }
  function Gx(t, a, n) {
    if (n === 1 || a.itemProp != null) return !1;
    switch (t) {
      case "meta":
      case "title":
        return !0;
      case "style":
        if (
          typeof a.precedence != "string" ||
          typeof a.href != "string" ||
          a.href === ""
        )
          break;
        return !0;
      case "link":
        if (
          typeof a.rel != "string" ||
          typeof a.href != "string" ||
          a.href === "" ||
          a.onLoad ||
          a.onError
        )
          break;
        switch (a.rel) {
          case "stylesheet":
            return (
              (t = a.disabled),
              typeof a.precedence == "string" && t == null
            );
          default:
            return !0;
        }
      case "script":
        if (
          a.async &&
          typeof a.async != "function" &&
          typeof a.async != "symbol" &&
          !a.onLoad &&
          !a.onError &&
          a.src &&
          typeof a.src == "string"
        )
          return !0;
    }
    return !1;
  }
  function Jm(t) {
    return !(t.type === "stylesheet" && (t.state.loading & 3) === 0);
  }
  function Kx(t, a, n, l) {
    if (
      n.type === "stylesheet" &&
      (typeof l.media != "string" || matchMedia(l.media).matches !== !1) &&
      (n.state.loading & 4) === 0
    ) {
      if (n.instance === null) {
        var o = Ql(l.href),
          c = a.querySelector(Gr(o));
        if (c) {
          ((a = c._p),
            a !== null &&
              typeof a == "object" &&
              typeof a.then == "function" &&
              (t.count++, (t = tc.bind(t)), a.then(t, t)),
            (n.state.loading |= 4),
            (n.instance = c),
            ca(c));
          return;
        }
        ((c = a.ownerDocument || a),
          (l = Vm(l)),
          (o = Bs.get(o)) && Yd(l, o),
          (c = c.createElement("link")),
          ca(c));
        var m = c;
        ((m._p = new Promise(function (x, N) {
          ((m.onload = x), (m.onerror = N));
        })),
          Da(c, "link", l),
          (n.instance = c));
      }
      (t.stylesheets === null && (t.stylesheets = new Map()),
        t.stylesheets.set(n, a),
        (a = n.state.preload) &&
          (n.state.loading & 3) === 0 &&
          (t.count++,
          (n = tc.bind(t)),
          a.addEventListener("load", n),
          a.addEventListener("error", n)));
    }
  }
  var $d = 0;
  function Zx(t, a) {
    return (
      t.stylesheets && t.count === 0 && sc(t, t.stylesheets),
      0 < t.count || 0 < t.imgCount
        ? function (n) {
            var l = setTimeout(function () {
              if ((t.stylesheets && sc(t, t.stylesheets), t.unsuspend)) {
                var c = t.unsuspend;
                ((t.unsuspend = null), c());
              }
            }, 6e4 + a);
            0 < t.imgBytes && $d === 0 && ($d = 62500 * wx());
            var o = setTimeout(
              function () {
                if (
                  ((t.waitingForImages = !1),
                  t.count === 0 &&
                    (t.stylesheets && sc(t, t.stylesheets), t.unsuspend))
                ) {
                  var c = t.unsuspend;
                  ((t.unsuspend = null), c());
                }
              },
              (t.imgBytes > $d ? 50 : 800) + a,
            );
            return (
              (t.unsuspend = n),
              function () {
                ((t.unsuspend = null), clearTimeout(l), clearTimeout(o));
              }
            );
          }
        : null
    );
  }
  function tc() {
    if (
      (this.count--,
      this.count === 0 && (this.imgCount === 0 || !this.waitingForImages))
    ) {
      if (this.stylesheets) sc(this, this.stylesheets);
      else if (this.unsuspend) {
        var t = this.unsuspend;
        ((this.unsuspend = null), t());
      }
    }
  }
  var ac = null;
  function sc(t, a) {
    ((t.stylesheets = null),
      t.unsuspend !== null &&
        (t.count++,
        (ac = new Map()),
        a.forEach(qx, t),
        (ac = null),
        tc.call(t)));
  }
  function qx(t, a) {
    if (!(a.state.loading & 4)) {
      var n = ac.get(t);
      if (n) var l = n.get(null);
      else {
        ((n = new Map()), ac.set(t, n));
        for (
          var o = t.querySelectorAll(
              "link[data-precedence],style[data-precedence]",
            ),
            c = 0;
          c < o.length;
          c++
        ) {
          var m = o[c];
          (m.nodeName === "LINK" || m.getAttribute("media") !== "not all") &&
            (n.set(m.dataset.precedence, m), (l = m));
        }
        l && n.set(null, l);
      }
      ((o = a.instance),
        (m = o.getAttribute("data-precedence")),
        (c = n.get(m) || l),
        c === l && n.set(null, o),
        n.set(m, o),
        this.count++,
        (l = tc.bind(this)),
        o.addEventListener("load", l),
        o.addEventListener("error", l),
        c
          ? c.parentNode.insertBefore(o, c.nextSibling)
          : ((t = t.nodeType === 9 ? t.head : t),
            t.insertBefore(o, t.firstChild)),
        (a.state.loading |= 4));
    }
  }
  var Zr = {
    $$typeof: ie,
    Provider: null,
    Consumer: null,
    _currentValue: O,
    _currentValue2: O,
    _threadCount: 0,
  };
  function Vx(t, a, n, l, o, c, m, x, N) {
    ((this.tag = 1),
      (this.containerInfo = t),
      (this.pingCache = this.current = this.pendingChildren = null),
      (this.timeoutHandle = -1),
      (this.callbackNode =
        this.next =
        this.pendingContext =
        this.context =
        this.cancelPendingCommit =
          null),
      (this.callbackPriority = 0),
      (this.expirationTimes = ks(-1)),
      (this.entangledLanes =
        this.shellSuspendCounter =
        this.errorRecoveryDisabledLanes =
        this.expiredLanes =
        this.warmLanes =
        this.pingedLanes =
        this.suspendedLanes =
        this.pendingLanes =
          0),
      (this.entanglements = ks(0)),
      (this.hiddenUpdates = ks(null)),
      (this.identifierPrefix = l),
      (this.onUncaughtError = o),
      (this.onCaughtError = c),
      (this.onRecoverableError = m),
      (this.pooledCache = null),
      (this.pooledCacheLanes = 0),
      (this.formState = N),
      (this.incompleteTransitions = new Map()));
  }
  function Qm(t, a, n, l, o, c, m, x, N, R, Q, ne) {
    return (
      (t = new Vx(t, a, n, m, N, R, Q, ne, x)),
      (a = 1),
      c === !0 && (a |= 24),
      (c = Za(3, null, null, a)),
      (t.current = c),
      (c.stateNode = t),
      (a = Cc()),
      a.refCount++,
      (t.pooledCache = a),
      a.refCount++,
      (c.memoizedState = { element: l, isDehydrated: n, cache: a }),
      Lc(c),
      t
    );
  }
  function Wm(t) {
    return t ? ((t = En), t) : En;
  }
  function Fm(t, a, n, l, o, c) {
    ((o = Wm(o)),
      l.context === null ? (l.context = o) : (l.pendingContext = o),
      (l = pi(a)),
      (l.payload = { element: n }),
      (c = c === void 0 ? null : c),
      c !== null && (l.callback = c),
      (n = xi(t, l, a)),
      n !== null && (hs(n, t, a), Nr(n, t, a)));
  }
  function ep(t, a) {
    if (((t = t.memoizedState), t !== null && t.dehydrated !== null)) {
      var n = t.retryLane;
      t.retryLane = n !== 0 && n < a ? n : a;
    }
  }
  function Jd(t, a) {
    (ep(t, a), (t = t.alternate) && ep(t, a));
  }
  function tp(t) {
    if (t.tag === 13 || t.tag === 31) {
      var a = Os(t, 67108864);
      (a !== null && hs(a, t, 67108864), Jd(t, 67108864));
    }
  }
  function ap(t) {
    if (t.tag === 13 || t.tag === 31) {
      var a = Ns();
      a = ga(a);
      var n = Os(t, a);
      (n !== null && hs(n, t, a), Jd(t, a));
    }
  }
  var nc = !0;
  function Yx(t, a, n, l) {
    var o = y.T;
    y.T = null;
    var c = K.p;
    try {
      ((K.p = 2), Qd(t, a, n, l));
    } finally {
      ((K.p = c), (y.T = o));
    }
  }
  function Xx(t, a, n, l) {
    var o = y.T;
    y.T = null;
    var c = K.p;
    try {
      ((K.p = 8), Qd(t, a, n, l));
    } finally {
      ((K.p = c), (y.T = o));
    }
  }
  function Qd(t, a, n, l) {
    if (nc) {
      var o = Wd(l);
      if (o === null) (zd(t, a, l, ic, n), np(t, l));
      else if (Jx(o, t, a, n, l)) l.stopPropagation();
      else if ((np(t, l), a & 4 && -1 < $x.indexOf(t))) {
        for (; o !== null; ) {
          var c = _a(o);
          if (c !== null)
            switch (c.tag) {
              case 3:
                if (((c = c.stateNode), c.current.memoizedState.isDehydrated)) {
                  var m = Pt(c.pendingLanes);
                  if (m !== 0) {
                    var x = c;
                    for (x.pendingLanes |= 2, x.entangledLanes |= 2; m; ) {
                      var N = 1 << (31 - Zt(m));
                      ((x.entanglements[1] |= N), (m &= ~N));
                    }
                    (yn(c), (kt & 6) === 0 && ((Io = E() + 500), Br(0)));
                  }
                }
                break;
              case 31:
              case 13:
                ((x = Os(c, 2)), x !== null && hs(x, c, 2), Ko(), Jd(c, 2));
            }
          if (((c = Wd(l)), c === null && zd(t, a, l, ic, n), c === o)) break;
          o = c;
        }
        o !== null && l.stopPropagation();
      } else zd(t, a, l, null, n);
    }
  }
  function Wd(t) {
    return ((t = Cn(t)), Fd(t));
  }
  var ic = null;
  function Fd(t) {
    if (((ic = null), (t = It(t)), t !== null)) {
      var a = ue(t);
      if (a === null) t = null;
      else {
        var n = a.tag;
        if (n === 13) {
          if (((t = re(a)), t !== null)) return t;
          t = null;
        } else if (n === 31) {
          if (((t = ee(a)), t !== null)) return t;
          t = null;
        } else if (n === 3) {
          if (a.stateNode.current.memoizedState.isDehydrated)
            return a.tag === 3 ? a.stateNode.containerInfo : null;
          t = null;
        } else a !== t && (t = null);
      }
    }
    return ((ic = t), null);
  }
  function sp(t) {
    switch (t) {
      case "beforetoggle":
      case "cancel":
      case "click":
      case "close":
      case "contextmenu":
      case "copy":
      case "cut":
      case "auxclick":
      case "dblclick":
      case "dragend":
      case "dragstart":
      case "drop":
      case "focusin":
      case "focusout":
      case "input":
      case "invalid":
      case "keydown":
      case "keypress":
      case "keyup":
      case "mousedown":
      case "mouseup":
      case "paste":
      case "pause":
      case "play":
      case "pointercancel":
      case "pointerdown":
      case "pointerup":
      case "ratechange":
      case "reset":
      case "resize":
      case "seeked":
      case "submit":
      case "toggle":
      case "touchcancel":
      case "touchend":
      case "touchstart":
      case "volumechange":
      case "change":
      case "selectionchange":
      case "textInput":
      case "compositionstart":
      case "compositionend":
      case "compositionupdate":
      case "beforeblur":
      case "afterblur":
      case "beforeinput":
      case "blur":
      case "fullscreenchange":
      case "focus":
      case "hashchange":
      case "popstate":
      case "select":
      case "selectstart":
        return 2;
      case "drag":
      case "dragenter":
      case "dragexit":
      case "dragleave":
      case "dragover":
      case "mousemove":
      case "mouseout":
      case "mouseover":
      case "pointermove":
      case "pointerout":
      case "pointerover":
      case "scroll":
      case "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 8;
      case "message":
        switch (Re()) {
          case qe:
            return 2;
          case Fe:
            return 8;
          case fa:
          case Aa:
            return 32;
          case ps:
            return 268435456;
          default:
            return 32;
        }
      default:
        return 32;
    }
  }
  var eu = !1,
    Si = null,
    Ti = null,
    Ci = null,
    qr = new Map(),
    Vr = new Map(),
    Ai = [],
    $x =
      "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 np(t, a) {
    switch (t) {
      case "focusin":
      case "focusout":
        Si = null;
        break;
      case "dragenter":
      case "dragleave":
        Ti = null;
        break;
      case "mouseover":
      case "mouseout":
        Ci = null;
        break;
      case "pointerover":
      case "pointerout":
        qr.delete(a.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        Vr.delete(a.pointerId);
    }
  }
  function Yr(t, a, n, l, o, c) {
    return t === null || t.nativeEvent !== c
      ? ((t = {
          blockedOn: a,
          domEventName: n,
          eventSystemFlags: l,
          nativeEvent: c,
          targetContainers: [o],
        }),
        a !== null && ((a = _a(a)), a !== null && tp(a)),
        t)
      : ((t.eventSystemFlags |= l),
        (a = t.targetContainers),
        o !== null && a.indexOf(o) === -1 && a.push(o),
        t);
  }
  function Jx(t, a, n, l, o) {
    switch (a) {
      case "focusin":
        return ((Si = Yr(Si, t, a, n, l, o)), !0);
      case "dragenter":
        return ((Ti = Yr(Ti, t, a, n, l, o)), !0);
      case "mouseover":
        return ((Ci = Yr(Ci, t, a, n, l, o)), !0);
      case "pointerover":
        var c = o.pointerId;
        return (qr.set(c, Yr(qr.get(c) || null, t, a, n, l, o)), !0);
      case "gotpointercapture":
        return (
          (c = o.pointerId),
          Vr.set(c, Yr(Vr.get(c) || null, t, a, n, l, o)),
          !0
        );
    }
    return !1;
  }
  function ip(t) {
    var a = It(t.target);
    if (a !== null) {
      var n = ue(a);
      if (n !== null) {
        if (((a = n.tag), a === 13)) {
          if (((a = re(n)), a !== null)) {
            ((t.blockedOn = a),
              vt(t.priority, function () {
                ap(n);
              }));
            return;
          }
        } else if (a === 31) {
          if (((a = ee(n)), a !== null)) {
            ((t.blockedOn = a),
              vt(t.priority, function () {
                ap(n);
              }));
            return;
          }
        } else if (a === 3 && n.stateNode.current.memoizedState.isDehydrated) {
          t.blockedOn = n.tag === 3 ? n.stateNode.containerInfo : null;
          return;
        }
      }
    }
    t.blockedOn = null;
  }
  function lc(t) {
    if (t.blockedOn !== null) return !1;
    for (var a = t.targetContainers; 0 < a.length; ) {
      var n = Wd(t.nativeEvent);
      if (n === null) {
        n = t.nativeEvent;
        var l = new n.constructor(n.type, n);
        ((Tn = l), n.target.dispatchEvent(l), (Tn = null));
      } else return ((a = _a(n)), a !== null && tp(a), (t.blockedOn = n), !1);
      a.shift();
    }
    return !0;
  }
  function lp(t, a, n) {
    lc(t) && n.delete(a);
  }
  function Qx() {
    ((eu = !1),
      Si !== null && lc(Si) && (Si = null),
      Ti !== null && lc(Ti) && (Ti = null),
      Ci !== null && lc(Ci) && (Ci = null),
      qr.forEach(lp),
      Vr.forEach(lp));
  }
  function rc(t, a) {
    t.blockedOn === a &&
      ((t.blockedOn = null),
      eu ||
        ((eu = !0),
        w.unstable_scheduleCallback(w.unstable_NormalPriority, Qx)));
  }
  var oc = null;
  function rp(t) {
    oc !== t &&
      ((oc = t),
      w.unstable_scheduleCallback(w.unstable_NormalPriority, function () {
        oc === t && (oc = null);
        for (var a = 0; a < t.length; a += 3) {
          var n = t[a],
            l = t[a + 1],
            o = t[a + 2];
          if (typeof l != "function") {
            if (Fd(l || n) === null) continue;
            break;
          }
          var c = _a(n);
          c !== null &&
            (t.splice(a, 3),
            (a -= 3),
            Wc(c, { pending: !0, data: o, method: n.method, action: l }, l, o));
        }
      }));
  }
  function Fl(t) {
    function a(N) {
      return rc(N, t);
    }
    (Si !== null && rc(Si, t),
      Ti !== null && rc(Ti, t),
      Ci !== null && rc(Ci, t),
      qr.forEach(a),
      Vr.forEach(a));
    for (var n = 0; n < Ai.length; n++) {
      var l = Ai[n];
      l.blockedOn === t && (l.blockedOn = null);
    }
    for (; 0 < Ai.length && ((n = Ai[0]), n.blockedOn === null); )
      (ip(n), n.blockedOn === null && Ai.shift());
    if (((n = (t.ownerDocument || t).$$reactFormReplay), n != null))
      for (l = 0; l < n.length; l += 3) {
        var o = n[l],
          c = n[l + 1],
          m = o[Ve] || null;
        if (typeof c == "function") m || rp(n);
        else if (m) {
          var x = null;
          if (c && c.hasAttribute("formAction")) {
            if (((o = c), (m = c[Ve] || null))) x = m.formAction;
            else if (Fd(o) !== null) continue;
          } else x = m.action;
          (typeof x == "function" ? (n[l + 1] = x) : (n.splice(l, 3), (l -= 3)),
            rp(n));
        }
      }
  }
  function op() {
    function t(c) {
      c.canIntercept &&
        c.info === "react-transition" &&
        c.intercept({
          handler: function () {
            return new Promise(function (m) {
              return (o = m);
            });
          },
          focusReset: "manual",
          scroll: "manual",
        });
    }
    function a() {
      (o !== null && (o(), (o = null)), l || setTimeout(n, 20));
    }
    function n() {
      if (!l && !navigation.transition) {
        var c = navigation.currentEntry;
        c &&
          c.url != null &&
          navigation.navigate(c.url, {
            state: c.getState(),
            info: "react-transition",
            history: "replace",
          });
      }
    }
    if (typeof navigation == "object") {
      var l = !1,
        o = null;
      return (
        navigation.addEventListener("navigate", t),
        navigation.addEventListener("navigatesuccess", a),
        navigation.addEventListener("navigateerror", a),
        setTimeout(n, 100),
        function () {
          ((l = !0),
            navigation.removeEventListener("navigate", t),
            navigation.removeEventListener("navigatesuccess", a),
            navigation.removeEventListener("navigateerror", a),
            o !== null && (o(), (o = null)));
        }
      );
    }
  }
  function tu(t) {
    this._internalRoot = t;
  }
  ((cc.prototype.render = tu.prototype.render =
    function (t) {
      var a = this._internalRoot;
      if (a === null) throw Error(b(409));
      var n = a.current,
        l = Ns();
      Fm(n, l, t, a, null, null);
    }),
    (cc.prototype.unmount = tu.prototype.unmount =
      function () {
        var t = this._internalRoot;
        if (t !== null) {
          this._internalRoot = null;
          var a = t.containerInfo;
          (Fm(t.current, 2, null, t, null, null), Ko(), (a[rt] = null));
        }
      }));
  function cc(t) {
    this._internalRoot = t;
  }
  cc.prototype.unstable_scheduleHydration = function (t) {
    if (t) {
      var a = Pe();
      t = { blockedOn: null, target: t, priority: a };
      for (var n = 0; n < Ai.length && a !== 0 && a < Ai[n].priority; n++);
      (Ai.splice(n, 0, t), n === 0 && ip(t));
    }
  };
  var cp = J.version;
  if (cp !== "19.2.7") throw Error(b(527, cp, "19.2.7"));
  K.findDOMNode = function (t) {
    var a = t._reactInternals;
    if (a === void 0)
      throw typeof t.render == "function"
        ? Error(b(188))
        : ((t = Object.keys(t).join(",")), Error(b(268, t)));
    return (
      (t = T(a)),
      (t = t !== null ? fe(t) : null),
      (t = t === null ? null : t.stateNode),
      t
    );
  };
  var Wx = {
    bundleType: 0,
    version: "19.2.7",
    rendererPackageName: "react-dom",
    currentDispatcherRef: y,
    reconcilerVersion: "19.2.7",
  };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var dc = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!dc.isDisabled && dc.supportsFiber)
      try {
        ((Ft = dc.inject(Wx)), (Tt = dc));
      } catch {}
  }
  return (
    ($r.createRoot = function (t, a) {
      if (!V(t)) throw Error(b(299));
      var n = !1,
        l = "",
        o = fh,
        c = gh,
        m = bh;
      return (
        a != null &&
          (a.unstable_strictMode === !0 && (n = !0),
          a.identifierPrefix !== void 0 && (l = a.identifierPrefix),
          a.onUncaughtError !== void 0 && (o = a.onUncaughtError),
          a.onCaughtError !== void 0 && (c = a.onCaughtError),
          a.onRecoverableError !== void 0 && (m = a.onRecoverableError)),
        (a = Qm(t, 1, !1, null, null, n, l, null, o, c, m, op)),
        (t[rt] = a.current),
        Rd(t),
        new tu(a)
      );
    }),
    ($r.hydrateRoot = function (t, a, n) {
      if (!V(t)) throw Error(b(299));
      var l = !1,
        o = "",
        c = fh,
        m = gh,
        x = bh,
        N = null;
      return (
        n != null &&
          (n.unstable_strictMode === !0 && (l = !0),
          n.identifierPrefix !== void 0 && (o = n.identifierPrefix),
          n.onUncaughtError !== void 0 && (c = n.onUncaughtError),
          n.onCaughtError !== void 0 && (m = n.onCaughtError),
          n.onRecoverableError !== void 0 && (x = n.onRecoverableError),
          n.formState !== void 0 && (N = n.formState)),
        (a = Qm(t, 1, !0, a, n ?? null, l, o, N, c, m, x, op)),
        (a.context = Wm(null)),
        (n = a.current),
        (l = Ns()),
        (l = ga(l)),
        (o = pi(l)),
        (o.callback = null),
        xi(n, o, l),
        (n = l),
        (a.current.lanes = n),
        Na(a, n),
        yn(a),
        (t[rt] = a.current),
        Rd(t),
        new cc(a)
      );
    }),
    ($r.version = "19.2.7"),
    $r
  );
}
var vp;
function df() {
  if (vp) return nu.exports;
  vp = 1;
  function w() {
    if (
      !(
        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" ||
        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"
      )
    )
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w);
      } catch (J) {
        console.error(J);
      }
  }
  return (w(), (nu.exports = cf()), nu.exports);
}
var uf = df();
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const hf = (w) => w.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
  mf = (w) =>
    w.replace(/^([A-Z])|[\s-_]+(\w)/g, (J, S, b) =>
      b ? b.toUpperCase() : S.toLowerCase(),
    ),
  yp = (w) => {
    const J = mf(w);
    return J.charAt(0).toUpperCase() + J.slice(1);
  },
  Pp = (...w) =>
    w
      .filter((J, S, b) => !!J && J.trim() !== "" && b.indexOf(J) === S)
      .join(" ")
      .trim(),
  pf = (w) => {
    for (const J in w)
      if (J.startsWith("aria-") || J === "role" || J === "title") return !0;
  };
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ var xf = {
  xmlns: "http://www.w3.org/2000/svg",
  width: 24,
  height: 24,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 2,
  strokeLinecap: "round",
  strokeLinejoin: "round",
};
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const ff = f.forwardRef(
  (
    {
      color: w = "currentColor",
      size: J = 24,
      strokeWidth: S = 2,
      absoluteStrokeWidth: b,
      className: V = "",
      children: ue,
      iconNode: re,
      ...ee
    },
    B,
  ) =>
    f.createElement(
      "svg",
      {
        ref: B,
        ...xf,
        width: J,
        height: J,
        stroke: w,
        strokeWidth: b ? (Number(S) * 24) / Number(J) : S,
        className: Pp("lucide", V),
        ...(!ue && !pf(ee) && { "aria-hidden": "true" }),
        ...ee,
      },
      [
        ...re.map(([T, fe]) => f.createElement(T, fe)),
        ...(Array.isArray(ue) ? ue : [ue]),
      ],
    ),
);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const je = (w, J) => {
  const S = f.forwardRef(({ className: b, ...V }, ue) =>
    f.createElement(ff, {
      ref: ue,
      iconNode: J,
      className: Pp(`lucide-${hf(yp(w))}`, `lucide-${w}`, b),
      ...V,
    }),
  );
  return ((S.displayName = yp(w)), S);
};
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const gf = [
    [
      "path",
      {
        d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
        key: "169zse",
      },
    ],
  ],
  eo = je("activity", gf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const bf = [
    ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
    ["path", { d: "M19 12H5", key: "x3x0zl" }],
  ],
  vf = je("arrow-left", bf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const yf = [
    ["path", { d: "m16 3 4 4-4 4", key: "1x1c3m" }],
    ["path", { d: "M20 7H4", key: "zbl0bi" }],
    ["path", { d: "m8 21-4-4 4-4", key: "h9nckh" }],
    ["path", { d: "M4 17h16", key: "g4d7ey" }],
  ],
  jf = je("arrow-right-left", yf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Nf = [
    ["path", { d: "M5 12h14", key: "1ays0h" }],
    ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }],
  ],
  _f = je("arrow-right", Nf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const wf = [
    ["path", { d: "M7 7h10v10", key: "1tivn9" }],
    ["path", { d: "M7 17 17 7", key: "1vkiza" }],
  ],
  kf = je("arrow-up-right", wf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Sf = [
    [
      "path",
      {
        d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
        key: "3c2336",
      },
    ],
    ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
    ["path", { d: "M9 9h.01", key: "1q5me6" }],
    ["path", { d: "M15 15h.01", key: "lqbp3k" }],
  ],
  Tf = je("badge-percent", Sf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Cf = [
    ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
    [
      "path",
      {
        d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
        key: "11g9vi",
      },
    ],
  ],
  Af = je("bell", Cf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Mf = [
    ["path", { d: "M12 7v14", key: "1akyts" }],
    [
      "path",
      {
        d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
        key: "ruj8y",
      },
    ],
  ],
  Pf = je("book-open", Mf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Lf = [
    ["path", { d: "M12 8V4H8", key: "hb8ula" }],
    [
      "rect",
      { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" },
    ],
    ["path", { d: "M2 14h2", key: "vft8re" }],
    ["path", { d: "M20 14h2", key: "4cs60a" }],
    ["path", { d: "M15 13v2", key: "1xurst" }],
    ["path", { d: "M9 13v2", key: "rq6x2g" }],
  ],
  uc = je("bot", Lf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Ef = [
    ["path", { d: "M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16", key: "jecpp" }],
    [
      "rect",
      { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" },
    ],
  ],
  Of = je("briefcase", Ef);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Df = [
    ["path", { d: "M10 12h4", key: "a56b0p" }],
    ["path", { d: "M10 8h4", key: "1sr2af" }],
    ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
    [
      "path",
      {
        d: "M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",
        key: "secmi2",
      },
    ],
    ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }],
  ],
  jp = je("building-2", Df);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Rf = [
    ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
    ["path", { d: "M18 17V9", key: "2bz60n" }],
    ["path", { d: "M13 17V5", key: "1frdt8" }],
    ["path", { d: "M8 17v-3", key: "17ska0" }],
  ],
  zf = je("chart-column", Rf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Bf = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]],
  ul = je("check", Bf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Hf = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]],
  Np = je("chevron-down", Hf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Uf = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
    ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }],
  ],
  to = je("circle-alert", Uf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const If = [
    ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
    ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }],
  ],
  tn = je("circle-check-big", If);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Gf = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }],
  ],
  hc = je("circle-check", Gf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Kf = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8", key: "1h4pet" }],
    ["path", { d: "M12 18V6", key: "zqpxq5" }],
  ],
  Zf = je("circle-dollar-sign", Kf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const qf = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
    ["path", { d: "M12 17h.01", key: "p32p05" }],
  ],
  ir = je("circle-question-mark", qf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Vf = [
    [
      "rect",
      {
        width: "8",
        height: "4",
        x: "8",
        y: "2",
        rx: "1",
        ry: "1",
        key: "tgr4d6",
      },
    ],
    [
      "path",
      {
        d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
        key: "116196",
      },
    ],
    ["path", { d: "m9 14 2 2 4-4", key: "df797q" }],
  ],
  Yf = je("clipboard-check", Vf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Xf = [
    ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ],
  Wr = je("clock", Xf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const $f = [
    ["circle", { cx: "8", cy: "8", r: "6", key: "3yglwk" }],
    ["path", { d: "M18.09 10.37A6 6 0 1 1 10.34 18", key: "t5s6rm" }],
    ["path", { d: "M7 6h1v4", key: "1obek4" }],
    ["path", { d: "m16.71 13.88.7.71-2.82 2.82", key: "1rbuyh" }],
  ],
  _p = je("coins", $f);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Jf = [
    [
      "path",
      {
        d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",
        key: "9ktpf1",
      },
    ],
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ],
  Qf = je("compass", Jf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Wf = [
    ["path", { d: "M12 20v2", key: "1lh1kg" }],
    ["path", { d: "M12 2v2", key: "tus03m" }],
    ["path", { d: "M17 20v2", key: "1rnc9c" }],
    ["path", { d: "M17 2v2", key: "11trls" }],
    ["path", { d: "M2 12h2", key: "1t8f8n" }],
    ["path", { d: "M2 17h2", key: "7oei6x" }],
    ["path", { d: "M2 7h2", key: "asdhe0" }],
    ["path", { d: "M20 12h2", key: "1q8mjw" }],
    ["path", { d: "M20 17h2", key: "1fpfkl" }],
    ["path", { d: "M20 7h2", key: "1o8tra" }],
    ["path", { d: "M7 20v2", key: "4gnj0m" }],
    ["path", { d: "M7 2v2", key: "1i4yhu" }],
    [
      "rect",
      { x: "4", y: "4", width: "16", height: "16", rx: "2", key: "1vbyd7" },
    ],
    [
      "rect",
      { x: "8", y: "8", width: "8", height: "8", rx: "1", key: "z9xiuo" },
    ],
  ],
  mc = je("cpu", Wf);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Ff = [
    [
      "rect",
      { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" },
    ],
    ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }],
  ],
  sr = je("credit-card", Ff);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const e0 = [
    ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
    ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
    ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }],
  ],
  $n = je("database", e0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const t0 = [
    ["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }],
    [
      "path",
      { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" },
    ],
  ],
  a0 = je("dollar-sign", t0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const s0 = [
    ["path", { d: "M12 15V3", key: "m9g1x1" }],
    ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
    ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }],
  ],
  pc = je("download", s0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const n0 = [
    [
      "path",
      {
        d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
        key: "ct8e1f",
      },
    ],
    ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
    [
      "path",
      {
        d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
        key: "13bj9a",
      },
    ],
    ["path", { d: "m2 2 20 20", key: "1ooewy" }],
  ],
  i0 = je("eye-off", n0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const l0 = [
    [
      "path",
      {
        d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
        key: "1nclc0",
      },
    ],
    ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
  ],
  r0 = je("eye", l0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const o0 = [
    ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
    ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }],
    ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
    [
      "path",
      {
        d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",
        key: "1mlx9k",
      },
    ],
  ],
  wp = je("file-code", o0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const c0 = [
    [
      "path",
      {
        d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
        key: "1rqfz7",
      },
    ],
    ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
    ["path", { d: "M10 9H8", key: "b1mrlr" }],
    ["path", { d: "M16 13H8", key: "t4e002" }],
    ["path", { d: "M16 17H8", key: "z1uh3a" }],
  ],
  hu = je("file-text", c0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const d0 = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    [
      "path",
      { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" },
    ],
    ["path", { d: "M2 12h20", key: "9i4pu4" }],
  ],
  ao = je("globe", d0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const u0 = [
    ["line", { x1: "22", x2: "2", y1: "12", y2: "12", key: "1y58io" }],
    [
      "path",
      {
        d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",
        key: "oot6mr",
      },
    ],
    ["line", { x1: "6", x2: "6.01", y1: "16", y2: "16", key: "sgf278" }],
    ["line", { x1: "10", x2: "10.01", y1: "16", y2: "16", key: "1l4acy" }],
  ],
  h0 = je("hard-drive", u0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const m0 = [
    [
      "path",
      { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" },
    ],
    ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
    ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }],
  ],
  kp = je("history", m0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const p0 = [
    ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
    ["path", { d: "M12 16v-4", key: "1dtifu" }],
    ["path", { d: "M12 8h.01", key: "e9boi3" }],
  ],
  x0 = je("info", p0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const f0 = [
    [
      "path",
      {
        d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",
        key: "g0fldk",
      },
    ],
    ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
    ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }],
  ],
  xc = je("key", f0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const g0 = [
    ["path", { d: "M10 18v-7", key: "wt116b" }],
    [
      "path",
      {
        d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",
        key: "1m329m",
      },
    ],
    ["path", { d: "M14 18v-7", key: "vav6t3" }],
    ["path", { d: "M18 18v-7", key: "aexdmj" }],
    ["path", { d: "M3 22h18", key: "8prr45" }],
    ["path", { d: "M6 18v-7", key: "1ivflk" }],
  ],
  Lp = je("landmark", g0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const b0 = [
    [
      "path",
      {
        d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
        key: "zw3jo",
      },
    ],
    [
      "path",
      {
        d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
        key: "1wduqc",
      },
    ],
    [
      "path",
      {
        d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
        key: "kqbvx6",
      },
    ],
  ],
  v0 = je("layers", b0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const y0 = [
    [
      "rect",
      {
        width: "18",
        height: "11",
        x: "3",
        y: "11",
        rx: "2",
        ry: "2",
        key: "1w4ew1",
      },
    ],
    ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }],
  ],
  Ep = je("lock", y0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const j0 = [
    ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
    ["path", { d: "M21 12H9", key: "dn1m92" }],
    ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }],
  ],
  N0 = je("log-out", j0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const _0 = [
    ["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
    [
      "rect",
      { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" },
    ],
  ],
  w0 = je("mail", _0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const k0 = [
    [
      "path",
      {
        d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
        key: "1r0f0z",
      },
    ],
    ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }],
  ],
  ou = je("map-pin", k0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const S0 = [
    [
      "path",
      {
        d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
        key: "169xi5",
      },
    ],
    ["path", { d: "M15 5.764v15", key: "1pn4in" }],
    ["path", { d: "M9 3.236v15", key: "1uimfh" }],
  ],
  T0 = je("map", S0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const C0 = [
    ["path", { d: "M4 5h16", key: "1tepv9" }],
    ["path", { d: "M4 12h16", key: "1lakjw" }],
    ["path", { d: "M4 19h16", key: "1djgab" }],
  ],
  A0 = je("menu", C0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const M0 = [
    [
      "path",
      {
        d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
        key: "18887p",
      },
    ],
  ],
  bc = je("message-square", M0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const P0 = [
    [
      "rect",
      { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" },
    ],
    [
      "rect",
      { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" },
    ],
    [
      "rect",
      { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" },
    ],
    ["path", { d: "M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3", key: "1jsf9p" }],
    ["path", { d: "M12 12V8", key: "2874zd" }],
  ],
  cu = je("network", P0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const L0 = [
    [
      "path",
      {
        d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
        key: "1a8usu",
      },
    ],
  ],
  E0 = je("pen", L0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const O0 = [
    [
      "path",
      {
        d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
        key: "9njp5v",
      },
    ],
  ],
  D0 = je("phone", O0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const R0 = [
    [
      "path",
      {
        d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
        key: "10ikf1",
      },
    ],
  ],
  Sp = je("play", R0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const z0 = [
    ["path", { d: "M5 12h14", key: "1ays0h" }],
    ["path", { d: "M12 5v14", key: "s699le" }],
  ],
  jn = je("plus", z0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const B0 = [
    ["path", { d: "M18.36 6.64A9 9 0 0 1 20.77 15", key: "dxknvb" }],
    ["path", { d: "M6.16 6.16a9 9 0 1 0 12.68 12.68", key: "1x7qb5" }],
    ["path", { d: "M12 2v4", key: "3427ic" }],
    ["path", { d: "m2 2 20 20", key: "1ooewy" }],
  ],
  H0 = je("power-off", B0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const U0 = [
    [
      "path",
      {
        d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",
        key: "143wyd",
      },
    ],
    ["path", { d: "M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6", key: "1itne7" }],
    [
      "rect",
      { x: "6", y: "14", width: "12", height: "8", rx: "1", key: "1ue0tg" },
    ],
  ],
  Op = je("printer", U0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const I0 = [
    [
      "rect",
      { width: "5", height: "5", x: "3", y: "3", rx: "1", key: "1tu5fj" },
    ],
    [
      "rect",
      { width: "5", height: "5", x: "16", y: "3", rx: "1", key: "1v8r4q" },
    ],
    [
      "rect",
      { width: "5", height: "5", x: "3", y: "16", rx: "1", key: "1x03jg" },
    ],
    ["path", { d: "M21 16h-3a2 2 0 0 0-2 2v3", key: "177gqh" }],
    ["path", { d: "M21 21v.01", key: "ents32" }],
    ["path", { d: "M12 7v3a2 2 0 0 1-2 2H7", key: "8crl2c" }],
    ["path", { d: "M3 12h.01", key: "nlz23k" }],
    ["path", { d: "M12 3h.01", key: "n36tog" }],
    ["path", { d: "M12 16v.01", key: "133mhm" }],
    ["path", { d: "M16 12h1", key: "1slzba" }],
    ["path", { d: "M21 12v.01", key: "1lwtk9" }],
    ["path", { d: "M12 21v-1", key: "1880an" }],
  ],
  fc = je("qr-code", I0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const G0 = [
    ["path", { d: "M16.247 7.761a6 6 0 0 1 0 8.478", key: "1fwjs5" }],
    ["path", { d: "M19.075 4.933a10 10 0 0 1 0 14.134", key: "ehdyv1" }],
    ["path", { d: "M4.925 19.067a10 10 0 0 1 0-14.134", key: "1q22gi" }],
    ["path", { d: "M7.753 16.239a6 6 0 0 1 0-8.478", key: "r2q7qm" }],
    ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
  ],
  gc = je("radio", G0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const K0 = [
    [
      "path",
      {
        d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",
        key: "q3az6g",
      },
    ],
    ["path", { d: "M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8", key: "1h4pet" }],
    ["path", { d: "M12 17.5v-11", key: "1jc1ny" }],
  ],
  nr = je("receipt", K0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Z0 = [
    [
      "path",
      {
        d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",
        key: "v9h5vc",
      },
    ],
    ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
    [
      "path",
      {
        d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",
        key: "3uifl3",
      },
    ],
    ["path", { d: "M8 16H3v5", key: "1cv678" }],
  ],
  Va = je("refresh-cw", Z0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const q0 = [
    ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
    ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
  ],
  Pi = je("search", q0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const V0 = [
    [
      "path",
      {
        d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
        key: "1ffxy3",
      },
    ],
    ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }],
  ],
  vc = je("send", V0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Y0 = [
    [
      "rect",
      {
        width: "20",
        height: "8",
        x: "2",
        y: "2",
        rx: "2",
        ry: "2",
        key: "ngkwjq",
      },
    ],
    [
      "rect",
      {
        width: "20",
        height: "8",
        x: "2",
        y: "14",
        rx: "2",
        ry: "2",
        key: "iecqi9",
      },
    ],
    ["line", { x1: "6", x2: "6.01", y1: "6", y2: "6", key: "16zg32" }],
    ["line", { x1: "6", x2: "6.01", y1: "18", y2: "18", key: "nzw8ys" }],
  ],
  Tp = je("server", Y0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const X0 = [
    [
      "path",
      {
        d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
        key: "1i5ecw",
      },
    ],
    ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
  ],
  mu = je("settings", X0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const $0 = [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
    ["path", { d: "M12 8v4", key: "1got3b" }],
    ["path", { d: "M12 16h.01", key: "1drbdi" }],
  ],
  du = je("shield-alert", $0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const J0 = [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
    ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }],
  ],
  so = je("shield-check", J0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const Q0 = [
    [
      "path",
      {
        d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
        key: "oel41y",
      },
    ],
  ],
  Dp = je("shield", Q0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const W0 = [
    ["path", { d: "M10 8h4", key: "1sr2af" }],
    ["path", { d: "M12 21v-9", key: "17s77i" }],
    ["path", { d: "M12 8V3", key: "13r4qs" }],
    ["path", { d: "M17 16h4", key: "h1uq16" }],
    ["path", { d: "M19 12V3", key: "o1uvq1" }],
    ["path", { d: "M19 21v-5", key: "qua636" }],
    ["path", { d: "M3 14h4", key: "bcjad9" }],
    ["path", { d: "M5 10V3", key: "cb8scm" }],
    ["path", { d: "M5 21v-7", key: "1w1uti" }],
  ],
  F0 = je("sliders-vertical", W0);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const eg = [
    [
      "rect",
      {
        width: "14",
        height: "20",
        x: "5",
        y: "2",
        rx: "2",
        ry: "2",
        key: "1yt0o3",
      },
    ],
    ["path", { d: "M12 18h.01", key: "mhygvu" }],
  ],
  Fr = je("smartphone", eg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const tg = [
    [
      "path",
      {
        d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
        key: "1s2grr",
      },
    ],
    ["path", { d: "M20 2v4", key: "1rf3ol" }],
    ["path", { d: "M22 4h-4", key: "gwowj6" }],
    ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }],
  ],
  no = je("sparkles", tg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const ag = [
    [
      "path",
      {
        d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",
        key: "2acyp4",
      },
    ],
    ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }],
  ],
  er = je("square-check-big", ag);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const sg = [
    [
      "rect",
      { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" },
    ],
  ],
  tr = je("square", sg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const ng = [
    ["path", { d: "M12 19h8", key: "baeox8" }],
    ["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }],
  ],
  Rp = je("terminal", ng);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const ig = [
    ["path", { d: "M10 11v6", key: "nco0om" }],
    ["path", { d: "M14 11v6", key: "outv1u" }],
    ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
    ["path", { d: "M3 6h18", key: "d0wm0j" }],
    ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }],
  ],
  ms = je("trash-2", ig);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const lg = [
    ["path", { d: "M16 7h6v6", key: "box55l" }],
    ["path", { d: "m22 7-8.5 8.5-5-5L2 17", key: "1t1m79" }],
  ],
  pu = je("trending-up", lg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const rg = [
    [
      "path",
      {
        d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
        key: "wmoenq",
      },
    ],
    ["path", { d: "M12 9v4", key: "juzpu7" }],
    ["path", { d: "M12 17h.01", key: "p32p05" }],
  ],
  Xn = je("triangle-alert", rg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const og = [
    ["path", { d: "M12 3v12", key: "1x0j5s" }],
    ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
    ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
  ],
  Cp = je("upload", og);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const cg = [
    ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
    ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
    ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
    ["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }],
  ],
  zp = je("user-plus", cg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const dg = [
    ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
    ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }],
  ],
  xu = je("user", dg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const ug = [
    ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
    ["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
    ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
    ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
  ],
  Jn = je("users", ug);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const hg = [
    [
      "path",
      {
        d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",
        key: "18etb6",
      },
    ],
    ["path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4", key: "xoc0q4" }],
  ],
  Ap = je("wallet", hg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const mg = [
    ["path", { d: "M12 20h.01", key: "zekei9" }],
    ["path", { d: "M2 8.82a15 15 0 0 1 20 0", key: "dnpr2z" }],
    ["path", { d: "M5 12.859a10 10 0 0 1 14 0", key: "1x1e6c" }],
    ["path", { d: "M8.5 16.429a5 5 0 0 1 7 0", key: "1bycff" }],
  ],
  Nn = je("wifi", mg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const pg = [
    ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
    ["path", { d: "m6 6 12 12", key: "d8bk6v" }],
  ],
  la = je("x", pg);
/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */ const xg = [
    [
      "path",
      {
        d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
        key: "1xq2db",
      },
    ],
  ],
  ar = je("zap", xg);
function fg({
  currentView: w,
  setView: J,
  activeRole: S,
  isOpen: b,
  onClose: V,
}) {
  const re = [
    {
      group: "Pemilik Web (SaaS)",
      roles: ["saas_admin"],
      links: [{ id: "saas_admin", label: "Control Room SaaS", icon: v0 }],
    },
    {
      group: "Utama",
      roles: ["Super Admin", "Owner", "Admin", "Finance", "NOC", "Technician"],
      links: [
        { id: "dashboard", label: "Dashboard NOC", icon: mc },
        { id: "analytics", label: "Data Analytics", icon: zf },
      ],
    },
    {
      group: "Klien & Layanan",
      roles: ["Super Admin", "Owner", "Admin", "Finance", "Technician"],
      links: [
        { id: "customers", label: "Pelanggan CRM", icon: Jn },
        { id: "billing", label: "Billing & Invoice", icon: nr },
        { id: "internet", label: "Layanan PPPoE/Hotspot", icon: Nn },
        { id: "resellers", label: "Kios & Reseller Agen", icon: ao },
      ],
    },
    {
      group: "Infrastruktur",
      roles: ["Super Admin", "Owner", "Admin", "NOC", "Technician"],
      links: [{ id: "network", label: "Router & OLT/ACS", icon: gc }],
    },
    {
      group: "Tiket & Lapangan",
      roles: ["Super Admin", "Owner", "Admin", "Technician"],
      links: [{ id: "support", label: "Ticketing & Wo", icon: ir }],
    },
    {
      group: "Notifikasi & Sistem",
      roles: ["Super Admin", "Owner", "Admin", "Finance", "NOC"],
      links: [
        { id: "comms", label: "Log WhatsApp/TG", icon: bc },
        { id: "ai_local", label: "AI Network Guru 🤖", icon: no },
        { id: "settings", label: "Pengaturan & RBAC", icon: mu },
      ],
    },
  ].filter((ee) => ee.roles.includes(S));
  return e.jsxs("div", {
    id: "side-navigation",
    className: `fixed md:relative top-0 bottom-0 left-0 z-50 w-64 bg-slate-900 border-r border-slate-800 text-slate-300 flex flex-col h-full select-none transition-transform duration-300 md:translate-x-0 ${b ? "translate-x-0" : "-translate-x-full"}`,
    children: [
      e.jsxs("div", {
        className:
          "p-5 border-b border-slate-800 flex items-center justify-between",
        children: [
          e.jsxs("div", {
            className: "flex items-center gap-3",
            children: [
              e.jsx("div", {
                className:
                  "h-9 w-9 rounded-lg bg-blue-600 flex items-center justify-center font-display font-bold text-white text-xl tracking-tight shadow-md shadow-blue-500/20",
                children: "M",
              }),
              e.jsxs("div", {
                children: [
                  e.jsx("h1", {
                    className:
                      "font-display font-bold text-white text-base tracking-tight",
                    children: "MikRobiL",
                  }),
                  e.jsx("p", {
                    className:
                      "text-[10px] text-slate-400 font-mono tracking-wider",
                    children: "OSS/BSS SaaS v1.0",
                  }),
                ],
              }),
            ],
          }),
          V &&
            e.jsx("button", {
              type: "button",
              onClick: V,
              className:
                "p-1 px-2 text-slate-400 hover:text-white rounded-lg md:hidden cursor-pointer shrink-0 border border-slate-800 hover:bg-slate-850",
              title: "Tutup Navigasi",
              children: e.jsx(la, { className: "h-4 w-4" }),
            }),
        ],
      }),
      e.jsx("div", {
        className: "flex-1 overflow-y-auto custom-scroll p-4 space-y-6",
        children: re.map((ee, B) =>
          e.jsxs(
            "div",
            {
              className: "space-y-2",
              children: [
                e.jsx("span", {
                  className:
                    "text-[11px] font-bold text-slate-500 uppercase tracking-widest px-3 block",
                  children: ee.group,
                }),
                e.jsx("div", {
                  className: "space-y-1",
                  children: ee.links.map((T) => {
                    const fe = T.icon,
                      G = w === T.id;
                    return e.jsxs(
                      "button",
                      {
                        id: `nav-item-${T.id}`,
                        onClick: () => {
                          (J(T.id), V && V());
                        },
                        className: `w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200 cursor-pointer ${G ? "bg-blue-600 text-white shadow-lg shadow-blue-600/10" : "hover:bg-slate-800/60 hover:text-white text-slate-400"}`,
                        children: [
                          e.jsx(fe, {
                            className: `h-4 w-4 shrink-0 ${G ? "text-white" : "text-slate-400 group-hover:text-white"}`,
                          }),
                          e.jsx("span", { children: T.label }),
                        ],
                      },
                      T.id,
                    );
                  }),
                }),
              ],
            },
            B,
          ),
        ),
      }),
      e.jsx("div", {
        className: "p-4 border-t border-slate-800 bg-slate-950/40",
        children: e.jsxs("div", {
          className: "flex items-center gap-3",
          children: [
            e.jsx("div", {
              className:
                "h-8 w-8 rounded-full bg-slate-800 flex items-center justify-center text-xs font-bold text-blue-400",
              children: S.substring(0, 2).toUpperCase(),
            }),
            e.jsxs("div", {
              className: "flex-1 min-w-0",
              children: [
                e.jsx("h4", {
                  id: "user-display-name",
                  className: "text-xs font-semibold text-white truncate",
                  children: "Administrator",
                }),
                e.jsxs("div", {
                  className: "flex items-center gap-1.5 mt-0.5",
                  children: [
                    e.jsx("span", {
                      className:
                        "h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse",
                    }),
                    e.jsxs("span", {
                      id: "role-display-indicator",
                      className:
                        "text-[10px] text-blue-400 font-mono capitalize tracking-wider font-semibold",
                      children: [S, " Role"],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
function gg({
  activeRole: w,
  setActiveRole: J,
  onLogout: S,
  alerts: b,
  unreadCount: V,
  onToggleSidebar: ue,
  userSession: re,
}) {
  var ie, $, de;
  window.currentUserSession = re;
  const [globalDarkMode, setGlobalDarkMode] = f.useState(() => localStorage.getItem("mikrobil_dark_mode") === "true"),
    [ee, B] = f.useState(!1),
    [T, fe] = f.useState(!1),
    [G, F] = f.useState({ status: "loading", ping: null }),
    [X, Z] = f.useState({ status: "loading", active_nas_count: 0 }),
    [ce, ve] = f.useState(!1),
    [xe, ye] = f.useState(!1),
    [dgLogs, setDgLogs] = f.useState([]),
    [dgRunning, setDgRunning] = f.useState(!1),
    [dgResult, setDgResult] = f.useState(null),
    runDiagnostics = async () => {
      setDgRunning(!0);
      setDgLogs([{ timestamp: new Date().toISOString(), level: "info", message: "Menginisiasi modul uji koneksi..." }]);
      try {
        const res = await (await fetch("/api/v1/radius/diagnose")).json();
        setDgLogs(res.logs || []);
        setDgResult(res);
      } catch (err) {
        setDgLogs([
          { timestamp: new Date().toISOString(), level: "info", message: "Menginisiasi modul uji koneksi..." },
          { timestamp: new Date().toISOString(), level: "error", message: "Gagal berkomunikasi dengan server diagnosis." }
        ]);
        setDgResult({ success: false });
      } finally {
        setDgRunning(!1);
      }
    },
    He = async () => {
      try {
        const be = await (await fetch("/api/v1/radius/status")).json();
        be.status === "success"
          ? Z({ status: be.data.status, active_nas_count: be.data.active_nas_count, vpn_simulation_active: be.data.vpn_simulation_active })
          : Z({ status: "disconnected", active_nas_count: 0, vpn_simulation_active: false });
      } catch {
        Z({ status: "disconnected", active_nas_count: 0, vpn_simulation_active: false });
      }
    },
    Re = async () => {
      (ye(!0),
        await He(),
        setTimeout(() => {
          ye(!1);
        }, 500));
    },
    Y = async () => {
      try {
        const be = await (await fetch("/api/v1/routers/1/status")).json();
        be.status === "success"
          ? F({ status: be.data.status, ping: be.data.api_ping_ms })
          : F({ status: "offline", ping: null });
      } catch {
        F({ status: "offline", ping: null });
      }
    },
    Ee = async () => {
      (ve(!0),
        await Y(),
        setTimeout(() => {
          ve(!1);
        }, 500));
    };
  f.useEffect(() => {
    Y();
    He();
    const oe = setInterval(() => {
      Y();
      He();
    }, 1e4);
    return () => clearInterval(oe);
  }, []);
  f.useEffect(() => {
    localStorage.setItem("mikrobil_dark_mode", globalDarkMode);
    document.documentElement.classList.toggle("dark", globalDarkMode);
    let styleTag = document.getElementById("dark-theme-override");
    if (globalDarkMode && !styleTag) {
      styleTag = document.createElement("style");
      styleTag.id = "dark-theme-override";
      styleTag.textContent = ':root { --color-slate-50: #0f172a !important; --color-slate-100: #1e293b !important; --color-slate-200: #334155 !important; --color-white: #0f172a !important; } body, html, #root { background-color: #0b0f19 !important; color: #f1f5f9 !important; } .bg-white, .bg-slate-50, [class*="bg-slate-50/"] { background-color: #111827 !important; border-color: #1f2937 !important; color: #f1f5f9 !important; } .text-slate-800, .text-slate-900, .text-slate-705, .text-slate-700 { color: #f1f5f9 !important; } .text-slate-500, .text-slate-650, .text-slate-600, .text-slate-400 { color: #94a3b8 !important; } .border-slate-200, .border-slate-100, .border-slate-150 { border-color: #1f2937 !important; } input, select, textarea { background-color: #1f2937 !important; border-color: #374151 !important; color: #fff !important; } table, thead, tbody, tr, td, th { background-color: #111827 !important; color: #e5e7eb !important; border-color: #1f2937 !important; } tr:hover, .bg-slate-100 { background-color: #1e293b !important; }';
      document.head.appendChild(styleTag);
    } else if (!globalDarkMode && styleTag) {
      styleTag.remove();
    }
  }, [globalDarkMode]);
  const Se = [
      "Owner",
      "Admin",
      "Finance",
      "NOC",
      "Technician",
      "Customer",
      "saas_admin",
    ],
    le =
      ((ie = re == null ? void 0 : re.user) == null ? void 0 : ie.role_id) === 1
        ? Se
        : Se.filter((oe) => oe !== "saas_admin");
  return e.jsxs("div", {
    className:
      "h-16 border-b border-slate-200 bg-white flex items-center justify-between px-4 md:px-6 select-none relative",
    children: [
      e.jsxs("div", {
        className: "flex items-center gap-2",
        children: [
          ue &&
            e.jsx("button", {
              type: "button",
              onClick: ue,
              className:
                "p-1.5 text-slate-600 hover:text-slate-900 hover:bg-slate-100 rounded-lg md:hidden cursor-pointer shrink-0",
              title: "Buka Navigasi",
              children: e.jsx(A0, { className: "h-5 w-5" }),
            }),
          e.jsx(so, { className: "h-5 w-5 text-blue-600 shrink-0" }),
          e.jsx("h2", {
            className:
              "text-sm font-semibold text-slate-800 font-display hidden xl:block",
            children: re?.tenant?.company_name || re?.tenant?.name || "PT Jaya Solusi Network Portal",
          }),
          e.jsxs("div", {
            id: "top-router-ping-status",
            onClick: async () => {
              ve(!0);
              ye(!0);
              await Y();
              await He();
              setTimeout(() => {
                ve(!1);
                ye(!1);
              }, 500);
            },
            className:
              "flex items-center gap-1.5 md:gap-2 border-l border-slate-200 pl-3 ml-1 text-xs cursor-pointer select-none group",
            title:
              "Indikator Koneksi MikroTik. Klik untuk ping manual.",
            children: [
              e.jsx("span", {
                className:
                  "text-slate-450 font-mono text-[10px] hidden sm:inline uppercase tracking-wider font-bold",
                children: "MikroTik Gateway:",
              }),
              G.status === "loading" || X.status === "loading"
                ? e.jsxs("div", {
                    className: "flex items-center gap-1.5 text-slate-400",
                    children: [
                      e.jsx("span", {
                        className:
                          "h-2 w-2 rounded-full bg-slate-300 animate-pulse",
                      }),
                      e.jsx("span", {
                        className:
                          "text-[10px] uppercase font-bold tracking-wider font-mono",
                        children: "Checking...",
                      }),
                    ],
                  })
                : G.status === "online" && X.status === "connected"
                  ? e.jsxs("div", {
                      className:
                        "flex items-center gap-1.5 bg-green-50 text-green-700 px-3 py-1 rounded-full border border-green-200 font-sans font-bold text-[10.5px] shadow-inner hover:bg-green-100 transition-colors",
                      children: [
                        e.jsxs("span", {
                          className: "relative flex h-1.5 w-1.5 shrink-0",
                          children: [
                            e.jsx("span", {
                              className:
                                "animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75",
                            }),
                            e.jsx("span", {
                              className:
                                "relative inline-flex rounded-full h-1.5 w-1.5 bg-green-500",
                            }),
                          ],
                        }),
                        e.jsxs("span", {
                          children: [
                            "Online ",
                            G.ping ? `(${G.ping}ms)` : "",
                            " • RADIUS Hubung",
                          ],
                        }),
                        e.jsx(Va, {
                          className: `h-3 w-3 text-green-600 transition-all ${ce || xe ? "animate-spin" : "group-hover:rotate-45"}`,
                        }),
                      ],
                    })
                  : e.jsxs("div", {
                      className:
                        "flex items-center gap-1.5 bg-rose-50 text-rose-700 px-3 py-1 rounded-full border border-rose-200 font-sans font-bold text-[10.5px] shadow-inner hover:bg-rose-100 transition-colors",
                      children: [
                        e.jsx("span", {
                          className:
                            "relative flex h-1.5 w-1.5 shrink-0 animate-pulse",
                          children: e.jsx("span", {
                            className:
                              "relative inline-flex rounded-full h-1.5 w-1.5 bg-rose-500",
                          }),
                        }),
                        e.jsx("span", {
                          children: G.status === "online" && X.status !== "connected"
                            ? [
                                "Online ",
                                G.ping ? `(${G.ping}ms)` : "",
                                " • RADIUS Putus",
                              ]
                            : "Offline",
                        }),
                        e.jsx(Va, {
                          className: `h-3 w-3 text-rose-600 transition-all ${ce || xe ? "animate-spin" : "group-hover:rotate-45"}`,
                        }),
                      ],
                    }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "flex items-center gap-4",
        children: [
          ((($ = re == null ? void 0 : re.user) == null
            ? void 0
            : $.role_id) === 1 ||
            ((de = re == null ? void 0 : re.user) == null
              ? void 0
              : de.role_id) === 2 ||
            !re) &&
            e.jsxs("div", {
              id: "role-simulator-container",
              className:
                "flex items-center gap-2 bg-blue-50 border border-blue-200 rounded-lg px-3 py-1.5",
              children: [
                e.jsx("span", {
                  className:
                    "text-[10px] uppercase font-mono font-bold tracking-widest text-blue-700",
                  children: "Simulator RBAC:",
                }),
                e.jsxs("div", {
                  className: "relative",
                  children: [
                    e.jsx("select", {
                      id: "role-simulator-select",
                      value: w,
                      onChange: (oe) => {
                        J(oe.target.value);
                      },
                      className:
                        "text-xs font-semibold text-blue-800 bg-transparent pr-6 focus:outline-none cursor-pointer capitalize font-sans",
                      children: le.map((oe) =>
                        e.jsx(
                          "option",
                          {
                            value: oe,
                            className: "text-slate-800 bg-white",
                            children:
                              oe === "saas_admin"
                                ? "SaaS Admin (Pemilik Web)"
                                : oe,
                          },
                          oe,
                        ),
                      ),
                    }),
                    e.jsx(Np, {
                      className:
                        "h-3 w-3 text-blue-600 absolute right-0 top-1/2 -translate-y-1/2 pointer-events-none",
                    }),
                  ],
                }),
              ],
            }),
          e.jsx("button", {
            id: "global-theme-toggle",
            type: "button",
            onClick: () => setGlobalDarkMode(!globalDarkMode),
            "aria-label": globalDarkMode ? "Aktifkan mode terang" : "Aktifkan mode gelap",
            title: globalDarkMode ? "Mode terang" : "Mode gelap",
            className: "p-2 text-slate-500 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white rounded-full hover:bg-slate-100 dark:hover:bg-slate-800 transition-all cursor-pointer",
            children: globalDarkMode ? "☀️" : "🌙",
          }),
          e.jsxs("div", {
            className: "relative",
            children: [
              e.jsxs("button", {
                id: "notifications-bell",
                onClick: () => B(!ee),
                className:
                  "p-2 text-slate-500 hover:text-slate-800 rounded-full hover:bg-slate-100 transition-all cursor-pointer relative",
                children: [
                  e.jsx(Af, { className: "h-5 w-5" }),
                  V > 0 &&
                    e.jsx("span", {
                      id: "notifications-count-badge",
                      className:
                        "absolute top-1.5 right-1.5 h-4 min-w-4 rounded-full bg-rose-500 px-1 border-2 border-white flex items-center justify-center text-[9px] font-bold text-white leading-none",
                      children: V,
                    }),
                ],
              }),
              ee &&
                e.jsxs("div", {
                  id: "notifications-dropdown-menu",
                  className:
                    "absolute right-0 mt-2 w-80 bg-white border border-slate-200 rounded-xl shadow-xl z-50 overflow-hidden py-1",
                  children: [
                    e.jsxs("div", {
                      className:
                        "px-4 py-2.5 bg-slate-50 border-b border-slate-100 flex items-center justify-between",
                      children: [
                        e.jsx("span", {
                          className: "text-xs font-bold text-slate-800",
                          children: "Pemberitahuan Sistem NOC",
                        }),
                        e.jsx("span", {
                          className:
                            "text-[10px] text-blue-600 font-semibold font-mono",
                          children: "Live",
                        }),
                      ],
                    }),
                    e.jsx("div", {
                      className:
                        "max-h-64 overflow-y-auto custom-scroll divide-y divide-slate-100",
                      children:
                        b.length === 0
                          ? e.jsx("p", {
                              className:
                                "p-4 text-center text-xs text-slate-400",
                              children: "Tidak ada notifikasi aktif.",
                            })
                          : b.map((oe) =>
                              e.jsxs(
                                "div",
                                {
                                  className:
                                    "p-3 hover:bg-slate-50 transition-colors flex gap-2",
                                  children: [
                                    e.jsx("div", {
                                      className: "mt-0.5 shrink-0",
                                      children:
                                        oe.severity === "danger"
                                          ? e.jsx(Xn, {
                                              className:
                                                "h-4 w-4 text-rose-500",
                                            })
                                          : oe.severity === "warning"
                                            ? e.jsx(Xn, {
                                                className:
                                                  "h-4 w-4 text-amber-500",
                                              })
                                            : e.jsx(so, {
                                                className:
                                                  "h-4 w-4 text-blue-500",
                                              }),
                                    }),
                                    e.jsxs("div", {
                                      children: [
                                        e.jsx("h4", {
                                          className:
                                            "text-xs font-bold text-slate-800",
                                          children: oe.title,
                                        }),
                                        e.jsx("p", {
                                          className:
                                            "text-[11px] text-slate-500 leading-normal mt-0.5",
                                          children: oe.message,
                                        }),
                                        e.jsx("span", {
                                          className:
                                            "text-[9px] text-slate-400 block mt-1 font-mono",
                                          children: new Date(
                                            oe.timestamp,
                                          ).toLocaleTimeString("id-ID", {
                                            hour: "2-digit",
                                            minute: "2-digit",
                                          }),
                                        }),
                                      ],
                                    }),
                                  ],
                                },
                                oe.id,
                              ),
                            ),
                    }),
                  ],
                }),
            ],
          }),
          e.jsxs("div", {
            className: "relative",
            children: [
              e.jsxs("button", {
                id: "profile-dropdown-btn",
                onClick: () => fe(!T),
                className:
                  "flex items-center gap-2.5 p-1 rounded-full hover:bg-slate-50 cursor-pointer text-left",
                children: [
                  e.jsx("div", {
                    className:
                      "h-8 w-8 rounded-full bg-blue-100 border border-blue-200 flex items-center justify-center text-xs font-bold text-blue-700",
                    children: re?.user?.name ? re.user.name.split(" ").map((n2) => n2[0]).join("").slice(0, 2).toUpperCase() : "JN",
                  }),
                  e.jsxs("div", {
                    className: "hidden md:block",
                    children: [
                      e.jsx("h4", {
                        className: "text-xs font-bold text-slate-800",
                        children: re?.user?.name || "Jaya Net Operator",
                      }),
                      e.jsx("p", {
                        className:
                          "text-[10px] text-slate-400 font-mono capitalize",
                        children: w,
                      }),
                    ],
                  }),
                  e.jsx(Np, { className: "h-3.5 w-3.5 text-slate-400" }),
                ],
              }),
              T &&
                e.jsxs("div", {
                  id: "profile-dropdown-menu",
                  className:
                    "absolute right-0 mt-2 w-48 bg-white border border-slate-200 rounded-xl shadow-xl z-50 py-1 font-sans",
                  children: [
                    e.jsxs("div", {
                      className: "px-4 py-2 border-b border-slate-100",
                      children: [
                        e.jsx("span", {
                          className:
                            "text-[10px] font-bold text-slate-400 uppercase tracking-widest",
                          children: "ID Tenant",
                        }),
                        e.jsx("p", {
                          className:
                            "text-xs font-mono font-bold text-slate-700",
                          children: re?.tenant?.name ? "#" + String(re.tenant.id).padStart(5, "0") + " (" + (re.tenant.company_name || re.tenant.name) + ")" : "#00001 (PT JSN)",
                        }),
                      ],
                    }),
                    e.jsxs("button", {
                      onClick: S,
                      className:
                        "w-full flex items-center gap-2 px-4 py-2.5 text-rose-600 hover:bg-rose-50 text-xs font-semibold cursor-pointer",
                      children: [
                        e.jsx(N0, { className: "h-4 w-4" }),
                        e.jsx("span", { children: "Keluar Aplikasi" }),
                      ],
                    }),
                  ],
                }),
            ],
          }),
        ],
      }),
    ],
  });
}
function bg({ onLogin: w, onRegister: J, onEnterDemo: S }) {
  const [b, V] = f.useState("getting-started");
  const [ue, setUe] = f.useState([
    {
      id: "starter",
      name: "Starter Plan",
      price: "Rp 150.000",
      cycle: "/ bulan",
      desc: "Cocok untuk wirausaha RT/RW Net pemula atau ISP mandiri skala kecil.",
      quota: [
        "Maksimal 100 Pelanggan",
        "Maksimal 3 Router Mikrotik",
        "Maksimal 1 OLT PON",
        "PPPoE & Hotspot Manager",
        "Sistem Denda & Isolasi Otomatis",
        "Notifikasi Sistem Dasar",
      ],
      cta: "Mulai Trial Gratis",
      popular: !1,
    },
    {
      id: "pro",
      name: "Professional Plan",
      price: "Rp 500.000",
      cycle: "/ bulan",
      desc: "Pilihan terbaik untuk local ISP berkembang & operator RT/RW Net meluas.",
      quota: [
        "Maksimal 1000 Pelanggan",
        "Maksimal 20 Router Mikrotik",
        "Maksimal 5 OLT PON",
        "Support Integrasi GenieACS",
        "Payment Gateway (Midtrans/Xendit)",
        "Notifikasi WhatsApp & Telegram",
        "NOC Real-Time Dashboard & Maps",
      ],
      cta: "Rekomendasi Terbaik",
      popular: !0,
    },
    {
      id: "enterprise",
      name: "Enterprise",
      price: "Rp 1.500.000",
      cycle: "/ bulan",
      desc: "Solusi lengkap tanpa batasan untuk ISP Nasional, Korporasi & WISP besar.",
      quota: [
        "Sistem Tanpa Batas Pelanggan",
        "Unlimited Routers",
        "Unlimited OLT PON",
        "Dedicated Server / VPS Support",
        "Custom Branding (White-Label)",
        "API Platform & Webhook Support",
        "Dedicated VIP Support 24/7",
      ],
      cta: "Hubungi Penjualan",
      popular: !1,
    },
  ]);
  const re = [
      {
        name: "Billing & Payment Gateway",
        desc: "Automasi tagihan bulanan terpadu dengan gerbang pembayaran terkemuka (Midtrans, Xendit & TriPay). Sinkronisasi status otomatis dan isolasi/suspend klien instan.",
        icon: nr,
      },
      {
        name: "Internet Services Engine",
        desc: "Atur PPPoE Secret, generate voucher Hotspot massal dengan QR Code unik, dan unduh Mikrotik RSC Script bundle yang siap diimport ke WinBox.",
        icon: Nn,
      },
      {
        name: "Interactive NOC Node Map",
        desc: "Lacak infrastruktur Anda via Peta Jaringan OLT GPON ke perangkat ONU pelanggan. Monitor daya optik (Rx/Tx) dan status live Node secara spasial.",
        icon: T0,
      },
      {
        name: "Mitra Kios & Reseller Portal",
        desc: "Kelola jaringan kemitraan voucher RT/RW Net Anda dengan bagi hasil fleksibel, cetak voucher retail, dan catat riwayat top-up saldo deposit mitra.",
        icon: Jn,
      },
      {
        name: "CRM Ticketing & Dispatch",
        desc: "Manajemen komplain NOC, pembagian prioritas tiket keluhan, worksheet kunjungan lapangan teknisi, otomatisasi template chat & log log notifikasi.",
        icon: ir,
      },
      {
        name: "MikRobiL AI Troubleshooting",
        desc: "Asisten AI lokal khusus ISP untuk verifikasi skrip RouterOS, konsultasi topologi, analisis loss fiber optik, dan pembuatan konfigurasi otomatis.",
        icon: mc,
      },
    ];
  f.useEffect(() => {
    console.log("[SaaS Plans Fetch] Initializing fetch to /api/v1/saas/plans...");
    fetch("/api/v1/saas/plans")
      .then((res) => {
        console.log("[SaaS Plans Fetch] Response status:", res.status);
        return res.json();
      })
      .then((resJson) => {
        console.log("[SaaS Plans Fetch] Received data:", resJson);
        if (resJson.status === "success" && Array.isArray(resJson.data)) {
          const mapped = resJson.data.map((p) => {
            const idStr = p.id === 1 ? "starter" : p.id === 2 ? "pro" : "enterprise";
            const defaultPlan = [
              {
                id: "starter",
                name: "Starter Plan",
                price: "Rp 150.000",
                cycle: "/ bulan",
                desc: "Cocok untuk wirausaha RT/RW Net pemula atau ISP mandiri skala kecil.",
                quota: [
                  "Maksimal 100 Pelanggan",
                  "Maksimal 3 Router Mikrotik",
                  "Maksimal 1 OLT PON",
                  "PPPoE & Hotspot Manager",
                  "Sistem Denda & Isolasi Otomatis",
                  "Notifikasi Sistem Dasar",
                ],
                cta: "Mulai Trial Gratis",
                popular: !1,
              },
              {
                id: "pro",
                name: "Professional Plan",
                price: "Rp 500.000",
                cycle: "/ bulan",
                desc: "Pilihan terbaik untuk local ISP berkembang & operator RT/RW Net meluas.",
                quota: [
                  "Maksimal 1000 Pelanggan",
                  "Maksimal 20 Router Mikrotik",
                  "Maksimal 5 OLT PON",
                  "Support Integrasi GenieACS",
                  "Payment Gateway (Midtrans/Xendit)",
                  "Notifikasi WhatsApp & Telegram",
                  "NOC Real-Time Dashboard & Maps",
                ],
                cta: "Rekomendasi Terbaik",
                popular: !0,
              },
              {
                id: "enterprise",
                name: "Enterprise",
                price: "Rp 1.500.000",
                cycle: "/ bulan",
                desc: "Solusi lengkap tanpa batasan untuk ISP Nasional, Korporasi & WISP besar.",
                quota: [
                  "Sistem Tanpa Batas Pelanggan",
                  "Unlimited Routers",
                  "Unlimited OLT PON",
                  "Dedicated Server / VPS Support",
                  "Custom Branding (White-Label)",
                  "API Platform & Webhook Support",
                  "Dedicated VIP Support 24/7",
                ],
                cta: "Hubungi Penjualan",
                popular: !1,
              }
            ].find((item) => item.id === idStr) || {};

            // Keep the exact design naming (Starter Plan, Professional Plan, Enterprise)
            const resolvedName = p.name === "Enterprise" || p.name.toLowerCase() === "enterprise" 
              ? "Enterprise" 
              : (p.name.endsWith(" Plan") || p.name.endsWith(" plan") ? p.name : p.name + " Plan");

            return {
              id: idStr,
              name: resolvedName,
              price: "Rp " + new Intl.NumberFormat("id-ID", { minimumFractionDigits: 0 }).format(p.monthly_price),
              cycle: "/ bulan",
              desc: defaultPlan.desc || `Paket untuk ${p.max_customers} pelanggan, ${p.max_routers} router, ${p.max_olts} OLT.`,
              quota: [
                `Maksimal ${p.max_customers} Pelanggan`,
                p.max_routers > 10000 ? "Router Mikrotik Tanpa Batas" : `Maksimal ${p.max_routers} Router Mikrotik`,
                p.max_olts > 10000 ? "OLT PON Tanpa Batas" : `Maksimal ${p.max_olts} OLT PON`,
                ...(defaultPlan.quota ? defaultPlan.quota.slice(3) : [])
              ],
              cta: defaultPlan.cta || "Pilih Paket",
              popular: p.id === 2,
            };
          });
          console.log("[SaaS Plans Fetch] Successfully mapped plans to state:", mapped);
          setUe(mapped);
        }
      })
      .catch((err) => console.error("[SaaS Plans Fetch] Error fetching plans:", err));
  }, []);
  return e.jsxs("div", {
    id: "landing-root",
    className:
      "min-h-screen bg-slate-950 font-sans text-slate-300 flex flex-col antialiased",
    children: [
      e.jsxs("header", {
        className:
          "sticky top-0 z-50 bg-slate-950/80 backdrop-blur-md border-b border-slate-900 px-6 lg:px-16 py-4 flex items-center justify-between",
        children: [
          e.jsxs("div", {
            className: "flex items-center gap-3",
            children: [
              e.jsx("div", {
                className:
                  "h-8 w-8 rounded bg-blue-600 flex items-center justify-center font-display font-black text-white text-lg shadow-lg shadow-blue-500/10",
                children: "M",
              }),
              e.jsx("span", {
                className:
                  "font-display font-extrabold text-white text-lg tracking-tight",
                children: "MikRobiL",
              }),
            ],
          }),
          e.jsxs("nav", {
            className:
              "hidden md:flex items-center gap-8 text-sm font-medium text-slate-400",
            children: [
              e.jsx("a", {
                href: "#fitur",
                className: "hover:text-blue-400 transition-colors",
                children: "Fitur",
              }),
              e.jsx("a", {
                href: "#harga",
                className: "hover:text-blue-400 transition-colors",
                children: "Harga",
              }),
              e.jsx("a", {
                href: "#dokumentasi",
                className: "hover:text-blue-400 transition-colors",
                children: "Dokumentasi",
              }),
              e.jsx("a", {
                href: "#kontak",
                className: "hover:text-blue-400 transition-colors",
                children: "Kontak",
              }),
            ],
          }),
          e.jsxs("div", {
            className: "flex items-center gap-3",
            children: [
              e.jsx("button", {
                id: "btn-nav-login",
                onClick: w,
                className:
                  "px-4 py-1.5 text-xs font-semibold text-slate-300 hover:text-white transition-colors cursor-pointer",
                children: "Masuk",
              }),
              e.jsx("button", {
                id: "btn-nav-register",
                onClick: J,
                className:
                  "px-4 py-1.5 text-xs font-semibold text-white bg-blue-600 hover:bg-blue-500 rounded-lg shadow-lg shadow-blue-500/10 transition-all cursor-pointer",
                children: "Daftar Tenant",
              }),
            ],
          }),
        ],
      }),
      e.jsxs("section", {
        className:
          "relative overflow-hidden pt-20 pb-16 px-6 lg:px-16 max-w-7xl mx-auto w-full flex flex-col lg:flex-row items-center justify-between gap-12",
        children: [
          e.jsxs("div", {
            className: "flex-1 text-center lg:text-left space-y-6 max-w-xl",
            children: [
              e.jsxs("div", {
                className:
                  "inline-flex items-center gap-2 px-3 py-1 rounded-full bg-blue-950/50 border border-blue-900",
                children: [
                  e.jsx("span", {
                    className: "h-2 w-2 rounded-full bg-blue-500 animate-pulse",
                  }),
                  e.jsx("span", {
                    className:
                      "text-[10px] font-bold text-blue-400 uppercase tracking-widest leading-none font-mono",
                    children: "OSS/BSS SaaS RT/RW NET & ISP",
                  }),
                ],
              }),
              e.jsxs("h1", {
                className:
                  "font-display font-extrabold text-white text-4xl sm:text-5xl leading-tight tracking-tight",
                children: [
                  "Mikrotik Router Billing & ",
                  e.jsx("span", {
                    className: "text-blue-500",
                    children: "ISP Management",
                  }),
                  " Platform",
                ],
              }),
              e.jsx("p", {
                className:
                  "text-sm sm:text-base text-slate-400 leading-relaxed font-light",
                children:
                  "Solusi cloud all-in-one untuk mempermudah operasional billing otomatis, kontrol PPPoE/Hotspot, monitoring live NOC, integrasi OLT/ACS, dan pusat komplain pelanggan. Selesaikan dalam satu dashboard.",
              }),
              e.jsxs("div", {
                className:
                  "flex flex-col sm:flex-row items-center gap-3 justify-center lg:justify-start",
                children: [
                  e.jsxs("button", {
                    id: "hero-btn-demo",
                    onClick: S,
                    className:
                      "w-full sm:w-auto px-6 py-3 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-sm font-semibold text-white shadow-lg shadow-emerald-600/10 transition-all flex items-center justify-center gap-2 cursor-pointer0 hover:shadow-emerald-500/20",
                    children: [
                      e.jsx(ar, { className: "h-4 w-4" }),
                      e.jsx("span", {
                        children: "Coba Demo Instan (Tanpa Daftar)",
                      }),
                    ],
                  }),
                  e.jsxs("button", {
                    onClick: J,
                    className:
                      "w-full sm:w-auto px-6 py-3 rounded-lg bg-slate-900 border border-slate-800 hover:border-slate-700 text-sm font-semibold text-slate-300 hover:text-white transition-all flex items-center justify-center gap-2 cursor-pointer",
                    children: [
                      e.jsx("span", { children: "Daftar 7 Hari Trial" }),
                      e.jsx(_f, { className: "h-4 w-4" }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "flex flex-wrap items-center gap-3 justify-center lg:justify-start pt-2 border-t border-slate-900/60",
                children: [
                  e.jsxs("a", {
                    href: "/apps/billing-radius-admin.apk",
                    download: "billing-radius-admin.apk",
                    onClick: (ee) => {
                      (ee.preventDefault(),
                        alert(
                          "Mengunduh Administrasi Billing Radius APK (v2.4.1)... File aman terbebas dari virus. Ukuran file: 14.2 MB.",
                        ));
                    },
                    className:
                      "inline-flex items-center gap-2 px-3.5 py-1.5 bg-black hover:bg-slate-900 border border-slate-850 hover:border-slate-800 rounded-md text-left transition-all group scale-100 hover:scale-[1.02] shadow-md cursor-pointer",
                    title:
                      "Download Aplikasi Android untuk Administrator NOC & Owner",
                    children: [
                      e.jsx("svg", {
                        className: "h-5.5 w-5.5 text-emerald-500 shrink-0",
                        fill: "currentColor",
                        viewBox: "0 0 24 24",
                        children: e.jsx("path", {
                          d: "M17.525 10.025a.75.75 0 0 1 .75.75c0 .35-.05.7-.15 1.025l1.625 1.625a.747.747 0 0 1-.225 1.25.75.75 0 0 1-.575-.1l-1.375-1.375A7.514 7.514 0 0 1 12 16.5c-2.3 0-4.325-1.025-5.575-2.675l-1.375 1.375a.75.75 0 0 1-1.05-1.05l1.625-1.625A7.443 7.443 0 0 1 5.475 10.8a.75.75 0 0 1 .75-.75c2.325 0 4.25.875 5.775 2.275 1.525-1.4 3.45-2.275 5.525-2.275zM12 2a1.5 1.5 0 0 1 1.5 1.5v1.275a7.48 7.48 0 0 1 3.5 1.525L18.15 5.15a.75.75 0 0 1 1.05 1.05l-1.15 1.15c.675.825 1.125 1.8 1.325 2.85H20.75a.75.75 0 0 1 0 1.5h-1.325a7.426 7.426 0 0 1-1.35 2.85l1.15 1.15a.75.75 0 1 1-1.05 1.05l-1.15-1.15a7.487 7.487 0 0 1-3.5 1.525v1.275a1.5 1.5 0 0 1-3 0v-1.275a7.487 7.487 0 0 1-3.5-1.525l-1.15 1.15A.75.75 0 0 1 3.8 16.3l1.15-1.15A7.426 7.426 0 0 1 3.65 12.3H2.25a.75.75 0 0 1 0-1.5h1.325A7.443 7.443 0 0 1 4.9 7.95L3.8 6.8a.75.75 0 0 1 1.05-1.05L6 6.9a7.48 7.48 0 0 1 3.5-1.525V3.5A1.5 1.5 0 0 1 12 2zm-3.5 8.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm7 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z",
                        }),
                      }),
                      e.jsxs("div", {
                        className: "flex flex-col leading-tight select-none",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[7.5px] uppercase font-bold text-slate-400 tracking-wider font-mono",
                            children: "Download App",
                          }),
                          e.jsx("span", {
                            className:
                              "text-[12px] font-black text-white group-hover:text-emerald-400 transition-colors",
                            children: "Admin APK",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("a", {
                    href: "/apps/billing-radius-client.apk",
                    download: "billing-radius-client.apk",
                    onClick: (ee) => {
                      (ee.preventDefault(),
                        alert(
                          "Mengunduh Client Portal Billing Radius APK (v2.4.1)... File aman terbebas dari virus. Ukuran file: 9.8 MB.",
                        ));
                    },
                    className:
                      "inline-flex items-center gap-2 px-3.5 py-1.5 bg-black hover:bg-slate-900 border border-slate-850 hover:border-slate-800 rounded-md text-left transition-all group scale-100 hover:scale-[1.02] shadow-md cursor-pointer",
                    title:
                      "Download Aplikasi Android untuk Pelanggan (Cek Tagihan & Hotspot)",
                    children: [
                      e.jsx("svg", {
                        className: "h-5.5 w-5.5 text-emerald-500 shrink-0",
                        fill: "currentColor",
                        viewBox: "0 0 24 24",
                        children: e.jsx("path", {
                          d: "M17.525 10.025a.75.75 0 0 1 .75.75c0 .35-.05.7-.15 1.025l1.625 1.625a.747.747 0 0 1-.225 1.25.75.75 0 0 1-.575-.1l-1.375-1.375A7.514 7.514 0 0 1 12 16.5c-2.3 0-4.325-1.025-5.575-2.675l-1.375 1.375a.75.75 0 0 1-1.05-1.05l1.625-1.625A7.443 7.443 0 0 1 5.475 10.8a.75.75 0 0 1 .75-.75c2.325 0 4.25.875 5.775 2.275 1.525-1.4 3.45-2.275 5.525-2.275zM12 2a1.5 1.5 0 0 1 1.5 1.5v1.275a7.48 7.48 0 0 1 3.5 1.525L18.15 5.15a.75.75 0 0 1 1.05 1.05l-1.15 1.15c.675.825 1.125 1.8 1.325 2.85H20.75a.75.75 0 0 1 0 1.5h-1.325a7.426 7.426 0 0 1-1.35 2.85l1.15 1.15a.75.75 0 1 1-1.05 1.05l-1.15-1.15a7.487 7.487 0 0 1-3.5 1.525v1.275a1.5 1.5 0 0 1-3 0v-1.275a7.487 7.487 0 0 1-3.5-1.525l-1.15 1.15A.75.75 0 0 1 3.8 16.3l1.15-1.15A7.426 7.426 0 0 1 3.65 12.3H2.25a.75.75 0 0 1 0-1.5h1.325A7.443 7.443 0 0 1 4.9 7.95L3.8 6.8a.75.75 0 0 1 1.05-1.05L6 6.9a7.48 7.48 0 0 1 3.5-1.525V3.5A1.5 1.5 0 0 1 12 2zm-3.5 8.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm7 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z",
                        }),
                      }),
                      e.jsxs("div", {
                        className: "flex flex-col leading-tight select-none",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[7.5px] uppercase font-bold text-slate-400 tracking-wider font-mono",
                            children: "Download App",
                          }),
                          e.jsx("span", {
                            className:
                              "text-[12px] font-black text-white group-hover:text-emerald-400 transition-colors",
                            children: "Client APK",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("a", {
                    href: "/apps/billing-radius-agent.apk",
                    download: "billing-radius-agent.apk",
                    onClick: (ee) => {
                      (ee.preventDefault(),
                        alert(
                          "Mengunduh Mitra Kios Agent Portal APK (v2.4.1)... File aman terbebas dari malware. Ukuran file: 11.5 MB.",
                        ));
                    },
                    className:
                      "inline-flex items-center gap-2 px-3.5 py-1.5 bg-black hover:bg-slate-900 border border-slate-850 hover:border-slate-800 rounded-md text-left transition-all group scale-100 hover:scale-[1.02] shadow-md cursor-pointer",
                    title:
                      "Download Aplikasi Android untuk Reseller & Agent Penjual Voucher",
                    children: [
                      e.jsx("svg", {
                        className: "h-5.5 w-5.5 text-emerald-500 shrink-0",
                        fill: "currentColor",
                        viewBox: "0 0 24 24",
                        children: e.jsx("path", {
                          d: "M17.525 10.025a.75.75 0 0 1 .75.75c0 .35-.05.7-.15 1.025l1.625 1.625a.747.747 0 0 1-.225 1.25.75.75 0 0 1-.575-.1l-1.375-1.375A7.514 7.514 0 0 1 12 16.5c-2.3 0-4.325-1.025-5.575-2.675l-1.375 1.375a.75.75 0 0 1-1.05-1.05l1.625-1.625A7.443 7.443 0 0 1 5.475 10.8a.75.75 0 0 1 .75-.75c2.325 0 4.25.875 5.775 2.275 1.525-1.4 3.45-2.275 5.525-2.275zM12 2a1.5 1.5 0 0 1 1.5 1.5v1.275a7.48 7.48 0 0 1 3.5 1.525L18.15 5.15a.75.75 0 0 1 1.05 1.05l-1.15 1.15c.675.825 1.125 1.8 1.325 2.85H20.75a.75.75 0 0 1 0 1.5h-1.325a7.426 7.426 0 0 1-1.35 2.85l1.15 1.15a.75.75 0 1 1-1.05 1.05l-1.15-1.15a7.487 7.487 0 0 1-3.5 1.525v1.275a1.5 1.5 0 0 1-3 0v-1.275a7.487 7.487 0 0 1-3.5-1.525l-1.15 1.15A.75.75 0 0 1 3.8 16.3l1.15-1.15A7.426 7.426 0 0 1 3.65 12.3H2.25a.75.75 0 0 1 0-1.5h1.325A7.443 7.443 0 0 1 4.9 7.95L3.8 6.8a.75.75 0 0 1 1.05-1.05L6 6.9a7.48 7.48 0 0 1 3.5-1.525V3.5A1.5 1.5 0 0 1 12 2zm-3.5 8.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm7 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z",
                        }),
                      }),
                      e.jsxs("div", {
                        className: "flex flex-col leading-tight select-none",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[7.5px] uppercase font-bold text-slate-400 tracking-wider font-mono",
                            children: "Download App",
                          }),
                          e.jsx("span", {
                            className:
                              "text-[12px] font-black text-white group-hover:text-emerald-400 transition-colors",
                            children: "Agent APK",
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "pt-4 grid grid-cols-3 gap-6 border-t border-slate-900 pt-6",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("p", {
                        className:
                          "text-xl sm:text-2xl font-bold font-display text-white",
                        children: "100%",
                      }),
                      e.jsx("p", {
                        className: "text-[11px] text-slate-500",
                        children: "Cloud Host & Aman",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    children: [
                      e.jsx("p", {
                        className:
                          "text-xl sm:text-2xl font-bold font-display text-white",
                        children: "99.9%",
                      }),
                      e.jsx("p", {
                        className: "text-[11px] text-slate-500",
                        children: "Live Sync Uptime",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    children: [
                      e.jsx("p", {
                        className:
                          "text-xl sm:text-2xl font-bold font-display text-white",
                        children: "< 30d",
                      }),
                      e.jsx("p", {
                        className: "text-[11px] text-slate-500",
                        children: "Auto Suspend Cycle",
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            id: "hero-dashboard-mockup",
            className:
              "flex-1 bg-slate-900 border border-slate-800 rounded-xl p-3 shadow-2xl relative max-w-lg lg:max-w-none w-full",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b border-slate-800 pb-2 mb-3 px-2",
                children: [
                  e.jsxs("div", {
                    className: "flex gap-1.5",
                    children: [
                      e.jsx("span", {
                        className: "h-2.5 w-2.5 rounded-full bg-rose-500",
                      }),
                      e.jsx("span", {
                        className: "h-2.5 w-2.5 rounded-full bg-amber-500",
                      }),
                      e.jsx("span", {
                        className: "h-2.5 w-2.5 rounded-full bg-green-500",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "text-[10px] text-slate-500 font-mono tracking-wider",
                    children: "Jaya Net Overview",
                  }),
                  e.jsx("div", { className: "h-3 w-3" }),
                ],
              }),
              e.jsxs("div", {
                className: "grid grid-cols-2 gap-3 mb-3",
                children: [
                  e.jsxs("div", {
                    className:
                      "p-3.5 bg-slate-950 rounded-lg border border-slate-800/80",
                    children: [
                      e.jsx("p", {
                        className:
                          "text-[10px] uppercase font-bold tracking-widest text-slate-500",
                        children: "Total Klien",
                      }),
                      e.jsx("h3", {
                        className:
                          "text-2xl font-display font-extrabold text-white mt-1",
                        children: "1.284",
                      }),
                      e.jsx("p", {
                        className: "text-[9px] text-emerald-400 mt-0.5",
                        children: "+18% bulan ini",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "p-3.5 bg-slate-950 rounded-lg border border-slate-800/80",
                    children: [
                      e.jsx("p", {
                        className:
                          "text-[10px] uppercase font-bold tracking-widest text-slate-500",
                        children: "Bandwidth Peak",
                      }),
                      e.jsx("h3", {
                        className:
                          "text-2xl font-display font-extrabold text-blue-500 mt-1",
                        children: "843 Mbps",
                      }),
                      e.jsx("p", {
                        className: "text-[9px] text-slate-500 mt-0.5",
                        children: "Interface ether1-WAN",
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-slate-950 rounded-lg border border-slate-800/80 space-y-3",
                children: [
                  e.jsxs("div", {
                    className:
                      "flex items-center justify-between text-xs text-slate-400 font-bold border-b border-slate-900 pb-2",
                    children: [
                      e.jsx("span", { children: "Alat Sinkronisasi" }),
                      e.jsx("span", { children: "Status" }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "flex items-center justify-between text-xs",
                    children: [
                      e.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          e.jsx(Nn, { className: "h-3.5 w-3.5 text-blue-400" }),
                          e.jsx("span", {
                            className: "text-slate-300",
                            children: "PPPoE Accounts",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[10px] bg-green-950 border border-green-900 px-2 py-0.5 rounded text-green-400",
                        children: "Terhubung",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "flex items-center justify-between text-xs",
                    children: [
                      e.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          e.jsx($n, {
                            className: "h-3.5 w-3.5 text-emerald-400",
                          }),
                          e.jsx("span", {
                            className: "text-slate-300",
                            children: "ACS TR-069 Service",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[10px] bg-green-950 border border-green-900 px-2 py-0.5 rounded text-green-400",
                        children: "Aktif",
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      e.jsxs("section", {
        id: "fitur",
        className:
          "bg-slate-950 border-t border-slate-900 py-20 px-6 lg:px-16 scroll-mt-16",
        children: [
          e.jsxs("div", {
            className: "max-w-7xl mx-auto w-full text-center space-y-4 mb-16",
            children: [
              e.jsx("h2", {
                className:
                  "font-display font-extrabold text-3xl text-white tracking-tight",
                children: "Fitur Profesional Lengkap untuk ISP Modern",
              }),
              e.jsx("p", {
                className:
                  "text-sm text-slate-400 max-w-xl mx-auto font-light leading-relaxed",
                children:
                  "Tidak perlu melakukan konfigurasi manual yang melelahkan. MikRobiL merangkum seluruh alur kerja operasional Anda secara instan dan aman.",
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "max-w-7xl mx-auto w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",
            children: re.map((ee, B) => {
              const T = ee.icon;
              return e.jsxs(
                "div",
                {
                  className:
                    "p-6 bg-slate-900/40 border border-slate-900 hover:border-slate-800 rounded-xl hover:-translate-y-1 transition-all group duration-350",
                  children: [
                    e.jsx("div", {
                      className:
                        "h-10 w-10 bg-blue-900/30 border border-blue-800 text-blue-400 rounded-lg flex items-center justify-center mb-5 group-hover:scale-110 transition-transform",
                      children: e.jsx(T, { className: "h-5 w-5" }),
                    }),
                    e.jsx("h3", {
                      className: "text-lg font-bold text-white mb-2",
                      children: ee.name,
                    }),
                    e.jsx("p", {
                      className:
                        "text-slate-400 text-xs sm:text-sm font-light leading-relaxed",
                      children: ee.desc,
                    }),
                  ],
                },
                B,
              );
            }),
          }),
        ],
      }),
      e.jsx("section", {
        className:
          "bg-slate-900/20 border-t border-slate-900 py-12 px-6 lg:px-16 text-center",
        children: e.jsxs("div", {
          className: "max-w-7xl mx-auto w-full space-y-4",
          children: [
            e.jsx("p", {
              className:
                "text-xs uppercase font-bold tracking-widest text-slate-500 font-mono",
              children: "Dukungan Kompatibilitas Perangkat",
            }),
            e.jsxs("div", {
              className:
                "flex flex-wrap items-center justify-center gap-8 lg:gap-14 pt-4",
              children: [
                e.jsx("span", {
                  className:
                    "text-sm font-bold text-slate-400 border border-slate-800 px-3 py-1 rounded",
                  children: "MikroTik RouterOS (v6 & v7)",
                }),
                e.jsx("span", {
                  className:
                    "text-sm font-bold text-slate-400 border border-slate-800 px-3 py-1 rounded",
                  children: "GenieACS (TR-069)",
                }),
                e.jsx("span", {
                  className:
                    "text-sm font-bold text-slate-400 border border-slate-800 px-3 py-1 rounded",
                  children: "Huawei GPON OLT",
                }),
                e.jsx("span", {
                  className:
                    "text-sm font-bold text-slate-400 border border-slate-800 px-3 py-1 rounded",
                  children: "ZTE OLT & GPON CPE",
                }),
                e.jsx("span", {
                  className:
                    "text-sm font-bold text-slate-400 border border-slate-800 px-3 py-1 rounded",
                  children: "VSOL & FiberHome",
                }),
              ],
            }),
          ],
        }),
      }),
      e.jsxs("section", {
        id: "harga",
        className:
          "py-20 px-6 lg:px-16 border-t border-slate-900 bg-slate-950 scroll-mt-16",
        children: [
          e.jsxs("div", {
            className: "max-w-7xl mx-auto w-full text-center space-y-4 mb-16",
            children: [
              e.jsx("h2", {
                className:
                  "font-display font-extrabold text-3xl text-white tracking-tight",
                children: " pilihan Paket Berlangganan SaaS ",
              }),
              e.jsx("p", {
                className: "text-sm text-slate-400 max-w-xl mx-auto font-light",
                children:
                  " Sederhana, transparan, tanpa biaya tersembunyi. Tingkatkan paket Anda seiring pertumbuhan bisnis Anda. ",
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "max-w-6xl mx-auto w-full grid grid-cols-1 md:grid-cols-3 gap-8",
            children: ue.map((ee, B) =>
              e.jsxs(
                "div",
                {
                  className: `p-8 rounded-xl border flex flex-col h-full relative ${ee.popular ? "bg-slate-900 border-blue-600 shadow-xl shadow-blue-500/5" : "bg-slate-900/40 border-slate-900"}`,
                  children: [
                    ee.popular &&
                      e.jsx("span", {
                        className:
                          "absolute top-0 right-8 -translate-y-1/2 bg-blue-600 text-white text-[10px] uppercase font-bold tracking-widest px-3 py-1 rounded-full",
                        children: "Terpopuler",
                      }),
                    e.jsxs("div", {
                      className: "mb-6",
                      children: [
                        e.jsx("h4", {
                          className: "text-sm font-bold text-slate-400",
                          children: ee.name,
                        }),
                        e.jsxs("div", {
                          className: "flex items-baseline gap-1 mt-3",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-3xl font-extrabold text-white font-display",
                              children: ee.price,
                            }),
                            e.jsx("span", {
                              className: "text-slate-500 text-xs font-mono",
                              children: ee.cycle,
                            }),
                          ],
                        }),
                        e.jsx("p", {
                          className:
                            "text-slate-400 text-xs sm:text-xs mt-3 leading-relaxed font-light",
                          children: ee.desc,
                        }),
                      ],
                    }),
                    e.jsx("ul", {
                      className:
                        "space-y-3.5 mb-8 flex-1 text-slate-300 text-xs sm:text-sm font-light",
                      children: ee.quota.map((T, fe) =>
                        e.jsxs(
                          "li",
                          {
                            className: "flex items-start gap-2.5",
                            children: [
                              e.jsx(tn, {
                                className:
                                  "h-4.5 w-4.5 text-blue-400 shrink-0 mt-0.5",
                              }),
                              e.jsx("span", { children: T }),
                            ],
                          },
                          fe,
                        ),
                      ),
                    }),
                    e.jsx("button", {
                      onClick: J,
                      className: `w-full py-2.5 rounded-lg text-xs font-bold transition-all cursor-pointer ${ee.popular ? "bg-blue-600 text-white hover:bg-blue-500 shadow-lg shadow-blue-600/10" : "bg-slate-800 text-slate-350 hover:bg-slate-700 hover:text-white"}`,
                      children: ee.cta,
                    }),
                  ],
                },
                B,
              ),
            ),
          }),
        ],
      }),
      e.jsx("section", {
        id: "dokumentasi",
        className:
          "py-20 px-6 lg:px-16 border-t border-slate-900 bg-slate-900/10 scroll-mt-16",
        children: e.jsxs("div", {
          className: "max-w-7xl mx-auto w-full",
          children: [
            e.jsxs("div", {
              className: "text-center space-y-4 mb-14",
              children: [
                e.jsx("h2", {
                  className:
                    "font-display font-extrabold text-3xl text-white tracking-tight",
                  children: "Dokumentasi & Panduan setup",
                }),
                e.jsx("p", {
                  className:
                    "text-sm text-slate-400 max-w-xl mx-auto font-light",
                  children:
                    "Lakukan integrasi router Anda secara mandiri dalam waktu kurang dari 5 menit menggunakan panduan komparatif kami.",
                }),
              ],
            }),
            e.jsxs("div", {
              className:
                "bg-slate-900 border border-slate-800 rounded-xl overflow-hidden flex flex-col md:flex-row h-[480px]",
              children: [
                e.jsxs("div", {
                  className:
                    "w-full md:w-64 border-r border-slate-800 bg-slate-950/30 flex flex-col",
                  children: [
                    e.jsxs("div", {
                      className:
                        "p-4 border-b border-slate-800 flex items-center gap-2",
                      children: [
                        e.jsx(hu, { className: "h-4 w-4 text-blue-500" }),
                        e.jsx("span", {
                          className:
                            "text-xs font-bold text-white uppercase tracking-wider",
                          children: "Topik Panduan",
                        }),
                      ],
                    }),
                    e.jsx("div", {
                      className:
                        "p-2 space-y-1.5 flex-1 overflow-y-auto custom-scroll",
                      children: [
                        {
                          id: "getting-started",
                          label: "Cara Mulai Cepat (Getting Started)",
                        },
                        {
                          id: "billing-gateway",
                          label: "Billing & Integrasi Payment Gateway",
                        },
                        {
                          id: "network-map",
                          label: "NOC & GPON Spasial Node Map",
                        },
                        {
                          id: "reseller-partner",
                          label: "Mitra Kios & Reseller Partner",
                        },
                        {
                          id: "crm-support",
                          label: "CRM Tiket & Dispatch Lapangan",
                        },
                        {
                          id: "ai-assistant",
                          label: "MikRobiL AI ISP Troubleshooter",
                        },
                      ].map((ee) =>
                        e.jsx(
                          "button",
                          {
                            onClick: () => V(ee.id),
                            className: `w-full text-left px-3 py-2 rounded text-xs font-medium transition-colors ${b === ee.id ? "bg-slate-800 text-white font-bold" : "hover:bg-slate-800/40 text-slate-400 hover:text-slate-200"}`,
                            children: ee.label,
                          },
                          ee.id,
                        ),
                      ),
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "flex-1 p-6 lg:p-8 overflow-y-auto custom-scroll bg-slate-900/60 font-sans",
                  children: [
                    b === "getting-started" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-blue-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "1",
                              }),
                              e.jsx("span", {
                                children: "Awal Mulai & Integrasi Cepat",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 leading-relaxed font-light",
                            children:
                              "Selamat datang di platform manajemen billing ISP MikRobiL. Memulai operasional RT/RW Net atau Local ISP Anda sangat mudah:",
                          }),
                          e.jsxs("ol", {
                            className:
                              "list-decimal pl-5 text-slate-350 text-xs sm:text-sm space-y-2.5 font-light",
                            children: [
                              e.jsxs("li", {
                                children: [
                                  "Luncurkan ",
                                  e.jsx("strong", { children: "Demo Instan" }),
                                  " tanpa registrasi atau miliki tenant mandiri gratis 7 hari trial penuh.",
                                ],
                              }),
                              e.jsx("li", {
                                children:
                                  "Sistem otomatis membuat kluster RouterOS & OLT virtual untuk pengujian instan Anda secara real-time.",
                              }),
                              e.jsxs("li", {
                                children: [
                                  "Buka menu ",
                                  e.jsx("strong", {
                                    children: "Internet Services",
                                  }),
                                  " untuk memproses profile paket billing, akun rahasia PPPoE, dan voucher Hotspot terpadu.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  "Generate lembar konfigurasi skrip ",
                                  e.jsx("i", {
                                    children: "walled-garden Mikrotik",
                                  }),
                                  " yang menyinkronisasikan firewall rules router Anda secara otomatis.",
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                    b === "billing-gateway" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-emerald-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "2",
                              }),
                              e.jsx("span", {
                                children:
                                  "Billing & Integrasi Payment Gateway Utama",
                              }),
                            ],
                          }),
                          e.jsxs("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 font-light leading-relaxed",
                            children: [
                              "Kami menyediakan automasi billing tagihan paling mutakhir di Indonesia yang ditarik ",
                              e.jsx("strong", {
                                children:
                                  "langsung dari konfigurasi gerbang pembayaran utama Anda",
                              }),
                              " di tab Pengaturan:",
                            ],
                          }),
                          e.jsxs("ul", {
                            className:
                              "list-disc pl-5 text-slate-350 text-xs sm:text-sm space-y-2.5 font-light",
                            children: [
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    className: "text-blue-400",
                                    children: "Midtrans, Xendit, & TriPay",
                                  }),
                                  ": Sediakan Virtual Account (Mandiri, BRI, BCA, BNI), QRIS Dinamis Standar, outlet retail Alfamart/Indomaret, serta dompet digital (OVO, ShopeePay, LinkAja) dengan callback instan.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    className: "text-indigo-400",
                                    children: "Pembaruan Auto-Sync Kunci API",
                                  }),
                                  ": Kredensial dienkripsi aman pada database server. Modul isolasi/suspend internet pelanggan akan berkoordinasi secara otomatis dengan gateway pembayaran tanpa perantara splash tambahan yang mengganggu keindahan antarmuka.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    className: "text-emerald-400",
                                    children: "Customer Portal Checkout",
                                  }),
                                  ": Klien dapat login mandiri, memantau riwayat invoice, mengunduh file PDF kuitansi formal, dan membayar tagihan secara real-time.",
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                    b === "network-map" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-pink-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "3",
                              }),
                              e.jsx("span", {
                                children:
                                  "Automasi NOC & Peta Geografis Jaringan OLT GPON",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 font-light leading-relaxed",
                            children:
                              "Dapatkan visibilitas penuh infrastruktur fisik kabel fiber Anda secara spasial menggunakan integrasi Leaflet Interactive Map:",
                          }),
                          e.jsxs("ul", {
                            className:
                              "list-disc pl-5 text-slate-350 text-xs sm:text-sm space-y-2 font-light",
                            children: [
                              e.jsx("li", {
                                children:
                                  "Sistem plotting koordinat latitude/longitude Node Router Pusat, Box ODP/Splitter, dan ONT modem rumah pelanggan.",
                              }),
                              e.jsx("li", {
                                children:
                                  "Pendeteksi degradasi kualitas transmisi optik (Rx/Tx optical signal power dbm) dengan grafik alarm merah ketika redaman melebihi batas kelayakan.",
                              }),
                              e.jsx("li", {
                                children:
                                  "Data tabular tipe modem, serial number GPON, hingga status klien online/warning yang termonitor real-time dari satu peta interaktif.",
                              }),
                            ],
                          }),
                        ],
                      }),
                    b === "reseller-partner" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-purple-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "4",
                              }),
                              e.jsx("span", {
                                children:
                                  "Mitra Kios & Reseller Partner Portal",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 font-light leading-relaxed",
                            children:
                              "Maksimalkan penjualan voucher internet Hotspot di warung-warung dan gerai agen mitra Anda dengan modul kemitraan canggih:",
                          }),
                          e.jsxs("ol", {
                            className:
                              "list-decimal pl-5 text-slate-350 text-xs sm:text-sm space-y-2 font-light",
                            children: [
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Balance & Deposit Ledger",
                                  }),
                                  ": Dukungan deposit saldo prabayar reseller untuk pencairan voucher Hotspot mandiri oleh mitra.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Flexible Revenue Share",
                                  }),
                                  ": Atur rasio komisi bagi hasil penjualan (misal 10% untuk Mitra, 90% untuk Owner ISP) per gerai.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Interactive Simulator",
                                  }),
                                  ": Fitur simulasi feedback gerbang pembayaran terintegrasi untuk melatih reseller Anda memproses response callback transaksi voucher secara aman.",
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                    b === "crm-support" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-amber-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "5",
                              }),
                              e.jsx("span", {
                                children:
                                  "NOC CRM Ticketing & Dispatch Teknisi Lapangan",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 leading-relaxed font-light",
                            children:
                              "Pertahankan service level agreement (SLA) internet Anda tetap tinggi dan pertahankan loyalitas pelanggan Anda:",
                          }),
                          e.jsxs("ul", {
                            className:
                              "list-disc pl-5 text-slate-350 text-xs sm:text-sm space-y-2 font-light",
                            children: [
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Priority Ticketing",
                                  }),
                                  ": Urutkan keluhan berdasarkan urgensi, lampirkan status penanganan gangguan (Open, Progress, Resolved).",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Worksheet Dispatch",
                                  }),
                                  ": Kirimkan kru teknisi ke lapangan dengan assignment pekerjaan terstruktur, pencatatan biaya material kabel, dan rincian log instalasi.",
                                ],
                              }),
                              e.jsxs("li", {
                                children: [
                                  e.jsx("strong", {
                                    children: "Notifikasi & Broadcast",
                                  }),
                                  ": Integrasikan log template pengumuman tagihan berulang, log broadcast pemeliharaan massal, dan log status SMS/WhatsApp Gateway.",
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                    b === "ai-assistant" &&
                      e.jsxs("div", {
                        className: "space-y-4 text-left",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-lg font-bold text-white font-display flex items-center gap-2",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-5 w-5 bg-rose-600 rounded-full flex items-center justify-center text-[10px] text-white",
                                children: "★",
                              }),
                              e.jsx("span", {
                                children: "MikRobiL AI ISP Troubleshooter",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-xs sm:text-sm text-slate-400 leading-relaxed font-light font-sans",
                            children:
                              "Dapatkan bantuan asisten cerdas khusus ISP berbasis lokal AI model yang dapat membantu Anda memecahkan masalah sistem dalam hitungan detik:",
                          }),
                          e.jsxs("div", {
                            className:
                              "p-3 bg-slate-950/80 rounded-xl border border-slate-800 text-[11px] space-y-2 font-mono",
                            children: [
                              e.jsx("p", {
                                className: "text-emerald-400 font-bold",
                                children: "// Tanyakan Kepada MikRobiL AI:",
                              }),
                              e.jsx("p", {
                                className: "text-slate-300",
                                children:
                                  '"Bagaimana skrip scheduler di MikroTik v7 untuk melakukan auto-reboot router setiap jam 3 pagi secara aman?"',
                              }),
                              e.jsx("p", {
                                className: "text-amber-400",
                                children:
                                  '"Analisis redaman kabel FO sebesar -28.5 dBm di RT 04, apa langkah pemulihan terbaik?"',
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-[11px] text-slate-500 font-light leading-relaxed",
                            children:
                              "Sistem asisten AI lokal kami meminimalisir ketergantungan Anda terhadap engineer eksternal dan melatih staf pemula menguasai jaringan MikroTik.",
                          }),
                        ],
                      }),
                  ],
                }),
              ],
            }),
          ],
        }),
      }),
      e.jsx("footer", {
        id: "kontak",
        className:
          "mt-auto border-t border-slate-900 bg-slate-950 py-12 px-6 lg:px-16 text-center text-slate-500 text-xs sm:text-xs",
        children: e.jsxs("div", {
          className: "max-w-7xl mx-auto w-full space-y-4",
          children: [
            e.jsxs("div", {
              className: "flex items-center justify-center gap-2",
              children: [
                e.jsx("div", {
                  className:
                    "h-6 w-6 rounded bg-slate-800 flex items-center justify-center font-display font-semibold text-white",
                  children: "M",
                }),
                e.jsx("span", {
                  className: "font-display font-bold text-white text-sm",
                  children: "MikRobiL Billing Platform",
                }),
              ],
            }),
            e.jsx("p", {
              className:
                "max-w-md mx-auto text-slate-400 font-light leading-relaxed",
              children:
                "Menghubungkan billing, router, map, dan CRM untuk operasional ISP yang lebih menguntungkan dan efisien.",
            }),
            e.jsxs("div", {
              className:
                "pt-6 border-t border-slate-900 max-w-lg mx-auto flex justify-between items-center text-slate-500",
              children: [
                e.jsx("span", {
                  children: "© 2026 MikRobiL. Hak Cipta Dilindungi.",
                }),
                e.jsxs("div", {
                  className: "flex gap-4",
                  children: [
                    e.jsx("a", {
                      href: "#",
                      className: "hover:text-slate-300",
                      children: "Privacy Policy",
                    }),
                    e.jsx("a", {
                      href: "#",
                      className: "hover:text-slate-300",
                      children: "Terms of Use",
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
      }),
    ],
  });
}
function vg({ initialMode: w, onBack: J, onSuccess: S }) {
  const [b, V] = f.useState(w),
    [ue, re] = f.useState(!1),
    [ee, B] = f.useState(""),
    [T, fe] = f.useState(""),
    [G, F] = f.useState(""),
    [ce, ve] = f.useState(""),
    [Y, Ee] = f.useState(""),
    [Se, le] = f.useState(""),
    [ie, $] = f.useState(!1),
    de = async (oe) => {
      (oe.preventDefault(), re(!0), B(""));
      try {
        const response = await fetch(
          b === "login" ? "/api/v1/auth/login" : "/api/v1/auth/register",
          {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(
              b === "login"
                ? { email: T, password: G }
                : {
                    company_name: ce,
                    name: Y,
                    email: T,
                    password: G,
                    phone: Se,
                  },
            ),
          },
        );
        let Ie;
        try {
          Ie = await response.json();
        } catch (jsonErr) {
          if (response.status === 401 || response.status === 403) {
            B("Email atau kata sandi salah. Silakan periksa kembali.");
            return;
          }
          throw new Error("Invalid json response");
        }
        if (response.status === 401 || response.status === 403) {
          B(Ie.message || "Email atau kata sandi salah. Silakan periksa kembali.");
          return;
        }
        if (Ie.status === "success") {
          S(Ie.data);
        } else {
          B(Ie.message || "Terjadi kesalahan sistem, silakan coba lagi.");
        }
      } catch (err) {
        B("Gagal terhubung ke server. Silakan periksa koneksi internet Anda atau coba lagi.");
      } finally {
        re(!1);
      }
    };
  return e.jsxs("div", {
    className:
      "min-h-screen bg-slate-950 flex font-sans select-none antialiased",
    children: [
      e.jsxs("div", {
        className:
          "hidden lg:flex flex-1 bg-gradient-to-tr from-slate-900 via-slate-950 to-blue-950 items-center justify-center p-16 border-r border-slate-900 relative",
        children: [
          e.jsx("div", {
            className: "absolute top-8 left-8",
            children: e.jsxs("button", {
              onClick: J,
              className:
                "flex items-center gap-2 text-xs text-slate-400 hover:text-white transition-all cursor-pointer font-bold",
              children: [
                e.jsx(vf, { className: "h-4 w-4" }),
                e.jsx("span", { children: "KEMBALI KE BERANDA" }),
              ],
            }),
          }),
          e.jsxs("div", {
            className: "max-w-md space-y-6",
            children: [
              e.jsx("div", {
                className:
                  "h-12 w-12 rounded bg-blue-600 flex items-center justify-center font-display font-black text-white text-2xl shadow-xl shadow-blue-500/10",
                children: "M",
              }),
              e.jsx("h2", {
                className:
                  "text-3xl font-display font-extrabold text-white tracking-tight leading-tight",
                children:
                  "Kemudahan Pengelolaan Billing & NOC Jaringan dalam Satu Platform.",
              }),
              e.jsx("p", {
                className:
                  "text-slate-400 text-xs sm:text-sm font-light leading-relaxed",
                children:
                  "Gabungkan kontrol RouterOS Mikrotik, billing otomatis PPPoE & Hotspot, hingga dashboard monitoring komplain NOC dalam ekosistem tersentralisasi yang andal.",
              }),
              e.jsxs("div", {
                className: "flex items-center gap-3",
                children: [
                  e.jsx("span", {
                    className:
                      "h-2 w-2 rounded-full bg-emerald-500 animate-pulse",
                  }),
                  e.jsx("span", {
                    className:
                      "text-[10px] uppercase font-mono font-bold text-slate-500 tracking-wider",
                    children: "MikRobiL cloud engine sudah aktif",
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      e.jsx("div", {
        className:
          "flex-1 flex flex-col justify-center px-6 sm:px-12 lg:px-24 bg-slate-950",
        children: e.jsxs("div", {
          className: "mx-auto w-full max-w-sm space-y-8",
          children: [
            e.jsxs("div", {
              className: "text-center lg:text-left space-y-2",
              children: [
                e.jsxs("div", {
                  className:
                    "flex lg:hidden justify-center items-center gap-2 mb-4",
                  children: [
                    e.jsx("div", {
                      className:
                        "h-8 w-8 rounded bg-blue-600 flex items-center justify-center font-display font-bold text-white text-lg",
                      children: "M",
                    }),
                    e.jsx("span", {
                      className:
                        "font-display font-black text-white text-lg tracking-tight",
                      children: "MikRobiL",
                    }),
                  ],
                }),
                e.jsx("h1", {
                  className:
                    "text-2xl font-display font-extrabold text-white tracking-tight",
                  children:
                    b === "login"
                      ? "Selamat Datang Kembali!"
                      : "Daftarkan Tenant Baru",
                }),
                e.jsx("p", {
                  className: "text-xs sm:text-xs text-slate-400 font-light",
                  children:
                    b === "login"
                      ? "Masuk untuk melanjutkan ke dashboard manajemen ISP Anda."
                      : "Mulai trial gratis 7 hari penuh fitur hari ini.",
                }),
              ],
            }),
            ee &&
              e.jsx("div", {
                className:
                  "p-3.5 bg-rose-950/30 border border-rose-900 rounded-lg text-rose-400 text-xs font-semibold",
                children: ee,
              }),
            e.jsxs("form", {
              onSubmit: de,
              className: "space-y-4",
              children: [
                b === "register" &&
                  e.jsxs(e.Fragment, {
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", {
                            className:
                              "text-[11px] font-bold text-slate-400 uppercase tracking-wider block",
                            children: "Nama Perusahaan / ISP",
                          }),
                          e.jsxs("div", {
                            className: "relative",
                            children: [
                              e.jsx(Lp, {
                                className:
                                  "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "Contoh: Jaya Solusi Net",
                                value: ce,
                                onChange: (oe) => ve(oe.target.value),
                                className:
                                  "w-full bg-slate-900 border border-slate-800 focus:border-blue-500 rounded-lg pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 outline-none transition-all font-sans",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", {
                            className:
                              "text-[11px] font-bold text-slate-400 uppercase tracking-wider block",
                            children: "Nama Lengkap Operator",
                          }),
                          e.jsxs("div", {
                            className: "relative",
                            children: [
                              e.jsx(xu, {
                                className:
                                  "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "Contoh: Budi Gunawan",
                                value: Y,
                                onChange: (oe) => Ee(oe.target.value),
                                className:
                                  "w-full bg-slate-900 border border-slate-800 focus:border-blue-500 rounded-lg pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 outline-none transition-all font-sans",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", {
                            className:
                              "text-[11px] font-bold text-slate-400 uppercase tracking-wider block",
                            children: "No. WhatsApp",
                          }),
                          e.jsxs("div", {
                            className: "relative",
                            children: [
                              e.jsx(D0, {
                                className:
                                  "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500",
                              }),
                              e.jsx("input", {
                                type: "tel",
                                placeholder: "Contoh: 0812345678",
                                value: Se,
                                onChange: (oe) => le(oe.target.value),
                                className:
                                  "w-full bg-slate-900 border border-slate-800 focus:border-blue-500 rounded-lg pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 outline-none transition-all font-sans",
                              }),
                            ],
                          }),
                        ],
                      }),
                    ],
                  }),
                e.jsxs("div", {
                  className: "space-y-1.5",
                  children: [
                    e.jsx("label", {
                      className:
                        "text-[11px] font-bold text-slate-400 uppercase tracking-wider block",
                      children: "E-mail",
                    }),
                    e.jsxs("div", {
                      className: "relative",
                      children: [
                        e.jsx(w0, {
                          className:
                            "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500",
                        }),
                        e.jsx("input", {
                          type: "email",
                          required: !0,
                          placeholder: "admin@jayanet.com",
                          value: T,
                          onChange: (oe) => fe(oe.target.value),
                          className:
                            "w-full bg-slate-900 border border-slate-800 focus:border-blue-500 rounded-lg pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 outline-none transition-all font-sans",
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "space-y-1.5",
                  children: [
                    e.jsx("label", {
                      className:
                        "text-[11px] font-bold text-slate-400 uppercase tracking-wider block",
                      children: "Kata Sandi (Password)",
                    }),
                    e.jsxs("div", {
                      className: "relative",
                      children: [
                        e.jsx(Ep, {
                          className:
                            "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500",
                        }),
                        e.jsx("input", {
                          type: "password",
                          required: !0,
                          placeholder: "••••••••",
                          value: G,
                          onChange: (oe) => F(oe.target.value),
                          className:
                            "w-full bg-slate-900 border border-slate-800 focus:border-blue-500 rounded-lg pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 outline-none transition-all font-sans",
                        }),
                      ],
                    }),
                  ],
                }),
                b === "login" &&
                  e.jsxs("div", {
                    className: "flex items-center justify-between text-xs pt-1",
                    children: [
                      e.jsxs("label", {
                        className:
                          "flex items-center gap-2 text-slate-400 cursor-pointer",
                        children: [
                          e.jsx("input", {
                            type: "checkbox",
                            checked: ie,
                            onChange: (oe) => $(oe.target.checked),
                            className:
                              "accent-blue-600 rounded bg-slate-900 border-slate-850",
                          }),
                          e.jsx("span", { children: "Ingat Saya" }),
                        ],
                      }),
                      e.jsx("button", {
                        type: "button",
                        onClick: () =>
                          alert(
                            "Simulasi Lupa password: Silakan email tim support di info@mikrobil.com untuk reset kredensial.",
                          ),
                        className:
                          "text-blue-500 hover:text-blue-400 transition-colors cursor-pointer",
                        children: "Lupa Password?",
                      }),
                    ],
                  }),
                e.jsx("button", {
                  id: `submit-${b}-btn`,
                  type: "submit",
                  disabled: ue,
                  className:
                    "w-full py-2.5 rounded-lg bg-blue-600 hover:bg-blue-500 disabled:bg-blue-800 text-xs font-bold text-white shadow-lg shadow-blue-500/10 cursor-pointer pt-3 transition-colors",
                  children: ue
                    ? "Memproses..."
                    : b === "login"
                      ? "Masuk ke Panel"
                      : "Buat Akun Tenant",
                }),
              ],
            }),
            e.jsxs("div", {
              className: "text-center font-sans text-xs",
              children: [
                e.jsx("span", {
                  className: "text-slate-500",
                  children:
                    b === "login" ? "Belum punya akun?" : "Sudah terdaftar?",
                }),
                " ",
                e.jsx("button", {
                  onClick: () => {
                    (V(b === "login" ? "register" : "login"), B(""));
                  },
                  className:
                    "font-bold text-blue-500 hover:text-blue-400 cursor-pointer transition-colors",
                  children: b === "login" ? "Daftar Sekarang" : "Masuk ke Akun",
                }),
              ],
            }),
            e.jsx("div", {
              className: "pt-2 text-center lg:hidden",
              children: e.jsx("button", {
                onClick: J,
                className: "text-xs text-slate-400 underline",
                children: "Kembali Ke Beranda",
              }),
            }),
          ],
        }),
      }),
    ],
  });
}
function yg({ activeRole: w }) {
  var O;
  const [J, S] = f.useState({
      total_customers: 0,
      active_customers: 0,
      suspended_customers: 0,
      revenue_today: 0,
      unpaid_invoices: 0,
      routers_online: 0,
      routers_total: 0,
      router_statuses: [],
      active_alerts: [],
    }),
    [b, V] = f.useState(!0),
    [ue, re] = f.useState([]),
    [ee, B] = f.useState([]),
    [T, fe] = f.useState("all"),
    [G, F] = f.useState(""),
    [ce, ve] = f.useState(!1),
    [Y, Ee] = f.useState([]),
    [Se, le] = f.useState(""),
    [ie, $] = f.useState(!1),
    [de, oe] = f.useState(!1),
    [be, Ye] = f.useState("bandwidth"),
    [Te, Ie] = f.useState(""),
    [me, Oe] = f.useState(""),
    te = async () => {
      try {
        const z = await (await fetch("/api/v1/dashboard/overview")).json();
        z.status === "success" && S(z.data);
      } catch (P) {
        console.error(P);
      }
    },
    Ae = async () => {
      try {
        const z = await (await fetch("/api/v1/routers/1/traffic")).json();
        z.status === "success" && re((P) => [...P, ...(Array.isArray(z.data) ? z.data : [])].slice(-30));
      } catch (P) {
        console.error(P);
      }
    },
    Ue = async () => {
      try {
        ve(!0);
        const z = await (await fetch("/api/v1/audit-logs")).json();
        z.status === "success" && B(z.data);
      } catch (P) {
        console.error(P);
      } finally {
        ve(!1);
      }
    },
    y = async () => {
      try {
        const z = await (await fetch("/api/v1/noc/snapshots")).json();
        z.status === "success" && Ee(z.data);
      } catch (P) {
        console.error("Gagal memuat snapshot NOC:", P);
      }
    };
  if (
    (f.useEffect(() => {
      (te(), Ae(), Ue(), y());
      const P = setInterval(() => {
        (te(), Ae(), Ue(), y());
      }, 1e4);
      return () => clearInterval(P);
    }, []),
    f.useEffect(() => {
      V(!1);
    }, [J]),
    b)
  )
    return e.jsx("div", {
      className:
        "flex items-center justify-center h-full text-xs font-mono font-bold text-slate-500",
      children: "Memuat Dashboard NOC...",
    });
  const K = ee.filter((P) => {
    if (
      T !== "all" &&
      ((T === "mikrotik" &&
        !(
          P.action.startsWith("router") ||
          P.action.startsWith("pppoe") ||
          P.action.startsWith("radius") ||
          P.action.startsWith("static_ip")
        )) ||
        (T === "hotspot" && !P.action.startsWith("hotspot")) ||
        (T === "customer" && !P.action.startsWith("customer")) ||
        (T === "billing" &&
          !P.action.startsWith("invoice") &&
          !P.action.startsWith("settings")))
    )
      return !1;
    if (G.trim()) {
      const z = G.toLowerCase(),
        g = (P.user_name || "").toLowerCase(),
        C = (P.action || "").toLowerCase(),
        I = (P.details || "").toLowerCase(),
        X = (P.ip_address || "").toLowerCase(),
        pe = (P.entity_type || "").toLowerCase();
      if (
        !g.includes(z) &&
        !C.includes(z) &&
        !I.includes(z) &&
        !X.includes(z) &&
        !pe.includes(z)
      )
        return !1;
    }
    return !0;
  });
  return e.jsxs("div", {
    id: "dashboard-noc-view",
    className: "space-y-6 max-w-7xl mx-auto w-full font-sans select-none",
    children: [
      e.jsxs("div", {
        className:
          "flex flex-col md:flex-row md:items-center justify-between gap-4",
        children: [
          e.jsxs("div", {
            children: [
              e.jsx("h1", {
                className:
                  "text-xl font-display font-extrabold text-slate-900 tracking-tight",
                children: "NOC Real-Time Dashboard",
              }),
              e.jsx("p", {
                className: "text-xs text-slate-500 font-light mt-0.5",
                children:
                  "Lacak status server, metrics bandwidth router, kelangsungan PPPoE, dan tagihan saas di sini.",
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "flex items-center gap-2 text-xs font-mono bg-slate-100 px-3 py-1.5 rounded-lg border border-slate-205 text-slate-650",
            children: [
              e.jsx(Wr, {
                className: "h-3.5 w-3.5 text-blue-600 animate-spin",
              }),
              e.jsx("span", { children: "Live Sync Stat: AKTIF (tiap 10s)" }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
        children: [
          e.jsxs("div", {
            id: "stat-revenue",
            className:
              "p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md transition-shadow",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  e.jsx("span", {
                    className:
                      "text-[10px] uppercase font-mono font-bold tracking-wider text-slate-400",
                    children: "Pemasukan Hari Ini",
                  }),
                  e.jsx("div", {
                    className:
                      "p-1.5 bg-emerald-50 text-emerald-600 rounded-lg",
                    children: e.jsx(pu, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "mt-2.5",
                children: [
                  e.jsxs("h3", {
                    className:
                      "text-xl font-display font-extrabold text-slate-900",
                    children: [
                      "Rp ",
                      (O = J.revenue_today) == null
                        ? void 0
                        : O.toLocaleString(),
                    ],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[10px] text-emerald-600 flex items-center gap-1 mt-0.5 font-sans font-semibold",
                    children: [
                      e.jsx(kf, { className: "h-3.5 w-3.5" }),
                      e.jsx("span", { children: "+12.4% vs kemarin" }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            id: "stat-customers",
            className:
              "p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md transition-shadow",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  e.jsx("span", {
                    className:
                      "text-[10px] uppercase font-mono font-bold tracking-wider text-slate-400",
                    children: "Total Pelanggan",
                  }),
                  e.jsx("div", {
                    className: "p-1.5 bg-blue-50 text-blue-600 rounded-lg",
                    children: e.jsx(Jn, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "mt-2.5",
                children: [
                  e.jsxs("h3", {
                    className:
                      "text-xl font-display font-extrabold text-slate-900",
                    children: [J.total_customers, " CRM"],
                  }),
                  e.jsxs("div", {
                    className:
                      "flex gap-2 items-center text-[10px] text-slate-500 mt-1",
                    children: [
                      e.jsxs("span", {
                        className:
                          "bg-emerald-50 text-emerald-600 px-1.5 py-0.5 rounded font-bold font-mono",
                        children: [J.active_customers, " On"],
                      }),
                      e.jsxs("span", {
                        className:
                          "bg-rose-50 text-rose-600 px-1.5 py-0.5 rounded font-bold font-mono",
                        children: [J.suspended_customers, " Suspended"],
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            id: "stat-unpaid",
            className:
              "p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md transition-shadow",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  e.jsx("span", {
                    className:
                      "text-[10px] uppercase font-mono font-bold tracking-wider text-slate-400",
                    children: "Tagihan Menunggak",
                  }),
                  e.jsx("div", {
                    className: "p-1.5 bg-amber-50 text-amber-600 rounded-lg",
                    children: e.jsx(nr, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "mt-2.5",
                children: [
                  e.jsxs("h3", {
                    className:
                      "text-xl font-display font-extrabold text-slate-900",
                    children: [J.unpaid_invoices, " Invoice"],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[10px] text-amber-600 flex items-center gap-1 mt-0.5 font-semibold",
                    children: [
                      e.jsx(Wr, { className: "h-3 w-3" }),
                      e.jsx("span", { children: "Butuh follow up reminder" }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            id: "stat-routers",
            className:
              "p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md transition-shadow",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between",
                children: [
                  e.jsx("span", {
                    className:
                      "text-[10px] uppercase font-mono font-bold tracking-wider text-slate-400",
                    children: "Router Core Online",
                  }),
                  e.jsx("div", {
                    className: "p-1.5 bg-slate-50 text-slate-700 rounded-lg",
                    children: e.jsx(gc, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "mt-2.5",
                children: [
                  e.jsxs("h3", {
                    className:
                      "text-xl font-display font-extrabold text-slate-900",
                    children: [J.routers_online, " / ", J.routers_total, " Router"],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[10px] text-rose-500 font-semibold flex items-center gap-1 mt-0.5",
                    children: [
                      e.jsx(Xn, { className: "h-3 w-3" }),
                      e.jsx("span", { children: J.routers_total === J.routers_online ? "Semua router terhubung" : `${Math.max(0, J.routers_total - J.routers_online)} router offline` }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            id: "traffic-chart-card",
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm lg:col-span-2 space-y-4",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b border-slate-100 pb-3",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("h3", {
                        className: "text-sm font-bold text-slate-800",
                        children: `Traffic Monitor ${(ue.length && ue[ue.length - 1].interface) || "WAN"} (Kbps)`,
                      }),
                      e.jsx("p", {
                        className: "text-[10px] text-slate-400",
                        children: "Nilai throughput RX & TX Real-Time",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "flex gap-3 text-[10px] font-mono font-bold",
                    children: [
                      e.jsxs("span", {
                        className: "flex items-center gap-1 text-blue-500",
                        children: [
                          e.jsx("span", {
                            className: "h-2 w-2 rounded-full bg-blue-500",
                          }),
                          " RX (Download)",
                        ],
                      }),
                      e.jsxs("span", {
                        className: "flex items-center gap-1 text-emerald-500",
                        children: [
                          e.jsx("span", {
                            className: "h-2 w-2 rounded-full bg-emerald-500",
                          }),
                          " TX (Upload)",
                        ],
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "h-52 w-full bg-slate-950/20 border border-slate-100 rounded-xl flex items-end p-2 relative overflow-hidden",
                children: [
                  e.jsxs("div", {
                    className:
                      "absolute inset-0 grid grid-rows-4 divide-y divide-slate-100/30 p-2",
                    children: [
                      e.jsx("div", {}),
                      e.jsx("div", {}),
                      e.jsx("div", {}),
                      e.jsx("div", {}),
                    ],
                  }),
                  e.jsxs("svg", {
                    className: "absolute inset-0 h-full w-full",
                    preserveAspectRatio: "none",
                    viewBox: "0 0 100 100",
                    children: [
                      e.jsxs("defs", {
                        children: [
                          e.jsxs("linearGradient", {
                            id: "rxGrad",
                            x1: "0",
                            y1: "0",
                            x2: "0",
                            y2: "1",
                            children: [
                              e.jsx("stop", {
                                offset: "0%",
                                stopColor: "#3b82f6",
                                stopOpacity: "0.4",
                              }),
                              e.jsx("stop", {
                                offset: "100%",
                                stopColor: "#3b82f6",
                                stopOpacity: "0",
                              }),
                            ],
                          }),
                          e.jsxs("linearGradient", {
                            id: "txGrad",
                            x1: "0",
                            y1: "0",
                            x2: "0",
                            y2: "1",
                            children: [
                              e.jsx("stop", {
                                offset: "0%",
                                stopColor: "#10b981",
                                stopOpacity: "0.4",
                              }),
                              e.jsx("stop", {
                                offset: "100%",
                                stopColor: "#10b981",
                                stopOpacity: "0",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsx("path", {
                        d:
                          J.routers_online > 0
                            ? "M 0 100 Q 15 45, 30 55 T 60 25 T 90 40 T 100 20 L 100 100 Z"
                            : "M 0 100 Q 15 100, 30 100 T 60 100 T 90 100 T 100 100 L 100 100 Z",
                        fill: "url(#rxGrad)",
                      }),
                      e.jsx("path", {
                        d:
                          J.routers_online > 0
                            ? "M 0 100 Q 15 45, 30 55 T 60 25 T 90 40 T 100 20"
                            : "M 0 100 Q 15 100, 30 100 T 60 100 T 90 100 T 100 100",
                        fill: "none",
                        stroke: J.routers_online > 0 ? "#3b82f6" : "#e2e8f0",
                        strokeWidth: "2",
                      }),
                      e.jsx("path", {
                        d:
                          J.routers_online > 0
                            ? "M 0 100 Q 10 75, 30 85 T 60 65 T 90 70 T 100 68 L 100 100 Z"
                            : "M 0 100 Q 10 100, 30 100 T 60 100 T 90 100 T 100 100 L 100 100 Z",
                        fill: "url(#txGrad)",
                      }),
                      e.jsx("path", {
                        d:
                          J.routers_online > 0
                            ? "M 0 100 Q 10 75, 30 85 T 60 65 T 90 70 T 100 68"
                            : "M 0 100 Q 10 100, 30 100 T 60 100 T 90 100 T 100 100",
                        fill: "none",
                        stroke: J.routers_online > 0 ? "#10b981" : "#cbd5e1",
                        strokeWidth: "1.5",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "absolute left-2 top-2 text-[9px] font-mono text-slate-500 bg-white/70 px-1 py-0.5 rounded",
                    children: "Peak: 20M Bps",
                  }),
                  e.jsx("div", {
                    className:
                      "absolute right-2 bottom-2 text-[9px] font-mono text-slate-400",
                    children: J.routers_online > 0 ? "Live Feed" : "Offline",
                  }),
                  J.routers_online === 0 &&
                    e.jsxs("div", {
                      className:
                        "absolute inset-0 flex flex-col items-center justify-center bg-slate-900/5 backdrop-blur-[1.5px] text-center p-4 space-y-2.5",
                      children: [
                        e.jsxs("div", {
                          className: "space-y-0.5",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-slate-750 font-extrabold text-[12px] uppercase tracking-wider block",
                              children: "MikroTik Belum Terhubung",
                            }),
                            e.jsx("span", {
                              className:
                                "text-slate-450 text-[10px] max-w-xs leading-normal block",
                              children:
                                "Lalu lintas data (Traffic Monitor) akan otomatis aktif setelah Anda menghubungkan ke Router MikroTik.",
                            }),
                          ],
                        }),
                        e.jsx("button", {
                          type: "button",
                          onClick: () => {
                            window.__targetSubTab = "radius";
                            document
                              .getElementById("nav-item-internet")
                              ?.click();
                          },
                          className:
                            "px-3.5 py-1.5 bg-blue-600 hover:bg-blue-550 active:scale-95 text-white font-bold rounded-lg cursor-pointer transition-all text-[11px] shadow-md shadow-blue-500/25 flex items-center gap-1 mx-auto",
                          children: "Hubungkan MikroTik",
                        }),
                      ],
                    }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            id: "customer-growth-card",
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", {
                    className: "text-sm font-bold text-slate-800",
                    children: "Distribusi Klien per Status",
                  }),
                  e.jsx("p", {
                    className: "text-[10px] text-slate-400",
                    children: "Visualisasi data demografi klien aktif",
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "h-44 w-full flex items-end justify-around gap-2 px-4 pt-10",
                children: [
                  {
                    label: "Aktif",
                    count: J.active_customers,
                    color: "bg-emerald-500",
                  },
                  {
                    label: "Suspend",
                    count: J.suspended_customers,
                    color: "bg-rose-500",
                  },
                  { label: "Non-Aktif", count: 1, color: "bg-slate-400" },
                  { label: "Leads", count: 1, color: "bg-blue-500" },
                ].map((P, z) => {
                  const g =
                    J.total_customers > 0
                      ? (P.count / J.total_customers) * 100
                      : 10;
                  return e.jsxs(
                    "div",
                    {
                      className: "flex flex-col items-center flex-1 space-y-2",
                      children: [
                        e.jsx("span", {
                          className:
                            "text-[10px] font-mono font-bold text-slate-700",
                          children: P.count,
                        }),
                        e.jsx("div", {
                          className:
                            "w-full bg-slate-100 rounded-t-md h-28 flex items-end overflow-hidden",
                          children: e.jsx("div", {
                            className: `w-full rounded-t-md ${P.color}`,
                            style: { height: `${Math.max(g, 15)}%` },
                          }),
                        }),
                        e.jsx("span", {
                          className:
                            "text-[10px] font-medium text-slate-500 tracking-tight capitalize truncate w-full text-center",
                          children: P.label,
                        }),
                      ],
                    },
                    z,
                  );
                }),
              }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            id: "active-alerts-list-card",
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm lg:col-span-2 space-y-3",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b border-slate-100 pb-3 mb-1",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("h3", {
                        className: "text-sm font-bold text-slate-800",
                        children: "Alert Keamanan & Aliran Jaringan",
                      }),
                      e.jsx("p", {
                        className: "text-[10px] text-slate-400",
                        children: "Daftar anomali / penalti billing engine",
                      }),
                    ],
                  }),
                  e.jsx("span", {
                    className:
                      "bg-rose-50 text-rose-600 text-[10px] font-bold px-2 py-0.5 rounded font-mono",
                    children: "AKTIF SYNC",
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "space-y-2.5 max-h-56 overflow-y-auto custom-scroll pr-1",
                children:
                  J.active_alerts.length === 0
                    ? e.jsx("div", {
                        className: "p-6 text-center text-xs text-slate-400",
                        children:
                          "Tidak ada alert aktif dari sumber jaringan yang terhubung.",
                      })
                    : J.active_alerts.map((P) =>
                        e.jsxs(
                          "div",
                          {
                            className: `p-3.5 rounded-lg border text-xs flex gap-3 items-start ${P.severity === "danger" ? "bg-rose-50/50 border-rose-150" : P.severity === "warning" ? "bg-amber-50/50 border-amber-150" : "bg-blue-50/50 border-blue-150"}`,
                            children: [
                              e.jsx("div", {
                                className: "mt-0.5",
                                children:
                                  P.severity === "danger"
                                    ? e.jsx(Xn, {
                                        className: "h-4 w-4 text-rose-600",
                                      })
                                    : P.severity === "warning"
                                      ? e.jsx(Xn, {
                                          className: "h-4 w-4 text-amber-600",
                                        })
                                      : e.jsx(hc, {
                                          className: "h-4 w-4 text-blue-600",
                                        }),
                              }),
                              e.jsxs("div", {
                                className: "flex-1",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex items-center justify-between",
                                    children: [
                                      e.jsx("h4", {
                                        className: "font-bold text-slate-800",
                                        children: P.title,
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[9px] text-slate-400 font-mono",
                                        children: new Date(
                                          P.timestamp,
                                        ).toLocaleTimeString("id", {
                                          hour: "2-digit",
                                          minute: "2-digit",
                                        }),
                                      }),
                                    ],
                                  }),
                                  e.jsx("p", {
                                    className:
                                      "text-[11px] text-slate-500 leading-normal mt-1",
                                    children: P.message,
                                  }),
                                ],
                              }),
                            ],
                          },
                          P.id,
                        ),
                      ),
              }),
            ],
          }),
          e.jsxs("div", {
            id: "active-routers-list-card",
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
            children: [
              e.jsx("div", {
                className:
                  "flex items-center justify-between border-b border-slate-100 pb-3",
                children: e.jsxs("div", {
                  children: [
                    e.jsx("h3", {
                      className: "text-sm font-bold text-slate-800",
                      children: "Status Router RouterOS",
                    }),
                    e.jsx("p", {
                      className: "text-[10px] text-slate-400",
                      children: "Kredensial Winbox API",
                    }),
                  ],
                }),
              }),
              e.jsx("div", {
                className: "space-y-3.5 text-xs",
                children: (J.router_statuses || []).length ? J.router_statuses.map((P) => e.jsxs("div", {
                  className: "flex items-center justify-between",
                  children: [
                    e.jsxs("div", { children: [
                      e.jsx("h4", { className: `font-bold ${P.status === "online" ? "text-slate-800" : "text-slate-400"}`, children: P.identity || P.name }),
                      e.jsx("p", { className: "text-[10px] font-mono text-slate-400", children: `IP: ${P.ip_address || P.ip} | API ${P.api_port || 8728}` })
                    ] }),
                    e.jsxs("div", { className: "text-right", children: [
                      e.jsx("span", { className: `text-[10px] px-1.5 py-0.5 rounded border font-bold ${P.status === "online" ? "bg-green-50 text-green-600 border-green-200" : "bg-rose-50 text-rose-600 border-rose-200"}`, children: P.status === "online" ? "ONLINE" : "OFFLINE" }),
                      e.jsx("span", { className: "block text-[9px] text-slate-405 font-mono mt-0.5", children: P.ping == null ? "Timeout" : `Ping: ${P.ping}ms` })
                    ] })
                  ]
                }, P.id)) : e.jsx("p", { className: "text-slate-400 text-center py-4", children: "Belum ada Router NAS yang dikonfigurasi." }),
              }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        id: "noc-audit-logs-card",
        className:
          "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4 text-left",
        children: [
          e.jsxs("div", {
            className:
              "flex flex-col md:flex-row md:items-center justify-between border-b border-slate-100 pb-4 gap-3",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsxs("h3", {
                    className:
                      "text-sm font-bold text-slate-800 flex items-center gap-2",
                    children: [
                      e.jsx(Dp, {
                        className: "h-5 w-5 text-blue-600 animate-pulse",
                      }),
                      e.jsx("span", {
                        children:
                          "Sistem Log Audit & Jejak Aktivitas Staf (NOC Audit Log)",
                      }),
                    ],
                  }),
                  e.jsx("p", {
                    className: "text-[11px] text-slate-400 mt-0.5",
                    children:
                      "Mencatat seluruh perubahan parameter MikroTik, manajemen cetak/hapus voucher, status pelanggan, dan eksekusi skrip router.",
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "flex items-center gap-2",
                children: [
                  e.jsxs("span", {
                    className:
                      "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-bold bg-green-50 text-green-600 border border-green-200",
                    children: [
                      e.jsx("span", {
                        className:
                          "inline-block w-1.5 h-1.5 rounded-full bg-green-500 animate-ping",
                      }),
                      "Live Tracking Aktif",
                    ],
                  }),
                  e.jsxs("button", {
                    onClick: () => Ue(),
                    disabled: ce,
                    className:
                      "px-2.5 py-1.5 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded text-[11px] font-semibold text-slate-600 cursor-pointer flex items-center gap-1 shadow-sm transition-all active:scale-95 disabled:opacity-50",
                    title: "Segarkan log audit biling sekarang",
                    children: [
                      e.jsx(Va, {
                        className: `h-3 w-3 ${ce ? "animate-spin text-blue-600" : ""}`,
                      }),
                      "Sync Manual",
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "grid grid-cols-1 md:grid-cols-12 gap-3 pb-2 pt-1",
            children: [
              e.jsx("div", {
                className: "md:col-span-8 flex flex-wrap gap-1",
                children: [
                  { id: "all", label: "Semua Kategori", count: ee.length },
                  {
                    id: "mikrotik",
                    label: "MikroTik & Koneksi",
                    count: ee.filter(
                      (P) =>
                        P.action.startsWith("router") ||
                        P.action.startsWith("pppoe") ||
                        P.action.startsWith("radius") ||
                        P.action.startsWith("static_ip"),
                    ).length,
                  },
                  {
                    id: "hotspot",
                    label: "Hotspot & Voucher",
                    count: ee.filter((P) => P.action.startsWith("hotspot"))
                      .length,
                  },
                  {
                    id: "customer",
                    label: "Manajemen Pelanggan",
                    count: ee.filter((P) => P.action.startsWith("customer"))
                      .length,
                  },
                  {
                    id: "billing",
                    label: "Tagihan & Billing",
                    count: ee.filter(
                      (P) =>
                        P.action.startsWith("invoice") ||
                        P.action.startsWith("settings"),
                    ).length,
                  },
                ].map((P) =>
                  e.jsxs(
                    "button",
                    {
                      onClick: () => fe(P.id),
                      className: `px-3 py-1.5 rounded-lg text-xs font-bold transition-all relative cursor-pointer border ${T === P.id ? "bg-blue-600 text-white border-blue-600 shadow-sm" : "bg-slate-50 text-slate-600 border-slate-200 hover:bg-slate-100"}`,
                      children: [
                        P.label,
                        e.jsx("span", {
                          className: `ml-1 px-1.5 py-0.2 text-[9px] font-extrabold rounded-full ${T === P.id ? "bg-white/20 text-white" : "bg-slate-200 text-slate-700"}`,
                          children: P.count,
                        }),
                      ],
                    },
                    P.id,
                  ),
                ),
              }),
              e.jsxs("div", {
                className: "md:col-span-4 relative",
                children: [
                  e.jsx(Pi, {
                    className:
                      "absolute left-3 top-2.5 h-3.5 w-3.5 text-slate-400",
                  }),
                  e.jsx("input", {
                    type: "text",
                    placeholder: "Cari kata kunci audit / admin...",
                    value: G,
                    onChange: (P) => F(P.target.value),
                    className:
                      "w-full pl-8.5 pr-8 py-1.5 bg-slate-50 border border-slate-200 rounded-lg text-xs font-medium focus:outline-none focus:ring-1 focus:ring-blue-500 focus:bg-white transition-all shadow-inner",
                  }),
                  G &&
                    e.jsx("button", {
                      onClick: () => F(""),
                      className:
                        "absolute right-2.5 top-2 text-slate-400 hover:text-slate-600 text-xs font-bold cursor-pointer",
                      children: "×",
                    }),
                ],
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "border border-slate-150 rounded-lg overflow-hidden bg-slate-50/50",
            children: e.jsx("div", {
              className:
                "max-h-[380px] overflow-y-auto custom-scroll divide-y divide-slate-100",
              children:
                K.length === 0
                  ? e.jsxs("div", {
                      id: "audit-empty-view",
                      className: "p-10 text-center space-y-2",
                      children: [
                        e.jsx($n, {
                          className: "h-8 w-8 text-slate-300 mx-auto",
                        }),
                        e.jsx("p", {
                          className: "text-xs font-bold text-slate-500",
                          children: "Tidak ada log audit ditemukan",
                        }),
                        e.jsx("p", {
                          className:
                            "text-[10px] text-slate-400 max-w-md mx-auto",
                          children:
                            "Coba sesuaikan kata kunci pencarian atau ubah tab kategori untuk menampilkan riwayat log penjejakan NOC.",
                        }),
                      ],
                    })
                  : K.map((P) => {
                      let z = "bg-slate-100 text-slate-700 border-slate-200",
                        g = "SYSTEM_EVENT",
                        C = eo;
                      return (
                        P.action.startsWith("customer")
                          ? P.action.includes("suspend")
                            ? ((z =
                                "bg-amber-50 text-amber-700 border-amber-200"),
                              (g = "CLIENT_SUSPENDED"),
                              (C = Xn))
                            : P.action.includes("unsuspend") ||
                                P.action.includes("activate")
                              ? ((z =
                                  "bg-emerald-50 text-emerald-700 border-emerald-200"),
                                (g = "CLIENT_REACTIVE"),
                                (C = hc))
                              : P.action.includes("delete")
                                ? ((z =
                                    "bg-rose-50 text-rose-700 border-rose-200"),
                                  (g = "CLIENT_DELETED"),
                                  (C = ms))
                                : ((z =
                                    "bg-blue-50 text-blue-700 border-blue-200"),
                                  (g = "CRM_USER_MODIFIED"),
                                  (C = Jn))
                          : P.action.startsWith("hotspot")
                            ? P.action.includes("delete")
                              ? ((z =
                                  "bg-rose-50 text-rose-700 border-rose-250"),
                                (g = "VOUCHER_DESTROYED"),
                                (C = ms))
                              : P.action.includes("generate")
                                ? ((z =
                                    "bg-indigo-50 text-indigo-700 border-indigo-200"),
                                  (g = "VCH_GENERATION"),
                                  (C = ar))
                                : P.action.includes("reset_mac")
                                  ? ((z =
                                      "bg-amber-50 text-amber-700 border-amber-200"),
                                    (g = "MAC_UNBOUND"),
                                    (C = Va))
                                  : ((z =
                                      "bg-slate-100 text-slate-700 border-slate-200"),
                                    (g = "HOTSPOT_CONFIG"),
                                    (C = Nn))
                            : P.action.includes("execute")
                              ? ((z =
                                  "bg-violet-50 text-violet-700 border-violet-200"),
                                (g = "MTRK_SHELL_CMD"),
                                (C = Rp))
                              : P.action.includes("sync")
                                ? ((z =
                                    "bg-blue-50 text-blue-700 border-blue-200"),
                                  (g = "RADIUS_ROUTER_SYNC"),
                                  (C = Va))
                                : P.action.startsWith("pppoe")
                                  ? ((z =
                                      "bg-sky-50 text-sky-700 border-sky-200"),
                                    (g = "MTRK_PPPOE_PROFILE"),
                                    (C = gc))
                                  : P.action.startsWith("radius") ||
                                      P.action.startsWith("static_ip")
                                    ? ((z =
                                        "bg-teal-50 text-teal-700 border-teal-200"),
                                      (g = "NAS_GATEWAY_NET"),
                                      (C = Wr))
                                    : (P.action.startsWith("invoice") ||
                                        P.action.startsWith("settings")) &&
                                      ((z =
                                        "bg-purple-50 text-purple-700 border-purple-200"),
                                      (g = "BILLING_MUTATION"),
                                      (C = nr)),
                        e.jsxs(
                          "div",
                          {
                            className:
                              "p-3.5 hover:bg-white bg-white/70 transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-2",
                            children: [
                              e.jsxs("div", {
                                className: "flex items-start gap-3",
                                children: [
                                  e.jsx("div", {
                                    className: `p-2 rounded-lg border hidden sm:block ${z.split(" ")[0]} ${z.split(" ")[2]}`,
                                    children: e.jsx(C, {
                                      className: "h-4 w-4",
                                    }),
                                  }),
                                  e.jsxs("div", {
                                    className: "space-y-0.5",
                                    children: [
                                      e.jsxs("div", {
                                        className:
                                          "flex flex-wrap items-center gap-1.5",
                                        children: [
                                          e.jsx("span", {
                                            className: `px-2 py-0.5 rounded text-[9px] font-extrabold border uppercase tracking-wider ${z}`,
                                            children: g,
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-[10px] font-semibold text-slate-450",
                                            children: "•",
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-[11px] font-bold text-slate-800",
                                            children:
                                              P.details ||
                                              `Admin melakukan aksi "${P.action}"`,
                                          }),
                                        ],
                                      }),
                                      e.jsxs("div", {
                                        className:
                                          "flex flex-wrap items-center gap-3 text-[10px] text-slate-400 pt-1 font-medium",
                                        children: [
                                          e.jsxs("span", {
                                            className:
                                              "flex items-center gap-1",
                                            children: [
                                              e.jsx("span", {
                                                className:
                                                  "inline-block w-1.5 h-1.5 rounded-full bg-blue-500",
                                              }),
                                              "Operator: ",
                                              e.jsx("strong", {
                                                className:
                                                  "text-slate-650 font-semibold",
                                                children:
                                                  P.user_name ||
                                                  "Admin Jaya Net",
                                              }),
                                            ],
                                          }),
                                          e.jsx("span", { children: "•" }),
                                          e.jsxs("span", {
                                            children: [
                                              "IP Terminal: ",
                                              e.jsx("strong", {
                                                className:
                                                  "font-mono text-slate-600",
                                                children:
                                                  P.ip_address ||
                                                  "182.2.34.120",
                                              }),
                                            ],
                                          }),
                                          e.jsx("span", { children: "•" }),
                                          e.jsxs("span", {
                                            children: [
                                              "Entity: ",
                                              e.jsxs("strong", {
                                                className:
                                                  "text-slate-650 font-semibold",
                                                children: [
                                                  P.entity_type || "Sistem",
                                                  " (#",
                                                  P.entity_id || "0",
                                                  ")",
                                                ],
                                              }),
                                            ],
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className:
                                  "text-right flex items-center sm:block gap-2 justify-between",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "text-[10px] text-slate-400 font-bold font-mono",
                                    children: [
                                      new Date(P.created_at).toLocaleDateString(
                                        "id-ID",
                                        { day: "2-digit", month: "short" },
                                      ),
                                      " ",
                                      new Date(P.created_at).toLocaleTimeString(
                                        "id-ID",
                                        {
                                          hour: "2-digit",
                                          minute: "2-digit",
                                          second: "2-digit",
                                        },
                                      ),
                                    ],
                                  }),
                                  e.jsxs("span", {
                                    className:
                                      "text-[9px] px-1 bg-slate-100 font-semibold rounded text-slate-500 border border-slate-200 mt-0.5 inline-block font-mono",
                                    children: ["ID: ", 202600 + P.id],
                                  }),
                                ],
                              }),
                            ],
                          },
                          P.id,
                        )
                      );
                    }),
            }),
          }),
        ],
      }),
    ],
  });
}
function jg({ activeRole: w }) {
  var C,
    I,
    X,
    pe,
    he,
    Ne,
    $e,
    ae,
    ze,
    at,
    bt,
    Mt,
    ge,
    Me,
    mt,
    st,
    Z,
    _e,
    Ze,
    Xe,
    Ht,
    St;
  const [J, S] = f.useState([]),
    [b, V] = f.useState([]),
    [ue, re] = f.useState("all"),
    [ee, B] = f.useState(""),
    [T, fe] = f.useState(null),
    [G, F] = f.useState([]),
    [ce, ve] = f.useState(null),
    [Y, Ee] = f.useState("profile"),
    [Se, le] = f.useState(!1),
    [ie, $] = f.useState(!1),
    [de, oe] = f.useState(!1),
    [be, Ye] = f.useState(null),
    [Te, Ie] = f.useState({
      full_name: "",
      email: "",
      phone: "",
      address: "",
      latitude: -6.2146,
      longitude: 106.8451,
      package_id: 1,
      status: "active",
    }),
    [me, Oe] = f.useState(""),
    te = async () => {
      try {
        const Re = await (await fetch("/api/v1/customers")).json();
        Re.status === "success" && S(Re.data);
      } catch (E) {
        console.error(E);
      }
    },
    Ae = async () => {
      V([
        { id: 1, name: "Home-Lite 10M", price: 15e4 },
        { id: 2, name: "Home-Fast 30M", price: 25e4 },
        { id: 3, name: "Gamer-Pro 100M", price: 45e4 },
      ]);
    },
    Ue = async (E) => {
      try {
        const qe = await (await fetch(`/api/v1/customers/${E}`)).json();
        qe.status === "success" && ve(qe.data);
      } catch (Re) {
        console.error(Re);
      }
    };
  (f.useEffect(() => {
    (te(), Ae());
  }, []),
    f.useEffect(() => {
      T && Ue(T);
    }, [T]));
  const y = async (E) => {
      (E.preventDefault(), oe(!0));
      try {
        (
          await (
            await fetch("/api/v1/customers", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(Te),
            })
          ).json()
        ).status === "success" &&
          (le(!1),
          Ie({
            full_name: "",
            email: "",
            phone: "",
            address: "",
            latitude: -6.2146,
            longitude: 106.8451,
            package_id: 1,
            status: "active",
          }),
          te());
      } catch (Re) {
        console.error(Re);
      } finally {
        oe(!1);
      }
    },
    K = async (E, Re) => {
      try {
        (
          await (
            await fetch(`/api/v1/customers/${E}/${Re}`, { method: "POST" })
          ).json()
        ).status === "success" && (te(), T === E && Ue(E));
      } catch (qe) {
        console.error(qe);
      }
    },
    O = async (E) => {
      try {
        (
          await (
            await fetch(`/api/v1/customers/${E}`, { method: "DELETE" })
          ).json()
        ).status === "success" &&
          (te(), T === E && (fe(null), ve(null)), Ye(null));
      } catch (Re) {
        console.error(Re);
      }
    },
    P = async (E, Re) => {
      oe(!0);
      try {
        for (const qe of G)
          E === "activate"
            ? await fetch(`/api/v1/customers/${qe}/activate`, {
                method: "POST",
              })
            : E === "suspend"
              ? await fetch(`/api/v1/customers/${qe}/suspend`, {
                  method: "POST",
                })
              : E === "apply_plan" &&
                Re !== void 0 &&
                (await fetch(`/api/v1/customers/${qe}`, {
                  method: "PUT",
                  headers: { "Content-Type": "application/json" },
                  body: JSON.stringify({ package_id: Re }),
                }));
        (F([]),
          te(),
          T && G.includes(T) && Ue(T),
          alert("Operasi batch berhasil diproses!"));
      } catch (qe) {
        (console.error("Batch operation failed:", qe),
          alert("Gagal memproses operasi batch."));
      } finally {
        oe(!1);
      }
    },
    z = async () => {
      if (!(!me.trim() || !T))
        try {
          const E = [
            ...(ce.notes || []),
            {
              id: Date.now(),
              customer_id: T,
              note: me,
              created_by: "Admin Jaya Net",
              created_at: new Date().toISOString(),
            },
          ];
          (ve({ ...ce, notes: E }), Oe(""));
        } catch (E) {
          console.error(E);
        }
    },
    g = J.filter((E) => {
      const Re = ue === "all" || E.status === ue,
        qe =
          E.full_name.toLowerCase().includes(ee.toLowerCase()) ||
          E.customer_code.toLowerCase().includes(ee.toLowerCase()) ||
          E.email.toLowerCase().includes(ee.toLowerCase()) ||
          E.phone.includes(ee);
      return Re && qe;
    });
  return e.jsxs("div", {
    className:
      "grid grid-cols-1 xl:grid-cols-3 gap-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsxs("div", {
        className: "xl:col-span-2 space-y-4",
        children: [
          e.jsxs("div", {
            className:
              "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
            children: [
              e.jsxs("div", {
                className:
                  "flex flex-col sm:flex-row items-center justify-between gap-4",
                children: [
                  e.jsx("div", {
                    children: e.jsxs("h2", {
                      className:
                        "text-sm font-extrabold text-slate-900 flex items-center gap-2",
                      children: [
                        e.jsx(Jn, { className: "h-4.5 w-4.5 text-blue-600" }),
                        e.jsxs("span", {
                          children: ["Customer Database CRM (", g.length, ")"],
                        }),
                      ],
                    }),
                  }),
                  w !== "Customer" &&
                    w !== "Finance" &&
                    w !== "Technician" &&
                    e.jsxs("button", {
                      id: "add-customer-btn",
                      onClick: () => le(!0),
                      className:
                        "w-full sm:w-auto px-3.5 py-1.5 bg-blue-600 hover:bg-blue-500 rounded-lg text-xs font-bold text-white flex items-center justify-center gap-1.5 cursor-pointer shadow-sm shadow-blue-500/10 transition-colors",
                      children: [
                        e.jsx(zp, { className: "h-4 w-4" }),
                        e.jsx("span", { children: "Pelanggan Baru" }),
                      ],
                    }),
                ],
              }),
              e.jsxs("div", {
                className: "flex flex-col sm:flex-row items-center gap-3",
                children: [
                  e.jsxs("div", {
                    className: "relative flex-1 w-full",
                    children: [
                      e.jsx(Pi, {
                        className:
                          "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400",
                      }),
                      e.jsx("input", {
                        id: "crm-search-input",
                        type: "text",
                        placeholder: "Cari kode, nama, email, phone...",
                        value: ee,
                        onChange: (E) => B(E.target.value),
                        className:
                          "w-full pl-9 pr-4 py-1.5 bg-slate-50 border border-slate-200 hover:border-slate-350 focus:border-blue-500 rounded-lg text-xs placeholder-slate-400 outline-none transition-all font-sans",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "flex gap-1.5 overflow-x-auto self-start w-full sm:w-auto",
                    children: [
                      "all",
                      "active",
                      "suspended",
                      "inactive",
                      "lead",
                    ].map((E) =>
                      e.jsx(
                        "button",
                        {
                          onClick: () => re(E),
                          className: `px-3 py-1 rounded text-[11px] font-bold capitalize transition-colors cursor-pointer ${ue === E ? "bg-slate-800 text-white" : "bg-slate-100 hover:bg-slate-200 text-slate-600"}`,
                          children: E,
                        },
                        E,
                      ),
                    ),
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "space-y-2",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between px-4 py-2 bg-slate-50 border border-slate-200 rounded-xl text-[11px] text-slate-550",
                children: [
                  e.jsxs("div", {
                    className: "flex items-center gap-2.5",
                    children: [
                      e.jsx("input", {
                        type: "checkbox",
                        checked:
                          g.length > 0 && g.every((E) => G.includes(E.id)),
                        onChange: (E) => {
                          if (E.target.checked) {
                            const Re = g.map((qe) => qe.id);
                            F((qe) => Array.from(new Set([...qe, ...Re])));
                          } else {
                            const Re = g.map((qe) => qe.id);
                            F((qe) => qe.filter((Fe) => !Re.includes(Fe)));
                          }
                        },
                        className:
                          "h-3.5 w-3.5 rounded border-slate-300 text-blue-600 focus:ring-blue-500 cursor-pointer shadow-xs",
                      }),
                      e.jsxs("span", {
                        onClick: () => {
                          if (
                            g.length > 0 &&
                            g.every((Re) => G.includes(Re.id))
                          ) {
                            const Re = g.map((qe) => qe.id);
                            F((qe) => qe.filter((Fe) => !Re.includes(Fe)));
                          } else {
                            const Re = g.map((qe) => qe.id);
                            F((qe) => Array.from(new Set([...qe, ...Re])));
                          }
                        },
                        className:
                          "font-extrabold cursor-pointer select-none text-slate-700",
                        children: [
                          "Pilih Semua Pelanggan Berdasarkan Filter (",
                          g.length,
                          ")",
                        ],
                      }),
                    ],
                  }),
                  G.length > 0 &&
                    e.jsxs("button", {
                      type: "button",
                      onClick: () => F([]),
                      className: "text-blue-600 font-extrabold hover:underline",
                      children: ["Hapus Semua Pilihan (", G.length, ")"],
                    }),
                ],
              }),
              G.length > 0 &&
                e.jsxs("div", {
                  className:
                    "p-3 bg-blue-50 border border-blue-200 rounded-xl flex flex-col md:flex-row items-center justify-between gap-3 animate-fade-in shadow-xs text-left",
                  children: [
                    e.jsxs("div", {
                      className: "flex items-center gap-2",
                      children: [
                        e.jsx("div", {
                          className:
                            "h-5 w-5 bg-blue-600 rounded-full flex items-center justify-center text-white text-[10px] font-black",
                          children: G.length,
                        }),
                        e.jsx("span", {
                          className:
                            "text-[11px] font-extrabold text-slate-700 font-sans",
                          children: "Tindakan Massal untuk Pelanggan Terpilih:",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "flex flex-wrap items-center gap-2 w-full md:w-auto justify-end",
                      children: [
                        e.jsxs("button", {
                          type: "button",
                          onClick: () => P("activate"),
                          disabled: de,
                          className:
                            "px-2.5 py-1.5 bg-emerald-600 hover:bg-emerald-500 active:bg-emerald-700 disabled:opacity-50 text-white rounded-lg text-[10px] font-extrabold flex items-center gap-1 cursor-pointer shadow-xs transition-all",
                          children: [
                            e.jsx("span", {
                              className:
                                "inline-block h-1.5 w-1.5 rounded-full bg-white animate-pulse",
                            }),
                            e.jsx("span", { children: "Enable (Aktifkan)" }),
                          ],
                        }),
                        e.jsxs("button", {
                          type: "button",
                          onClick: () => P("suspend"),
                          disabled: de,
                          className:
                            "px-2.5 py-1.5 bg-rose-600 hover:bg-rose-500 active:bg-rose-750 disabled:opacity-50 text-white rounded-lg text-[10px] font-extrabold flex items-center gap-1 cursor-pointer shadow-xs transition-all",
                          children: [
                            e.jsx("span", {
                              className:
                                "inline-block h-1.5 w-1.5 rounded-full bg-white",
                            }),
                            e.jsx("span", { children: "Disable (Suspend)" }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "flex items-center gap-1.5 bg-white border border-slate-200 rounded-lg pl-2 pr-1 py-1",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[9px] text-slate-500 font-bold whitespace-nowrap",
                              children: "Terapkan Paket:",
                            }),
                            e.jsxs("select", {
                              onChange: (E) => {
                                const Re = E.target.value;
                                Re &&
                                  (P("apply_plan", Number(Re)),
                                  (E.target.value = ""));
                              },
                              disabled: de,
                              className:
                                "text-[10px] font-extrabold text-slate-750 outline-none bg-transparent cursor-pointer",
                              children: [
                                e.jsx("option", {
                                  value: "",
                                  children: "-- Pilih Paket --",
                                }),
                                b.map((E) =>
                                  e.jsx(
                                    "option",
                                    { value: E.id, children: E.name },
                                    E.id,
                                  ),
                                ),
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
            ],
          }),
          e.jsx("div", {
            id: "customers-list-container",
            className:
              "bg-white border border-slate-200 rounded-xl shadow-sm overflow-hidden divide-y divide-slate-100",
            children:
              g.length === 0
                ? e.jsx("p", {
                    className:
                      "p-8 text-center text-xs text-slate-400 font-light",
                    children: "Tidak menemukan data pelanggan.",
                  })
                : g.map((E) => {
                    const Re = b.find((Fe) => Fe.id === E.package_id),
                      qe = T === E.id;
                    return e.jsxs(
                      "div",
                      {
                        id: `customer-item-${E.id}`,
                        onClick: () => fe(E.id),
                        className: `p-4 transition-all duration-200 cursor-pointer flex items-center justify-between gap-4 ${qe ? "bg-blue-50/40 border-l-4 border-blue-600" : "hover:bg-slate-50"}`,
                        children: [
                          e.jsxs("div", {
                            className: "flex items-start gap-3",
                            children: [
                              e.jsx("div", {
                                className: "pt-2.5",
                                onClick: (Fe) => Fe.stopPropagation(),
                                children: e.jsx("input", {
                                  type: "checkbox",
                                  checked: G.includes(E.id),
                                  onChange: (Fe) => {
                                    Fe.target.checked
                                      ? F((fa) => [...fa, E.id])
                                      : F((fa) =>
                                          fa.filter((Aa) => Aa !== E.id),
                                        );
                                  },
                                  className:
                                    "rounded border-slate-300 text-blue-600 focus:ring-blue-500 cursor-pointer h-3.5 w-3.5",
                                }),
                              }),
                              e.jsx("div", {
                                className:
                                  "h-9 w-9 rounded-full bg-slate-100 flex items-center justify-center font-bold text-slate-700 text-xs shrink-0 mt-0.5",
                                children: E.full_name
                                  .substring(0, 2)
                                  .toUpperCase(),
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsxs("div", {
                                    className: "flex items-center gap-2",
                                    children: [
                                      e.jsx("h4", {
                                        className:
                                          "text-xs font-extrabold text-slate-800 tracking-tight",
                                        children: E.full_name,
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[10px] font-mono text-slate-450",
                                        children: E.customer_code,
                                      }),
                                    ],
                                  }),
                                  e.jsx("p", {
                                    className:
                                      "text-[10px] text-slate-500 font-light mt-0.5 leading-normal",
                                    children: E.address,
                                  }),
                                  e.jsxs("div", {
                                    className:
                                      "flex items-center gap-3 mt-1.5 text-[9px] font-mono font-semibold",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-450 uppercase",
                                        children: Re ? Re.name : "Custom Plan",
                                      }),
                                      e.jsx("span", {
                                        className: "text-slate-400",
                                        children: "•",
                                      }),
                                      e.jsx("span", {
                                        className: "text-slate-450",
                                        children: E.phone,
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "flex items-center gap-3 shrink-0",
                            children: [
                              e.jsx("span", {
                                className: `text-[10px] font-extrabold px-2 py-0.5 rounded ${E.status === "active" ? "bg-green-50 text-green-600" : E.status === "suspended" ? "bg-rose-50 text-rose-600 animate-pulse" : E.status === "inactive" ? "bg-slate-100 text-slate-500" : "bg-blue-50 text-blue-600"}`,
                                children: E.status,
                              }),
                              "                     ",
                              w !== "Customer" &&
                                w !== "Finance" &&
                                w !== "Technician" &&
                                e.jsxs("div", {
                                  className: "flex gap-1.5 items-center",
                                  children: [
                                    E.status === "active"
                                      ? e.jsx("button", {
                                          id: `suspend-btn-${E.id}`,
                                          onClick: (Fe) => {
                                            (Fe.stopPropagation(),
                                              K(E.id, "suspend"));
                                          },
                                          className:
                                            "p-1 text-rose-500 hover:bg-rose-50 rounded text-[10px] font-bold",
                                          title: "Suspend Internet",
                                          children: "Suspend",
                                        })
                                      : E.status === "suspended"
                                        ? e.jsx("button", {
                                            id: `activate-btn-${E.id}`,
                                            onClick: (Fe) => {
                                              (Fe.stopPropagation(),
                                                K(E.id, "activate"));
                                            },
                                            className:
                                              "p-1 text-green-600 hover:bg-green-50 rounded text-[10px] font-bold",
                                            title: "Unsuspend Internet",
                                            children: "Unsuspend",
                                          })
                                        : null,
                                    e.jsx("div", {
                                      onClick: (Fe) => Fe.stopPropagation(),
                                      className:
                                        "ml-1 border-l pl-2 border-slate-200 flex items-center",
                                      children:
                                        be === E.id
                                          ? e.jsxs("div", {
                                              className:
                                                "flex items-center gap-1",
                                              children: [
                                                e.jsx("button", {
                                                  id: `confirm-delete-${E.id}`,
                                                  onClick: () => O(E.id),
                                                  className:
                                                    "px-1.5 py-0.5 bg-rose-600 hover:bg-rose-700 text-white rounded text-[9.5px] font-bold",
                                                  children: "Yakin?",
                                                }),
                                                e.jsx("button", {
                                                  id: `cancel-delete-${E.id}`,
                                                  onClick: () => Ye(null),
                                                  className:
                                                    "px-1.5 py-0.5 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded text-[9.5px] font-semibold",
                                                  children: "Batal",
                                                }),
                                              ],
                                            })
                                          : e.jsxs("button", {
                                              id: `delete-btn-${E.id}`,
                                              onClick: () => Ye(E.id),
                                              className:
                                                "p-1 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded text-[10px] font-bold flex items-center gap-0.5 transition-colors",
                                              title: "Hapus Pelanggan Permanen",
                                              children: [
                                                e.jsx(ms, {
                                                  className: "h-3.5 w-3.5",
                                                }),
                                                e.jsx("span", {
                                                  children: "Hapus",
                                                }),
                                              ],
                                            }),
                                    }),
                                  ],
                                }),
                            ],
                          }),
                        ],
                      },
                      E.id,
                    );
                  }),
          }),
        ],
      }),
      e.jsx("div", {
        id: "customer-details-panel",
        className:
          "bg-white border border-slate-200 rounded-xl shadow-sm overflow-hidden flex flex-col h-fit",
        children:
          !T || !ce
            ? e.jsxs("div", {
                className:
                  "p-12 text-center text-xs text-slate-400 font-light flex flex-col items-center justify-center gap-2",
                children: [
                  e.jsx(Jn, { className: "h-8 w-8 text-slate-300" }),
                  e.jsx("span", {
                    children:
                      "Klik salah satu pelanggan di daftar sebelah kiri untuk meninjau database detail, invoice, PPPoE credentials, dan TR-069 router.",
                  }),
                ],
              })
            : e.jsxs("div", {
                className: "flex flex-col h-full divide-y divide-slate-100",
                children: [
                  e.jsxs("div", {
                    className:
                      "p-4 bg-slate-50/50 flex items-center justify-between",
                    children: [
                      e.jsxs("div", {
                        children: [
                          e.jsx("h3", {
                            className: "text-sm font-extrabold text-slate-800",
                            children:
                              (C = ce.customer) == null ? void 0 : C.full_name,
                          }),
                          e.jsx("p", {
                            className:
                              "text-[10px] font-mono text-slate-450 mt-0.5",
                            children:
                              (I = ce.customer) == null
                                ? void 0
                                : I.customer_code,
                          }),
                        ],
                      }),
                      e.jsx("button", {
                        onClick: () => fe(null),
                        className:
                          "p-1 hover:bg-slate-200/50 rounded text-slate-400",
                        children: e.jsx(la, { className: "h-4 w-4" }),
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "flex overflow-x-auto gap-0.5 p-1 bg-slate-50 select-none custom-scroll",
                    children: [
                      { id: "profile", label: "Profil" },
                      { id: "billing", label: "Billing" },
                      { id: "pppoe", label: "PPPoE" },
                      { id: "devices", label: "Devices" },
                      { id: "tickets", label: "Tiket" },
                      { id: "notes", label: "Notes" },
                    ].map((E) =>
                      e.jsx(
                        "button",
                        {
                          id: `tab-btn-${E.id}`,
                          onClick: () => Ee(E.id),
                          className: `px-3 py-1.5 rounded text-[10px] font-bold tracking-tight shrink-0 transition-colors cursor-pointer ${Y === E.id ? "bg-white text-blue-600 shadow-sm" : "text-slate-500 hover:text-slate-800 hover:bg-slate-200/40"}`,
                          children: E.label,
                        },
                        E.id,
                      ),
                    ),
                  }),
                  e.jsxs("div", {
                    className:
                      "p-4 min-h-[300px] overflow-y-auto max-h-[500px] custom-scroll",
                    children: [
                      Y === "profile" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsxs("div", {
                              className: "space-y-2",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                                  children: "Informasi Kontak",
                                }),
                                e.jsxs("div", {
                                  className:
                                    "text-xs space-y-1.5 text-slate-650 bg-slate-50 p-2.5 rounded-lg border border-slate-100",
                                  children: [
                                    e.jsxs("p", {
                                      children: [
                                        e.jsx("strong", {
                                          className: "text-slate-800",
                                          children: "Email:",
                                        }),
                                        " ",
                                        (X = ce.customer) == null
                                          ? void 0
                                          : X.email,
                                      ],
                                    }),
                                    e.jsxs("p", {
                                      className: "pt-0.5",
                                      children: [
                                        e.jsx("strong", {
                                          className: "text-slate-800",
                                          children: "No WA:",
                                        }),
                                        " ",
                                        (pe = ce.customer) == null
                                          ? void 0
                                          : pe.phone,
                                      ],
                                    }),
                                    e.jsxs("p", {
                                      className: "pt-0.5",
                                      children: [
                                        e.jsx("strong", {
                                          className: "text-slate-800",
                                          children: "Alamat:",
                                        }),
                                        " ",
                                        (he = ce.customer) == null
                                          ? void 0
                                          : he.address,
                                      ],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "space-y-2",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                                  children: "Geolokasi Map Koordinat",
                                }),
                                e.jsxs("div", {
                                  className:
                                    "text-[11px] bg-slate-900 text-slate-400 p-3 rounded-lg font-mono flex items-center justify-between",
                                  children: [
                                    e.jsxs("div", {
                                      children: [
                                        e.jsxs("p", {
                                          className: "text-blue-400",
                                          children: [
                                            "LAT: ",
                                            (Ne = ce.customer) == null
                                              ? void 0
                                              : Ne.latitude,
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          className: "text-blue-400 mt-0.5",
                                          children: [
                                            "LNG: ",
                                            ($e = ce.customer) == null
                                              ? void 0
                                              : $e.longitude,
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsx(ou, {
                                      className:
                                        "h-5 w-5 text-blue-500 shrink-0",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            ((ae = ce.customer) == null
                              ? void 0
                              : ae.activation_date) &&
                              e.jsxs("div", {
                                className:
                                  "text-[11px] text-slate-500 font-light italic",
                                children: [
                                  "Ditinjau aktif sejak: ",
                                  (ze = ce.customer) == null
                                    ? void 0
                                    : ze.activation_date,
                                ],
                              }),
                          ],
                        }),
                      Y === "billing" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsx("div", {
                              className:
                                "flex items-center justify-between border-b pb-2",
                              children: e.jsx("span", {
                                className:
                                  "text-[9px] font-bold text-slate-400 uppercase tracking-widest",
                                children: "Daftar Tagihan",
                              }),
                            }),
                            e.jsx("div", {
                              className: "space-y-2",
                              children:
                                ((at = ce.invoices) == null
                                  ? void 0
                                  : at.length) === 0
                                  ? e.jsx("p", {
                                      className:
                                        "text-slate-450 text-[11px] text-center",
                                      children:
                                        "Belum ada invoice untuk pelanggan ini.",
                                    })
                                  : (bt = ce.invoices) == null
                                    ? void 0
                                    : bt.map((E) => {
                                        var Re;
                                        return e.jsxs(
                                          "div",
                                          {
                                            className:
                                              "p-2.5 bg-slate-50 border border-slate-150 rounded-lg flex items-center justify-between text-xs",
                                            children: [
                                              e.jsxs("div", {
                                                children: [
                                                  e.jsx("p", {
                                                    className:
                                                      "font-extrabold text-slate-800",
                                                    children: E.invoice_number,
                                                  }),
                                                  e.jsxs("p", {
                                                    className:
                                                      "text-[10px] text-slate-450 font-mono mt-0.5",
                                                    children: [
                                                      "Jatuh tempo: ",
                                                      new Date(
                                                        E.due_date,
                                                      ).toLocaleDateString(),
                                                    ],
                                                  }),
                                                ],
                                              }),
                                              e.jsxs("div", {
                                                className: "text-right",
                                                children: [
                                                  e.jsxs("p", {
                                                    className:
                                                      "font-extrabold text-slate-800",
                                                    children: [
                                                      "Rp ",
                                                      (Re = E.amount) == null
                                                        ? void 0
                                                        : Re.toLocaleString(),
                                                    ],
                                                  }),
                                                  e.jsx("span", {
                                                    className: `text-[9px] uppercase font-bold py-0.5 px-1.5 rounded mt-0.5 inline-block ${E.status === "paid" ? "bg-green-50 text-green-600" : E.status === "suspended" || E.status === "overdue" ? "bg-rose-50 text-rose-600 animate-pulse" : "bg-amber-50 text-amber-600"}`,
                                                    children: E.status,
                                                  }),
                                                ],
                                              }),
                                            ],
                                          },
                                          E.id,
                                        );
                                      }),
                            }),
                          ],
                        }),
                      Y === "pppoe" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                              children: "PPPoE Secret (RouterOS)",
                            }),
                            ce.pppoe
                              ? e.jsxs("div", {
                                  className: "space-y-3",
                                  children: [
                                    e.jsxs("div", {
                                      className:
                                        "text-xs space-y-1.5 bg-slate-900 border border-slate-800 text-slate-3D0 p-3 rounded-lg font-mono",
                                      children: [
                                        e.jsxs("p", {
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-white",
                                              children: "Username:",
                                            }),
                                            " ",
                                            (Mt = ce.pppoe) == null
                                              ? void 0
                                              : Mt.username,
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          className: "pt-0.5",
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-white",
                                              children: "Password:",
                                            }),
                                            " ",
                                            e.jsx("span", {
                                              className: "text-slate-400",
                                              children: "****** (Enkripsi ROS)",
                                            }),
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          className: "pt-0.5",
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-white",
                                              children: "Profile Limit:",
                                            }),
                                            " ",
                                            (ge = ce.pppoe) == null
                                              ? void 0
                                              : ge.profile,
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          className: "pt-0.5",
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-white",
                                              children: "Remote Address Pool:",
                                            }),
                                            " ",
                                            (Me = ce.pppoe) == null
                                              ? void 0
                                              : Me.remote_address,
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className:
                                        "flex items-center gap-2 p-2 bg-emerald-50 rounded-lg text-emerald-800 border border-emerald-100 text-[11px] font-medium leading-normal",
                                      children: [
                                        e.jsx(tn, {
                                          className:
                                            "h-4 w-4 shrink-0 text-emerald-600",
                                        }),
                                        e.jsx("span", {
                                          children:
                                            "Kredensial sesuai dengan target Simple Queue di router Core.",
                                        }),
                                      ],
                                    }),
                                  ],
                                })
                              : e.jsx("div", {
                                  className:
                                    "text-center p-6 bg-slate-50 border border-dashed rounded-lg",
                                  children: e.jsx("p", {
                                    className: "text-[11px] text-slate-450",
                                    children: "Tidak ada PPPoE secret terikat.",
                                  }),
                                }),
                          ],
                        }),
                      Y === "devices" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                              children: "TR-069 CPE ACS Status",
                            }),
                            ce.acsDevice
                              ? e.jsxs("div", {
                                  className: "space-y-3.5",
                                  children: [
                                    e.jsxs("div", {
                                      className:
                                        "text-xs bg-slate-50 border p-3 rounded-lg border-slate-150 space-y-1.5",
                                      children: [
                                        e.jsxs("p", {
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-slate-800",
                                              children: "Modem Vendor:",
                                            }),
                                            " ",
                                            (mt = ce.acsDevice) == null
                                              ? void 0
                                              : mt.vendor,
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-slate-800",
                                              children: "Model:",
                                            }),
                                            " ",
                                            (st = ce.acsDevice) == null
                                              ? void 0
                                              : st.model,
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-slate-800",
                                              children: "Serial Number:",
                                            }),
                                            " ",
                                            e.jsx("span", {
                                              className:
                                                "font-mono text-blue-600",
                                              children:
                                                (Z = ce.acsDevice) == null
                                                  ? void 0
                                                  : Z.serial_number,
                                            }),
                                          ],
                                        }),
                                        e.jsxs("p", {
                                          children: [
                                            e.jsx("strong", {
                                              className: "text-slate-800",
                                              children: "Software Firmware:",
                                            }),
                                            " ",
                                            (_e = ce.acsDevice) == null
                                              ? void 0
                                              : _e.firmware,
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className:
                                        "flex items-center justify-between text-xs bg-slate-900 text-slate-400 p-2.5 rounded-lg font-mono",
                                      children: [
                                        e.jsxs("span", {
                                          className: "flex items-center gap-1",
                                          children: [
                                            e.jsx("span", {
                                              className:
                                                "h-1.5 w-1.5 bg-green-500 rounded-full animate-ping",
                                            }),
                                            " CPE Online",
                                          ],
                                        }),
                                        e.jsx("span", {
                                          className:
                                            "text-[10px] text-slate-500",
                                          children: "Uptime: 2 Hari",
                                        }),
                                      ],
                                    }),
                                  ],
                                })
                              : e.jsx("div", {
                                  className:
                                    "text-center p-6 bg-slate-50 border border-dashed rounded-lg",
                                  children: e.jsx("p", {
                                    className: "text-[11px] text-slate-450",
                                    children:
                                      "Modem ONT belum disinkronisasi melalui auto-provisioning TR-069 GenieACS.",
                                  }),
                                }),
                          ],
                        }),
                      Y === "tickets" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                              children: "Tiket Komplain & Pelayanan",
                            }),
                            e.jsx("div", {
                              className: "space-y-2",
                              children:
                                ((Ze = ce.tickets) == null
                                  ? void 0
                                  : Ze.length) === 0
                                  ? e.jsx("p", {
                                      className:
                                        "text-slate-450 text-[11px] text-center",
                                      children:
                                        "Pelanggan tidak memiliki riwayat tiket aktif.",
                                    })
                                  : (Xe = ce.tickets) == null
                                    ? void 0
                                    : Xe.map((E) =>
                                        e.jsxs(
                                          "div",
                                          {
                                            className:
                                              "p-3 bg-slate-50 border rounded-lg text-xs space-y-1",
                                            children: [
                                              e.jsxs("div", {
                                                className:
                                                  "flex items-center justify-between",
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "font-bold text-slate-800",
                                                    children: E.title,
                                                  }),
                                                  e.jsx("span", {
                                                    className: `text-[9px] px-2 py-0.5 rounded font-bold uppercase ${E.priority === "critical" || E.priority === "high" ? "bg-rose-50 text-rose-600" : "bg-blue-50 text-blue-600"}`,
                                                    children: E.priority,
                                                  }),
                                                ],
                                              }),
                                              e.jsx("p", {
                                                className:
                                                  "text-[11px] text-slate-500 font-light mt-1 select-none",
                                                children: E.description,
                                              }),
                                              e.jsxs("div", {
                                                className:
                                                  "flex items-center justify-between pt-1 border-t text-[10px] text-slate-400 font-mono mt-1.5",
                                                children: [
                                                  e.jsxs("span", {
                                                    children: [
                                                      "Status: ",
                                                      E.status,
                                                    ],
                                                  }),
                                                  e.jsx("span", {
                                                    children: new Date(
                                                      E.created_at,
                                                    ).toLocaleDateString(),
                                                  }),
                                                ],
                                              }),
                                            ],
                                          },
                                          E.id,
                                        ),
                                      ),
                            }),
                          ],
                        }),
                      Y === "notes" &&
                        e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                              children: "Audit Notes Jaringan",
                            }),
                            e.jsxs("div", {
                              className: "flex gap-2",
                              children: [
                                e.jsx("input", {
                                  type: "text",
                                  disabled:
                                    w === "Technician" || w === "Customer",
                                  placeholder:
                                    w === "Technician" || w === "Customer"
                                      ? "Akses menulis catatan dikunci (Read-Only)"
                                      : "Tulis note, misal: Router diganti ke TP-Link...",
                                  value: me,
                                  onChange: (E) => Oe(E.target.value),
                                  className:
                                    "flex-1 text-xs border border-slate-200 rounded-lg p-2 outline-none font-sans disabled:bg-slate-50 disabled:text-slate-400",
                                }),
                                e.jsx("button", {
                                  disabled:
                                    w === "Technician" ||
                                    w === "Customer" ||
                                    !me.trim(),
                                  onClick: z,
                                  className:
                                    "px-3 py-1.5 bg-blue-600 text-white font-bold rounded-lg text-xs shrink-0 cursor-pointer shadow-sm hover:bg-blue-500 transition-colors disabled:bg-slate-300 disabled:text-slate-500 disabled:cursor-not-allowed",
                                  children: "Kirim",
                                }),
                              ],
                            }),
                            e.jsx("div", {
                              className: "space-y-2 pb-2",
                              children:
                                ((Ht = ce.notes) == null
                                  ? void 0
                                  : Ht.length) === 0
                                  ? e.jsx("p", {
                                      className:
                                        "text-slate-450 text-[11px] text-center",
                                      children:
                                        "Belum ada log catatan untuk pelanggan ini.",
                                    })
                                  : (St = ce.notes) == null
                                    ? void 0
                                    : St.map((E) =>
                                        e.jsxs(
                                          "div",
                                          {
                                            className:
                                              "p-3 bg-slate-50 border rounded-lg text-xs space-y-1.5",
                                            children: [
                                              e.jsx("p", {
                                                className:
                                                  "text-slate-700 leading-normal font-light",
                                                children: E.note,
                                              }),
                                              e.jsxs("div", {
                                                className:
                                                  "flex items-center justify-between text-[10px] text-slate-400 font-mono pt-1 border-t",
                                                children: [
                                                  e.jsxs("span", {
                                                    children: [
                                                      "Oleh: ",
                                                      E.created_by,
                                                    ],
                                                  }),
                                                  e.jsx("span", {
                                                    children: new Date(
                                                      E.created_at,
                                                    ).toLocaleDateString(),
                                                  }),
                                                ],
                                              }),
                                            ],
                                          },
                                          E.id,
                                        ),
                                      ),
                            }),
                          ],
                        }),
                    ],
                  }),
                ],
              }),
      }),
      Se &&
        e.jsx("div", {
          id: "add-customer-modal",
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-md w-full max-h-[90vh] overflow-y-auto custom-scroll space-y-4",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b pb-3 mb-2",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-display font-extrabold text-slate-800 text-sm",
                    children: "Registrasi Pelanggan CRM Baru",
                  }),
                  e.jsx("button", {
                    onClick: () => le(!1),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: y,
                className: "space-y-3.5 text-xs",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-600",
                        children: "Nama Lengkap Pelanggan *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "Misal: Budi Santoso",
                        value: Te.full_name,
                        onChange: (E) =>
                          Ie({ ...Te, full_name: E.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-600",
                            children: "Email *",
                          }),
                          e.jsx("input", {
                            type: "email",
                            required: !0,
                            placeholder: "budi@gmail.com",
                            value: Te.email,
                            onChange: (E) =>
                              Ie({ ...Te, email: E.target.value }),
                            className:
                              "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-600",
                            children: "No. WhatsApp *",
                          }),
                          e.jsx("input", {
                            type: "text",
                            required: !0,
                            placeholder: "0821xxxx",
                            value: Te.phone,
                            onChange: (E) =>
                              Ie({ ...Te, phone: E.target.value }),
                            className:
                              "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-600",
                        children: "Paket Internet Langganan",
                      }),
                      e.jsxs("select", {
                        value: Te.package_id,
                        onChange: (E) =>
                          Ie({ ...Te, package_id: Number(E.target.value) }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: 1,
                            children: "Home-Lite 10M (Rp 150.000/bln)",
                          }),
                          e.jsx("option", {
                            value: 2,
                            children: "Home-Fast 30M (Rp 250.000/bln)",
                          }),
                          e.jsx("option", {
                            value: 3,
                            children: "Gamer-Pro 100M (Rp 450.000/bln)",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-600",
                        children: "Alamat Lengkap Rumah *",
                      }),
                      e.jsx("textarea", {
                        required: !0,
                        rows: 2,
                        placeholder:
                          "Misal: Perum Griya Indah Blok A/4, Jakarta",
                        value: Te.address,
                        onChange: (E) => Ie({ ...Te, address: E.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans resize-none",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-600",
                            children: "Latitude Map",
                          }),
                          e.jsx("input", {
                            type: "number",
                            step: "any",
                            placeholder: "-6.2146",
                            value: Te.latitude,
                            onChange: (E) =>
                              Ie({ ...Te, latitude: Number(E.target.value) }),
                            className:
                              "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-600",
                            children: "Longitude Map",
                          }),
                          e.jsx("input", {
                            type: "number",
                            step: "any",
                            placeholder: "106.8451",
                            value: Te.longitude,
                            onChange: (E) =>
                              Ie({ ...Te, longitude: Number(E.target.value) }),
                            className:
                              "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-600",
                        children: "Status Pendaftaran Awal",
                      }),
                      e.jsxs("select", {
                        value: Te.status,
                        onChange: (E) => Ie({ ...Te, status: E.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "active",
                            children: "Active (Langsung Buat Akun PPPoE)",
                          }),
                          e.jsx("option", {
                            value: "lead",
                            children: "Leads (Brosur / Prospect)",
                          }),
                          e.jsx("option", {
                            value: "inactive",
                            children: "Inactive",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    disabled: de,
                    className:
                      "w-full py-2.5 bg-blue-600 hover:bg-blue-500 disabled:bg-blue-800 text-xs font-bold text-white rounded-lg cursor-pointer transition-colors pt-2.5",
                    children: de
                      ? "Menyimpan Data..."
                      : "Registrasikan Pelanggan",
                  }),
                ],
              }),
            ],
          }),
        }),
    ],
  });
}
function Ng({ activeRole: w }) {
  var I, X, pe, he, Ne, $e;
  const [J, S] = f.useState([]),
    [b, V] = f.useState([]),
    [ue, re] = f.useState("all"),
    [ee, B] = f.useState(""),
    [T, fe] = f.useState({}),
    [G, F] = f.useState(null),
    [ce, ve] = f.useState(null),
    [Y, Ee] = f.useState("Midtrans"),
    [Se, le] = f.useState(!1),
    [ie, $] = f.useState(""),
    [de, oe] = f.useState({
      auto_billing_enabled: !0,
      auto_isolate_overdue: !0,
      due_days: 10,
      template_invoice_created: "",
      template_invoice_reminder: "",
      template_invoice_overdue: "",
      template_invoice_paid: "",
    }),
    [be, Ye] = f.useState(!1),
    [Te, Ie] = f.useState(""),
    [me, Oe] = f.useState(!1),
    te = async () => {
      try {
        const ze = await (await fetch("/api/v1/billing/settings")).json();
        ze.status === "success" && ze.data && oe(ze.data);
      } catch (ae) {
        console.error("Gagal mengambil setelan automasi tagihan:", ae);
      }
    },
    Ae = async (ae) => {
      (Ye(!0), Ie(""));
      try {
        (
          await (
            await fetch("/api/v1/billing/settings", {
              method: "PUT",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(de),
            })
          ).json()
        ).status === "success" &&
          (Ie("Setelan & Aturan Penagihan otomatis sukses disimpan!"),
          te(),
          setTimeout(() => Ie(""), 4e3));
      } catch (ze) {
        (console.error(ze), Ie("Gagal menyimpan peraturan."));
      } finally {
        Ye(!1);
      }
    },
    Ue = async () => {
      (Oe(!0), Ie(""));
      try {
        const ze = await (
          await fetch("/api/v1/billing/run-check", { method: "POST" })
        ).json();
        if (ze.status === "success") {
          const at = ze.data;
          (Ie(
            `Cron Berhasil: ${at.generatedCount} tagihan terbit, ${at.overdueCount} telat, ${at.isolatedCount} diisolasi.`,
          ),
            y(),
            setTimeout(() => Ie(""), 6500));
        }
      } catch (ae) {
        (console.error(ae), Ie("Gagal memacu scheduler."));
      } finally {
        Oe(!1);
      }
    },
    y = async () => {
      try {
        const ze = await (await fetch("/api/v1/billing/invoices")).json();
        ze.status === "success" && S(ze.data);
        const bt = await (await fetch("/api/v1/customers")).json();
        if (bt.status === "success") {
          const Mt = {};
          (bt.data.forEach((ge) => {
            Mt[ge.id] = ge;
          }),
            fe(Mt));
        }
      } catch (ae) {
        console.error(ae);
      }
    },
    K = async () => {
      try {
        V([
          {
            id: 1,
            invoice_num: "INV/202605/0001",
            gateway: "Midtrans",
            price: 15e4,
            reference: "PAY-MID-829103",
            date: "2026-05-01 15:30",
          },
          {
            id: 2,
            invoice_num: "INV/202605/0002",
            gateway: "Xendit",
            price: 25e4,
            reference: "PAY-XEN-392183",
            date: "2026-05-01 16:00",
          },
          {
            id: 3,
            invoice_num: "INV/202606/0001",
            gateway: "Midtrans-QRIS",
            price: 15e4,
            reference: "PAY-QRIS-920193",
            date: "2026-06-01 09:00",
          },
        ]);
      } catch (ae) {
        console.error(ae);
      }
    };
  f.useEffect(() => {
    (y(), K(), te());
  }, []);
  const O = async () => {
      (le(!0), $(""));
      try {
        const ze = await (
          await fetch("/api/v1/billing/invoices/generate", { method: "POST" })
        ).json();
        ze.status === "success" && ($(ze.message), y());
      } catch (ae) {
        console.error(ae);
      } finally {
        le(!1);
      }
    },
    P = async (ae) => {
      F(ae);
      try {
        const at = await (await fetch(`/api/v1/billing/invoices/${ae}`)).json();
        at.status === "success" && ve(at.data);
      } catch (ze) {
        console.error(ze);
      }
    },
    z = async () => {
      if (!(!ce || !G)) {
        (le(!0), $(""));
        try {
          const ze = await (
            await fetch("/api/v1/payments/create", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ invoice_id: G, gateway: Y }),
            })
          ).json();
          if (ze.status === "success") {
            const at = ze.data.payment_reference;
            (
              await (
                await fetch("/api/v1/payments/webhook", {
                  method: "POST",
                  headers: { "Content-Type": "application/json" },
                  body: JSON.stringify({
                    payment_reference: at,
                    status: "success",
                  }),
                })
              ).json()
            ).status === "success" &&
              ($(
                "Pembayaran Berhasil! Sistem denda & isolasi otomatis mendeteksi pelunasan. Klien PPPoE di-unsuspend instan.",
              ),
              y(),
              F(null));
          }
        } catch (ae) {
          console.error(ae);
        } finally {
          le(!1);
        }
      }
    },
    g = async (ae) => {
      try {
        (
          await (
            await fetch(`/api/v1/billing/invoices/${ae}/remind`, {
              method: "POST",
            })
          ).json()
        ).status === "success" &&
          alert(
            "Notifikasi WhatsApp pengingat tagihan berhasil dikirim secara lokal!",
          );
      } catch (ze) {
        console.error(ze);
      }
    },
    C = J.filter((ae) => {
      const ze = ue === "all" || ae.status === ue,
        at = T[ae.customer_id],
        bt = at ? at.full_name : "",
        Mt =
          ae.invoice_number.toLowerCase().includes(ee.toLowerCase()) ||
          bt.toLowerCase().includes(ee.toLowerCase());
      return ze && Mt;
    });
  return e.jsxs("div", {
    className:
      "grid grid-cols-1 xl:grid-cols-3 gap-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsxs("div", {
        className: "xl:col-span-2 space-y-4",
        children: [
          e.jsxs("div", {
            className:
              "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
            children: [
              e.jsxs("div", {
                className:
                  "flex flex-col sm:flex-row sm:items-center justify-between gap-4",
                children: [
                  e.jsx("div", {
                    children: e.jsxs("h2", {
                      className:
                        "text-sm font-extrabold text-slate-900 flex items-center gap-2",
                      children: [
                        e.jsx(nr, { className: "h-4.5 w-4.5 text-blue-600" }),
                        e.jsxs("span", {
                          children: [
                            "Invoice Tagihan & Keuangan (",
                            C.length,
                            ")",
                          ],
                        }),
                      ],
                    }),
                  }),
                  w !== "Customer" &&
                    w !== "Technician" &&
                    e.jsxs("button", {
                      id: "billing-run-btn",
                      onClick: O,
                      disabled: Se,
                      className:
                        "w-full sm:w-auto px-4 py-1.5 bg-blue-650 hover:bg-blue-600 text-white font-bold rounded-lg text-xs flex items-center justify-center gap-2 shadow-sm cursor-pointer disabled:bg-blue-800 transition-colors",
                      title: "Generasikan invoice bulanan otomatis",
                      children: [
                        e.jsx(Sp, { className: "h-3.5 w-3.5 fill-current" }),
                        e.jsx("span", {
                          children: "Jalankan Auto-Billing Run",
                        }),
                      ],
                    }),
                ],
              }),
              ie &&
                e.jsx("div", {
                  className:
                    "p-3 bg-emerald-50 border border-emerald-250 text-emerald-800 text-xs rounded-lg font-medium",
                  children: ie,
                }),
              e.jsxs("div", {
                className: "flex flex-col sm:flex-row items-center gap-3",
                children: [
                  e.jsxs("div", {
                    className: "relative flex-1 w-full",
                    children: [
                      e.jsx(Pi, {
                        className:
                          "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400",
                      }),
                      e.jsx("input", {
                        id: "invoice-search-input",
                        type: "text",
                        placeholder: "Cari kode invoice, nama pelanggan...",
                        value: ee,
                        onChange: (ae) => B(ae.target.value),
                        className:
                          "w-full pl-9 pr-4 py-1.5 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg text-xs placeholder-slate-400 outline-none font-sans",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "flex gap-1.5 w-full sm:w-auto overflow-x-auto self-start",
                    children: ["all", "paid", "unpaid", "overdue"].map((ae) =>
                      e.jsx(
                        "button",
                        {
                          onClick: () => re(ae),
                          className: `px-3 py-1 rounded text-[11px] font-bold capitalize transition-colors cursor-pointer ${ue === ae ? "bg-slate-800 text-white" : "bg-slate-100 hover:bg-slate-200 text-slate-600"}`,
                          children: ae,
                        },
                        ae,
                      ),
                    ),
                  }),
                ],
              }),
            ],
          }),
          e.jsx("div", {
            id: "invoices-list",
            className:
              "bg-white border rounded-xl overflow-hidden shadow-sm divide-y divide-slate-100",
            children:
              C.length === 0
                ? e.jsx("p", {
                    className:
                      "p-8 text-center text-xs text-slate-400 font-light",
                    children: "Tidak ada invoice tercatat.",
                  })
                : C.map((ae) => {
                    var at, bt;
                    const ze =
                      ((at = T[ae.customer_id]) == null
                        ? void 0
                        : at.full_name) || "Unknown Customer";
                    return e.jsxs(
                      "div",
                      {
                        className:
                          "p-4 hover:bg-slate-50 flex items-center justify-between gap-4 text-xs",
                        children: [
                          e.jsxs("div", {
                            className: "flex items-start gap-3",
                            children: [
                              e.jsx("div", {
                                className:
                                  "h-9 w-9 rounded-lg bg-slate-50 flex items-center justify-center font-bold text-slate-500 shrink-0 border mt-0.5",
                                children: "INV",
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsxs("div", {
                                    className: "flex items-center gap-2",
                                    children: [
                                      e.jsx("span", {
                                        className:
                                          "font-extrabold text-slate-850 font-mono",
                                        children: ae.invoice_number,
                                      }),
                                      e.jsx("span", {
                                        className: `text-[9px] uppercase font-bold py-0.5 px-1.5 rounded ${ae.status === "paid" ? "bg-green-50 text-green-600 font-bold" : ae.status === "suspended" || ae.status === "overdue" ? "bg-rose-50 text-rose-600 animate-pulse font-bold" : "bg-amber-50 text-amber-600 font-bold"}`,
                                        children: ae.status,
                                      }),
                                    ],
                                  }),
                                  e.jsx("h4", {
                                    className: "font-bold text-slate-700 mt-1",
                                    children: ze,
                                  }),
                                  e.jsxs("p", {
                                    className:
                                      "text-[10px] text-slate-400 mt-0.5 font-mono",
                                    children: [
                                      "Due Date: ",
                                      new Date(ae.due_date).toLocaleDateString(
                                        "id-ID",
                                      ),
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "flex items-center gap-4",
                            children: [
                              e.jsxs("strong", {
                                className:
                                  "text-slate-800 text-sm font-display",
                                children: [
                                  "Rp ",
                                  (bt = ae.amount) == null
                                    ? void 0
                                    : bt.toLocaleString(),
                                ],
                              }),
                              e.jsx("div", {
                                className: "flex gap-1.5",
                                children:
                                  ae.status !== "paid" &&
                                  w !== "Customer" &&
                                  w !== "Technician" &&
                                  w !== "NOC" &&
                                  e.jsxs(e.Fragment, {
                                    children: [
                                      e.jsxs("button", {
                                        id: `pay-btn-${ae.id}`,
                                        onClick: () => P(ae.id),
                                        className:
                                          "px-2.5 py-1 bg-green-600 hover:bg-green-500 text-white font-bold rounded text-[10px] cursor-pointer flex items-center gap-1",
                                        title: "Bayar tagihan lewat simulasi",
                                        children: [
                                          e.jsx(sr, { className: "h-3 w-3" }),
                                          e.jsx("span", { children: "Bayar" }),
                                        ],
                                      }),
                                      e.jsx("button", {
                                        onClick: () => g(ae.id),
                                        className:
                                          "p-1 text-blue-600 hover:bg-blue-50 rounded text-[10px] font-bold",
                                        title: "Kirim pengingat WhatsApp",
                                        children: "Remind",
                                      }),
                                    ],
                                  }),
                              }),
                            ],
                          }),
                        ],
                      },
                      ae.id,
                    );
                  }),
          }),
        ],
      }),
      e.jsxs("div", {
        className: "space-y-4",
        children: [
          w !== "Customer" &&
            w !== "Technician" &&
            e.jsxs("div", {
              className:
                "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4 font-sans",
              children: [
                e.jsxs("div", {
                  className:
                    "border-b pb-2 mb-1 flex items-center justify-between",
                  children: [
                    e.jsxs("h3", {
                      className:
                        "text-xs font-extrabold text-slate-900 uppercase tracking-wider flex items-center gap-1.5",
                      children: [
                        e.jsx(Wr, { className: "h-4 w-4 text-blue-650" }),
                        e.jsx("span", {
                          children: "Setelan Automasi & Templat",
                        }),
                      ],
                    }),
                    e.jsx("span", {
                      className:
                        "text-[10px] bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full font-bold",
                      children: "Auto-Cron",
                    }),
                  ],
                }),
                Te &&
                  e.jsx("div", {
                    className:
                      "p-2.5 text-xs rounded-lg font-bold bg-blue-50 border border-blue-200 text-blue-800",
                    children: Te,
                  }),
                e.jsxs("div", {
                  className: "space-y-3.5 text-xs",
                  children: [
                    e.jsxs("label", {
                      className:
                        "flex items-start gap-2.5 cursor-pointer select-none",
                      children: [
                        e.jsx("input", {
                          type: "checkbox",
                          checked: de.auto_billing_enabled,
                          onChange: (ae) =>
                            oe({
                              ...de,
                              auto_billing_enabled: ae.target.checked,
                            }),
                          className:
                            "mt-0.5 h-3.5 w-3.5 text-blue-600 border-slate-300 rounded focus:ring-blue-500 cursor-pointer",
                        }),
                        e.jsxs("div", {
                          children: [
                            e.jsx("span", {
                              className:
                                "font-extrabold text-slate-800 block text-[11.5px]",
                              children: "Generasi Tagihan Otomatis",
                            }),
                            e.jsx("p", {
                              className:
                                "text-[10px] text-slate-400 font-light mt-0.5",
                              children:
                                "Terbitkan invoice bulanan otomatis jika klien tidak memiliki tagihan aktif.",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("label", {
                      className:
                        "flex items-start gap-2.5 cursor-pointer select-none border-t pt-3",
                      children: [
                        e.jsx("input", {
                          type: "checkbox",
                          checked: de.auto_isolate_overdue,
                          onChange: (ae) =>
                            oe({
                              ...de,
                              auto_isolate_overdue: ae.target.checked,
                            }),
                          className:
                            "mt-0.5 h-3.5 w-3.5 text-blue-600 border-slate-300 rounded focus:ring-blue-500 cursor-pointer",
                        }),
                        e.jsxs("div", {
                          children: [
                            e.jsx("span", {
                              className:
                                "font-extrabold text-slate-800 block text-[11.5px]",
                              children: "Isolasi / Suspend Otomatis",
                            }),
                            e.jsx("p", {
                              className:
                                "text-[10px] text-slate-400 font-light mt-0.5",
                              children:
                                "Isolasi internet & nonaktifkan klien otomatis jika tagihan melewati jatuh tempo.",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-1.5 pt-3 border-t",
                      children: [
                        e.jsxs("div", {
                          className:
                            "flex justify-between items-center text-[10px]",
                          children: [
                            e.jsx("span", {
                              className: "font-extrabold text-slate-700",
                              children: "Tenggat Waktu Pembayaran",
                            }),
                            e.jsxs("span", {
                              className: "text-slate-500 font-mono font-bold",
                              children: [de.due_days, " Hari"],
                            }),
                          ],
                        }),
                        e.jsx("input", {
                          type: "number",
                          min: "1",
                          max: "30",
                          value: de.due_days,
                          onChange: (ae) =>
                            oe({
                              ...de,
                              due_days: parseInt(ae.target.value) || 10,
                            }),
                          className:
                            "w-full p-2 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg outline-none font-sans font-medium text-xs text-slate-800",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-2.5 pt-3 border-t",
                      children: [
                        e.jsx("span", {
                          className:
                            "font-extrabold text-slate-805 block text-[11px] mb-1",
                          children: "Kustomisasi Templat Notifikasi",
                        }),
                        e.jsxs("div", {
                          className:
                            "p-2 bg-amber-50 text-[10px] text-amber-805 rounded border border-amber-150 font-medium space-y-0.5",
                          children: [
                            e.jsx("p", {
                              className: "font-extrabold",
                              children: "Token Variabel:",
                            }),
                            e.jsx("p", {
                              className: "font-mono text-[9px]",
                              children: "{customer_name}, {invoice_number}",
                            }),
                            e.jsx("p", {
                              className: "font-mono text-[9px]",
                              children:
                                "{invoice_amount}, {due_date}, {service_plan}",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-1 mt-2",
                          children: [
                            e.jsx("label", {
                              className:
                                "text-[10px] font-extrabold text-slate-600 block",
                              children: "1. Invoice Baru Terbit (WhatsApp)",
                            }),
                            e.jsx("textarea", {
                              rows: 2,
                              value: de.template_invoice_created,
                              onChange: (ae) =>
                                oe({
                                  ...de,
                                  template_invoice_created: ae.target.value,
                                }),
                              placeholder:
                                "Contoh: Invoice {invoice_number} sebesar {invoice_amount} telah terbit...",
                              className:
                                "w-full p-2 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg outline-none text-[11px] text-slate-700 leading-relaxed font-sans",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-1",
                          children: [
                            e.jsx("label", {
                              className:
                                "text-[10px] font-extrabold text-slate-600 block",
                              children: "2. Pengingat Tagihan / Reminder",
                            }),
                            e.jsx("textarea", {
                              rows: 2,
                              value: de.template_invoice_reminder,
                              onChange: (ae) =>
                                oe({
                                  ...de,
                                  template_invoice_reminder: ae.target.value,
                                }),
                              placeholder:
                                "Contoh: Mengingatkan tagihan {invoice_number} segera jatuh tempo...",
                              className:
                                "w-full p-2 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg outline-none text-[11px] text-slate-700 leading-relaxed font-sans",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-1",
                          children: [
                            e.jsx("label", {
                              className:
                                "text-[10px] font-extrabold text-slate-600 block",
                              children: "3. Peringatan Lewat Jatuh Tempo",
                            }),
                            e.jsx("textarea", {
                              rows: 2,
                              value: de.template_invoice_overdue,
                              onChange: (ae) =>
                                oe({
                                  ...de,
                                  template_invoice_overdue: ae.target.value,
                                }),
                              placeholder:
                                "Contoh: Peringatan tagihan {invoice_number} melebihi jatuh tempo...",
                              className:
                                "w-full p-2 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg outline-none text-[11px] text-slate-700 leading-relaxed font-sans",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-1",
                          children: [
                            e.jsx("label", {
                              className:
                                "text-[10px] font-extrabold text-slate-600 block",
                              children: "4. Konfirmasi Pembayaran Lunas",
                            }),
                            e.jsx("textarea", {
                              rows: 2,
                              value: de.template_invoice_paid,
                              onChange: (ae) =>
                                oe({
                                  ...de,
                                  template_invoice_paid: ae.target.value,
                                }),
                              placeholder:
                                "Contoh: Terima kasih, pembayaran invoice {invoice_number} sukses...",
                              className:
                                "w-full p-2 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg outline-none text-[11px] text-slate-700 leading-relaxed font-sans",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "flex gap-2 pt-3 border-t",
                      children: [
                        e.jsx("button", {
                          type: "button",
                          onClick: () => Ae(),
                          disabled: be,
                          className:
                            "flex-1 py-1.5 bg-slate-800 hover:bg-slate-700 text-white font-bold rounded-lg cursor-pointer text-center text-[10px] disabled:bg-slate-600 transition-colors",
                          children: be
                            ? "Menyimpan..."
                            : "Simpan Aturan & Templat",
                        }),
                        e.jsxs("button", {
                          type: "button",
                          onClick: Ue,
                          disabled: me,
                          className:
                            "py-1.5 px-2.5 bg-blue-50 hover:bg-blue-150 text-blue-700 font-bold border border-blue-200 rounded-lg cursor-pointer text-center text-[10px] flex items-center justify-center gap-1 shrink-0 transition-all font-sans",
                          title:
                            "Simulasikan trigger periodic background scheduler",
                          children: [
                            e.jsx(Sp, {
                              className: "h-2.5 w-2.5 fill-current",
                            }),
                            e.jsx("span", { children: "Jalankan Cron" }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          e.jsxs("div", {
            className:
              "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3",
            children: [
              e.jsx("div", {
                className: "border-b pb-2 mb-1.5",
                children: e.jsxs("h3", {
                  className:
                    "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                  children: [
                    e.jsx(_p, { className: "h-4 w-4 text-emerald-500" }),
                    e.jsx("span", { children: "Riwayat Transaksi Bayar" }),
                  ],
                }),
              }),
              e.jsx("div", {
                className:
                  "space-y-2.5 max-h-96 overflow-y-auto custom-scroll pr-1",
                children: b.map((ae) =>
                  e.jsxs(
                    "div",
                    {
                      className:
                        "p-3 bg-slate-50 border rounded-lg text-xs space-y-1",
                      children: [
                        e.jsxs("div", {
                          className: "flex items-center justify-between",
                          children: [
                            e.jsx("span", {
                              className:
                                "font-extrabold text-slate-800 font-mono text-[11px]",
                              children: ae.invoice_num,
                            }),
                            e.jsx("span", {
                              className:
                                "text-[10px] text-emerald-600 font-bold bg-emerald-50 px-2 py-0.5 rounded",
                              children: "Sukses",
                            }),
                          ],
                        }),
                        e.jsxs("p", {
                          className:
                            "text-[11px] text-slate-450 font-mono mt-0.5",
                          children: ["Ref: ", ae.reference],
                        }),
                        e.jsxs("div", {
                          className:
                            "flex items-center justify-between pt-1 border-t text-[10px] text-slate-400 mt-1 font-mono",
                          children: [
                            e.jsx("span", { children: ae.gateway }),
                            e.jsx("span", { children: ae.date }),
                          ],
                        }),
                      ],
                    },
                    ae.id,
                  ),
                ),
              }),
            ],
          }),
        ],
      }),
      G &&
        ce &&
        e.jsx("div", {
          id: "payment-modal",
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b pb-3 mb-2",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-display font-extrabold text-slate-800 text-sm",
                    children: "Simulasi Webhook Pembayaran",
                  }),
                  e.jsx("button", {
                    onClick: () => F(null),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-slate-50 rounded-lg border border-slate-150 space-y-2 text-xs",
                children: [
                  e.jsxs("p", {
                    children: [
                      e.jsx("strong", {
                        className: "text-slate-800",
                        children: "Invoice:",
                      }),
                      " ",
                      (I = ce.invoice) == null ? void 0 : I.invoice_number,
                    ],
                  }),
                  e.jsxs("p", {
                    children: [
                      e.jsx("strong", {
                        className: "text-slate-800",
                        children: "Pelanggan:",
                      }),
                      " ",
                      (X = ce.customer) == null ? void 0 : X.full_name,
                    ],
                  }),
                  e.jsxs("p", {
                    children: [
                      e.jsx("strong", {
                        className: "text-slate-800",
                        children: "Paket Langganan:",
                      }),
                      " Home-Lite 10M",
                    ],
                  }),
                  e.jsx("p", {
                    className: "border-t pt-2 mt-2",
                    children: e.jsx("strong", {
                      className: "text-slate-850",
                      children: "Rincian Item:",
                    }),
                  }),
                  e.jsxs("p", {
                    className: "text-[11px] text-slate-500 font-light",
                    children: [
                      "• Internet Bulanan x 1 Qty (Rp ",
                      (he = (pe = ce.invoice) == null ? void 0 : pe.amount) ==
                      null
                        ? void 0
                        : he.toLocaleString(),
                      ")",
                    ],
                  }),
                  e.jsxs("p", {
                    className: "border-t pt-2 mt-2 text-sm",
                    children: [
                      e.jsx("strong", {
                        className: "text-slate-900",
                        children: "Total Tagihan:",
                      }),
                      " Rp ",
                      ($e = (Ne = ce.invoice) == null ? void 0 : Ne.amount) ==
                      null
                        ? void 0
                        : $e.toLocaleString(),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "space-y-1.5 text-xs",
                children: [
                  e.jsx("label", {
                    className: "font-bold text-slate-600 block",
                    children: "Hubungkan Gerbang Pembayaran",
                  }),
                  e.jsxs("select", {
                    value: Y,
                    onChange: (ae) => Ee(ae.target.value),
                    className:
                      "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer text-xs",
                    children: [
                      e.jsx("option", {
                        value: "Midtrans",
                        children: "Midtrans (Virtual Account)",
                      }),
                      e.jsx("option", {
                        value: "Xendit",
                        children: "Xendit (E-Wallet)",
                      }),
                      e.jsx("option", {
                        value: "Midtrans-QRIS",
                        children: "QRIS Standar (Auto-Detect)",
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("button", {
                onClick: z,
                disabled: Se,
                className:
                  "w-full py-2.5 bg-emerald-600 hover:bg-emerald-500 disabled:bg-emerald-800 text-xs font-bold text-white rounded-lg flex items-center justify-center gap-1.5 cursor-pointer shadow-md transition-colors",
                children: [
                  e.jsx(_p, { className: "h-4 w-4" }),
                  e.jsx("span", {
                    children: Se
                      ? "Menyinkronkan..."
                      : "Selesaikan & Lunasi Tagihan",
                  }),
                ],
              }),
            ],
          }),
        }),
    ],
  });
}
window.RadiusDashboard = window.RadiusDashboard || function RadiusDashboardFallback({ G }) {
  const [subTab, setSubTab] = f.useState("routers");
  const [nasList, setNasList] = f.useState([]);
  const [form, setForm] = f.useState({ id: "", name: "", ip_address: "", secret: "", type: "Mikrotik", username: "admin", password: "", api_port: 8728, radius_source_ip: "" });
  const [editing, setEditing] = f.useState(false);
  const [loading, setLoading] = f.useState(false);
  const [notice, setNotice] = f.useState(null);
  const [logs, setLogs] = f.useState([]);
  const say = (type, message) => (setNotice({ type, message }), setTimeout(() => setNotice(null), 3500));
  const loadNas = async () => {
    try {
      const res = await (await fetch("/api/v1/radius/nas")).json();
      if (res.status === "success") setNasList(Array.isArray(res.data) ? res.data : []);
    } catch (_) {
      say("error", "Gagal memuat daftar Router NAS.");
    }
  };
  f.useEffect(() => {
    loadNas();
  }, []);
  const resetForm = () => {
    setEditing(false);
    setForm({ id: "", name: "", ip_address: "", secret: "", type: "Mikrotik", username: "admin", password: "", api_port: 8728, radius_source_ip: "" });
  };
  const saveNas = async (ev) => {
    ev.preventDefault();
    if (!form.name || !form.ip_address || !form.secret) return say("error", "Nama, IP Address, dan Secret RADIUS wajib diisi.");
    setLoading(true);
    try {
      const res = await (await fetch(editing ? `/api/v1/radius/nas/${form.id}` : "/api/v1/radius/nas", {
        method: editing ? "PUT" : "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(form)
      })).json();
      if (res.status === "success" || res.data) {
        say("success", editing ? "Router NAS berhasil diperbarui." : "Router NAS berhasil ditambahkan.");
        resetForm();
        loadNas();
      } else say("error", res.message || "Gagal menyimpan Router NAS.");
    } catch (_) {
      say("error", "Gagal menghubungi server.");
    } finally {
      setLoading(false);
    }
  };
  const testNas = async (id) => {
    setLoading(true);
    setLogs(["Membuka koneksi diagnostik RADIUS/MikroTik..."]);
    try {
      const res = await (await fetch(`/api/v1/radius/diagnose?nas_id=${id}`)).json();
      setLogs((res.logs || []).map((l) => `[${(l.level || "info").toUpperCase()}] ${l.message}`));
      say(res.success ? "success" : "error", res.success ? "Koneksi Router NAS berhasil." : "Koneksi Router NAS gagal, cek log diagnostik.");
    } catch (_) {
      setLogs(["[ERROR] Server diagnostik tidak dapat dihubungi."]);
      say("error", "Tes koneksi gagal.");
    } finally {
      setLoading(false);
    }
  };
  const deleteNas = async (nas) => {
    if (!window.confirm(`Hapus Router NAS "${nas.name}"? Koneksi RADIUS dari router ini akan terputus setelah disetujui.`)) return;
    try {
      const res = await (await fetch(`/api/v1/radius/nas/${nas.id}`, { method: "DELETE" })).json();
      if (res.status === "success") (say("success", "Router NAS berhasil dihapus."), loadNas());
      else say("error", res.message || "Gagal menghapus Router NAS.");
    } catch (_) {
      say("error", "Gagal menghapus Router NAS.");
    }
  };
  return e.jsxs("div", { className: "space-y-6 text-xs", children: [
    notice && e.jsx("div", { className: `p-3 rounded-lg border font-bold ${notice.type === "success" ? "bg-emerald-50 border-emerald-200 text-emerald-700" : "bg-rose-50 border-rose-200 text-rose-700"}`, children: notice.message }),
    e.jsxs("div", { className: "bg-white border border-slate-200 rounded-xl p-4 shadow-sm space-y-4", children: [
      e.jsxs("div", { className: "flex border-b border-slate-200 gap-2", children: [
        e.jsx("button", { onClick: () => setSubTab("routers"), className: `px-4 py-2 font-bold border-b-2 ${subTab === "routers" ? "text-blue-600 border-blue-600" : "text-slate-500 border-transparent"}`, children: "Router NAS Server" }),
        e.jsx("button", { onClick: () => setSubTab("logs"), className: `px-4 py-2 font-bold border-b-2 ${subTab === "logs" ? "text-blue-600 border-blue-600" : "text-slate-500 border-transparent"}`, children: "Log & Diagnostik" })
      ] }),
      subTab === "routers" && e.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-4", children: [
        e.jsxs("div", { className: "lg:col-span-2 border rounded-lg overflow-hidden", children: [
          e.jsxs("div", { className: "grid grid-cols-5 gap-2 bg-slate-100 p-2 font-bold text-slate-600", children: [e.jsx("span", { children: "Nama" }), e.jsx("span", { children: "IP" }), e.jsx("span", { children: "API" }), e.jsx("span", { children: "User" }), e.jsx("span", { children: "Aksi" })] }),
          nasList.length === 0 ? e.jsx("div", { className: "p-4 text-center text-slate-400", children: "Belum ada Router NAS terdaftar." }) : nasList.map((nas) => e.jsxs("div", { className: "grid grid-cols-5 gap-2 p-2 border-t items-center", children: [
            e.jsx("span", { className: "font-bold truncate", children: nas.name }),
            e.jsx("span", { className: "font-mono", children: nas.ip_address }),
            e.jsx("span", { className: "font-mono", children: nas.api_port || 8728 }),
            e.jsx("span", { children: nas.username || "admin" }),
            e.jsxs("div", { className: "flex gap-2 flex-wrap", children: [
              e.jsx("button", { type: "button", onClick: () => testNas(nas.id), className: "text-emerald-600 font-bold", children: "TEST" }),
              e.jsx("button", { type: "button", onClick: () => (setForm({ id: nas.id, name: nas.name || "", ip_address: nas.ip_address || "", secret: nas.secret || "", type: nas.type || "Mikrotik", username: nas.username || "admin", password: nas.password || "", api_port: nas.api_port || 8728, radius_source_ip: nas.radius_source_ip || "" }), setEditing(true)), className: "text-blue-600 font-bold", children: "EDIT" }),
              e.jsx("button", { type: "button", onClick: () => deleteNas(nas), className: "text-rose-600 font-bold", children: "HAPUS" })
            ] })
          ] }, nas.id))
        ] }),
        e.jsxs("form", { onSubmit: saveNas, className: "border rounded-lg p-4 space-y-3 bg-slate-50", children: [
          e.jsx("h3", { className: "font-black text-slate-800 uppercase", children: editing ? "Edit Router NAS" : "Tambah Router NAS" }),
          e.jsx("input", { required: true, placeholder: "Nama Router", value: form.name, onChange: (ev) => setForm({ ...form, name: ev.target.value }), className: "w-full p-2 border rounded" }),
          e.jsx("input", { required: true, placeholder: "IP Address MikroTik", value: form.ip_address, onChange: (ev) => setForm({ ...form, ip_address: ev.target.value }), className: "w-full p-2 border rounded font-mono" }),
          e.jsx("input", { required: true, placeholder: "RADIUS Secret", value: form.secret, onChange: (ev) => setForm({ ...form, secret: ev.target.value }), className: "w-full p-2 border rounded font-mono" }),
          e.jsx("input", { type: "number", required: true, placeholder: "API Port", value: form.api_port, onChange: (ev) => setForm({ ...form, api_port: Number(ev.target.value) }), className: "w-full p-2 border rounded font-mono" }),
          e.jsx("input", { placeholder: "Username API", value: form.username, onChange: (ev) => setForm({ ...form, username: ev.target.value }), className: "w-full p-2 border rounded" }),
          e.jsx("input", { type: "password", placeholder: "Password API", value: form.password, onChange: (ev) => setForm({ ...form, password: ev.target.value }), className: "w-full p-2 border rounded font-mono" }),
          e.jsxs("div", { className: "flex gap-2", children: [
            e.jsx("button", { disabled: loading, className: "flex-1 bg-blue-600 text-white rounded p-2 font-bold disabled:opacity-60", children: loading ? "Memproses..." : "Simpan" }),
            editing && e.jsx("button", { type: "button", onClick: resetForm, className: "px-3 bg-white border rounded font-bold", children: "Batal" })
          ] })
        ] })
      ] }),
      subTab === "logs" && e.jsx("div", { className: "bg-slate-950 text-slate-200 rounded-lg p-3 font-mono text-[11px] min-h-40 space-y-1", children: logs.length ? logs.map((line, idx) => e.jsx("div", { children: line }, idx)) : "Klik TEST pada Router NAS untuk melihat log diagnostik koneksi." })
    ] })
  ] });
};
window.SyncDashboard = window.SyncDashboard || function SyncDashboardFallback({ activeRole: w }) {
  const [target, setTarget] = f.useState({ ip: "", port: "8728", username: "", password: "" });
  const [running, setRunning] = f.useState(false);
  const [logs, setLogs] = f.useState([]);
  const [counts, setCounts] = f.useState({ pppoe: 0, pppoeProfiles: 0, hotspot: 0, hotspotProfiles: 0, nas: 0 });
  f.useEffect(() => {
    Promise.all([
      fetch("/api/v1/pppoe/accounts").then((r) => r.json()).catch(() => ({ data: [] })),
      fetch("/api/v1/pppoe/profiles").then((r) => r.json()).catch(() => ({ data: [] })),
      fetch("/api/v1/hotspot/users").then((r) => r.json()).catch(() => ({ data: [] })),
      fetch("/api/v1/hotspot/profiles").then((r) => r.json()).catch(() => ({ data: [] })),
      fetch("/api/v1/radius/nas").then((r) => r.json()).catch(() => ({ data: [] }))
    ]).then(([a, p, h, hp, n]) => {
      const nasRows = Array.isArray(n.data) ? n.data : [];
      setCounts({ pppoe: Array.isArray(a.data) ? a.data.length : 0, pppoeProfiles: Array.isArray(p.data) ? p.data.length : 0, hotspot: Array.isArray(h.data) ? h.data.length : 0, hotspotProfiles: Array.isArray(hp.data) ? hp.data.length : 0, nas: nasRows.length });
      if (nasRows[0]) setTarget({ ip: nasRows[0].ip_address || "", port: String(nasRows[0].api_port || 8728), username: nasRows[0].username || "", password: "" });
    });
  }, []);
  const runSync = async () => {
    setRunning(true);
    setLogs([`[${new Date().toLocaleTimeString()}] Memulai sinkronisasi ke MikroTik ${target.ip}:${target.port}...`]);
    try {
      const [pppoeRes, hotspotRes] = await Promise.all([
        fetch("/api/v1/pppoe/sync", { method: "POST" }).then((r) => r.json()),
        fetch("/api/v1/hotspot/sync", { method: "POST" }).then((r) => r.json())
      ]);
      if (pppoeRes.status !== "success" || hotspotRes.status !== "success") throw new Error(pppoeRes.message || hotspotRes.message || "Sinkronisasi gagal");
      setLogs((old) => [...old, `[${new Date().toLocaleTimeString()}] ${pppoeRes.message}`, `[${new Date().toLocaleTimeString()}] ${hotspotRes.message}`, `[${new Date().toLocaleTimeString()}] PPPoE: ${counts.pppoe}, Hotspot: ${counts.hotspot}, Profil: ${counts.pppoeProfiles + counts.hotspotProfiles}, NAS: ${counts.nas}`, `[${new Date().toLocaleTimeString()}] Selesai. Semua data dibaca ulang langsung dari RouterOS.`]);
    } catch (_) {
      setLogs((old) => [...old, `[${new Date().toLocaleTimeString()}] ERROR: server sync tidak dapat dihubungi.`]);
    } finally {
      setRunning(false);
    }
  };
  return e.jsxs("div", { className: "space-y-6 text-xs", children: [
    e.jsxs("div", { className: "bg-white border border-slate-200 rounded-xl p-5 shadow-sm space-y-4", children: [
      e.jsx("h2", { className: "font-black text-slate-900 uppercase tracking-wider", children: "Recovery & Sync MikroTik" }),
      e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-3", children: [
        e.jsx("input", { value: target.ip, readOnly: true, className: "p-2 border rounded font-mono bg-slate-50", placeholder: "IP MikroTik" }),
        e.jsx("input", { value: target.port, readOnly: true, className: "p-2 border rounded font-mono bg-slate-50", placeholder: "API Port" }),
        e.jsx("input", { value: target.username, readOnly: true, className: "p-2 border rounded bg-slate-50", placeholder: "Username" }),
        e.jsx("div", { className: "p-2 border rounded bg-emerald-50 text-emerald-700 font-bold", children: "Kredensial dari Router NAS aktif" })
      ] }),
      e.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-2 text-center font-bold", children: [
        e.jsxs("div", { className: "p-3 bg-blue-50 rounded border border-blue-100", children: [e.jsx("span", { className: "block text-slate-500", children: "PPPoE" }), e.jsx("b", { className: "text-blue-700", children: counts.pppoe })] }),
        e.jsxs("div", { className: "p-3 bg-cyan-50 rounded border border-cyan-100", children: [e.jsx("span", { className: "block text-slate-500", children: "Hotspot" }), e.jsx("b", { className: "text-cyan-700", children: counts.hotspot })] }),
        e.jsxs("div", { className: "p-3 bg-violet-50 rounded border border-violet-100", children: [e.jsx("span", { className: "block text-slate-500", children: "Profil PPPoE" }), e.jsx("b", { className: "text-violet-700", children: counts.pppoeProfiles })] }),
        e.jsxs("div", { className: "p-3 bg-fuchsia-50 rounded border border-fuchsia-100", children: [e.jsx("span", { className: "block text-slate-500", children: "Profil Hotspot" }), e.jsx("b", { className: "text-fuchsia-700", children: counts.hotspotProfiles })] }),
        e.jsxs("div", { className: "p-3 bg-emerald-50 rounded border border-emerald-100", children: [e.jsx("span", { className: "block text-slate-500", children: "NAS" }), e.jsx("b", { className: "text-emerald-700", children: counts.nas })] })
      ] }),
      e.jsx("button", { onClick: runSync, disabled: running, className: "w-full py-2.5 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-300 text-white rounded-lg font-black", children: running ? "Sinkronisasi berjalan..." : "Mulai Sync MikroTik" }),
      e.jsx("div", { className: "bg-slate-950 text-slate-200 rounded-lg p-3 font-mono text-[11px] min-h-44 space-y-1", children: logs.length ? logs.map((line, idx) => e.jsx("div", { children: line }, idx)) : "Log sync akan muncul di sini." })
    ] })
  ] });
};
function _g({ activeRole: w }) {
  const [J, S] = f.useState(() => {
      const t = window.__targetSubTab || "pppoe";
      return (delete window.__targetSubTab, t);
    }),
    [b, V] = f.useState([]),
    [ue, re] = f.useState([]),
    [ee, B] = f.useState([]),
    [T, fe] = f.useState([]),
    [G, F] = f.useState([]),
    [ce, ve] = f.useState([]),
    [Y, Ee] = f.useState([]),
    [Se, le] = f.useState(""),
    [ie, $] = f.useState(""),
    [de, oe] = f.useState([]),
    [be, Ye] = f.useState([]),
    [Te, Ie] = f.useState([]),
    [me, Oe] = f.useState([]),
    [te, Ae] = f.useState(!1),
    [Ue, y] = f.useState(!1),
    [K, O] = f.useState(!1),
    [P, z] = f.useState(!1),
    [g, C] = f.useState(!1),
    [I, X] = f.useState(null),
    [pe, he] = f.useState(!1),
    [Ne, $e] = f.useState({
      name: "",
      ip_address: "",
      secret: "",
      type: "Mikrotik",
    }),
    [ae, ze] = f.useState("vouchers"),
    [at, bt] = f.useState({
      session_timeout: "01:00:00",
      idle_timeout: "00:05:00",
      keepalive_timeout: "00:02:00",
      shared_users: "1",
      limit_bytes_total: "0",
    }),
    [Mt, ge] = f.useState([
      {
        id: 1,
        domain: "*.midtrans.com",
        action: "allow",
        description: "Bypass Payment Gateway Midtrans",
      },
      {
        id: 2,
        domain: "*.xendit.co",
        action: "allow",
        description: "Bypass Payment Gateway Xendit",
      },
      {
        id: 3,
        domain: "jayanet.id",
        action: "allow",
        description: "Situs portal utama operator",
      },
      {
        id: 4,
        domain: "whatsapp.com",
        action: "allow",
        description: "Bypass WhatsApp api",
      },
    ]),
    [Me, mt] = f.useState({ domain: "", action: "allow", description: "" }),
    [st, Z] = f.useState("alpha"),
    [_e, Ze] = f.useState("diff"),
    [Xe, Ht] = f.useState("default"),
    [St, E] = f.useState(!0),
    [Re, qe] = f.useState([]),
    [Fe, fa] = f.useState(null),
    [Aa, ps] = f.useState(null),
    [ra, es] = f.useState([
      {
        id: "1",
        name: "Paket 2 Jam",
        price: "3000",
        speed: "2 Mbps",
        activePeriod: "2 Jam",
      },
      {
        id: "2",
        name: "Paket Daily Speed",
        price: "5000",
        speed: "5 Mbps",
        activePeriod: "24 Jam",
      },
      {
        id: "3",
        name: "Paket Weekly Unlimited",
        price: "25000",
        speed: "10 Mbps",
        activePeriod: "7 Hari",
      },
    ]),
    [Ft, Tt] = f.useState({
      provider: "midtrans",
      merchantId: "M12093",
      clientKey: "SB-Mid-client-A9B7CdEfGhIj",
      isProduction: !1,
    }),
    [oa, Zt] = f.useState(null),
    [ts, ja] = f.useState(!1),
    [_s, xe] = f.useState(null),
    [pt, Xt] = f.useState(""),
    [Pt, Ya] = f.useState("5000"),
    [Xa, an] = f.useState("5 Mbps"),
    [ws, ks] = f.useState("24 Jam"),
    [Na, $t] = f.useState("192.168.88.1"),
    [sn, Qn] = f.useState("8728"),
    [_n, ga] = f.useState("admin"),
    [v, Pe] = f.useState(""),
    [vt, Ut] = f.useState(!1),
    [we, Ve] = f.useState([]),
    [rt, We] = f.useState(0),
    [nt, ea] = f.useState({
      brandName: "JAYA NET HOTSPOT",
      welcomeText: "Selamat Datang di Hotspot Desa Mandiri",
      buttonColor: "#2563eb",
      themeType: "modern-blue",
      loginOption: "voucher-only",
      customerSla: "SLA Kecepatan up to 5Mbps (Garansi Bandwidth 1:4)",
    }),
    [as, Ot] = f.useState(""),
    [Ra, It] = f.useState(!1),
    [_a, qt] = f.useState(!1),
    [Ss, ca] = f.useState("500000"),
    [Ma, Ts] = f.useState(null),
    [aa, wa] = f.useState(null),
    [ka, Hs] = f.useState({
      customer_id: "",
      username: "",
      password: "password123#",
      profile: "Home-Lite",
    }),
    [ba, za] = f.useState({
      name: "",
      local_address: "10.10.10.1",
      remote_pool: "PPPoE-Pool-1",
      rate_limit: "20M/10M",
    }),
    [Be, ot] = f.useState({
      customer_id: "",
      name: "",
      interface: "ether3-Lan",
      static_ip: "",
      gateway: "192.168.10.1",
      mac_address: "",
      rate_limit: "20M/20M",
      status: "active",
    }),
    [yt, Ct] = f.useState({
      name: "",
      rate_limit: "2M/2M",
      validity: "1d",
      grace_period: "30d",
      shared_users: "1",
      price: "5000",
    }),
    xs = [
      "ether1-WAN",
      "ether2-LAN-PPPoE",
      "ether3-Lan",
      "ether4",
      "ether5",
      "bridge-local",
      "bridge-hotspot",
      "wlan1",
      "wlan2",
    ],
    Us = [
      "1M/1M",
      "2M/2M",
      "5M/5M",
      "10M/5M",
      "10M/10M",
      "20M/10M",
      "20M/20M",
      "30M/15M",
      "30M/30M",
      "50M/25M",
      "50M/50M",
      "100M/50M",
      "100M/100M",
    ],
    Je = ["10.10.10.1", "192.168.10.1", "192.168.88.1", "10.0.0.1"],
    Kt = [
      "PPPoE-Pool-1",
      "PPPoE-Pool-2",
      "PPPoE-Pool-3",
      "PPPoE-Pool-Default",
      "dhcp_pool1",
      "dhcp_pool2",
    ],
    nn = ["1h", "2h", "3h", "5h", "12h", "1d", "7d", "30d"],
    Wn = ["1h", "1d", "7d", "30d"],
    [Dt, Li] = f.useState("ether3-Lan"),
    [ln, $a] = f.useState("ether3-Lan"),
    [At, Cs] = f.useState("20M/20M"),
    [Is, Ba] = f.useState("20M/20M"),
    [Fn, rn] = f.useState("10.10.10.1"),
    [wn, kn] = f.useState("PPPoE-Pool-1"),
    [Sn, Ei] = f.useState("20M/10M"),
    [Gs, Ha] = f.useState("2M/2M"),
    [Tn, Cn] = f.useState("1d"),
    [Ks, Ge] = f.useState("30d");
  f.useEffect(() => {
    I &&
      (xs.includes(I.interface) ? $a(I.interface) : $a("custom"),
      Us.includes(I.rate_limit) ? Ba(I.rate_limit) : Ba("custom"));
  }, [I]);
  const [Jt, xt] = f.useState({
      mac_address: "",
      ip_address: "",
      type: "bypassed",
      comment: "",
    }),
    [hl, on] = f.useState(!1),
    [Ua, An] = f.useState(10),
    [Ia, ss] = f.useState("Voucher-2Hours"),
    [As, Vt] = f.useState([]),
    Ja = async () => {
      try {
        const _ = await (await fetch("/api/v1/pppoe/profiles")).json();
        _.status === "success" && oe(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    Zs = async () => {
      try {
        const _ = await (await fetch("/api/v1/hotspot/profiles")).json();
        _.status === "success" && Ye(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    qs = async () => {
      try {
        const _ = await (await fetch("/api/v1/hotspot/ip-bindings")).json();
        _.status === "success" && Ie(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    ml = async () => {
      try {
        const _ = await (await fetch("/api/v1/hotspot/hosts")).json();
        _.status === "success" && Oe(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    Qt = async () => {
      try {
        const _ = await (await fetch("/api/v1/pppoe/accounts")).json();
        (_.status === "success" && V(_.data), Ja());
        const ct = await (await fetch("/api/v1/pppoe/sessions")).json();
        ct.status === "success" ? re(ct.data) : re([]);
      } catch (u) {
        console.error(u);
      }
    },
    Ga = async () => {
      try {
        const _ = await (await fetch("/api/v1/static-ips")).json();
        _.status === "success" && ve(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    ei = async () => {
      try {
        const _ = await (await fetch("/api/v1/hotspot/vouchers/sales")).json();
        _.status === "success" && qe(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    cn = async () => {
      if (
        confirm(
          "Konfirmasi: Apakah Anda yakin ingin mematikan / menghapus semua laporan penjualan voucher hotspot ini?",
        )
      )
        try {
          (
            await (
              await fetch("/api/v1/hotspot/vouchers/sales", {
                method: "DELETE",
              })
            ).json()
          ).status === "success" &&
            (qe([]), $("Laporan penjualan voucher berhasil dibersihkan."));
        } catch (u) {
          console.error(u);
        }
    },
    et = async () => {
      try {
        const _ = await (await fetch("/api/v1/hotspot/users")).json();
        _.status === "success"
          ? B(_.data)
          : B([
              {
                id: 1,
                username: "HSPT-VCH-82A1",
                profile: "Voucher-2Hours",
                status: "active",
              },
              {
                id: 2,
                username: "HSPT-VCH-393D",
                profile: "Voucher-Daily",
                status: "active",
              },
              {
                id: 3,
                username: "HSPT-VCH-11FF",
                profile: "Voucher-Hourly",
                status: "suspended",
              },
            ]);
        const ct = await (await fetch("/api/v1/hotspot/sessions")).json();
        (ct.status === "success" && fe(ct.data), Zs(), qs(), ml(), ei());
      } catch (u) {
        console.error(u);
      }
    },
    ti = async () => {
      try {
        const _ = await (await fetch("/api/v1/radius/nas")).json();
        _.status === "success" && F(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    Pa = async (u) => {
      if ((u.preventDefault(), !Ne.name || !Ne.ip_address || !Ne.secret)) {
        le("Harap lengkapi semua field bertanda bintang!");
        return;
      }
      try {
        const isEdit = !!Ne.id;
        const url = isEdit
          ? `/api/v1/radius/nas/${Ne.id}`
          : "/api/v1/radius/nas";
        const method = isEdit ? "PUT" : "POST";
        const Ce = await (
          await fetch(url, {
            method: method,
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(Ne),
          })
        ).json();
        Ce.status === "success"
          ? ($(
              isEdit
                ? `Router NAS RADIUS "${Ne.name}" berhasil diperbarui!`
                : `Router NAS RADIUS "${Ne.name}" berhasil terdaftar!`,
            ),
            he(!1),
            $e({ name: "", ip_address: "", secret: "", type: "Mikrotik" }),
            ti())
          : le(Ce.message || "Gagal menyimpan router NAS.");
      } catch (_) {
        (console.error(_), le("Terjadi kesalahan jaringan."));
      }
    },
    fs = async () => {
      try {
        const _ = await (await fetch("/api/v1/customers")).json();
        _.status === "success" && Ee(_.data);
      } catch (u) {
        console.error(u);
      }
    },
    Mn = async () => {
      var u, _, Ce, ct, La, Ln;
      try {
        const Ui = await (
          await fetch("/api/v1/settings/payment-gateway")
        ).json();
        if (Ui.status === "success" && Ui.data) {
          const Qa = Ui.data,
            Ys = Qa.activeGateway || "midtrans",
            Nl = (Qa.environment || "sandbox") === "production";
          let dn = "",
            Xs = "";
          (Ys === "midtrans"
            ? ((dn =
                ((u = Qa.midtrans) == null ? void 0 : u.serverKey) ||
                ((_ = Qa.midtrans) == null ? void 0 : _.clientKey) ||
                ""),
              (Xs =
                ((Ce = Qa.midtrans) == null ? void 0 : Ce.merchantId) || ""))
            : Ys === "xendit"
              ? ((dn =
                  ((ct = Qa.xendit) == null ? void 0 : ct.secretKey) || ""),
                (Xs = "Xendit-Core"))
              : Ys === "tripay"
                ? ((dn = ((La = Qa.tripay) == null ? void 0 : La.apiKey) || ""),
                  (Xs =
                    ((Ln = Qa.tripay) == null ? void 0 : Ln.merchantCode) ||
                    ""))
                : ((dn = "KUNCI-MANUAL"), (Xs = "MANUAL-ID")),
            Tt({
              provider: Ys,
              merchantId: Xs || "M10001",
              clientKey: dn || "SECRET_AUTHENTICATION_KEY_HIDDEN",
              isProduction: Nl,
            }));
        }
      } catch (Vs) {
        console.error("Error loading payment gateway settings:", Vs);
      }
    };
  f.useEffect(() => {
    (Qt(), et(), ti(), fs(), Ga(), Mn());
  }, []);
  const pl = async (u) => {
      if ((u.preventDefault(), !!ba.name))
        try {
          (
            await (
              await fetch("/api/v1/pppoe/profiles", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(ba),
              })
            ).json()
          ).status === "success" &&
            ($("Profil PPPoE Baru berhasil didaftarkan di RouterOS!"),
            y(!1),
            za({
              name: "",
              local_address: "10.10.10.1",
              remote_pool: "PPPoE-Pool-1",
              rate_limit: "20M/10M",
            }),
            Ja());
        } catch (_) {
          console.error(_);
        }
    },
    Oi = async (u) => {
      if (!window.confirm("Hapus profil PPPoE ini dari database billing dan daftar profile RouterOS? Akun pelanggan yang memakai profil ini bisa terdampak. Lanjutkan?")) return;
      try {
        (
          await (
            await fetch(`/api/v1/pppoe/profiles/${u}`, { method: "DELETE" })
          ).json()
        ).status === "success" && ($("Profil PPPoE berhasil dihapus."), Ja());
      } catch (_) {
        console.error(_);
      }
    },
    lr = async (u) => {
      if ((u.preventDefault(), !!Ma))
        try {
          (
            await (
              await fetch(`/api/v1/pppoe/accounts/${Ma.id}`, {
                method: "PUT",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(Ma),
              })
            ).json()
          ).status === "success" &&
            ($("Akun PPPoE berhasil diperbarui!"), Ts(null), Qt());
        } catch (_) {
          console.error(_);
        }
    },
    xl = async (u) => {
      if (confirm("Hapus akun PPPoE ini dari database?"))
        try {
          (
            await (
              await fetch(`/api/v1/pppoe/accounts/${u}`, { method: "DELETE" })
            ).json()
          ).status === "success" && ($("Akun PPPoE berhasil dihapus."), Qt());
        } catch (_) {
          console.error(_);
        }
    },
    Di = async (u) => {
      if ((u.preventDefault(), !!aa))
        try {
          (
            await (
              await fetch(`/api/v1/pppoe/profiles/${aa.id}`, {
                method: "PUT",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(aa),
              })
            ).json()
          ).status === "success" &&
            ($("Profil PPPoE berhasil diperbarui!"), wa(null), Ja());
        } catch (_) {
          console.error(_);
        }
    },
    rr = async (u) => {
      u.preventDefault();
      try {
        (
          await (
            await fetch("/api/v1/static-ips", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(Be),
            })
          ).json()
        ).status === "success" &&
          ($("Layanan IP Statik baru berhasil ditambahkan!"),
          C(!1),
          ot({
            customer_id: "",
            name: "",
            interface: "ether3-Lan",
            static_ip: "",
            gateway: "192.168.10.1",
            mac_address: "",
            rate_limit: "20M/20M",
            status: "active",
          }),
          Ga());
      } catch (_) {
        console.error(_);
      }
    },
    Ri = async (u) => {
      if ((u.preventDefault(), !!I))
        try {
          (
            await (
              await fetch(`/api/v1/static-ips/${I.id}`, {
                method: "PUT",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(I),
              })
            ).json()
          ).status === "success" &&
            ($("Layanan IP Statik berhasil diperbarui!"), X(null), Ga());
        } catch (_) {
          console.error(_);
        }
    },
    or = async (u) => {
      if (confirm("Hapus layanan IP Statik ini?"))
        try {
          (
            await (
              await fetch(`/api/v1/static-ips/${u}`, { method: "DELETE" })
            ).json()
          ).status === "success" && ($("IP Statik berhasil dihapus."), Ga());
        } catch (_) {
          console.error(_);
        }
    },
    ns = async (u) => {
      if ((u.preventDefault(), !!yt.name))
        try {
          (
            await (
              await fetch("/api/v1/hotspot/profiles", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(yt),
              })
            ).json()
          ).status === "success" &&
            ($("Profil Hotspot Baru berhasil dipasang."),
            O(!1),
            Ct({
              name: "",
              rate_limit: "2M/2M",
              validity: "1d",
              grace_period: "30d",
              shared_users: "1",
              price: "5000",
            }),
            Zs());
        } catch (_) {
          console.error(_);
        }
    },
    cr = async (u) => {
      try {
        (
          await (
            await fetch(`/api/v1/hotspot/profiles/${u}`, { method: "DELETE" })
          ).json()
        ).status === "success" && ($("Profil Hotspot berhasil dihapus."), Zs());
      } catch (_) {
        console.error(_);
      }
    },
    zi = async (u) => {
      if ((u.preventDefault(), !!Jt.mac_address))
        try {
          (
            await (
              await fetch("/api/v1/hotspot/ip-bindings", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(Jt),
              })
            ).json()
          ).status === "success" &&
            ($("Aturan IP Binding berhasil diaktifkan di IP > Hotspot!"),
            z(!1),
            xt({
              mac_address: "",
              ip_address: "",
              type: "bypassed",
              comment: "",
            }),
            qs());
        } catch (_) {
          console.error(_);
        }
    },
    Ms = async (u) => {
      try {
        (
          await (
            await fetch(`/api/v1/hotspot/ip-bindings/${u}`, {
              method: "DELETE",
            })
          ).json()
        ).status === "success" &&
          ($("Aturan IP Binding berhasil dihapus."), qs());
      } catch (_) {
        console.error(_);
      }
    },
    fl = async (u) => {
      if ((u.preventDefault(), !!ka.customer_id))
        try {
          (
            await (
              await fetch("/api/v1/pppoe/accounts", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(ka),
              })
            ).json()
          ).status === "success" &&
            ($("Kredensial PPPoE berhasil didaftarkan di RouterOS!"),
            Ae(!1),
            Hs({
              customer_id: "",
              username: "",
              password: "password123#",
              profile: "Home-Lite",
            }),
            Qt());
        } catch (_) {
          console.error(_);
        }
    },
    gl = async (u) => {
      try {
        const Ce = await (
          await fetch(`/api/v1/pppoe/accounts/${u}/disconnect`, {
            method: "POST",
          })
        ).json();
        Ce.status === "success" && ($(Ce.message), Qt());
      } catch (_) {
        console.error(_);
      }
    },
    Bi = async () => {
      try {
        const _ = await (
          await fetch("/api/v1/pppoe/sync", { method: "POST" })
        ).json();
        _.status === "success" && ($(_.message), Qt());
      } catch (u) {
        console.error(u);
      }
    },
    Hi = async (u) => {
      u.preventDefault();
      try {
        const Ce = await (
          await fetch("/api/v1/hotspot/vouchers/generate", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({
              limit: Ua,
              profile: Ia,
              charMode: st,
              credentialMode: _e,
              lockMac: St,
            }),
          })
        ).json();
        Ce.status === "success" &&
          (Vt(Ce.data),
          $(`Berhasil menjaring ${Ce.data.length} voucher baru di hotspot.`),
          et());
      } catch (_) {
        console.error(_);
      }
    },
    bl = async (u) => {
      try {
        const Ce = await (
          await fetch(`/api/v1/hotspot/users/${u}/toggle-lock`, {
            method: "POST",
          })
        ).json();
        Ce.status === "success" && ($(Ce.message), et());
      } catch (_) {
        console.error(_);
      }
    },
    vl = async (u) => {
      try {
        const Ce = await (
          await fetch(`/api/v1/hotspot/users/${u}/reset-mac`, {
            method: "POST",
          })
        ).json();
        Ce.status === "success" && ($(Ce.message), et());
      } catch (_) {
        console.error(_);
      }
    },
    dr = async (u, _) => {
      if (
        window.confirm(
          `Hapus voucher hotspot "${_}" secara permanen? Tindakan ini tidak dapat dibatalkan.`,
        )
      )
        try {
          const ct = await (
            await fetch(`/api/v1/hotspot/users/${u}`, { method: "DELETE" })
          ).json();
          ct.status === "success"
            ? ($(`Voucher hotspot "${_}" berhasil dihapus.`), et())
            : le(ct.message || "Gagal menghapus voucher.");
        } catch (Ce) {
          (console.error(Ce), le("Koneksi gagal ke server biling."));
        }
    },
    yl = (u) => {
      const _ = Math.floor(u / 3600),
        Ce = Math.floor((u % 3600) / 60);
      return `${_}j ${Ce}m`;
    },
    Pn = (u) => `${(u / 1073741824).toFixed(1)} GB`,
    ur = async () => {
      Ut(!0); We(10); Ve([`[${new Date().toLocaleTimeString()}] Membaca ulang data PPPoE dan Hotspot dari Router NAS aktif...`]);
      try {
        const [pppoeResult, hotspotResult] = await Promise.all([
          fetch("/api/v1/pppoe/sync", { method: "POST" }).then((response) => response.json()),
          fetch("/api/v1/hotspot/sync", { method: "POST" }).then((response) => response.json())
        ]);
        if (pppoeResult.status !== "success" || hotspotResult.status !== "success") throw new Error(pppoeResult.message || hotspotResult.message || "Sinkronisasi ditolak RouterOS");
        We(100); Ve((lines) => [...lines, `[${new Date().toLocaleTimeString()}] ${pppoeResult.message}`, `[${new Date().toLocaleTimeString()}] ${hotspotResult.message}`, `[${new Date().toLocaleTimeString()}] Sinkronisasi live selesai tanpa data simulasi.`]);
        await et(); $("Data PPPoE dan Hotspot berhasil disinkronkan dari RouterOS.");
      } catch (error) {
        Ve((lines) => [...lines, `[${new Date().toLocaleTimeString()}] ERROR: ${error.message}`]); le(error.message || "Sinkronisasi RouterOS gagal.");
      } finally { Ut(!1); }
      return;
      (Ut(!0),
        We(5),
        Ve([
          `[${new Date().toLocaleTimeString()}] 🔌 Memulai proses sinkronisasi database ke MikroTik Baru (${Na}:${sn})...`,
          `[${new Date().toLocaleTimeString()}] 🔍 Membuka soket API & memverifikasi kredensial sebagai '${_n}'...`,
        ]),
        setTimeout(() => {
          (We(25),
            Ve((u) => [
              ...u,
              `[${new Date().toLocaleTimeString()}] ✅ Koneksi berhasil dibentuk! Terhubung ke MikroTik OS v7.14`,
              `[${new Date().toLocaleTimeString()}] 📦 Sinkronisasi PPP Profiles (${de.length} item ditemukan)...`,
            ]),
            de.forEach((u) => {
              Ve((_) => [
                ..._,
                `  ↳ /ppp profile add name="${u.name}" local-address=${u.local_address} remote-address=${u.remote_pool} rate-limit="${u.rate_limit}"`,
              ]);
            }));
        }, 1e3),
        setTimeout(() => {
          (We(50),
            Ve((u) => [
              ...u,
              `[${new Date().toLocaleTimeString()}] 📦 Sinkronisasi PPP Secrets / Akun Pelanggan PPPoE (${b.length} akun ditemukan)...`,
            ]),
            b.forEach((u) => {
              Ve((_) => [
                ..._,
                `  ↳ /ppp secret add name="${u.username}" service=pppoe profile="${u.profile}" local-address="${u.remote_address || "10.10.10.x"}"`,
              ]);
            }));
        }, 2e3),
        setTimeout(() => {
          (We(75),
            Ve((u) => [
              ...u,
              `[${new Date().toLocaleTimeString()}] 📦 Sinkronisasi Hotspot Profiles (${be.length} profil ditemukan)...`,
            ]),
            be.forEach((u) => {
              Ve((_) => [
                ..._,
                `  ↳ /ip hotspot user profile add name="${u.name}" rate-limit="${u.rate_limit}" shared-users=${u.shared_users || 1}`,
              ]);
            }));
        }, 3e3),
        setTimeout(() => {
          (We(90),
            Ve((u) => [
              ...u,
              `[${new Date().toLocaleTimeString()}] 📦 Sinkronisasi Voucher Hotspot Users (${ee.length} voucher ditemukan)...`,
            ]),
            ee.forEach((u) => {
              const _ = u.lock_mac
                ? u.mac_address
                  ? ` mac-address=${u.mac_address}`
                  : ' comment="MAC-Lock: pending first login"'
                : "";
              Ve((Ce) => [
                ...Ce,
                `  ↳ /ip hotspot user add name="${u.username}" password="${u.password || u.username}" profile="${u.profile}"${_}`,
              ]);
            }));
        }, 4e3),
        setTimeout(() => {
          (We(100),
            Ve((u) => [
              ...u,
              `[${new Date().toLocaleTimeString()}] ✨ -------------------------------------------------------------`,
              `[${new Date().toLocaleTimeString()}] 🎉 SINKRONISASI SUKSES! Seluruh database lokal di web billing berhasil diunggah ke MikroTik baru.`,
              `[${new Date().toLocaleTimeString()}] ℹ️ RouterOS sekarang otomatis sinkron penuh dengan sistem manajemen penjualan.`,
            ]),
            Ut(!1),
            $(
              "Sinkronisasi otomatis database ke MikroTik Baru sukses diselesaikan!",
            ));
        }, 5e3));
    },
    ai = () => {
      let u = `# =========================================================
`;
      return (
        (u += `# MIKROTIK AUTO-RECOVERY & CONFIGURATION EXPORT SCRIPT
`),
        (u += `# Dibuat pada: ${new Date().toLocaleString("id-ID")}
`),
        (u += `# Desain Sistem: Billing Hub IP & Voucher Manager
`),
        (u += `# Target: MikroTik RouterOS v6.x / v7.x Terminal Console
`),
        (u += `# =========================================================

`),
        (u += `/sys note set show-at-login=no note="Konfigurasi dipulihkan oleh AutoSync-Center"

`),
        (u += `# ---------------------------------------------------------
`),
        (u += `# A. SINKRONISASI PROFIL PPP (PPPoE Server Profiles)
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `/ppp profile
`),
        de.forEach((_) => {
          u += `add name="${_.name}" local-address="${_.local_address}" remote-address="${_.remote_pool}" rate-limit="${_.rate_limit}" comment="Restored profile ${_.name}"
`;
        }),
        (u += `
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `# B. SINKRONISASI AKUN PELANGGAN PPPoE (PPP Secrets)
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `/ppp secret
`),
        b.forEach((_) => {
          const Ce = "secret123",
            ct = _.status === "disabled" ? " disabled=yes" : "";
          u += `add name="${_.username}" password="${Ce}" service=pppoe profile="${_.profile}" local-address="${_.remote_address || "10.10.10.x"}" comment="ID: ${_.id}"${ct}
`;
        }),
        (u += `
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `# C. SINKRONISASI PROFIL SPEED HOTSPOT
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `/ip hotspot user profile
`),
        be.forEach((_) => {
          u += `add name="${_.name}" rate-limit="${_.rate_limit}" shared-users=${_.shared_users || 1} keepalive-timeout=120s idle-timeout=300s comment="${_.validity} lease"
`;
        }),
        (u += `
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `# D. SINKRONISASI VOUCHER HOTSPOT (Hotspot Users & anti-share settings)
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `/ip hotspot user
`),
        ee.forEach((_) => {
          const Ce = _.password || _.username;
          let ct = "";
          (_.lock_mac
            ? _.mac_address
              ? (ct += ` mac-address=${_.mac_address}`)
              : (ct += ' comment="Anti-Share: Lock MAC pending on first login"')
            : (ct += ' comment="Shared Access Allowed"'),
            (u += `add name="${_.username}" password="${Ce}" profile="${_.profile}"${ct}
`));
        }),
        (u += `
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `# E. SINKRONISASI IP STATIK & DHCP BINDINGS
`),
        (u += `# ---------------------------------------------------------
`),
        (u += `/ip dhcp-server lease
`),
        ce.forEach((_) => {
          _.static_ip &&
            _.mac_address &&
            (u += `add address="${_.static_ip}" mac-address="${_.mac_address}" comment="Static IP Binding ${_.name}" disabled=no
`);
        }),
        (u += `
# --- AKHIR DARI RECOVERY FILE ---`),
        u
      );
    },
    jl = () => {
      const u = ai(),
        _ = document.createElement("a"),
        Ce = new Blob([u], { type: "text/plain" });
      ((_.href = URL.createObjectURL(Ce)),
        (_.download = "mikrotik_autosync_recovery.rsc"),
        document.body.appendChild(_),
        _.click(),
        document.body.removeChild(_),
        $(
          "File backup MikroTik .rsc berhasil diunduh! Silakan drag & drop atau pasang via Terminal MikroTik baru.",
        ));
    };
  return e.jsxs("div", {
    className: "space-y-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [

      ie &&
        e.jsxs("div", {
          className:
            "p-3 bg-emerald-50 border border-emerald-250 text-emerald-800 text-xs rounded-lg font-medium flex justify-between items-center",
          children: [
            e.jsx("span", { children: ie }),
            e.jsx("button", {
              onClick: () => $(""),
              className: "font-bold shrink-0",
              children: "X",
            }),
          ],
        }),
      e.jsx("div", {
        className: "flex border-b border-slate-200 flex-wrap",
        children: [
          { id: "pppoe", label: "PPPoE Server Secret & Sessions" },
          { id: "hotspot", label: "Hotspot Portal & Config" },
          { id: "static-ip", label: "IP Statik & Binding Mode" },
        ].map((u) =>
          e.jsx(
            "button",
            {
              onClick: () => S(u.id),
              className: `px-5 py-3 text-xs font-bold border-b-2 tracking-tight transition-all duration-150 cursor-pointer ${J === u.id ? "border-blue-600 text-blue-600 font-extrabold" : "border-transparent text-slate-500 hover:text-slate-800"}`,
              children: u.label,
            },
            u.id,
          ),
        ),
      }),
      J === "pppoe" &&
        e.jsxs("div", {
          className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
          children: [
            e.jsxs("div", {
              className: "lg:col-span-2 space-y-6",
              children: [
                e.jsxs("div", {
                  className:
                    "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
                  children: [
                    e.jsxs("div", {
                      className:
                        "flex items-center justify-between border-b pb-3",
                      children: [
                        e.jsx("div", {
                          children: e.jsxs("h3", {
                            className:
                              "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                            children: [
                              e.jsx(Nn, {
                                className: "h-4.5 w-4.5 text-blue-650",
                              }),
                              e.jsx("span", {
                                children: "Daftar User PPPoE (PPP Secrets)",
                              }),
                            ],
                          }),
                        }),
                        w !== "Customer" &&
                          w !== "Technician" &&
                          e.jsxs("div", {
                            className: "flex gap-2",
                            children: [
                              e.jsx("button", {
                                onClick: Bi,
                                className:
                                  "px-3 py-1 bg-slate-100 hover:bg-slate-200 border text-slate-650 font-bold rounded text-[11px] cursor-pointer",
                                children: "Sync MikroTik",
                              }),
                              e.jsxs("button", {
                                onClick: () => Ae(!0),
                                className:
                                  "px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded text-[11px] cursor-pointer flex items-center gap-1 shadow-sm",
                                children: [
                                  e.jsx(jn, { className: "h-3 w-3" }),
                                  e.jsx("span", { children: "Buat PPPoE" }),
                                ],
                              }),
                            ],
                          }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-700",
                      children: [
                        e.jsxs("div", {
                          className:
                            "p-2.5 bg-slate-100/80 font-bold grid grid-cols-5 gap-2 text-slate-600",
                          children: [
                            e.jsx("span", { children: "Username" }),
                            e.jsx("span", { children: "Profile Limit" }),
                            e.jsx("span", { children: "IP Remote" }),
                            e.jsx("span", { children: "Status" }),
                            e.jsx("span", { children: "Aksi" }),
                          ],
                        }),
                        b.map((u) =>
                          e.jsxs(
                            "div",
                            {
                              className:
                                "p-2.5 grid grid-cols-5 gap-2 font-mono items-center hover:bg-white transition-colors",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "font-sans font-bold truncate text-slate-800",
                                  children: u.username,
                                }),
                                e.jsx("span", {
                                  className: "text-[11px] text-slate-500",
                                  children: u.profile,
                                }),
                                e.jsx("span", {
                                  className: "text-[11px]",
                                  children: u.remote_address,
                                }),
                                e.jsx("span", {
                                  children: e.jsx("span", {
                                    className: `text-[10px] font-bold px-1.5 py-0.5 rounded ${u.status === "active" ? "bg-green-50 text-green-600" : "bg-slate-100 text-slate-500"}`,
                                    children: u.status,
                                  }),
                                }),
                                e.jsxs("div", {
                                  className: "flex gap-2 text-sans font-sans",
                                  children: [
                                    e.jsx("button", {
                                      onClick: () => Ts(u),
                                      className:
                                        "text-blue-600 hover:underline font-bold text-[10px] uppercase cursor-pointer",
                                      children: "Edit",
                                    }),
                                    e.jsx("button", {
                                      onClick: () => xl(u.id),
                                      className:
                                        "text-rose-600 hover:text-rose-500 font-bold text-[10px] uppercase cursor-pointer",
                                      children: "Hapus",
                                    }),
                                  ],
                                }),
                              ],
                            },
                            u.id,
                          ),
                        ),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "p-4 bg-white border border-slate-200 rounded-xl space-y-3 shadow-sm",
                  children: [
                    e.jsx("div", {
                      className: "border-b pb-2",
                      children: e.jsxs("h3", {
                        className:
                          "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                        children: [
                          e.jsx(eo, { className: "h-4 w-4 text-emerald-500" }),
                          e.jsx("span", {
                            children: "Sesi PPPoE Aktif (MikroTik ROS)",
                          }),
                        ],
                      }),
                    }),
                    e.jsxs("div", {
                      className:
                        "bg-slate-50 border rounded-lg overflow-hidden divide-y text-[11px] font-mono text-slate-700",
                      children: [
                        e.jsxs("div", {
                          className:
                            "p-2 bg-slate-100/60 font-bold grid grid-cols-5 gap-2 text-slate-600 text-xs font-sans",
                          children: [
                            e.jsx("span", { children: "User" }),
                            e.jsx("span", { children: "IP Address" }),
                            e.jsx("span", { children: "Uptime" }),
                            e.jsx("span", { children: "Kuota Down/Up" }),
                            e.jsx("span", { children: "Aksi" }),
                          ],
                        }),
                        ue.length === 0
                          ? e.jsx("div", {
                              className:
                                "p-4 text-center text-slate-400 font-sans",
                              children:
                                "Tidak ada sesi PPPoE yang aktif di Router.",
                            })
                          : ue.map((u) =>
                              e.jsxs(
                                "div",
                                {
                                  className:
                                    "p-2 grid grid-cols-5 gap-2 items-center hover:bg-white transition-colors",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "font-sans font-bold text-slate-800 truncate",
                                      children: u.username,
                                    }),
                                    e.jsx("span", { children: u.ip_address }),
                                    e.jsx("span", { children: yl(u.uptime) }),
                                    e.jsx("span", {
                                      className: "text-blue-600 font-bold",
                                      children: Pn(u.download_usage),
                                    }),
                                    e.jsx("div", {
                                      children:
                                        w !== "Customer" &&
                                        w !== "Technician" &&
                                        e.jsxs("button", {
                                          onClick: () => gl(u.id),
                                          className:
                                            "px-2 py-0.5 border border-rose-250 text-rose-600 hover:bg-rose-50 rounded text-[10px] font-sans font-bold flex items-center gap-1 shrink-0 cursor-pointer",
                                          children: [
                                            e.jsx(H0, {
                                              className: "h-2.5 w-2.5",
                                            }),
                                            e.jsx("span", {
                                              children: "Kill Sesi",
                                            }),
                                          ],
                                        }),
                                    }),
                                  ],
                                },
                                u.id,
                              ),
                            ),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "p-4 bg-white border border-slate-200 rounded-xl space-y-3 shadow-sm",
                  children: [
                    e.jsxs("div", {
                      className:
                        "border-b pb-2 flex justify-between items-center",
                      children: [
                        e.jsxs("h3", {
                          className:
                            "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                          children: [
                            e.jsx($n, { className: "h-4 w-4 text-violet-500" }),
                            e.jsx("span", {
                              children:
                                "Daftar Profil Kecepatan PPPoE (PPP Profiles)",
                            }),
                          ],
                        }),
                        w !== "Customer" &&
                          w !== "Technician" &&
                          e.jsxs("button", {
                            onClick: () => y(!0),
                            className:
                              "px-2.5 py-1 bg-violet-600 hover:bg-violet-500 text-white font-bold rounded text-[10px] cursor-pointer flex items-center gap-1 shadow-sm",
                            children: [
                              e.jsx(jn, { className: "h-3 w-3" }),
                              e.jsx("span", { children: "Tambah Profil" }),
                            ],
                          }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "bg-slate-50 border rounded-lg overflow-hidden divide-y text-[11px] font-mono text-slate-705",
                      children: [
                        e.jsxs("div", {
                          className:
                            "p-2 bg-slate-100/60 font-bold grid grid-cols-5 gap-2 text-slate-650 text-xs font-sans",
                          children: [
                            e.jsx("span", { children: "Nama Profil" }),
                            e.jsx("span", { children: "Local Address" }),
                            e.jsx("span", { children: "IP Pool Remote" }),
                            e.jsx("span", { children: "Rate Limit (Speed)" }),
                            e.jsx("span", { children: "Aksi" }),
                          ],
                        }),
                        de.map((u) =>
                          e.jsxs(
                            "div",
                            {
                              className:
                                "p-2.5 grid grid-cols-5 gap-2 items-center hover:bg-white transition-colors",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "font-sans font-bold text-slate-800 truncate",
                                  children: u.name,
                                }),
                                e.jsx("span", { children: u.local_address }),
                                e.jsx("span", { children: u.remote_pool }),
                                e.jsx("span", {
                                  className: "text-violet-600 font-bold",
                                  children: u.rate_limit,
                                }),
                                e.jsx("div", {
                                  className: "flex gap-2 font-sans",
                                  children:
                                    w !== "Customer" &&
                                    w !== "Technician" &&
                                    e.jsxs(e.Fragment, {
                                      children: [
                                        e.jsx("button", {
                                          onClick: () => wa(u),
                                          className:
                                            "text-blue-600 hover:underline font-bold text-[10px] uppercase cursor-pointer",
                                          children: "Edit",
                                        }),
                                        e.jsxs("button", {
                                          onClick: () => Oi(u.id),
                                          className:
                                            "text-rose-600 hover:text-rose-500 font-bold text-[10px] uppercase cursor-pointer flex items-center gap-1 shrink-0",
                                          children: [
                                            e.jsx(ms, { className: "h-3 w-3" }),
                                            e.jsx("span", {
                                              children: "Hapus",
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                }),
                              ],
                            },
                            u.id,
                          ),
                        ),
                      ],
                    }),
                  ],
                }),
              ],
            }),
            e.jsx("div", {
              className: "space-y-4",
              children: e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
                children: [
                  e.jsx("h3", {
                    className:
                      "text-xs font-extrabold text-slate-800 uppercase tracking-widest",
                    children: "Aturan Profile Speed Limit",
                  }),
                  e.jsx("p", {
                    className:
                      "text-xs text-slate-500 leading-normal font-light",
                    children:
                      "Setiap akun PPPoE yang dibuat disinkronisasikan ke RouterOS. Profil Home-Lite otomatis membatasi kecepatan download 10Mbps dan upload 5Mbps di queue list router.",
                  }),
                  e.jsx("div", {
                    className:
                      "p-1 px-3 bg-blue-50 text-blue-750 text-xs rounded border border-blue-100 leading-normal font-medium",
                    children:
                      "Peringatan: Bila tagihan pelanggan terlambat sistem otomatis men-disable secret PPPoE ini dari RouterOS!",
                  }),
                ],
              }),
            }),
          ],
        }),
      J === "hotspot" &&
        e.jsxs("div", {
          className: "space-y-6",
          children: [
            e.jsx("div", {
              className: "flex bg-slate-100 p-1 rounded-xl max-w-xl",
              children: [
                { id: "vouchers", label: "Vouchers & Sesi Aktif" },
                {
                  id: "profiles-config",
                  label: "Hotspot Profiles & Walled Garden",
                },
                { id: "splash-page", label: "Splash Page Designer" },
              ].map((u) =>
                e.jsx(
                  "button",
                  {
                    onClick: () => ze(u.id),
                    className: `flex-1 py-1.5 text-xs font-bold rounded-lg transition-all cursor-pointer ${ae === u.id ? "bg-white text-slate-900 shadow-sm" : "text-slate-500 hover:text-slate-800"}`,
                    children: u.label,
                  },
                  u.id,
                ),
              ),
            }),
            ae === "vouchers" &&
              e.jsxs("div", {
                className:
                  "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
                children: [
                  e.jsxs("div", {
                    className: "lg:col-span-2 space-y-6",
                    children: [
                      w !== "Customer" &&
                        w !== "Technician" &&
                        e.jsxs("div", {
                          className:
                            "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                          children: [
                            e.jsx("div", {
                              className: "border-b pb-3",
                              children: e.jsxs("h3", {
                                className:
                                  "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                                children: [
                                  e.jsx(fc, {
                                    className: "h-4.5 w-4.5 text-blue-600",
                                  }),
                                  e.jsx("span", {
                                    children:
                                      "Simpan & Cetak Batch Voucher Hotspot",
                                  }),
                                ],
                              }),
                            }),
                            e.jsxs("form", {
                              onSubmit: Hi,
                              className: "space-y-4 text-xs font-sans",
                              children: [
                                e.jsxs("div", {
                                  className:
                                    "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4",
                                  children: [
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "font-bold text-slate-600 block",
                                          children: "Jumlah Voucher *",
                                        }),
                                        e.jsx("input", {
                                          type: "number",
                                          max: 50,
                                          min: 1,
                                          value: Ua,
                                          onChange: (u) =>
                                            An(Number(u.target.value)),
                                          className:
                                            "w-full p-2 bg-slate-50 border border-slate-250 rounded-lg outline-none font-sans",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "font-bold text-slate-600 block",
                                          children: "Profil Kecepatan & Tarif",
                                        }),
                                        e.jsx("select", {
                                          value: Ia,
                                          onChange: (u) => ss(u.target.value),
                                          className:
                                            "w-full p-2 bg-slate-50 border border-slate-250 rounded-lg outline-none cursor-pointer",
                                          children: be.map((u) =>
                                            e.jsxs(
                                              "option",
                                              {
                                                value: u.name,
                                                children: [
                                                  u.name,
                                                  " (Rp ",
                                                  u.price.toLocaleString(
                                                    "id-ID",
                                                  ),
                                                  ")",
                                                ],
                                              },
                                              u.id,
                                            ),
                                          ),
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "font-bold text-slate-600 block",
                                          children: "Kriteria Kolom Kode",
                                        }),
                                        e.jsxs("select", {
                                          value: st,
                                          onChange: (u) => Z(u.target.value),
                                          className:
                                            "w-full p-2 bg-slate-50 border border-slate-250 rounded-lg outline-none cursor-pointer",
                                          children: [
                                            e.jsx("option", {
                                              value: "alpha",
                                              children:
                                                "Campur Angka & Kapital (Contoh: K2B9X)",
                                            }),
                                            e.jsx("option", {
                                              value: "numbers",
                                              children:
                                                "Hanya Angka (Contoh: 82194)",
                                            }),
                                            e.jsx("option", {
                                              value: "uppercase",
                                              children:
                                                "Hanya Huruf Kapital (Contoh: JKWQL)",
                                            }),
                                            e.jsx("option", {
                                              value: "mixed",
                                              children:
                                                "Campuran Besar-Kecil & Angka (Contoh: k9Wa1)",
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "font-bold text-slate-600 block",
                                          children: "Format Kredensial",
                                        }),
                                        e.jsxs("select", {
                                          value: _e,
                                          onChange: (u) => Ze(u.target.value),
                                          className:
                                            "w-full p-2 bg-slate-50 border border-slate-250 rounded-lg outline-none cursor-pointer",
                                          children: [
                                            e.jsx("option", {
                                              value: "diff",
                                              children:
                                                "Username & Password Berbeda (Lebih Aman)",
                                            }),
                                            e.jsx("option", {
                                              value: "same",
                                              children:
                                                "Username = Password (Single Code/Lebih Praktis)",
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "p-3 bg-blue-50/50 border border-blue-100 rounded-xl space-y-1.5 font-sans",
                                  children: [
                                    e.jsxs("label", {
                                      className:
                                        "flex items-center gap-2 cursor-pointer select-none",
                                      children: [
                                        e.jsx("input", {
                                          type: "checkbox",
                                          checked: St,
                                          onChange: (u) => E(u.target.checked),
                                          className:
                                            "h-4 w-4 rounded border-slate-300 text-blue-650 focus:ring-blue-605 cursor-pointer accent-blue-600",
                                        }),
                                        e.jsx("span", {
                                          className:
                                            "font-extrabold text-slate-800 text-xs",
                                          children:
                                            "Aktifkan Keamanan Anti-Share (Kunci MAC HP Pertama)",
                                        }),
                                      ],
                                    }),
                                    e.jsx("p", {
                                      className:
                                        "text-[10px] text-slate-500 pl-6 leading-normal font-medium",
                                      children:
                                        "Saat user melakukan login pertama kali, Mikrotik secara otomatis akan mencatat dan mengunci MAC address perangkat HP milik client terhubung. Voucher hanya bisa dipakai di HP tersebut dan tidak bisa digilir dipindah-pindah.",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "grid grid-cols-1 md:grid-cols-2 gap-4 pt-2 border-t border-slate-100 items-end",
                                  children: [
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "font-bold text-slate-650 block",
                                          children:
                                            "Desain / Template Voucher & Logo Kustom",
                                        }),
                                        e.jsx("div", {
                                          className:
                                            "grid grid-cols-2 sm:grid-cols-4 gap-2 mb-2",
                                          children: [
                                            {
                                              id: "default",
                                              label: "Default Grid",
                                            },
                                            {
                                              id: "ticket",
                                              label: "Tiket POS ✂️",
                                            },
                                            {
                                              id: "badge",
                                              label: "Modern Badge",
                                            },
                                            {
                                              id: "minimal",
                                              label: "Minimalis & QR",
                                            },
                                          ].map((u) =>
                                            e.jsx(
                                              "button",
                                              {
                                                type: "button",
                                                onClick: () => Ht(u.id),
                                                className: `p-1.5 rounded-lg border text-[10px] font-bold text-center transition-all cursor-pointer ${Xe === u.id ? "bg-blue-50 border-blue-600 text-blue-700 shadow-sm" : "bg-white border-slate-250 hover:bg-slate-50 text-slate-600"}`,
                                                children: u.label,
                                              },
                                              u.id,
                                            ),
                                          ),
                                        }),
                                        e.jsxs("div", {
                                          className:
                                            "p-2.5 bg-slate-50 border border-slate-200 rounded-xl flex items-center justify-between gap-3 font-sans",
                                          children: [
                                            e.jsxs("div", {
                                              className:
                                                "flex items-center gap-2",
                                              children: [
                                                e.jsx("div", {
                                                  className:
                                                    "w-8 h-8 rounded bg-white border flex items-center justify-center overflow-hidden shrink-0 shadow-sm relative",
                                                  children: Fe
                                                    ? e.jsx("img", {
                                                        src: Fe,
                                                        alt: "Logo",
                                                        className:
                                                          "w-full h-full object-contain",
                                                        referrerPolicy:
                                                          "no-referrer",
                                                      })
                                                    : e.jsx("span", {
                                                        className:
                                                          "text-[7.5px] font-mono text-slate-400 font-extrabold text-center leading-none",
                                                        children: "NO LOGO",
                                                      }),
                                                }),
                                                e.jsxs("div", {
                                                  className: "leading-tight",
                                                  children: [
                                                    e.jsx("span", {
                                                      className:
                                                        "text-[10px] font-extrabold text-slate-800 block",
                                                      children:
                                                        "Logo pada Voucher",
                                                    }),
                                                    e.jsx("span", {
                                                      className:
                                                        "text-[8px] text-slate-450",
                                                      children:
                                                        "Tampil otomatis di tiket cetak",
                                                    }),
                                                  ],
                                                }),
                                              ],
                                            }),
                                            e.jsxs("div", {
                                              className: "flex gap-2",
                                              children: [
                                                e.jsx("input", {
                                                  id: "hotspot-voucher-logo-upload",
                                                  type: "file",
                                                  accept: "image/*",
                                                  className: "hidden",
                                                  onChange: (u) => {
                                                    var Ce;
                                                    const _ =
                                                      (Ce = u.target.files) ==
                                                      null
                                                        ? void 0
                                                        : Ce[0];
                                                    if (_) {
                                                      const ct =
                                                        new FileReader();
                                                      ((ct.onloadend = () => {
                                                        fa(ct.result);
                                                      }),
                                                        ct.readAsDataURL(_));
                                                    }
                                                  },
                                                }),
                                                e.jsx("label", {
                                                  htmlFor:
                                                    "hotspot-voucher-logo-upload",
                                                  className:
                                                    "px-2.5 py-1 bg-blue-650 hover:bg-blue-600 text-white font-bold rounded text-[9px] uppercase cursor-pointer select-none tracking-wide",
                                                  children: "Pilih Logo",
                                                }),
                                                Fe &&
                                                  e.jsx("button", {
                                                    type: "button",
                                                    onClick: () => fa(null),
                                                    className:
                                                      "px-1.5 py-1 text-[9px] text-red-650 hover:text-red-700 font-bold bg-white border border-slate-200 rounded cursor-pointer",
                                                    children: "Hapus",
                                                  }),
                                              ],
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsxs("button", {
                                      type: "submit",
                                      className:
                                        "w-full py-2 bg-blue-650 hover:bg-blue-600 text-white font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1.5 shadow",
                                      children: [
                                        e.jsx(ar, {
                                          className:
                                            "h-3.5 w-3.5 fill-current animate-bounce",
                                        }),
                                        e.jsx("span", {
                                          children:
                                            "Mulai Jaring & Cetak Batch Voucher",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            As.length > 0 &&
                              e.jsxs("div", {
                                className: "pt-4 space-y-3.5 border-t",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center bg-slate-100 p-2.5 rounded-xl border border-slate-200",
                                    children: [
                                      e.jsxs("div", {
                                        children: [
                                          e.jsxs("span", {
                                            className:
                                              "text-xs font-bold text-slate-705 block",
                                            children: [
                                              "Daftar Voucher Terbit (Tema: ",
                                              e.jsx("span", {
                                                className:
                                                  "uppercase text-blue-605 font-extrabold",
                                                children: Xe,
                                              }),
                                              ")",
                                            ],
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-[10px] text-slate-450",
                                            children:
                                              "Telah disimpan ke database mikrotik hotspot untuk didistribusikan.",
                                          }),
                                        ],
                                      }),
                                      e.jsxs("button", {
                                        onClick: () => {
                                          (alert(
                                            "Memicu printer Thermal POS lokal atau mendownload dokumen PDF...",
                                          ),
                                            Vt([]));
                                        },
                                        className:
                                          "px-3 py-1.5 text-[11px] bg-slate-900 hover:bg-slate-800 text-white font-bold rounded-lg flex items-center gap-1 cursor-pointer transition-colors shrink-0",
                                        children: [
                                          e.jsx(Op, {
                                            className:
                                              "h-3.5 w-3.5 text-blue-400",
                                          }),
                                          e.jsx("span", {
                                            children: "Kirim ke Printer",
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                  e.jsx("div", {
                                    className:
                                      "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3",
                                    children: As.map((u, _) =>
                                      Xe === "ticket"
                                        ? e.jsxs(
                                            "div",
                                            {
                                              className:
                                                "p-3.5 border-2 border-dashed border-slate-300 rounded-none bg-white text-center font-mono text-xs space-y-1.5 relative select-all",
                                              children: [
                                                e.jsx("div", {
                                                  className:
                                                    "absolute top-1 right-1 text-[10px] text-slate-300",
                                                  children: "✂️",
                                                }),
                                                e.jsxs("div", {
                                                  className:
                                                    "border-b pb-1 mb-1 font-sans flex items-center justify-center gap-1.5",
                                                  children: [
                                                    Fe &&
                                                      e.jsx("img", {
                                                        src: Fe,
                                                        alt: "Logo",
                                                        className:
                                                          "w-5 h-5 object-contain rounded-xs",
                                                        referrerPolicy:
                                                          "no-referrer",
                                                      }),
                                                    e.jsxs("div", {
                                                      className: "text-left",
                                                      children: [
                                                        e.jsx("h4", {
                                                          className:
                                                            "font-black text-slate-800 uppercase tracking-wide text-[9px] leading-tight",
                                                          children:
                                                            "📡 BATCH VOUCHER",
                                                        }),
                                                        e.jsx("span", {
                                                          className:
                                                            "text-[7px] bg-slate-100 px-1 py-0.5 rounded text-slate-605 font-bold leading-none inline-block",
                                                          children: u.profile,
                                                        }),
                                                      ],
                                                    }),
                                                  ],
                                                }),
                                                e.jsxs("div", {
                                                  className:
                                                    "space-y-1 leading-tight",
                                                  children: [
                                                    e.jsx("span", {
                                                      className:
                                                        "text-[9px] text-slate-400 block font-sans",
                                                      children: "USER CODE:",
                                                    }),
                                                    e.jsx("span", {
                                                      className:
                                                        "font-extrabold text-slate-900 text-lg tracking-widest bg-yellow-105 px-1.5",
                                                      children: u.username,
                                                    }),
                                                  ],
                                                }),
                                                u.password !== u.username &&
                                                  e.jsxs("div", {
                                                    className:
                                                      "pt-1 mt-1 border-t border-dotted border-slate-200",
                                                    children: [
                                                      e.jsx("span", {
                                                        className:
                                                          "text-[9px] text-slate-400 block font-sans",
                                                        children:
                                                          "PASSWORD SPEEDLIMIT:",
                                                      }),
                                                      e.jsx("span", {
                                                        className:
                                                          "font-bold text-slate-800 text-[11px] font-mono select-all",
                                                        children: u.password,
                                                      }),
                                                    ],
                                                  }),
                                                e.jsx("div", {
                                                  className:
                                                    "text-[7.5px] text-slate-400 uppercase font-sans mt-1",
                                                  children:
                                                    "Gunting rapi batas putus-putus",
                                                }),
                                              ],
                                            },
                                            _,
                                          )
                                        : Xe === "badge"
                                          ? e.jsxs(
                                              "div",
                                              {
                                                className:
                                                  "border border-slate-200 rounded-2xl bg-gradient-to-r from-blue-700 via-indigo-700 to-blue-800 text-white shadow-md p-3 relative overflow-hidden font-sans",
                                                children: [
                                                  e.jsx("div", {
                                                    className:
                                                      "absolute -bottom-6 -right-6 w-14 h-14 bg-white/10 rounded-full",
                                                  }),
                                                  e.jsx("div", {
                                                    className:
                                                      "absolute -top-6 -left-6 w-12 h-12 bg-white/10 rounded-full",
                                                  }),
                                                  e.jsxs("div", {
                                                    className:
                                                      "text-center space-y-2.5 relative z-10",
                                                    children: [
                                                      e.jsxs("div", {
                                                        className:
                                                          "flex items-center justify-between text-[8px] font-bold uppercase tracking-widest opacity-80 border-b border-white/20 pb-1",
                                                        children: [
                                                          e.jsxs("div", {
                                                            className:
                                                              "flex items-center gap-1",
                                                            children: [
                                                              Fe &&
                                                                e.jsx("img", {
                                                                  src: Fe,
                                                                  alt: "Logo",
                                                                  className:
                                                                    "w-4 h-4 rounded-full bg-white/20 object-contain p-0.5",
                                                                  referrerPolicy:
                                                                    "no-referrer",
                                                                }),
                                                              e.jsx("span", {
                                                                children:
                                                                  "Jaya Net WiFi",
                                                              }),
                                                            ],
                                                          }),
                                                          e.jsx("span", {
                                                            className:
                                                              "bg-white/20 px-1.5 py-0.5 rounded text-emerald-300 font-bold",
                                                            children: u.profile,
                                                          }),
                                                        ],
                                                      }),
                                                      e.jsxs("div", {
                                                        className:
                                                          "bg-white text-slate-800 rounded-xl p-2 font-mono text-xs shadow-inner space-y-1",
                                                        children: [
                                                          e.jsxs("div", {
                                                            className:
                                                              "text-center",
                                                            children: [
                                                              e.jsx("span", {
                                                                className:
                                                                  "text-[8px] text-slate-400 font-sans block uppercase font-bold tracking-tight",
                                                                children:
                                                                  "Kode Voucher (Login)",
                                                              }),
                                                              e.jsx("span", {
                                                                className:
                                                                  "text-sm font-black tracking-widest text-indigo-700 select-all",
                                                                children:
                                                                  u.username,
                                                              }),
                                                            ],
                                                          }),
                                                          u.password !==
                                                            u.username &&
                                                            e.jsxs("div", {
                                                              className:
                                                                "border-t border-slate-100 pt-0.5 mt-0.5 text-center",
                                                              children: [
                                                                e.jsx("span", {
                                                                  className:
                                                                    "text-[8px] text-slate-400 font-sans block uppercase font-bold",
                                                                  children:
                                                                    "Password",
                                                                }),
                                                                e.jsx("span", {
                                                                  className:
                                                                    "text-[11px] font-bold text-slate-800 select-all",
                                                                  children:
                                                                    u.password,
                                                                }),
                                                              ],
                                                            }),
                                                        ],
                                                      }),
                                                      e.jsx("p", {
                                                        className:
                                                          "text-[8.5px] text-white/70 italic text-center leading-none",
                                                        children:
                                                          "Hubungkan ke WiFi & Gosok disini",
                                                      }),
                                                    ],
                                                  }),
                                                ],
                                              },
                                              _,
                                            )
                                          : Xe === "minimal"
                                            ? e.jsxs(
                                                "div",
                                                {
                                                  className:
                                                    "p-3 border border-slate-200 rounded-xl bg-slate-50 text-slate-800 flex gap-2.5 w-full font-sans items-center relative hover:bg-slate-100 transition-colors",
                                                  children: [
                                                    e.jsx("div", {
                                                      className:
                                                        "w-11 h-11 bg-white border border-slate-200 flex-shrink-0 flex flex-col items-center justify-center p-1 rounded-lg",
                                                      children: e.jsx("div", {
                                                        className:
                                                          "grid grid-cols-4 gap-0.5 w-full h-full opacity-60",
                                                        children: [
                                                          ...Array(16),
                                                        ].map((Ce, ct) =>
                                                          e.jsx(
                                                            "div",
                                                            {
                                                              className: `w-full h-full ${ct % 3 === 0 || ct % 5 === 1 ? "bg-slate-900" : "bg-transparent"}`,
                                                            },
                                                            ct,
                                                          ),
                                                        ),
                                                      }),
                                                    }),
                                                    e.jsxs("div", {
                                                      className:
                                                        "flex-1 text-left min-w-0 font-sans space-y-0.5",
                                                      children: [
                                                        e.jsxs("div", {
                                                          className:
                                                            "flex justify-between items-center",
                                                          children: [
                                                            e.jsx("span", {
                                                              className:
                                                                "text-[8.5px] font-extrabold text-slate-500 uppercase truncate leading-none",
                                                              children:
                                                                u.profile,
                                                            }),
                                                            e.jsxs("div", {
                                                              className:
                                                                "flex items-center gap-1",
                                                              children: [
                                                                Fe &&
                                                                  e.jsx("img", {
                                                                    src: Fe,
                                                                    alt: "Logo",
                                                                    className:
                                                                      "w-3.5 h-3.5 object-contain rounded-xs",
                                                                    referrerPolicy:
                                                                      "no-referrer",
                                                                  }),
                                                                e.jsx("span", {
                                                                  className:
                                                                    "text-[8px] bg-indigo-50 text-indigo-700 font-bold px-1 rounded-sm leading-none",
                                                                  children:
                                                                    "Hotspot",
                                                                }),
                                                              ],
                                                            }),
                                                          ],
                                                        }),
                                                        e.jsxs("div", {
                                                          className:
                                                            "text-[11px] font-mono leading-tight",
                                                          children: [
                                                            e.jsx("span", {
                                                              className:
                                                                "text-slate-405 font-sans",
                                                              children: "Kode:",
                                                            }),
                                                            " ",
                                                            e.jsx("strong", {
                                                              className:
                                                                "text-slate-900 select-all text-xs font-black font-mono",
                                                              children:
                                                                u.username,
                                                            }),
                                                          ],
                                                        }),
                                                        u.password !==
                                                          u.username &&
                                                          e.jsxs("div", {
                                                            className:
                                                              "text-[9.5px] font-mono leading-tight",
                                                            children: [
                                                              e.jsx("span", {
                                                                className:
                                                                  "text-slate-405 font-sans",
                                                                children:
                                                                  "Pass:",
                                                              }),
                                                              " ",
                                                              e.jsx("span", {
                                                                className:
                                                                  "text-slate-700 font-bold select-all",
                                                                children:
                                                                  u.password,
                                                              }),
                                                            ],
                                                          }),
                                                      ],
                                                    }),
                                                  ],
                                                },
                                                _,
                                              )
                                            : e.jsxs(
                                                "div",
                                                {
                                                  className:
                                                    "p-3.5 border border-slate-200 rounded-xl bg-amber-50/20 text-center font-mono text-xs space-y-1.5 relative shadow-sm hover:border-slate-300",
                                                  children: [
                                                    e.jsxs("div", {
                                                      className:
                                                        "flex items-center justify-center gap-1.5 mb-1.5",
                                                      children: [
                                                        Fe &&
                                                          e.jsx("img", {
                                                            src: Fe,
                                                            alt: "Logo",
                                                            className:
                                                              "w-4 h-4 object-contain rounded bg-white p-0.5 border shadow-3xs",
                                                            referrerPolicy:
                                                              "no-referrer",
                                                          }),
                                                        e.jsx("p", {
                                                          className:
                                                            "font-sans font-extrabold text-slate-800 text-[11px] leading-none",
                                                          children: u.profile,
                                                        }),
                                                      ],
                                                    }),
                                                    e.jsxs("div", {
                                                      className:
                                                        "p-1 px-1.5 bg-slate-900 text-amber-400 font-bold block rounded-md text-center text-xs select-all",
                                                      children: [
                                                        "Code: ",
                                                        u.username,
                                                      ],
                                                    }),
                                                    u.password !== u.username &&
                                                      e.jsxs("p", {
                                                        className:
                                                          "text-[9.5px] text-slate-450 font-sans",
                                                        children: [
                                                          "Pass: ",
                                                          e.jsx("span", {
                                                            className:
                                                              "font-mono font-bold text-slate-800 select-all",
                                                            children:
                                                              u.password,
                                                          }),
                                                        ],
                                                      }),
                                                  ],
                                                },
                                                _,
                                              ),
                                    ),
                                  }),
                                ],
                              }),
                          ],
                        }),
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3",
                        children: [
                          e.jsx("div", {
                            className:
                              "border-b pb-2 flex justify-between items-center",
                            children: e.jsxs("div", {
                              children: [
                                e.jsx("h3", {
                                  className:
                                    "text-xs font-extrabold text-slate-800 uppercase tracking-widest",
                                  children:
                                    "Aktif Hotspot User Database & Voucher Security",
                                }),
                                e.jsx("p", {
                                  className: "text-[10px] text-slate-400",
                                  children:
                                    "Keamanan Anti-Share MAC Address Binding",
                                }),
                              ],
                            }),
                          }),
                          e.jsxs("div", {
                            className:
                              "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-700 font-mono",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "p-2.5 bg-slate-100/60 font-bold grid grid-cols-12 gap-2 text-slate-600 text-xs font-sans",
                                children: [
                                  e.jsx("div", {
                                    className: "col-span-3",
                                    children: "User & Pass",
                                  }),
                                  e.jsx("div", {
                                    className: "col-span-3",
                                    children: "Profil Kecepatan",
                                  }),
                                  e.jsx("div", {
                                    className: "col-span-4",
                                    children: "Proteksi Lock MAC",
                                  }),
                                  e.jsx("div", {
                                    className: "col-span-2 text-right",
                                    children: "Aksi Operator",
                                  }),
                                ],
                              }),
                              ee.length === 0
                                ? e.jsx("p", {
                                    className:
                                      "p-4 text-center text-slate-400 font-sans text-xs",
                                    children:
                                      "Belum ada user database terdaftar.",
                                  })
                                : ee.map((u) =>
                                    e.jsxs(
                                      "div",
                                      {
                                        className:
                                          "p-2.5 grid grid-cols-12 gap-2 items-center hover:bg-white transition-colors text-[11px] font-mono",
                                        children: [
                                          e.jsxs("div", {
                                            className:
                                              "col-span-3 font-sans space-y-0.5",
                                            children: [
                                              e.jsx("span", {
                                                className:
                                                  "font-extrabold text-slate-800 text-xs tracking-wider block font-mono bg-slate-100 px-1 py-0.5 rounded w-fit select-all",
                                                children: u.username,
                                              }),
                                              u.password &&
                                                u.password !== u.username &&
                                                e.jsxs("p", {
                                                  className:
                                                    "text-[9px] text-slate-450 font-sans font-semibold",
                                                  children: [
                                                    "Password: ",
                                                    e.jsx("span", {
                                                      className:
                                                        "font-bold text-slate-700 font-mono select-all",
                                                      children: u.password,
                                                    }),
                                                  ],
                                                }),
                                            ],
                                          }),
                                          e.jsx("div", {
                                            className:
                                              "col-span-3 font-sans font-bold text-slate-700",
                                            children: u.profile,
                                          }),
                                          e.jsx("div", {
                                            className:
                                              "col-span-4 font-sans flex flex-col gap-0.5",
                                            children: u.lock_mac
                                              ? e.jsxs(e.Fragment, {
                                                  children: [
                                                    e.jsxs("span", {
                                                      className:
                                                        "text-[10px] font-extrabold text-blue-650 flex items-center gap-1",
                                                      children: [
                                                        e.jsx("span", {
                                                          className:
                                                            "inline-block w-1.5 h-1.5 rounded-full bg-blue-600 animate-pulse",
                                                        }),
                                                        "🔒 Kunci MAC HP Aktif",
                                                      ],
                                                    }),
                                                    u.mac_address
                                                      ? e.jsx("div", {
                                                          className:
                                                            "flex items-center gap-1.5",
                                                          children: e.jsx(
                                                            "span",
                                                            {
                                                              className:
                                                                "font-mono text-[9.5px] bg-sky-50 border border-sky-100 px-1 rounded text-sky-850 font-bold tracking-wider select-all",
                                                              children:
                                                                u.mac_address,
                                                            },
                                                          ),
                                                        })
                                                      : e.jsx("span", {
                                                          className:
                                                            "text-[9.5px] text-slate-450 bg-slate-100/70 border border-slate-150 px-1 py-0.5 rounded w-fit italic",
                                                          children:
                                                            "Menunggu HP pertama login...",
                                                        }),
                                                  ],
                                                })
                                              : e.jsxs("span", {
                                                  className:
                                                    "text-[10px] text-slate-450 font-medium flex items-center gap-1",
                                                  children: [
                                                    e.jsx("span", {
                                                      className:
                                                        "inline-block w-1.5 h-1.5 rounded-full bg-slate-300",
                                                    }),
                                                    "Bebas (Bisa ganti HP)",
                                                  ],
                                                }),
                                          }),
                                          e.jsx("div", {
                                            className:
                                              "col-span-2 text-right font-sans flex justify-end gap-1.5",
                                            children:
                                              w !== "Customer" &&
                                              w !== "Technician" &&
                                              e.jsxs(e.Fragment, {
                                                children: [
                                                  e.jsx("button", {
                                                    onClick: () => bl(u.id),
                                                    className: `px-2 py-1 text-[9px] font-bold rounded cursor-pointer transition-colors shadow-sm ${u.lock_mac ? "bg-slate-250 text-slate-700 hover:bg-slate-300" : "bg-blue-600 text-white hover:bg-blue-550"}`,
                                                    title: u.lock_mac
                                                      ? "Matikan proteksi kunci HP"
                                                      : "Aktifkan proteksi kunci HP",
                                                    children: u.lock_mac
                                                      ? "Matikan Kunci"
                                                      : "Kunci HP",
                                                  }),
                                                  u.mac_address &&
                                                    e.jsx("button", {
                                                      onClick: () => vl(u.id),
                                                      className:
                                                        "px-2 py-1 text-[9px] font-extrabold bg-amber-50 hover:bg-amber-100 text-amber-700 border border-amber-200 rounded cursor-pointer transition-colors shadow-sm",
                                                      title:
                                                        "Reset MAC HP agar bisa login di HP lain (akan mengunci kembali)",
                                                      children: "Reset HP",
                                                    }),
                                                  e.jsx("button", {
                                                    onClick: () =>
                                                      dr(u.id, u.username),
                                                    className:
                                                      "px-2 py-1 text-[9px] font-bold bg-rose-50 hover:bg-rose-100 text-rose-650 border border-rose-200 rounded cursor-pointer transition-colors shadow-sm",
                                                    title:
                                                      "Hapus voucher ini secara permanen",
                                                    children: "Hapus",
                                                  }),
                                                ],
                                              }),
                                          }),
                                        ],
                                      },
                                      u.id,
                                    ),
                                  ),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3",
                        children: [
                          e.jsxs("div", {
                            className:
                              "border-b pb-2 flex justify-between items-center",
                            children: [
                              e.jsxs("h3", {
                                className:
                                  "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                                children: [
                                  e.jsx(du, {
                                    className: "h-4 w-4 text-blue-600",
                                  }),
                                  e.jsx("span", {
                                    children:
                                      "Daftar IP Bindings (Bypass MAC Address / Static)",
                                  }),
                                ],
                              }),
                              w !== "Customer" &&
                                w !== "Technician" &&
                                e.jsxs("button", {
                                  onClick: () => z(!0),
                                  className:
                                    "px-2.5 py-1 bg-blue-605 hover:bg-blue-500 text-white font-bold rounded text-[10px] cursor-pointer flex items-center gap-1 shadow-sm",
                                  children: [
                                    e.jsx(jn, { className: "h-3 w-3" }),
                                    e.jsx("span", {
                                      children: "User Bypass (Binding)",
                                    }),
                                  ],
                                }),
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-700 font-mono",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "p-2 bg-slate-100/60 font-bold grid grid-cols-5 gap-2 text-slate-600 text-xs font-sans",
                                children: [
                                  e.jsx("span", { children: "MAC Address" }),
                                  e.jsx("span", { children: "IP Address" }),
                                  e.jsx("span", { children: "Tipe Binding" }),
                                  e.jsx("span", { children: "Komentar" }),
                                  e.jsx("span", { children: "Aksi" }),
                                ],
                              }),
                              Te.map((u) =>
                                e.jsxs(
                                  "div",
                                  {
                                    className:
                                      "p-2.5 grid grid-cols-5 gap-2 items-center hover:bg-white transition-colors text-[11px]",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-800 font-bold",
                                        children: u.mac_address,
                                      }),
                                      e.jsx("span", {
                                        children: u.ip_address || "any",
                                      }),
                                      e.jsx("span", {
                                        children: e.jsx("span", {
                                          className: `text-[9px] font-bold px-1.5 py-0.5 rounded uppercase ${u.type === "bypassed" ? "bg-green-50 text-green-600 border border-green-200" : u.type === "blocked" ? "bg-rose-50 text-rose-600 border border-rose-200" : "bg-slate-105 text-slate-500 border"}`,
                                          children: u.type,
                                        }),
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "font-sans text-slate-500 truncate",
                                        children: u.comment,
                                      }),
                                      e.jsx("div", {
                                        children:
                                          w !== "Customer" &&
                                          w !== "Technician" &&
                                          e.jsxs("button", {
                                            onClick: () => Ms(u.id),
                                            className:
                                              "text-rose-600 hover:text-rose-500 font-bold text-[10px] uppercase font-sans cursor-pointer flex items-center gap-1 shrink-0",
                                            children: [
                                              e.jsx(ms, {
                                                className: "h-2.5 w-2.5",
                                              }),
                                              e.jsx("span", {
                                                children: "Hapus",
                                              }),
                                            ],
                                          }),
                                      }),
                                    ],
                                  },
                                  u.id,
                                ),
                              ),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3",
                        children: [
                          e.jsx("div", {
                            className:
                              "border-b pb-2 flex justify-between items-center",
                            children: e.jsxs("h3", {
                              className:
                                "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                              children: [
                                e.jsx(cu, {
                                  className: "h-4 w-4 text-orange-600",
                                }),
                                e.jsx("span", {
                                  children:
                                    "Hotspot Hosts (Active Clients List)",
                                }),
                              ],
                            }),
                          }),
                          e.jsxs("div", {
                            className:
                              "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-705 font-mono",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "p-2 bg-slate-100/60 font-bold grid grid-cols-4 gap-2 text-slate-600 text-xs font-sans",
                                children: [
                                  e.jsx("span", { children: "MAC Address" }),
                                  e.jsx("span", { children: "IP Address" }),
                                  e.jsx("span", { children: "Uptime" }),
                                  e.jsx("span", { children: "Status Hotspot" }),
                                ],
                              }),
                              me.map((u) =>
                                e.jsxs(
                                  "div",
                                  {
                                    className:
                                      "p-2.5 grid grid-cols-4 gap-2 items-center hover:bg-white transition-colors",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-800 font-bold",
                                        children: u.mac_address,
                                      }),
                                      e.jsx("span", { children: u.ip_address }),
                                      e.jsx("span", { children: u.uptime }),
                                      e.jsx("span", {
                                        children: e.jsx("span", {
                                          className: `text-[10px] font-bold px-1.5 py-0.5 rounded capitalize ${u.status === "bypassed" ? "bg-green-50 text-green-600" : u.status === "authorized" ? "bg-blue-50 text-blue-600" : "bg-slate-100 text-slate-500"}`,
                                          children: u.status,
                                        }),
                                      }),
                                    ],
                                  },
                                  u.id,
                                ),
                              ),
                            ],
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-4",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl space-y-4 shadow-sm text-xs",
                        children: [
                          e.jsxs("div", {
                            className:
                              "border-b pb-2 flex justify-between items-center",
                            children: [
                              e.jsxs("h3", {
                                className:
                                  "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                                children: [
                                  e.jsx(pu, {
                                    className: "h-4 w-4 text-emerald-600",
                                  }),
                                  e.jsx("span", {
                                    children: "Laporan Penjualan Voucher",
                                  }),
                                ],
                              }),
                              Re.length > 0 &&
                                e.jsx("button", {
                                  onClick: cn,
                                  className:
                                    "text-[10px] text-rose-600 hover:underline font-bold cursor-pointer",
                                  children: "Reset Log",
                                }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "grid grid-cols-2 gap-2",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "p-2.5 bg-emerald-50/55 border border-emerald-100 rounded-lg text-center",
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "text-[9px] font-bold text-emerald-800 uppercase block tracking-wider",
                                    children: "Total Omset",
                                  }),
                                  e.jsxs("strong", {
                                    className:
                                      "text-sm font-black text-emerald-700",
                                    children: [
                                      "Rp ",
                                      Re.reduce(
                                        (u, _) => u + (_.price || 0),
                                        0,
                                      ).toLocaleString("id-ID"),
                                    ],
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className:
                                  "p-2.5 bg-blue-50/55 border border-blue-100 rounded-lg text-center",
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "text-[9px] font-bold text-blue-800 uppercase block tracking-wider",
                                    children: "Voucher Ritel",
                                  }),
                                  e.jsxs("strong", {
                                    className:
                                      "text-sm font-black text-blue-700",
                                    children: [Re.length, " Pcs"],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsx("div", {
                            className:
                              "space-y-2 max-h-[290px] overflow-y-auto pr-1",
                            children:
                              Re.length === 0
                                ? e.jsx("p", {
                                    className:
                                      "text-center text-slate-400 py-4 italic text-[11px]",
                                    children: "Belum ada data penjualan.",
                                  })
                                : Re.map((u) => {
                                    var _;
                                    return e.jsxs(
                                      "div",
                                      {
                                        className:
                                          "p-2.5 bg-slate-50 border border-slate-150 rounded-lg hover:border-slate-300 transition-colors space-y-1 text-[11px]",
                                        children: [
                                          e.jsxs("div", {
                                            className:
                                              "flex justify-between items-center font-bold",
                                            children: [
                                              e.jsx("span", {
                                                className:
                                                  "font-mono text-blue-600 font-extrabold",
                                                children: u.code,
                                              }),
                                              e.jsxs("span", {
                                                className:
                                                  "text-emerald-700 font-extrabold font-sans",
                                                children: [
                                                  "Rp ",
                                                  ((_ = u.price) == null
                                                    ? void 0
                                                    : _.toLocaleString(
                                                        "id-ID",
                                                      )) || 0,
                                                ],
                                              }),
                                            ],
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "flex justify-between items-center text-[10px] text-slate-500 font-sans",
                                            children: [
                                              e.jsxs("span", {
                                                children: [
                                                  "Profile: ",
                                                  u.profile,
                                                ],
                                              }),
                                              e.jsx("span", {
                                                className:
                                                  "font-mono opacity-85",
                                                children: u.sold_at
                                                  ? new Date(
                                                      u.sold_at,
                                                    ).toLocaleTimeString(
                                                      "id-ID",
                                                      {
                                                        hour: "2-digit",
                                                        minute: "2-digit",
                                                      },
                                                    )
                                                  : "-",
                                              }),
                                            ],
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "text-[9px] text-slate-400 font-sans uppercase",
                                            children: [
                                              "Pembayaran: ",
                                              e.jsx("span", {
                                                className:
                                                  "font-bold text-slate-600",
                                                children:
                                                  u.buy_method || "Tunai",
                                              }),
                                            ],
                                          }),
                                        ],
                                      },
                                      u.id,
                                    );
                                  }),
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm text-xs",
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1",
                            children: [
                              e.jsx(eo, {
                                className: "h-4 w-4 text-orange-500",
                              }),
                              e.jsx("span", { children: "Sesi Hotspot Aktif" }),
                            ],
                          }),
                          e.jsx("div", {
                            className: "space-y-2.5",
                            children: T.map((u) =>
                              e.jsxs(
                                "div",
                                {
                                  className:
                                    "p-2.5 bg-slate-50 border border-slate-150 rounded-lg font-mono",
                                  children: [
                                    e.jsx("p", {
                                      className:
                                        "font-sans font-extrabold text-slate-800 text-[11px]",
                                      children: u.username,
                                    }),
                                    e.jsxs("div", {
                                      className:
                                        "flex justify-between items-center text-[10px] text-slate-500 mt-1",
                                      children: [
                                        e.jsxs("span", {
                                          children: [
                                            "DL: ",
                                            Pn(u.download_usage),
                                          ],
                                        }),
                                        e.jsxs("span", {
                                          children: [
                                            "UL: ",
                                            Pn(u.upload_usage),
                                          ],
                                        }),
                                      ],
                                    }),
                                  ],
                                },
                                u.id,
                              ),
                            ),
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
            ae === "profiles-config" &&
              e.jsxs("div", {
                className:
                  "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
                children: [
                  e.jsxs("div", {
                    className: "lg:col-span-2 space-y-6",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                        children: [
                          e.jsxs("div", {
                            className:
                              "flex justify-between items-center border-b pb-2 border-slate-200",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsx("h3", {
                                    className:
                                      "text-xs font-extrabold text-slate-800 uppercase tracking-widest",
                                    children:
                                      "Konfigurasi Profil Hotspot & Aturan Masa Aktif (Session Timeouts)",
                                  }),
                                  e.jsx("p", {
                                    className:
                                      "text-[10px] text-slate-400 font-sans mt-0.5",
                                    children:
                                      "Definisikan session timeout, keepalive, idle timeout, dan batas shared-users MikroTik RouterOS.",
                                  }),
                                ],
                              }),
                              w !== "Customer" &&
                                w !== "Technician" &&
                                e.jsxs("button", {
                                  onClick: () => O(!0),
                                  className:
                                    "px-2.5 py-1.5 bg-emerald-600 hover:bg-emerald-500 text-white font-extrabold rounded-lg text-[10px] cursor-pointer shadow-sm flex items-center gap-1",
                                  children: [
                                    e.jsx(jn, { className: "h-3 w-3" }),
                                    e.jsx("span", { children: "Profil Baru" }),
                                  ],
                                }),
                              e.jsxs("div", {
                                className:
                                  "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-700 font-mono",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "p-2.5 bg-slate-100/60 font-bold grid grid-cols-6 gap-2 text-slate-600 text-[10px] font-sans uppercase",
                                    children: [
                                      e.jsx("span", {
                                        children: "Nama Profil",
                                      }),
                                      e.jsx("span", { children: "Rate Limit" }),
                                      e.jsx("span", {
                                        children: "Durasi Sesi",
                                      }),
                                      e.jsx("span", {
                                        children: "Masa Aktif Akun",
                                      }),
                                      e.jsx("span", {
                                        children: "Shared User",
                                      }),
                                      e.jsx("span", {
                                        children: "Tarif Ritel",
                                      }),
                                    ],
                                  }),
                                  be.map((u) =>
                                    e.jsxs(
                                      "div",
                                      {
                                        className:
                                          "p-2.5 grid grid-cols-6 gap-2 items-center hover:bg-white transition-colors text-[11px]",
                                        children: [
                                          e.jsx("span", {
                                            className:
                                              "font-sans font-extrabold text-slate-800",
                                            children: u.name,
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-blue-600 font-bold",
                                            children: u.rate_limit,
                                          }),
                                          e.jsxs("span", {
                                            className: "text-slate-900",
                                            children: [
                                              u.validity,
                                              " (Limit Uptime)",
                                            ],
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-amber-700 font-bold",
                                            children: u.grace_period || "30d",
                                          }),
                                          e.jsxs("span", {
                                            className:
                                              "font-bold text-slate-700",
                                            children: [
                                              u.shared_users || 1,
                                              " Device(s)",
                                            ],
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "flex items-center justify-between font-sans",
                                            children: [
                                              e.jsxs("span", {
                                                className:
                                                  "font-bold text-emerald-600",
                                                children: [
                                                  "Rp ",
                                                  u.price.toLocaleString(
                                                    "id-ID",
                                                  ),
                                                ],
                                              }),
                                              w !== "Customer" &&
                                                w !== "Technician" &&
                                                e.jsx("button", {
                                                  onClick: () => cr(u.id),
                                                  className:
                                                    "p-1 hover:bg-rose-50 rounded text-rose-600 shrink-0 cursor-pointer ml-1",
                                                  title: "Hapus Profil Hotspot",
                                                  children: e.jsx(ms, {
                                                    className: "h-3.5 w-3.5",
                                                  }),
                                                }),
                                            ],
                                          }),
                                        ],
                                      },
                                      u.id,
                                    ),
                                  ),
                                ],
                              }),
                              "     ",
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "p-3 bg-blue-50/60 border rounded-lg text-slate-700 text-[11px] font-sans leading-relaxed",
                            children: [
                              e.jsx("strong", {
                                children: "Informasi Session Timeout:",
                              }),
                              " Saat durasi session timeout tercapai, RouterOS secara otomatis melepas autentikasi client, meminta kode voucher baru dimasukkan kembali, atau memicu halaman checkout captive portal.",
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                        children: [
                          e.jsx("div", {
                            className:
                              "flex justify-between items-center border-b pb-2 border-slate-200",
                            children: e.jsxs("div", {
                              children: [
                                e.jsxs("h3", {
                                  className:
                                    "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                                  children: [
                                    e.jsx(ao, {
                                      className: "h-4 w-4 text-emerald-600",
                                    }),
                                    e.jsx("span", {
                                      children:
                                        "Walled Garden List rules database (Bypass Aturan Domain Bebas)",
                                    }),
                                  ],
                                }),
                                e.jsx("p", {
                                  className:
                                    "text-[10px] text-slate-400 font-sans mt-0.5",
                                  children:
                                    "Situs gratis bebas akses sebelum pengguna memasukan atau login memakai voucher (Contoh: payment check, portal bank, WhatsApp, atau dns gateway).",
                                }),
                              ],
                            }),
                          }),
                          w !== "Customer" &&
                            w !== "Technician" &&
                            e.jsxs("form", {
                              onSubmit: (u) => {
                                (u.preventDefault(),
                                  Me.domain &&
                                    (ge((_) => [
                                      ..._,
                                      {
                                        id: _.length + 1,
                                        domain: Me.domain,
                                        action: Me.action,
                                        description:
                                          Me.description || "Bypass rules",
                                      },
                                    ]),
                                    mt({
                                      domain: "",
                                      action: "allow",
                                      description: "",
                                    }),
                                    $(
                                      "Aturan Walled Garden baru berhasil di-push ke RouterOS!",
                                    )));
                              },
                              className:
                                "grid grid-cols-1 sm:grid-cols-4 gap-3 bg-slate-50 p-3 rounded-xl border border-slate-200 text-xs text-slate-700",
                              children: [
                                e.jsxs("div", {
                                  className: "space-y-1",
                                  children: [
                                    e.jsx("label", {
                                      className:
                                        "font-extrabold text-slate-500",
                                      children: "Domain / DNS Host *",
                                    }),
                                    e.jsx("input", {
                                      type: "text",
                                      required: !0,
                                      placeholder: "e.g. *.bca.co.id",
                                      value: Me.domain,
                                      onChange: (u) =>
                                        mt({ ...Me, domain: u.target.value }),
                                      className:
                                        "w-full p-2 bg-white border rounded outline-none font-mono",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className: "space-y-1",
                                  children: [
                                    e.jsx("label", {
                                      className:
                                        "font-extrabold text-slate-500",
                                      children: "Keterangan / Tujuan",
                                    }),
                                    e.jsx("input", {
                                      type: "text",
                                      placeholder: "e.g. Portal Bank Bayar",
                                      value: Me.description,
                                      onChange: (u) =>
                                        mt({
                                          ...Me,
                                          description: u.target.value,
                                        }),
                                      className:
                                        "w-full p-2 bg-white border rounded outline-none",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className: "space-y-1",
                                  children: [
                                    e.jsx("label", {
                                      className:
                                        "font-extrabold text-slate-500",
                                      children: "Aksi Aturan",
                                    }),
                                    e.jsxs("select", {
                                      value: Me.action,
                                      onChange: (u) =>
                                        mt({ ...Me, action: u.target.value }),
                                      className:
                                        "w-full p-2 bg-white border rounded outline-none cursor-pointer font-bold",
                                      children: [
                                        e.jsx("option", {
                                          value: "allow",
                                          children: "ALLOW (Bypass Bebas)",
                                        }),
                                        e.jsx("option", {
                                          value: "deny",
                                          children: "DENY (Blokir Penuh)",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                                e.jsx("div", {
                                  className: "flex items-end",
                                  children: e.jsx("button", {
                                    type: "submit",
                                    className:
                                      "w-full py-2 bg-slate-900 text-white font-extrabold rounded-lg text-[11px] hover:bg-slate-800 transition-all cursor-pointer shadow-sm",
                                    children: "+ Push ke OLT/Router",
                                  }),
                                }),
                              ],
                            }),
                          e.jsxs("div", {
                            className:
                              "bg-slate-50 border border-slate-200 rounded-lg overflow-hidden divide-y text-xs text-slate-750 font-mono",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "p-2 bg-slate-100 font-bold grid grid-cols-4 gap-2 text-slate-600 text-[10px] font-sans uppercase",
                                children: [
                                  e.jsx("span", {
                                    children: "Bypass Target [Dst-Host]",
                                  }),
                                  e.jsx("span", { children: "Aksi / Rule" }),
                                  e.jsx("span", {
                                    children: "Keterangan Bypass",
                                  }),
                                  e.jsx("span", { children: "Aksi Manajer" }),
                                ],
                              }),
                              Mt.map((u) =>
                                e.jsxs(
                                  "div",
                                  {
                                    className:
                                      "p-2.5 grid grid-cols-4 gap-2 items-center hover:bg-white transition-colors",
                                    children: [
                                      e.jsx("span", {
                                        className: "font-bold text-slate-800",
                                        children: u.domain,
                                      }),
                                      e.jsx("span", {
                                        children: e.jsx("span", {
                                          className:
                                            "px-1.5 py-0.5 rounded text-[9px] font-black uppercase bg-green-50 text-green-600 border border-green-200",
                                          children: u.action,
                                        }),
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "font-sans text-slate-500 text-[11px] truncate",
                                        children: u.description,
                                      }),
                                      e.jsx("div", {
                                        children:
                                          w !== "Customer" &&
                                          w !== "Technician" &&
                                          e.jsxs("button", {
                                            onClick: () => {
                                              (ge((_) =>
                                                _.filter(
                                                  (Ce) => Ce.id !== u.id,
                                                ),
                                              ),
                                                $(
                                                  "Aturan Walled Garden berhasil dicabut.",
                                                ));
                                            },
                                            className:
                                              "text-rose-600 hover:text-rose-500 font-bold text-[10px] font-sans cursor-pointer flex items-center gap-1",
                                            children: [
                                              e.jsx(ms, {
                                                className: "h-3 w-3",
                                              }),
                                              e.jsx("span", {
                                                children: "Hapus",
                                              }),
                                            ],
                                          }),
                                      }),
                                    ],
                                  },
                                  u.id,
                                ),
                              ),
                            ],
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "space-y-4",
                    children: e.jsxs("div", {
                      className:
                        "p-4 bg-slate-900 text-white border border-slate-800 rounded-xl space-y-3 shadow-lg text-xs leading-normal",
                      children: [
                        e.jsx("h4", {
                          className:
                            "font-extrabold uppercase text-slate-350 tracking-wider",
                          children: "RouterOS API Syncer",
                        }),
                        e.jsx("p", {
                          className: "font-sans text-slate-400",
                          children:
                            "Walled Garden dipetakan menggunakan MikroTik REST API atau command SSH port 22:",
                        }),
                        e.jsx("pre", {
                          className:
                            "bg-slate-950 p-2 text-[9px] font-mono rounded text-yellow-300 border border-slate-800 overflow-x-auto whitespace-pre-wrap",
                          children:
                            '/ip hotspot walled-garden add dst-host=*.midtrans.com action=allow comment="Payment Gateway Bypass"',
                        }),
                      ],
                    }),
                  }),
                ],
              }),
            ae === "splash-page" &&
              e.jsxs("div", {
                className:
                  "grid grid-cols-1 lg:grid-cols-12 gap-6 animate-fade-in shadow-xs",
                children: [
                  e.jsxs("div", {
                    className: "lg:col-span-6 space-y-6 text-left",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-5 bg-white border border-slate-200 rounded-xl shadow-xs space-y-4",
                        children: [
                          e.jsxs("div", {
                            className:
                              "border-b pb-3 flex justify-between items-center bg-white",
                            children: [
                              e.jsxs("h3", {
                                className:
                                  "text-xs font-black text-slate-850 uppercase tracking-widest flex items-center gap-1.5",
                                children: [
                                  e.jsx(Nn, {
                                    className: "h-4 w-4 text-blue-500",
                                  }),
                                  e.jsx("span", {
                                    children:
                                      "Desain Hub & Logo Captive Portal",
                                  }),
                                ],
                              }),
                              e.jsx("span", {
                                className:
                                  "text-[9px] bg-blue-100 text-blue-800 font-bold px-2 py-0.5 rounded-full uppercase",
                                children: "Kustom Visual",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "space-y-4 text-xs text-slate-755 font-sans",
                            children: [
                              e.jsxs("div", {
                                className: "space-y-1",
                                children: [
                                  e.jsx("label", {
                                    className: "font-bold text-slate-600",
                                    children:
                                      "Judul Brand / Nama WiFi Captive *",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    value: nt.brandName,
                                    onChange: (u) =>
                                      ea({ ...nt, brandName: u.target.value }),
                                    className:
                                      "w-full p-2 bg-slate-50 border border-slate-200 outline-none rounded-lg text-xs",
                                    placeholder: "Contoh: JAYA NET HOTSPOT",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-1",
                                children: [
                                  e.jsx("label", {
                                    className: "font-bold text-slate-600",
                                    children:
                                      "Greeting / Teks Selamat Datang *",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    value: nt.welcomeText,
                                    onChange: (u) =>
                                      ea({
                                        ...nt,
                                        welcomeText: u.target.value,
                                      }),
                                    className:
                                      "w-full p-2 bg-slate-50 border border-slate-200 outline-none rounded-lg text-xs",
                                    placeholder:
                                      "Selamat datang di Portal Desa Mandiri",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "grid grid-cols-2 gap-3",
                                children: [
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className: "font-bold text-slate-600",
                                        children: "Skema Warna Tombol",
                                      }),
                                      e.jsx("div", {
                                        className:
                                          "flex gap-1.5 items-center mt-1",
                                        children: [
                                          { color: "#2563eb", name: "Blue" },
                                          { color: "#10b981", name: "Emerald" },
                                          { color: "#f97316", name: "Orange" },
                                          { color: "#8b5cf6", name: "Purple" },
                                          { color: "#ec4899", name: "Magenta" },
                                        ].map((u) =>
                                          e.jsx(
                                            "button",
                                            {
                                              type: "button",
                                              onClick: () =>
                                                ea({
                                                  ...nt,
                                                  buttonColor: u.color,
                                                }),
                                              style: {
                                                backgroundColor: u.color,
                                              },
                                              className: `h-6 w-6 rounded-full border border-white cursor-pointer transition-transform ${nt.buttonColor === u.color ? "scale-125 ring-2 ring-slate-900" : ""}`,
                                              title: u.name,
                                            },
                                            u.color,
                                          ),
                                        ),
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className: "font-bold text-slate-600",
                                        children: "Mode Autentikasi Utama",
                                      }),
                                      e.jsxs("select", {
                                        value: nt.loginOption,
                                        onChange: (u) =>
                                          ea({
                                            ...nt,
                                            loginOption: u.target.value,
                                          }),
                                        className:
                                          "w-full p-2 mt-0.5 bg-slate-50 border rounded-lg outline-none font-bold text-xs",
                                        children: [
                                          e.jsx("option", {
                                            value: "voucher-only",
                                            children: "Kode Voucher Gosok Saja",
                                          }),
                                          e.jsx("option", {
                                            value: "voucher-qris",
                                            children:
                                              "Voucher & Bayar Gateway Mandiri 💳",
                                          }),
                                          e.jsx("option", {
                                            value: "voucher-agent",
                                            children:
                                              "Voucher + Saldo Mitra Agen",
                                          }),
                                          e.jsx("option", {
                                            value: "multi-login",
                                            children:
                                              "Autentikasi Multi-Role Integrasi",
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-1",
                                children: [
                                  e.jsx("label", {
                                    className: "font-bold text-slate-600 block",
                                    children:
                                      "Informasi Garansi Bandwidth / SLA WiFi",
                                  }),
                                  e.jsx("textarea", {
                                    rows: 2,
                                    value: nt.customerSla,
                                    onChange: (u) =>
                                      ea({
                                        ...nt,
                                        customerSla: u.target.value,
                                      }),
                                    className:
                                      "w-full p-2 bg-slate-50 border border-slate-200 outline-none rounded-lg text-[11px]",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className:
                                  "p-3 bg-slate-50 border border-slate-200 rounded-xl flex items-center justify-between gap-3 font-sans",
                                children: [
                                  e.jsxs("div", {
                                    className: "flex items-center gap-2",
                                    children: [
                                      e.jsx("div", {
                                        className:
                                          "w-9 h-9 rounded bg-white border flex items-center justify-center overflow-hidden shrink-0 shadow-sm relative",
                                        children: Aa
                                          ? e.jsx("img", {
                                              src: Aa,
                                              alt: "Logo",
                                              className:
                                                "w-full h-full object-contain",
                                              referrerPolicy: "no-referrer",
                                            })
                                          : e.jsxs("div", {
                                              className:
                                                "flex flex-col items-center justify-center leading-none",
                                              children: [
                                                e.jsx(Nn, {
                                                  className:
                                                    "h-4 w-4 text-blue-500 animate-pulse",
                                                }),
                                                e.jsx("span", {
                                                  className:
                                                    "text-[6px] font-mono text-slate-400 font-extrabold text-center uppercase tracking-tighter mt-0.5",
                                                  children: "DEFAULT",
                                                }),
                                              ],
                                            }),
                                      }),
                                      e.jsxs("div", {
                                        className: "leading-tight",
                                        children: [
                                          e.jsx("span", {
                                            className:
                                              "text-[10px] font-extrabold text-slate-805 block",
                                            children: "Logo Captive Portal",
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-[8.5px] text-slate-450 block",
                                            children:
                                              "Tampil di portal login WiFi",
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className: "flex gap-2 shrink-0",
                                    children: [
                                      e.jsx("input", {
                                        id: "captive-portal-logo-upload",
                                        type: "file",
                                        accept: "image/*",
                                        className: "hidden",
                                        onChange: (u) => {
                                          var Ce;
                                          const _ =
                                            (Ce = u.target.files) == null
                                              ? void 0
                                              : Ce[0];
                                          if (_) {
                                            const ct = new FileReader();
                                            ((ct.onloadend = () => {
                                              ps(ct.result);
                                            }),
                                              ct.readAsDataURL(_));
                                          }
                                        },
                                      }),
                                      e.jsx("label", {
                                        htmlFor: "captive-portal-logo-upload",
                                        className:
                                          "px-2.5 py-1 bg-slate-900 hover:bg-slate-800 text-white font-bold rounded text-[9.5px] uppercase cursor-pointer select-none tracking-wide text-center",
                                        children: "Pilih Logo",
                                      }),
                                      Aa &&
                                        e.jsx("button", {
                                          type: "button",
                                          onClick: () => ps(null),
                                          className:
                                            "px-1.5 py-1 text-[9.5px] text-red-600 hover:text-red-700 font-bold bg-white border border-slate-200 rounded cursor-pointer",
                                          children: "Hapus",
                                        }),
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-5 bg-white border border-slate-200 rounded-xl shadow-xs space-y-4",
                        children: [
                          e.jsxs("div", {
                            className:
                              "border-b pb-2 flex justify-between items-center",
                            children: [
                              e.jsxs("h3", {
                                className:
                                  "text-xs font-black text-slate-850 uppercase tracking-widest flex items-center gap-1.5",
                                children: [
                                  e.jsx(ar, {
                                    className: "h-4 w-4 text-amber-500",
                                  }),
                                  e.jsx("span", {
                                    children:
                                      "Atur Daftar Harga Voucher di Template Login",
                                  }),
                                ],
                              }),
                              e.jsx("span", {
                                className:
                                  "bg-emerald-100 text-emerald-800 text-[8.5px] font-bold px-2 py-0.5 rounded-full uppercase",
                                children: "Sinkron Live",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-3",
                            children: [
                              e.jsx("p", {
                                className:
                                  "text-[10px] text-slate-500 leading-relaxed font-sans",
                                children:
                                  "Pelanggan / pengunjung WiFi dapat melihat daftar harga ini pada halaman splash captive portal secara instan, dan memproses order voucher online secara realtime Mandiri.",
                              }),
                              e.jsxs("div", {
                                className:
                                  "space-y-1.5 max-h-[170px] overflow-y-auto pr-1",
                                children: [
                                  ra.map((u) =>
                                    e.jsxs(
                                      "div",
                                      {
                                        className:
                                          "p-2 border border-slate-150 rounded-lg flex justify-between items-center bg-slate-50 text-[11px] font-sans",
                                        children: [
                                          e.jsxs("div", {
                                            className: "space-y-0.5",
                                            children: [
                                              e.jsxs("div", {
                                                className:
                                                  "flex items-center gap-1.5",
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "font-bold text-slate-800",
                                                    children: u.name,
                                                  }),
                                                  e.jsx("span", {
                                                    className:
                                                      "text-[9px] bg-blue-50 text-blue-700 px-1 py-0.5 rounded font-bold leading-none",
                                                    children: u.speed,
                                                  }),
                                                ],
                                              }),
                                              e.jsxs("div", {
                                                className:
                                                  "text-[10px] text-slate-450 font-mono",
                                                children: [
                                                  "Durasi Sesi: ",
                                                  e.jsx("strong", {
                                                    className: "text-slate-600",
                                                    children: u.activePeriod,
                                                  }),
                                                  " • Harga: ",
                                                  e.jsxs("strong", {
                                                    className:
                                                      "text-emerald-600",
                                                    children: [
                                                      "Rp ",
                                                      parseInt(
                                                        u.price,
                                                      ).toLocaleString("id-ID"),
                                                    ],
                                                  }),
                                                ],
                                              }),
                                            ],
                                          }),
                                          e.jsx("button", {
                                            type: "button",
                                            onClick: () => {
                                              es(
                                                ra.filter((_) => _.id !== u.id),
                                              );
                                            },
                                            className:
                                              "p-1 text-red-500 hover:text-red-700 hover:bg-red-50 rounded cursor-pointer transition-colors",
                                            title: "Hapus",
                                            children: e.jsx(ms, {
                                              className: "h-3.5 w-3.5",
                                            }),
                                          }),
                                        ],
                                      },
                                      u.id,
                                    ),
                                  ),
                                  ra.length === 0 &&
                                    e.jsx("div", {
                                      className:
                                        "text-center py-4 text-slate-400 border border-dashed rounded-lg bg-slate-50 font-mono text-[10px]",
                                      children:
                                        "Belum ada paket voucher wifi dalam daftar harga template.",
                                    }),
                                ],
                              }),
                              e.jsxs("div", {
                                className:
                                  "bg-slate-50 p-3.5 rounded-xl border border-slate-200 grid grid-cols-2 gap-2.5 text-[10.5px] font-sans",
                                children: [
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "font-bold text-slate-550 block",
                                        children: "Nama Paket WiFi",
                                      }),
                                      e.jsx("input", {
                                        type: "text",
                                        placeholder: "Contoh: Paket Hemat",
                                        value: pt,
                                        onChange: (u) => Xt(u.target.value),
                                        className:
                                          "w-full p-1.5 bg-white border rounded border-slate-300 outline-none text-[11px]",
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "font-bold text-slate-550 block",
                                        children: "Harga Jual (Rp)",
                                      }),
                                      e.jsx("input", {
                                        type: "number",
                                        placeholder: "Rp",
                                        value: Pt,
                                        onChange: (u) => Ya(u.target.value),
                                        className:
                                          "w-full p-1.5 bg-white border rounded border-slate-300 outline-none text-[11px] font-mono",
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "font-bold text-slate-550 block",
                                        children: "Batas Kecepatan (Up To)",
                                      }),
                                      e.jsx("input", {
                                        type: "text",
                                        placeholder: "Misal: 5 Mbps",
                                        value: Xa,
                                        onChange: (u) => an(u.target.value),
                                        className:
                                          "w-full p-1.5 bg-white border rounded border-slate-300 outline-none text-[11px]",
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className: "space-y-1",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "font-bold text-slate-550 block",
                                        children: "Masa Aktif Sesi",
                                      }),
                                      e.jsx("input", {
                                        type: "text",
                                        placeholder: "Misal: 12 Jam / 3 Hari",
                                        value: ws,
                                        onChange: (u) => ks(u.target.value),
                                        className:
                                          "w-full p-1.5 bg-white border rounded border-slate-300 outline-none text-[11px]",
                                      }),
                                    ],
                                  }),
                                  e.jsx("button", {
                                    type: "button",
                                    onClick: () => {
                                      if (!pt.trim() || !Pt.trim()) {
                                        alert(
                                          "Mohon isi Nama Paket dan Harga!",
                                        );
                                        return;
                                      }
                                      const u = {
                                        id: Date.now().toString(),
                                        name: pt,
                                        price: Pt,
                                        speed: Xa || "5 Mbps",
                                        activePeriod: ws || "24 Jam",
                                      };
                                      (es([...ra, u]), Xt(""), Ya("5000"));
                                    },
                                    className:
                                      "col-span-2 py-2 bg-blue-650 hover:bg-blue-600 text-white font-extrabold rounded-lg text-center cursor-pointer uppercase text-[9px] tracking-wide mt-1.5 shadow-sm",
                                    children:
                                      "+ Tambah ke Daftar Harga Template",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "lg:col-span-6 flex flex-col items-center",
                    children: e.jsxs("div", {
                      className:
                        "w-[305px] h-[620px] bg-slate-900 rounded-[40px] p-4 shadow-2xl border-4 border-slate-800 relative flex flex-col shrink-0 select-none overflow-hidden ring-4 ring-slate-950/20",
                      children: [
                        e.jsxs("div", {
                          className:
                            "absolute top-0 left-1/2 transform -translate-x-1/2 h-5 w-28 bg-slate-900 rounded-b-xl z-20 flex items-center justify-center gap-1",
                          children: [
                            e.jsx("span", {
                              className: "h-1 w-8 rounded-full bg-slate-800",
                            }),
                            e.jsx("span", {
                              className:
                                "h-1.5 w-1.5 rounded-full bg-slate-750",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "flex-1 rounded-[26px] bg-slate-950 flex flex-col relative overflow-hidden text-center justify-between py-5 px-3.5 font-sans text-xs",
                          children: [
                            e.jsxs("div", {
                              className:
                                "flex justify-between items-center text-slate-500 font-mono text-[9px] px-1.5 mb-2.5",
                              children: [
                                e.jsx("span", {
                                  className: "font-bold",
                                  children: "12:25",
                                }),
                                e.jsxs("div", {
                                  className: "flex items-center gap-1",
                                  children: [
                                    e.jsx(Nn, {
                                      className:
                                        "h-3 w-3 text-emerald-500 animate-pulse",
                                    }),
                                    e.jsx("span", {
                                      className: "font-sans",
                                      children: "JAYA_WIFI",
                                    }),
                                    e.jsx("span", { children: "88%" }),
                                  ],
                                }),
                              ],
                            }),
                            _a
                              ? e.jsxs("div", {
                                  className:
                                    "flex-1 flex flex-col items-center justify-center space-y-4 animate-fade-in p-2 text-slate-100",
                                  children: [
                                    e.jsx("div", {
                                      className:
                                        "h-14 w-14 rounded-full bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-center text-emerald-400 shadow-lg shadow-emerald-500/10",
                                      children: e.jsx(tn, {
                                        className: "h-7 w-7",
                                      }),
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("h4", {
                                          className:
                                            "font-extrabold text-xs uppercase text-emerald-400 tracking-wider",
                                          children: "KONEKSI BERHASIL!",
                                        }),
                                        e.jsx("p", {
                                          className:
                                            "text-[9px] text-slate-400 font-sans leading-relaxed",
                                          children:
                                            "Perangkat Anda berhasil diotorisasi di sistem IP Hotspot MikroTik RouterOS.",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className:
                                        "w-full bg-slate-900/80 border border-slate-800/80 rounded-xl p-3 text-left space-y-1.5 font-mono text-[9.5px] text-slate-350",
                                      children: [
                                        e.jsxs("div", {
                                          className:
                                            "flex justify-between border-b border-slate-800/85 pb-1",
                                          children: [
                                            e.jsx("span", {
                                              children: "Sisa Masa Aktif:",
                                            }),
                                            e.jsx("span", {
                                              className:
                                                "text-yellow-400 font-bold",
                                              children: "Terhitung Mundur",
                                            }),
                                          ],
                                        }),
                                        e.jsxs("div", {
                                          className:
                                            "flex justify-between border-b border-slate-800/85 pb-1",
                                          children: [
                                            e.jsx("span", {
                                              children: "Alokasi IP Client:",
                                            }),
                                            e.jsx("span", {
                                              className: "text-white",
                                              children: "192.168.88.243",
                                            }),
                                          ],
                                        }),
                                        e.jsxs("div", {
                                          className: "flex justify-between",
                                          children: [
                                            e.jsx("span", {
                                              children: "Alokasi MAC POOL:",
                                            }),
                                            e.jsx("span", {
                                              className:
                                                "text-emerald-400 font-bold",
                                              children: "Otorisasi bypass ✓",
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                    e.jsx("button", {
                                      type: "button",
                                      onClick: () => {
                                        (qt(!1), Ot(""));
                                      },
                                      className:
                                        "w-full py-2 bg-slate-800 hover:bg-slate-700 text-white font-extrabold rounded-lg text-[9.5px] transition-all cursor-pointer uppercase tracking-wider",
                                      children: "Putus Hubungan Sesi (Logout)",
                                    }),
                                  ],
                                })
                              : oa
                                ? e.jsxs("div", {
                                    className:
                                      "flex-1 flex flex-col justify-between text-left animate-fade-in text-white pt-1",
                                    children: [
                                      e.jsxs("div", {
                                        className:
                                          "bg-slate-900 border border-slate-800 rounded-xl p-3 space-y-2.5 relative",
                                        children: [
                                          e.jsx("button", {
                                            type: "button",
                                            onClick: () => {
                                              (Zt(null), ja(!1), xe(null));
                                            },
                                            className:
                                              "absolute top-2 right-2 text-slate-400 hover:text-white font-bold text-[14px]",
                                            children: "×",
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "flex items-center gap-1.5 pt-0.5",
                                            children: [
                                              e.jsxs("span", {
                                                className:
                                                  "text-[10px] font-black tracking-widest text-[#00c4ff] uppercase font-mono",
                                                children: [
                                                  Ft.provider.toUpperCase(),
                                                  " SECURE CHECKOUT",
                                                ],
                                              }),
                                              e.jsx("span", {
                                                className:
                                                  "bg-emerald-500 text-slate-950 text-[7px] font-black uppercase px-1 rounded-sm leading-none",
                                                children: "SECURE",
                                              }),
                                            ],
                                          }),
                                          e.jsx("div", {
                                            className:
                                              "h-[0.5px] bg-slate-800 w-full",
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "grid grid-cols-2 gap-1 text-[10px] leading-snug",
                                            children: [
                                              e.jsxs("div", {
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "text-slate-450 block text-[8px] uppercase",
                                                    children: "Rincian Paket:",
                                                  }),
                                                  e.jsxs("span", {
                                                    className:
                                                      "font-extrabold text-white text-[11px] block",
                                                    children: [
                                                      oa.name,
                                                      " (",
                                                      oa.speed,
                                                      ")",
                                                    ],
                                                  }),
                                                ],
                                              }),
                                              e.jsxs("div", {
                                                className: "text-right",
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "text-slate-450 block text-[8px] uppercase",
                                                    children: "Harga Bayar:",
                                                  }),
                                                  e.jsxs("span", {
                                                    className:
                                                      "font-black text-rose-400 text-[11.5px] block",
                                                    children: [
                                                      "Rp ",
                                                      parseInt(
                                                        oa.price,
                                                      ).toLocaleString("id-ID"),
                                                    ],
                                                  }),
                                                ],
                                              }),
                                            ],
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "text-[8px] font-mono text-slate-400",
                                            children: [
                                              "Invoice: ID_WIFI_INV-",
                                              Date.now().toString().slice(-6),
                                            ],
                                          }),
                                        ],
                                      }),
                                      e.jsx("div", {
                                        className:
                                          "flex-1 bg-slate-900/40 border border-dashed border-slate-850 rounded-xl my-2 p-2.5 flex flex-col justify-center items-center text-center space-y-2 relative",
                                        children: _s
                                          ? e.jsxs("div", {
                                              className:
                                                "space-y-2 text-center animate-fade-in w-full",
                                              children: [
                                                e.jsx("div", {
                                                  className:
                                                    "h-10 w-10 bg-emerald-500/20 border border-emerald-500 rounded-full flex items-center justify-center text-emerald-400 mx-auto",
                                                  children: e.jsx(tn, {
                                                    className: "h-5 w-5",
                                                  }),
                                                }),
                                                e.jsxs("div", {
                                                  children: [
                                                    e.jsx("h5", {
                                                      className:
                                                        "font-bold text-slate-100 text-[11px] uppercase tracking-wide",
                                                      children:
                                                        "Transaksi Berhasil!",
                                                    }),
                                                    e.jsx("p", {
                                                      className:
                                                        "text-[8.5px] text-slate-400 leading-normal",
                                                      children:
                                                        "Pembayaran terverifikasi via QRIS API Callback.",
                                                    }),
                                                  ],
                                                }),
                                                e.jsxs("div", {
                                                  className:
                                                    "bg-slate-950 p-2 rounded border border-slate-800 text-center font-mono space-y-1",
                                                  children: [
                                                    e.jsx("span", {
                                                      className:
                                                        "text-slate-500 text-[7.5px] block tracking-wider uppercase",
                                                      children:
                                                        "SALIN KODE VOUCHER INDIVIDUAL ANDA",
                                                    }),
                                                    e.jsx("span", {
                                                      className:
                                                        "text-yellow-300 font-extrabold text-xs tracking-widest",
                                                      children: _s,
                                                    }),
                                                  ],
                                                }),
                                                e.jsx("button", {
                                                  type: "button",
                                                  onClick: () => {
                                                    (Ot(_s),
                                                      Zt(null),
                                                      qt(!0),
                                                      xe(null));
                                                  },
                                                  style: {
                                                    backgroundColor:
                                                      nt.buttonColor,
                                                  },
                                                  className:
                                                    "w-full py-1.5 text-white font-extrabold rounded-lg text-[9.5px] uppercase cursor-pointer",
                                                  children:
                                                    "Gunakan & Hubungkan WiFi",
                                                }),
                                              ],
                                            })
                                          : ts
                                            ? e.jsxs("div", {
                                                className:
                                                  "space-y-2.5 text-center py-4",
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "h-8 w-8 rounded-full border-2 border-indigo-500 border-t-transparent animate-spin inline-block",
                                                  }),
                                                  e.jsxs("div", {
                                                    className: "space-y-0.5",
                                                    children: [
                                                      e.jsx("p", {
                                                        className:
                                                          "font-bold text-white text-[10px] animate-pulse",
                                                        children:
                                                          "Menghubungi Webhook Web API...",
                                                      }),
                                                      e.jsxs("p", {
                                                        className:
                                                          "text-[8.5px] text-slate-400",
                                                        children: [
                                                          "Verifikasi status transaksi ",
                                                          Ft.provider.toUpperCase(),
                                                          " Core",
                                                        ],
                                                      }),
                                                    ],
                                                  }),
                                                ],
                                              })
                                            : e.jsxs("div", {
                                                className:
                                                  "space-y-2 w-full animate-fade-in",
                                                children: [
                                                  e.jsx("span", {
                                                    className:
                                                      "text-[9px] text-slate-400 tracking-wider font-extrabold uppercase block",
                                                    children:
                                                      "SCAN KODE QRIS BERIKUT",
                                                  }),
                                                  e.jsx("div", {
                                                    className:
                                                      "p-2 bg-white rounded-lg inline-block shadow mx-auto",
                                                    children: e.jsx(fc, {
                                                      className:
                                                        "h-20 w-20 text-slate-900",
                                                    }),
                                                  }),
                                                  e.jsx("div", {
                                                    className:
                                                      "text-[8px] font-sans text-slate-450 leading-relaxed max-w-[210px] mx-auto",
                                                    children:
                                                      "Gunakan LinkAja, OVO, GoPay, ShopeePay, atau BCA Mobile Anda untuk memproses transaksi.",
                                                  }),
                                                  e.jsx("button", {
                                                    type: "button",
                                                    onClick: () => {
                                                      (ja(!0),
                                                        setTimeout(() => {
                                                          ja(!1);
                                                          const u =
                                                            "JV" +
                                                            Math.floor(
                                                              1e3 +
                                                                Math.random() *
                                                                  9e3,
                                                            );
                                                          xe(u);
                                                        }, 1500));
                                                    },
                                                    className:
                                                      "w-full py-1.5 mt-1 bg-emerald-500 hover:bg-emerald-600 text-slate-950 font-black rounded-lg text-[9px] uppercase tracking-wide cursor-pointer transition-all duration-150",
                                                    children:
                                                      "Simulasikan Pembayaran Sukses",
                                                  }),
                                                ],
                                              }),
                                      }),
                                      e.jsxs("div", {
                                        className:
                                          "text-[8px] text-slate-500 text-center border-t border-slate-900 pt-1 flex justify-between items-center px-1 font-mono",
                                        children: [
                                          e.jsx("span", {
                                            children: "API Version v2",
                                          }),
                                          e.jsx("span", {
                                            children:
                                              "Secure SSL 256-bit Encrypted ✓",
                                          }),
                                        ],
                                      }),
                                    ],
                                  })
                                : e.jsxs("div", {
                                    className:
                                      "flex-1 flex flex-col justify-between py-1 text-slate-200",
                                    children: [
                                      e.jsxs("div", {
                                        className:
                                          "space-y-1.5 flex flex-col items-center",
                                        children: [
                                          e.jsx("div", {
                                            className:
                                              "h-11 w-11 rounded-xl bg-slate-905 border border-slate-800 flex items-center justify-center overflow-hidden shrink-0 shadow",
                                            children: Aa
                                              ? e.jsx("img", {
                                                  src: Aa,
                                                  alt: "Logo",
                                                  className:
                                                    "w-full h-full object-contain",
                                                  referrerPolicy: "no-referrer",
                                                })
                                              : e.jsx(Nn, {
                                                  className:
                                                    "h-5 w-5 text-blue-400 animate-pulse",
                                                }),
                                          }),
                                          e.jsx("h4", {
                                            className:
                                              "text-xs font-black text-white uppercase tracking-wider leading-none mt-1",
                                            children: nt.brandName,
                                          }),
                                          e.jsx("p", {
                                            className:
                                              "text-[9px] text-slate-400 font-sans leading-tight px-1",
                                            children: nt.welcomeText,
                                          }),
                                        ],
                                      }),
                                      e.jsx("div", {
                                        className:
                                          "my-2 bg-slate-900/60 p-3 rounded-2xl border border-slate-850 space-y-2.5 text-left text-[11px]",
                                        children: e.jsxs("div", {
                                          className: "space-y-1",
                                          children: [
                                            e.jsx("label", {
                                              className:
                                                "font-bold text-slate-350 block text-[9.5px]",
                                              children:
                                                "Masuk Menggunakan Kode Voucher:",
                                            }),
                                            e.jsx("input", {
                                              type: "text",
                                              disabled: Ra,
                                              placeholder:
                                                "Ketik kode: HSPT-XXXX",
                                              value: as,
                                              onChange: (u) =>
                                                Ot(
                                                  u.target.value.toUpperCase(),
                                                ),
                                              className:
                                                "w-full p-1.5 bg-slate-950 border border-slate-800 text-yellow-300 rounded font-mono text-[10.5px] uppercase text-center outline-none",
                                            }),
                                            e.jsx("button", {
                                              type: "button",
                                              onClick: () => {
                                                if (!as) {
                                                  alert(
                                                    "Isi kode voucher terlebih dahulu!",
                                                  );
                                                  return;
                                                }
                                                (It(!0),
                                                  setTimeout(() => {
                                                    (It(!1), qt(!0));
                                                  }, 1e3));
                                              },
                                              style: {
                                                backgroundColor: nt.buttonColor,
                                              },
                                              className:
                                                "w-full py-1.5 text-white font-extrabold rounded-lg text-[10px] cursor-pointer tracking-wider shadow uppercase mt-1",
                                              children: Ra
                                                ? "Memverifikasi di RouterOS..."
                                                : "MASUK & HUBUNGKAN",
                                            }),
                                          ],
                                        }),
                                      }),
                                      e.jsxs("div", {
                                        className:
                                          "bg-slate-900/40 p-2 rounded-xl border border-slate-850/60 space-y-2 text-left",
                                        children: [
                                          e.jsx("span", {
                                            className:
                                              "text-[9px] text-indigo-300 block font-bold text-center uppercase tracking-wider",
                                            children:
                                              "🛒 Online Voucher Wifi Terintegrasi",
                                          }),
                                          e.jsxs("div", {
                                            className:
                                              "space-y-1 max-h-[140px] overflow-y-auto pr-0.5",
                                            children: [
                                              ra.map((u) =>
                                                e.jsxs(
                                                  "div",
                                                  {
                                                    className:
                                                      "p-1 px-1.5 bg-slate-950/80 border border-slate-850 rounded-lg flex items-center justify-between text-[9px] gap-1.5",
                                                    children: [
                                                      e.jsxs("div", {
                                                        className:
                                                          "leading-tight shrink-0",
                                                        children: [
                                                          e.jsx("span", {
                                                            className:
                                                              "font-bold text-white block text-[9.5px]",
                                                            children: u.name,
                                                          }),
                                                          e.jsxs("span", {
                                                            className:
                                                              "text-[8px] text-slate-400 font-mono",
                                                            children: [
                                                              "Speed ",
                                                              u.speed,
                                                              " • ",
                                                              u.activePeriod,
                                                            ],
                                                          }),
                                                        ],
                                                      }),
                                                      e.jsxs("button", {
                                                        type: "button",
                                                        onClick: () => {
                                                          (Zt(u),
                                                            ja(!1),
                                                            xe(null));
                                                        },
                                                        style: {
                                                          backgroundColor:
                                                            nt.buttonColor,
                                                        },
                                                        className:
                                                          "px-2 py-1 text-[8.5px] text-white font-bold rounded cursor-pointer leading-none text-center select-none",
                                                        children: [
                                                          "Rp ",
                                                          parseInt(
                                                            u.price,
                                                          ).toLocaleString(
                                                            "id",
                                                          ),
                                                        ],
                                                      }),
                                                    ],
                                                  },
                                                  u.id,
                                                ),
                                              ),
                                              ra.length === 0 &&
                                                e.jsx("p", {
                                                  className:
                                                    "text-center text-[8.5px] text-slate-500 py-2",
                                                  children:
                                                    "Offline payment support only.",
                                                }),
                                            ],
                                          }),
                                        ],
                                      }),
                                      e.jsxs("div", {
                                        className: "space-y-1.5 mt-2.5",
                                        children: [
                                          e.jsx("p", {
                                            className:
                                              "text-[8px] text-slate-500 bg-slate-900/40 p-1 font-sans rounded-lg leading-normal",
                                            children: nt.customerSla,
                                          }),
                                          e.jsx("p", {
                                            className:
                                              "text-[7.5px] text-slate-500 uppercase tracking-widest leading-none",
                                            children:
                                              "Powered by MikRobiL OSS/BSS Core System v1",
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                          ],
                        }),
                      ],
                    }),
                  }),
                ],
              }),
          ],
        }),
      J === "radius" && e.jsx(window.RadiusDashboard || (window.RadiusDashboard = ({ G }) => {
  const [subTab, setSubTab] = f.useState("dashboard");
  const [sessions, setSessions] = f.useState([]);
  const [profiles, setProfiles] = f.useState([]);
  const [config, setConfig] = f.useState({ server_ip: "103.111.92.12", auth_port: 1812, acct_port: 1813, secret_key: "mikrobilsecret" });
  const [testStatus, setTestStatus] = f.useState(null);
  const [testLogs, setTestLogs] = f.useState([]);
  const [testing, setTesting] = f.useState(false);
  
  const [profileForm, setProfileForm] = f.useState({ id: "", name: "", bandwidth_limit: "", expiration_date: "", package_type: "PPPoE Premium" });
  const [isEditingProfile, setIsEditingProfile] = f.useState(false);
  
  // Unique elements for the new features:
  const [adminLogs, setAdminLogs] = f.useState([]);
  const [alertHistory, setAlertHistory] = f.useState([]);
  const [alertConfig, setAlertConfig] = f.useState({ enabled: true, alertThresholdPct: 90, emailAlerts: true, telegramAlerts: false });
  const [searchQuery, setSearchQuery] = f.useState("");
  const [testClientId, setTestClientId] = f.useState("102");
  const [nasList, setNasList] = f.useState([]);
  const [selectedNasId, setSelectedNasId] = f.useState("");
  const [nasForm, setNasForm] = f.useState({ id: "", name: "", ip_address: "", secret: "", type: "Mikrotik", username: "admin", password: "", api_port: 8728, radius_source_ip: "" });
  const [isEditingNas, setIsEditingNas] = f.useState(false);

  const [toast, setToast] = f.useState(null);
  const showToast = (type, message) => {
    setToast({ type, message });
    setTimeout(() => setToast(null), 3000);
  };
  const Y = (obj) => showToast(obj.type, obj.message);

  const loadConfig = async () => {
    try {
      const configRes = await (await fetch("/api/v1/radius/config")).json();
      if (configRes.status === "success" && configRes.data) {
        setConfig({
          server_ip: configRes.data.server_ip || "103.111.92.12",
          auth_port: configRes.data.auth_port || 1812,
          acct_port: configRes.data.acct_port || 1813,
          secret_key: configRes.data.secret_key || "mikrobilsecret"
        });
      }
    } catch (err) {}
  };

  const loadAlertConfig = async () => {
    try {
      const alertsRes = await (await fetch("/api/v1/radius/alerts")).json();
      if (alertsRes.status === "success" && alertsRes.data && alertsRes.data.config) {
        setAlertConfig(alertsRes.data.config || { enabled: true, alertThresholdPct: 90, emailAlerts: true, telegramAlerts: false });
      }
    } catch (err) {}
  };

  const loadData = async () => {
    try {
      const sessRes = await (await fetch("/api/v1/radius/sessions")).json();
      if (sessRes.status === "success" && sessRes.data) setSessions(sessRes.data);
      
      const profRes = await (await fetch("/api/v1/radius/profiles")).json();
      if (profRes.status === "success" && profRes.data) setProfiles(profRes.data);
      
      const adminLogsRes = await (await fetch("/api/v1/radius/admin-logs")).json();
      if (adminLogsRes.status === "success" && adminLogsRes.data) setAdminLogs(adminLogsRes.data);
      
      const alertsRes = await (await fetch("/api/v1/radius/alerts")).json();
      if (alertsRes.status === "success" && alertsRes.data) {
        setAlertHistory(alertsRes.data.history || []);
      }

      const nasRes = await (await fetch("/api/v1/radius/nas")).json();
      if (nasRes.status === "success" && nasRes.data) {
        setNasList(nasRes.data);
        if (nasRes.data.length > 0) {
          setSelectedNasId(prev => prev || String(nasRes.data[0].id));
        }
      }
    } catch (err) {}
  };

  f.useEffect(() => {
    loadConfig();
    loadAlertConfig();
    loadData();
    const interval = setInterval(loadData, 4000);
    return () => clearInterval(interval);
  }, []);

  const handleSaveConfig = async (e) => {
    e.preventDefault();
    try {
      const res = await (await fetch("/api/v1/radius/config", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(config)
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Konfigurasi RADIUS Server berhasil disimpan!" });
        loadConfig();
        loadData();
      } else {
        Y({ type: "error", message: res.message });
      }
    } catch(err) {
      Y({ type: "error", message: "Kesalahan koneksi." });
    }
  };

  const handleTestConnection = async (nasIdToTest) => {
    const targetNasId = nasIdToTest || selectedNasId || (nasList[0] ? String(nasList[0].id) : "");
    const targetRouter = nasList.find(n => String(n.id) === String(targetNasId));
    const routerName = targetRouter ? targetRouter.name : "Router default";

    setTesting(true);
    setTestStatus(null);
    setTestLogs([
      "👉 [1/2] Memulai proses pengetesan koneksi ke router: \"" + routerName + "\"...",
      "👉 [2/2] Membuka analisis socket TCP & RADIUS..."
    ]);
    try {
      const url = targetNasId ? "/api/v1/radius/diagnose?nas_id=" + targetNasId : "/api/v1/radius/diagnose";
      const res = await (await fetch(url)).json();
      const backendLogs = res.logs ? res.logs.map(l => "[" + l.level.toUpperCase() + "] " + l.message) : [];
      if (res.success) {
        setTestLogs(backendLogs.length > 0 ? backendLogs : [
          "✓ Koneksi MikroTik API Berhasil!",
          "✓ Kredensial Login Valid!",
          "✓ Handshake RADIUS Terkonfirmasi!"
        ]);
        setTestStatus("success");
        Y({ type: "success", message: "Koneksi ke MikroTik \"" + routerName + "\" Berhasil Terhubung!" });
      } else {
        if (res.analysis && res.analysis.suggested_actions) {
          backendLogs.push("\n👉 CHECKLIST REKOMENDASI NYATA:");
          res.analysis.suggested_actions.forEach(act => {
            backendLogs.push("• " + act);
          });
        }
        setTestLogs(backendLogs.length > 0 ? backendLogs : ["❌ Gagal: Router tidak dapat dihubungi (Unreachable)."]);
        setTestStatus("error");
        Y({ type: "error", message: "Koneksi MikroTik \"" + routerName + "\" Gagal!" });
      }
    } catch (err) {
      setTestLogs(["❌ Gagal: Tidak dapat menghubungi server diagnostik billing."]);
      setTestStatus("error");
      Y({ type: "error", message: "Koneksi diagnostik gagal." });
    } finally {
      setTesting(false);
    }
  };

  const handleSubmitProfile = async (e) => {
    e.preventDefault();
    if (!profileForm.name || !profileForm.bandwidth_limit) {
      Y({ type: "error", message: "Nama profil & bandwidth wajib diisi!" });
      return;
    }
    try {
      const url = isEditingProfile ? "/api/v1/radius/profiles/" + profileForm.id : "/api/v1/radius/profiles";
      const method = isEditingProfile ? "PUT" : "POST";
      const res = await (await fetch(url, {
        method,
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(profileForm)
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: isEditingProfile ? "Profil berhasil diperbarui!" : "Profil Baru berhasil ditambahkan!" });
        setProfileForm({ id: "", name: "", bandwidth_limit: "", expiration_date: "", package_type: "PPPoE Premium" });
        setIsEditingProfile(false);
        loadData();
      } else {
        Y({ type: "error", message: res.message });
      }
    } catch(err) {}
  };

  const handleEditProfile = (prof) => {
    setProfileForm(prof);
    setIsEditingProfile(true);
  };

  const handleDeleteProfile = async (id) => {
    if (!confirm("Hapus profil RADIUS ini?")) return;
    try {
      const res = await (await fetch("/api/v1/radius/profiles/" + id, { method: "DELETE" })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Profil RADIUS berhasil dihapus!" });
        loadData();
      }
    } catch(err) {}
  };

  const handleToggleSession = async (id) => {
    try {
      const res = await (await fetch("/api/v1/radius/sessions/toggle-status", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ id })
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Status sesi client berhasil diperbarui!" });
        loadData();
      }
    } catch (err) {}
  };

  const handleSaveAlertConfig = async (e) => {
    e.preventDefault();
    try {
      const res = await (await fetch("/api/v1/radius/alerts/config", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(alertConfig)
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Konfigurasi alarm sukses disimpan!" });
        loadAlertConfig();
        loadData();
      }
    } catch(err) {
      Y({ type: "error", message: "Gagal menyimpan konfigurasi." });
    }
  };

  const handleSendMockAlert = async () => {
    try {
      const res = await (await fetch("/api/v1/radius/alerts/send-test", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ clientId: testClientId })
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Simulasi alarm sukses dikirim!" });
        loadData();
      }
    } catch(err) {
      Y({ type: "error", message: "Gagal mengirim simulasi." });
    }
  };

  const handleSubmitNas = async (e) => {
    e.preventDefault();
    if (!nasForm.name || !nasForm.ip_address || !nasForm.secret) {
      Y({ type: "error", message: "Nama, IP Address, dan Secret Key wajib diisi!" });
      return;
    }
    try {
      let res;
      if (isEditingNas) {
        res = await (await fetch("/api/v1/radius/nas/" + nasForm.id, {
          method: "PUT",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(nasForm)
        })).json();
      } else {
        res = await (await fetch("/api/v1/radius/nas", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(nasForm)
        })).json();
      }
      if (res.status === "success" || res.data) {
        Y({ type: "success", message: isEditingNas ? "Router NAS berhasil diperbarui!" : "Router NAS baru berhasil didaftarkan!" });
        setNasForm({ id: "", name: "", ip_address: "", secret: "", type: "Mikrotik", username: "admin", password: "", api_port: 8728, radius_source_ip: "" });
        setIsEditingNas(false);
        loadData();
      } else {
        Y({ type: "error", message: res.message || "Gagal memproses data." });
      }
    } catch(err) {
      Y({ type: "error", message: "Gagal menghubungkan ke server." });
    }
  };

  const handleEditNas = (nas) => {
    setNasForm({
      id: nas.id,
      name: nas.name || "",
      ip_address: nas.ip_address || "",
      secret: nas.secret || "",
      type: nas.type || "Mikrotik",
      username: nas.username || "admin",
      password: nas.password || "",
      api_port: nas.api_port || 8728,
      radius_source_ip: nas.radius_source_ip || ""
    });
    setIsEditingNas(true);
    setSubTab("routers");
  };

  const handleDeleteNas = async (id) => {
    if (!confirm("Hapus Router NAS ini? Koneksi RADIUS dari router ini akan terputus.")) return;
    try {
      const res = await (await fetch("/api/v1/radius/nas/" + id, { method: "DELETE" })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Router NAS berhasil dihapus!" });
        loadData();
      }
    } catch(err) {
      Y({ type: "error", message: "Gagal menghapus router." });
    }
  };

  const filteredSessions = sessions.filter(sess => {
    const q = searchQuery.trim().toLowerCase();
    if (!q) return true;
    return (sess.username || "").toLowerCase().includes(q) || (sess.mac_address || "").toLowerCase().includes(q);
  });

  return e.jsxs("div", {
    className: "space-y-6 text-sans text-xs text-left shadow-sm",
    children: [
      e.jsxs("div", {
        className: "flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white dark:bg-slate-900 p-4 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm gap-4 flex-wrap",
        children: [
          e.jsxs("div", {
            className: "space-y-1",
            children: [
              e.jsxs("h2", {
                className: "text-[#d97706] dark:text-amber-400 font-bold text-sm tracking-wide flex items-center gap-1.5",
                children: [
                  e.jsx("span", { className: "h-2 w-2 rounded-full bg-emerald-500 animate-pulse" }),
                  "Master RADIUS Billing Control Hub"
                ]
              }),
              e.jsx("p", {
                className: "text-[10px] text-slate-500 dark:text-slate-400 font-medium",
                children: "Manajemen rute perangkat, CRUD profil, status tagihan real-time, dan monitoring koneksi client berbasis RADIUS."
              })
            ]
          }),
          e.jsxs("div", {
            className: "flex items-center gap-3 flex-wrap",
            children: [
              e.jsx("a", {
                href: "/api/v1/radius/reports/export",
                className: "px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white font-bold rounded-lg flex items-center gap-1 transition-all cursor-pointer shadow-sm active:scale-95 text-[10px]",
                children: "📥 Ekspor Laporan CSV"
              })
            ]
          })
        ]
      }),
      e.jsxs("div", {
        className: "flex border-b border-slate-200 dark:border-slate-800 gap-1.5 flex-wrap overflow-x-auto",
        children: [
          e.jsx("button", {
            onClick: () => setSubTab("dashboard"),
            className: "px-4 py-2 text-xs font-bold transition-all border-b-2 " + (subTab === "dashboard" ? "border-blue-600 text-blue-600 font-black" : "border-transparent text-slate-500 hover:text-slate-850 dark:hover:text-slate-350"),
            children: "🖥️ Live Dashboard & Sesi Sesi"
          }),
          e.jsx("button", {
            onClick: () => setSubTab("alerts"),
            className: "px-4 py-2 text-xs font-bold transition-all border-b-2 " + (subTab === "alerts" ? "border-blue-600 text-blue-600 font-black" : "border-transparent text-slate-500 hover:text-slate-850 dark:hover:text-slate-350"),
            children: "🔔 Alarm Otomatis & threshold"
          }),
          e.jsx("button", {
            onClick: () => setSubTab("adminLogs"),
            className: "px-4 py-2 text-xs font-bold transition-all border-b-2 " + (subTab === "adminLogs" ? "border-blue-600 text-blue-600 font-black" : "border-transparent text-slate-500 hover:text-slate-850 dark:hover:text-slate-350"),
            children: "📋 Log Aktivitas Admin"
          }),
          e.jsx("button", {
            onClick: () => setSubTab("routers"),
            className: "px-4 py-2 text-xs font-bold transition-all border-b-2 " + (subTab === "routers" ? "border-blue-600 text-blue-600 font-black" : "border-transparent text-slate-500 hover:text-slate-850 dark:hover:text-slate-350"),
            children: "🔌 Management Router NAS"
          }),
          e.jsx("button", {
            onClick: () => setSubTab("profiles"),
            className: "px-4 py-2 text-xs font-bold transition-all border-b-2 " + (subTab === "profiles" ? "border-blue-600 text-blue-600 font-black" : "border-transparent text-slate-500 hover:text-slate-850 dark:hover:text-slate-350"),
            children: "📋 CRUD Profil & Bandwidth"
          })
        ]
      }),
      subTab === "dashboard" && e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 space-y-6",
            children: [
              e.jsxs("div", {
                className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
                children: [
                  e.jsxs("div", {
                    className: "p-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm",
                    children: [
                      e.jsx("p", { className: "text-[10px] uppercase font-bold text-slate-500 dark:text-slate-400", children: "Sesi Aktif" }),
                      e.jsxs("h3", { className: "text-lg font-black text-slate-800 dark:text-slate-100 mt-1", children: [sessions.filter(s => s.status === "Active").length, " Connected"] })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "p-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm",
                    children: [
                      e.jsx("p", { className: "text-[10px] uppercase font-bold text-slate-500 dark:text-slate-400", children: "Total Usage Rate" }),
                      e.jsx("h3", { className: "text-lg font-black text-slate-800 dark:text-slate-100 mt-1", children: "24.5 Mbps" })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "p-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm",
                    children: [
                      e.jsx("p", { className: "text-[10px] uppercase font-bold text-slate-500 dark:text-slate-400", children: "Billing Status" }),
                      e.jsx("h3", { className: "text-lg font-black text-emerald-600 dark:text-emerald-400 mt-1", children: "Rp 630,000" })
                    ]
                  })
                ]
              }),
              e.jsxs("div", {
                className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-3",
                children: [
                  e.jsxs("div", {
                    className: "flex flex-col sm:flex-row gap-2 justify-between items-stretch sm:items-center border-b pb-3 mb-1",
                    children: [
                      e.jsxs("h3", {
                        className: "font-bold text-slate-800 dark:text-slate-100 flex items-center gap-1.5 text-xs sm:text-sm",
                        children: [
                          e.jsx("span", { className: "h-2 w-2 rounded-full bg-blue-500 animate-ping" }),
                          "Koneksi MikroTik Client RADIUS Aktif"
                        ]
                      }),
                      e.jsxs("div", {
                        className: "flex gap-2 items-center w-full sm:w-auto",
                        children: [
                          e.jsx("input", {
                            type: "text",
                            value: searchQuery,
                            onChange: (e) => setSearchQuery(e.target.value),
                            placeholder: "Cari username / MAC address...",
                            className: "px-3 py-1.5 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-[10px] w-full sm:w-48 font-mono outline-none focus:ring-1 focus:ring-blue-500"
                          }),
                          e.jsx("button", {
                            onClick: loadData,
                            className: "px-2.5 py-1.5 bg-slate-105 dark:bg-slate-800 text-slate-600 dark:text-slate-100 font-bold rounded-lg cursor-pointer text-[10px]",
                            children: "🔄 Refresh"
                          })
                        ]
                      })
                    ]
                  }),
                  e.jsx("div", {
                    className: "overflow-x-auto",
                    children: e.jsxs("table", {
                      className: "w-full text-left border-collapse",
                      children: [
                        e.jsx("thead", {
                          children: e.jsxs("tr", {
                            className: "bg-slate-10 border-b border-slate-100 dark:border-slate-800 text-[10px] text-slate-400 font-mono tracking-wider",
                            children: [
                              e.jsx("th", { className: "p-2", children: "USERNAME & MAC" }),
                              e.jsx("th", { className: "p-2", children: "IP ADDR" }),
                              e.jsx("th", { className: "p-2", children: "SPEED (UP/DOWN)" }),
                              e.jsx("th", { className: "p-2", children: "USAGE METRIC" }),
                              e.jsx("th", { className: "p-2", children: "UPTIME / EXPIRY" }),
                              e.jsx("th", { className: "p-2 text-center", children: "STATUS / AKSI" })
                            ]
                          })
                        }),
                        e.jsx("tbody", {
                          children: filteredSessions.length === 0 ? e.jsx("tr", {
                            children: e.jsx("td", {
                              colSpan: 6,
                              className: "p-4 text-center text-slate-450 text-slate-400 font-mono",
                              children: "Klien tidak ditemukan"
                            })
                          }) : filteredSessions.map(sess => e.jsxs("tr", {
                            className: "border-b border-light-grid dark:border-slate-800 text-[11px] hover:bg-light-hover dark:hover:bg-slate-800/40 font-medium",
                            children: [
                              e.jsxs("td", {
                                className: "p-2 space-y-0.5",
                                children: [
                                  e.jsx("div", { className: "font-mono font-bold text-slate-800 dark:text-slate-100", children: sess.username }),
                                  e.jsx("div", { className: "font-mono text-[9px] text-slate-400", children: sess.mac_address })
                                ]
                              }),
                              e.jsx("td", { className: "p-2 font-mono text-slate-500 dark:text-slate-400", children: sess.ip_address }),
                              e.jsxs("td", { className: "p-2 font-mono text-indigo-600 dark:text-indigo-400", children: [sess.upload, " / ", sess.download] }),
                              e.jsxs("td", {
                                className: "p-2 space-y-1 min-w-[120px]",
                                children: [
                                  e.jsxs("div", {
                                    className: "flex justify-between font-mono text-[9px] text-slate-505 text-slate-500",
                                    children: [
                                      e.jsx("span", { children: sess.bytes_used || "0 GB" }),
                                      e.jsxs("span", {
                                        className: "font-bold " + (sess.percentage_used >= 90 ? "text-rose-500" : sess.percentage_used >= 75 ? "text-amber-500" : "text-emerald-500"),
                                        children: [sess.percentage_used || 0, "%"]
                                      })
                                    ]
                                  }),
                                  e.jsx("div", {
                                    className: "w-full bg-slate-105 dark:bg-slate-800 rounded-full h-1.5 overflow-hidden",
                                    children: e.jsx("div", {
                                      className: "h-full rounded-full transition-all " + (sess.percentage_used >= 90 ? "bg-rose-500" : sess.percentage_used >= 75 ? "bg-amber-500" : "bg-emerald-500"),
                                      style: { width: Math.min(sess.percentage_used || 0, 100) + "%" }
                                    })
                                  })
                                ]
                              }),
                              e.jsxs("td", {
                                className: "p-2 space-y-0.5",
                                children: [
                                  e.jsx("div", { className: "text-slate-600 dark:text-slate-350 font-semibold", children: sess.uptime }),
                                  e.jsxs("div", {
                                    className: "text-[9px] font-mono " + (sess.username === "ppp_user_tony" ? "text-rose-500" : "text-slate-400"),
                                    children: ["Exp: ", sess.expiration_date]
                                  })
                                ]
                              }),
                              e.jsxs("td", {
                                className: "p-2 text-center space-y-1",
                                children: [
                                  e.jsxs("div", {
                                    className: "flex gap-1 justify-center",
                                    children: [
                                      e.jsx("span", {
                                        className: "px-1.5 py-0.5 rounded font-mono text-[9px] font-black " + (sess.billing_status === "Lunas" ? "bg-emerald-50 dark:bg-emerald-950/40 text-emerald-600 dark:text-emerald-400 border dark:border-emerald-900" : "bg-rose-50 dark:bg-rose-950/30 text-rose-600 dark:text-rose-400 border dark:border-rose-900"),
                                        children: sess.billing_status
                                      }),
                                      sess.percentage_used >= 90 && e.jsx("span", {
                                        className: "px-1.5 py-0.5 rounded font-mono text-[9px] font-black bg-amber-50 dark:bg-amber-950/30 text-amber-600 dark:text-amber-400 border dark:border-amber-900 animate-pulse",
                                        children: "⚠️ LIMIT"
                                      })
                                    ]
                                  }),
                                  e.jsx("button", {
                                    onClick: () => handleToggleSession(sess.id),
                                    className: "px-2.5 py-0.5 rounded font-bold text-[9px] cursor-pointer text-white transition-all " + (sess.status === "Active" ? "bg-rose-500 hover:bg-rose-600 shadow-sm" : "bg-emerald-500 hover:bg-emerald-600 shadow-sm"),
                                    children: sess.status === "Active" ? "Isolir Akun" : "Re-Aktifkan"
                                  })
                                ]
                              })
                            ]
                          }, sess.id))
                        })
                      ]
                    })
                  })
                ]
              })
            ]
          }),
          e.jsxs("div", {
            className: "space-y-6",
            children: [
              e.jsxs("div", {
                className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-3",
                children: [
                  e.jsx("h3", { className: "font-black text-slate-805 dark:text-slate-100 text-[11px] uppercase tracking-wider", children: "Daftar Router NAS" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px]", children: "Status rute fisik / Network Access Server." }),
                  e.jsx("div", {
                    className: "space-y-2",
                    children: (nasList.length > 0 ? nasList : (G || [])).map(r => e.jsxs("div", {
                      className: "flex justify-between items-center p-2.5 bg-slate-50 dark:bg-slate-800/40 rounded-lg border border-slate-100 dark:border-slate-800",
                      children: [
                        e.jsxs("div", {
                          className: "space-y-0.5",
                          children: [
                            e.jsx("div", { className: "font-bold text-slate-800 dark:text-slate-100", children: r.name }),
                            e.jsxs("div", { className: "font-mono text-[9px] text-slate-550 text-slate-500", children: [r.ip_address, " : ", r.api_port || 8728] })
                          ]
                        }),
                        e.jsx("span", { className: "px-2 py-0.5 rounded text-[9px] font-black uppercase text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/40 border dark:border-emerald-900", children: "Connected" })
                      ]
                    }, r.id))
                  })
                ]
              }),
              e.jsxs("div", {
                className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-3",
                children: [
                  e.jsxs("div", {
                    className: "flex justify-between items-center border-b pb-1.5",
                    children: [
                      e.jsx("h3", { className: "font-black text-slate-805 dark:text-slate-100 text-[11px] uppercase tracking-wider", children: "Aktivitas Terakhir" }),
                      e.jsx("button", {
                        onClick: () => setSubTab("adminLogs"),
                        className: "text-[9px] text-blue-600 dark:text-blue-400 font-bold hover:underline",
                        children: "Lihat Semua"
                      })
                    ]
                  }),
                  e.jsx("div", {
                    className: "space-y-2 max-h-52 overflow-y-auto pr-1",
                    children: adminLogs.slice(0, 3).map(log => e.jsxs("div", {
                      className: "text-[10px] leading-normal border-b dark:border-slate-800 pb-1.5 last:border-0 last:pb-0 font-medium",
                      children: [
                        e.jsx("p", { className: "text-slate-705 text-slate-700 dark:text-slate-200", children: log.action }),
                        e.jsx("p", { className: "text-slate-400 font-mono text-[8px]", children: new Date(log.timestamp).toLocaleTimeString() })
                      ]
                    }, log.id))
                  })
                ]
              })
            ]
          })
        ]
      }),
      subTab === "alerts" && e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: "⚙️ Pengaturan Notifikasi Alarm Otomatis" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Sistem akan mengirimkan pesan otomatis ke klien ketika mendekati kuota limit atau tanggal kedaluwarsa." })
                ]
              }),
              e.jsxs("form", {
                onSubmit: handleSaveAlertConfig,
                className: "space-y-4 text-slate-700 dark:text-slate-350",
                children: [
                  e.jsxs("div", {
                    className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "Threshold Pemakaian Kuota (%)" }),
                          e.jsx("input", {
                            type: "number",
                            value: alertConfig.alertThresholdPct,
                            onChange: (e) => setAlertConfig({ ...alertConfig, alertThresholdPct: Number(e.target.value) }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs",
                            min: 50,
                            max: 95
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-2 mt-2 sm:mt-5",
                        children: [
                          e.jsxs("label", {
                            className: "flex items-center gap-2 cursor-pointer font-bold text-slate-600 dark:text-slate-300",
                            children: [
                              e.jsx("input", {
                                type: "checkbox",
                                checked: alertConfig.enabled,
                                onChange: (e) => setAlertConfig({ ...alertConfig, enabled: e.target.checked }),
                                className: "rounded border-slate-300 text-blue-600"
                              }),
                              "Aktifkan Kirim Alarm Pengingat"
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
                    children: [
                      e.jsxs("label", {
                        className: "flex items-center gap-2 cursor-pointer font-bold text-slate-600 dark:text-slate-300",
                        children: [
                          e.jsx("input", {
                            type: "checkbox",
                            checked: alertConfig.emailAlerts,
                            onChange: (e) => setAlertConfig({ ...alertConfig, emailAlerts: e.target.checked }),
                            className: "rounded border-slate-300 text-blue-600"
                          }),
                          "Kirim Melalui E-mail (client@domain)"
                        ]
                      }),
                      e.jsxs("label", {
                        className: "flex items-center gap-2 cursor-pointer font-bold text-slate-600 dark:text-slate-300",
                        children: [
                          e.jsx("input", {
                            type: "checkbox",
                            checked: alertConfig.telegramAlerts,
                            onChange: (e) => setAlertConfig({ ...alertConfig, telegramAlerts: e.target.checked }),
                            className: "rounded border-slate-300 text-blue-600"
                          }),
                          "Kirim Melalui Telegram Bot API"
                        ]
                      })
                    ]
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className: "px-4 py-2 bg-blue-600 hover:bg-blue-550 text-white font-bold rounded-lg cursor-pointer text-xs shadow",
                    children: "💾 Simpan Config Alarm"
                  })
                ]
              })
            ]
          }),
          e.jsxs("div", {
            className: "space-y-6",
            children: [
              e.jsxs("div", {
                className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("h3", { className: "font-bold text-slate-805 dark:text-slate-100 text-xs uppercase animate-pulse", children: "⚡ Uji Simulasi Kirim Alarm" }),
                      e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Kirim pesan alarm manual ke klien untuk menguji interaksi bot." })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "space-y-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-mono text-[9px] uppercase font-bold text-slate-500", children: "Pilih Client RADIUS" }),
                          e.jsxs("select", {
                            value: testClientId,
                            onChange: (e) => setTestClientId(e.target.value),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs font-mono",
                            children: sessions.map(sess => e.jsxs("option", {
                              value: sess.id,
                              children: [sess.username, " (", sess.percentage_used, "%)"]
                            }, sess.id))
                          })
                        ]
                      }),
                      e.jsx("button", {
                        type: "button",
                        onClick: handleSendMockAlert,
                        className: "w-full py-2 bg-emerald-600 hover:bg-emerald-700 text-white font-bold rounded-lg cursor-pointer transition-all text-xs active:scale-[0.98]",
                        children: "📬 Kirim Notifikasi Sekarang"
                      })
                    ]
                  })
                ]
              }),
              e.jsxs("div", {
                className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-3",
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-[11px] uppercase border-b pb-1.5", children: "History Pengiriman Alarm" }),
                  e.jsx("div", {
                    className: "space-y-3 border-l border-slate-100 dark:border-slate-800 pl-3 ml-1 max-h-72 overflow-y-auto",
                    children: alertHistory.length === 0 ? e.jsx("div", {
                      className: "text-slate-400 font-mono text-[10px]",
                      children: "Belum ada riwayat alarm."
                    }) : alertHistory.map(hist => e.jsxs("div", {
                      className: "relative space-y-1 pb-2 text-[11px] leading-normal font-medium last:pb-0",
                      children: [
                        e.jsx("span", { className: "absolute -left-[17px] top-1.5 h-2 w-2 rounded-full border-2 border-white dark:border-slate-900 bg-amber-500" }),
                        e.jsxs("div", {
                          className: "flex justify-between items-center",
                          children: [
                            e.jsx("span", { className: "font-mono font-bold text-slate-800 dark:text-slate-100", children: hist.client }),
                            e.jsx("span", { className: "text-[8px] text-slate-400 font-mono", children: new Date(hist.timestamp).toLocaleTimeString() })
                          ]
                        }),
                        e.jsx("p", { className: "text-slate-500 dark:text-slate-350 text-[10px] bg-slate-50 dark:bg-slate-800/50 p-2 rounded-lg border dark:border-slate-800", children: hist.message }),
                        e.jsx("div", {
                          children: e.jsx("span", {
                            className: "px-1.5 py-0.2 bg-emerald-50 dark:bg-emerald-950/40 text-[9px] text-emerald-600 dark:text-emerald-400 font-mono font-bold rounded border dark:border-emerald-900",
                            children: "✓ Sent"
                          })
                        })
                      ]
                    }, hist.id))
                  })
                ]
              })
            ]
          })
        ]
      }),
      subTab === "adminLogs" && e.jsxs("div", {
        className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4 animate-fade-in",
        children: [
          e.jsxs("div", {
            className: "flex justify-between items-center border-b pb-2.5",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs sm:text-sm uppercase", children: "📋 Log Aktivitas Audit Admin RADIUS" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Daftar tindakan administratif, pembaruan konfigurasi, tindakan isolasi, dan pengiriman notifikasi." })
                ]
              }),
              e.jsxs("span", {
                className: "px-2 py-0.5 bg-blue-50 dark:bg-blue-900/30 text-[9px] text-blue-600 dark:text-blue-400 font-bold rounded flex items-center gap-1.5 border dark:border-blue-900",
                children: [
                  e.jsx("span", { className: "h-1.5 w-1.5 bg-blue-500 rounded-full animate-ping" }),
                  "Live Connected"
                ]
              })
            ]
          }),
          e.jsx("div", {
            className: "space-y-4 max-h-[480px] overflow-y-auto pl-2",
            children: adminLogs.length === 0 ? e.jsx("div", {
              className: "text-center text-slate-400 py-6 font-medium text-[11px]",
              children: "Belum ada rekaman aktivitas admin."
            }) : adminLogs.map(log => e.jsxs("div", {
              className: "flex gap-3 text-xs border-b border-slate-50 dark:border-slate-800 pb-3 last:border-0 last:pb-0 font-medium",
              children: [
                e.jsx("span", { className: "text-[14px] select-none", children: "⚙️" }),
                e.jsxs("div", {
                  className: "space-y-1 w-full",
                  children: [
                    e.jsx("p", { className: "text-slate-700 dark:text-slate-200 font-bold text-[11px]", children: log.action }),
                    e.jsxs("div", {
                      className: "flex justify-between text-[9px] text-slate-400 font-mono",
                      children: [
                        e.jsxs("span", { children: ["Oleh: ", e.jsx("strong", { children: "Administrator" })] }),
                        e.jsx("span", { children: new Date(log.timestamp).toLocaleString("id-ID") })
                      ]
                    })
                  ]
                })
              ]
            }, log.id))
          })
        ]
      }),
      subTab === "profiles" && e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: "Pengaturan Profil Paket Bandwidth" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Atur limit kecepatan, tipe akun, dan masa kedaluwarsa paket." })
                ]
              }),
              e.jsx("div", {
                className: "overflow-x-auto",
                children: e.jsxs("table", {
                  className: "w-full text-left border-collapse",
                  children: [
                    e.jsx("thead", {
                      children: e.jsxs("tr", {
                        className: "bg-slate-50 dark:bg-slate-800/40 border-b border-slate-100 dark:border-slate-800 text-[10px] text-slate-400 font-mono tracking-wider",
                        children: [
                          e.jsx("th", { className: "p-2", children: "NAME" }),
                          e.jsx("th", { className: "p-2", children: "RATE LIMIT" }),
                          e.jsx("th", { className: "p-2", children: "TYPE" }),
                          e.jsx("th", { className: "p-2", children: "EXPIRY" }),
                          e.jsx("th", { className: "p-2 text-center", children: "AKSI" })
                        ]
                      })
                    }),
                    e.jsx("tbody", {
                      children: profiles.map(prof => e.jsxs("tr", {
                        className: "border-b border-slate-100 dark:border-slate-800 text-[11px] hover:bg-slate-50 dark:hover:bg-slate-800/40 font-medium",
                        children: [
                          e.jsx("td", { className: "p-2 font-bold text-slate-800 dark:text-slate-100", children: prof.name }),
                          e.jsx("td", { className: "p-2 font-mono text-indigo-750 text-indigo-600 dark:text-indigo-400", children: prof.bandwidth_limit }),
                          e.jsx("td", { className: "p-2 font-mono text-slate-500 dark:text-slate-400", children: prof.package_type }),
                          e.jsx("td", { className: "p-2 text-slate-600 dark:text-slate-350", children: prof.expiration_date }),
                          e.jsxs("td", {
                            className: "p-2 text-center space-x-2",
                            children: [
                              e.jsx("button", {
                                type: "button",
                                onClick: () => handleEditProfile(prof),
                                className: "px-2 py-0.5 bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 border dark:border-blue-900 rounded font-bold cursor-pointer hover:bg-blue-100 text-[9px]",
                                children: "Ubah"
                              }),
                              e.jsx("button", {
                                type: "button",
                                onClick: () => handleDeleteProfile(prof.id),
                                className: "px-2 py-0.5 bg-rose-50 dark:bg-rose-950/30 text-rose-600 dark:text-rose-400 border dark:border-rose-900 rounded font-bold cursor-pointer hover:bg-rose-100 text-[9px]",
                                children: "Hapus"
                              })
                            ]
                          })
                        ]
                      }, prof.id))
                    })
                  ]
                })
              })
            ]
          }),
          e.jsxs("div", {
            className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: isEditingProfile ? "Ubah Profil" : "Tambah Profil" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Masukkan parameter bandwidth dan lisensi profile baru." })
                ]
              }),
              e.jsxs("form", {
                onSubmit: handleSubmitProfile,
                className: "space-y-4 text-slate-755 text-slate-700 dark:text-slate-200",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", { className: "font-bold text-slate-500", children: "Nama Paket *" }),
                      e.jsx("input", {
                        type: "text",
                        value: profileForm.name,
                        onChange: (e) => setProfileForm({ ...profileForm, name: e.target.value }),
                        className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs",
                        placeholder: "e.g. Premium 10M"
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", { className: "font-bold text-slate-500", children: "Limit Bandwidth *" }),
                      e.jsx("input", {
                        type: "text",
                        value: profileForm.bandwidth_limit,
                        onChange: (e) => setProfileForm({ ...profileForm, bandwidth_limit: e.target.value }),
                        className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs",
                        placeholder: "e.g. 10M/10M"
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", { className: "font-bold text-slate-550", children: "Tipe Paket *" }),
                      e.jsxs("select", {
                        value: profileForm.package_type,
                        onChange: (e) => setProfileForm({ ...profileForm, package_type: e.target.value }),
                        className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs",
                        children: [
                          e.jsx("option", { value: "PPPoE Premium", children: "PPPoE Premium Connection" }),
                          e.jsx("option", { value: "Hotspot Voucher", children: "Hotspot Voucher / Captive" }),
                          e.jsx("option", { value: "Dedicated Link", children: "Dedicated Link / SOHO" })
                        ]
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", { className: "font-bold text-slate-500", children: "Masa Kedaluwarsa *" }),
                      e.jsx("input", {
                        type: "date",
                        value: profileForm.expiration_date,
                        onChange: (e) => setProfileForm({ ...profileForm, expiration_date: e.target.value }),
                        className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs"
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "flex gap-2",
                    children: [
                      e.jsx("button", {
                        type: "submit",
                        className: "flex-1 py-1.5 bg-blue-600 hover:bg-blue-550 text-white font-bold rounded-lg cursor-pointer shadow text-xs transition-all",
                        children: "Simpan"
                      }),
                      isEditingProfile && e.jsx("button", {
                        type: "button",
                        onClick: () => {
                          setIsEditingProfile(false);
                          setProfileForm({ id: "", name: "", bandwidth_limit: "", expiration_date: "", package_type: "PPPoE Premium" });
                        },
                        className: "py-1.5 px-3 bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-705 text-slate-650 dark:text-slate-100 font-bold rounded-lg cursor-pointer border dark:border-slate-700 text-xs",
                        children: "Batal"
                      })
                    ]
                  })
                ]
              })
            ]
          })
        ]
      }),
      subTab === "routers" && e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: "🔌 Daftar Router NAS Terkoneksi (MikroTik)" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Daftar fisik router penagihan RADIUS. Anda dapat mengedit, menghapus, atau mendaftarkan kredensial login baru." })
                ]
              }),
              e.jsx("div", {
                className: "overflow-x-auto",
                children: e.jsxs("table", {
                  className: "w-full text-left border-collapse",
                  children: [
                    e.jsx("thead", {
                      children: e.jsxs("tr", {
                        className: "bg-slate-50 dark:bg-slate-800/40 border-b border-slate-100 dark:border-slate-800 text-[10px] text-slate-400 font-mono tracking-wider",
                        children: [
                          e.jsx("th", { className: "p-2", children: "NAME" }),
                          e.jsx("th", { className: "p-2", children: "IP ADDRESS" }),
                          e.jsx("th", { className: "p-2", children: "VENDOR / TYPE" }),
                          e.jsx("th", { className: "p-2", children: "CREDENTIALS & SECRET" }),
                          e.jsx("th", { className: "p-2 text-center", children: "AKSI" })
                        ]
                      })
                    }),
                    e.jsx("tbody", {
                      children: nasList.map(r => e.jsxs("tr", {
                        className: "border-b border-slate-100 dark:border-slate-800 text-[11px] hover:bg-slate-50 dark:hover:bg-slate-800/40 font-medium",
                        children: [
                          e.jsxs("td", { 
                            className: "p-2",
                            children: [
                              e.jsx("div", { className: "font-bold text-slate-800 dark:text-slate-100", children: r.name }),
                              e.jsx("span", { className: "px-1.5 py-0.2 bg-emerald-50 dark:bg-emerald-950/40 text-[8px] text-emerald-600 dark:text-emerald-400 font-mono font-bold rounded border dark:border-emerald-900", children: "Connected" })
                            ]
                          }),
                          e.jsx("td", { className: "p-2 font-mono text-indigo-600 dark:text-indigo-400 font-bold", children: r.ip_address }),
                          e.jsx("td", { className: "p-2 font-bold text-slate-600 dark:text-slate-350", children: r.type || "Mikrotik" }),
                          e.jsxs("td", {
                            className: "p-2 font-mono space-y-0.5",
                            children: [
                              e.jsxs("div", { className: "text-slate-500", children: ["User: ", e.jsx("strong", { className: "text-slate-700 dark:text-slate-200", children: r.username || "admin" }), " | Port: ", r.api_port || 8728] }),
                              e.jsxs("div", { className: "text-slate-500", children: ["Pass: ", e.jsx("span", { className: "text-slate-650", children: r.password ? "••••••" : "(Tanpa Sandi)" })] }),
                              e.jsxs("div", { className: "text-slate-500", children: ["Secret: ", e.jsx("span", { className: "text-amber-600 dark:text-amber-400 font-bold", children: r.secret })] })
                            ]
                          }),
                          e.jsxs("td", {
                            className: "p-2 text-center space-x-2 whitespace-nowrap",
                            children: [
                              e.jsx("button", {
                                type: "button",
                                onClick: () => {
                                  setSelectedNasId(String(r.id));
                                  handleTestConnection(String(r.id));
                                },
                                className: "px-2 py-0.5 bg-amber-55 dark:bg-amber-950/40 text-amber-600 dark:text-amber-400 border border-amber-200 dark:border-amber-900 rounded font-bold cursor-pointer hover:bg-amber-100 dark:hover:bg-amber-900/30 text-[9px]",
                                children: "⚡ Tes Koneksi"
                              }),
                              e.jsx("button", {
                                type: "button",
                                onClick: () => handleEditNas(r),
                                className: "px-2 py-0.5 bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 border dark:border-blue-900 rounded font-bold cursor-pointer hover:bg-blue-100 text-[9px]",
                                children: "Ubah"
                              }),
                              e.jsx("button", {
                                type: "button",
                                onClick: () => handleDeleteNas(r.id),
                                className: "px-2 py-0.5 bg-rose-50 dark:bg-rose-950/30 text-rose-600 dark:text-rose-400 border dark:border-rose-900 rounded font-bold cursor-pointer hover:bg-rose-100 text-[9px]",
                                children: "Hapus"
                              })
                            ]
                          })
                        ]
                      }, r.id))
                    })
                  ]
                })
              }),
              e.jsx("div", { className: "border-t border-slate-100 dark:border-slate-800 my-4" }),
              e.jsxs("div", {
                className: "space-y-4 pt-1",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: "⚡ Uji Diagnosis Konektivitas MikroTik" }),
                      e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Uji ping, port API (8728) MikroTik, otentikasi login, serta respon UDP Port 1812 secara nyata." })
                    ]
                  }),
                  nasList.length > 0 && e.jsxs("div", {
                    className: "space-y-1 bg-slate-50 dark:bg-slate-900/60 p-2.5 rounded-lg border border-slate-100 dark:border-slate-800",
                    children: [
                      e.jsx("label", { className: "font-bold text-[10px] text-slate-550 dark:text-slate-400 uppercase block mb-1", children: "Pilih Target Router NAS Yang Ingin Diuji:" }),
                      e.jsx("select", {
                        value: selectedNasId,
                        onChange: (e) => setSelectedNasId(e.target.value),
                        className: "w-full p-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg text-xs font-semibold cursor-pointer text-slate-800 dark:text-slate-100",
                        children: nasList.map(n => e.jsx("option", {
                          value: String(n.id),
                          children: n.name + " — " + n.ip_address + " (Port: " + (n.api_port || 8728) + ")"
                        }, n.id))
                      })
                    ]
                  }),
                  e.jsx("button", {
                    type: "button",
                    onClick: () => handleTestConnection(),
                    disabled: testing,
                    className: "w-full py-2 bg-blue-600 hover:bg-blue-550 text-white font-bold rounded-lg cursor-pointer transition-all text-xs " + (testing ? "opacity-50" : ""),
                    children: testing ? "⚡ Sedang Menguji..." : "⚡ Jalankan Tes Koneksi RADIUS"
                  }),
                  testLogs.length > 0 && e.jsxs("div", {
                    className: "p-3 bg-slate-950 rounded-lg border border-slate-900 dark:border-slate-800 leading-normal",
                    children: [
                      e.jsx("p", { className: "text-[9px] uppercase font-bold text-slate-500 font-mono tracking-wider border-b border-light-grid dark:border-slate-950 pb-1 mb-1.5", children: "Log Diagnosis" }),
                      e.jsx("div", {
                        className: "font-mono text-[9px] space-y-1 " + (testStatus === "success" ? "text-emerald-400" : "text-yellow-500"),
                        children: testLogs.map((log, i) => e.jsx("div", { children: log }, i))
                      })
                    ]
                  })
                ]
              })
            ]
          }),
          e.jsxs("div", {
            className: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl p-4 shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", { className: "font-bold text-slate-800 dark:text-slate-100 text-xs uppercase", children: isEditingNas ? "✏️ Ubah Router NAS" : "➕ Registrasi Router NAS Baru" }),
                  e.jsx("p", { className: "text-slate-400 text-[10px] mt-0.5", children: "Daftarkan kredensial login (Winbox API) dan shared secret interkoneksi RADIUS." })
                ]
              }),
              e.jsxs("form", {
                onSubmit: handleSubmitNas,
                className: "space-y-4 text-slate-700 dark:text-slate-200",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", { className: "font-bold text-slate-500", children: "Nama Router / Identitas NAS *" }),
                      e.jsx("input", {
                        type: "text",
                        required: true,
                        value: nasForm.name,
                        onChange: (e) => setNasForm({ ...nasForm, name: e.target.value }),
                        className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs font-semibold",
                        placeholder: "e.g. Router Utama Bengkulu"
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "IP Address / Host *" }),
                          e.jsx("input", {
                            type: "text",
                            required: true,
                            value: nasForm.ip_address,
                            onChange: (e) => setNasForm({ ...nasForm, ip_address: e.target.value }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs",
                            placeholder: "e.g. 10.61.0.12"
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "Shared Secret RADIUS *" }),
                          e.jsx("input", {
                            type: "text",
                            required: true,
                            value: nasForm.secret,
                            onChange: (e) => setNasForm({ ...nasForm, secret: e.target.value }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs",
                            placeholder: "Shared Secret Keamanan"
                          })
                        ]
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "Vendor / Type *" }),
                          e.jsxs("select", {
                            value: nasForm.type,
                            onChange: (e) => setNasForm({ ...nasForm, type: e.target.value }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs font-semibold cursor-pointer",
                            children: [
                              e.jsx("option", { value: "Mikrotik", children: "MikroTik RouterOS" }),
                              e.jsx("option", { value: "Cisco", children: "Cisco Systems" }),
                              e.jsx("option", { value: "Huawei", children: "Huawei Broadband" }),
                              e.jsx("option", { value: "Generic", children: "Generic RADIUS" })
                            ]
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "API Port (RouterOS) *" }),
                          e.jsx("input", {
                            type: "number",
                            required: true,
                            value: nasForm.api_port,
                            onChange: (e) => setNasForm({ ...nasForm, api_port: Number(e.target.value) }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs"
                          })
                        ]
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "Username Router / Winbox API *" }),
                          e.jsx("input", {
                            type: "text",
                            required: true,
                            value: nasForm.username,
                            onChange: (e) => setNasForm({ ...nasForm, username: e.target.value }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg text-xs font-semibold",
                            placeholder: "e.g. admin"
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "font-bold text-slate-500", children: "Password Router / Winbox API" }),
                          e.jsx("input", {
                            type: "password",
                            value: nasForm.password,
                            onChange: (e) => setNasForm({ ...nasForm, password: e.target.value }),
                            className: "w-full p-2 bg-slate-50 dark:bg-slate-800 border dark:border-slate-700 rounded-lg font-mono text-xs",
                            placeholder: "Isi password atau kosongkan"
                          })
                        ]
                      })
                    ]
                  }),
                  e.jsxs("div", {
                    className: "flex gap-2 pt-2",
                    children: [
                      e.jsx("button", {
                        type: "submit",
                        className: "flex-1 py-1.5 bg-blue-600 hover:bg-blue-550 text-white font-bold rounded-lg cursor-pointer text-xs shadow transition-all",
                        children: isEditingNas ? "💾 Perbarui Router NAS" : "➕ Simpan Router NAS"
                      }),
                      isEditingNas && e.jsx("button", {
                        type: "button",
                        onClick: () => {
                          setNasForm({ id: "", name: "", ip_address: "", secret: "", type: "Mikrotik", username: "admin", password: "", api_port: 8728, radius_source_ip: "" });
                          setIsEditingNas(false);
                        },
                        className: "px-4 py-1.5 bg-slate-100 hover:bg-slate-200 dark:bg-slate-800 dark:hover:bg-slate-700 text-slate-800 dark:text-slate-100 font-bold rounded-lg cursor-pointer text-xs transition-all",
                        children: "Batal"
                      })
                    ]
                  })
                ]
              })
            ]
          })
        ]
      }),
      toast && e.jsx("div", {
        className: "fixed bottom-5 right-5 z-50 p-4 rounded-xl shadow-lg border text-white font-semibold flex items-center gap-2 " + (toast.type === "success" ? "bg-emerald-600 border-emerald-500 animate-fade-in" : "bg-rose-600 border-rose-500 animate-fade-in"),
        children: toast.message
      })
    ]
  });
  // END REPLACEMENT
}), { G: G }),J === "static-ip" &&
        e.jsxs("div", {
          className: "grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in",
          children: [
            e.jsx("div", {
              className: "lg:col-span-2 space-y-6",
              children: e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
                children: [
                  e.jsxs("div", {
                    className:
                      "flex items-center justify-between border-b pb-3",
                    children: [
                      e.jsxs("h3", {
                        className:
                          "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                        children: [
                          e.jsx(cu, {
                            className: "h-4.5 w-4.5 text-indigo-650",
                          }),
                          e.jsx("span", {
                            children:
                              "Layanan Pelanggan IP Statik (Routing Mode)",
                          }),
                        ],
                      }),
                      w !== "Customer" &&
                        w !== "Technician" &&
                        e.jsxs("button", {
                          onClick: () => C(!0),
                          className:
                            "px-3 py-1 bg-indigo-600 hover:bg-indigo-505 text-white font-bold rounded text-[11px] cursor-pointer flex items-center gap-1 shadow-sm",
                          children: [
                            e.jsx(jn, { className: "h-3 w-3" }),
                            e.jsx("span", { children: "Aktifkan IP Statik" }),
                          ],
                        }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "bg-slate-50 border rounded-lg overflow-hidden divide-y text-xs text-slate-700",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-2.5 bg-slate-100/80 font-bold grid grid-cols-6 gap-2 text-slate-600",
                        children: [
                          e.jsx("span", { children: "Nama Pelanggan" }),
                          e.jsx("span", { children: "IP Statik" }),
                          e.jsx("span", { children: "Gateway" }),
                          e.jsx("span", { children: "Interface" }),
                          e.jsx("span", { children: "MAC Address" }),
                          e.jsx("span", { children: "Aksi" }),
                        ],
                      }),
                      ce.length === 0
                        ? e.jsx("div", {
                            className:
                              "p-4 text-center text-slate-400 font-sans",
                            children:
                              "Belum ada pelanggan dengan mode IP Statik.",
                          })
                        : ce.map((u) =>
                            e.jsxs(
                              "div",
                              {
                                className:
                                  "p-2.5 grid grid-cols-6 gap-2 font-mono items-center hover:bg-white transition-colors text-[11px]",
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "font-sans font-bold text-slate-800 truncate",
                                    children: u.name,
                                  }),
                                  e.jsx("span", {
                                    className: "text-indigo-600 font-bold",
                                    children: u.static_ip,
                                  }),
                                  e.jsx("span", { children: u.gateway }),
                                  e.jsx("span", {
                                    className: "text-slate-505",
                                    children: u.interface,
                                  }),
                                  e.jsx("span", {
                                    className: "truncate",
                                    children: u.mac_address,
                                  }),
                                  e.jsxs("div", {
                                    className: "flex gap-2 font-sans",
                                    children: [
                                      e.jsx("button", {
                                        onClick: () => X(u),
                                        className:
                                          "text-blue-600 hover:underline font-bold text-[10px] uppercase cursor-pointer",
                                        children: "Edit",
                                      }),
                                      e.jsx("button", {
                                        onClick: () => or(u.id),
                                        className:
                                          "text-rose-600 hover:underline font-bold text-[10px] uppercase cursor-pointer",
                                        children: "Hapus",
                                      }),
                                    ],
                                  }),
                                ],
                              },
                              u.id,
                            ),
                          ),
                    ],
                  }),
                ],
              }),
            }),
            e.jsx("div", {
              className: "space-y-6",
              children: e.jsxs("div", {
                className:
                  "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5 text-xs text-slate-650",
                children: [
                  e.jsxs("h4", {
                    className:
                      "font-extrabold text-slate-800 text-[11px] uppercase tracking-wider flex items-center gap-1.5",
                    children: [
                      e.jsx(ar, { className: "h-4 w-4 text-indigo-500" }),
                      e.jsx("span", {
                        children: "Panduan IP Statik Mode (MikroTik)",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    children: [
                      "Pelanggan dengan ",
                      e.jsx("b", { children: "IP Statik Mode" }),
                      " tidak memerlukan autentikasi PPPoE atau Hotspot captive portal. Router MikroTik mengidentifikasi pelanggan berdasarkan IP address tetap, ARP Binding, atau MAC Authentication.",
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "p-2 bg-slate-800 text-slate-200 rounded font-mono text-[10px] leading-relaxed",
                    children: [
                      "# Setup IP Address pada Port Lan",
                      e.jsx("br", {}),
                      "/ip address add address=192.168.10.1/24 interface=ether3-Lan",
                      e.jsx("br", {}),
                      "# Tambah Queue Simple untuk Limit Berdasarkan IP",
                      e.jsx("br", {}),
                      "/queue simple add name=Sip-Budi target=192.168.10.50 max-limit=20M/20M",
                    ],
                  }),
                ],
              }),
            }),
          ],
        }),
      te &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Buat Akun PPPoE",
                  }),
                  e.jsx("button", {
                    type: "button",
                    onClick: () => Ae(!1),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: fl,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Pelanggan *",
                      }),
                      e.jsxs("select", {
                        required: !0,
                        value: ka.customer_id,
                        onChange: (u) => {
                          const _ = Y.find((Ce) => Ce.id === Number(u.target.value));
                          Hs({
                            ...ka,
                            customer_id: u.target.value,
                            username: _ ? (_.username || _.full_name || "").toLowerCase().replace(/\s+/g, "") : ka.username,
                          });
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "",
                            children: "-- Pilih Pelanggan --",
                          }),
                          Y.map((u) =>
                            e.jsxs(
                              "option",
                              {
                                value: u.id,
                                children: [u.full_name || u.name || "Pelanggan", " (", u.phone || u.address || "CRM", ")"],
                              },
                              u.id,
                            ),
                          ),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Username PPPoE *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ka.username,
                        onChange: (u) => Hs({ ...ka, username: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Password PPPoE *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ka.password,
                        onChange: (u) => Hs({ ...ka, password: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Profile Kecepatan *",
                      }),
                      e.jsx("select", {
                        value: ka.profile,
                        onChange: (u) => Hs({ ...ka, profile: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: de.map((u) =>
                          e.jsxs(
                            "option",
                            {
                              value: u.name,
                              children: [u.name, " (", u.rate_limit, ")"],
                            },
                            u.id,
                          ),
                        ),
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-blue-600 hover:bg-blue-700 text-white font-bold rounded-lg cursor-pointer shadow",
                    children: "Simpan Akun PPPoE",
                  }),
                ],
              }),
            ],
          }),
        }),
      Ue &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Tambah Profil Kecepatan PPPoE",
                  }),
                  e.jsx("button", {
                    type: "button",
                    onClick: () => y(!1),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: pl,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Profil *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ba.name,
                        onChange: (u) => za({ ...ba, name: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Gateway Local Address *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ba.local_address,
                        onChange: (u) => za({ ...ba, local_address: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Remote Pool *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ba.remote_pool,
                        onChange: (u) => za({ ...ba, remote_pool: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Rate Limit Down/Up *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: ba.rate_limit,
                        onChange: (u) => za({ ...ba, rate_limit: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-violet-600 hover:bg-violet-700 text-white font-bold rounded-lg cursor-pointer shadow",
                    children: "Simpan Profil PPPoE",
                  }),
                ],
              }),
            ],
          }),
        }),
      Ma &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Edit Akun PPPoE",
                  }),
                  e.jsx("button", {
                    onClick: () => Ts(null),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: lr,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Username PPPoE *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: Ma.username,
                        onChange: (u) =>
                          Ts({ ...Ma, username: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Password Klien *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: Ma.password || "123456",
                        onChange: (u) =>
                          Ts({ ...Ma, password: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Kecepatan PPP Profile *",
                      }),
                      e.jsx("select", {
                        value: Ma.profile,
                        onChange: (u) => Ts({ ...Ma, profile: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: de.map((u) =>
                          e.jsxs(
                            "option",
                            {
                              value: u.name,
                              children: [u.name, " (", u.rate_limit, ")"],
                            },
                            u.id,
                          ),
                        ),
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Status Akun *",
                      }),
                      e.jsxs("select", {
                        value: Ma.status,
                        onChange: (u) => Ts({ ...Ma, status: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "active",
                            children: "Active / Enabled",
                          }),
                          e.jsx("option", {
                            value: "disabled",
                            children: "Disabled / Suspend",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-blue-605 hover:bg-blue-600 text-white font-bold rounded-lg cursor-pointer shadow mt-2",
                    children: "Simpan Perubahan",
                  }),
                ],
              }),
            ],
          }),
        }),
      aa &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Edit Profil Kecepatan PPPoE",
                  }),
                  e.jsx("button", {
                    onClick: () => wa(null),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: Di,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Profil *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: aa.name,
                        onChange: (u) => wa({ ...aa, name: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Gateway Local Address *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: aa.local_address,
                        onChange: (u) =>
                          wa({ ...aa, local_address: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Remote Pool IP Range *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: aa.remote_pool,
                        onChange: (u) =>
                          wa({ ...aa, remote_pool: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Rate Limit Download/Upload *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: aa.rate_limit,
                        onChange: (u) =>
                          wa({ ...aa, rate_limit: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-violet-650 hover:bg-violet-600 text-white font-bold rounded-lg cursor-pointer animate-pulse",
                    children: "Simpan Profil",
                  }),
                ],
              }),
            ],
          }),
        }),
      g &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Aktifkan Layanan IP Statik",
                  }),
                  e.jsx("button", {
                    onClick: () => C(!1),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: rr,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Pelanggan Terkait (Opsional)",
                      }),
                      e.jsxs("select", {
                        value: Be.customer_id,
                        onChange: (u) => {
                          const _ = Y.find(
                            (Ce) => Ce.id === Number(u.target.value),
                          );
                          ot({
                            ...Be,
                            customer_id: u.target.value,
                            name: _ ? _.full_name : Be.name,
                          });
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "",
                            children: "-- Pilih Pelanggan --",
                          }),
                          Y.map((u) =>
                            e.jsxs(
                              "option",
                              {
                                value: u.id,
                                children: [u.full_name, " (", u.address, ")"],
                              },
                              u.id,
                            ),
                          ),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Penerima Layanan *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "e.g. Kantor Desa Kuningan",
                        value: Be.name,
                        onChange: (u) => ot({ ...Be, name: u.target.value }),
                        className: "w-full p-2 bg-slate-50 border rounded-lg",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Static IP Address *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "e.g. 192.168.10.150",
                        value: Be.static_ip,
                        onChange: (u) =>
                          ot({ ...Be, static_ip: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Gateway Address *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "e.g. 192.168.10.1",
                        value: Be.gateway,
                        onChange: (u) => ot({ ...Be, gateway: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "MAC Address (Opsional)",
                      }),
                      e.jsx("input", {
                        type: "text",
                        placeholder: "FC:12:AA:BB:33:99",
                        value: Be.mac_address,
                        onChange: (u) =>
                          ot({ ...Be, mac_address: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Router LAN Interface *",
                      }),
                      e.jsxs("select", {
                        value: Dt,
                        onChange: (u) => {
                          const _ = u.target.value;
                          (Li(_),
                            _ !== "custom" && ot({ ...Be, interface: _ }));
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer font-mono",
                        children: [
                          xs.map((u) =>
                            e.jsx("option", { value: u, children: u }, u),
                          ),
                          e.jsx("option", {
                            value: "custom",
                            children: "-- Ketik Manual / Custom --",
                          }),
                        ],
                      }),
                      Dt === "custom" &&
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "Contoh: ether3-MyLan",
                          value: Be.interface,
                          onChange: (u) =>
                            ot({ ...Be, interface: u.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg font-mono outline-none mt-1",
                        }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Limit Kecepatan (Simple Queue) *",
                      }),
                      e.jsxs("select", {
                        value: At,
                        onChange: (u) => {
                          const _ = u.target.value;
                          (Cs(_),
                            _ !== "custom" && ot({ ...Be, rate_limit: _ }));
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer font-mono",
                        children: [
                          Us.map((u) =>
                            e.jsx("option", { value: u, children: u }, u),
                          ),
                          e.jsx("option", {
                            value: "custom",
                            children: "-- Ketik Manual / Custom --",
                          }),
                        ],
                      }),
                      At === "custom" &&
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "Contoh: 20M/20M",
                          value: Be.rate_limit,
                          onChange: (u) =>
                            ot({ ...Be, rate_limit: u.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg font-mono outline-none mt-1",
                        }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-indigo-650 hover:bg-indigo-600 text-white font-bold rounded-lg cursor-pointer",
                    children: "Aktifkan Static IP",
                  }),
                ],
              }),
            ],
          }),
        }),
      I &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-800 text-sm",
                    children: "Edit Layanan IP Statik",
                  }),
                  e.jsx("button", {
                    onClick: () => X(null),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: Ri,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Penerima *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: I.name,
                        onChange: (u) => X({ ...I, name: u.target.value }),
                        className: "w-full p-2 bg-slate-50 border rounded-lg",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "IP Statik *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: I.static_ip,
                        onChange: (u) => X({ ...I, static_ip: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Gateway *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: I.gateway,
                        onChange: (u) => X({ ...I, gateway: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "MAC Address",
                      }),
                      e.jsx("input", {
                        type: "text",
                        value: I.mac_address,
                        onChange: (u) =>
                          X({ ...I, mac_address: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Interface LAN *",
                      }),
                      e.jsxs("select", {
                        value: ln,
                        onChange: (u) => {
                          const _ = u.target.value;
                          ($a(_), _ !== "custom" && X({ ...I, interface: _ }));
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer font-mono",
                        children: [
                          xs.map((u) =>
                            e.jsx("option", { value: u, children: u }, u),
                          ),
                          e.jsx("option", {
                            value: "custom",
                            children: "-- Ketik Manual / Custom --",
                          }),
                        ],
                      }),
                      ln === "custom" &&
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "Contoh: ether3-MyLan",
                          value: I.interface,
                          onChange: (u) =>
                            X({ ...I, interface: u.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg font-mono outline-none mt-1",
                        }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Rate Limit Queue *",
                      }),
                      e.jsxs("select", {
                        value: Is,
                        onChange: (u) => {
                          const _ = u.target.value;
                          (Ba(_), _ !== "custom" && X({ ...I, rate_limit: _ }));
                        },
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer font-mono",
                        children: [
                          Us.map((u) =>
                            e.jsx("option", { value: u, children: u }, u),
                          ),
                          e.jsx("option", {
                            value: "custom",
                            children: "-- Ketik Manual / Custom --",
                          }),
                        ],
                      }),
                      Is === "custom" &&
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "Contoh: 20M/20M",
                          value: I.rate_limit,
                          onChange: (u) =>
                            X({ ...I, rate_limit: u.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg font-mono outline-none mt-1",
                        }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Status *",
                      }),
                      e.jsxs("select", {
                        value: I.status,
                        onChange: (u) => X({ ...I, status: u.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "active",
                            children: "Active",
                          }),
                          e.jsx("option", {
                            value: "disabled",
                            children: "Disabled",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2 bg-indigo-650 hover:bg-indigo-600 text-white font-bold rounded-lg cursor-pointer shadow",
                    children: "Simpan IP Statik",
                  }),
                ],
              }),
            ],
          }),
        }),
      J === "sync" &&
        e.jsxs("div", {
          className: "space-y-6 animate-fade-in text-sans text-xs",
          children: [
            e.jsxs("div", {
              className:
                "bg-gradient-to-r from-slate-900 to-indigo-950 text-white p-5 rounded-2xl shadow-md border border-slate-700/50 relative overflow-hidden",
              children: [
                e.jsx("div", {
                  className:
                    "absolute right-0 top-0 opacity-10 flex text-slate-100 justify-end h-full",
                  children: e.jsx(Tp, { className: "h-40 w-40" }),
                }),
                e.jsxs("div", {
                  className: "relative z-10 space-y-2 max-w-2xl text-left",
                  children: [
                    e.jsx("span", {
                      className:
                        "text-[10px] font-extrabold uppercase bg-indigo-500/30 border border-indigo-400/30 px-2.5 py-0.5 rounded-full tracking-wider text-indigo-300",
                      children: "MikroTik Recovery & Database Engine",
                    }),
                    e.jsx("h2", {
                      className: "text-xl font-black font-sans leading-tight",
                      children:
                        "Pusat Pemulihan Bencana & Sinkronisasi MikroTik Baru",
                    }),
                    e.jsx("p", {
                      className:
                        "text-slate-300 font-medium text-[11px] leading-relaxed",
                      children:
                        "Seluruh data pendaftaran pelanggan PPPoE, database voucher hotspot aktif, beserta profil kecepatan di web billing mandiri Anda ini tersimpan secara tersentralisasi dan permanen di server cloud kami. Saat MikroTik Anda rusak, ganti baru, atau mati total, Anda dapat mengunggah ulang seluruh data ini ke MikroTik baru secara otomatis hanya dalam hitungan detik!",
                    }),
                  ],
                }),
              ],
            }),
            e.jsxs("div", {
              className: "grid grid-cols-1 lg:grid-cols-12 gap-6",
              children: [
                e.jsxs("div", {
                  className: "lg:col-span-5 space-y-5 text-left",
                  children: [
                    e.jsxs("div", {
                      className:
                        "p-4 bg-white border border-slate-200 rounded-2xl shadow-sm space-y-2.5",
                      children: [
                        e.jsx("span", {
                          className:
                            "inline-block px-2 py-0.5 bg-indigo-50 text-indigo-700 rounded text-[9px] font-bold uppercase",
                          children: "Tanya Jawab Teknis #1",
                        }),
                        e.jsx("h4", {
                          className: "font-extrabold text-slate-850 text-xs",
                          children:
                            "A. Apakah file backup (.backup) Mikrotik lama bisa langsung dipulihkan ke Mikrotik baru / pengganti?",
                        }),
                        e.jsxs("div", {
                          className:
                            "text-[11px] text-slate-605 leading-relaxed space-y-1.5 font-medium",
                          children: [
                            e.jsx("p", {
                              children: e.jsx("strong", {
                                children: "Bisa, TETAPI ada syarat mutlaknya:",
                              }),
                            }),
                            e.jsxs("p", {
                              children: [
                                "File dengan ekstensi ",
                                e.jsx("code", {
                                  className:
                                    "bg-slate-100 px-1 py-0.5 rounded text-amber-700 font-mono font-bold",
                                  children: ".backup",
                                }),
                                " (binary) ",
                                e.jsx("strong", {
                                  children:
                                    "hanya boleh dipulihkan jika tipe/model MikroTik penggantinya persis sama",
                                }),
                                " (misal dari RB750Gr3 ke RB750Gr3 yang baru).",
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "p-2 border border-rose-100 bg-rose-50/50 rounded-lg text-rose-800 text-[10px]",
                              children: [
                                e.jsx("strong", { children: "⚠️ PENTING:" }),
                                " Jika Anda memulihkannya ke tipe MikroTik yang berbeda (misalnya dari CCR2004 ke RB3011), hal ini dapat menyebabkan ",
                                e.jsx("strong", {
                                  children:
                                    "Error Interfaces, error MAC alamat, atau Router hang / bootloop",
                                }),
                                " karena perbedaan susunan hardware ethernet card internal!",
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "p-4 bg-white border border-slate-200 rounded-2xl shadow-sm space-y-2.5",
                      children: [
                        e.jsx("span", {
                          className:
                            "inline-block px-2 py-0.5 bg-emerald-50 text-emerald-700 rounded text-[9px] font-bold uppercase",
                          children: "Saran Praktisi ISP",
                        }),
                        e.jsx("h4", {
                          className: "font-extrabold text-slate-850 text-xs",
                          children:
                            "B. Apa alternatif terbaik mengunggah ulang data ke Mikrotik berbeda tipe?",
                        }),
                        e.jsxs("div", {
                          className:
                            "text-[11px] text-slate-605 leading-relaxed space-y-2 font-medium",
                          children: [
                            e.jsxs("p", {
                              children: [
                                "Gunakan file script ",
                                e.jsx("code", {
                                  className:
                                    "bg-slate-100 px-1 py-0.5 rounded text-indigo-700 font-mono font-bold text-[10.5px]",
                                  children: ".rsc",
                                }),
                                " (yang berisi baris teks command/perintah). File RSC dapat dibaca, diedit manual menggunakan Notepad, dan bebas dipasang di tipe Mikrotik apa saja.",
                              ],
                            }),
                            e.jsxs("p", {
                              children: [
                                "Hub Pemulihan kami di sebelah kanan telah merancang kode eksportir cerdas yang ",
                                e.jsx("strong", {
                                  children:
                                    "otomatis merangkum seluruh voucher aktif dan secret PPPoE",
                                }),
                                " dari data web billing terbaru untuk siap disalin ke model MikroTik manapun!",
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "p-4 bg-slate-50 border border-slate-200 rounded-2xl space-y-3",
                      children: [
                        e.jsxs("h4", {
                          className:
                            "font-bold text-slate-800 text-xs flex items-center gap-1.5",
                          children: [
                            e.jsx($n, { className: "h-4 w-4 text-slate-500" }),
                            e.jsx("span", {
                              children: "Kesiapan Saldo Database di Web",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "grid grid-cols-2 gap-2 text-center text-[10px] font-bold font-mono",
                          children: [
                            e.jsxs("div", {
                              className:
                                "bg-white p-2 border border-slate-200 rounded-xl",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-slate-400 block text-[9px] uppercase font-sans",
                                  children: "PPPoE Accounts",
                                }),
                                e.jsxs("span", {
                                  className: "text-blue-650 text-xs font-black",
                                  children: [b.length, " Akun"],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "bg-white p-2 border border-slate-200 rounded-xl",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-slate-400 block text-[9px] uppercase font-sans font-medium",
                                  children: "Hotspot Vouchers",
                                }),
                                e.jsxs("span", {
                                  className:
                                    "text-amber-650 text-xs font-black",
                                  children: [ee.length, " Voucher"],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "bg-white p-2 border border-slate-200 rounded-xl",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-slate-400 block text-[9px] uppercase font-sans font-medium",
                                  children: "Profiles Kecepatan",
                                }),
                                e.jsxs("span", {
                                  className:
                                    "text-emerald-650 text-xs font-black",
                                  children: [de.length + be.length, " Profil"],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "bg-white p-2 border border-slate-200 rounded-xl",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-slate-400 block text-[9px] uppercase font-sans font-medium",
                                  children: "Static IP Bindings",
                                }),
                                e.jsxs("span", {
                                  className:
                                    "text-indigo-650 text-xs font-black",
                                  children: [ce.length, " Target"],
                                }),
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "lg:col-span-7 space-y-6 text-left",
                  children: [
                    e.jsxs("div", {
                      className:
                        "p-4 bg-white border border-slate-200 rounded-2xl shadow-sm space-y-4",
                      children: [
                        e.jsxs("div", {
                          children: [
                            e.jsxs("h4", {
                              className:
                                "font-extrabold text-slate-850 text-xs flex items-center gap-1.5",
                              children: [
                                e.jsx(Rp, {
                                  className: "h-4 w-4 text-blue-600",
                                }),
                                e.jsx("span", {
                                  children:
                                    "Metode 1: Automatic Live Auto-Sync (API Push Mode)",
                                }),
                              ],
                            }),
                            e.jsx("p", {
                              className:
                                "text-[10px] text-slate-450 leading-normal pl-5.5 font-medium",
                              children:
                                "Program otomatis mengkoneksikan billing ke Mikrotik Baru via RouterOS API Port 8728, kemudian langsung menyuntikkan seluruh database user tanpa bantuan input manual.",
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "grid grid-cols-2 sm:grid-cols-4 gap-3 bg-slate-50 p-3 rounded-xl border border-slate-100",
                          children: [
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className:
                                    "font-black text-slate-500 text-[9.5px]",
                                  children: "IP MikroTik Baru *",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  value: Na,
                                  onChange: (u) => $t(u.target.value),
                                  className:
                                    "w-full p-2 bg-white border rounded font-mono text-[11px] outline-none",
                                  placeholder: "192.168.88.1",
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className:
                                    "font-black text-slate-500 text-[9.5px]",
                                  children: "API Port *",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  value: sn,
                                  onChange: (u) => Qn(u.target.value),
                                  className:
                                    "w-full p-2 bg-white border rounded font-mono text-[11px] outline-none",
                                  placeholder: "8728",
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className:
                                    "font-black text-slate-500 text-[9.5px]",
                                  children: "Username *",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  value: _n,
                                  onChange: (u) => ga(u.target.value),
                                  className:
                                    "w-full p-2 bg-white border rounded font-mono text-[11px] outline-none",
                                  placeholder: "admin",
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className:
                                    "font-black text-slate-500 text-[9.5px]",
                                  children: "Password",
                                }),
                                e.jsx("input", {
                                  type: "password",
                                  value: v,
                                  onChange: (u) => Pe(u.target.value),
                                  className:
                                    "w-full p-2 bg-white border rounded font-mono text-[11px] outline-none",
                                  placeholder: "Tinggalkan kosong jika default",
                                }),
                              ],
                            }),
                          ],
                        }),
                        vt
                          ? e.jsxs("div", {
                              className: "space-y-2",
                              children: [
                                e.jsxs("div", {
                                  className:
                                    "flex justify-between text-[10px] font-bold text-slate-600",
                                  children: [
                                    e.jsx("span", {
                                      children:
                                        "Proses Upload database sedang dijalankan...",
                                    }),
                                    e.jsxs("span", { children: [rt, "%"] }),
                                  ],
                                }),
                                e.jsx("div", {
                                  className:
                                    "w-full bg-slate-100 h-2 rounded-full overflow-hidden",
                                  children: e.jsx("div", {
                                    className:
                                      "bg-blue-600 h-full transition-all duration-300",
                                    style: { width: `${rt}%` },
                                  }),
                                }),
                                e.jsx("div", {
                                  className:
                                    "bg-slate-950 text-slate-200 p-3 rounded-lg font-mono text-[9px] h-48 overflow-y-auto space-y-1 border border-slate-800 leading-normal",
                                  children: we.map((u, _) =>
                                    e.jsx(
                                      "div",
                                      {
                                        className:
                                          u.includes("✅") || u.includes("🎉")
                                            ? "text-emerald-400"
                                            : u.includes("↳")
                                              ? "text-sky-300 pl-2"
                                              : "text-slate-300",
                                        children: u,
                                      },
                                      _,
                                    ),
                                  ),
                                }),
                              ],
                            })
                          : e.jsxs("div", {
                              className: "flex flex-col gap-2",
                              children: [
                                e.jsxs("button", {
                                  onClick: ur,
                                  className:
                                    "w-full py-2.5 bg-blue-600 hover:bg-blue-550 text-white font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1.5 shadow-sm transition-colors text-xs",
                                  children: [
                                    e.jsx(Va, {
                                      className: "h-4 w-4 animate-spin-slow",
                                    }),
                                    e.jsx("span", {
                                      children:
                                        "Mulai Eksekusi Auto-Sync (Push Ke MikroTik Baru)",
                                    }),
                                  ],
                                }),
                                we.length > 0 &&
                                  e.jsxs("div", {
                                    className:
                                      "bg-slate-950 text-emerald-400 border border-slate-900 p-3 rounded-xl font-mono text-[10px] space-y-1 h-28 overflow-y-auto leading-normal",
                                    children: [
                                      e.jsx("div", {
                                        className:
                                          "text-slate-400 font-sans text-[9px] mb-1 font-bold",
                                        children:
                                          "Riwayat Log Sinkronisasi Terakhir:",
                                      }),
                                      we
                                        .slice(-4)
                                        .map((u, _) =>
                                          e.jsx("div", { children: u }, _),
                                        ),
                                    ],
                                  }),
                              ],
                            }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "p-4 bg-white border border-slate-200 rounded-2xl shadow-sm space-y-4",
                      children: [
                        e.jsxs("div", {
                          children: [
                            e.jsxs("h4", {
                              className:
                                "font-extrabold text-slate-850 text-xs flex items-center gap-1.5",
                              children: [
                                e.jsx(hu, {
                                  className: "h-4 w-4 text-emerald-600",
                                }),
                                e.jsx("span", {
                                  children:
                                    "Metode 2: Manual Terminal Script Paste (.rsc Exporter)",
                                }),
                              ],
                            }),
                            e.jsxs("p", {
                              className:
                                "text-[10px] text-slate-450 leading-normal pl-5.5 font-medium",
                              children: [
                                "Tidak bisa menghubungkan billing langsung lewat kabel API? Cukup unduh berkas script ",
                                e.jsx("code", {
                                  className:
                                    "bg-slate-100 text-slate-700 px-1 rounded font-mono font-bold",
                                  children: ".rsc",
                                }),
                                " di bawah, lalu paste (tempel) isinya langsung ke terminal MikroTik pengganti yang baru!",
                              ],
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-2",
                          children: [
                            e.jsx("div", {
                              className:
                                "bg-slate-950 border border-slate-900 rounded-xl p-3 h-48 overflow-y-auto font-mono text-[9px] text-emerald-400/95 whitespace-pre leading-relaxed select-all",
                              children: ai(),
                            }),
                            e.jsxs("div", {
                              className: "flex gap-2",
                              children: [
                                e.jsx("button", {
                                  onClick: () => {
                                    (navigator.clipboard.writeText(ai()),
                                      $(
                                        "Kode script MikroTik berhasil disalin ke clipboard Anda! Tempelkan perintah ini di New Terminal Winbox.",
                                      ));
                                  },
                                  className:
                                    "flex-1 py-2 bg-slate-100 hover:bg-slate-200 border text-slate-700 font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1 text-[11px] transition-colors",
                                  children: "Salin Teks Perintah Terminal",
                                }),
                                e.jsxs("button", {
                                  onClick: jl,
                                  className:
                                    "flex-1 py-2 bg-emerald-600 hover:bg-emerald-550 text-white font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1 text-[11px] transition-colors shadow-sm",
                                  children: [
                                    e.jsx(pc, { className: "h-3.5 w-3.5" }),
                                    e.jsx("span", {
                                      children: "Unduh File Script (.rsc)",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "p-3 bg-amber-50 border border-amber-200 rounded-xl text-[10px] text-amber-900 leading-normal font-medium flex gap-2",
                          children: [
                            e.jsx(Xn, {
                              className:
                                "h-4 w-4 text-amber-600 shrink-0 mt-0.5",
                            }),
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("strong", {
                                  className: "font-bold",
                                  children:
                                    "Cara Penggunaan Kode RSC di Mikrotik Baru:",
                                }),
                                e.jsxs("ol", {
                                  className: "list-decimal pl-3 space-y-0.5",
                                  children: [
                                    e.jsx("li", {
                                      children:
                                        "Buka aplikasi Winbox dan koneksikan ke MikroTik Baru Anda.",
                                    }),
                                    e.jsxs("li", {
                                      children: [
                                        "Klik menu ",
                                        e.jsx("strong", {
                                          children: "New Terminal",
                                        }),
                                        " yang terletak di sebelah kiri.",
                                      ],
                                    }),
                                    e.jsxs("li", {
                                      children: [
                                        "Copy isi script di atas, kemudian klik kanan di dalam jendela Terminal Mikrotik dan pilih ",
                                        e.jsx("strong", { children: "Paste" }),
                                        ".",
                                      ],
                                    }),
                                    e.jsx("li", {
                                      children:
                                        "Bum! Seluruh Voucher & akun PPPoE lama langsung tercipta kembali secara instan.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
    ],
  });
}
var Qr = { exports: {} };
/* @preserve
 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */ var wg = Qr.exports,
  Mp;
function kg() {
  return (
    Mp ||
      ((Mp = 1),
      (function (w, J) {
        (function (S, b) {
          b(J);
        })(wg, function (S) {
          var b = "1.9.4";
          function V(s) {
            var i, r, d, h;
            for (r = 1, d = arguments.length; r < d; r++) {
              h = arguments[r];
              for (i in h) s[i] = h[i];
            }
            return s;
          }
          var ue =
            Object.create ||
            (function () {
              function s() {}
              return function (i) {
                return ((s.prototype = i), new s());
              };
            })();
          function re(s, i) {
            var r = Array.prototype.slice;
            if (s.bind) return s.bind.apply(s, r.call(arguments, 1));
            var d = r.call(arguments, 2);
            return function () {
              return s.apply(
                i,
                d.length ? d.concat(r.call(arguments)) : arguments,
              );
            };
          }
          var ee = 0;
          function B(s) {
            return (
              "_leaflet_id" in s || (s._leaflet_id = ++ee),
              s._leaflet_id
            );
          }
          function T(s, i, r) {
            var d, h, p, j;
            return (
              (j = function () {
                ((d = !1), h && (p.apply(r, h), (h = !1)));
              }),
              (p = function () {
                d
                  ? (h = arguments)
                  : (s.apply(r, arguments), setTimeout(j, i), (d = !0));
              }),
              p
            );
          }
          function fe(s, i, r) {
            var d = i[1],
              h = i[0],
              p = d - h;
            return s === d && r ? s : ((((s - h) % p) + p) % p) + h;
          }
          function G() {
            return !1;
          }
          function F(s, i) {
            if (i === !1) return s;
            var r = Math.pow(10, i === void 0 ? 6 : i);
            return Math.round(s * r) / r;
          }
          function ce(s) {
            return s.trim ? s.trim() : s.replace(/^\s+|\s+$/g, "");
          }
          function ve(s) {
            return ce(s).split(/\s+/);
          }
          function Y(s, i) {
            Object.prototype.hasOwnProperty.call(s, "options") ||
              (s.options = s.options ? ue(s.options) : {});
            for (var r in i) s.options[r] = i[r];
            return s.options;
          }
          function Ee(s, i, r) {
            var d = [];
            for (var h in s)
              d.push(
                encodeURIComponent(r ? h.toUpperCase() : h) +
                  "=" +
                  encodeURIComponent(s[h]),
              );
            return (!i || i.indexOf("?") === -1 ? "?" : "&") + d.join("&");
          }
          var Se = /\{ *([\w_ -]+) *\}/g;
          function le(s, i) {
            return s.replace(Se, function (r, d) {
              var h = i[d];
              if (h === void 0)
                throw new Error("No value provided for variable " + r);
              return (typeof h == "function" && (h = h(i)), h);
            });
          }
          var ie =
            Array.isArray ||
            function (s) {
              return Object.prototype.toString.call(s) === "[object Array]";
            };
          function $(s, i) {
            for (var r = 0; r < s.length; r++) if (s[r] === i) return r;
            return -1;
          }
          var de = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
          function oe(s) {
            return (
              window["webkit" + s] || window["moz" + s] || window["ms" + s]
            );
          }
          var be = 0;
          function Ye(s) {
            var i = +new Date(),
              r = Math.max(0, 16 - (i - be));
            return ((be = i + r), window.setTimeout(s, r));
          }
          var Te =
              window.requestAnimationFrame || oe("RequestAnimationFrame") || Ye,
            Ie =
              window.cancelAnimationFrame ||
              oe("CancelAnimationFrame") ||
              oe("CancelRequestAnimationFrame") ||
              function (s) {
                window.clearTimeout(s);
              };
          function me(s, i, r) {
            if (r && Te === Ye) s.call(i);
            else return Te.call(window, re(s, i));
          }
          function Oe(s) {
            s && Ie.call(window, s);
          }
          var te = {
            __proto__: null,
            extend: V,
            create: ue,
            bind: re,
            get lastId() {
              return ee;
            },
            stamp: B,
            throttle: T,
            wrapNum: fe,
            falseFn: G,
            formatNum: F,
            trim: ce,
            splitWords: ve,
            setOptions: Y,
            getParamString: Ee,
            template: le,
            isArray: ie,
            indexOf: $,
            emptyImageUrl: de,
            requestFn: Te,
            cancelFn: Ie,
            requestAnimFrame: me,
            cancelAnimFrame: Oe,
          };
          function Ae() {}
          ((Ae.extend = function (s) {
            var i = function () {
                (Y(this),
                  this.initialize && this.initialize.apply(this, arguments),
                  this.callInitHooks());
              },
              r = (i.__super__ = this.prototype),
              d = ue(r);
            ((d.constructor = i), (i.prototype = d));
            for (var h in this)
              Object.prototype.hasOwnProperty.call(this, h) &&
                h !== "prototype" &&
                h !== "__super__" &&
                (i[h] = this[h]);
            return (
              s.statics && V(i, s.statics),
              s.includes &&
                (Ue(s.includes), V.apply(null, [d].concat(s.includes))),
              V(d, s),
              delete d.statics,
              delete d.includes,
              d.options &&
                ((d.options = r.options ? ue(r.options) : {}),
                V(d.options, s.options)),
              (d._initHooks = []),
              (d.callInitHooks = function () {
                if (!this._initHooksCalled) {
                  (r.callInitHooks && r.callInitHooks.call(this),
                    (this._initHooksCalled = !0));
                  for (var p = 0, j = d._initHooks.length; p < j; p++)
                    d._initHooks[p].call(this);
                }
              }),
              i
            );
          }),
            (Ae.include = function (s) {
              var i = this.prototype.options;
              return (
                V(this.prototype, s),
                s.options &&
                  ((this.prototype.options = i), this.mergeOptions(s.options)),
                this
              );
            }),
            (Ae.mergeOptions = function (s) {
              return (V(this.prototype.options, s), this);
            }),
            (Ae.addInitHook = function (s) {
              var i = Array.prototype.slice.call(arguments, 1),
                r =
                  typeof s == "function"
                    ? s
                    : function () {
                        this[s].apply(this, i);
                      };
              return (
                (this.prototype._initHooks = this.prototype._initHooks || []),
                this.prototype._initHooks.push(r),
                this
              );
            }));
          function Ue(s) {
            if (!(typeof L > "u" || !L || !L.Mixin)) {
              s = ie(s) ? s : [s];
              for (var i = 0; i < s.length; i++)
                s[i] === L.Mixin.Events &&
                  console.warn(
                    "Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",
                    new Error().stack,
                  );
            }
          }
          var y = {
            on: function (s, i, r) {
              if (typeof s == "object") for (var d in s) this._on(d, s[d], i);
              else {
                s = ve(s);
                for (var h = 0, p = s.length; h < p; h++) this._on(s[h], i, r);
              }
              return this;
            },
            off: function (s, i, r) {
              if (!arguments.length) delete this._events;
              else if (typeof s == "object")
                for (var d in s) this._off(d, s[d], i);
              else {
                s = ve(s);
                for (
                  var h = arguments.length === 1, p = 0, j = s.length;
                  p < j;
                  p++
                )
                  h ? this._off(s[p]) : this._off(s[p], i, r);
              }
              return this;
            },
            _on: function (s, i, r, d) {
              if (typeof i != "function") {
                console.warn("wrong listener type: " + typeof i);
                return;
              }
              if (this._listens(s, i, r) === !1) {
                r === this && (r = void 0);
                var h = { fn: i, ctx: r };
                (d && (h.once = !0),
                  (this._events = this._events || {}),
                  (this._events[s] = this._events[s] || []),
                  this._events[s].push(h));
              }
            },
            _off: function (s, i, r) {
              var d, h, p;
              if (this._events && ((d = this._events[s]), !!d)) {
                if (arguments.length === 1) {
                  if (this._firingCount)
                    for (h = 0, p = d.length; h < p; h++) d[h].fn = G;
                  delete this._events[s];
                  return;
                }
                if (typeof i != "function") {
                  console.warn("wrong listener type: " + typeof i);
                  return;
                }
                var j = this._listens(s, i, r);
                if (j !== !1) {
                  var M = d[j];
                  (this._firingCount &&
                    ((M.fn = G), (this._events[s] = d = d.slice())),
                    d.splice(j, 1));
                }
              }
            },
            fire: function (s, i, r) {
              if (!this.listens(s, r)) return this;
              var d = V({}, i, {
                type: s,
                target: this,
                sourceTarget: (i && i.sourceTarget) || this,
              });
              if (this._events) {
                var h = this._events[s];
                if (h) {
                  this._firingCount = this._firingCount + 1 || 1;
                  for (var p = 0, j = h.length; p < j; p++) {
                    var M = h[p],
                      H = M.fn;
                    (M.once && this.off(s, H, M.ctx), H.call(M.ctx || this, d));
                  }
                  this._firingCount--;
                }
              }
              return (r && this._propagateEvent(d), this);
            },
            listens: function (s, i, r, d) {
              typeof s != "string" &&
                console.warn('"string" type argument expected');
              var h = i;
              typeof i != "function" && ((d = !!i), (h = void 0), (r = void 0));
              var p = this._events && this._events[s];
              if (p && p.length && this._listens(s, h, r) !== !1) return !0;
              if (d) {
                for (var j in this._eventParents)
                  if (this._eventParents[j].listens(s, i, r, d)) return !0;
              }
              return !1;
            },
            _listens: function (s, i, r) {
              if (!this._events) return !1;
              var d = this._events[s] || [];
              if (!i) return !!d.length;
              r === this && (r = void 0);
              for (var h = 0, p = d.length; h < p; h++)
                if (d[h].fn === i && d[h].ctx === r) return h;
              return !1;
            },
            once: function (s, i, r) {
              if (typeof s == "object")
                for (var d in s) this._on(d, s[d], i, !0);
              else {
                s = ve(s);
                for (var h = 0, p = s.length; h < p; h++)
                  this._on(s[h], i, r, !0);
              }
              return this;
            },
            addEventParent: function (s) {
              return (
                (this._eventParents = this._eventParents || {}),
                (this._eventParents[B(s)] = s),
                this
              );
            },
            removeEventParent: function (s) {
              return (
                this._eventParents && delete this._eventParents[B(s)],
                this
              );
            },
            _propagateEvent: function (s) {
              for (var i in this._eventParents)
                this._eventParents[i].fire(
                  s.type,
                  V({ layer: s.target, propagatedFrom: s.target }, s),
                  !0,
                );
            },
          };
          ((y.addEventListener = y.on),
            (y.removeEventListener = y.clearAllEventListeners = y.off),
            (y.addOneTimeEventListener = y.once),
            (y.fireEvent = y.fire),
            (y.hasEventListeners = y.listens));
          var K = Ae.extend(y);
          function O(s, i, r) {
            ((this.x = r ? Math.round(s) : s),
              (this.y = r ? Math.round(i) : i));
          }
          var P =
            Math.trunc ||
            function (s) {
              return s > 0 ? Math.floor(s) : Math.ceil(s);
            };
          O.prototype = {
            clone: function () {
              return new O(this.x, this.y);
            },
            add: function (s) {
              return this.clone()._add(z(s));
            },
            _add: function (s) {
              return ((this.x += s.x), (this.y += s.y), this);
            },
            subtract: function (s) {
              return this.clone()._subtract(z(s));
            },
            _subtract: function (s) {
              return ((this.x -= s.x), (this.y -= s.y), this);
            },
            divideBy: function (s) {
              return this.clone()._divideBy(s);
            },
            _divideBy: function (s) {
              return ((this.x /= s), (this.y /= s), this);
            },
            multiplyBy: function (s) {
              return this.clone()._multiplyBy(s);
            },
            _multiplyBy: function (s) {
              return ((this.x *= s), (this.y *= s), this);
            },
            scaleBy: function (s) {
              return new O(this.x * s.x, this.y * s.y);
            },
            unscaleBy: function (s) {
              return new O(this.x / s.x, this.y / s.y);
            },
            round: function () {
              return this.clone()._round();
            },
            _round: function () {
              return (
                (this.x = Math.round(this.x)),
                (this.y = Math.round(this.y)),
                this
              );
            },
            floor: function () {
              return this.clone()._floor();
            },
            _floor: function () {
              return (
                (this.x = Math.floor(this.x)),
                (this.y = Math.floor(this.y)),
                this
              );
            },
            ceil: function () {
              return this.clone()._ceil();
            },
            _ceil: function () {
              return (
                (this.x = Math.ceil(this.x)),
                (this.y = Math.ceil(this.y)),
                this
              );
            },
            trunc: function () {
              return this.clone()._trunc();
            },
            _trunc: function () {
              return ((this.x = P(this.x)), (this.y = P(this.y)), this);
            },
            distanceTo: function (s) {
              s = z(s);
              var i = s.x - this.x,
                r = s.y - this.y;
              return Math.sqrt(i * i + r * r);
            },
            equals: function (s) {
              return ((s = z(s)), s.x === this.x && s.y === this.y);
            },
            contains: function (s) {
              return (
                (s = z(s)),
                Math.abs(s.x) <= Math.abs(this.x) &&
                  Math.abs(s.y) <= Math.abs(this.y)
              );
            },
            toString: function () {
              return "Point(" + F(this.x) + ", " + F(this.y) + ")";
            },
          };
          function z(s, i, r) {
            return s instanceof O
              ? s
              : ie(s)
                ? new O(s[0], s[1])
                : s == null
                  ? s
                  : typeof s == "object" && "x" in s && "y" in s
                    ? new O(s.x, s.y)
                    : new O(s, i, r);
          }
          function g(s, i) {
            if (s)
              for (var r = i ? [s, i] : s, d = 0, h = r.length; d < h; d++)
                this.extend(r[d]);
          }
          g.prototype = {
            extend: function (s) {
              var i, r;
              if (!s) return this;
              if (s instanceof O || typeof s[0] == "number" || "x" in s)
                i = r = z(s);
              else if (((s = C(s)), (i = s.min), (r = s.max), !i || !r))
                return this;
              return (
                !this.min && !this.max
                  ? ((this.min = i.clone()), (this.max = r.clone()))
                  : ((this.min.x = Math.min(i.x, this.min.x)),
                    (this.max.x = Math.max(r.x, this.max.x)),
                    (this.min.y = Math.min(i.y, this.min.y)),
                    (this.max.y = Math.max(r.y, this.max.y))),
                this
              );
            },
            getCenter: function (s) {
              return z(
                (this.min.x + this.max.x) / 2,
                (this.min.y + this.max.y) / 2,
                s,
              );
            },
            getBottomLeft: function () {
              return z(this.min.x, this.max.y);
            },
            getTopRight: function () {
              return z(this.max.x, this.min.y);
            },
            getTopLeft: function () {
              return this.min;
            },
            getBottomRight: function () {
              return this.max;
            },
            getSize: function () {
              return this.max.subtract(this.min);
            },
            contains: function (s) {
              var i, r;
              return (
                typeof s[0] == "number" || s instanceof O
                  ? (s = z(s))
                  : (s = C(s)),
                s instanceof g ? ((i = s.min), (r = s.max)) : (i = r = s),
                i.x >= this.min.x &&
                  r.x <= this.max.x &&
                  i.y >= this.min.y &&
                  r.y <= this.max.y
              );
            },
            intersects: function (s) {
              s = C(s);
              var i = this.min,
                r = this.max,
                d = s.min,
                h = s.max,
                p = h.x >= i.x && d.x <= r.x,
                j = h.y >= i.y && d.y <= r.y;
              return p && j;
            },
            overlaps: function (s) {
              s = C(s);
              var i = this.min,
                r = this.max,
                d = s.min,
                h = s.max,
                p = h.x > i.x && d.x < r.x,
                j = h.y > i.y && d.y < r.y;
              return p && j;
            },
            isValid: function () {
              return !!(this.min && this.max);
            },
            pad: function (s) {
              var i = this.min,
                r = this.max,
                d = Math.abs(i.x - r.x) * s,
                h = Math.abs(i.y - r.y) * s;
              return C(z(i.x - d, i.y - h), z(r.x + d, r.y + h));
            },
            equals: function (s) {
              return s
                ? ((s = C(s)),
                  this.min.equals(s.getTopLeft()) &&
                    this.max.equals(s.getBottomRight()))
                : !1;
            },
          };
          function C(s, i) {
            return !s || s instanceof g ? s : new g(s, i);
          }
          function I(s, i) {
            if (s)
              for (var r = i ? [s, i] : s, d = 0, h = r.length; d < h; d++)
                this.extend(r[d]);
          }
          I.prototype = {
            extend: function (s) {
              var i = this._southWest,
                r = this._northEast,
                d,
                h;
              if (s instanceof pe) ((d = s), (h = s));
              else if (s instanceof I) {
                if (((d = s._southWest), (h = s._northEast), !d || !h))
                  return this;
              } else return s ? this.extend(he(s) || X(s)) : this;
              return (
                !i && !r
                  ? ((this._southWest = new pe(d.lat, d.lng)),
                    (this._northEast = new pe(h.lat, h.lng)))
                  : ((i.lat = Math.min(d.lat, i.lat)),
                    (i.lng = Math.min(d.lng, i.lng)),
                    (r.lat = Math.max(h.lat, r.lat)),
                    (r.lng = Math.max(h.lng, r.lng))),
                this
              );
            },
            pad: function (s) {
              var i = this._southWest,
                r = this._northEast,
                d = Math.abs(i.lat - r.lat) * s,
                h = Math.abs(i.lng - r.lng) * s;
              return new I(
                new pe(i.lat - d, i.lng - h),
                new pe(r.lat + d, r.lng + h),
              );
            },
            getCenter: function () {
              return new pe(
                (this._southWest.lat + this._northEast.lat) / 2,
                (this._southWest.lng + this._northEast.lng) / 2,
              );
            },
            getSouthWest: function () {
              return this._southWest;
            },
            getNorthEast: function () {
              return this._northEast;
            },
            getNorthWest: function () {
              return new pe(this.getNorth(), this.getWest());
            },
            getSouthEast: function () {
              return new pe(this.getSouth(), this.getEast());
            },
            getWest: function () {
              return this._southWest.lng;
            },
            getSouth: function () {
              return this._southWest.lat;
            },
            getEast: function () {
              return this._northEast.lng;
            },
            getNorth: function () {
              return this._northEast.lat;
            },
            contains: function (s) {
              typeof s[0] == "number" || s instanceof pe || "lat" in s
                ? (s = he(s))
                : (s = X(s));
              var i = this._southWest,
                r = this._northEast,
                d,
                h;
              return (
                s instanceof I
                  ? ((d = s.getSouthWest()), (h = s.getNorthEast()))
                  : (d = h = s),
                d.lat >= i.lat &&
                  h.lat <= r.lat &&
                  d.lng >= i.lng &&
                  h.lng <= r.lng
              );
            },
            intersects: function (s) {
              s = X(s);
              var i = this._southWest,
                r = this._northEast,
                d = s.getSouthWest(),
                h = s.getNorthEast(),
                p = h.lat >= i.lat && d.lat <= r.lat,
                j = h.lng >= i.lng && d.lng <= r.lng;
              return p && j;
            },
            overlaps: function (s) {
              s = X(s);
              var i = this._southWest,
                r = this._northEast,
                d = s.getSouthWest(),
                h = s.getNorthEast(),
                p = h.lat > i.lat && d.lat < r.lat,
                j = h.lng > i.lng && d.lng < r.lng;
              return p && j;
            },
            toBBoxString: function () {
              return [
                this.getWest(),
                this.getSouth(),
                this.getEast(),
                this.getNorth(),
              ].join(",");
            },
            equals: function (s, i) {
              return s
                ? ((s = X(s)),
                  this._southWest.equals(s.getSouthWest(), i) &&
                    this._northEast.equals(s.getNorthEast(), i))
                : !1;
            },
            isValid: function () {
              return !!(this._southWest && this._northEast);
            },
          };
          function X(s, i) {
            return s instanceof I ? s : new I(s, i);
          }
          function pe(s, i, r) {
            if (isNaN(s) || isNaN(i))
              throw new Error("Invalid LatLng object: (" + s + ", " + i + ")");
            ((this.lat = +s), (this.lng = +i), r !== void 0 && (this.alt = +r));
          }
          pe.prototype = {
            equals: function (s, i) {
              if (!s) return !1;
              s = he(s);
              var r = Math.max(
                Math.abs(this.lat - s.lat),
                Math.abs(this.lng - s.lng),
              );
              return r <= (i === void 0 ? 1e-9 : i);
            },
            toString: function (s) {
              return "LatLng(" + F(this.lat, s) + ", " + F(this.lng, s) + ")";
            },
            distanceTo: function (s) {
              return $e.distance(this, he(s));
            },
            wrap: function () {
              return $e.wrapLatLng(this);
            },
            toBounds: function (s) {
              var i = (180 * s) / 40075017,
                r = i / Math.cos((Math.PI / 180) * this.lat);
              return X(
                [this.lat - i, this.lng - r],
                [this.lat + i, this.lng + r],
              );
            },
            clone: function () {
              return new pe(this.lat, this.lng, this.alt);
            },
          };
          function he(s, i, r) {
            return s instanceof pe
              ? s
              : ie(s) && typeof s[0] != "object"
                ? s.length === 3
                  ? new pe(s[0], s[1], s[2])
                  : s.length === 2
                    ? new pe(s[0], s[1])
                    : null
                : s == null
                  ? s
                  : typeof s == "object" && "lat" in s
                    ? new pe(s.lat, "lng" in s ? s.lng : s.lon, s.alt)
                    : i === void 0
                      ? null
                      : new pe(s, i, r);
          }
          var Ne = {
              latLngToPoint: function (s, i) {
                var r = this.projection.project(s),
                  d = this.scale(i);
                return this.transformation._transform(r, d);
              },
              pointToLatLng: function (s, i) {
                var r = this.scale(i),
                  d = this.transformation.untransform(s, r);
                return this.projection.unproject(d);
              },
              project: function (s) {
                return this.projection.project(s);
              },
              unproject: function (s) {
                return this.projection.unproject(s);
              },
              scale: function (s) {
                return 256 * Math.pow(2, s);
              },
              zoom: function (s) {
                return Math.log(s / 256) / Math.LN2;
              },
              getProjectedBounds: function (s) {
                if (this.infinite) return null;
                var i = this.projection.bounds,
                  r = this.scale(s),
                  d = this.transformation.transform(i.min, r),
                  h = this.transformation.transform(i.max, r);
                return new g(d, h);
              },
              infinite: !1,
              wrapLatLng: function (s) {
                var i = this.wrapLng ? fe(s.lng, this.wrapLng, !0) : s.lng,
                  r = this.wrapLat ? fe(s.lat, this.wrapLat, !0) : s.lat,
                  d = s.alt;
                return new pe(r, i, d);
              },
              wrapLatLngBounds: function (s) {
                var i = s.getCenter(),
                  r = this.wrapLatLng(i),
                  d = i.lat - r.lat,
                  h = i.lng - r.lng;
                if (d === 0 && h === 0) return s;
                var p = s.getSouthWest(),
                  j = s.getNorthEast(),
                  M = new pe(p.lat - d, p.lng - h),
                  H = new pe(j.lat - d, j.lng - h);
                return new I(M, H);
              },
            },
            $e = V({}, Ne, {
              wrapLng: [-180, 180],
              R: 6371e3,
              distance: function (s, i) {
                var r = Math.PI / 180,
                  d = s.lat * r,
                  h = i.lat * r,
                  p = Math.sin(((i.lat - s.lat) * r) / 2),
                  j = Math.sin(((i.lng - s.lng) * r) / 2),
                  M = p * p + Math.cos(d) * Math.cos(h) * j * j,
                  H = 2 * Math.atan2(Math.sqrt(M), Math.sqrt(1 - M));
                return this.R * H;
              },
            }),
            ae = 6378137,
            ze = {
              R: ae,
              MAX_LATITUDE: 85.0511287798,
              project: function (s) {
                var i = Math.PI / 180,
                  r = this.MAX_LATITUDE,
                  d = Math.max(Math.min(r, s.lat), -r),
                  h = Math.sin(d * i);
                return new O(
                  this.R * s.lng * i,
                  (this.R * Math.log((1 + h) / (1 - h))) / 2,
                );
              },
              unproject: function (s) {
                var i = 180 / Math.PI;
                return new pe(
                  (2 * Math.atan(Math.exp(s.y / this.R)) - Math.PI / 2) * i,
                  (s.x * i) / this.R,
                );
              },
              bounds: (function () {
                var s = ae * Math.PI;
                return new g([-s, -s], [s, s]);
              })(),
            };
          function at(s, i, r, d) {
            if (ie(s)) {
              ((this._a = s[0]),
                (this._b = s[1]),
                (this._c = s[2]),
                (this._d = s[3]));
              return;
            }
            ((this._a = s), (this._b = i), (this._c = r), (this._d = d));
          }
          at.prototype = {
            transform: function (s, i) {
              return this._transform(s.clone(), i);
            },
            _transform: function (s, i) {
              return (
                (i = i || 1),
                (s.x = i * (this._a * s.x + this._b)),
                (s.y = i * (this._c * s.y + this._d)),
                s
              );
            },
            untransform: function (s, i) {
              return (
                (i = i || 1),
                new O(
                  (s.x / i - this._b) / this._a,
                  (s.y / i - this._d) / this._c,
                )
              );
            },
          };
          function bt(s, i, r, d) {
            return new at(s, i, r, d);
          }
          var Mt = V({}, $e, {
              code: "EPSG:3857",
              projection: ze,
              transformation: (function () {
                var s = 0.5 / (Math.PI * ze.R);
                return bt(s, 0.5, -s, 0.5);
              })(),
            }),
            ge = V({}, Mt, { code: "EPSG:900913" });
          function Me(s) {
            return document.createElementNS("http://www.w3.org/2000/svg", s);
          }
          function mt(s, i) {
            var r = "",
              d,
              h,
              p,
              j,
              M,
              H;
            for (d = 0, p = s.length; d < p; d++) {
              for (M = s[d], h = 0, j = M.length; h < j; h++)
                ((H = M[h]), (r += (h ? "L" : "M") + H.x + " " + H.y));
              r += i ? (v.svg ? "z" : "x") : "";
            }
            return r || "M0 0";
          }
          var st = document.documentElement.style,
            Z = "ActiveXObject" in window,
            _e = Z && !document.addEventListener,
            Ze = "msLaunchUri" in navigator && !("documentMode" in document),
            Xe = ga("webkit"),
            Ht = ga("android"),
            St = ga("android 2") || ga("android 3"),
            E = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10),
            Re = Ht && ga("Google") && E < 537 && !("AudioNode" in window),
            qe = !!window.opera,
            Fe = !Ze && ga("chrome"),
            fa = ga("gecko") && !Xe && !qe && !Z,
            Aa = !Fe && ga("safari"),
            ps = ga("phantom"),
            ra = "OTransition" in st,
            es = navigator.platform.indexOf("Win") === 0,
            Ft = Z && "transition" in st,
            Tt =
              "WebKitCSSMatrix" in window &&
              "m11" in new window.WebKitCSSMatrix() &&
              !St,
            oa = "MozPerspective" in st,
            Zt = !window.L_DISABLE_3D && (Ft || Tt || oa) && !ra && !ps,
            ts = typeof orientation < "u" || ga("mobile"),
            ja = ts && Xe,
            _s = ts && Tt,
            xe = !window.PointerEvent && window.MSPointerEvent,
            pt = !!(window.PointerEvent || xe),
            Xt = "ontouchstart" in window || !!window.TouchEvent,
            Pt = !window.L_NO_TOUCH && (Xt || pt),
            Ya = ts && qe,
            Xa = ts && fa,
            an =
              (window.devicePixelRatio ||
                window.screen.deviceXDPI / window.screen.logicalXDPI) > 1,
            ws = (function () {
              var s = !1;
              try {
                var i = Object.defineProperty({}, "passive", {
                  get: function () {
                    s = !0;
                  },
                });
                (window.addEventListener("testPassiveEventSupport", G, i),
                  window.removeEventListener("testPassiveEventSupport", G, i));
              } catch {}
              return s;
            })(),
            ks = (function () {
              return !!document.createElement("canvas").getContext;
            })(),
            Na = !!(document.createElementNS && Me("svg").createSVGRect),
            $t =
              !!Na &&
              (function () {
                var s = document.createElement("div");
                return (
                  (s.innerHTML = "<svg/>"),
                  (s.firstChild && s.firstChild.namespaceURI) ===
                    "http://www.w3.org/2000/svg"
                );
              })(),
            sn =
              !Na &&
              (function () {
                try {
                  var s = document.createElement("div");
                  s.innerHTML = '<v:shape adj="1"/>';
                  var i = s.firstChild;
                  return (
                    (i.style.behavior = "url(#default#VML)"),
                    i && typeof i.adj == "object"
                  );
                } catch {
                  return !1;
                }
              })(),
            Qn = navigator.platform.indexOf("Mac") === 0,
            _n = navigator.platform.indexOf("Linux") === 0;
          function ga(s) {
            return navigator.userAgent.toLowerCase().indexOf(s) >= 0;
          }
          var v = {
              ie: Z,
              ielt9: _e,
              edge: Ze,
              webkit: Xe,
              android: Ht,
              android23: St,
              androidStock: Re,
              opera: qe,
              chrome: Fe,
              gecko: fa,
              safari: Aa,
              phantom: ps,
              opera12: ra,
              win: es,
              ie3d: Ft,
              webkit3d: Tt,
              gecko3d: oa,
              any3d: Zt,
              mobile: ts,
              mobileWebkit: ja,
              mobileWebkit3d: _s,
              msPointer: xe,
              pointer: pt,
              touch: Pt,
              touchNative: Xt,
              mobileOpera: Ya,
              mobileGecko: Xa,
              retina: an,
              passiveEvents: ws,
              canvas: ks,
              svg: Na,
              vml: sn,
              inlineSvg: $t,
              mac: Qn,
              linux: _n,
            },
            Pe = v.msPointer ? "MSPointerDown" : "pointerdown",
            vt = v.msPointer ? "MSPointerMove" : "pointermove",
            Ut = v.msPointer ? "MSPointerUp" : "pointerup",
            we = v.msPointer ? "MSPointerCancel" : "pointercancel",
            Ve = {
              touchstart: Pe,
              touchmove: vt,
              touchend: Ut,
              touchcancel: we,
            },
            rt = {
              touchstart: Ss,
              touchmove: qt,
              touchend: qt,
              touchcancel: qt,
            },
            We = {},
            nt = !1;
          function ea(s, i, r) {
            return (
              i === "touchstart" && _a(),
              rt[i]
                ? ((r = rt[i].bind(this, r)),
                  s.addEventListener(Ve[i], r, !1),
                  r)
                : (console.warn("wrong event specified:", i), G)
            );
          }
          function as(s, i, r) {
            if (!Ve[i]) {
              console.warn("wrong event specified:", i);
              return;
            }
            s.removeEventListener(Ve[i], r, !1);
          }
          function Ot(s) {
            We[s.pointerId] = s;
          }
          function Ra(s) {
            We[s.pointerId] && (We[s.pointerId] = s);
          }
          function It(s) {
            delete We[s.pointerId];
          }
          function _a() {
            nt ||
              (document.addEventListener(Pe, Ot, !0),
              document.addEventListener(vt, Ra, !0),
              document.addEventListener(Ut, It, !0),
              document.addEventListener(we, It, !0),
              (nt = !0));
          }
          function qt(s, i) {
            if (i.pointerType !== (i.MSPOINTER_TYPE_MOUSE || "mouse")) {
              i.touches = [];
              for (var r in We) i.touches.push(We[r]);
              ((i.changedTouches = [i]), s(i));
            }
          }
          function Ss(s, i) {
            (i.MSPOINTER_TYPE_TOUCH &&
              i.pointerType === i.MSPOINTER_TYPE_TOUCH &&
              Vt(i),
              qt(s, i));
          }
          function ca(s) {
            var i = {},
              r,
              d;
            for (d in s) ((r = s[d]), (i[d] = r && r.bind ? r.bind(s) : r));
            return (
              (s = i),
              (i.type = "dblclick"),
              (i.detail = 2),
              (i.isTrusted = !1),
              (i._simulated = !0),
              i
            );
          }
          var Ma = 200;
          function Ts(s, i) {
            s.addEventListener("dblclick", i);
            var r = 0,
              d;
            function h(p) {
              if (p.detail !== 1) {
                d = p.detail;
                return;
              }
              if (
                !(
                  p.pointerType === "mouse" ||
                  (p.sourceCapabilities &&
                    !p.sourceCapabilities.firesTouchEvents)
                )
              ) {
                var j = Zs(p);
                if (
                  !(
                    j.some(function (H) {
                      return H instanceof HTMLLabelElement && H.attributes.for;
                    }) &&
                    !j.some(function (H) {
                      return (
                        H instanceof HTMLInputElement ||
                        H instanceof HTMLSelectElement
                      );
                    })
                  )
                ) {
                  var M = Date.now();
                  (M - r <= Ma ? (d++, d === 2 && i(ca(p))) : (d = 1), (r = M));
                }
              }
            }
            return (
              s.addEventListener("click", h),
              { dblclick: i, simDblclick: h }
            );
          }
          function aa(s, i) {
            (s.removeEventListener("dblclick", i.dblclick),
              s.removeEventListener("click", i.simDblclick));
          }
          var wa = ln([
              "transform",
              "webkitTransform",
              "OTransform",
              "MozTransform",
              "msTransform",
            ]),
            ka = ln([
              "webkitTransition",
              "transition",
              "OTransition",
              "MozTransition",
              "msTransition",
            ]),
            Hs =
              ka === "webkitTransition" || ka === "OTransition"
                ? ka + "End"
                : "transitionend";
          function ba(s) {
            return typeof s == "string" ? document.getElementById(s) : s;
          }
          function za(s, i) {
            var r = s.style[i] || (s.currentStyle && s.currentStyle[i]);
            if ((!r || r === "auto") && document.defaultView) {
              var d = document.defaultView.getComputedStyle(s, null);
              r = d ? d[i] : null;
            }
            return r === "auto" ? null : r;
          }
          function Be(s, i, r) {
            var d = document.createElement(s);
            return ((d.className = i || ""), r && r.appendChild(d), d);
          }
          function ot(s) {
            var i = s.parentNode;
            i && i.removeChild(s);
          }
          function yt(s) {
            for (; s.firstChild; ) s.removeChild(s.firstChild);
          }
          function Ct(s) {
            var i = s.parentNode;
            i && i.lastChild !== s && i.appendChild(s);
          }
          function xs(s) {
            var i = s.parentNode;
            i && i.firstChild !== s && i.insertBefore(s, i.firstChild);
          }
          function Us(s, i) {
            if (s.classList !== void 0) return s.classList.contains(i);
            var r = Wn(s);
            return (
              r.length > 0 && new RegExp("(^|\\s)" + i + "(\\s|$)").test(r)
            );
          }
          function Je(s, i) {
            if (s.classList !== void 0)
              for (var r = ve(i), d = 0, h = r.length; d < h; d++)
                s.classList.add(r[d]);
            else if (!Us(s, i)) {
              var p = Wn(s);
              nn(s, (p ? p + " " : "") + i);
            }
          }
          function Kt(s, i) {
            s.classList !== void 0
              ? s.classList.remove(i)
              : nn(s, ce((" " + Wn(s) + " ").replace(" " + i + " ", " ")));
          }
          function nn(s, i) {
            s.className.baseVal === void 0
              ? (s.className = i)
              : (s.className.baseVal = i);
          }
          function Wn(s) {
            return (
              s.correspondingElement && (s = s.correspondingElement),
              s.className.baseVal === void 0 ? s.className : s.className.baseVal
            );
          }
          function Dt(s, i) {
            "opacity" in s.style
              ? (s.style.opacity = i)
              : "filter" in s.style && Li(s, i);
          }
          function Li(s, i) {
            var r = !1,
              d = "DXImageTransform.Microsoft.Alpha";
            try {
              r = s.filters.item(d);
            } catch {
              if (i === 1) return;
            }
            ((i = Math.round(i * 100)),
              r
                ? ((r.Enabled = i !== 100), (r.Opacity = i))
                : (s.style.filter += " progid:" + d + "(opacity=" + i + ")"));
          }
          function ln(s) {
            for (
              var i = document.documentElement.style, r = 0;
              r < s.length;
              r++
            )
              if (s[r] in i) return s[r];
            return !1;
          }
          function $a(s, i, r) {
            var d = i || new O(0, 0);
            s.style[wa] =
              (v.ie3d
                ? "translate(" + d.x + "px," + d.y + "px)"
                : "translate3d(" + d.x + "px," + d.y + "px,0)") +
              (r ? " scale(" + r + ")" : "");
          }
          function At(s, i) {
            ((s._leaflet_pos = i),
              v.any3d
                ? $a(s, i)
                : ((s.style.left = i.x + "px"), (s.style.top = i.y + "px")));
          }
          function Cs(s) {
            return s._leaflet_pos || new O(0, 0);
          }
          var Is, Ba, Fn;
          if ("onselectstart" in document)
            ((Is = function () {
              Ge(window, "selectstart", Vt);
            }),
              (Ba = function () {
                xt(window, "selectstart", Vt);
              }));
          else {
            var rn = ln([
              "userSelect",
              "WebkitUserSelect",
              "OUserSelect",
              "MozUserSelect",
              "msUserSelect",
            ]);
            ((Is = function () {
              if (rn) {
                var s = document.documentElement.style;
                ((Fn = s[rn]), (s[rn] = "none"));
              }
            }),
              (Ba = function () {
                rn &&
                  ((document.documentElement.style[rn] = Fn), (Fn = void 0));
              }));
          }
          function wn() {
            Ge(window, "dragstart", Vt);
          }
          function kn() {
            xt(window, "dragstart", Vt);
          }
          var Sn, Ei;
          function Gs(s) {
            for (; s.tabIndex === -1; ) s = s.parentNode;
            s.style &&
              (Ha(),
              (Sn = s),
              (Ei = s.style.outlineStyle),
              (s.style.outlineStyle = "none"),
              Ge(window, "keydown", Ha));
          }
          function Ha() {
            Sn &&
              ((Sn.style.outlineStyle = Ei),
              (Sn = void 0),
              (Ei = void 0),
              xt(window, "keydown", Ha));
          }
          function Tn(s) {
            do s = s.parentNode;
            while ((!s.offsetWidth || !s.offsetHeight) && s !== document.body);
            return s;
          }
          function Cn(s) {
            var i = s.getBoundingClientRect();
            return {
              x: i.width / s.offsetWidth || 1,
              y: i.height / s.offsetHeight || 1,
              boundingClientRect: i,
            };
          }
          var Ks = {
            __proto__: null,
            TRANSFORM: wa,
            TRANSITION: ka,
            TRANSITION_END: Hs,
            get: ba,
            getStyle: za,
            create: Be,
            remove: ot,
            empty: yt,
            toFront: Ct,
            toBack: xs,
            hasClass: Us,
            addClass: Je,
            removeClass: Kt,
            setClass: nn,
            getClass: Wn,
            setOpacity: Dt,
            testProp: ln,
            setTransform: $a,
            setPosition: At,
            getPosition: Cs,
            get disableTextSelection() {
              return Is;
            },
            get enableTextSelection() {
              return Ba;
            },
            disableImageDrag: wn,
            enableImageDrag: kn,
            preventOutline: Gs,
            restoreOutline: Ha,
            getSizedParentNode: Tn,
            getScale: Cn,
          };
          function Ge(s, i, r, d) {
            if (i && typeof i == "object") for (var h in i) Ua(s, h, i[h], r);
            else {
              i = ve(i);
              for (var p = 0, j = i.length; p < j; p++) Ua(s, i[p], r, d);
            }
            return this;
          }
          var Jt = "_leaflet_events";
          function xt(s, i, r, d) {
            if (arguments.length === 1) (hl(s), delete s[Jt]);
            else if (i && typeof i == "object")
              for (var h in i) An(s, h, i[h], r);
            else if (((i = ve(i)), arguments.length === 2))
              hl(s, function (M) {
                return $(i, M) !== -1;
              });
            else for (var p = 0, j = i.length; p < j; p++) An(s, i[p], r, d);
            return this;
          }
          function hl(s, i) {
            for (var r in s[Jt]) {
              var d = r.split(/\d/)[0];
              (!i || i(d)) && An(s, d, null, null, r);
            }
          }
          var on = {
            mouseenter: "mouseover",
            mouseleave: "mouseout",
            wheel: !("onwheel" in window) && "mousewheel",
          };
          function Ua(s, i, r, d) {
            var h = i + B(r) + (d ? "_" + B(d) : "");
            if (s[Jt] && s[Jt][h]) return this;
            var p = function (M) {
                return r.call(d || s, M || window.event);
              },
              j = p;
            (!v.touchNative && v.pointer && i.indexOf("touch") === 0
              ? (p = ea(s, i, p))
              : v.touch && i === "dblclick"
                ? (p = Ts(s, p))
                : "addEventListener" in s
                  ? i === "touchstart" ||
                    i === "touchmove" ||
                    i === "wheel" ||
                    i === "mousewheel"
                    ? s.addEventListener(
                        on[i] || i,
                        p,
                        v.passiveEvents ? { passive: !1 } : !1,
                      )
                    : i === "mouseenter" || i === "mouseleave"
                      ? ((p = function (M) {
                          ((M = M || window.event), Ga(s, M) && j(M));
                        }),
                        s.addEventListener(on[i], p, !1))
                      : s.addEventListener(i, j, !1)
                  : s.attachEvent("on" + i, p),
              (s[Jt] = s[Jt] || {}),
              (s[Jt][h] = p));
          }
          function An(s, i, r, d, h) {
            h = h || i + B(r) + (d ? "_" + B(d) : "");
            var p = s[Jt] && s[Jt][h];
            if (!p) return this;
            (!v.touchNative && v.pointer && i.indexOf("touch") === 0
              ? as(s, i, p)
              : v.touch && i === "dblclick"
                ? aa(s, p)
                : "removeEventListener" in s
                  ? s.removeEventListener(on[i] || i, p, !1)
                  : s.detachEvent("on" + i, p),
              (s[Jt][h] = null));
          }
          function Ia(s) {
            return (
              s.stopPropagation
                ? s.stopPropagation()
                : s.originalEvent
                  ? (s.originalEvent._stopped = !0)
                  : (s.cancelBubble = !0),
              this
            );
          }
          function ss(s) {
            return (Ua(s, "wheel", Ia), this);
          }
          function As(s) {
            return (
              Ge(s, "mousedown touchstart dblclick contextmenu", Ia),
              (s._leaflet_disable_click = !0),
              this
            );
          }
          function Vt(s) {
            return (
              s.preventDefault ? s.preventDefault() : (s.returnValue = !1),
              this
            );
          }
          function Ja(s) {
            return (Vt(s), Ia(s), this);
          }
          function Zs(s) {
            if (s.composedPath) return s.composedPath();
            for (var i = [], r = s.target; r; ) (i.push(r), (r = r.parentNode));
            return i;
          }
          function qs(s, i) {
            if (!i) return new O(s.clientX, s.clientY);
            var r = Cn(i),
              d = r.boundingClientRect;
            return new O(
              (s.clientX - d.left) / r.x - i.clientLeft,
              (s.clientY - d.top) / r.y - i.clientTop,
            );
          }
          var ml =
            v.linux && v.chrome
              ? window.devicePixelRatio
              : v.mac
                ? window.devicePixelRatio * 3
                : window.devicePixelRatio > 0
                  ? 2 * window.devicePixelRatio
                  : 1;
          function Qt(s) {
            return v.edge
              ? s.wheelDeltaY / 2
              : s.deltaY && s.deltaMode === 0
                ? -s.deltaY / ml
                : s.deltaY && s.deltaMode === 1
                  ? -s.deltaY * 20
                  : s.deltaY && s.deltaMode === 2
                    ? -s.deltaY * 60
                    : s.deltaX || s.deltaZ
                      ? 0
                      : s.wheelDelta
                        ? (s.wheelDeltaY || s.wheelDelta) / 2
                        : s.detail && Math.abs(s.detail) < 32765
                          ? -s.detail * 20
                          : s.detail
                            ? (s.detail / -32765) * 60
                            : 0;
          }
          function Ga(s, i) {
            var r = i.relatedTarget;
            if (!r) return !0;
            try {
              for (; r && r !== s; ) r = r.parentNode;
            } catch {
              return !1;
            }
            return r !== s;
          }
          var ei = {
              __proto__: null,
              on: Ge,
              off: xt,
              stopPropagation: Ia,
              disableScrollPropagation: ss,
              disableClickPropagation: As,
              preventDefault: Vt,
              stop: Ja,
              getPropagationPath: Zs,
              getMousePosition: qs,
              getWheelDelta: Qt,
              isExternalTarget: Ga,
              addListener: Ge,
              removeListener: xt,
            },
            cn = K.extend({
              run: function (s, i, r, d) {
                (this.stop(),
                  (this._el = s),
                  (this._inProgress = !0),
                  (this._duration = r || 0.25),
                  (this._easeOutPower = 1 / Math.max(d || 0.5, 0.2)),
                  (this._startPos = Cs(s)),
                  (this._offset = i.subtract(this._startPos)),
                  (this._startTime = +new Date()),
                  this.fire("start"),
                  this._animate());
              },
              stop: function () {
                this._inProgress && (this._step(!0), this._complete());
              },
              _animate: function () {
                ((this._animId = me(this._animate, this)), this._step());
              },
              _step: function (s) {
                var i = +new Date() - this._startTime,
                  r = this._duration * 1e3;
                i < r
                  ? this._runFrame(this._easeOut(i / r), s)
                  : (this._runFrame(1), this._complete());
              },
              _runFrame: function (s, i) {
                var r = this._startPos.add(this._offset.multiplyBy(s));
                (i && r._round(), At(this._el, r), this.fire("step"));
              },
              _complete: function () {
                (Oe(this._animId), (this._inProgress = !1), this.fire("end"));
              },
              _easeOut: function (s) {
                return 1 - Math.pow(1 - s, this._easeOutPower);
              },
            }),
            et = K.extend({
              options: {
                crs: Mt,
                center: void 0,
                zoom: void 0,
                minZoom: void 0,
                maxZoom: void 0,
                layers: [],
                maxBounds: void 0,
                renderer: void 0,
                zoomAnimation: !0,
                zoomAnimationThreshold: 4,
                fadeAnimation: !0,
                markerZoomAnimation: !0,
                transform3DLimit: 8388608,
                zoomSnap: 1,
                zoomDelta: 1,
                trackResize: !0,
              },
              initialize: function (s, i) {
                ((i = Y(this, i)),
                  (this._handlers = []),
                  (this._layers = {}),
                  (this._zoomBoundLayers = {}),
                  (this._sizeChanged = !0),
                  this._initContainer(s),
                  this._initLayout(),
                  (this._onResize = re(this._onResize, this)),
                  this._initEvents(),
                  i.maxBounds && this.setMaxBounds(i.maxBounds),
                  i.zoom !== void 0 && (this._zoom = this._limitZoom(i.zoom)),
                  i.center &&
                    i.zoom !== void 0 &&
                    this.setView(he(i.center), i.zoom, { reset: !0 }),
                  this.callInitHooks(),
                  (this._zoomAnimated =
                    ka &&
                    v.any3d &&
                    !v.mobileOpera &&
                    this.options.zoomAnimation),
                  this._zoomAnimated &&
                    (this._createAnimProxy(),
                    Ge(this._proxy, Hs, this._catchTransitionEnd, this)),
                  this._addLayers(this.options.layers));
              },
              setView: function (s, i, r) {
                if (
                  ((i = i === void 0 ? this._zoom : this._limitZoom(i)),
                  (s = this._limitCenter(he(s), i, this.options.maxBounds)),
                  (r = r || {}),
                  this._stop(),
                  this._loaded && !r.reset && r !== !0)
                ) {
                  r.animate !== void 0 &&
                    ((r.zoom = V({ animate: r.animate }, r.zoom)),
                    (r.pan = V(
                      { animate: r.animate, duration: r.duration },
                      r.pan,
                    )));
                  var d =
                    this._zoom !== i
                      ? this._tryAnimatedZoom &&
                        this._tryAnimatedZoom(s, i, r.zoom)
                      : this._tryAnimatedPan(s, r.pan);
                  if (d) return (clearTimeout(this._sizeTimer), this);
                }
                return (
                  this._resetView(s, i, r.pan && r.pan.noMoveStart),
                  this
                );
              },
              setZoom: function (s, i) {
                return this._loaded
                  ? this.setView(this.getCenter(), s, { zoom: i })
                  : ((this._zoom = s), this);
              },
              zoomIn: function (s, i) {
                return (
                  (s = s || (v.any3d ? this.options.zoomDelta : 1)),
                  this.setZoom(this._zoom + s, i)
                );
              },
              zoomOut: function (s, i) {
                return (
                  (s = s || (v.any3d ? this.options.zoomDelta : 1)),
                  this.setZoom(this._zoom - s, i)
                );
              },
              setZoomAround: function (s, i, r) {
                var d = this.getZoomScale(i),
                  h = this.getSize().divideBy(2),
                  p = s instanceof O ? s : this.latLngToContainerPoint(s),
                  j = p.subtract(h).multiplyBy(1 - 1 / d),
                  M = this.containerPointToLatLng(h.add(j));
                return this.setView(M, i, { zoom: r });
              },
              _getBoundsCenterZoom: function (s, i) {
                ((i = i || {}), (s = s.getBounds ? s.getBounds() : X(s)));
                var r = z(i.paddingTopLeft || i.padding || [0, 0]),
                  d = z(i.paddingBottomRight || i.padding || [0, 0]),
                  h = this.getBoundsZoom(s, !1, r.add(d));
                if (
                  ((h =
                    typeof i.maxZoom == "number" ? Math.min(i.maxZoom, h) : h),
                  h === 1 / 0)
                )
                  return { center: s.getCenter(), zoom: h };
                var p = d.subtract(r).divideBy(2),
                  j = this.project(s.getSouthWest(), h),
                  M = this.project(s.getNorthEast(), h),
                  H = this.unproject(j.add(M).divideBy(2).add(p), h);
                return { center: H, zoom: h };
              },
              fitBounds: function (s, i) {
                if (((s = X(s)), !s.isValid()))
                  throw new Error("Bounds are not valid.");
                var r = this._getBoundsCenterZoom(s, i);
                return this.setView(r.center, r.zoom, i);
              },
              fitWorld: function (s) {
                return this.fitBounds(
                  [
                    [-90, -180],
                    [90, 180],
                  ],
                  s,
                );
              },
              panTo: function (s, i) {
                return this.setView(s, this._zoom, { pan: i });
              },
              panBy: function (s, i) {
                if (((s = z(s).round()), (i = i || {}), !s.x && !s.y))
                  return this.fire("moveend");
                if (i.animate !== !0 && !this.getSize().contains(s))
                  return (
                    this._resetView(
                      this.unproject(this.project(this.getCenter()).add(s)),
                      this.getZoom(),
                    ),
                    this
                  );
                if (
                  (this._panAnim ||
                    ((this._panAnim = new cn()),
                    this._panAnim.on(
                      {
                        step: this._onPanTransitionStep,
                        end: this._onPanTransitionEnd,
                      },
                      this,
                    )),
                  i.noMoveStart || this.fire("movestart"),
                  i.animate !== !1)
                ) {
                  Je(this._mapPane, "leaflet-pan-anim");
                  var r = this._getMapPanePos().subtract(s).round();
                  this._panAnim.run(
                    this._mapPane,
                    r,
                    i.duration || 0.25,
                    i.easeLinearity,
                  );
                } else (this._rawPanBy(s), this.fire("move").fire("moveend"));
                return this;
              },
              flyTo: function (s, i, r) {
                if (((r = r || {}), r.animate === !1 || !v.any3d))
                  return this.setView(s, i, r);
                this._stop();
                var d = this.project(this.getCenter()),
                  h = this.project(s),
                  p = this.getSize(),
                  j = this._zoom;
                ((s = he(s)), (i = i === void 0 ? j : i));
                var M = Math.max(p.x, p.y),
                  H = M * this.getZoomScale(j, i),
                  se = h.distanceTo(d) || 1,
                  ye = 1.42,
                  De = ye * ye;
                function it(ta) {
                  var Qs = ta ? -1 : 1,
                    Dn = ta ? H : M,
                    gr = H * H - M * M + Qs * De * De * se * se,
                    el = 2 * Dn * De * se,
                    tl = gr / el,
                    bn = Math.sqrt(tl * tl + 1) - tl,
                    Ws = bn < 1e-9 ? -18 : Math.log(bn);
                  return Ws;
                }
                function va(ta) {
                  return (Math.exp(ta) - Math.exp(-ta)) / 2;
                }
                function sa(ta) {
                  return (Math.exp(ta) + Math.exp(-ta)) / 2;
                }
                function Wa(ta) {
                  return va(ta) / sa(ta);
                }
                var jt = it(0);
                function Nt(ta) {
                  return M * (sa(jt) / sa(jt + ye * ta));
                }
                function dt(ta) {
                  return (M * (sa(jt) * Wa(jt + ye * ta) - va(jt))) / De;
                }
                function fn(ta) {
                  return 1 - Math.pow(1 - ta, 1.5);
                }
                var rs = Date.now(),
                  Ll = (it(1) - jt) / ye,
                  gn = r.duration ? 1e3 * r.duration : 1e3 * Ll * 0.8;
                function fr() {
                  var ta = (Date.now() - rs) / gn,
                    Qs = fn(ta) * Ll;
                  ta <= 1
                    ? ((this._flyToFrame = me(fr, this)),
                      this._move(
                        this.unproject(
                          d.add(h.subtract(d).multiplyBy(dt(Qs) / se)),
                          j,
                        ),
                        this.getScaleZoom(M / Nt(Qs), j),
                        { flyTo: !0 },
                      ))
                    : this._move(s, i)._moveEnd(!0);
                }
                return (
                  this._moveStart(!0, r.noMoveStart),
                  fr.call(this),
                  this
                );
              },
              flyToBounds: function (s, i) {
                var r = this._getBoundsCenterZoom(s, i);
                return this.flyTo(r.center, r.zoom, i);
              },
              setMaxBounds: function (s) {
                return (
                  (s = X(s)),
                  this.listens("moveend", this._panInsideMaxBounds) &&
                    this.off("moveend", this._panInsideMaxBounds),
                  s.isValid()
                    ? ((this.options.maxBounds = s),
                      this._loaded && this._panInsideMaxBounds(),
                      this.on("moveend", this._panInsideMaxBounds))
                    : ((this.options.maxBounds = null), this)
                );
              },
              setMinZoom: function (s) {
                var i = this.options.minZoom;
                return (
                  (this.options.minZoom = s),
                  this._loaded &&
                  i !== s &&
                  (this.fire("zoomlevelschange"),
                  this.getZoom() < this.options.minZoom)
                    ? this.setZoom(s)
                    : this
                );
              },
              setMaxZoom: function (s) {
                var i = this.options.maxZoom;
                return (
                  (this.options.maxZoom = s),
                  this._loaded &&
                  i !== s &&
                  (this.fire("zoomlevelschange"),
                  this.getZoom() > this.options.maxZoom)
                    ? this.setZoom(s)
                    : this
                );
              },
              panInsideBounds: function (s, i) {
                this._enforcingBounds = !0;
                var r = this.getCenter(),
                  d = this._limitCenter(r, this._zoom, X(s));
                return (
                  r.equals(d) || this.panTo(d, i),
                  (this._enforcingBounds = !1),
                  this
                );
              },
              panInside: function (s, i) {
                i = i || {};
                var r = z(i.paddingTopLeft || i.padding || [0, 0]),
                  d = z(i.paddingBottomRight || i.padding || [0, 0]),
                  h = this.project(this.getCenter()),
                  p = this.project(s),
                  j = this.getPixelBounds(),
                  M = C([j.min.add(r), j.max.subtract(d)]),
                  H = M.getSize();
                if (!M.contains(p)) {
                  this._enforcingBounds = !0;
                  var se = p.subtract(M.getCenter()),
                    ye = M.extend(p).getSize().subtract(H);
                  ((h.x += se.x < 0 ? -ye.x : ye.x),
                    (h.y += se.y < 0 ? -ye.y : ye.y),
                    this.panTo(this.unproject(h), i),
                    (this._enforcingBounds = !1));
                }
                return this;
              },
              invalidateSize: function (s) {
                if (!this._loaded) return this;
                s = V({ animate: !1, pan: !0 }, s === !0 ? { animate: !0 } : s);
                var i = this.getSize();
                ((this._sizeChanged = !0), (this._lastCenter = null));
                var r = this.getSize(),
                  d = i.divideBy(2).round(),
                  h = r.divideBy(2).round(),
                  p = d.subtract(h);
                return !p.x && !p.y
                  ? this
                  : (s.animate && s.pan
                      ? this.panBy(p)
                      : (s.pan && this._rawPanBy(p),
                        this.fire("move"),
                        s.debounceMoveend
                          ? (clearTimeout(this._sizeTimer),
                            (this._sizeTimer = setTimeout(
                              re(this.fire, this, "moveend"),
                              200,
                            )))
                          : this.fire("moveend")),
                    this.fire("resize", { oldSize: i, newSize: r }));
              },
              stop: function () {
                return (
                  this.setZoom(this._limitZoom(this._zoom)),
                  this.options.zoomSnap || this.fire("viewreset"),
                  this._stop()
                );
              },
              locate: function (s) {
                if (
                  ((s = this._locateOptions =
                    V({ timeout: 1e4, watch: !1 }, s)),
                  !("geolocation" in navigator))
                )
                  return (
                    this._handleGeolocationError({
                      code: 0,
                      message: "Geolocation not supported.",
                    }),
                    this
                  );
                var i = re(this._handleGeolocationResponse, this),
                  r = re(this._handleGeolocationError, this);
                return (
                  s.watch
                    ? (this._locationWatchId =
                        navigator.geolocation.watchPosition(i, r, s))
                    : navigator.geolocation.getCurrentPosition(i, r, s),
                  this
                );
              },
              stopLocate: function () {
                return (
                  navigator.geolocation &&
                    navigator.geolocation.clearWatch &&
                    navigator.geolocation.clearWatch(this._locationWatchId),
                  this._locateOptions && (this._locateOptions.setView = !1),
                  this
                );
              },
              _handleGeolocationError: function (s) {
                if (this._container._leaflet_id) {
                  var i = s.code,
                    r =
                      s.message ||
                      (i === 1
                        ? "permission denied"
                        : i === 2
                          ? "position unavailable"
                          : "timeout");
                  (this._locateOptions.setView &&
                    !this._loaded &&
                    this.fitWorld(),
                    this.fire("locationerror", {
                      code: i,
                      message: "Geolocation error: " + r + ".",
                    }));
                }
              },
              _handleGeolocationResponse: function (s) {
                if (this._container._leaflet_id) {
                  var i = s.coords.latitude,
                    r = s.coords.longitude,
                    d = new pe(i, r),
                    h = d.toBounds(s.coords.accuracy * 2),
                    p = this._locateOptions;
                  if (p.setView) {
                    var j = this.getBoundsZoom(h);
                    this.setView(d, p.maxZoom ? Math.min(j, p.maxZoom) : j);
                  }
                  var M = { latlng: d, bounds: h, timestamp: s.timestamp };
                  for (var H in s.coords)
                    typeof s.coords[H] == "number" && (M[H] = s.coords[H]);
                  this.fire("locationfound", M);
                }
              },
              addHandler: function (s, i) {
                if (!i) return this;
                var r = (this[s] = new i(this));
                return (
                  this._handlers.push(r),
                  this.options[s] && r.enable(),
                  this
                );
              },
              remove: function () {
                if (
                  (this._initEvents(!0),
                  this.options.maxBounds &&
                    this.off("moveend", this._panInsideMaxBounds),
                  this._containerId !== this._container._leaflet_id)
                )
                  throw new Error(
                    "Map container is being reused by another instance",
                  );
                try {
                  (delete this._container._leaflet_id,
                    delete this._containerId);
                } catch {
                  ((this._container._leaflet_id = void 0),
                    (this._containerId = void 0));
                }
                (this._locationWatchId !== void 0 && this.stopLocate(),
                  this._stop(),
                  ot(this._mapPane),
                  this._clearControlPos && this._clearControlPos(),
                  this._resizeRequest &&
                    (Oe(this._resizeRequest), (this._resizeRequest = null)),
                  this._clearHandlers(),
                  this._loaded && this.fire("unload"));
                var s;
                for (s in this._layers) this._layers[s].remove();
                for (s in this._panes) ot(this._panes[s]);
                return (
                  (this._layers = []),
                  (this._panes = []),
                  delete this._mapPane,
                  delete this._renderer,
                  this
                );
              },
              createPane: function (s, i) {
                var r =
                    "leaflet-pane" +
                    (s ? " leaflet-" + s.replace("Pane", "") + "-pane" : ""),
                  d = Be("div", r, i || this._mapPane);
                return (s && (this._panes[s] = d), d);
              },
              getCenter: function () {
                return (
                  this._checkIfLoaded(),
                  this._lastCenter && !this._moved()
                    ? this._lastCenter.clone()
                    : this.layerPointToLatLng(this._getCenterLayerPoint())
                );
              },
              getZoom: function () {
                return this._zoom;
              },
              getBounds: function () {
                var s = this.getPixelBounds(),
                  i = this.unproject(s.getBottomLeft()),
                  r = this.unproject(s.getTopRight());
                return new I(i, r);
              },
              getMinZoom: function () {
                return this.options.minZoom === void 0
                  ? this._layersMinZoom || 0
                  : this.options.minZoom;
              },
              getMaxZoom: function () {
                return this.options.maxZoom === void 0
                  ? this._layersMaxZoom === void 0
                    ? 1 / 0
                    : this._layersMaxZoom
                  : this.options.maxZoom;
              },
              getBoundsZoom: function (s, i, r) {
                ((s = X(s)), (r = z(r || [0, 0])));
                var d = this.getZoom() || 0,
                  h = this.getMinZoom(),
                  p = this.getMaxZoom(),
                  j = s.getNorthWest(),
                  M = s.getSouthEast(),
                  H = this.getSize().subtract(r),
                  se = C(this.project(M, d), this.project(j, d)).getSize(),
                  ye = v.any3d ? this.options.zoomSnap : 1,
                  De = H.x / se.x,
                  it = H.y / se.y,
                  va = i ? Math.max(De, it) : Math.min(De, it);
                return (
                  (d = this.getScaleZoom(va, d)),
                  ye &&
                    ((d = Math.round(d / (ye / 100)) * (ye / 100)),
                    (d = i ? Math.ceil(d / ye) * ye : Math.floor(d / ye) * ye)),
                  Math.max(h, Math.min(p, d))
                );
              },
              getSize: function () {
                return (
                  (!this._size || this._sizeChanged) &&
                    ((this._size = new O(
                      this._container.clientWidth || 0,
                      this._container.clientHeight || 0,
                    )),
                    (this._sizeChanged = !1)),
                  this._size.clone()
                );
              },
              getPixelBounds: function (s, i) {
                var r = this._getTopLeftPoint(s, i);
                return new g(r, r.add(this.getSize()));
              },
              getPixelOrigin: function () {
                return (this._checkIfLoaded(), this._pixelOrigin);
              },
              getPixelWorldBounds: function (s) {
                return this.options.crs.getProjectedBounds(
                  s === void 0 ? this.getZoom() : s,
                );
              },
              getPane: function (s) {
                return typeof s == "string" ? this._panes[s] : s;
              },
              getPanes: function () {
                return this._panes;
              },
              getContainer: function () {
                return this._container;
              },
              getZoomScale: function (s, i) {
                var r = this.options.crs;
                return (
                  (i = i === void 0 ? this._zoom : i),
                  r.scale(s) / r.scale(i)
                );
              },
              getScaleZoom: function (s, i) {
                var r = this.options.crs;
                i = i === void 0 ? this._zoom : i;
                var d = r.zoom(s * r.scale(i));
                return isNaN(d) ? 1 / 0 : d;
              },
              project: function (s, i) {
                return (
                  (i = i === void 0 ? this._zoom : i),
                  this.options.crs.latLngToPoint(he(s), i)
                );
              },
              unproject: function (s, i) {
                return (
                  (i = i === void 0 ? this._zoom : i),
                  this.options.crs.pointToLatLng(z(s), i)
                );
              },
              layerPointToLatLng: function (s) {
                var i = z(s).add(this.getPixelOrigin());
                return this.unproject(i);
              },
              latLngToLayerPoint: function (s) {
                var i = this.project(he(s))._round();
                return i._subtract(this.getPixelOrigin());
              },
              wrapLatLng: function (s) {
                return this.options.crs.wrapLatLng(he(s));
              },
              wrapLatLngBounds: function (s) {
                return this.options.crs.wrapLatLngBounds(X(s));
              },
              distance: function (s, i) {
                return this.options.crs.distance(he(s), he(i));
              },
              containerPointToLayerPoint: function (s) {
                return z(s).subtract(this._getMapPanePos());
              },
              layerPointToContainerPoint: function (s) {
                return z(s).add(this._getMapPanePos());
              },
              containerPointToLatLng: function (s) {
                var i = this.containerPointToLayerPoint(z(s));
                return this.layerPointToLatLng(i);
              },
              latLngToContainerPoint: function (s) {
                return this.layerPointToContainerPoint(
                  this.latLngToLayerPoint(he(s)),
                );
              },
              mouseEventToContainerPoint: function (s) {
                return qs(s, this._container);
              },
              mouseEventToLayerPoint: function (s) {
                return this.containerPointToLayerPoint(
                  this.mouseEventToContainerPoint(s),
                );
              },
              mouseEventToLatLng: function (s) {
                return this.layerPointToLatLng(this.mouseEventToLayerPoint(s));
              },
              _initContainer: function (s) {
                var i = (this._container = ba(s));
                if (i) {
                  if (i._leaflet_id)
                    throw new Error("Map container is already initialized.");
                } else throw new Error("Map container not found.");
                (Ge(i, "scroll", this._onScroll, this),
                  (this._containerId = B(i)));
              },
              _initLayout: function () {
                var s = this._container;
                ((this._fadeAnimated = this.options.fadeAnimation && v.any3d),
                  Je(
                    s,
                    "leaflet-container" +
                      (v.touch ? " leaflet-touch" : "") +
                      (v.retina ? " leaflet-retina" : "") +
                      (v.ielt9 ? " leaflet-oldie" : "") +
                      (v.safari ? " leaflet-safari" : "") +
                      (this._fadeAnimated ? " leaflet-fade-anim" : ""),
                  ));
                var i = za(s, "position");
                (i !== "absolute" &&
                  i !== "relative" &&
                  i !== "fixed" &&
                  i !== "sticky" &&
                  (s.style.position = "relative"),
                  this._initPanes(),
                  this._initControlPos && this._initControlPos());
              },
              _initPanes: function () {
                var s = (this._panes = {});
                ((this._paneRenderers = {}),
                  (this._mapPane = this.createPane("mapPane", this._container)),
                  At(this._mapPane, new O(0, 0)),
                  this.createPane("tilePane"),
                  this.createPane("overlayPane"),
                  this.createPane("shadowPane"),
                  this.createPane("markerPane"),
                  this.createPane("tooltipPane"),
                  this.createPane("popupPane"),
                  this.options.markerZoomAnimation ||
                    (Je(s.markerPane, "leaflet-zoom-hide"),
                    Je(s.shadowPane, "leaflet-zoom-hide")));
              },
              _resetView: function (s, i, r) {
                At(this._mapPane, new O(0, 0));
                var d = !this._loaded;
                ((this._loaded = !0),
                  (i = this._limitZoom(i)),
                  this.fire("viewprereset"));
                var h = this._zoom !== i;
                (this._moveStart(h, r)._move(s, i)._moveEnd(h),
                  this.fire("viewreset"),
                  d && this.fire("load"));
              },
              _moveStart: function (s, i) {
                return (
                  s && this.fire("zoomstart"),
                  i || this.fire("movestart"),
                  this
                );
              },
              _move: function (s, i, r, d) {
                i === void 0 && (i = this._zoom);
                var h = this._zoom !== i;
                return (
                  (this._zoom = i),
                  (this._lastCenter = s),
                  (this._pixelOrigin = this._getNewPixelOrigin(s)),
                  d
                    ? r && r.pinch && this.fire("zoom", r)
                    : ((h || (r && r.pinch)) && this.fire("zoom", r),
                      this.fire("move", r)),
                  this
                );
              },
              _moveEnd: function (s) {
                return (s && this.fire("zoomend"), this.fire("moveend"));
              },
              _stop: function () {
                return (
                  Oe(this._flyToFrame),
                  this._panAnim && this._panAnim.stop(),
                  this
                );
              },
              _rawPanBy: function (s) {
                At(this._mapPane, this._getMapPanePos().subtract(s));
              },
              _getZoomSpan: function () {
                return this.getMaxZoom() - this.getMinZoom();
              },
              _panInsideMaxBounds: function () {
                this._enforcingBounds ||
                  this.panInsideBounds(this.options.maxBounds);
              },
              _checkIfLoaded: function () {
                if (!this._loaded)
                  throw new Error("Set map center and zoom first.");
              },
              _initEvents: function (s) {
                ((this._targets = {}),
                  (this._targets[B(this._container)] = this));
                var i = s ? xt : Ge;
                (i(
                  this._container,
                  "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",
                  this._handleDOMEvent,
                  this,
                ),
                  this.options.trackResize &&
                    i(window, "resize", this._onResize, this),
                  v.any3d &&
                    this.options.transform3DLimit &&
                    (s ? this.off : this.on).call(
                      this,
                      "moveend",
                      this._onMoveEnd,
                    ));
              },
              _onResize: function () {
                (Oe(this._resizeRequest),
                  (this._resizeRequest = me(function () {
                    this.invalidateSize({ debounceMoveend: !0 });
                  }, this)));
              },
              _onScroll: function () {
                ((this._container.scrollTop = 0),
                  (this._container.scrollLeft = 0));
              },
              _onMoveEnd: function () {
                var s = this._getMapPanePos();
                Math.max(Math.abs(s.x), Math.abs(s.y)) >=
                  this.options.transform3DLimit &&
                  this._resetView(this.getCenter(), this.getZoom());
              },
              _findEventTargets: function (s, i) {
                for (
                  var r = [],
                    d,
                    h = i === "mouseout" || i === "mouseover",
                    p = s.target || s.srcElement,
                    j = !1;
                  p;
                ) {
                  if (
                    ((d = this._targets[B(p)]),
                    d &&
                      (i === "click" || i === "preclick") &&
                      this._draggableMoved(d))
                  ) {
                    j = !0;
                    break;
                  }
                  if (
                    (d &&
                      d.listens(i, !0) &&
                      ((h && !Ga(p, s)) || (r.push(d), h))) ||
                    p === this._container
                  )
                    break;
                  p = p.parentNode;
                }
                return (
                  !r.length && !j && !h && this.listens(i, !0) && (r = [this]),
                  r
                );
              },
              _isClickDisabled: function (s) {
                for (; s && s !== this._container; ) {
                  if (s._leaflet_disable_click) return !0;
                  s = s.parentNode;
                }
              },
              _handleDOMEvent: function (s) {
                var i = s.target || s.srcElement;
                if (
                  !(
                    !this._loaded ||
                    i._leaflet_disable_events ||
                    (s.type === "click" && this._isClickDisabled(i))
                  )
                ) {
                  var r = s.type;
                  (r === "mousedown" && Gs(i), this._fireDOMEvent(s, r));
                }
              },
              _mouseEvents: [
                "click",
                "dblclick",
                "mouseover",
                "mouseout",
                "contextmenu",
              ],
              _fireDOMEvent: function (s, i, r) {
                if (s.type === "click") {
                  var d = V({}, s);
                  ((d.type = "preclick"), this._fireDOMEvent(d, d.type, r));
                }
                var h = this._findEventTargets(s, i);
                if (r) {
                  for (var p = [], j = 0; j < r.length; j++)
                    r[j].listens(i, !0) && p.push(r[j]);
                  h = p.concat(h);
                }
                if (h.length) {
                  i === "contextmenu" && Vt(s);
                  var M = h[0],
                    H = { originalEvent: s };
                  if (
                    s.type !== "keypress" &&
                    s.type !== "keydown" &&
                    s.type !== "keyup"
                  ) {
                    var se = M.getLatLng && (!M._radius || M._radius <= 10);
                    ((H.containerPoint = se
                      ? this.latLngToContainerPoint(M.getLatLng())
                      : this.mouseEventToContainerPoint(s)),
                      (H.layerPoint = this.containerPointToLayerPoint(
                        H.containerPoint,
                      )),
                      (H.latlng = se
                        ? M.getLatLng()
                        : this.layerPointToLatLng(H.layerPoint)));
                  }
                  for (j = 0; j < h.length; j++)
                    if (
                      (h[j].fire(i, H, !0),
                      H.originalEvent._stopped ||
                        (h[j].options.bubblingMouseEvents === !1 &&
                          $(this._mouseEvents, i) !== -1))
                    )
                      return;
                }
              },
              _draggableMoved: function (s) {
                return (
                  (s = s.dragging && s.dragging.enabled() ? s : this),
                  (s.dragging && s.dragging.moved()) ||
                    (this.boxZoom && this.boxZoom.moved())
                );
              },
              _clearHandlers: function () {
                for (var s = 0, i = this._handlers.length; s < i; s++)
                  this._handlers[s].disable();
              },
              whenReady: function (s, i) {
                return (
                  this._loaded
                    ? s.call(i || this, { target: this })
                    : this.on("load", s, i),
                  this
                );
              },
              _getMapPanePos: function () {
                return Cs(this._mapPane) || new O(0, 0);
              },
              _moved: function () {
                var s = this._getMapPanePos();
                return s && !s.equals([0, 0]);
              },
              _getTopLeftPoint: function (s, i) {
                var r =
                  s && i !== void 0
                    ? this._getNewPixelOrigin(s, i)
                    : this.getPixelOrigin();
                return r.subtract(this._getMapPanePos());
              },
              _getNewPixelOrigin: function (s, i) {
                var r = this.getSize()._divideBy(2);
                return this.project(s, i)
                  ._subtract(r)
                  ._add(this._getMapPanePos())
                  ._round();
              },
              _latLngToNewLayerPoint: function (s, i, r) {
                var d = this._getNewPixelOrigin(r, i);
                return this.project(s, i)._subtract(d);
              },
              _latLngBoundsToNewLayerBounds: function (s, i, r) {
                var d = this._getNewPixelOrigin(r, i);
                return C([
                  this.project(s.getSouthWest(), i)._subtract(d),
                  this.project(s.getNorthWest(), i)._subtract(d),
                  this.project(s.getSouthEast(), i)._subtract(d),
                  this.project(s.getNorthEast(), i)._subtract(d),
                ]);
              },
              _getCenterLayerPoint: function () {
                return this.containerPointToLayerPoint(
                  this.getSize()._divideBy(2),
                );
              },
              _getCenterOffset: function (s) {
                return this.latLngToLayerPoint(s).subtract(
                  this._getCenterLayerPoint(),
                );
              },
              _limitCenter: function (s, i, r) {
                if (!r) return s;
                var d = this.project(s, i),
                  h = this.getSize().divideBy(2),
                  p = new g(d.subtract(h), d.add(h)),
                  j = this._getBoundsOffset(p, r, i);
                return Math.abs(j.x) <= 1 && Math.abs(j.y) <= 1
                  ? s
                  : this.unproject(d.add(j), i);
              },
              _limitOffset: function (s, i) {
                if (!i) return s;
                var r = this.getPixelBounds(),
                  d = new g(r.min.add(s), r.max.add(s));
                return s.add(this._getBoundsOffset(d, i));
              },
              _getBoundsOffset: function (s, i, r) {
                var d = C(
                    this.project(i.getNorthEast(), r),
                    this.project(i.getSouthWest(), r),
                  ),
                  h = d.min.subtract(s.min),
                  p = d.max.subtract(s.max),
                  j = this._rebound(h.x, -p.x),
                  M = this._rebound(h.y, -p.y);
                return new O(j, M);
              },
              _rebound: function (s, i) {
                return s + i > 0
                  ? Math.round(s - i) / 2
                  : Math.max(0, Math.ceil(s)) - Math.max(0, Math.floor(i));
              },
              _limitZoom: function (s) {
                var i = this.getMinZoom(),
                  r = this.getMaxZoom(),
                  d = v.any3d ? this.options.zoomSnap : 1;
                return (
                  d && (s = Math.round(s / d) * d),
                  Math.max(i, Math.min(r, s))
                );
              },
              _onPanTransitionStep: function () {
                this.fire("move");
              },
              _onPanTransitionEnd: function () {
                (Kt(this._mapPane, "leaflet-pan-anim"), this.fire("moveend"));
              },
              _tryAnimatedPan: function (s, i) {
                var r = this._getCenterOffset(s)._trunc();
                return (i && i.animate) !== !0 && !this.getSize().contains(r)
                  ? !1
                  : (this.panBy(r, i), !0);
              },
              _createAnimProxy: function () {
                var s = (this._proxy = Be(
                  "div",
                  "leaflet-proxy leaflet-zoom-animated",
                ));
                (this._panes.mapPane.appendChild(s),
                  this.on(
                    "zoomanim",
                    function (i) {
                      var r = wa,
                        d = this._proxy.style[r];
                      ($a(
                        this._proxy,
                        this.project(i.center, i.zoom),
                        this.getZoomScale(i.zoom, 1),
                      ),
                        d === this._proxy.style[r] &&
                          this._animatingZoom &&
                          this._onZoomTransitionEnd());
                    },
                    this,
                  ),
                  this.on("load moveend", this._animMoveEnd, this),
                  this._on("unload", this._destroyAnimProxy, this));
              },
              _destroyAnimProxy: function () {
                (ot(this._proxy),
                  this.off("load moveend", this._animMoveEnd, this),
                  delete this._proxy);
              },
              _animMoveEnd: function () {
                var s = this.getCenter(),
                  i = this.getZoom();
                $a(this._proxy, this.project(s, i), this.getZoomScale(i, 1));
              },
              _catchTransitionEnd: function (s) {
                this._animatingZoom &&
                  s.propertyName.indexOf("transform") >= 0 &&
                  this._onZoomTransitionEnd();
              },
              _nothingToAnimate: function () {
                return !this._container.getElementsByClassName(
                  "leaflet-zoom-animated",
                ).length;
              },
              _tryAnimatedZoom: function (s, i, r) {
                if (this._animatingZoom) return !0;
                if (
                  ((r = r || {}),
                  !this._zoomAnimated ||
                    r.animate === !1 ||
                    this._nothingToAnimate() ||
                    Math.abs(i - this._zoom) >
                      this.options.zoomAnimationThreshold)
                )
                  return !1;
                var d = this.getZoomScale(i),
                  h = this._getCenterOffset(s)._divideBy(1 - 1 / d);
                return r.animate !== !0 && !this.getSize().contains(h)
                  ? !1
                  : (me(function () {
                      this._moveStart(!0, r.noMoveStart || !1)._animateZoom(
                        s,
                        i,
                        !0,
                      );
                    }, this),
                    !0);
              },
              _animateZoom: function (s, i, r, d) {
                this._mapPane &&
                  (r &&
                    ((this._animatingZoom = !0),
                    (this._animateToCenter = s),
                    (this._animateToZoom = i),
                    Je(this._mapPane, "leaflet-zoom-anim")),
                  this.fire("zoomanim", { center: s, zoom: i, noUpdate: d }),
                  this._tempFireZoomEvent ||
                    (this._tempFireZoomEvent =
                      this._zoom !== this._animateToZoom),
                  this._move(
                    this._animateToCenter,
                    this._animateToZoom,
                    void 0,
                    !0,
                  ),
                  setTimeout(re(this._onZoomTransitionEnd, this), 250));
              },
              _onZoomTransitionEnd: function () {
                this._animatingZoom &&
                  (this._mapPane && Kt(this._mapPane, "leaflet-zoom-anim"),
                  (this._animatingZoom = !1),
                  this._move(
                    this._animateToCenter,
                    this._animateToZoom,
                    void 0,
                    !0,
                  ),
                  this._tempFireZoomEvent && this.fire("zoom"),
                  delete this._tempFireZoomEvent,
                  this.fire("move"),
                  this._moveEnd(!0));
              },
            });
          function ti(s, i) {
            return new et(s, i);
          }
          var Pa = Ae.extend({
              options: { position: "topright" },
              initialize: function (s) {
                Y(this, s);
              },
              getPosition: function () {
                return this.options.position;
              },
              setPosition: function (s) {
                var i = this._map;
                return (
                  i && i.removeControl(this),
                  (this.options.position = s),
                  i && i.addControl(this),
                  this
                );
              },
              getContainer: function () {
                return this._container;
              },
              addTo: function (s) {
                (this.remove(), (this._map = s));
                var i = (this._container = this.onAdd(s)),
                  r = this.getPosition(),
                  d = s._controlCorners[r];
                return (
                  Je(i, "leaflet-control"),
                  r.indexOf("bottom") !== -1
                    ? d.insertBefore(i, d.firstChild)
                    : d.appendChild(i),
                  this._map.on("unload", this.remove, this),
                  this
                );
              },
              remove: function () {
                return this._map
                  ? (ot(this._container),
                    this.onRemove && this.onRemove(this._map),
                    this._map.off("unload", this.remove, this),
                    (this._map = null),
                    this)
                  : this;
              },
              _refocusOnMap: function (s) {
                this._map &&
                  s &&
                  s.screenX > 0 &&
                  s.screenY > 0 &&
                  this._map.getContainer().focus();
              },
            }),
            fs = function (s) {
              return new Pa(s);
            };
          et.include({
            addControl: function (s) {
              return (s.addTo(this), this);
            },
            removeControl: function (s) {
              return (s.remove(), this);
            },
            _initControlPos: function () {
              var s = (this._controlCorners = {}),
                i = "leaflet-",
                r = (this._controlContainer = Be(
                  "div",
                  i + "control-container",
                  this._container,
                ));
              function d(h, p) {
                var j = i + h + " " + i + p;
                s[h + p] = Be("div", j, r);
              }
              (d("top", "left"),
                d("top", "right"),
                d("bottom", "left"),
                d("bottom", "right"));
            },
            _clearControlPos: function () {
              for (var s in this._controlCorners) ot(this._controlCorners[s]);
              (ot(this._controlContainer),
                delete this._controlCorners,
                delete this._controlContainer);
            },
          });
          var Mn = Pa.extend({
              options: {
                collapsed: !0,
                position: "topright",
                autoZIndex: !0,
                hideSingleBase: !1,
                sortLayers: !1,
                sortFunction: function (s, i, r, d) {
                  return r < d ? -1 : d < r ? 1 : 0;
                },
              },
              initialize: function (s, i, r) {
                (Y(this, r),
                  (this._layerControlInputs = []),
                  (this._layers = []),
                  (this._lastZIndex = 0),
                  (this._handlingClick = !1),
                  (this._preventClick = !1));
                for (var d in s) this._addLayer(s[d], d);
                for (d in i) this._addLayer(i[d], d, !0);
              },
              onAdd: function (s) {
                (this._initLayout(),
                  this._update(),
                  (this._map = s),
                  s.on("zoomend", this._checkDisabledLayers, this));
                for (var i = 0; i < this._layers.length; i++)
                  this._layers[i].layer.on(
                    "add remove",
                    this._onLayerChange,
                    this,
                  );
                return this._container;
              },
              addTo: function (s) {
                return (
                  Pa.prototype.addTo.call(this, s),
                  this._expandIfNotCollapsed()
                );
              },
              onRemove: function () {
                this._map.off("zoomend", this._checkDisabledLayers, this);
                for (var s = 0; s < this._layers.length; s++)
                  this._layers[s].layer.off(
                    "add remove",
                    this._onLayerChange,
                    this,
                  );
              },
              addBaseLayer: function (s, i) {
                return (
                  this._addLayer(s, i),
                  this._map ? this._update() : this
                );
              },
              addOverlay: function (s, i) {
                return (
                  this._addLayer(s, i, !0),
                  this._map ? this._update() : this
                );
              },
              removeLayer: function (s) {
                s.off("add remove", this._onLayerChange, this);
                var i = this._getLayer(B(s));
                return (
                  i && this._layers.splice(this._layers.indexOf(i), 1),
                  this._map ? this._update() : this
                );
              },
              expand: function () {
                (Je(this._container, "leaflet-control-layers-expanded"),
                  (this._section.style.height = null));
                var s =
                  this._map.getSize().y - (this._container.offsetTop + 50);
                return (
                  s < this._section.clientHeight
                    ? (Je(this._section, "leaflet-control-layers-scrollbar"),
                      (this._section.style.height = s + "px"))
                    : Kt(this._section, "leaflet-control-layers-scrollbar"),
                  this._checkDisabledLayers(),
                  this
                );
              },
              collapse: function () {
                return (
                  Kt(this._container, "leaflet-control-layers-expanded"),
                  this
                );
              },
              _initLayout: function () {
                var s = "leaflet-control-layers",
                  i = (this._container = Be("div", s)),
                  r = this.options.collapsed;
                (i.setAttribute("aria-haspopup", !0), As(i), ss(i));
                var d = (this._section = Be("section", s + "-list"));
                r &&
                  (this._map.on("click", this.collapse, this),
                  Ge(
                    i,
                    {
                      mouseenter: this._expandSafely,
                      mouseleave: this.collapse,
                    },
                    this,
                  ));
                var h = (this._layersLink = Be("a", s + "-toggle", i));
                ((h.href = "#"),
                  (h.title = "Layers"),
                  h.setAttribute("role", "button"),
                  Ge(
                    h,
                    {
                      keydown: function (p) {
                        p.keyCode === 13 && this._expandSafely();
                      },
                      click: function (p) {
                        (Vt(p), this._expandSafely());
                      },
                    },
                    this,
                  ),
                  r || this.expand(),
                  (this._baseLayersList = Be("div", s + "-base", d)),
                  (this._separator = Be("div", s + "-separator", d)),
                  (this._overlaysList = Be("div", s + "-overlays", d)),
                  i.appendChild(d));
              },
              _getLayer: function (s) {
                for (var i = 0; i < this._layers.length; i++)
                  if (this._layers[i] && B(this._layers[i].layer) === s)
                    return this._layers[i];
              },
              _addLayer: function (s, i, r) {
                (this._map && s.on("add remove", this._onLayerChange, this),
                  this._layers.push({ layer: s, name: i, overlay: r }),
                  this.options.sortLayers &&
                    this._layers.sort(
                      re(function (d, h) {
                        return this.options.sortFunction(
                          d.layer,
                          h.layer,
                          d.name,
                          h.name,
                        );
                      }, this),
                    ),
                  this.options.autoZIndex &&
                    s.setZIndex &&
                    (this._lastZIndex++, s.setZIndex(this._lastZIndex)),
                  this._expandIfNotCollapsed());
              },
              _update: function () {
                if (!this._container) return this;
                (yt(this._baseLayersList),
                  yt(this._overlaysList),
                  (this._layerControlInputs = []));
                var s,
                  i,
                  r,
                  d,
                  h = 0;
                for (r = 0; r < this._layers.length; r++)
                  ((d = this._layers[r]),
                    this._addItem(d),
                    (i = i || d.overlay),
                    (s = s || !d.overlay),
                    (h += d.overlay ? 0 : 1));
                return (
                  this.options.hideSingleBase &&
                    ((s = s && h > 1),
                    (this._baseLayersList.style.display = s ? "" : "none")),
                  (this._separator.style.display = i && s ? "" : "none"),
                  this
                );
              },
              _onLayerChange: function (s) {
                this._handlingClick || this._update();
                var i = this._getLayer(B(s.target)),
                  r = i.overlay
                    ? s.type === "add"
                      ? "overlayadd"
                      : "overlayremove"
                    : s.type === "add"
                      ? "baselayerchange"
                      : null;
                r && this._map.fire(r, i);
              },
              _createRadioElement: function (s, i) {
                var r =
                    '<input type="radio" class="leaflet-control-layers-selector" name="' +
                    s +
                    '"' +
                    (i ? ' checked="checked"' : "") +
                    "/>",
                  d = document.createElement("div");
                return ((d.innerHTML = r), d.firstChild);
              },
              _addItem: function (s) {
                var i = document.createElement("label"),
                  r = this._map.hasLayer(s.layer),
                  d;
                (s.overlay
                  ? ((d = document.createElement("input")),
                    (d.type = "checkbox"),
                    (d.className = "leaflet-control-layers-selector"),
                    (d.defaultChecked = r))
                  : (d = this._createRadioElement(
                      "leaflet-base-layers_" + B(this),
                      r,
                    )),
                  this._layerControlInputs.push(d),
                  (d.layerId = B(s.layer)),
                  Ge(d, "click", this._onInputClick, this));
                var h = document.createElement("span");
                h.innerHTML = " " + s.name;
                var p = document.createElement("span");
                (i.appendChild(p), p.appendChild(d), p.appendChild(h));
                var j = s.overlay ? this._overlaysList : this._baseLayersList;
                return (j.appendChild(i), this._checkDisabledLayers(), i);
              },
              _onInputClick: function () {
                if (!this._preventClick) {
                  var s = this._layerControlInputs,
                    i,
                    r,
                    d = [],
                    h = [];
                  this._handlingClick = !0;
                  for (var p = s.length - 1; p >= 0; p--)
                    ((i = s[p]),
                      (r = this._getLayer(i.layerId).layer),
                      i.checked ? d.push(r) : i.checked || h.push(r));
                  for (p = 0; p < h.length; p++)
                    this._map.hasLayer(h[p]) && this._map.removeLayer(h[p]);
                  for (p = 0; p < d.length; p++)
                    this._map.hasLayer(d[p]) || this._map.addLayer(d[p]);
                  ((this._handlingClick = !1), this._refocusOnMap());
                }
              },
              _checkDisabledLayers: function () {
                for (
                  var s = this._layerControlInputs,
                    i,
                    r,
                    d = this._map.getZoom(),
                    h = s.length - 1;
                  h >= 0;
                  h--
                )
                  ((i = s[h]),
                    (r = this._getLayer(i.layerId).layer),
                    (i.disabled =
                      (r.options.minZoom !== void 0 && d < r.options.minZoom) ||
                      (r.options.maxZoom !== void 0 && d > r.options.maxZoom)));
              },
              _expandIfNotCollapsed: function () {
                return (
                  this._map && !this.options.collapsed && this.expand(),
                  this
                );
              },
              _expandSafely: function () {
                var s = this._section;
                ((this._preventClick = !0), Ge(s, "click", Vt), this.expand());
                var i = this;
                setTimeout(function () {
                  (xt(s, "click", Vt), (i._preventClick = !1));
                });
              },
            }),
            pl = function (s, i, r) {
              return new Mn(s, i, r);
            },
            Oi = Pa.extend({
              options: {
                position: "topleft",
                zoomInText: '<span aria-hidden="true">+</span>',
                zoomInTitle: "Zoom in",
                zoomOutText: '<span aria-hidden="true">&#x2212;</span>',
                zoomOutTitle: "Zoom out",
              },
              onAdd: function (s) {
                var i = "leaflet-control-zoom",
                  r = Be("div", i + " leaflet-bar"),
                  d = this.options;
                return (
                  (this._zoomInButton = this._createButton(
                    d.zoomInText,
                    d.zoomInTitle,
                    i + "-in",
                    r,
                    this._zoomIn,
                  )),
                  (this._zoomOutButton = this._createButton(
                    d.zoomOutText,
                    d.zoomOutTitle,
                    i + "-out",
                    r,
                    this._zoomOut,
                  )),
                  this._updateDisabled(),
                  s.on("zoomend zoomlevelschange", this._updateDisabled, this),
                  r
                );
              },
              onRemove: function (s) {
                s.off("zoomend zoomlevelschange", this._updateDisabled, this);
              },
              disable: function () {
                return ((this._disabled = !0), this._updateDisabled(), this);
              },
              enable: function () {
                return ((this._disabled = !1), this._updateDisabled(), this);
              },
              _zoomIn: function (s) {
                !this._disabled &&
                  this._map._zoom < this._map.getMaxZoom() &&
                  this._map.zoomIn(
                    this._map.options.zoomDelta * (s.shiftKey ? 3 : 1),
                  );
              },
              _zoomOut: function (s) {
                !this._disabled &&
                  this._map._zoom > this._map.getMinZoom() &&
                  this._map.zoomOut(
                    this._map.options.zoomDelta * (s.shiftKey ? 3 : 1),
                  );
              },
              _createButton: function (s, i, r, d, h) {
                var p = Be("a", r, d);
                return (
                  (p.innerHTML = s),
                  (p.href = "#"),
                  (p.title = i),
                  p.setAttribute("role", "button"),
                  p.setAttribute("aria-label", i),
                  As(p),
                  Ge(p, "click", Ja),
                  Ge(p, "click", h, this),
                  Ge(p, "click", this._refocusOnMap, this),
                  p
                );
              },
              _updateDisabled: function () {
                var s = this._map,
                  i = "leaflet-disabled";
                (Kt(this._zoomInButton, i),
                  Kt(this._zoomOutButton, i),
                  this._zoomInButton.setAttribute("aria-disabled", "false"),
                  this._zoomOutButton.setAttribute("aria-disabled", "false"),
                  (this._disabled || s._zoom === s.getMinZoom()) &&
                    (Je(this._zoomOutButton, i),
                    this._zoomOutButton.setAttribute("aria-disabled", "true")),
                  (this._disabled || s._zoom === s.getMaxZoom()) &&
                    (Je(this._zoomInButton, i),
                    this._zoomInButton.setAttribute("aria-disabled", "true")));
              },
            });
          (et.mergeOptions({ zoomControl: !0 }),
            et.addInitHook(function () {
              this.options.zoomControl &&
                ((this.zoomControl = new Oi()),
                this.addControl(this.zoomControl));
            }));
          var lr = function (s) {
              return new Oi(s);
            },
            xl = Pa.extend({
              options: {
                position: "bottomleft",
                maxWidth: 100,
                metric: !0,
                imperial: !0,
              },
              onAdd: function (s) {
                var i = "leaflet-control-scale",
                  r = Be("div", i),
                  d = this.options;
                return (
                  this._addScales(d, i + "-line", r),
                  s.on(
                    d.updateWhenIdle ? "moveend" : "move",
                    this._update,
                    this,
                  ),
                  s.whenReady(this._update, this),
                  r
                );
              },
              onRemove: function (s) {
                s.off(
                  this.options.updateWhenIdle ? "moveend" : "move",
                  this._update,
                  this,
                );
              },
              _addScales: function (s, i, r) {
                (s.metric && (this._mScale = Be("div", i, r)),
                  s.imperial && (this._iScale = Be("div", i, r)));
              },
              _update: function () {
                var s = this._map,
                  i = s.getSize().y / 2,
                  r = s.distance(
                    s.containerPointToLatLng([0, i]),
                    s.containerPointToLatLng([this.options.maxWidth, i]),
                  );
                this._updateScales(r);
              },
              _updateScales: function (s) {
                (this.options.metric && s && this._updateMetric(s),
                  this.options.imperial && s && this._updateImperial(s));
              },
              _updateMetric: function (s) {
                var i = this._getRoundNum(s),
                  r = i < 1e3 ? i + " m" : i / 1e3 + " km";
                this._updateScale(this._mScale, r, i / s);
              },
              _updateImperial: function (s) {
                var i = s * 3.2808399,
                  r,
                  d,
                  h;
                i > 5280
                  ? ((r = i / 5280),
                    (d = this._getRoundNum(r)),
                    this._updateScale(this._iScale, d + " mi", d / r))
                  : ((h = this._getRoundNum(i)),
                    this._updateScale(this._iScale, h + " ft", h / i));
              },
              _updateScale: function (s, i, r) {
                ((s.style.width = Math.round(this.options.maxWidth * r) + "px"),
                  (s.innerHTML = i));
              },
              _getRoundNum: function (s) {
                var i = Math.pow(10, (Math.floor(s) + "").length - 1),
                  r = s / i;
                return (
                  (r = r >= 10 ? 10 : r >= 5 ? 5 : r >= 3 ? 3 : r >= 2 ? 2 : 1),
                  i * r
                );
              },
            }),
            Di = function (s) {
              return new xl(s);
            },
            rr =
              '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',
            Ri = Pa.extend({
              options: {
                position: "bottomright",
                prefix:
                  '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' +
                  (v.inlineSvg ? rr + " " : "") +
                  "Leaflet</a>",
              },
              initialize: function (s) {
                (Y(this, s), (this._attributions = {}));
              },
              onAdd: function (s) {
                ((s.attributionControl = this),
                  (this._container = Be("div", "leaflet-control-attribution")),
                  As(this._container));
                for (var i in s._layers)
                  s._layers[i].getAttribution &&
                    this.addAttribution(s._layers[i].getAttribution());
                return (
                  this._update(),
                  s.on("layeradd", this._addAttribution, this),
                  this._container
                );
              },
              onRemove: function (s) {
                s.off("layeradd", this._addAttribution, this);
              },
              _addAttribution: function (s) {
                s.layer.getAttribution &&
                  (this.addAttribution(s.layer.getAttribution()),
                  s.layer.once(
                    "remove",
                    function () {
                      this.removeAttribution(s.layer.getAttribution());
                    },
                    this,
                  ));
              },
              setPrefix: function (s) {
                return ((this.options.prefix = s), this._update(), this);
              },
              addAttribution: function (s) {
                return s
                  ? (this._attributions[s] || (this._attributions[s] = 0),
                    this._attributions[s]++,
                    this._update(),
                    this)
                  : this;
              },
              removeAttribution: function (s) {
                return s
                  ? (this._attributions[s] &&
                      (this._attributions[s]--, this._update()),
                    this)
                  : this;
              },
              _update: function () {
                if (this._map) {
                  var s = [];
                  for (var i in this._attributions)
                    this._attributions[i] && s.push(i);
                  var r = [];
                  (this.options.prefix && r.push(this.options.prefix),
                    s.length && r.push(s.join(", ")),
                    (this._container.innerHTML = r.join(
                      ' <span aria-hidden="true">|</span> ',
                    )));
                }
              },
            });
          (et.mergeOptions({ attributionControl: !0 }),
            et.addInitHook(function () {
              this.options.attributionControl && new Ri().addTo(this);
            }));
          var or = function (s) {
            return new Ri(s);
          };
          ((Pa.Layers = Mn),
            (Pa.Zoom = Oi),
            (Pa.Scale = xl),
            (Pa.Attribution = Ri),
            (fs.layers = pl),
            (fs.zoom = lr),
            (fs.scale = Di),
            (fs.attribution = or));
          var ns = Ae.extend({
            initialize: function (s) {
              this._map = s;
            },
            enable: function () {
              return this._enabled
                ? this
                : ((this._enabled = !0), this.addHooks(), this);
            },
            disable: function () {
              return this._enabled
                ? ((this._enabled = !1), this.removeHooks(), this)
                : this;
            },
            enabled: function () {
              return !!this._enabled;
            },
          });
          ns.addTo = function (s, i) {
            return (s.addHandler(i, this), this);
          };
          var cr = { Events: y },
            zi = v.touch ? "touchstart mousedown" : "mousedown",
            Ms = K.extend({
              options: { clickTolerance: 3 },
              initialize: function (s, i, r, d) {
                (Y(this, d),
                  (this._element = s),
                  (this._dragStartTarget = i || s),
                  (this._preventOutline = r));
              },
              enable: function () {
                this._enabled ||
                  (Ge(this._dragStartTarget, zi, this._onDown, this),
                  (this._enabled = !0));
              },
              disable: function () {
                this._enabled &&
                  (Ms._dragging === this && this.finishDrag(!0),
                  xt(this._dragStartTarget, zi, this._onDown, this),
                  (this._enabled = !1),
                  (this._moved = !1));
              },
              _onDown: function (s) {
                if (
                  this._enabled &&
                  ((this._moved = !1), !Us(this._element, "leaflet-zoom-anim"))
                ) {
                  if (s.touches && s.touches.length !== 1) {
                    Ms._dragging === this && this.finishDrag();
                    return;
                  }
                  if (
                    !(
                      Ms._dragging ||
                      s.shiftKey ||
                      (s.which !== 1 && s.button !== 1 && !s.touches)
                    ) &&
                    ((Ms._dragging = this),
                    this._preventOutline && Gs(this._element),
                    wn(),
                    Is(),
                    !this._moving)
                  ) {
                    this.fire("down");
                    var i = s.touches ? s.touches[0] : s,
                      r = Tn(this._element);
                    ((this._startPoint = new O(i.clientX, i.clientY)),
                      (this._startPos = Cs(this._element)),
                      (this._parentScale = Cn(r)));
                    var d = s.type === "mousedown";
                    (Ge(
                      document,
                      d ? "mousemove" : "touchmove",
                      this._onMove,
                      this,
                    ),
                      Ge(
                        document,
                        d ? "mouseup" : "touchend touchcancel",
                        this._onUp,
                        this,
                      ));
                  }
                }
              },
              _onMove: function (s) {
                if (this._enabled) {
                  if (s.touches && s.touches.length > 1) {
                    this._moved = !0;
                    return;
                  }
                  var i =
                      s.touches && s.touches.length === 1 ? s.touches[0] : s,
                    r = new O(i.clientX, i.clientY)._subtract(this._startPoint);
                  (!r.x && !r.y) ||
                    Math.abs(r.x) + Math.abs(r.y) <
                      this.options.clickTolerance ||
                    ((r.x /= this._parentScale.x),
                    (r.y /= this._parentScale.y),
                    Vt(s),
                    this._moved ||
                      (this.fire("dragstart"),
                      (this._moved = !0),
                      Je(document.body, "leaflet-dragging"),
                      (this._lastTarget = s.target || s.srcElement),
                      window.SVGElementInstance &&
                        this._lastTarget instanceof window.SVGElementInstance &&
                        (this._lastTarget =
                          this._lastTarget.correspondingUseElement),
                      Je(this._lastTarget, "leaflet-drag-target")),
                    (this._newPos = this._startPos.add(r)),
                    (this._moving = !0),
                    (this._lastEvent = s),
                    this._updatePosition());
                }
              },
              _updatePosition: function () {
                var s = { originalEvent: this._lastEvent };
                (this.fire("predrag", s),
                  At(this._element, this._newPos),
                  this.fire("drag", s));
              },
              _onUp: function () {
                this._enabled && this.finishDrag();
              },
              finishDrag: function (s) {
                (Kt(document.body, "leaflet-dragging"),
                  this._lastTarget &&
                    (Kt(this._lastTarget, "leaflet-drag-target"),
                    (this._lastTarget = null)),
                  xt(document, "mousemove touchmove", this._onMove, this),
                  xt(
                    document,
                    "mouseup touchend touchcancel",
                    this._onUp,
                    this,
                  ),
                  kn(),
                  Ba());
                var i = this._moved && this._moving;
                ((this._moving = !1),
                  (Ms._dragging = !1),
                  i &&
                    this.fire("dragend", {
                      noInertia: s,
                      distance: this._newPos.distanceTo(this._startPos),
                    }));
              },
            });
          function fl(s, i, r) {
            var d,
              h = [1, 4, 2, 8],
              p,
              j,
              M,
              H,
              se,
              ye,
              De,
              it;
            for (p = 0, ye = s.length; p < ye; p++) s[p]._code = _(s[p], i);
            for (M = 0; M < 4; M++) {
              for (
                De = h[M], d = [], p = 0, ye = s.length, j = ye - 1;
                p < ye;
                j = p++
              )
                ((H = s[p]),
                  (se = s[j]),
                  H._code & De
                    ? se._code & De ||
                      ((it = u(se, H, De, i, r)),
                      (it._code = _(it, i)),
                      d.push(it))
                    : (se._code & De &&
                        ((it = u(se, H, De, i, r)),
                        (it._code = _(it, i)),
                        d.push(it)),
                      d.push(H)));
              s = d;
            }
            return s;
          }
          function gl(s, i) {
            var r, d, h, p, j, M, H, se, ye;
            if (!s || s.length === 0) throw new Error("latlngs not passed");
            La(s) ||
              (console.warn(
                "latlngs are not flat! Only the first ring will be used",
              ),
              (s = s[0]));
            var De = he([0, 0]),
              it = X(s),
              va =
                it.getNorthWest().distanceTo(it.getSouthWest()) *
                it.getNorthEast().distanceTo(it.getNorthWest());
            va < 1700 && (De = Bi(s));
            var sa = s.length,
              Wa = [];
            for (r = 0; r < sa; r++) {
              var jt = he(s[r]);
              Wa.push(i.project(he([jt.lat - De.lat, jt.lng - De.lng])));
            }
            for (M = H = se = 0, r = 0, d = sa - 1; r < sa; d = r++)
              ((h = Wa[r]),
                (p = Wa[d]),
                (j = h.y * p.x - p.y * h.x),
                (H += (h.x + p.x) * j),
                (se += (h.y + p.y) * j),
                (M += j * 3));
            M === 0 ? (ye = Wa[0]) : (ye = [H / M, se / M]);
            var Nt = i.unproject(z(ye));
            return he([Nt.lat + De.lat, Nt.lng + De.lng]);
          }
          function Bi(s) {
            for (var i = 0, r = 0, d = 0, h = 0; h < s.length; h++) {
              var p = he(s[h]);
              ((i += p.lat), (r += p.lng), d++);
            }
            return he([i / d, r / d]);
          }
          var Hi = {
            __proto__: null,
            clipPolygon: fl,
            polygonCenter: gl,
            centroid: Bi,
          };
          function bl(s, i) {
            if (!i || !s.length) return s.slice();
            var r = i * i;
            return ((s = ur(s, r)), (s = yl(s, r)), s);
          }
          function vl(s, i, r) {
            return Math.sqrt(ct(s, i, r, !0));
          }
          function dr(s, i, r) {
            return ct(s, i, r);
          }
          function yl(s, i) {
            var r = s.length,
              d = typeof Uint8Array < "u" ? Uint8Array : Array,
              h = new d(r);
            ((h[0] = h[r - 1] = 1), Pn(s, h, i, 0, r - 1));
            var p,
              j = [];
            for (p = 0; p < r; p++) h[p] && j.push(s[p]);
            return j;
          }
          function Pn(s, i, r, d, h) {
            var p = 0,
              j,
              M,
              H;
            for (M = d + 1; M <= h - 1; M++)
              ((H = ct(s[M], s[d], s[h], !0)), H > p && ((j = M), (p = H)));
            p > r && ((i[j] = 1), Pn(s, i, r, d, j), Pn(s, i, r, j, h));
          }
          function ur(s, i) {
            for (var r = [s[0]], d = 1, h = 0, p = s.length; d < p; d++)
              Ce(s[d], s[h]) > i && (r.push(s[d]), (h = d));
            return (h < p - 1 && r.push(s[p - 1]), r);
          }
          var ai;
          function jl(s, i, r, d, h) {
            var p = d ? ai : _(s, r),
              j = _(i, r),
              M,
              H,
              se;
            for (ai = j; ; ) {
              if (!(p | j)) return [s, i];
              if (p & j) return !1;
              ((M = p || j),
                (H = u(s, i, M, r, h)),
                (se = _(H, r)),
                M === p ? ((s = H), (p = se)) : ((i = H), (j = se)));
            }
          }
          function u(s, i, r, d, h) {
            var p = i.x - s.x,
              j = i.y - s.y,
              M = d.min,
              H = d.max,
              se,
              ye;
            return (
              r & 8
                ? ((se = s.x + (p * (H.y - s.y)) / j), (ye = H.y))
                : r & 4
                  ? ((se = s.x + (p * (M.y - s.y)) / j), (ye = M.y))
                  : r & 2
                    ? ((se = H.x), (ye = s.y + (j * (H.x - s.x)) / p))
                    : r & 1 && ((se = M.x), (ye = s.y + (j * (M.x - s.x)) / p)),
              new O(se, ye, h)
            );
          }
          function _(s, i) {
            var r = 0;
            return (
              s.x < i.min.x ? (r |= 1) : s.x > i.max.x && (r |= 2),
              s.y < i.min.y ? (r |= 4) : s.y > i.max.y && (r |= 8),
              r
            );
          }
          function Ce(s, i) {
            var r = i.x - s.x,
              d = i.y - s.y;
            return r * r + d * d;
          }
          function ct(s, i, r, d) {
            var h = i.x,
              p = i.y,
              j = r.x - h,
              M = r.y - p,
              H = j * j + M * M,
              se;
            return (
              H > 0 &&
                ((se = ((s.x - h) * j + (s.y - p) * M) / H),
                se > 1
                  ? ((h = r.x), (p = r.y))
                  : se > 0 && ((h += j * se), (p += M * se))),
              (j = s.x - h),
              (M = s.y - p),
              d ? j * j + M * M : new O(h, p)
            );
          }
          function La(s) {
            return (
              !ie(s[0]) || (typeof s[0][0] != "object" && typeof s[0][0] < "u")
            );
          }
          function Ln(s) {
            return (
              console.warn(
                "Deprecated use of _flat, please use L.LineUtil.isFlat instead.",
              ),
              La(s)
            );
          }
          function Vs(s, i) {
            var r, d, h, p, j, M, H, se;
            if (!s || s.length === 0) throw new Error("latlngs not passed");
            La(s) ||
              (console.warn(
                "latlngs are not flat! Only the first ring will be used",
              ),
              (s = s[0]));
            var ye = he([0, 0]),
              De = X(s),
              it =
                De.getNorthWest().distanceTo(De.getSouthWest()) *
                De.getNorthEast().distanceTo(De.getNorthWest());
            it < 1700 && (ye = Bi(s));
            var va = s.length,
              sa = [];
            for (r = 0; r < va; r++) {
              var Wa = he(s[r]);
              sa.push(i.project(he([Wa.lat - ye.lat, Wa.lng - ye.lng])));
            }
            for (r = 0, d = 0; r < va - 1; r++)
              d += sa[r].distanceTo(sa[r + 1]) / 2;
            if (d === 0) se = sa[0];
            else
              for (r = 0, p = 0; r < va - 1; r++)
                if (
                  ((j = sa[r]),
                  (M = sa[r + 1]),
                  (h = j.distanceTo(M)),
                  (p += h),
                  p > d)
                ) {
                  ((H = (p - d) / h),
                    (se = [M.x - H * (M.x - j.x), M.y - H * (M.y - j.y)]));
                  break;
                }
            var jt = i.unproject(z(se));
            return he([jt.lat + ye.lat, jt.lng + ye.lng]);
          }
          var Ui = {
              __proto__: null,
              simplify: bl,
              pointToSegmentDistance: vl,
              closestPointOnSegment: dr,
              clipSegment: jl,
              _getEdgeIntersection: u,
              _getBitCode: _,
              _sqClosestPointOnSegment: ct,
              isFlat: La,
              _flat: Ln,
              polylineCenter: Vs,
            },
            Qa = {
              project: function (s) {
                return new O(s.lng, s.lat);
              },
              unproject: function (s) {
                return new pe(s.y, s.x);
              },
              bounds: new g([-180, -90], [180, 90]),
            },
            Ys = {
              R: 6378137,
              R_MINOR: 6356752314245179e-9,
              bounds: new g(
                [-2003750834279e-5, -1549657073972e-5],
                [2003750834279e-5, 1876465623138e-5],
              ),
              project: function (s) {
                var i = Math.PI / 180,
                  r = this.R,
                  d = s.lat * i,
                  h = this.R_MINOR / r,
                  p = Math.sqrt(1 - h * h),
                  j = p * Math.sin(d),
                  M =
                    Math.tan(Math.PI / 4 - d / 2) /
                    Math.pow((1 - j) / (1 + j), p / 2);
                return (
                  (d = -r * Math.log(Math.max(M, 1e-10))),
                  new O(s.lng * i * r, d)
                );
              },
              unproject: function (s) {
                for (
                  var i = 180 / Math.PI,
                    r = this.R,
                    d = this.R_MINOR / r,
                    h = Math.sqrt(1 - d * d),
                    p = Math.exp(-s.y / r),
                    j = Math.PI / 2 - 2 * Math.atan(p),
                    M = 0,
                    H = 0.1,
                    se;
                  M < 15 && Math.abs(H) > 1e-7;
                  M++
                )
                  ((se = h * Math.sin(j)),
                    (se = Math.pow((1 - se) / (1 + se), h / 2)),
                    (H = Math.PI / 2 - 2 * Math.atan(p * se) - j),
                    (j += H));
                return new pe(j * i, (s.x * i) / r);
              },
            },
            Nl = {
              __proto__: null,
              LonLat: Qa,
              Mercator: Ys,
              SphericalMercator: ze,
            },
            dn = V({}, $e, {
              code: "EPSG:3395",
              projection: Ys,
              transformation: (function () {
                var s = 0.5 / (Math.PI * Ys.R);
                return bt(s, 0.5, -s, 0.5);
              })(),
            }),
            Xs = V({}, $e, {
              code: "EPSG:4326",
              projection: Qa,
              transformation: bt(1 / 180, 1, -1 / 180, 0.5),
            }),
            si = V({}, Ne, {
              projection: Qa,
              transformation: bt(1, 0, -1, 0),
              scale: function (s) {
                return Math.pow(2, s);
              },
              zoom: function (s) {
                return Math.log(s) / Math.LN2;
              },
              distance: function (s, i) {
                var r = i.lng - s.lng,
                  d = i.lat - s.lat;
                return Math.sqrt(r * r + d * d);
              },
              infinite: !0,
            });
          ((Ne.Earth = $e),
            (Ne.EPSG3395 = dn),
            (Ne.EPSG3857 = Mt),
            (Ne.EPSG900913 = ge),
            (Ne.EPSG4326 = Xs),
            (Ne.Simple = si));
          var gs = K.extend({
            options: {
              pane: "overlayPane",
              attribution: null,
              bubblingMouseEvents: !0,
            },
            addTo: function (s) {
              return (s.addLayer(this), this);
            },
            remove: function () {
              return this.removeFrom(this._map || this._mapToAdd);
            },
            removeFrom: function (s) {
              return (s && s.removeLayer(this), this);
            },
            getPane: function (s) {
              return this._map.getPane(
                s ? this.options[s] || s : this.options.pane,
              );
            },
            addInteractiveTarget: function (s) {
              return ((this._map._targets[B(s)] = this), this);
            },
            removeInteractiveTarget: function (s) {
              return (delete this._map._targets[B(s)], this);
            },
            getAttribution: function () {
              return this.options.attribution;
            },
            _layerAdd: function (s) {
              var i = s.target;
              if (i.hasLayer(this)) {
                if (
                  ((this._map = i),
                  (this._zoomAnimated = i._zoomAnimated),
                  this.getEvents)
                ) {
                  var r = this.getEvents();
                  (i.on(r, this),
                    this.once(
                      "remove",
                      function () {
                        i.off(r, this);
                      },
                      this,
                    ));
                }
                (this.onAdd(i),
                  this.fire("add"),
                  i.fire("layeradd", { layer: this }));
              }
            },
          });
          et.include({
            addLayer: function (s) {
              if (!s._layerAdd)
                throw new Error("The provided object is not a Layer.");
              var i = B(s);
              return this._layers[i]
                ? this
                : ((this._layers[i] = s),
                  (s._mapToAdd = this),
                  s.beforeAdd && s.beforeAdd(this),
                  this.whenReady(s._layerAdd, s),
                  this);
            },
            removeLayer: function (s) {
              var i = B(s);
              return this._layers[i]
                ? (this._loaded && s.onRemove(this),
                  delete this._layers[i],
                  this._loaded &&
                    (this.fire("layerremove", { layer: s }), s.fire("remove")),
                  (s._map = s._mapToAdd = null),
                  this)
                : this;
            },
            hasLayer: function (s) {
              return B(s) in this._layers;
            },
            eachLayer: function (s, i) {
              for (var r in this._layers) s.call(i, this._layers[r]);
              return this;
            },
            _addLayers: function (s) {
              s = s ? (ie(s) ? s : [s]) : [];
              for (var i = 0, r = s.length; i < r; i++) this.addLayer(s[i]);
            },
            _addZoomLimit: function (s) {
              (!isNaN(s.options.maxZoom) || !isNaN(s.options.minZoom)) &&
                ((this._zoomBoundLayers[B(s)] = s), this._updateZoomLevels());
            },
            _removeZoomLimit: function (s) {
              var i = B(s);
              this._zoomBoundLayers[i] &&
                (delete this._zoomBoundLayers[i], this._updateZoomLevels());
            },
            _updateZoomLevels: function () {
              var s = 1 / 0,
                i = -1 / 0,
                r = this._getZoomSpan();
              for (var d in this._zoomBoundLayers) {
                var h = this._zoomBoundLayers[d].options;
                ((s = h.minZoom === void 0 ? s : Math.min(s, h.minZoom)),
                  (i = h.maxZoom === void 0 ? i : Math.max(i, h.maxZoom)));
              }
              ((this._layersMaxZoom = i === -1 / 0 ? void 0 : i),
                (this._layersMinZoom = s === 1 / 0 ? void 0 : s),
                r !== this._getZoomSpan() && this.fire("zoomlevelschange"),
                this.options.maxZoom === void 0 &&
                  this._layersMaxZoom &&
                  this.getZoom() > this._layersMaxZoom &&
                  this.setZoom(this._layersMaxZoom),
                this.options.minZoom === void 0 &&
                  this._layersMinZoom &&
                  this.getZoom() < this._layersMinZoom &&
                  this.setZoom(this._layersMinZoom));
            },
          });
          var ni = gs.extend({
              initialize: function (s, i) {
                (Y(this, i), (this._layers = {}));
                var r, d;
                if (s)
                  for (r = 0, d = s.length; r < d; r++) this.addLayer(s[r]);
              },
              addLayer: function (s) {
                var i = this.getLayerId(s);
                return (
                  (this._layers[i] = s),
                  this._map && this._map.addLayer(s),
                  this
                );
              },
              removeLayer: function (s) {
                var i = s in this._layers ? s : this.getLayerId(s);
                return (
                  this._map &&
                    this._layers[i] &&
                    this._map.removeLayer(this._layers[i]),
                  delete this._layers[i],
                  this
                );
              },
              hasLayer: function (s) {
                var i = typeof s == "number" ? s : this.getLayerId(s);
                return i in this._layers;
              },
              clearLayers: function () {
                return this.eachLayer(this.removeLayer, this);
              },
              invoke: function (s) {
                var i = Array.prototype.slice.call(arguments, 1),
                  r,
                  d;
                for (r in this._layers)
                  ((d = this._layers[r]), d[s] && d[s].apply(d, i));
                return this;
              },
              onAdd: function (s) {
                this.eachLayer(s.addLayer, s);
              },
              onRemove: function (s) {
                this.eachLayer(s.removeLayer, s);
              },
              eachLayer: function (s, i) {
                for (var r in this._layers) s.call(i, this._layers[r]);
                return this;
              },
              getLayer: function (s) {
                return this._layers[s];
              },
              getLayers: function () {
                var s = [];
                return (this.eachLayer(s.push, s), s);
              },
              setZIndex: function (s) {
                return this.invoke("setZIndex", s);
              },
              getLayerId: function (s) {
                return B(s);
              },
            }),
            yc = function (s, i) {
              return new ni(s, i);
            },
            Ps = ni.extend({
              addLayer: function (s) {
                return this.hasLayer(s)
                  ? this
                  : (s.addEventParent(this),
                    ni.prototype.addLayer.call(this, s),
                    this.fire("layeradd", { layer: s }));
              },
              removeLayer: function (s) {
                return this.hasLayer(s)
                  ? (s in this._layers && (s = this._layers[s]),
                    s.removeEventParent(this),
                    ni.prototype.removeLayer.call(this, s),
                    this.fire("layerremove", { layer: s }))
                  : this;
              },
              setStyle: function (s) {
                return this.invoke("setStyle", s);
              },
              bringToFront: function () {
                return this.invoke("bringToFront");
              },
              bringToBack: function () {
                return this.invoke("bringToBack");
              },
              getBounds: function () {
                var s = new I();
                for (var i in this._layers) {
                  var r = this._layers[i];
                  s.extend(r.getBounds ? r.getBounds() : r.getLatLng());
                }
                return s;
              },
            }),
            io = function (s, i) {
              return new Ps(s, i);
            },
            Ls = Ae.extend({
              options: {
                popupAnchor: [0, 0],
                tooltipAnchor: [0, 0],
                crossOrigin: !1,
              },
              initialize: function (s) {
                Y(this, s);
              },
              createIcon: function (s) {
                return this._createIcon("icon", s);
              },
              createShadow: function (s) {
                return this._createIcon("shadow", s);
              },
              _createIcon: function (s, i) {
                var r = this._getIconUrl(s);
                if (!r) {
                  if (s === "icon")
                    throw new Error(
                      "iconUrl not set in Icon options (see the docs).",
                    );
                  return null;
                }
                var d = this._createImg(r, i && i.tagName === "IMG" ? i : null);
                return (
                  this._setIconStyles(d, s),
                  (this.options.crossOrigin ||
                    this.options.crossOrigin === "") &&
                    (d.crossOrigin =
                      this.options.crossOrigin === !0
                        ? ""
                        : this.options.crossOrigin),
                  d
                );
              },
              _setIconStyles: function (s, i) {
                var r = this.options,
                  d = r[i + "Size"];
                typeof d == "number" && (d = [d, d]);
                var h = z(d),
                  p = z(
                    (i === "shadow" && r.shadowAnchor) ||
                      r.iconAnchor ||
                      (h && h.divideBy(2, !0)),
                  );
                ((s.className =
                  "leaflet-marker-" + i + " " + (r.className || "")),
                  p &&
                    ((s.style.marginLeft = -p.x + "px"),
                    (s.style.marginTop = -p.y + "px")),
                  h &&
                    ((s.style.width = h.x + "px"),
                    (s.style.height = h.y + "px")));
              },
              _createImg: function (s, i) {
                return (
                  (i = i || document.createElement("img")),
                  (i.src = s),
                  i
                );
              },
              _getIconUrl: function (s) {
                return (
                  (v.retina && this.options[s + "RetinaUrl"]) ||
                  this.options[s + "Url"]
                );
              },
            });
          function Ii(s) {
            return new Ls(s);
          }
          var Gi = Ls.extend({
              options: {
                iconUrl: "marker-icon.png",
                iconRetinaUrl: "marker-icon-2x.png",
                shadowUrl: "marker-shadow.png",
                iconSize: [25, 41],
                iconAnchor: [12, 41],
                popupAnchor: [1, -34],
                tooltipAnchor: [16, -28],
                shadowSize: [41, 41],
              },
              _getIconUrl: function (s) {
                return (
                  typeof Gi.imagePath != "string" &&
                    (Gi.imagePath = this._detectIconPath()),
                  (this.options.imagePath || Gi.imagePath) +
                    Ls.prototype._getIconUrl.call(this, s)
                );
              },
              _stripUrl: function (s) {
                var i = function (r, d, h) {
                  var p = d.exec(r);
                  return p && p[h];
                };
                return (
                  (s = i(s, /^url\((['"])?(.+)\1\)$/, 2)),
                  s && i(s, /^(.*)marker-icon\.png$/, 1)
                );
              },
              _detectIconPath: function () {
                var s = Be("div", "leaflet-default-icon-path", document.body),
                  i = za(s, "background-image") || za(s, "backgroundImage");
                if ((document.body.removeChild(s), (i = this._stripUrl(i)), i))
                  return i;
                var r = document.querySelector('link[href$="leaflet.css"]');
                return r ? r.href.substring(0, r.href.length - 11 - 1) : "";
              },
            }),
            Ki = ns.extend({
              initialize: function (s) {
                this._marker = s;
              },
              addHooks: function () {
                var s = this._marker._icon;
                (this._draggable || (this._draggable = new Ms(s, s, !0)),
                  this._draggable
                    .on(
                      {
                        dragstart: this._onDragStart,
                        predrag: this._onPreDrag,
                        drag: this._onDrag,
                        dragend: this._onDragEnd,
                      },
                      this,
                    )
                    .enable(),
                  Je(s, "leaflet-marker-draggable"));
              },
              removeHooks: function () {
                (this._draggable
                  .off(
                    {
                      dragstart: this._onDragStart,
                      predrag: this._onPreDrag,
                      drag: this._onDrag,
                      dragend: this._onDragEnd,
                    },
                    this,
                  )
                  .disable(),
                  this._marker._icon &&
                    Kt(this._marker._icon, "leaflet-marker-draggable"));
              },
              moved: function () {
                return this._draggable && this._draggable._moved;
              },
              _adjustPan: function (s) {
                var i = this._marker,
                  r = i._map,
                  d = this._marker.options.autoPanSpeed,
                  h = this._marker.options.autoPanPadding,
                  p = Cs(i._icon),
                  j = r.getPixelBounds(),
                  M = r.getPixelOrigin(),
                  H = C(
                    j.min._subtract(M).add(h),
                    j.max._subtract(M).subtract(h),
                  );
                if (!H.contains(p)) {
                  var se = z(
                    (Math.max(H.max.x, p.x) - H.max.x) / (j.max.x - H.max.x) -
                      (Math.min(H.min.x, p.x) - H.min.x) / (j.min.x - H.min.x),
                    (Math.max(H.max.y, p.y) - H.max.y) / (j.max.y - H.max.y) -
                      (Math.min(H.min.y, p.y) - H.min.y) / (j.min.y - H.min.y),
                  ).multiplyBy(d);
                  (r.panBy(se, { animate: !1 }),
                    this._draggable._newPos._add(se),
                    this._draggable._startPos._add(se),
                    At(i._icon, this._draggable._newPos),
                    this._onDrag(s),
                    (this._panRequest = me(this._adjustPan.bind(this, s))));
                }
              },
              _onDragStart: function () {
                ((this._oldLatLng = this._marker.getLatLng()),
                  this._marker.closePopup && this._marker.closePopup(),
                  this._marker.fire("movestart").fire("dragstart"));
              },
              _onPreDrag: function (s) {
                this._marker.options.autoPan &&
                  (Oe(this._panRequest),
                  (this._panRequest = me(this._adjustPan.bind(this, s))));
              },
              _onDrag: function (s) {
                var i = this._marker,
                  r = i._shadow,
                  d = Cs(i._icon),
                  h = i._map.layerPointToLatLng(d);
                (r && At(r, d),
                  (i._latlng = h),
                  (s.latlng = h),
                  (s.oldLatLng = this._oldLatLng),
                  i.fire("move", s).fire("drag", s));
              },
              _onDragEnd: function (s) {
                (Oe(this._panRequest),
                  delete this._oldLatLng,
                  this._marker.fire("moveend").fire("dragend", s));
              },
            }),
            Zi = gs.extend({
              options: {
                icon: new Gi(),
                interactive: !0,
                keyboard: !0,
                title: "",
                alt: "Marker",
                zIndexOffset: 0,
                opacity: 1,
                riseOnHover: !1,
                riseOffset: 250,
                pane: "markerPane",
                shadowPane: "shadowPane",
                bubblingMouseEvents: !1,
                autoPanOnFocus: !0,
                draggable: !1,
                autoPan: !1,
                autoPanPadding: [50, 50],
                autoPanSpeed: 10,
              },
              initialize: function (s, i) {
                (Y(this, i), (this._latlng = he(s)));
              },
              onAdd: function (s) {
                ((this._zoomAnimated =
                  this._zoomAnimated && s.options.markerZoomAnimation),
                  this._zoomAnimated &&
                    s.on("zoomanim", this._animateZoom, this),
                  this._initIcon(),
                  this.update());
              },
              onRemove: function (s) {
                (this.dragging &&
                  this.dragging.enabled() &&
                  ((this.options.draggable = !0), this.dragging.removeHooks()),
                  delete this.dragging,
                  this._zoomAnimated &&
                    s.off("zoomanim", this._animateZoom, this),
                  this._removeIcon(),
                  this._removeShadow());
              },
              getEvents: function () {
                return { zoom: this.update, viewreset: this.update };
              },
              getLatLng: function () {
                return this._latlng;
              },
              setLatLng: function (s) {
                var i = this._latlng;
                return (
                  (this._latlng = he(s)),
                  this.update(),
                  this.fire("move", { oldLatLng: i, latlng: this._latlng })
                );
              },
              setZIndexOffset: function (s) {
                return ((this.options.zIndexOffset = s), this.update());
              },
              getIcon: function () {
                return this.options.icon;
              },
              setIcon: function (s) {
                return (
                  (this.options.icon = s),
                  this._map && (this._initIcon(), this.update()),
                  this._popup &&
                    this.bindPopup(this._popup, this._popup.options),
                  this
                );
              },
              getElement: function () {
                return this._icon;
              },
              update: function () {
                if (this._icon && this._map) {
                  var s = this._map.latLngToLayerPoint(this._latlng).round();
                  this._setPos(s);
                }
                return this;
              },
              _initIcon: function () {
                var s = this.options,
                  i =
                    "leaflet-zoom-" +
                    (this._zoomAnimated ? "animated" : "hide"),
                  r = s.icon.createIcon(this._icon),
                  d = !1;
                (r !== this._icon &&
                  (this._icon && this._removeIcon(),
                  (d = !0),
                  s.title && (r.title = s.title),
                  r.tagName === "IMG" && (r.alt = s.alt || "")),
                  Je(r, i),
                  s.keyboard &&
                    ((r.tabIndex = "0"), r.setAttribute("role", "button")),
                  (this._icon = r),
                  s.riseOnHover &&
                    this.on({
                      mouseover: this._bringToFront,
                      mouseout: this._resetZIndex,
                    }),
                  this.options.autoPanOnFocus &&
                    Ge(r, "focus", this._panOnFocus, this));
                var h = s.icon.createShadow(this._shadow),
                  p = !1;
                (h !== this._shadow && (this._removeShadow(), (p = !0)),
                  h && (Je(h, i), (h.alt = "")),
                  (this._shadow = h),
                  s.opacity < 1 && this._updateOpacity(),
                  d && this.getPane().appendChild(this._icon),
                  this._initInteraction(),
                  h &&
                    p &&
                    this.getPane(s.shadowPane).appendChild(this._shadow));
              },
              _removeIcon: function () {
                (this.options.riseOnHover &&
                  this.off({
                    mouseover: this._bringToFront,
                    mouseout: this._resetZIndex,
                  }),
                  this.options.autoPanOnFocus &&
                    xt(this._icon, "focus", this._panOnFocus, this),
                  ot(this._icon),
                  this.removeInteractiveTarget(this._icon),
                  (this._icon = null));
              },
              _removeShadow: function () {
                (this._shadow && ot(this._shadow), (this._shadow = null));
              },
              _setPos: function (s) {
                (this._icon && At(this._icon, s),
                  this._shadow && At(this._shadow, s),
                  (this._zIndex = s.y + this.options.zIndexOffset),
                  this._resetZIndex());
              },
              _updateZIndex: function (s) {
                this._icon && (this._icon.style.zIndex = this._zIndex + s);
              },
              _animateZoom: function (s) {
                var i = this._map
                  ._latLngToNewLayerPoint(this._latlng, s.zoom, s.center)
                  .round();
                this._setPos(i);
              },
              _initInteraction: function () {
                if (
                  this.options.interactive &&
                  (Je(this._icon, "leaflet-interactive"),
                  this.addInteractiveTarget(this._icon),
                  Ki)
                ) {
                  var s = this.options.draggable;
                  (this.dragging &&
                    ((s = this.dragging.enabled()), this.dragging.disable()),
                    (this.dragging = new Ki(this)),
                    s && this.dragging.enable());
                }
              },
              setOpacity: function (s) {
                return (
                  (this.options.opacity = s),
                  this._map && this._updateOpacity(),
                  this
                );
              },
              _updateOpacity: function () {
                var s = this.options.opacity;
                (this._icon && Dt(this._icon, s),
                  this._shadow && Dt(this._shadow, s));
              },
              _bringToFront: function () {
                this._updateZIndex(this.options.riseOffset);
              },
              _resetZIndex: function () {
                this._updateZIndex(0);
              },
              _panOnFocus: function () {
                var s = this._map;
                if (s) {
                  var i = this.options.icon.options,
                    r = i.iconSize ? z(i.iconSize) : z(0, 0),
                    d = i.iconAnchor ? z(i.iconAnchor) : z(0, 0);
                  s.panInside(this._latlng, {
                    paddingTopLeft: d,
                    paddingBottomRight: r.subtract(d),
                  });
                }
              },
              _getPopupAnchor: function () {
                return this.options.icon.options.popupAnchor;
              },
              _getTooltipAnchor: function () {
                return this.options.icon.options.tooltipAnchor;
              },
            });
          function lo(s, i) {
            return new Zi(s, i);
          }
          var Es = gs.extend({
              options: {
                stroke: !0,
                color: "#3388ff",
                weight: 3,
                opacity: 1,
                lineCap: "round",
                lineJoin: "round",
                dashArray: null,
                dashOffset: null,
                fill: !1,
                fillColor: null,
                fillOpacity: 0.2,
                fillRule: "evenodd",
                interactive: !0,
                bubblingMouseEvents: !0,
              },
              beforeAdd: function (s) {
                this._renderer = s.getRenderer(this);
              },
              onAdd: function () {
                (this._renderer._initPath(this),
                  this._reset(),
                  this._renderer._addPath(this));
              },
              onRemove: function () {
                this._renderer._removePath(this);
              },
              redraw: function () {
                return (this._map && this._renderer._updatePath(this), this);
              },
              setStyle: function (s) {
                return (
                  Y(this, s),
                  this._renderer &&
                    (this._renderer._updateStyle(this),
                    this.options.stroke &&
                      s &&
                      Object.prototype.hasOwnProperty.call(s, "weight") &&
                      this._updateBounds()),
                  this
                );
              },
              bringToFront: function () {
                return (
                  this._renderer && this._renderer._bringToFront(this),
                  this
                );
              },
              bringToBack: function () {
                return (
                  this._renderer && this._renderer._bringToBack(this),
                  this
                );
              },
              getElement: function () {
                return this._path;
              },
              _reset: function () {
                (this._project(), this._update());
              },
              _clickTolerance: function () {
                return (
                  (this.options.stroke ? this.options.weight / 2 : 0) +
                  (this._renderer.options.tolerance || 0)
                );
              },
            }),
            ii = Es.extend({
              options: { fill: !0, radius: 10 },
              initialize: function (s, i) {
                (Y(this, i),
                  (this._latlng = he(s)),
                  (this._radius = this.options.radius));
              },
              setLatLng: function (s) {
                var i = this._latlng;
                return (
                  (this._latlng = he(s)),
                  this.redraw(),
                  this.fire("move", { oldLatLng: i, latlng: this._latlng })
                );
              },
              getLatLng: function () {
                return this._latlng;
              },
              setRadius: function (s) {
                return (
                  (this.options.radius = this._radius = s),
                  this.redraw()
                );
              },
              getRadius: function () {
                return this._radius;
              },
              setStyle: function (s) {
                var i = (s && s.radius) || this._radius;
                return (
                  Es.prototype.setStyle.call(this, s),
                  this.setRadius(i),
                  this
                );
              },
              _project: function () {
                ((this._point = this._map.latLngToLayerPoint(this._latlng)),
                  this._updateBounds());
              },
              _updateBounds: function () {
                var s = this._radius,
                  i = this._radiusY || s,
                  r = this._clickTolerance(),
                  d = [s + r, i + r];
                this._pxBounds = new g(
                  this._point.subtract(d),
                  this._point.add(d),
                );
              },
              _update: function () {
                this._map && this._updatePath();
              },
              _updatePath: function () {
                this._renderer._updateCircle(this);
              },
              _empty: function () {
                return (
                  this._radius &&
                  !this._renderer._bounds.intersects(this._pxBounds)
                );
              },
              _containsPoint: function (s) {
                return (
                  s.distanceTo(this._point) <=
                  this._radius + this._clickTolerance()
                );
              },
            });
          function ro(s, i) {
            return new ii(s, i);
          }
          var _l = ii.extend({
            initialize: function (s, i, r) {
              if (
                (typeof i == "number" && (i = V({}, r, { radius: i })),
                Y(this, i),
                (this._latlng = he(s)),
                isNaN(this.options.radius))
              )
                throw new Error("Circle radius cannot be NaN");
              this._mRadius = this.options.radius;
            },
            setRadius: function (s) {
              return ((this._mRadius = s), this.redraw());
            },
            getRadius: function () {
              return this._mRadius;
            },
            getBounds: function () {
              var s = [this._radius, this._radiusY || this._radius];
              return new I(
                this._map.layerPointToLatLng(this._point.subtract(s)),
                this._map.layerPointToLatLng(this._point.add(s)),
              );
            },
            setStyle: Es.prototype.setStyle,
            _project: function () {
              var s = this._latlng.lng,
                i = this._latlng.lat,
                r = this._map,
                d = r.options.crs;
              if (d.distance === $e.distance) {
                var h = Math.PI / 180,
                  p = this._mRadius / $e.R / h,
                  j = r.project([i + p, s]),
                  M = r.project([i - p, s]),
                  H = j.add(M).divideBy(2),
                  se = r.unproject(H).lat,
                  ye =
                    Math.acos(
                      (Math.cos(p * h) - Math.sin(i * h) * Math.sin(se * h)) /
                        (Math.cos(i * h) * Math.cos(se * h)),
                    ) / h;
                ((isNaN(ye) || ye === 0) &&
                  (ye = p / Math.cos((Math.PI / 180) * i)),
                  (this._point = H.subtract(r.getPixelOrigin())),
                  (this._radius = isNaN(ye)
                    ? 0
                    : H.x - r.project([se, s - ye]).x),
                  (this._radiusY = H.y - j.y));
              } else {
                var De = d.unproject(
                  d.project(this._latlng).subtract([this._mRadius, 0]),
                );
                ((this._point = r.latLngToLayerPoint(this._latlng)),
                  (this._radius = this._point.x - r.latLngToLayerPoint(De).x));
              }
              this._updateBounds();
            },
          });
          function oo(s, i, r) {
            return new _l(s, i, r);
          }
          var $s = Es.extend({
            options: { smoothFactor: 1, noClip: !1 },
            initialize: function (s, i) {
              (Y(this, i), this._setLatLngs(s));
            },
            getLatLngs: function () {
              return this._latlngs;
            },
            setLatLngs: function (s) {
              return (this._setLatLngs(s), this.redraw());
            },
            isEmpty: function () {
              return !this._latlngs.length;
            },
            closestLayerPoint: function (s) {
              for (
                var i = 1 / 0,
                  r = null,
                  d = ct,
                  h,
                  p,
                  j = 0,
                  M = this._parts.length;
                j < M;
                j++
              )
                for (
                  var H = this._parts[j], se = 1, ye = H.length;
                  se < ye;
                  se++
                ) {
                  ((h = H[se - 1]), (p = H[se]));
                  var De = d(s, h, p, !0);
                  De < i && ((i = De), (r = d(s, h, p)));
                }
              return (r && (r.distance = Math.sqrt(i)), r);
            },
            getCenter: function () {
              if (!this._map)
                throw new Error(
                  "Must add layer to map before using getCenter()",
                );
              return Vs(this._defaultShape(), this._map.options.crs);
            },
            getBounds: function () {
              return this._bounds;
            },
            addLatLng: function (s, i) {
              return (
                (i = i || this._defaultShape()),
                (s = he(s)),
                i.push(s),
                this._bounds.extend(s),
                this.redraw()
              );
            },
            _setLatLngs: function (s) {
              ((this._bounds = new I()),
                (this._latlngs = this._convertLatLngs(s)));
            },
            _defaultShape: function () {
              return La(this._latlngs) ? this._latlngs : this._latlngs[0];
            },
            _convertLatLngs: function (s) {
              for (var i = [], r = La(s), d = 0, h = s.length; d < h; d++)
                r
                  ? ((i[d] = he(s[d])), this._bounds.extend(i[d]))
                  : (i[d] = this._convertLatLngs(s[d]));
              return i;
            },
            _project: function () {
              var s = new g();
              ((this._rings = []),
                this._projectLatlngs(this._latlngs, this._rings, s),
                this._bounds.isValid() &&
                  s.isValid() &&
                  ((this._rawPxBounds = s), this._updateBounds()));
            },
            _updateBounds: function () {
              var s = this._clickTolerance(),
                i = new O(s, s);
              this._rawPxBounds &&
                (this._pxBounds = new g([
                  this._rawPxBounds.min.subtract(i),
                  this._rawPxBounds.max.add(i),
                ]));
            },
            _projectLatlngs: function (s, i, r) {
              var d = s[0] instanceof pe,
                h = s.length,
                p,
                j;
              if (d) {
                for (j = [], p = 0; p < h; p++)
                  ((j[p] = this._map.latLngToLayerPoint(s[p])), r.extend(j[p]));
                i.push(j);
              } else for (p = 0; p < h; p++) this._projectLatlngs(s[p], i, r);
            },
            _clipPoints: function () {
              var s = this._renderer._bounds;
              if (
                ((this._parts = []),
                !(!this._pxBounds || !this._pxBounds.intersects(s)))
              ) {
                if (this.options.noClip) {
                  this._parts = this._rings;
                  return;
                }
                var i = this._parts,
                  r,
                  d,
                  h,
                  p,
                  j,
                  M,
                  H;
                for (r = 0, h = 0, p = this._rings.length; r < p; r++)
                  for (H = this._rings[r], d = 0, j = H.length; d < j - 1; d++)
                    ((M = jl(H[d], H[d + 1], s, d, !0)),
                      M &&
                        ((i[h] = i[h] || []),
                        i[h].push(M[0]),
                        (M[1] !== H[d + 1] || d === j - 2) &&
                          (i[h].push(M[1]), h++)));
              }
            },
            _simplifyPoints: function () {
              for (
                var s = this._parts,
                  i = this.options.smoothFactor,
                  r = 0,
                  d = s.length;
                r < d;
                r++
              )
                s[r] = bl(s[r], i);
            },
            _update: function () {
              this._map &&
                (this._clipPoints(),
                this._simplifyPoints(),
                this._updatePath());
            },
            _updatePath: function () {
              this._renderer._updatePoly(this);
            },
            _containsPoint: function (s, i) {
              var r,
                d,
                h,
                p,
                j,
                M,
                H = this._clickTolerance();
              if (!this._pxBounds || !this._pxBounds.contains(s)) return !1;
              for (r = 0, p = this._parts.length; r < p; r++)
                for (
                  M = this._parts[r], d = 0, j = M.length, h = j - 1;
                  d < j;
                  h = d++
                )
                  if (!(!i && d === 0) && vl(s, M[h], M[d]) <= H) return !0;
              return !1;
            },
          });
          function jc(s, i) {
            return new $s(s, i);
          }
          $s._flat = Ln;
          var li = $s.extend({
            options: { fill: !0 },
            isEmpty: function () {
              return !this._latlngs.length || !this._latlngs[0].length;
            },
            getCenter: function () {
              if (!this._map)
                throw new Error(
                  "Must add layer to map before using getCenter()",
                );
              return gl(this._defaultShape(), this._map.options.crs);
            },
            _convertLatLngs: function (s) {
              var i = $s.prototype._convertLatLngs.call(this, s),
                r = i.length;
              return (
                r >= 2 &&
                  i[0] instanceof pe &&
                  i[0].equals(i[r - 1]) &&
                  i.pop(),
                i
              );
            },
            _setLatLngs: function (s) {
              ($s.prototype._setLatLngs.call(this, s),
                La(this._latlngs) && (this._latlngs = [this._latlngs]));
            },
            _defaultShape: function () {
              return La(this._latlngs[0])
                ? this._latlngs[0]
                : this._latlngs[0][0];
            },
            _clipPoints: function () {
              var s = this._renderer._bounds,
                i = this.options.weight,
                r = new O(i, i);
              if (
                ((s = new g(s.min.subtract(r), s.max.add(r))),
                (this._parts = []),
                !(!this._pxBounds || !this._pxBounds.intersects(s)))
              ) {
                if (this.options.noClip) {
                  this._parts = this._rings;
                  return;
                }
                for (var d = 0, h = this._rings.length, p; d < h; d++)
                  ((p = fl(this._rings[d], s, !0)),
                    p.length && this._parts.push(p));
              }
            },
            _updatePath: function () {
              this._renderer._updatePoly(this, !0);
            },
            _containsPoint: function (s) {
              var i = !1,
                r,
                d,
                h,
                p,
                j,
                M,
                H,
                se;
              if (!this._pxBounds || !this._pxBounds.contains(s)) return !1;
              for (p = 0, H = this._parts.length; p < H; p++)
                for (
                  r = this._parts[p], j = 0, se = r.length, M = se - 1;
                  j < se;
                  M = j++
                )
                  ((d = r[j]),
                    (h = r[M]),
                    d.y > s.y != h.y > s.y &&
                      s.x < ((h.x - d.x) * (s.y - d.y)) / (h.y - d.y) + d.x &&
                      (i = !i));
              return i || $s.prototype._containsPoint.call(this, s, !0);
            },
          });
          function Nc(s, i) {
            return new li(s, i);
          }
          var Js = Ps.extend({
            initialize: function (s, i) {
              (Y(this, i), (this._layers = {}), s && this.addData(s));
            },
            addData: function (s) {
              var i = ie(s) ? s : s.features,
                r,
                d,
                h;
              if (i) {
                for (r = 0, d = i.length; r < d; r++)
                  ((h = i[r]),
                    (h.geometries ||
                      h.geometry ||
                      h.features ||
                      h.coordinates) &&
                      this.addData(h));
                return this;
              }
              var p = this.options;
              if (p.filter && !p.filter(s)) return this;
              var j = Sa(s, p);
              return j
                ? ((j.feature = Sl(s)),
                  (j.defaultOptions = j.options),
                  this.resetStyle(j),
                  p.onEachFeature && p.onEachFeature(s, j),
                  this.addLayer(j))
                : this;
            },
            resetStyle: function (s) {
              return s === void 0
                ? this.eachLayer(this.resetStyle, this)
                : ((s.options = V({}, s.defaultOptions)),
                  this._setLayerStyle(s, this.options.style),
                  this);
            },
            setStyle: function (s) {
              return this.eachLayer(function (i) {
                this._setLayerStyle(i, s);
              }, this);
            },
            _setLayerStyle: function (s, i) {
              s.setStyle &&
                (typeof i == "function" && (i = i(s.feature)), s.setStyle(i));
            },
          });
          function Sa(s, i) {
            var r = s.type === "Feature" ? s.geometry : s,
              d = r ? r.coordinates : null,
              h = [],
              p = i && i.pointToLayer,
              j = (i && i.coordsToLatLng) || wl,
              M,
              H,
              se,
              ye;
            if (!d && !r) return null;
            switch (r.type) {
              case "Point":
                return ((M = j(d)), ri(p, s, M, i));
              case "MultiPoint":
                for (se = 0, ye = d.length; se < ye; se++)
                  ((M = j(d[se])), h.push(ri(p, s, M, i)));
                return new Ps(h);
              case "LineString":
              case "MultiLineString":
                return (
                  (H = qi(d, r.type === "LineString" ? 0 : 1, j)),
                  new $s(H, i)
                );
              case "Polygon":
              case "MultiPolygon":
                return (
                  (H = qi(d, r.type === "Polygon" ? 1 : 2, j)),
                  new li(H, i)
                );
              case "GeometryCollection":
                for (se = 0, ye = r.geometries.length; se < ye; se++) {
                  var De = Sa(
                    {
                      geometry: r.geometries[se],
                      type: "Feature",
                      properties: s.properties,
                    },
                    i,
                  );
                  De && h.push(De);
                }
                return new Ps(h);
              case "FeatureCollection":
                for (se = 0, ye = r.features.length; se < ye; se++) {
                  var it = Sa(r.features[se], i);
                  it && h.push(it);
                }
                return new Ps(h);
              default:
                throw new Error("Invalid GeoJSON object.");
            }
          }
          function ri(s, i, r, d) {
            return s ? s(i, r) : new Zi(r, d && d.markersInheritOptions && d);
          }
          function wl(s) {
            return new pe(s[1], s[0], s[2]);
          }
          function qi(s, i, r) {
            for (var d = [], h = 0, p = s.length, j; h < p; h++)
              ((j = i ? qi(s[h], i - 1, r) : (r || wl)(s[h])), d.push(j));
            return d;
          }
          function kl(s, i) {
            return (
              (s = he(s)),
              s.alt !== void 0
                ? [F(s.lng, i), F(s.lat, i), F(s.alt, i)]
                : [F(s.lng, i), F(s.lat, i)]
            );
          }
          function Vi(s, i, r, d) {
            for (var h = [], p = 0, j = s.length; p < j; p++)
              h.push(i ? Vi(s[p], La(s[p]) ? 0 : i - 1, r, d) : kl(s[p], d));
            return (!i && r && h.length > 0 && h.push(h[0].slice()), h);
          }
          function un(s, i) {
            return s.feature ? V({}, s.feature, { geometry: i }) : Sl(i);
          }
          function Sl(s) {
            return s.type === "Feature" || s.type === "FeatureCollection"
              ? s
              : { type: "Feature", properties: {}, geometry: s };
          }
          var hn = {
            toGeoJSON: function (s) {
              return un(this, {
                type: "Point",
                coordinates: kl(this.getLatLng(), s),
              });
            },
          };
          (Zi.include(hn),
            _l.include(hn),
            ii.include(hn),
            $s.include({
              toGeoJSON: function (s) {
                var i = !La(this._latlngs),
                  r = Vi(this._latlngs, i ? 1 : 0, !1, s);
                return un(this, {
                  type: (i ? "Multi" : "") + "LineString",
                  coordinates: r,
                });
              },
            }),
            li.include({
              toGeoJSON: function (s) {
                var i = !La(this._latlngs),
                  r = i && !La(this._latlngs[0]),
                  d = Vi(this._latlngs, r ? 2 : i ? 1 : 0, !0, s);
                return (
                  i || (d = [d]),
                  un(this, {
                    type: (r ? "Multi" : "") + "Polygon",
                    coordinates: d,
                  })
                );
              },
            }),
            ni.include({
              toMultiPoint: function (s) {
                var i = [];
                return (
                  this.eachLayer(function (r) {
                    i.push(r.toGeoJSON(s).geometry.coordinates);
                  }),
                  un(this, { type: "MultiPoint", coordinates: i })
                );
              },
              toGeoJSON: function (s) {
                var i =
                  this.feature &&
                  this.feature.geometry &&
                  this.feature.geometry.type;
                if (i === "MultiPoint") return this.toMultiPoint(s);
                var r = i === "GeometryCollection",
                  d = [];
                return (
                  this.eachLayer(function (h) {
                    if (h.toGeoJSON) {
                      var p = h.toGeoJSON(s);
                      if (r) d.push(p.geometry);
                      else {
                        var j = Sl(p);
                        j.type === "FeatureCollection"
                          ? d.push.apply(d, j.features)
                          : d.push(j);
                      }
                    }
                  }),
                  r
                    ? un(this, { geometries: d, type: "GeometryCollection" })
                    : { type: "FeatureCollection", features: d }
                );
              },
            }));
          function Tl(s, i) {
            return new Js(s, i);
          }
          var Yi = Tl,
            oi = gs.extend({
              options: {
                opacity: 1,
                alt: "",
                interactive: !1,
                crossOrigin: !1,
                errorOverlayUrl: "",
                zIndex: 1,
                className: "",
              },
              initialize: function (s, i, r) {
                ((this._url = s), (this._bounds = X(i)), Y(this, r));
              },
              onAdd: function () {
                (this._image ||
                  (this._initImage(),
                  this.options.opacity < 1 && this._updateOpacity()),
                  this.options.interactive &&
                    (Je(this._image, "leaflet-interactive"),
                    this.addInteractiveTarget(this._image)),
                  this.getPane().appendChild(this._image),
                  this._reset());
              },
              onRemove: function () {
                (ot(this._image),
                  this.options.interactive &&
                    this.removeInteractiveTarget(this._image));
              },
              setOpacity: function (s) {
                return (
                  (this.options.opacity = s),
                  this._image && this._updateOpacity(),
                  this
                );
              },
              setStyle: function (s) {
                return (s.opacity && this.setOpacity(s.opacity), this);
              },
              bringToFront: function () {
                return (this._map && Ct(this._image), this);
              },
              bringToBack: function () {
                return (this._map && xs(this._image), this);
              },
              setUrl: function (s) {
                return (
                  (this._url = s),
                  this._image && (this._image.src = s),
                  this
                );
              },
              setBounds: function (s) {
                return (
                  (this._bounds = X(s)),
                  this._map && this._reset(),
                  this
                );
              },
              getEvents: function () {
                var s = { zoom: this._reset, viewreset: this._reset };
                return (
                  this._zoomAnimated && (s.zoomanim = this._animateZoom),
                  s
                );
              },
              setZIndex: function (s) {
                return ((this.options.zIndex = s), this._updateZIndex(), this);
              },
              getBounds: function () {
                return this._bounds;
              },
              getElement: function () {
                return this._image;
              },
              _initImage: function () {
                var s = this._url.tagName === "IMG",
                  i = (this._image = s ? this._url : Be("img"));
                if (
                  (Je(i, "leaflet-image-layer"),
                  this._zoomAnimated && Je(i, "leaflet-zoom-animated"),
                  this.options.className && Je(i, this.options.className),
                  (i.onselectstart = G),
                  (i.onmousemove = G),
                  (i.onload = re(this.fire, this, "load")),
                  (i.onerror = re(this._overlayOnError, this, "error")),
                  (this.options.crossOrigin ||
                    this.options.crossOrigin === "") &&
                    (i.crossOrigin =
                      this.options.crossOrigin === !0
                        ? ""
                        : this.options.crossOrigin),
                  this.options.zIndex && this._updateZIndex(),
                  s)
                ) {
                  this._url = i.src;
                  return;
                }
                ((i.src = this._url), (i.alt = this.options.alt));
              },
              _animateZoom: function (s) {
                var i = this._map.getZoomScale(s.zoom),
                  r = this._map._latLngBoundsToNewLayerBounds(
                    this._bounds,
                    s.zoom,
                    s.center,
                  ).min;
                $a(this._image, r, i);
              },
              _reset: function () {
                var s = this._image,
                  i = new g(
                    this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
                    this._map.latLngToLayerPoint(this._bounds.getSouthEast()),
                  ),
                  r = i.getSize();
                (At(s, i.min),
                  (s.style.width = r.x + "px"),
                  (s.style.height = r.y + "px"));
              },
              _updateOpacity: function () {
                Dt(this._image, this.options.opacity);
              },
              _updateZIndex: function () {
                this._image &&
                  this.options.zIndex !== void 0 &&
                  this.options.zIndex !== null &&
                  (this._image.style.zIndex = this.options.zIndex);
              },
              _overlayOnError: function () {
                this.fire("error");
                var s = this.options.errorOverlayUrl;
                s &&
                  this._url !== s &&
                  ((this._url = s), (this._image.src = s));
              },
              getCenter: function () {
                return this._bounds.getCenter();
              },
            }),
            co = function (s, i, r) {
              return new oi(s, i, r);
            },
            mn = oi.extend({
              options: {
                autoplay: !0,
                loop: !0,
                keepAspectRatio: !0,
                muted: !1,
                playsInline: !0,
              },
              _initImage: function () {
                var s = this._url.tagName === "VIDEO",
                  i = (this._image = s ? this._url : Be("video"));
                if (
                  (Je(i, "leaflet-image-layer"),
                  this._zoomAnimated && Je(i, "leaflet-zoom-animated"),
                  this.options.className && Je(i, this.options.className),
                  (i.onselectstart = G),
                  (i.onmousemove = G),
                  (i.onloadeddata = re(this.fire, this, "load")),
                  s)
                ) {
                  for (
                    var r = i.getElementsByTagName("source"), d = [], h = 0;
                    h < r.length;
                    h++
                  )
                    d.push(r[h].src);
                  this._url = r.length > 0 ? d : [i.src];
                  return;
                }
                (ie(this._url) || (this._url = [this._url]),
                  !this.options.keepAspectRatio &&
                    Object.prototype.hasOwnProperty.call(
                      i.style,
                      "objectFit",
                    ) &&
                    (i.style.objectFit = "fill"),
                  (i.autoplay = !!this.options.autoplay),
                  (i.loop = !!this.options.loop),
                  (i.muted = !!this.options.muted),
                  (i.playsInline = !!this.options.playsInline));
                for (var p = 0; p < this._url.length; p++) {
                  var j = Be("source");
                  ((j.src = this._url[p]), i.appendChild(j));
                }
              },
            });
          function ci(s, i, r) {
            return new mn(s, i, r);
          }
          var Cl = oi.extend({
            _initImage: function () {
              var s = (this._image = this._url);
              (Je(s, "leaflet-image-layer"),
                this._zoomAnimated && Je(s, "leaflet-zoom-animated"),
                this.options.className && Je(s, this.options.className),
                (s.onselectstart = G),
                (s.onmousemove = G));
            },
          });
          function uo(s, i, r) {
            return new Cl(s, i, r);
          }
          var Ta = gs.extend({
            options: {
              interactive: !1,
              offset: [0, 0],
              className: "",
              pane: void 0,
              content: "",
            },
            initialize: function (s, i) {
              (s && (s instanceof pe || ie(s))
                ? ((this._latlng = he(s)), Y(this, i))
                : (Y(this, s), (this._source = i)),
                this.options.content && (this._content = this.options.content));
            },
            openOn: function (s) {
              return (
                (s = arguments.length ? s : this._source._map),
                s.hasLayer(this) || s.addLayer(this),
                this
              );
            },
            close: function () {
              return (this._map && this._map.removeLayer(this), this);
            },
            toggle: function (s) {
              return (
                this._map
                  ? this.close()
                  : (arguments.length ? (this._source = s) : (s = this._source),
                    this._prepareOpen(),
                    this.openOn(s._map)),
                this
              );
            },
            onAdd: function (s) {
              ((this._zoomAnimated = s._zoomAnimated),
                this._container || this._initLayout(),
                s._fadeAnimated && Dt(this._container, 0),
                clearTimeout(this._removeTimeout),
                this.getPane().appendChild(this._container),
                this.update(),
                s._fadeAnimated && Dt(this._container, 1),
                this.bringToFront(),
                this.options.interactive &&
                  (Je(this._container, "leaflet-interactive"),
                  this.addInteractiveTarget(this._container)));
            },
            onRemove: function (s) {
              (s._fadeAnimated
                ? (Dt(this._container, 0),
                  (this._removeTimeout = setTimeout(
                    re(ot, void 0, this._container),
                    200,
                  )))
                : ot(this._container),
                this.options.interactive &&
                  (Kt(this._container, "leaflet-interactive"),
                  this.removeInteractiveTarget(this._container)));
            },
            getLatLng: function () {
              return this._latlng;
            },
            setLatLng: function (s) {
              return (
                (this._latlng = he(s)),
                this._map && (this._updatePosition(), this._adjustPan()),
                this
              );
            },
            getContent: function () {
              return this._content;
            },
            setContent: function (s) {
              return ((this._content = s), this.update(), this);
            },
            getElement: function () {
              return this._container;
            },
            update: function () {
              this._map &&
                ((this._container.style.visibility = "hidden"),
                this._updateContent(),
                this._updateLayout(),
                this._updatePosition(),
                (this._container.style.visibility = ""),
                this._adjustPan());
            },
            getEvents: function () {
              var s = {
                zoom: this._updatePosition,
                viewreset: this._updatePosition,
              };
              return (
                this._zoomAnimated && (s.zoomanim = this._animateZoom),
                s
              );
            },
            isOpen: function () {
              return !!this._map && this._map.hasLayer(this);
            },
            bringToFront: function () {
              return (this._map && Ct(this._container), this);
            },
            bringToBack: function () {
              return (this._map && xs(this._container), this);
            },
            _prepareOpen: function (s) {
              var i = this._source;
              if (!i._map) return !1;
              if (i instanceof Ps) {
                i = null;
                var r = this._source._layers;
                for (var d in r)
                  if (r[d]._map) {
                    i = r[d];
                    break;
                  }
                if (!i) return !1;
                this._source = i;
              }
              if (!s)
                if (i.getCenter) s = i.getCenter();
                else if (i.getLatLng) s = i.getLatLng();
                else if (i.getBounds) s = i.getBounds().getCenter();
                else throw new Error("Unable to get source layer LatLng.");
              return (this.setLatLng(s), this._map && this.update(), !0);
            },
            _updateContent: function () {
              if (this._content) {
                var s = this._contentNode,
                  i =
                    typeof this._content == "function"
                      ? this._content(this._source || this)
                      : this._content;
                if (typeof i == "string") s.innerHTML = i;
                else {
                  for (; s.hasChildNodes(); ) s.removeChild(s.firstChild);
                  s.appendChild(i);
                }
                this.fire("contentupdate");
              }
            },
            _updatePosition: function () {
              if (this._map) {
                var s = this._map.latLngToLayerPoint(this._latlng),
                  i = z(this.options.offset),
                  r = this._getAnchor();
                this._zoomAnimated
                  ? At(this._container, s.add(r))
                  : (i = i.add(s).add(r));
                var d = (this._containerBottom = -i.y),
                  h = (this._containerLeft =
                    -Math.round(this._containerWidth / 2) + i.x);
                ((this._container.style.bottom = d + "px"),
                  (this._container.style.left = h + "px"));
              }
            },
            _getAnchor: function () {
              return [0, 0];
            },
          });
          (et.include({
            _initOverlay: function (s, i, r, d) {
              var h = i;
              return (
                h instanceof s || (h = new s(d).setContent(i)),
                r && h.setLatLng(r),
                h
              );
            },
          }),
            gs.include({
              _initOverlay: function (s, i, r, d) {
                var h = r;
                return (
                  h instanceof s
                    ? (Y(h, d), (h._source = this))
                    : ((h = i && !d ? i : new s(d, this)), h.setContent(r)),
                  h
                );
              },
            }));
          var Xi = Ta.extend({
              options: {
                pane: "popupPane",
                offset: [0, 7],
                maxWidth: 300,
                minWidth: 50,
                maxHeight: null,
                autoPan: !0,
                autoPanPaddingTopLeft: null,
                autoPanPaddingBottomRight: null,
                autoPanPadding: [5, 5],
                keepInView: !1,
                closeButton: !0,
                autoClose: !0,
                closeOnEscapeKey: !0,
                className: "",
              },
              openOn: function (s) {
                return (
                  (s = arguments.length ? s : this._source._map),
                  !s.hasLayer(this) &&
                    s._popup &&
                    s._popup.options.autoClose &&
                    s.removeLayer(s._popup),
                  (s._popup = this),
                  Ta.prototype.openOn.call(this, s)
                );
              },
              onAdd: function (s) {
                (Ta.prototype.onAdd.call(this, s),
                  s.fire("popupopen", { popup: this }),
                  this._source &&
                    (this._source.fire("popupopen", { popup: this }, !0),
                    this._source instanceof Es ||
                      this._source.on("preclick", Ia)));
              },
              onRemove: function (s) {
                (Ta.prototype.onRemove.call(this, s),
                  s.fire("popupclose", { popup: this }),
                  this._source &&
                    (this._source.fire("popupclose", { popup: this }, !0),
                    this._source instanceof Es ||
                      this._source.off("preclick", Ia)));
              },
              getEvents: function () {
                var s = Ta.prototype.getEvents.call(this);
                return (
                  (this.options.closeOnClick !== void 0
                    ? this.options.closeOnClick
                    : this._map.options.closePopupOnClick) &&
                    (s.preclick = this.close),
                  this.options.keepInView && (s.moveend = this._adjustPan),
                  s
                );
              },
              _initLayout: function () {
                var s = "leaflet-popup",
                  i = (this._container = Be(
                    "div",
                    s +
                      " " +
                      (this.options.className || "") +
                      " leaflet-zoom-animated",
                  )),
                  r = (this._wrapper = Be("div", s + "-content-wrapper", i));
                if (
                  ((this._contentNode = Be("div", s + "-content", r)),
                  As(i),
                  ss(this._contentNode),
                  Ge(i, "contextmenu", Ia),
                  (this._tipContainer = Be("div", s + "-tip-container", i)),
                  (this._tip = Be("div", s + "-tip", this._tipContainer)),
                  this.options.closeButton)
                ) {
                  var d = (this._closeButton = Be("a", s + "-close-button", i));
                  (d.setAttribute("role", "button"),
                    d.setAttribute("aria-label", "Close popup"),
                    (d.href = "#close"),
                    (d.innerHTML = '<span aria-hidden="true">&#215;</span>'),
                    Ge(
                      d,
                      "click",
                      function (h) {
                        (Vt(h), this.close());
                      },
                      this,
                    ));
                }
              },
              _updateLayout: function () {
                var s = this._contentNode,
                  i = s.style;
                ((i.width = ""), (i.whiteSpace = "nowrap"));
                var r = s.offsetWidth;
                ((r = Math.min(r, this.options.maxWidth)),
                  (r = Math.max(r, this.options.minWidth)),
                  (i.width = r + 1 + "px"),
                  (i.whiteSpace = ""),
                  (i.height = ""));
                var d = s.offsetHeight,
                  h = this.options.maxHeight,
                  p = "leaflet-popup-scrolled";
                (h && d > h ? ((i.height = h + "px"), Je(s, p)) : Kt(s, p),
                  (this._containerWidth = this._container.offsetWidth));
              },
              _animateZoom: function (s) {
                var i = this._map._latLngToNewLayerPoint(
                    this._latlng,
                    s.zoom,
                    s.center,
                  ),
                  r = this._getAnchor();
                At(this._container, i.add(r));
              },
              _adjustPan: function () {
                if (this.options.autoPan) {
                  if (
                    (this._map._panAnim && this._map._panAnim.stop(),
                    this._autopanning)
                  ) {
                    this._autopanning = !1;
                    return;
                  }
                  var s = this._map,
                    i = parseInt(za(this._container, "marginBottom"), 10) || 0,
                    r = this._container.offsetHeight + i,
                    d = this._containerWidth,
                    h = new O(this._containerLeft, -r - this._containerBottom);
                  h._add(Cs(this._container));
                  var p = s.layerPointToContainerPoint(h),
                    j = z(this.options.autoPanPadding),
                    M = z(this.options.autoPanPaddingTopLeft || j),
                    H = z(this.options.autoPanPaddingBottomRight || j),
                    se = s.getSize(),
                    ye = 0,
                    De = 0;
                  (p.x + d + H.x > se.x && (ye = p.x + d - se.x + H.x),
                    p.x - ye - M.x < 0 && (ye = p.x - M.x),
                    p.y + r + H.y > se.y && (De = p.y + r - se.y + H.y),
                    p.y - De - M.y < 0 && (De = p.y - M.y),
                    (ye || De) &&
                      (this.options.keepInView && (this._autopanning = !0),
                      s.fire("autopanstart").panBy([ye, De])));
                }
              },
              _getAnchor: function () {
                return z(
                  this._source && this._source._getPopupAnchor
                    ? this._source._getPopupAnchor()
                    : [0, 0],
                );
              },
            }),
            ho = function (s, i) {
              return new Xi(s, i);
            };
          (et.mergeOptions({ closePopupOnClick: !0 }),
            et.include({
              openPopup: function (s, i, r) {
                return (this._initOverlay(Xi, s, i, r).openOn(this), this);
              },
              closePopup: function (s) {
                return (
                  (s = arguments.length ? s : this._popup),
                  s && s.close(),
                  this
                );
              },
            }),
            gs.include({
              bindPopup: function (s, i) {
                return (
                  (this._popup = this._initOverlay(Xi, this._popup, s, i)),
                  this._popupHandlersAdded ||
                    (this.on({
                      click: this._openPopup,
                      keypress: this._onKeyPress,
                      remove: this.closePopup,
                      move: this._movePopup,
                    }),
                    (this._popupHandlersAdded = !0)),
                  this
                );
              },
              unbindPopup: function () {
                return (
                  this._popup &&
                    (this.off({
                      click: this._openPopup,
                      keypress: this._onKeyPress,
                      remove: this.closePopup,
                      move: this._movePopup,
                    }),
                    (this._popupHandlersAdded = !1),
                    (this._popup = null)),
                  this
                );
              },
              openPopup: function (s) {
                return (
                  this._popup &&
                    (this instanceof Ps || (this._popup._source = this),
                    this._popup._prepareOpen(s || this._latlng) &&
                      this._popup.openOn(this._map)),
                  this
                );
              },
              closePopup: function () {
                return (this._popup && this._popup.close(), this);
              },
              togglePopup: function () {
                return (this._popup && this._popup.toggle(this), this);
              },
              isPopupOpen: function () {
                return this._popup ? this._popup.isOpen() : !1;
              },
              setPopupContent: function (s) {
                return (this._popup && this._popup.setContent(s), this);
              },
              getPopup: function () {
                return this._popup;
              },
              _openPopup: function (s) {
                if (!(!this._popup || !this._map)) {
                  Ja(s);
                  var i = s.layer || s.target;
                  if (this._popup._source === i && !(i instanceof Es)) {
                    this._map.hasLayer(this._popup)
                      ? this.closePopup()
                      : this.openPopup(s.latlng);
                    return;
                  }
                  ((this._popup._source = i), this.openPopup(s.latlng));
                }
              },
              _movePopup: function (s) {
                this._popup.setLatLng(s.latlng);
              },
              _onKeyPress: function (s) {
                s.originalEvent.keyCode === 13 && this._openPopup(s);
              },
            }));
          var $i = Ta.extend({
              options: {
                pane: "tooltipPane",
                offset: [0, 0],
                direction: "auto",
                permanent: !1,
                sticky: !1,
                opacity: 0.9,
              },
              onAdd: function (s) {
                (Ta.prototype.onAdd.call(this, s),
                  this.setOpacity(this.options.opacity),
                  s.fire("tooltipopen", { tooltip: this }),
                  this._source &&
                    (this.addEventParent(this._source),
                    this._source.fire("tooltipopen", { tooltip: this }, !0)));
              },
              onRemove: function (s) {
                (Ta.prototype.onRemove.call(this, s),
                  s.fire("tooltipclose", { tooltip: this }),
                  this._source &&
                    (this.removeEventParent(this._source),
                    this._source.fire("tooltipclose", { tooltip: this }, !0)));
              },
              getEvents: function () {
                var s = Ta.prototype.getEvents.call(this);
                return (this.options.permanent || (s.preclick = this.close), s);
              },
              _initLayout: function () {
                var s = "leaflet-tooltip",
                  i =
                    s +
                    " " +
                    (this.options.className || "") +
                    " leaflet-zoom-" +
                    (this._zoomAnimated ? "animated" : "hide");
                ((this._contentNode = this._container = Be("div", i)),
                  this._container.setAttribute("role", "tooltip"),
                  this._container.setAttribute(
                    "id",
                    "leaflet-tooltip-" + B(this),
                  ));
              },
              _updateLayout: function () {},
              _adjustPan: function () {},
              _setPosition: function (s) {
                var i,
                  r,
                  d = this._map,
                  h = this._container,
                  p = d.latLngToContainerPoint(d.getCenter()),
                  j = d.layerPointToContainerPoint(s),
                  M = this.options.direction,
                  H = h.offsetWidth,
                  se = h.offsetHeight,
                  ye = z(this.options.offset),
                  De = this._getAnchor();
                (M === "top"
                  ? ((i = H / 2), (r = se))
                  : M === "bottom"
                    ? ((i = H / 2), (r = 0))
                    : M === "center"
                      ? ((i = H / 2), (r = se / 2))
                      : M === "right"
                        ? ((i = 0), (r = se / 2))
                        : M === "left"
                          ? ((i = H), (r = se / 2))
                          : j.x < p.x
                            ? ((M = "right"), (i = 0), (r = se / 2))
                            : ((M = "left"),
                              (i = H + (ye.x + De.x) * 2),
                              (r = se / 2)),
                  (s = s
                    .subtract(z(i, r, !0))
                    .add(ye)
                    .add(De)),
                  Kt(h, "leaflet-tooltip-right"),
                  Kt(h, "leaflet-tooltip-left"),
                  Kt(h, "leaflet-tooltip-top"),
                  Kt(h, "leaflet-tooltip-bottom"),
                  Je(h, "leaflet-tooltip-" + M),
                  At(h, s));
              },
              _updatePosition: function () {
                var s = this._map.latLngToLayerPoint(this._latlng);
                this._setPosition(s);
              },
              setOpacity: function (s) {
                ((this.options.opacity = s),
                  this._container && Dt(this._container, s));
              },
              _animateZoom: function (s) {
                var i = this._map._latLngToNewLayerPoint(
                  this._latlng,
                  s.zoom,
                  s.center,
                );
                this._setPosition(i);
              },
              _getAnchor: function () {
                return z(
                  this._source &&
                    this._source._getTooltipAnchor &&
                    !this.options.sticky
                    ? this._source._getTooltipAnchor()
                    : [0, 0],
                );
              },
            }),
            _c = function (s, i) {
              return new $i(s, i);
            };
          (et.include({
            openTooltip: function (s, i, r) {
              return (this._initOverlay($i, s, i, r).openOn(this), this);
            },
            closeTooltip: function (s) {
              return (s.close(), this);
            },
          }),
            gs.include({
              bindTooltip: function (s, i) {
                return (
                  this._tooltip && this.isTooltipOpen() && this.unbindTooltip(),
                  (this._tooltip = this._initOverlay($i, this._tooltip, s, i)),
                  this._initTooltipInteractions(),
                  this._tooltip.options.permanent &&
                    this._map &&
                    this._map.hasLayer(this) &&
                    this.openTooltip(),
                  this
                );
              },
              unbindTooltip: function () {
                return (
                  this._tooltip &&
                    (this._initTooltipInteractions(!0),
                    this.closeTooltip(),
                    (this._tooltip = null)),
                  this
                );
              },
              _initTooltipInteractions: function (s) {
                if (!(!s && this._tooltipHandlersAdded)) {
                  var i = s ? "off" : "on",
                    r = { remove: this.closeTooltip, move: this._moveTooltip };
                  (this._tooltip.options.permanent
                    ? (r.add = this._openTooltip)
                    : ((r.mouseover = this._openTooltip),
                      (r.mouseout = this.closeTooltip),
                      (r.click = this._openTooltip),
                      this._map
                        ? this._addFocusListeners()
                        : (r.add = this._addFocusListeners)),
                    this._tooltip.options.sticky &&
                      (r.mousemove = this._moveTooltip),
                    this[i](r),
                    (this._tooltipHandlersAdded = !s));
                }
              },
              openTooltip: function (s) {
                return (
                  this._tooltip &&
                    (this instanceof Ps || (this._tooltip._source = this),
                    this._tooltip._prepareOpen(s) &&
                      (this._tooltip.openOn(this._map),
                      this.getElement
                        ? this._setAriaDescribedByOnLayer(this)
                        : this.eachLayer &&
                          this.eachLayer(
                            this._setAriaDescribedByOnLayer,
                            this,
                          ))),
                  this
                );
              },
              closeTooltip: function () {
                if (this._tooltip) return this._tooltip.close();
              },
              toggleTooltip: function () {
                return (this._tooltip && this._tooltip.toggle(this), this);
              },
              isTooltipOpen: function () {
                return this._tooltip.isOpen();
              },
              setTooltipContent: function (s) {
                return (this._tooltip && this._tooltip.setContent(s), this);
              },
              getTooltip: function () {
                return this._tooltip;
              },
              _addFocusListeners: function () {
                this.getElement
                  ? this._addFocusListenersOnLayer(this)
                  : this.eachLayer &&
                    this.eachLayer(this._addFocusListenersOnLayer, this);
              },
              _addFocusListenersOnLayer: function (s) {
                var i = typeof s.getElement == "function" && s.getElement();
                i &&
                  (Ge(
                    i,
                    "focus",
                    function () {
                      ((this._tooltip._source = s), this.openTooltip());
                    },
                    this,
                  ),
                  Ge(i, "blur", this.closeTooltip, this));
              },
              _setAriaDescribedByOnLayer: function (s) {
                var i = typeof s.getElement == "function" && s.getElement();
                i &&
                  i.setAttribute(
                    "aria-describedby",
                    this._tooltip._container.id,
                  );
              },
              _openTooltip: function (s) {
                if (!(!this._tooltip || !this._map)) {
                  if (
                    this._map.dragging &&
                    this._map.dragging.moving() &&
                    !this._openOnceFlag
                  ) {
                    this._openOnceFlag = !0;
                    var i = this;
                    this._map.once("moveend", function () {
                      ((i._openOnceFlag = !1), i._openTooltip(s));
                    });
                    return;
                  }
                  ((this._tooltip._source = s.layer || s.target),
                    this.openTooltip(
                      this._tooltip.options.sticky ? s.latlng : void 0,
                    ));
                }
              },
              _moveTooltip: function (s) {
                var i = s.latlng,
                  r,
                  d;
                (this._tooltip.options.sticky &&
                  s.originalEvent &&
                  ((r = this._map.mouseEventToContainerPoint(s.originalEvent)),
                  (d = this._map.containerPointToLayerPoint(r)),
                  (i = this._map.layerPointToLatLng(d))),
                  this._tooltip.setLatLng(i));
              },
            }));
          var mo = Ls.extend({
            options: {
              iconSize: [12, 12],
              html: !1,
              bgPos: null,
              className: "leaflet-div-icon",
            },
            createIcon: function (s) {
              var i =
                  s && s.tagName === "DIV" ? s : document.createElement("div"),
                r = this.options;
              if (
                (r.html instanceof Element
                  ? (yt(i), i.appendChild(r.html))
                  : (i.innerHTML = r.html !== !1 ? r.html : ""),
                r.bgPos)
              ) {
                var d = z(r.bgPos);
                i.style.backgroundPosition = -d.x + "px " + -d.y + "px";
              }
              return (this._setIconStyles(i, "icon"), i);
            },
            createShadow: function () {
              return null;
            },
          });
          function wc(s) {
            return new mo(s);
          }
          Ls.Default = Gi;
          var di = gs.extend({
            options: {
              tileSize: 256,
              opacity: 1,
              updateWhenIdle: v.mobile,
              updateWhenZooming: !0,
              updateInterval: 200,
              zIndex: 1,
              bounds: null,
              minZoom: 0,
              maxZoom: void 0,
              maxNativeZoom: void 0,
              minNativeZoom: void 0,
              noWrap: !1,
              pane: "tilePane",
              className: "",
              keepBuffer: 2,
            },
            initialize: function (s) {
              Y(this, s);
            },
            onAdd: function () {
              (this._initContainer(),
                (this._levels = {}),
                (this._tiles = {}),
                this._resetView());
            },
            beforeAdd: function (s) {
              s._addZoomLimit(this);
            },
            onRemove: function (s) {
              (this._removeAllTiles(),
                ot(this._container),
                s._removeZoomLimit(this),
                (this._container = null),
                (this._tileZoom = void 0));
            },
            bringToFront: function () {
              return (
                this._map &&
                  (Ct(this._container), this._setAutoZIndex(Math.max)),
                this
              );
            },
            bringToBack: function () {
              return (
                this._map &&
                  (xs(this._container), this._setAutoZIndex(Math.min)),
                this
              );
            },
            getContainer: function () {
              return this._container;
            },
            setOpacity: function (s) {
              return ((this.options.opacity = s), this._updateOpacity(), this);
            },
            setZIndex: function (s) {
              return ((this.options.zIndex = s), this._updateZIndex(), this);
            },
            isLoading: function () {
              return this._loading;
            },
            redraw: function () {
              if (this._map) {
                this._removeAllTiles();
                var s = this._clampZoom(this._map.getZoom());
                (s !== this._tileZoom &&
                  ((this._tileZoom = s), this._updateLevels()),
                  this._update());
              }
              return this;
            },
            getEvents: function () {
              var s = {
                viewprereset: this._invalidateAll,
                viewreset: this._resetView,
                zoom: this._resetView,
                moveend: this._onMoveEnd,
              };
              return (
                this.options.updateWhenIdle ||
                  (this._onMove ||
                    (this._onMove = T(
                      this._onMoveEnd,
                      this.options.updateInterval,
                      this,
                    )),
                  (s.move = this._onMove)),
                this._zoomAnimated && (s.zoomanim = this._animateZoom),
                s
              );
            },
            createTile: function () {
              return document.createElement("div");
            },
            getTileSize: function () {
              var s = this.options.tileSize;
              return s instanceof O ? s : new O(s, s);
            },
            _updateZIndex: function () {
              this._container &&
                this.options.zIndex !== void 0 &&
                this.options.zIndex !== null &&
                (this._container.style.zIndex = this.options.zIndex);
            },
            _setAutoZIndex: function (s) {
              for (
                var i = this.getPane().children,
                  r = -s(-1 / 0, 1 / 0),
                  d = 0,
                  h = i.length,
                  p;
                d < h;
                d++
              )
                ((p = i[d].style.zIndex),
                  i[d] !== this._container && p && (r = s(r, +p)));
              isFinite(r) &&
                ((this.options.zIndex = r + s(-1, 1)), this._updateZIndex());
            },
            _updateOpacity: function () {
              if (this._map && !v.ielt9) {
                Dt(this._container, this.options.opacity);
                var s = +new Date(),
                  i = !1,
                  r = !1;
                for (var d in this._tiles) {
                  var h = this._tiles[d];
                  if (!(!h.current || !h.loaded)) {
                    var p = Math.min(1, (s - h.loaded) / 200);
                    (Dt(h.el, p),
                      p < 1
                        ? (i = !0)
                        : (h.active ? (r = !0) : this._onOpaqueTile(h),
                          (h.active = !0)));
                  }
                }
                (r && !this._noPrune && this._pruneTiles(),
                  i &&
                    (Oe(this._fadeFrame),
                    (this._fadeFrame = me(this._updateOpacity, this))));
              }
            },
            _onOpaqueTile: G,
            _initContainer: function () {
              this._container ||
                ((this._container = Be(
                  "div",
                  "leaflet-layer " + (this.options.className || ""),
                )),
                this._updateZIndex(),
                this.options.opacity < 1 && this._updateOpacity(),
                this.getPane().appendChild(this._container));
            },
            _updateLevels: function () {
              var s = this._tileZoom,
                i = this.options.maxZoom;
              if (s !== void 0) {
                for (var r in this._levels)
                  ((r = Number(r)),
                    this._levels[r].el.children.length || r === s
                      ? ((this._levels[r].el.style.zIndex =
                          i - Math.abs(s - r)),
                        this._onUpdateLevel(r))
                      : (ot(this._levels[r].el),
                        this._removeTilesAtZoom(r),
                        this._onRemoveLevel(r),
                        delete this._levels[r]));
                var d = this._levels[s],
                  h = this._map;
                return (
                  d ||
                    ((d = this._levels[s] = {}),
                    (d.el = Be(
                      "div",
                      "leaflet-tile-container leaflet-zoom-animated",
                      this._container,
                    )),
                    (d.el.style.zIndex = i),
                    (d.origin = h
                      .project(h.unproject(h.getPixelOrigin()), s)
                      .round()),
                    (d.zoom = s),
                    this._setZoomTransform(d, h.getCenter(), h.getZoom()),
                    G(d.el.offsetWidth),
                    this._onCreateLevel(d)),
                  (this._level = d),
                  d
                );
              }
            },
            _onUpdateLevel: G,
            _onRemoveLevel: G,
            _onCreateLevel: G,
            _pruneTiles: function () {
              if (this._map) {
                var s,
                  i,
                  r = this._map.getZoom();
                if (r > this.options.maxZoom || r < this.options.minZoom) {
                  this._removeAllTiles();
                  return;
                }
                for (s in this._tiles)
                  ((i = this._tiles[s]), (i.retain = i.current));
                for (s in this._tiles)
                  if (((i = this._tiles[s]), i.current && !i.active)) {
                    var d = i.coords;
                    this._retainParent(d.x, d.y, d.z, d.z - 5) ||
                      this._retainChildren(d.x, d.y, d.z, d.z + 2);
                  }
                for (s in this._tiles)
                  this._tiles[s].retain || this._removeTile(s);
              }
            },
            _removeTilesAtZoom: function (s) {
              for (var i in this._tiles)
                this._tiles[i].coords.z === s && this._removeTile(i);
            },
            _removeAllTiles: function () {
              for (var s in this._tiles) this._removeTile(s);
            },
            _invalidateAll: function () {
              for (var s in this._levels)
                (ot(this._levels[s].el),
                  this._onRemoveLevel(Number(s)),
                  delete this._levels[s]);
              (this._removeAllTiles(), (this._tileZoom = void 0));
            },
            _retainParent: function (s, i, r, d) {
              var h = Math.floor(s / 2),
                p = Math.floor(i / 2),
                j = r - 1,
                M = new O(+h, +p);
              M.z = +j;
              var H = this._tileCoordsToKey(M),
                se = this._tiles[H];
              return se && se.active
                ? ((se.retain = !0), !0)
                : (se && se.loaded && (se.retain = !0),
                  j > d ? this._retainParent(h, p, j, d) : !1);
            },
            _retainChildren: function (s, i, r, d) {
              for (var h = 2 * s; h < 2 * s + 2; h++)
                for (var p = 2 * i; p < 2 * i + 2; p++) {
                  var j = new O(h, p);
                  j.z = r + 1;
                  var M = this._tileCoordsToKey(j),
                    H = this._tiles[M];
                  if (H && H.active) {
                    H.retain = !0;
                    continue;
                  } else H && H.loaded && (H.retain = !0);
                  r + 1 < d && this._retainChildren(h, p, r + 1, d);
                }
            },
            _resetView: function (s) {
              var i = s && (s.pinch || s.flyTo);
              this._setView(this._map.getCenter(), this._map.getZoom(), i, i);
            },
            _animateZoom: function (s) {
              this._setView(s.center, s.zoom, !0, s.noUpdate);
            },
            _clampZoom: function (s) {
              var i = this.options;
              return i.minNativeZoom !== void 0 && s < i.minNativeZoom
                ? i.minNativeZoom
                : i.maxNativeZoom !== void 0 && i.maxNativeZoom < s
                  ? i.maxNativeZoom
                  : s;
            },
            _setView: function (s, i, r, d) {
              var h = Math.round(i);
              (this.options.maxZoom !== void 0 && h > this.options.maxZoom) ||
              (this.options.minZoom !== void 0 && h < this.options.minZoom)
                ? (h = void 0)
                : (h = this._clampZoom(h));
              var p = this.options.updateWhenZooming && h !== this._tileZoom;
              ((!d || p) &&
                ((this._tileZoom = h),
                this._abortLoading && this._abortLoading(),
                this._updateLevels(),
                this._resetGrid(),
                h !== void 0 && this._update(s),
                r || this._pruneTiles(),
                (this._noPrune = !!r)),
                this._setZoomTransforms(s, i));
            },
            _setZoomTransforms: function (s, i) {
              for (var r in this._levels)
                this._setZoomTransform(this._levels[r], s, i);
            },
            _setZoomTransform: function (s, i, r) {
              var d = this._map.getZoomScale(r, s.zoom),
                h = s.origin
                  .multiplyBy(d)
                  .subtract(this._map._getNewPixelOrigin(i, r))
                  .round();
              v.any3d ? $a(s.el, h, d) : At(s.el, h);
            },
            _resetGrid: function () {
              var s = this._map,
                i = s.options.crs,
                r = (this._tileSize = this.getTileSize()),
                d = this._tileZoom,
                h = this._map.getPixelWorldBounds(this._tileZoom);
              (h && (this._globalTileRange = this._pxBoundsToTileRange(h)),
                (this._wrapX = i.wrapLng &&
                  !this.options.noWrap && [
                    Math.floor(s.project([0, i.wrapLng[0]], d).x / r.x),
                    Math.ceil(s.project([0, i.wrapLng[1]], d).x / r.y),
                  ]),
                (this._wrapY = i.wrapLat &&
                  !this.options.noWrap && [
                    Math.floor(s.project([i.wrapLat[0], 0], d).y / r.x),
                    Math.ceil(s.project([i.wrapLat[1], 0], d).y / r.y),
                  ]));
            },
            _onMoveEnd: function () {
              !this._map || this._map._animatingZoom || this._update();
            },
            _getTiledPixelBounds: function (s) {
              var i = this._map,
                r = i._animatingZoom
                  ? Math.max(i._animateToZoom, i.getZoom())
                  : i.getZoom(),
                d = i.getZoomScale(r, this._tileZoom),
                h = i.project(s, this._tileZoom).floor(),
                p = i.getSize().divideBy(d * 2);
              return new g(h.subtract(p), h.add(p));
            },
            _update: function (s) {
              var i = this._map;
              if (i) {
                var r = this._clampZoom(i.getZoom());
                if (
                  (s === void 0 && (s = i.getCenter()),
                  this._tileZoom !== void 0)
                ) {
                  var d = this._getTiledPixelBounds(s),
                    h = this._pxBoundsToTileRange(d),
                    p = h.getCenter(),
                    j = [],
                    M = this.options.keepBuffer,
                    H = new g(
                      h.getBottomLeft().subtract([M, -M]),
                      h.getTopRight().add([M, -M]),
                    );
                  if (
                    !(
                      isFinite(h.min.x) &&
                      isFinite(h.min.y) &&
                      isFinite(h.max.x) &&
                      isFinite(h.max.y)
                    )
                  )
                    throw new Error(
                      "Attempted to load an infinite number of tiles",
                    );
                  for (var se in this._tiles) {
                    var ye = this._tiles[se].coords;
                    (ye.z !== this._tileZoom ||
                      !H.contains(new O(ye.x, ye.y))) &&
                      (this._tiles[se].current = !1);
                  }
                  if (Math.abs(r - this._tileZoom) > 1) {
                    this._setView(s, r);
                    return;
                  }
                  for (var De = h.min.y; De <= h.max.y; De++)
                    for (var it = h.min.x; it <= h.max.x; it++) {
                      var va = new O(it, De);
                      if (((va.z = this._tileZoom), !!this._isValidTile(va))) {
                        var sa = this._tiles[this._tileCoordsToKey(va)];
                        sa ? (sa.current = !0) : j.push(va);
                      }
                    }
                  if (
                    (j.sort(function (jt, Nt) {
                      return jt.distanceTo(p) - Nt.distanceTo(p);
                    }),
                    j.length !== 0)
                  ) {
                    this._loading ||
                      ((this._loading = !0), this.fire("loading"));
                    var Wa = document.createDocumentFragment();
                    for (it = 0; it < j.length; it++) this._addTile(j[it], Wa);
                    this._level.el.appendChild(Wa);
                  }
                }
              }
            },
            _isValidTile: function (s) {
              var i = this._map.options.crs;
              if (!i.infinite) {
                var r = this._globalTileRange;
                if (
                  (!i.wrapLng && (s.x < r.min.x || s.x > r.max.x)) ||
                  (!i.wrapLat && (s.y < r.min.y || s.y > r.max.y))
                )
                  return !1;
              }
              if (!this.options.bounds) return !0;
              var d = this._tileCoordsToBounds(s);
              return X(this.options.bounds).overlaps(d);
            },
            _keyToBounds: function (s) {
              return this._tileCoordsToBounds(this._keyToTileCoords(s));
            },
            _tileCoordsToNwSe: function (s) {
              var i = this._map,
                r = this.getTileSize(),
                d = s.scaleBy(r),
                h = d.add(r),
                p = i.unproject(d, s.z),
                j = i.unproject(h, s.z);
              return [p, j];
            },
            _tileCoordsToBounds: function (s) {
              var i = this._tileCoordsToNwSe(s),
                r = new I(i[0], i[1]);
              return (
                this.options.noWrap || (r = this._map.wrapLatLngBounds(r)),
                r
              );
            },
            _tileCoordsToKey: function (s) {
              return s.x + ":" + s.y + ":" + s.z;
            },
            _keyToTileCoords: function (s) {
              var i = s.split(":"),
                r = new O(+i[0], +i[1]);
              return ((r.z = +i[2]), r);
            },
            _removeTile: function (s) {
              var i = this._tiles[s];
              i &&
                (ot(i.el),
                delete this._tiles[s],
                this.fire("tileunload", {
                  tile: i.el,
                  coords: this._keyToTileCoords(s),
                }));
            },
            _initTile: function (s) {
              Je(s, "leaflet-tile");
              var i = this.getTileSize();
              ((s.style.width = i.x + "px"),
                (s.style.height = i.y + "px"),
                (s.onselectstart = G),
                (s.onmousemove = G),
                v.ielt9 &&
                  this.options.opacity < 1 &&
                  Dt(s, this.options.opacity));
            },
            _addTile: function (s, i) {
              var r = this._getTilePos(s),
                d = this._tileCoordsToKey(s),
                h = this.createTile(
                  this._wrapCoords(s),
                  re(this._tileReady, this, s),
                );
              (this._initTile(h),
                this.createTile.length < 2 &&
                  me(re(this._tileReady, this, s, null, h)),
                At(h, r),
                (this._tiles[d] = { el: h, coords: s, current: !0 }),
                i.appendChild(h),
                this.fire("tileloadstart", { tile: h, coords: s }));
            },
            _tileReady: function (s, i, r) {
              i && this.fire("tileerror", { error: i, tile: r, coords: s });
              var d = this._tileCoordsToKey(s);
              ((r = this._tiles[d]),
                r &&
                  ((r.loaded = +new Date()),
                  this._map._fadeAnimated
                    ? (Dt(r.el, 0),
                      Oe(this._fadeFrame),
                      (this._fadeFrame = me(this._updateOpacity, this)))
                    : ((r.active = !0), this._pruneTiles()),
                  i ||
                    (Je(r.el, "leaflet-tile-loaded"),
                    this.fire("tileload", { tile: r.el, coords: s })),
                  this._noTilesToLoad() &&
                    ((this._loading = !1),
                    this.fire("load"),
                    v.ielt9 || !this._map._fadeAnimated
                      ? me(this._pruneTiles, this)
                      : setTimeout(re(this._pruneTiles, this), 250))));
            },
            _getTilePos: function (s) {
              return s.scaleBy(this.getTileSize()).subtract(this._level.origin);
            },
            _wrapCoords: function (s) {
              var i = new O(
                this._wrapX ? fe(s.x, this._wrapX) : s.x,
                this._wrapY ? fe(s.y, this._wrapY) : s.y,
              );
              return ((i.z = s.z), i);
            },
            _pxBoundsToTileRange: function (s) {
              var i = this.getTileSize();
              return new g(
                s.min.unscaleBy(i).floor(),
                s.max.unscaleBy(i).ceil().subtract([1, 1]),
              );
            },
            _noTilesToLoad: function () {
              for (var s in this._tiles) if (!this._tiles[s].loaded) return !1;
              return !0;
            },
          });
          function po(s) {
            return new di(s);
          }
          var pn = di.extend({
            options: {
              minZoom: 0,
              maxZoom: 18,
              subdomains: "abc",
              errorTileUrl: "",
              zoomOffset: 0,
              tms: !1,
              zoomReverse: !1,
              detectRetina: !1,
              crossOrigin: !1,
              referrerPolicy: !1,
            },
            initialize: function (s, i) {
              ((this._url = s),
                (i = Y(this, i)),
                i.detectRetina && v.retina && i.maxZoom > 0
                  ? ((i.tileSize = Math.floor(i.tileSize / 2)),
                    i.zoomReverse
                      ? (i.zoomOffset--,
                        (i.minZoom = Math.min(i.maxZoom, i.minZoom + 1)))
                      : (i.zoomOffset++,
                        (i.maxZoom = Math.max(i.minZoom, i.maxZoom - 1))),
                    (i.minZoom = Math.max(0, i.minZoom)))
                  : i.zoomReverse
                    ? (i.minZoom = Math.min(i.maxZoom, i.minZoom))
                    : (i.maxZoom = Math.max(i.minZoom, i.maxZoom)),
                typeof i.subdomains == "string" &&
                  (i.subdomains = i.subdomains.split("")),
                this.on("tileunload", this._onTileRemove));
            },
            setUrl: function (s, i) {
              return (
                this._url === s && i === void 0 && (i = !0),
                (this._url = s),
                i || this.redraw(),
                this
              );
            },
            createTile: function (s, i) {
              var r = document.createElement("img");
              return (
                Ge(r, "load", re(this._tileOnLoad, this, i, r)),
                Ge(r, "error", re(this._tileOnError, this, i, r)),
                (this.options.crossOrigin || this.options.crossOrigin === "") &&
                  (r.crossOrigin =
                    this.options.crossOrigin === !0
                      ? ""
                      : this.options.crossOrigin),
                typeof this.options.referrerPolicy == "string" &&
                  (r.referrerPolicy = this.options.referrerPolicy),
                (r.alt = ""),
                (r.src = this.getTileUrl(s)),
                r
              );
            },
            getTileUrl: function (s) {
              var i = {
                r: v.retina ? "@2x" : "",
                s: this._getSubdomain(s),
                x: s.x,
                y: s.y,
                z: this._getZoomForUrl(),
              };
              if (this._map && !this._map.options.crs.infinite) {
                var r = this._globalTileRange.max.y - s.y;
                (this.options.tms && (i.y = r), (i["-y"] = r));
              }
              return le(this._url, V(i, this.options));
            },
            _tileOnLoad: function (s, i) {
              v.ielt9 ? setTimeout(re(s, this, null, i), 0) : s(null, i);
            },
            _tileOnError: function (s, i, r) {
              var d = this.options.errorTileUrl;
              (d && i.getAttribute("src") !== d && (i.src = d), s(r, i));
            },
            _onTileRemove: function (s) {
              s.tile.onload = null;
            },
            _getZoomForUrl: function () {
              var s = this._tileZoom,
                i = this.options.maxZoom,
                r = this.options.zoomReverse,
                d = this.options.zoomOffset;
              return (r && (s = i - s), s + d);
            },
            _getSubdomain: function (s) {
              var i = Math.abs(s.x + s.y) % this.options.subdomains.length;
              return this.options.subdomains[i];
            },
            _abortLoading: function () {
              var s, i;
              for (s in this._tiles)
                if (
                  this._tiles[s].coords.z !== this._tileZoom &&
                  ((i = this._tiles[s].el),
                  (i.onload = G),
                  (i.onerror = G),
                  !i.complete)
                ) {
                  i.src = de;
                  var r = this._tiles[s].coords;
                  (ot(i),
                    delete this._tiles[s],
                    this.fire("tileabort", { tile: i, coords: r }));
                }
            },
            _removeTile: function (s) {
              var i = this._tiles[s];
              if (i)
                return (
                  i.el.setAttribute("src", de),
                  di.prototype._removeTile.call(this, s)
                );
            },
            _tileReady: function (s, i, r) {
              if (!(!this._map || (r && r.getAttribute("src") === de)))
                return di.prototype._tileReady.call(this, s, i, r);
            },
          });
          function is(s, i) {
            return new pn(s, i);
          }
          var Ji = pn.extend({
            defaultWmsParams: {
              service: "WMS",
              request: "GetMap",
              layers: "",
              styles: "",
              format: "image/jpeg",
              transparent: !1,
              version: "1.1.1",
            },
            options: { crs: null, uppercase: !1 },
            initialize: function (s, i) {
              this._url = s;
              var r = V({}, this.defaultWmsParams);
              for (var d in i) d in this.options || (r[d] = i[d]);
              i = Y(this, i);
              var h = i.detectRetina && v.retina ? 2 : 1,
                p = this.getTileSize();
              ((r.width = p.x * h), (r.height = p.y * h), (this.wmsParams = r));
            },
            onAdd: function (s) {
              ((this._crs = this.options.crs || s.options.crs),
                (this._wmsVersion = parseFloat(this.wmsParams.version)));
              var i = this._wmsVersion >= 1.3 ? "crs" : "srs";
              ((this.wmsParams[i] = this._crs.code),
                pn.prototype.onAdd.call(this, s));
            },
            getTileUrl: function (s) {
              var i = this._tileCoordsToNwSe(s),
                r = this._crs,
                d = C(r.project(i[0]), r.project(i[1])),
                h = d.min,
                p = d.max,
                j = (
                  this._wmsVersion >= 1.3 && this._crs === Xs
                    ? [h.y, h.x, p.y, p.x]
                    : [h.x, h.y, p.x, p.y]
                ).join(","),
                M = pn.prototype.getTileUrl.call(this, s);
              return (
                M +
                Ee(this.wmsParams, M, this.options.uppercase) +
                (this.options.uppercase ? "&BBOX=" : "&bbox=") +
                j
              );
            },
            setParams: function (s, i) {
              return (V(this.wmsParams, s), i || this.redraw(), this);
            },
          });
          function ls(s, i) {
            return new Ji(s, i);
          }
          ((pn.WMS = Ji), (is.wms = ls));
          var Ka = gs.extend({
              options: { padding: 0.1 },
              initialize: function (s) {
                (Y(this, s), B(this), (this._layers = this._layers || {}));
              },
              onAdd: function () {
                (this._container ||
                  (this._initContainer(),
                  Je(this._container, "leaflet-zoom-animated")),
                  this.getPane().appendChild(this._container),
                  this._update(),
                  this.on("update", this._updatePaths, this));
              },
              onRemove: function () {
                (this.off("update", this._updatePaths, this),
                  this._destroyContainer());
              },
              getEvents: function () {
                var s = {
                  viewreset: this._reset,
                  zoom: this._onZoom,
                  moveend: this._update,
                  zoomend: this._onZoomEnd,
                };
                return (
                  this._zoomAnimated && (s.zoomanim = this._onAnimZoom),
                  s
                );
              },
              _onAnimZoom: function (s) {
                this._updateTransform(s.center, s.zoom);
              },
              _onZoom: function () {
                this._updateTransform(
                  this._map.getCenter(),
                  this._map.getZoom(),
                );
              },
              _updateTransform: function (s, i) {
                var r = this._map.getZoomScale(i, this._zoom),
                  d = this._map
                    .getSize()
                    .multiplyBy(0.5 + this.options.padding),
                  h = this._map.project(this._center, i),
                  p = d
                    .multiplyBy(-r)
                    .add(h)
                    .subtract(this._map._getNewPixelOrigin(s, i));
                v.any3d ? $a(this._container, p, r) : At(this._container, p);
              },
              _reset: function () {
                (this._update(),
                  this._updateTransform(this._center, this._zoom));
                for (var s in this._layers) this._layers[s]._reset();
              },
              _onZoomEnd: function () {
                for (var s in this._layers) this._layers[s]._project();
              },
              _updatePaths: function () {
                for (var s in this._layers) this._layers[s]._update();
              },
              _update: function () {
                var s = this.options.padding,
                  i = this._map.getSize(),
                  r = this._map
                    .containerPointToLayerPoint(i.multiplyBy(-s))
                    .round();
                ((this._bounds = new g(
                  r,
                  r.add(i.multiplyBy(1 + s * 2)).round(),
                )),
                  (this._center = this._map.getCenter()),
                  (this._zoom = this._map.getZoom()));
              },
            }),
            Al = Ka.extend({
              options: { tolerance: 0 },
              getEvents: function () {
                var s = Ka.prototype.getEvents.call(this);
                return ((s.viewprereset = this._onViewPreReset), s);
              },
              _onViewPreReset: function () {
                this._postponeUpdatePaths = !0;
              },
              onAdd: function () {
                (Ka.prototype.onAdd.call(this), this._draw());
              },
              _initContainer: function () {
                var s = (this._container = document.createElement("canvas"));
                (Ge(s, "mousemove", this._onMouseMove, this),
                  Ge(
                    s,
                    "click dblclick mousedown mouseup contextmenu",
                    this._onClick,
                    this,
                  ),
                  Ge(s, "mouseout", this._handleMouseOut, this),
                  (s._leaflet_disable_events = !0),
                  (this._ctx = s.getContext("2d")));
              },
              _destroyContainer: function () {
                (Oe(this._redrawRequest),
                  delete this._ctx,
                  ot(this._container),
                  xt(this._container),
                  delete this._container);
              },
              _updatePaths: function () {
                if (!this._postponeUpdatePaths) {
                  var s;
                  this._redrawBounds = null;
                  for (var i in this._layers)
                    ((s = this._layers[i]), s._update());
                  this._redraw();
                }
              },
              _update: function () {
                if (!(this._map._animatingZoom && this._bounds)) {
                  Ka.prototype._update.call(this);
                  var s = this._bounds,
                    i = this._container,
                    r = s.getSize(),
                    d = v.retina ? 2 : 1;
                  (At(i, s.min),
                    (i.width = d * r.x),
                    (i.height = d * r.y),
                    (i.style.width = r.x + "px"),
                    (i.style.height = r.y + "px"),
                    v.retina && this._ctx.scale(2, 2),
                    this._ctx.translate(-s.min.x, -s.min.y),
                    this.fire("update"));
                }
              },
              _reset: function () {
                (Ka.prototype._reset.call(this),
                  this._postponeUpdatePaths &&
                    ((this._postponeUpdatePaths = !1), this._updatePaths()));
              },
              _initPath: function (s) {
                (this._updateDashArray(s), (this._layers[B(s)] = s));
                var i = (s._order = {
                  layer: s,
                  prev: this._drawLast,
                  next: null,
                });
                (this._drawLast && (this._drawLast.next = i),
                  (this._drawLast = i),
                  (this._drawFirst = this._drawFirst || this._drawLast));
              },
              _addPath: function (s) {
                this._requestRedraw(s);
              },
              _removePath: function (s) {
                var i = s._order,
                  r = i.next,
                  d = i.prev;
                (r ? (r.prev = d) : (this._drawLast = d),
                  d ? (d.next = r) : (this._drawFirst = r),
                  delete s._order,
                  delete this._layers[B(s)],
                  this._requestRedraw(s));
              },
              _updatePath: function (s) {
                (this._extendRedrawBounds(s),
                  s._project(),
                  s._update(),
                  this._requestRedraw(s));
              },
              _updateStyle: function (s) {
                (this._updateDashArray(s), this._requestRedraw(s));
              },
              _updateDashArray: function (s) {
                if (typeof s.options.dashArray == "string") {
                  var i = s.options.dashArray.split(/[, ]+/),
                    r = [],
                    d,
                    h;
                  for (h = 0; h < i.length; h++) {
                    if (((d = Number(i[h])), isNaN(d))) return;
                    r.push(d);
                  }
                  s.options._dashArray = r;
                } else s.options._dashArray = s.options.dashArray;
              },
              _requestRedraw: function (s) {
                this._map &&
                  (this._extendRedrawBounds(s),
                  (this._redrawRequest =
                    this._redrawRequest || me(this._redraw, this)));
              },
              _extendRedrawBounds: function (s) {
                if (s._pxBounds) {
                  var i = (s.options.weight || 0) + 1;
                  ((this._redrawBounds = this._redrawBounds || new g()),
                    this._redrawBounds.extend(s._pxBounds.min.subtract([i, i])),
                    this._redrawBounds.extend(s._pxBounds.max.add([i, i])));
                }
              },
              _redraw: function () {
                ((this._redrawRequest = null),
                  this._redrawBounds &&
                    (this._redrawBounds.min._floor(),
                    this._redrawBounds.max._ceil()),
                  this._clear(),
                  this._draw(),
                  (this._redrawBounds = null));
              },
              _clear: function () {
                var s = this._redrawBounds;
                if (s) {
                  var i = s.getSize();
                  this._ctx.clearRect(s.min.x, s.min.y, i.x, i.y);
                } else
                  (this._ctx.save(),
                    this._ctx.setTransform(1, 0, 0, 1, 0, 0),
                    this._ctx.clearRect(
                      0,
                      0,
                      this._container.width,
                      this._container.height,
                    ),
                    this._ctx.restore());
              },
              _draw: function () {
                var s,
                  i = this._redrawBounds;
                if ((this._ctx.save(), i)) {
                  var r = i.getSize();
                  (this._ctx.beginPath(),
                    this._ctx.rect(i.min.x, i.min.y, r.x, r.y),
                    this._ctx.clip());
                }
                this._drawing = !0;
                for (var d = this._drawFirst; d; d = d.next)
                  ((s = d.layer),
                    (!i || (s._pxBounds && s._pxBounds.intersects(i))) &&
                      s._updatePath());
                ((this._drawing = !1), this._ctx.restore());
              },
              _updatePoly: function (s, i) {
                if (this._drawing) {
                  var r,
                    d,
                    h,
                    p,
                    j = s._parts,
                    M = j.length,
                    H = this._ctx;
                  if (M) {
                    for (H.beginPath(), r = 0; r < M; r++) {
                      for (d = 0, h = j[r].length; d < h; d++)
                        ((p = j[r][d]), H[d ? "lineTo" : "moveTo"](p.x, p.y));
                      i && H.closePath();
                    }
                    this._fillStroke(H, s);
                  }
                }
              },
              _updateCircle: function (s) {
                if (!(!this._drawing || s._empty())) {
                  var i = s._point,
                    r = this._ctx,
                    d = Math.max(Math.round(s._radius), 1),
                    h = (Math.max(Math.round(s._radiusY), 1) || d) / d;
                  (h !== 1 && (r.save(), r.scale(1, h)),
                    r.beginPath(),
                    r.arc(i.x, i.y / h, d, 0, Math.PI * 2, !1),
                    h !== 1 && r.restore(),
                    this._fillStroke(r, s));
                }
              },
              _fillStroke: function (s, i) {
                var r = i.options;
                (r.fill &&
                  ((s.globalAlpha = r.fillOpacity),
                  (s.fillStyle = r.fillColor || r.color),
                  s.fill(r.fillRule || "evenodd")),
                  r.stroke &&
                    r.weight !== 0 &&
                    (s.setLineDash &&
                      s.setLineDash((i.options && i.options._dashArray) || []),
                    (s.globalAlpha = r.opacity),
                    (s.lineWidth = r.weight),
                    (s.strokeStyle = r.color),
                    (s.lineCap = r.lineCap),
                    (s.lineJoin = r.lineJoin),
                    s.stroke()));
              },
              _onClick: function (s) {
                for (
                  var i = this._map.mouseEventToLayerPoint(s),
                    r,
                    d,
                    h = this._drawFirst;
                  h;
                  h = h.next
                )
                  ((r = h.layer),
                    r.options.interactive &&
                      r._containsPoint(i) &&
                      (!(s.type === "click" || s.type === "preclick") ||
                        !this._map._draggableMoved(r)) &&
                      (d = r));
                this._fireEvent(d ? [d] : !1, s);
              },
              _onMouseMove: function (s) {
                if (
                  !(
                    !this._map ||
                    this._map.dragging.moving() ||
                    this._map._animatingZoom
                  )
                ) {
                  var i = this._map.mouseEventToLayerPoint(s);
                  this._handleMouseHover(s, i);
                }
              },
              _handleMouseOut: function (s) {
                var i = this._hoveredLayer;
                i &&
                  (Kt(this._container, "leaflet-interactive"),
                  this._fireEvent([i], s, "mouseout"),
                  (this._hoveredLayer = null),
                  (this._mouseHoverThrottled = !1));
              },
              _handleMouseHover: function (s, i) {
                if (!this._mouseHoverThrottled) {
                  for (var r, d, h = this._drawFirst; h; h = h.next)
                    ((r = h.layer),
                      r.options.interactive && r._containsPoint(i) && (d = r));
                  (d !== this._hoveredLayer &&
                    (this._handleMouseOut(s),
                    d &&
                      (Je(this._container, "leaflet-interactive"),
                      this._fireEvent([d], s, "mouseover"),
                      (this._hoveredLayer = d))),
                    this._fireEvent(
                      this._hoveredLayer ? [this._hoveredLayer] : !1,
                      s,
                    ),
                    (this._mouseHoverThrottled = !0),
                    setTimeout(
                      re(function () {
                        this._mouseHoverThrottled = !1;
                      }, this),
                      32,
                    ));
                }
              },
              _fireEvent: function (s, i, r) {
                this._map._fireDOMEvent(i, r || i.type, s);
              },
              _bringToFront: function (s) {
                var i = s._order;
                if (i) {
                  var r = i.next,
                    d = i.prev;
                  if (r) r.prev = d;
                  else return;
                  (d ? (d.next = r) : r && (this._drawFirst = r),
                    (i.prev = this._drawLast),
                    (this._drawLast.next = i),
                    (i.next = null),
                    (this._drawLast = i),
                    this._requestRedraw(s));
                }
              },
              _bringToBack: function (s) {
                var i = s._order;
                if (i) {
                  var r = i.next,
                    d = i.prev;
                  if (d) d.next = r;
                  else return;
                  (r ? (r.prev = d) : d && (this._drawLast = d),
                    (i.prev = null),
                    (i.next = this._drawFirst),
                    (this._drawFirst.prev = i),
                    (this._drawFirst = i),
                    this._requestRedraw(s));
                }
              },
            });
          function Qi(s) {
            return v.canvas ? new Al(s) : null;
          }
          var xn = (function () {
              try {
                return (
                  document.namespaces.add(
                    "lvml",
                    "urn:schemas-microsoft-com:vml",
                  ),
                  function (s) {
                    return document.createElement(
                      "<lvml:" + s + ' class="lvml">',
                    );
                  }
                );
              } catch {}
              return function (s) {
                return document.createElement(
                  "<" +
                    s +
                    ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">',
                );
              };
            })(),
            hr = {
              _initContainer: function () {
                this._container = Be("div", "leaflet-vml-container");
              },
              _update: function () {
                this._map._animatingZoom ||
                  (Ka.prototype._update.call(this), this.fire("update"));
              },
              _initPath: function (s) {
                var i = (s._container = xn("shape"));
                (Je(i, "leaflet-vml-shape " + (this.options.className || "")),
                  (i.coordsize = "1 1"),
                  (s._path = xn("path")),
                  i.appendChild(s._path),
                  this._updateStyle(s),
                  (this._layers[B(s)] = s));
              },
              _addPath: function (s) {
                var i = s._container;
                (this._container.appendChild(i),
                  s.options.interactive && s.addInteractiveTarget(i));
              },
              _removePath: function (s) {
                var i = s._container;
                (ot(i),
                  s.removeInteractiveTarget(i),
                  delete this._layers[B(s)]);
              },
              _updateStyle: function (s) {
                var i = s._stroke,
                  r = s._fill,
                  d = s.options,
                  h = s._container;
                ((h.stroked = !!d.stroke),
                  (h.filled = !!d.fill),
                  d.stroke
                    ? (i || (i = s._stroke = xn("stroke")),
                      h.appendChild(i),
                      (i.weight = d.weight + "px"),
                      (i.color = d.color),
                      (i.opacity = d.opacity),
                      d.dashArray
                        ? (i.dashStyle = ie(d.dashArray)
                            ? d.dashArray.join(" ")
                            : d.dashArray.replace(/( *, *)/g, " "))
                        : (i.dashStyle = ""),
                      (i.endcap = d.lineCap.replace("butt", "flat")),
                      (i.joinstyle = d.lineJoin))
                    : i && (h.removeChild(i), (s._stroke = null)),
                  d.fill
                    ? (r || (r = s._fill = xn("fill")),
                      h.appendChild(r),
                      (r.color = d.fillColor || d.color),
                      (r.opacity = d.fillOpacity))
                    : r && (h.removeChild(r), (s._fill = null)));
              },
              _updateCircle: function (s) {
                var i = s._point.round(),
                  r = Math.round(s._radius),
                  d = Math.round(s._radiusY || r);
                this._setPath(
                  s,
                  s._empty()
                    ? "M0 0"
                    : "AL " +
                        i.x +
                        "," +
                        i.y +
                        " " +
                        r +
                        "," +
                        d +
                        " 0," +
                        65535 * 360,
                );
              },
              _setPath: function (s, i) {
                s._path.v = i;
              },
              _bringToFront: function (s) {
                Ct(s._container);
              },
              _bringToBack: function (s) {
                xs(s._container);
              },
            },
            Os = v.vml ? xn : Me,
            ui = Ka.extend({
              _initContainer: function () {
                ((this._container = Os("svg")),
                  this._container.setAttribute("pointer-events", "none"),
                  (this._rootGroup = Os("g")),
                  this._container.appendChild(this._rootGroup));
              },
              _destroyContainer: function () {
                (ot(this._container),
                  xt(this._container),
                  delete this._container,
                  delete this._rootGroup,
                  delete this._svgSize);
              },
              _update: function () {
                if (!(this._map._animatingZoom && this._bounds)) {
                  Ka.prototype._update.call(this);
                  var s = this._bounds,
                    i = s.getSize(),
                    r = this._container;
                  ((!this._svgSize || !this._svgSize.equals(i)) &&
                    ((this._svgSize = i),
                    r.setAttribute("width", i.x),
                    r.setAttribute("height", i.y)),
                    At(r, s.min),
                    r.setAttribute(
                      "viewBox",
                      [s.min.x, s.min.y, i.x, i.y].join(" "),
                    ),
                    this.fire("update"));
                }
              },
              _initPath: function (s) {
                var i = (s._path = Os("path"));
                (s.options.className && Je(i, s.options.className),
                  s.options.interactive && Je(i, "leaflet-interactive"),
                  this._updateStyle(s),
                  (this._layers[B(s)] = s));
              },
              _addPath: function (s) {
                (this._rootGroup || this._initContainer(),
                  this._rootGroup.appendChild(s._path),
                  s.addInteractiveTarget(s._path));
              },
              _removePath: function (s) {
                (ot(s._path),
                  s.removeInteractiveTarget(s._path),
                  delete this._layers[B(s)]);
              },
              _updatePath: function (s) {
                (s._project(), s._update());
              },
              _updateStyle: function (s) {
                var i = s._path,
                  r = s.options;
                i &&
                  (r.stroke
                    ? (i.setAttribute("stroke", r.color),
                      i.setAttribute("stroke-opacity", r.opacity),
                      i.setAttribute("stroke-width", r.weight),
                      i.setAttribute("stroke-linecap", r.lineCap),
                      i.setAttribute("stroke-linejoin", r.lineJoin),
                      r.dashArray
                        ? i.setAttribute("stroke-dasharray", r.dashArray)
                        : i.removeAttribute("stroke-dasharray"),
                      r.dashOffset
                        ? i.setAttribute("stroke-dashoffset", r.dashOffset)
                        : i.removeAttribute("stroke-dashoffset"))
                    : i.setAttribute("stroke", "none"),
                  r.fill
                    ? (i.setAttribute("fill", r.fillColor || r.color),
                      i.setAttribute("fill-opacity", r.fillOpacity),
                      i.setAttribute("fill-rule", r.fillRule || "evenodd"))
                    : i.setAttribute("fill", "none"));
              },
              _updatePoly: function (s, i) {
                this._setPath(s, mt(s._parts, i));
              },
              _updateCircle: function (s) {
                var i = s._point,
                  r = Math.max(Math.round(s._radius), 1),
                  d = Math.max(Math.round(s._radiusY), 1) || r,
                  h = "a" + r + "," + d + " 0 1,0 ",
                  p = s._empty()
                    ? "M0 0"
                    : "M" +
                      (i.x - r) +
                      "," +
                      i.y +
                      h +
                      r * 2 +
                      ",0 " +
                      h +
                      -r * 2 +
                      ",0 ";
                this._setPath(s, p);
              },
              _setPath: function (s, i) {
                s._path.setAttribute("d", i);
              },
              _bringToFront: function (s) {
                Ct(s._path);
              },
              _bringToBack: function (s) {
                xs(s._path);
              },
            });
          v.vml && ui.include(hr);
          function Wi(s) {
            return v.svg || v.vml ? new ui(s) : null;
          }
          et.include({
            getRenderer: function (s) {
              var i =
                s.options.renderer ||
                this._getPaneRenderer(s.options.pane) ||
                this.options.renderer ||
                this._renderer;
              return (
                i || (i = this._renderer = this._createRenderer()),
                this.hasLayer(i) || this.addLayer(i),
                i
              );
            },
            _getPaneRenderer: function (s) {
              if (s === "overlayPane" || s === void 0) return !1;
              var i = this._paneRenderers[s];
              return (
                i === void 0 &&
                  ((i = this._createRenderer({ pane: s })),
                  (this._paneRenderers[s] = i)),
                i
              );
            },
            _createRenderer: function (s) {
              return (this.options.preferCanvas && Qi(s)) || Wi(s);
            },
          });
          var En = li.extend({
            initialize: function (s, i) {
              li.prototype.initialize.call(this, this._boundsToLatLngs(s), i);
            },
            setBounds: function (s) {
              return this.setLatLngs(this._boundsToLatLngs(s));
            },
            _boundsToLatLngs: function (s) {
              return (
                (s = X(s)),
                [
                  s.getSouthWest(),
                  s.getNorthWest(),
                  s.getNorthEast(),
                  s.getSouthEast(),
                ]
              );
            },
          });
          function kc(s, i) {
            return new En(s, i);
          }
          ((ui.create = Os),
            (ui.pointsToPath = mt),
            (Js.geometryToLayer = Sa),
            (Js.coordsToLatLng = wl),
            (Js.coordsToLatLngs = qi),
            (Js.latLngToCoords = kl),
            (Js.latLngsToCoords = Vi),
            (Js.getFeature = un),
            (Js.asFeature = Sl),
            et.mergeOptions({ boxZoom: !0 }));
          var Za = ns.extend({
            initialize: function (s) {
              ((this._map = s),
                (this._container = s._container),
                (this._pane = s._panes.overlayPane),
                (this._resetStateTimeout = 0),
                s.on("unload", this._destroy, this));
            },
            addHooks: function () {
              Ge(this._container, "mousedown", this._onMouseDown, this);
            },
            removeHooks: function () {
              xt(this._container, "mousedown", this._onMouseDown, this);
            },
            moved: function () {
              return this._moved;
            },
            _destroy: function () {
              (ot(this._pane), delete this._pane);
            },
            _resetState: function () {
              ((this._resetStateTimeout = 0), (this._moved = !1));
            },
            _clearDeferredResetState: function () {
              this._resetStateTimeout !== 0 &&
                (clearTimeout(this._resetStateTimeout),
                (this._resetStateTimeout = 0));
            },
            _onMouseDown: function (s) {
              if (!s.shiftKey || (s.which !== 1 && s.button !== 1)) return !1;
              (this._clearDeferredResetState(),
                this._resetState(),
                Is(),
                wn(),
                (this._startPoint = this._map.mouseEventToContainerPoint(s)),
                Ge(
                  document,
                  {
                    contextmenu: Ja,
                    mousemove: this._onMouseMove,
                    mouseup: this._onMouseUp,
                    keydown: this._onKeyDown,
                  },
                  this,
                ));
            },
            _onMouseMove: function (s) {
              (this._moved ||
                ((this._moved = !0),
                (this._box = Be("div", "leaflet-zoom-box", this._container)),
                Je(this._container, "leaflet-crosshair"),
                this._map.fire("boxzoomstart")),
                (this._point = this._map.mouseEventToContainerPoint(s)));
              var i = new g(this._point, this._startPoint),
                r = i.getSize();
              (At(this._box, i.min),
                (this._box.style.width = r.x + "px"),
                (this._box.style.height = r.y + "px"));
            },
            _finish: function () {
              (this._moved &&
                (ot(this._box), Kt(this._container, "leaflet-crosshair")),
                Ba(),
                kn(),
                xt(
                  document,
                  {
                    contextmenu: Ja,
                    mousemove: this._onMouseMove,
                    mouseup: this._onMouseUp,
                    keydown: this._onKeyDown,
                  },
                  this,
                ));
            },
            _onMouseUp: function (s) {
              if (
                !(s.which !== 1 && s.button !== 1) &&
                (this._finish(), !!this._moved)
              ) {
                (this._clearDeferredResetState(),
                  (this._resetStateTimeout = setTimeout(
                    re(this._resetState, this),
                    0,
                  )));
                var i = new I(
                  this._map.containerPointToLatLng(this._startPoint),
                  this._map.containerPointToLatLng(this._point),
                );
                this._map.fitBounds(i).fire("boxzoomend", { boxZoomBounds: i });
              }
            },
            _onKeyDown: function (s) {
              s.keyCode === 27 &&
                (this._finish(),
                this._clearDeferredResetState(),
                this._resetState());
            },
          });
          (et.addInitHook("addHandler", "boxZoom", Za),
            et.mergeOptions({ doubleClickZoom: !0 }));
          var Ml = ns.extend({
            addHooks: function () {
              this._map.on("dblclick", this._onDoubleClick, this);
            },
            removeHooks: function () {
              this._map.off("dblclick", this._onDoubleClick, this);
            },
            _onDoubleClick: function (s) {
              var i = this._map,
                r = i.getZoom(),
                d = i.options.zoomDelta,
                h = s.originalEvent.shiftKey ? r - d : r + d;
              i.options.doubleClickZoom === "center"
                ? i.setZoom(h)
                : i.setZoomAround(s.containerPoint, h);
            },
          });
          (et.addInitHook("addHandler", "doubleClickZoom", Ml),
            et.mergeOptions({
              dragging: !0,
              inertia: !0,
              inertiaDeceleration: 3400,
              inertiaMaxSpeed: 1 / 0,
              easeLinearity: 0.2,
              worldCopyJump: !1,
              maxBoundsViscosity: 0,
            }));
          var Ds = ns.extend({
            addHooks: function () {
              if (!this._draggable) {
                var s = this._map;
                ((this._draggable = new Ms(s._mapPane, s._container)),
                  this._draggable.on(
                    {
                      dragstart: this._onDragStart,
                      drag: this._onDrag,
                      dragend: this._onDragEnd,
                    },
                    this,
                  ),
                  this._draggable.on("predrag", this._onPreDragLimit, this),
                  s.options.worldCopyJump &&
                    (this._draggable.on("predrag", this._onPreDragWrap, this),
                    s.on("zoomend", this._onZoomEnd, this),
                    s.whenReady(this._onZoomEnd, this)));
              }
              (Je(this._map._container, "leaflet-grab leaflet-touch-drag"),
                this._draggable.enable(),
                (this._positions = []),
                (this._times = []));
            },
            removeHooks: function () {
              (Kt(this._map._container, "leaflet-grab"),
                Kt(this._map._container, "leaflet-touch-drag"),
                this._draggable.disable());
            },
            moved: function () {
              return this._draggable && this._draggable._moved;
            },
            moving: function () {
              return this._draggable && this._draggable._moving;
            },
            _onDragStart: function () {
              var s = this._map;
              if (
                (s._stop(),
                this._map.options.maxBounds &&
                  this._map.options.maxBoundsViscosity)
              ) {
                var i = X(this._map.options.maxBounds);
                ((this._offsetLimit = C(
                  this._map
                    .latLngToContainerPoint(i.getNorthWest())
                    .multiplyBy(-1),
                  this._map
                    .latLngToContainerPoint(i.getSouthEast())
                    .multiplyBy(-1)
                    .add(this._map.getSize()),
                )),
                  (this._viscosity = Math.min(
                    1,
                    Math.max(0, this._map.options.maxBoundsViscosity),
                  )));
              } else this._offsetLimit = null;
              (s.fire("movestart").fire("dragstart"),
                s.options.inertia &&
                  ((this._positions = []), (this._times = [])));
            },
            _onDrag: function (s) {
              if (this._map.options.inertia) {
                var i = (this._lastTime = +new Date()),
                  r = (this._lastPos =
                    this._draggable._absPos || this._draggable._newPos);
                (this._positions.push(r),
                  this._times.push(i),
                  this._prunePositions(i));
              }
              this._map.fire("move", s).fire("drag", s);
            },
            _prunePositions: function (s) {
              for (; this._positions.length > 1 && s - this._times[0] > 50; )
                (this._positions.shift(), this._times.shift());
            },
            _onZoomEnd: function () {
              var s = this._map.getSize().divideBy(2),
                i = this._map.latLngToLayerPoint([0, 0]);
              ((this._initialWorldOffset = i.subtract(s).x),
                (this._worldWidth = this._map
                  .getPixelWorldBounds()
                  .getSize().x));
            },
            _viscousLimit: function (s, i) {
              return s - (s - i) * this._viscosity;
            },
            _onPreDragLimit: function () {
              if (!(!this._viscosity || !this._offsetLimit)) {
                var s = this._draggable._newPos.subtract(
                    this._draggable._startPos,
                  ),
                  i = this._offsetLimit;
                (s.x < i.min.x && (s.x = this._viscousLimit(s.x, i.min.x)),
                  s.y < i.min.y && (s.y = this._viscousLimit(s.y, i.min.y)),
                  s.x > i.max.x && (s.x = this._viscousLimit(s.x, i.max.x)),
                  s.y > i.max.y && (s.y = this._viscousLimit(s.y, i.max.y)),
                  (this._draggable._newPos = this._draggable._startPos.add(s)));
              }
            },
            _onPreDragWrap: function () {
              var s = this._worldWidth,
                i = Math.round(s / 2),
                r = this._initialWorldOffset,
                d = this._draggable._newPos.x,
                h = ((d - i + r) % s) + i - r,
                p = ((d + i + r) % s) - i - r,
                j = Math.abs(h + r) < Math.abs(p + r) ? h : p;
              ((this._draggable._absPos = this._draggable._newPos.clone()),
                (this._draggable._newPos.x = j));
            },
            _onDragEnd: function (s) {
              var i = this._map,
                r = i.options,
                d = !r.inertia || s.noInertia || this._times.length < 2;
              if ((i.fire("dragend", s), d)) i.fire("moveend");
              else {
                this._prunePositions(+new Date());
                var h = this._lastPos.subtract(this._positions[0]),
                  p = (this._lastTime - this._times[0]) / 1e3,
                  j = r.easeLinearity,
                  M = h.multiplyBy(j / p),
                  H = M.distanceTo([0, 0]),
                  se = Math.min(r.inertiaMaxSpeed, H),
                  ye = M.multiplyBy(se / H),
                  De = se / (r.inertiaDeceleration * j),
                  it = ye.multiplyBy(-De / 2).round();
                !it.x && !it.y
                  ? i.fire("moveend")
                  : ((it = i._limitOffset(it, i.options.maxBounds)),
                    me(function () {
                      i.panBy(it, {
                        duration: De,
                        easeLinearity: j,
                        noMoveStart: !0,
                        animate: !0,
                      });
                    }));
              }
            },
          });
          (et.addInitHook("addHandler", "dragging", Ds),
            et.mergeOptions({ keyboard: !0, keyboardPanDelta: 80 }));
          var mr = ns.extend({
            keyCodes: {
              left: [37],
              right: [39],
              down: [40],
              up: [38],
              zoomIn: [187, 107, 61, 171],
              zoomOut: [189, 109, 54, 173],
            },
            initialize: function (s) {
              ((this._map = s),
                this._setPanDelta(s.options.keyboardPanDelta),
                this._setZoomDelta(s.options.zoomDelta));
            },
            addHooks: function () {
              var s = this._map._container;
              (s.tabIndex <= 0 && (s.tabIndex = "0"),
                Ge(
                  s,
                  {
                    focus: this._onFocus,
                    blur: this._onBlur,
                    mousedown: this._onMouseDown,
                  },
                  this,
                ),
                this._map.on(
                  { focus: this._addHooks, blur: this._removeHooks },
                  this,
                ));
            },
            removeHooks: function () {
              (this._removeHooks(),
                xt(
                  this._map._container,
                  {
                    focus: this._onFocus,
                    blur: this._onBlur,
                    mousedown: this._onMouseDown,
                  },
                  this,
                ),
                this._map.off(
                  { focus: this._addHooks, blur: this._removeHooks },
                  this,
                ));
            },
            _onMouseDown: function () {
              if (!this._focused) {
                var s = document.body,
                  i = document.documentElement,
                  r = s.scrollTop || i.scrollTop,
                  d = s.scrollLeft || i.scrollLeft;
                (this._map._container.focus(), window.scrollTo(d, r));
              }
            },
            _onFocus: function () {
              ((this._focused = !0), this._map.fire("focus"));
            },
            _onBlur: function () {
              ((this._focused = !1), this._map.fire("blur"));
            },
            _setPanDelta: function (s) {
              var i = (this._panKeys = {}),
                r = this.keyCodes,
                d,
                h;
              for (d = 0, h = r.left.length; d < h; d++)
                i[r.left[d]] = [-1 * s, 0];
              for (d = 0, h = r.right.length; d < h; d++)
                i[r.right[d]] = [s, 0];
              for (d = 0, h = r.down.length; d < h; d++) i[r.down[d]] = [0, s];
              for (d = 0, h = r.up.length; d < h; d++) i[r.up[d]] = [0, -1 * s];
            },
            _setZoomDelta: function (s) {
              var i = (this._zoomKeys = {}),
                r = this.keyCodes,
                d,
                h;
              for (d = 0, h = r.zoomIn.length; d < h; d++) i[r.zoomIn[d]] = s;
              for (d = 0, h = r.zoomOut.length; d < h; d++)
                i[r.zoomOut[d]] = -s;
            },
            _addHooks: function () {
              Ge(document, "keydown", this._onKeyDown, this);
            },
            _removeHooks: function () {
              xt(document, "keydown", this._onKeyDown, this);
            },
            _onKeyDown: function (s) {
              if (!(s.altKey || s.ctrlKey || s.metaKey)) {
                var i = s.keyCode,
                  r = this._map,
                  d;
                if (i in this._panKeys) {
                  if (!r._panAnim || !r._panAnim._inProgress)
                    if (
                      ((d = this._panKeys[i]),
                      s.shiftKey && (d = z(d).multiplyBy(3)),
                      r.options.maxBounds &&
                        (d = r._limitOffset(z(d), r.options.maxBounds)),
                      r.options.worldCopyJump)
                    ) {
                      var h = r.wrapLatLng(
                        r.unproject(r.project(r.getCenter()).add(d)),
                      );
                      r.panTo(h);
                    } else r.panBy(d);
                } else if (i in this._zoomKeys)
                  r.setZoom(
                    r.getZoom() + (s.shiftKey ? 3 : 1) * this._zoomKeys[i],
                  );
                else if (
                  i === 27 &&
                  r._popup &&
                  r._popup.options.closeOnEscapeKey
                )
                  r.closePopup();
                else return;
                Ja(s);
              }
            },
          });
          (et.addInitHook("addHandler", "keyboard", mr),
            et.mergeOptions({
              scrollWheelZoom: !0,
              wheelDebounceTime: 40,
              wheelPxPerZoomLevel: 60,
            }));
          var Fi = ns.extend({
            addHooks: function () {
              (Ge(this._map._container, "wheel", this._onWheelScroll, this),
                (this._delta = 0));
            },
            removeHooks: function () {
              xt(this._map._container, "wheel", this._onWheelScroll, this);
            },
            _onWheelScroll: function (s) {
              var i = Qt(s),
                r = this._map.options.wheelDebounceTime;
              ((this._delta += i),
                (this._lastMousePos = this._map.mouseEventToContainerPoint(s)),
                this._startTime || (this._startTime = +new Date()));
              var d = Math.max(r - (+new Date() - this._startTime), 0);
              (clearTimeout(this._timer),
                (this._timer = setTimeout(re(this._performZoom, this), d)),
                Ja(s));
            },
            _performZoom: function () {
              var s = this._map,
                i = s.getZoom(),
                r = this._map.options.zoomSnap || 0;
              s._stop();
              var d = this._delta / (this._map.options.wheelPxPerZoomLevel * 4),
                h = (4 * Math.log(2 / (1 + Math.exp(-Math.abs(d))))) / Math.LN2,
                p = r ? Math.ceil(h / r) * r : h,
                j = s._limitZoom(i + (this._delta > 0 ? p : -p)) - i;
              ((this._delta = 0),
                (this._startTime = null),
                j &&
                  (s.options.scrollWheelZoom === "center"
                    ? s.setZoom(i + j)
                    : s.setZoomAround(this._lastMousePos, i + j)));
            },
          });
          et.addInitHook("addHandler", "scrollWheelZoom", Fi);
          var On = 600;
          et.mergeOptions({
            tapHold: v.touchNative && v.safari && v.mobile,
            tapTolerance: 15,
          });
          var Pl = ns.extend({
            addHooks: function () {
              Ge(this._map._container, "touchstart", this._onDown, this);
            },
            removeHooks: function () {
              xt(this._map._container, "touchstart", this._onDown, this);
            },
            _onDown: function (s) {
              if ((clearTimeout(this._holdTimeout), s.touches.length === 1)) {
                var i = s.touches[0];
                ((this._startPos = this._newPos = new O(i.clientX, i.clientY)),
                  (this._holdTimeout = setTimeout(
                    re(function () {
                      (this._cancel(),
                        this._isTapValid() &&
                          (Ge(document, "touchend", Vt),
                          Ge(
                            document,
                            "touchend touchcancel",
                            this._cancelClickPrevent,
                          ),
                          this._simulateEvent("contextmenu", i)));
                    }, this),
                    On,
                  )),
                  Ge(
                    document,
                    "touchend touchcancel contextmenu",
                    this._cancel,
                    this,
                  ),
                  Ge(document, "touchmove", this._onMove, this));
              }
            },
            _cancelClickPrevent: function s() {
              (xt(document, "touchend", Vt),
                xt(document, "touchend touchcancel", s));
            },
            _cancel: function () {
              (clearTimeout(this._holdTimeout),
                xt(
                  document,
                  "touchend touchcancel contextmenu",
                  this._cancel,
                  this,
                ),
                xt(document, "touchmove", this._onMove, this));
            },
            _onMove: function (s) {
              var i = s.touches[0];
              this._newPos = new O(i.clientX, i.clientY);
            },
            _isTapValid: function () {
              return (
                this._newPos.distanceTo(this._startPos) <=
                this._map.options.tapTolerance
              );
            },
            _simulateEvent: function (s, i) {
              var r = new MouseEvent(s, {
                bubbles: !0,
                cancelable: !0,
                view: window,
                screenX: i.screenX,
                screenY: i.screenY,
                clientX: i.clientX,
                clientY: i.clientY,
              });
              ((r._simulated = !0), i.target.dispatchEvent(r));
            },
          });
          (et.addInitHook("addHandler", "tapHold", Pl),
            et.mergeOptions({ touchZoom: v.touch, bounceAtZoomLimits: !0 }));
          var pr = ns.extend({
            addHooks: function () {
              (Je(this._map._container, "leaflet-touch-zoom"),
                Ge(
                  this._map._container,
                  "touchstart",
                  this._onTouchStart,
                  this,
                ));
            },
            removeHooks: function () {
              (Kt(this._map._container, "leaflet-touch-zoom"),
                xt(
                  this._map._container,
                  "touchstart",
                  this._onTouchStart,
                  this,
                ));
            },
            _onTouchStart: function (s) {
              var i = this._map;
              if (
                !(
                  !s.touches ||
                  s.touches.length !== 2 ||
                  i._animatingZoom ||
                  this._zooming
                )
              ) {
                var r = i.mouseEventToContainerPoint(s.touches[0]),
                  d = i.mouseEventToContainerPoint(s.touches[1]);
                ((this._centerPoint = i.getSize()._divideBy(2)),
                  (this._startLatLng = i.containerPointToLatLng(
                    this._centerPoint,
                  )),
                  i.options.touchZoom !== "center" &&
                    (this._pinchStartLatLng = i.containerPointToLatLng(
                      r.add(d)._divideBy(2),
                    )),
                  (this._startDist = r.distanceTo(d)),
                  (this._startZoom = i.getZoom()),
                  (this._moved = !1),
                  (this._zooming = !0),
                  i._stop(),
                  Ge(document, "touchmove", this._onTouchMove, this),
                  Ge(document, "touchend touchcancel", this._onTouchEnd, this),
                  Vt(s));
              }
            },
            _onTouchMove: function (s) {
              if (!(!s.touches || s.touches.length !== 2 || !this._zooming)) {
                var i = this._map,
                  r = i.mouseEventToContainerPoint(s.touches[0]),
                  d = i.mouseEventToContainerPoint(s.touches[1]),
                  h = r.distanceTo(d) / this._startDist;
                if (
                  ((this._zoom = i.getScaleZoom(h, this._startZoom)),
                  !i.options.bounceAtZoomLimits &&
                    ((this._zoom < i.getMinZoom() && h < 1) ||
                      (this._zoom > i.getMaxZoom() && h > 1)) &&
                    (this._zoom = i._limitZoom(this._zoom)),
                  i.options.touchZoom === "center")
                ) {
                  if (((this._center = this._startLatLng), h === 1)) return;
                } else {
                  var p = r._add(d)._divideBy(2)._subtract(this._centerPoint);
                  if (h === 1 && p.x === 0 && p.y === 0) return;
                  this._center = i.unproject(
                    i.project(this._pinchStartLatLng, this._zoom).subtract(p),
                    this._zoom,
                  );
                }
                (this._moved || (i._moveStart(!0, !1), (this._moved = !0)),
                  Oe(this._animRequest));
                var j = re(
                  i._move,
                  i,
                  this._center,
                  this._zoom,
                  { pinch: !0, round: !1 },
                  void 0,
                );
                ((this._animRequest = me(j, this, !0)), Vt(s));
              }
            },
            _onTouchEnd: function () {
              if (!this._moved || !this._zooming) {
                this._zooming = !1;
                return;
              }
              ((this._zooming = !1),
                Oe(this._animRequest),
                xt(document, "touchmove", this._onTouchMove, this),
                xt(document, "touchend touchcancel", this._onTouchEnd, this),
                this._map.options.zoomAnimation
                  ? this._map._animateZoom(
                      this._center,
                      this._map._limitZoom(this._zoom),
                      !0,
                      this._map.options.zoomSnap,
                    )
                  : this._map._resetView(
                      this._center,
                      this._map._limitZoom(this._zoom),
                    ));
            },
          });
          (et.addInitHook("addHandler", "touchZoom", pr),
            (et.BoxZoom = Za),
            (et.DoubleClickZoom = Ml),
            (et.Drag = Ds),
            (et.Keyboard = mr),
            (et.ScrollWheelZoom = Fi),
            (et.TapHold = Pl),
            (et.TouchZoom = pr),
            (S.Bounds = g),
            (S.Browser = v),
            (S.CRS = Ne),
            (S.Canvas = Al),
            (S.Circle = _l),
            (S.CircleMarker = ii),
            (S.Class = Ae),
            (S.Control = Pa),
            (S.DivIcon = mo),
            (S.DivOverlay = Ta),
            (S.DomEvent = ei),
            (S.DomUtil = Ks),
            (S.Draggable = Ms),
            (S.Evented = K),
            (S.FeatureGroup = Ps),
            (S.GeoJSON = Js),
            (S.GridLayer = di),
            (S.Handler = ns),
            (S.Icon = Ls),
            (S.ImageOverlay = oi),
            (S.LatLng = pe),
            (S.LatLngBounds = I),
            (S.Layer = gs),
            (S.LayerGroup = ni),
            (S.LineUtil = Ui),
            (S.Map = et),
            (S.Marker = Zi),
            (S.Mixin = cr),
            (S.Path = Es),
            (S.Point = O),
            (S.PolyUtil = Hi),
            (S.Polygon = li),
            (S.Polyline = $s),
            (S.Popup = Xi),
            (S.PosAnimation = cn),
            (S.Projection = Nl),
            (S.Rectangle = En),
            (S.Renderer = Ka),
            (S.SVG = ui),
            (S.SVGOverlay = Cl),
            (S.TileLayer = pn),
            (S.Tooltip = $i),
            (S.Transformation = at),
            (S.Util = te),
            (S.VideoOverlay = mn),
            (S.bind = re),
            (S.bounds = C),
            (S.canvas = Qi),
            (S.circle = oo),
            (S.circleMarker = ro),
            (S.control = fs),
            (S.divIcon = wc),
            (S.extend = V),
            (S.featureGroup = io),
            (S.geoJSON = Tl),
            (S.geoJson = Yi),
            (S.gridLayer = po),
            (S.icon = Ii),
            (S.imageOverlay = co),
            (S.latLng = he),
            (S.latLngBounds = X),
            (S.layerGroup = yc),
            (S.map = ti),
            (S.marker = lo),
            (S.point = z),
            (S.polygon = Nc),
            (S.polyline = jc),
            (S.popup = ho),
            (S.rectangle = kc),
            (S.setOptions = Y),
            (S.stamp = B),
            (S.svg = Wi),
            (S.svgOverlay = uo),
            (S.tileLayer = is),
            (S.tooltip = _c),
            (S.transformation = bt),
            (S.version = b),
            (S.videoOverlay = ci));
          var xr = window.L;
          ((S.noConflict = function () {
            return ((window.L = xr), this);
          }),
            (window.L = S));
        });
      })(Qr, Qr.exports)),
    Qr.exports
  );
}
var Sg = kg();
const Jr = ef(Sg);
function Tg() {
  const [w, J] = f.useState("real"),
    [S, b] = f.useState("router-core"),
    [V, ue] = f.useState(null),
    [re, ee] = f.useState(!1),
    [B, T] = f.useState([]),
    [fe, G] = f.useState(!0),
    [F, ce] = f.useState("road"),
    [ve, Y] = f.useState([]),
    [Ee, Se] = f.useState([]),
    [le, ie] = f.useState({
      name: "",
      node_type: "ODP",
      latitude: "",
      longitude: "",
    }),
    [$, de] = f.useState(!1),
    oe = f.useRef(null),
    be = [
      {
        id: "router-core",
        name: "Core CCR2004-Gateway",
        type: "router",
        status: "online",
        ip: "103.112.5.1",
        ping: 4,
        uptime: "45 Hari 12 Jam",
        extraStats: {
          Model: "MikroTik CCR2004-16G-2S+",
          "CPU Load": "18%",
          "Suhu Board": "42°C",
          "Total Bandwidth": "8.5 Gbps",
          "Active Routes": "320",
        },
        coords: { x: 200, y: 35 },
      },
      {
        id: "olt-sudirman",
        name: "Core OLT ZTE GPON-Sudirman",
        type: "olt",
        status: "online",
        ip: "10.200.0.2",
        ping: 8,
        uptime: "12 Hari 4 Jam",
        extraStats: {
          Model: "ZTE C320 GPON",
          "PON Ports": "8 Ports Active",
          "Suhu SFP": "39.5°C",
          "Total Registered ONU": "142 ONUs",
          "Rx Power": "-18.2 dBm Avg",
        },
        coords: { x: 200, y: 130 },
      },
      {
        id: "wireless-kuningan",
        name: "BTS Kuningan Wireless Backhaul",
        type: "wireless",
        status: "online",
        ip: "10.201.12.5",
        ping: 15,
        uptime: "9 Hari 18 Jam",
        extraStats: {
          Radio: "Cambium ePMP 305",
          Frekuesi: "5820 MHz",
          "Channel Width": "40 MHz",
          "TX/RX CCQ": "98.5%",
          "Active STA Client": "4 CPEs",
        },
        coords: { x: 60, y: 130 },
      },
      {
        id: "ont-budi",
        name: "CPE Budi Santoso (Home)",
        type: "ont",
        status: "online",
        ip: "10.10.10.11",
        ping: 13,
        uptime: "3 Hari 1 Jam",
        extraStats: {
          Model: "Huawei HG8245H",
          "Optical RX Power": "-19.4 dBm",
          "Optical TX Power": "2.1 dBm",
          "LAN Status": "1000M - Link Up",
          "Active PPPoE Secret": "budisantoso@jayanet",
        },
        coords: { x: 130, y: 240 },
      },
      {
        id: "ont-toni",
        name: "CPE Toni (Gamer)",
        type: "ont",
        status: "online",
        ip: "10.10.10.13",
        ping: 11,
        uptime: "1 Hari 21 Jam",
        extraStats: {
          Model: "ZTE F609",
          "Optical RX Power": "-21.2 dBm",
          "Optical TX Power": "1.8 dBm",
          "LAN Status": "1000M - Link Up",
          "Active PPPoE Secret": "toni@jayanet",
        },
        coords: { x: 270, y: 240 },
      },
      {
        id: "ont-citra",
        name: "CPE Citra Amelia (Kuningan)",
        type: "ont",
        status: "warning",
        ip: "10.10.10.12",
        ping: 42,
        uptime: "12 Jam 5m",
        extraStats: {
          Model: "FiberHome HG6143",
          "Optical RX Power": "-26.8 dBm (Low)",
          "Optical TX Power": "1.5 dBm",
          "WiFi Clients": "14 Devices (High Load)",
          "Active PPPoE Secret": "citraamelia@jayanet",
        },
        coords: { x: 60, y: 240 },
      },
    ],
    Ye = [
      {
        id: "link-core-olt",
        source: "router-core",
        target: "olt-sudirman",
        type: "fiber",
        status: "active",
        speed: "10 Gbps SFP+",
      },
      {
        id: "link-core-wireless",
        source: "router-core",
        target: "wireless-kuningan",
        type: "wireless",
        status: "active",
        speed: "450 Mbps",
        signal: "-58 dBm CCQ 98%",
      },
      {
        id: "link-olt-budi",
        source: "olt-sudirman",
        target: "ont-budi",
        type: "fiber",
        status: "active",
        speed: "GPON Splitter 1:8",
      },
      {
        id: "link-olt-toni",
        source: "olt-sudirman",
        target: "ont-toni",
        type: "fiber",
        status: "active",
        speed: "GPON Splitter 1:8",
      },
      {
        id: "link-wireless-citra",
        source: "wireless-kuningan",
        target: "ont-citra",
        type: "wireless",
        status: "congested",
        speed: "50 Mbps PTP",
        signal: "-74 dBm (Sinyal Lemah)",
      },
    ],
    Te = async () => {
      try {
        const K = await (await fetch("/api/v1/network/nodes")).json();
        K.status === "success" && Y(K.data);
        const P = await (await fetch("/api/v1/network/links")).json();
        P.status === "success" && Se(P.data);
      } catch (y) {
        console.error("Error loading geographic nodes:", y);
      }
    };
  (f.useEffect(() => {
    Te();
  }, []),
    f.useEffect(() => {
      if (
        (oe.current && (oe.current.remove(), (oe.current = null)), w !== "real")
      )
        return;
      const y = setTimeout(() => {
        if (!document.getElementById("leaflet-map-element") || oe.current)
          return;
        const O = Jr.map("leaflet-map-element", {
          scrollWheelZoom: !0,
          zoomControl: !0,
        }).setView([-6.216, 106.84], 14);
        oe.current = O;
        const P =
            F === "satellite"
              ? "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}"
              : "https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",
          z =
            F === "satellite"
              ? "&copy; Google Maps Hybrid / Satellite"
              : '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>';
        (Jr.tileLayer(P, { attribution: z, maxZoom: 20 }).addTo(O),
          O.on("click", (g) => {
            const { lat: C, lng: I } = g.latlng;
            ie((X) => ({
              ...X,
              latitude: C.toFixed(6),
              longitude: I.toFixed(6),
            }));
          }),
          ve.forEach((g) => {
            if (!g.latitude || !g.longitude) return;
            let C = "bg-blue-600",
              I = "border-blue-300",
              X = "OD";
            switch (g.node_type) {
              case "POP":
                ((C = "bg-sky-600"), (I = "border-sky-300"), (X = "PP"));
                break;
              case "Tower":
                ((C = "bg-purple-600"), (I = "border-purple-300"), (X = "TW"));
                break;
              case "ODP":
                ((C = "bg-amber-500"), (I = "border-amber-200"), (X = "OD"));
                break;
              case "Tiang":
              case "Pole":
                ((C = "bg-slate-500"), (I = "border-slate-300"), (X = "TG"));
                break;
              case "Customer":
                ((C = "bg-emerald-600"),
                  (I = "border-emerald-300"),
                  (X = "CS"));
                break;
            }
            const pe = Jr.divIcon({
              html: `
            <div class="relative flex items-center justify-center w-7 h-7 rounded-full ${C} border-2 ${I} shadow-lg text-white font-sans font-bold">
              <span class="text-[9px]">${X}</span>
              <div class="absolute -bottom-1 h-1 w-1 bg-inherit rotate-45"></div>
            </div>
          `,
              className: "custom-leaflet-marker-icon",
              iconSize: [28, 28],
              iconAnchor: [14, 28],
              popupAnchor: [0, -28],
            });
            Jr.marker([g.latitude, g.longitude], { icon: pe }).addTo(O)
              .bindPopup(`
          <div class="text-xs font-sans text-slate-800 p-1 min-w-[170px] space-y-1.5">
            <div class="flex items-center gap-1 border-b pb-1">
              <span class="px-1.5 py-0.2 text-[8.5px] font-black text-white rounded bg-slate-900 uppercase">${g.node_type}</span>
              <strong class="text-slate-900 text-[11px]">${g.name}</strong>
            </div>
            <p class="text-[10px] text-slate-500 font-mono m-0">Lat: ${g.latitude}</p>
            <p class="text-[10px] text-slate-500 font-mono m-0">Lng: ${g.longitude}</p>
            <div class="text-[9px] text-emerald-600 font-bold bg-emerald-50 px-1 py-0.5 rounded w-max">Active Live Node</div>
            <a 
              href="https://www.google.com/maps/search/?api=1&query=${g.latitude},${g.longitude}" 
              target="_blank" 
              rel="noopener noreferrer" 
              class="block text-center mt-2 px-2.5 py-1.5 bg-blue-600 hover:bg-blue-700 text-white font-extrabold rounded text-[10px] no-underline focus:outline-none transition-all shadow hover:shadow-md"
              style="text-decoration: none !important; color: white !important;"
            >
              🗺️ Buka di Google Maps
            </a>
          </div>
        `);
          }),
          Ee.forEach((g) => {
            const C = ve.find((X) => X.id === g.source_node_id),
              I = ve.find((X) => X.id === g.destination_node_id);
            if (
              C &&
              I &&
              C.latitude &&
              C.longitude &&
              I.latitude &&
              I.longitude
            ) {
              const X = [
                [C.latitude, C.longitude],
                [I.latitude, I.longitude],
              ];
              Jr.polyline(X, {
                color: g.link_type === "wireless" ? "#818cf8" : "#fbbf24",
                weight: 3.5,
                dashArray: g.link_type === "wireless" ? "5, 5" : void 0,
                opacity: 0.8,
              }).addTo(O);
            }
          }));
      }, 150);
      return () => {
        (clearTimeout(y),
          oe.current && (oe.current.remove(), (oe.current = null)));
      };
    }, [w, ve, Ee, F]));
  const Ie = async (y) => {
      if ((y.preventDefault(), !le.name || !le.latitude || !le.longitude)) {
        alert(
          "Harap masukkan nama node dan koordinat posisi. Klik peta untuk titik otomatis!",
        );
        return;
      }
      de(!0);
      try {
        (
          await (
            await fetch("/api/v1/network/nodes", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(le),
            })
          ).json()
        ).status === "success" &&
          (ie({ name: "", node_type: "ODP", latitude: "", longitude: "" }),
          Te());
      } catch (K) {
        console.error(K);
      } finally {
        de(!1);
      }
    },
    me = async (y) => {
      if (confirm("Hapus titik infrastruktur ini dari peta?"))
        try {
          (
            await (
              await fetch(`/api/v1/network/nodes/${y}`, { method: "DELETE" })
            ).json()
          ).status === "success" && Te();
        } catch (K) {
          console.error(K);
        }
    },
    Oe = () => {
      (ee(!0), T([]));
      let y = 0;
      const K = setInterval(() => {
        y++;
        const O = be.find((C) => C.id === S),
          P = Math.floor(Math.random() * 8) - 4,
          z = O ? O.ping : 15,
          g = Math.max(2, z + P);
        (T((C) => [
          ...C,
          { seq: y, bytes: 64, latency: g, ttl: 64, status: "OK" },
        ]),
          y >= 4 && (clearInterval(K), ee(!1)));
      }, 550);
    },
    te = be.find((y) => y.id === S) || be[0],
    Ae = Ye.find((y) => y.id === V),
    Ue = (y) =>
      y === "online" || y === "active"
        ? "bg-emerald-500 shadow-emerald-500/50"
        : y === "warning" || y === "congested"
          ? "bg-amber-500 shadow-amber-500/50"
          : "bg-rose-500 shadow-rose-500/50";
  return e.jsxs("div", {
    id: "interactive-topology-map",
    className:
      "grid grid-cols-1 xl:grid-cols-3 gap-5 bg-slate-900 border border-slate-800 rounded-xl p-4 text-xs font-sans text-slate-350 shadow-2xl",
    children: [
      e.jsxs("div", {
        className:
          "xl:col-span-2 relative flex flex-col justify-between bg-slate-950 rounded-lg border border-slate-800 p-3 min-h-[460px] overflow-hidden",
        children: [
          e.jsxs("div", {
            className:
              "z-10 flex flex-col sm:flex-row gap-3 justify-between items-start sm:items-center bg-slate-900/60 p-2.5 px-3 rounded-lg border border-slate-800/80 backdrop-blur-md mb-3",
            children: [
              e.jsxs("div", {
                className: "flex items-center gap-2",
                children: [
                  e.jsx(cu, {
                    className: "h-4.5 w-4.5 text-blue-400 animate-pulse",
                  }),
                  e.jsx("span", {
                    className:
                      "font-extrabold text-white text-sm tracking-wide",
                    children: "Peta Infrastruktur & Topologi Jayanet",
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "flex bg-slate-950 p-1 rounded-lg border border-slate-800/80 gap-1 self-stretch sm:self-auto text-[10px]",
                children: [
                  e.jsxs("button", {
                    onClick: () => J("real"),
                    className: `flex-1 sm:flex-none px-3 py-1 font-bold rounded cursor-pointer transition-all flex items-center justify-center gap-1 ${w === "real" ? "bg-blue-600 text-white" : "text-slate-400 hover:text-white hover:bg-slate-900"}`,
                    children: [
                      e.jsx(ao, { className: "h-3 w-3" }),
                      e.jsx("span", {
                        children: "🌍 Peta Geografis (Real Map)",
                      }),
                    ],
                  }),
                  e.jsxs("button", {
                    onClick: () => J("logical"),
                    className: `flex-1 sm:flex-none px-3 py-1 font-bold rounded cursor-pointer transition-all flex items-center justify-center gap-1 ${w === "logical" ? "bg-blue-600 text-white" : "text-slate-400 hover:text-white hover:bg-slate-900"}`,
                    children: [
                      e.jsx(jf, { className: "h-3 w-3" }),
                      e.jsx("span", { children: "🔌 Hubungan Logis (Schema)" }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "relative flex-1 w-full h-full flex items-center justify-center min-h-[380px]",
            children:
              w === "real"
                ? e.jsxs("div", {
                    className:
                      "absolute inset-0 w-full h-full rounded-lg overflow-hidden flex flex-col",
                    children: [
                      e.jsxs("div", {
                        className:
                          "absolute top-2 left-2 z-10 bg-slate-950/90 border border-slate-800/80 p-2 rounded-lg text-[9.5px] text-blue-300 max-w-sm pointer-events-none backdrop-blur shadow-md",
                        children: [
                          "💡 ",
                          e.jsx("strong", { children: "Petunjuk Klik Peta:" }),
                          " Klik di area jalan atau koordinat mana saja pada peta untuk mengotomatisasi pengisian Latitude & Longitude pada form register di panel kanan.",
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "absolute top-2 right-2 z-10 flex gap-1 bg-slate-950/90 border border-slate-800/80 p-1 rounded-lg shadow-md backdrop-blur",
                        children: [
                          e.jsx("button", {
                            type: "button",
                            onClick: () => ce("road"),
                            className: `px-2 py-1 text-[9.5px] font-bold rounded cursor-pointer transition-colors ${F === "road" ? "bg-emerald-600 text-white font-extrabold" : "text-slate-400 hover:text-white hover:bg-slate-900"}`,
                            children: "🗺️ Map Biasa",
                          }),
                          e.jsx("button", {
                            type: "button",
                            onClick: () => ce("satellite"),
                            className: `px-2 py-1 text-[9.5px] font-bold rounded cursor-pointer transition-colors ${F === "satellite" ? "bg-emerald-600 text-white font-extrabold" : "text-slate-400 hover:text-white hover:bg-slate-900"}`,
                            children: "🛰️ Satelit",
                          }),
                        ],
                      }),
                      e.jsx("div", {
                        id: "leaflet-map-element",
                        className: "w-full h-full bg-slate-950 relative",
                        style: { zIndex: 0 },
                      }),
                    ],
                  })
                : e.jsxs(e.Fragment, {
                    children: [
                      e.jsx("svg", {
                        className: "absolute inset-0 w-full h-full",
                        viewBox: "0 0 400 280",
                        children: Ye.map((y) => {
                          const K = be.find((z) => z.id === y.source),
                            O = be.find((z) => z.id === y.target);
                          if (!K || !O) return null;
                          const P = V === y.id;
                          return e.jsxs(
                            "g",
                            {
                              className: "cursor-pointer",
                              onClick: (z) => {
                                (z.stopPropagation(), ue(y.id), b(K.id));
                              },
                              children: [
                                e.jsx("line", {
                                  x1: K.coords.x,
                                  y1: K.coords.y,
                                  x2: O.coords.x,
                                  y2: O.coords.y,
                                  stroke: P
                                    ? "rgba(59, 130, 246, 0.55)"
                                    : "transparent",
                                  strokeWidth: "8",
                                  className:
                                    "hover:stroke-blue-500/10 transition-all duration-150",
                                }),
                                e.jsx("line", {
                                  x1: K.coords.x,
                                  y1: K.coords.y,
                                  x2: O.coords.x,
                                  y2: O.coords.y,
                                  stroke:
                                    y.status === "congested"
                                      ? "#f59e0b"
                                      : y.status === "down"
                                        ? "#ef4444"
                                        : P
                                          ? "#3b82f6"
                                          : "#475569",
                                  strokeWidth: P ? "3.5" : "2",
                                  strokeDasharray:
                                    y.type === "wireless" ? "4,4" : void 0,
                                }),
                                fe &&
                                  y.status !== "down" &&
                                  e.jsx("circle", {
                                    r: "3",
                                    fill:
                                      y.status === "congested"
                                        ? "#fbbf24"
                                        : "#60a5fa",
                                    children: e.jsx("animateMotion", {
                                      path: `M ${K.coords.x} ${K.coords.y} L ${O.coords.x} ${O.coords.y}`,
                                      dur:
                                        y.status === "congested"
                                          ? "5s"
                                          : "2.8s",
                                      repeatCount: "indefinite",
                                    }),
                                  }),
                              ],
                            },
                            y.id,
                          );
                        }),
                      }),
                      be.map((y) => {
                        const K = S === y.id;
                        return e.jsxs(
                          "button",
                          {
                            onClick: () => {
                              (b(y.id), ue(null), T([]));
                            },
                            className: `absolute z-10 p-2.5 rounded-lg border text-left cursor-pointer transition-all duration-200 select-none max-w-[130px] shadow-lg ${K ? "bg-slate-800 border-blue-500 scale-105 shadow-blue-500/10 text-white" : "bg-slate-900/90 hover:bg-slate-800 border-slate-800 hover:border-slate-750"}`,
                            style: {
                              left: `calc(${y.coords.x}% / 4 - 32px)`,
                              top: `calc(${y.coords.y}% / 2.8 - 18px)`,
                            },
                            children: [
                              e.jsxs("div", {
                                className: "flex items-center gap-1 mb-1",
                                children: [
                                  e.jsx("span", {
                                    className: `block h-1.5 w-1.5 rounded-full ${Ue(y.status)}`,
                                  }),
                                  e.jsx("span", {
                                    className:
                                      "text-[7.5px] uppercase font-bold text-slate-400 leading-tight",
                                    children: y.type,
                                  }),
                                ],
                              }),
                              e.jsx("p", {
                                className:
                                  "font-extrabold text-[9.5px] leading-tight text-white truncate animate-fade-in",
                                children: y.name
                                  .replace("Core OLT ", "")
                                  .replace("Core ", "")
                                  .replace("BTS ", ""),
                              }),
                              e.jsxs("div", {
                                className:
                                  "flex justify-between items-center text-[8px] text-slate-400 font-mono mt-0.5",
                                children: [
                                  e.jsx("span", { children: y.ip }),
                                  e.jsxs("span", {
                                    className:
                                      y.status === "warning"
                                        ? "text-amber-500 font-bold"
                                        : "text-emerald-400",
                                    children: [y.ping, "ms"],
                                  }),
                                ],
                              }),
                            ],
                          },
                          y.id,
                        );
                      }),
                    ],
                  }),
          }),
          e.jsxs("div", {
            className:
              "flex justify-between items-center text-[9px] text-slate-500 pt-1 border-t border-slate-800/60 mt-3 font-mono",
            children: [
              e.jsxs("div", {
                className: "flex gap-3",
                children: [
                  e.jsxs("span", {
                    className: "flex items-center gap-1",
                    children: [
                      e.jsx("span", {
                        className: "h-1.5 w-1.5 rounded-full bg-emerald-500",
                      }),
                      " Online / Active",
                    ],
                  }),
                  e.jsxs("span", {
                    className: "flex items-center gap-1",
                    children: [
                      e.jsx("span", {
                        className:
                          "h-1.5 w-1.5 rounded-full bg-amber-500 animate-pulse",
                      }),
                      " Warning / Loss",
                    ],
                  }),
                ],
              }),
              e.jsx("div", {
                children: e.jsx("span", {
                  children:
                    w === "real"
                      ? "Klik Kiri Peta untuk Ambil Titik GPS"
                      : "Klik Node untuk Diagnostic Uji",
                }),
              }),
            ],
          }),
        ],
      }),
      e.jsx("div", {
        className:
          "bg-slate-950 border border-slate-800 rounded-lg p-3.5 flex flex-col justify-between space-y-4 shadow-inner",
        children:
          w === "real"
            ? e.jsxs("div", {
                className: "space-y-4 flex-1 flex flex-col",
                children: [
                  e.jsxs("div", {
                    className: "border-b border-slate-850 pb-2",
                    children: [
                      e.jsxs("h4", {
                        className:
                          "text-[11.5px] font-black text-white uppercase tracking-wider flex items-center gap-1.5",
                        children: [
                          e.jsx(jn, { className: "h-4 w-4 text-emerald-400" }),
                          e.jsx("span", {
                            children: "Registrasi Titik Baru (ODP/Poles)",
                          }),
                        ],
                      }),
                      e.jsx("p", {
                        className:
                          "text-[10px] text-slate-500 leading-normal mt-0.5",
                        children:
                          "Demarkasikan dan daftarkan ODP, Tiang, atau customer ke peta geografis.",
                      }),
                    ],
                  }),
                  e.jsxs("form", {
                    onSubmit: Ie,
                    className: "space-y-3.5 text-slate-300",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className:
                              "text-[10px] font-bold text-slate-400 uppercase tracking-widest block",
                            children: "Jenis Alat Infrastruktur *",
                          }),
                          e.jsxs("select", {
                            value: le.node_type,
                            onChange: (y) =>
                              ie((K) => ({ ...K, node_type: y.target.value })),
                            className:
                              "w-full p-2 bg-slate-900 border border-slate-800 rounded outline-none font-sans text-xs focus:border-blue-650 text-white cursor-pointer",
                            children: [
                              e.jsx("option", {
                                value: "ODP",
                                children: "ODP (Optical Distribution Point)",
                              }),
                              e.jsx("option", {
                                value: "Tiang",
                                children: "Tiang Distribusi (Fiber Pole)",
                              }),
                              e.jsx("option", {
                                value: "POP",
                                children: "POP (Point of Presence / Office)",
                              }),
                              e.jsx("option", {
                                value: "Tower",
                                children: "BTS Tower Jaringan",
                              }),
                              e.jsx("option", {
                                value: "Customer",
                                children: "Perangkat ONT Klien (Home)",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className:
                              "text-[10px] font-bold text-slate-400 uppercase tracking-widest block font-sans",
                            children: "Nama / Kode Identitas Titik *",
                          }),
                          e.jsx("input", {
                            type: "text",
                            required: !0,
                            placeholder:
                              "Misal: ODP-SDR-B05 atau Tiang Raya 12",
                            value: le.name,
                            onChange: (y) =>
                              ie((K) => ({ ...K, name: y.target.value })),
                            className:
                              "w-full p-2 bg-slate-900 border border-slate-800 rounded text-xs text-white placeholder-slate-600 outline-none focus:border-blue-650",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "grid grid-cols-2 gap-2",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[9.5px] font-bold text-slate-400 uppercase tracking-widest block",
                                children: "Latitude *",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "-6.2160",
                                value: le.latitude,
                                onChange: (y) =>
                                  ie((K) => ({
                                    ...K,
                                    latitude: y.target.value,
                                  })),
                                className:
                                  "w-full p-2 bg-slate-900 border border-slate-800 rounded font-mono text-xs text-white placeholder-slate-600 outline-none",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[9.5px] font-bold text-slate-400 uppercase tracking-widest block",
                                children: "Longitude *",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "106.8400",
                                value: le.longitude,
                                onChange: (y) =>
                                  ie((K) => ({
                                    ...K,
                                    longitude: y.target.value,
                                  })),
                                className:
                                  "w-full p-2 bg-slate-900 border border-slate-800 rounded font-mono text-xs text-white placeholder-slate-600 outline-none",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("button", {
                        type: "submit",
                        disabled: $,
                        className:
                          "w-full py-2 bg-emerald-600 hover:bg-emerald-555 text-white font-bold text-xs rounded transition-colors shadow-md flex items-center justify-center gap-1 cursor-pointer disabled:bg-slate-700 disabled:cursor-not-allowed",
                        children: [
                          e.jsx(ou, { className: "h-3.5 w-3.5" }),
                          e.jsx("span", {
                            children: $
                              ? "Menyimpan..."
                              : "Simpan & Petakan Titik",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "flex-1 flex flex-col min-h-[140px]",
                    children: [
                      e.jsxs("span", {
                        className:
                          "text-[9.5px] font-bold text-slate-400 uppercase tracking-widest block mb-2 border-b border-slate-850 pb-1",
                        children: [
                          "Daftar Titik Koordinat GPS (",
                          ve.length,
                          ")",
                        ],
                      }),
                      e.jsx("div", {
                        className:
                          "flex-1 overflow-y-auto max-h-[160px] divide-y divide-slate-850 border border-slate-850 rounded bg-slate-900 p-2 text-[10.5px]",
                        children:
                          ve.length === 0
                            ? e.jsx("p", {
                                className:
                                  "text-slate-600 p-4 text-center font-sans",
                                children: "Belum ada titik yang disimpan.",
                              })
                            : ve.map((y) =>
                                e.jsxs(
                                  "div",
                                  {
                                    className:
                                      "py-2 flex items-center justify-between gap-2 hover:bg-slate-950/40 px-1 rounded",
                                    children: [
                                      e.jsxs("div", {
                                        className: "truncate",
                                        children: [
                                          e.jsxs("div", {
                                            className:
                                              "flex items-center gap-1",
                                            children: [
                                              e.jsx("span", {
                                                className:
                                                  "px-1 py-0.2 text-[8px] font-black uppercase tracking-wide bg-slate-850 font-sans text-blue-400 rounded",
                                                children: y.node_type,
                                              }),
                                              e.jsx("span", {
                                                className:
                                                  "font-bold text-white truncate",
                                                children: y.name,
                                              }),
                                            ],
                                          }),
                                          e.jsxs("span", {
                                            className:
                                              "font-mono text-[9px] text-slate-500 block leading-normal mt-0.5",
                                            children: [
                                              "Lat: ",
                                              y.latitude,
                                              " | Lng: ",
                                              y.longitude,
                                            ],
                                          }),
                                        ],
                                      }),
                                      e.jsxs("div", {
                                        className:
                                          "flex items-center gap-1 shrink-0",
                                        children: [
                                          e.jsx("a", {
                                            href: `https://www.google.com/maps/search/?api=1&query=${y.latitude},${y.longitude}`,
                                            target: "_blank",
                                            rel: "noopener noreferrer",
                                            className:
                                              "p-1 hover:bg-blue-950/40 text-blue-400 hover:text-blue-300 rounded cursor-pointer transition-colors",
                                            title: "Buka Lokasi di Google Maps",
                                            children: e.jsx(ou, {
                                              className: "h-3 w-3",
                                            }),
                                          }),
                                          e.jsx("button", {
                                            onClick: () => me(y.id),
                                            className:
                                              "p-1 hover:bg-rose-950/40 text-slate-500 hover:text-rose-400 rounded cursor-pointer transition-colors",
                                            title: "Delete Node dari Peta",
                                            children: e.jsx(ms, {
                                              className: "h-3 w-3",
                                            }),
                                          }),
                                        ],
                                      }),
                                    ],
                                  },
                                  y.id,
                                ),
                              ),
                      }),
                    ],
                  }),
                ],
              })
            : e.jsxs("div", {
                className: "space-y-3.5",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b border-slate-850 pb-2 flex justify-between items-center",
                    children: [
                      e.jsxs("h4", {
                        className:
                          "text-[11px] font-extrabold text-white uppercase tracking-wider flex items-center gap-1",
                        children: [
                          e.jsx(eo, { className: "h-3.5 w-3.5 text-blue-500" }),
                          e.jsx("span", {
                            children: "Real-time Panel Diagnostik",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[8px] bg-slate-900 border border-slate-800 text-slate-400 font-mono px-1 rounded uppercase",
                        children: te.type,
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-2",
                    children: [
                      e.jsxs("div", {
                        children: [
                          e.jsx("h3", {
                            className: "text-sm font-black text-white",
                            children: te.name,
                          }),
                          e.jsxs("p", {
                            className:
                              "text-[10px] text-blue-400 font-mono mt-0.5",
                            children: ["IP Address: ", te.ip],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "bg-slate-900/60 border border-slate-850 rounded-lg p-2.5 divide-y divide-slate-850 text-[10.5px]",
                        children: [
                          e.jsxs("div", {
                            className: "flex justify-between py-1 items-center",
                            children: [
                              e.jsx("span", {
                                className: "text-slate-550",
                                children: "Uptime Jaringan",
                              }),
                              e.jsx("span", {
                                className: "font-mono text-white text-[10px]",
                                children: te.uptime,
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "flex justify-between py-1 items-center",
                            children: [
                              e.jsx("span", {
                                className: "text-slate-550",
                                children: "Ping Delay Latency",
                              }),
                              e.jsxs("span", {
                                className:
                                  "font-mono font-bold text-emerald-400",
                                children: [te.ping, " ms (Avg)"],
                              }),
                            ],
                          }),
                          Object.entries(te.extraStats).map(([y, K]) =>
                            e.jsxs(
                              "div",
                              {
                                className:
                                  "flex justify-between py-1 items-center",
                                children: [
                                  e.jsx("span", {
                                    className: "text-slate-550",
                                    children: y,
                                  }),
                                  e.jsx("span", {
                                    className:
                                      "text-slate-300 font-mono text-[10px]",
                                    children: K,
                                  }),
                                ],
                              },
                              y,
                            ),
                          ),
                        ],
                      }),
                    ],
                  }),
                  Ae &&
                    e.jsxs("div", {
                      className:
                        "p-2.5 bg-blue-950/20 border border-blue-900/40 text-blue-300 rounded-lg space-y-1",
                      children: [
                        e.jsx("span", {
                          className:
                            "text-[9px] font-bold uppercase tracking-wider block text-blue-400",
                          children: "Atribut Link Terpilih",
                        }),
                        e.jsx("p", {
                          className: "font-bold text-[11px]",
                          children: Ae.speed,
                        }),
                        Ae.signal &&
                          e.jsxs("p", {
                            className: "text-[10px] text-amber-400 font-mono",
                            children: ["Signal: ", Ae.signal],
                          }),
                      ],
                    }),
                  e.jsxs("div", {
                    children: [
                      e.jsxs("div", {
                        className: "flex justify-between items-center mb-1",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[9.5px] uppercase font-bold text-slate-500 tracking-wider",
                            children: "Simulasi Ping Test (ICMP)",
                          }),
                          e.jsx("button", {
                            onClick: Oe,
                            disabled: re,
                            className:
                              "px-2 py-0.5 bg-blue-600 hover:bg-blue-500 disabled:bg-slate-700 text-white font-bold rounded text-[9px] transition-all cursor-pointer",
                            children: re ? "Running..." : "Mulai Ping",
                          }),
                        ],
                      }),
                      e.jsx("div", {
                        className:
                          "bg-slate-950 border border-slate-850/80 rounded-lg p-2 font-mono text-[9px] leading-relaxed text-blue-400 min-h-[90px] flex flex-col justify-end",
                        children:
                          B.length === 0
                            ? e.jsxs("p", {
                                className:
                                  "text-slate-600 select-all cursor-text text-center my-auto font-sans",
                                children: [
                                  "Instansi Routerboard siap diuji.",
                                  e.jsx("br", {}),
                                  "Klik 'Mulai Ping' untuk tes latency.",
                                ],
                              })
                            : B.map((y, K) =>
                                e.jsxs(
                                  "p",
                                  {
                                    className: "text-emerald-400 select-text",
                                    children: [
                                      y.bytes,
                                      " bytes from ",
                                      te.ip,
                                      ": seq=",
                                      y.seq,
                                      " ttl=",
                                      y.ttl,
                                      " time=",
                                      y.latency,
                                      "ms",
                                    ],
                                  },
                                  K,
                                ),
                              ),
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "flex gap-2 border-t border-slate-850 pt-3",
                    children: [
                      e.jsxs("button", {
                        onClick: () => {
                          alert(
                            `Menginisialisasi sync ulang API ke perlengkapan node '${te.name}'...`,
                          );
                        },
                        className:
                          "flex-1 py-1.5 bg-slate-900 hover:bg-slate-800 border border-slate-850 text-slate-300 rounded font-bold transition-all text-[10px] flex items-center justify-center gap-1 cursor-pointer",
                        children: [
                          e.jsx(Va, { className: "h-3 w-3" }),
                          e.jsx("span", { children: "Sync Stats" }),
                        ],
                      }),
                      e.jsx("button", {
                        onClick: () => {
                          confirm(
                            `Peringatan: Reboot Mikrotik/Device '${te.name}' dapat menghentikan kelangsungan internet pelanggan yang tersangkut. Jalankan?`,
                          ) &&
                            alert(`Pemicu reboot terkirim ke ROS API ${te.ip}`);
                        },
                        className:
                          "px-3 py-1.5 bg-rose-950/30 hover:bg-rose-900/30 text-rose-400 border border-rose-950/40 rounded font-extrabold text-[10px] transition-all cursor-pointer",
                        children: "Reboot",
                      }),
                    ],
                  }),
                ],
              }),
      }),
    ],
  });
}
function Cg({ activeRole: w }) {
  const [networkSubTab, setNetworkSubTab] = f.useState("nodes");
  const [J, S] = f.useState([]),
    [b, V] = f.useState(null),
    [ue, re] = f.useState([]),
    [ee, B] = f.useState([]),
    [T, fe] = f.useState(null),
    [G, F] = f.useState(!1),
    [ce, ve] = f.useState(""),
    Y = async () => {
      try {
        const Ae = await (await fetch("/api/v1/routers")).json();
        Ae.status === "success" && S(Ae.data);
      } catch (te) {
        console.error(te);
      }
    },
    loadInfrastructure = async () => {
      try {
        const response = await (await fetch("/api/v1/olt")).json();
        const oltRows = response.status === "success" && Array.isArray(response.data) ? response.data : [];
        re(oltRows);
        const onuGroups = await Promise.all(oltRows.map((olt) => fetch(`/api/v1/olt/${olt.id}/onus`).then((r) => r.json()).catch(() => ({ data: [] }))));
        B(onuGroups.flatMap((group) => Array.isArray(group.data) ? group.data : []));
      } catch (_) { re([]); B([]); }
    },
    [Ee, Se] = f.useState([]),
    [le, ie] = f.useState(!1),
    [$, de] = f.useState(""),
    [oe, be] = f.useState("routerOS_binary"),
    Ye = async () => {
      try {
        const Ae = await (await fetch("/api/v1/backups")).json();
        Ae.status === "success" && Se(Ae.data);
      } catch (te) {
        console.error(te);
      }
    },
    Te = async (te) => {
      (te.preventDefault(), ie(!0));
      try {
        (
          await (
            await fetch("/api/v1/backups/generate", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ type: oe, note: $ }),
            })
          ).json()
        ).status === "success" && (de(""), Ye());
      } catch (Ae) {
        console.error(Ae);
      } finally {
        ie(!1);
      }
    },
    Ie = async (te) => {
      if (confirm("Hapus file backup terenkripsi ini dari cloud storage?"))
        try {
          (
            await (
              await fetch(`/api/v1/backups/${te}`, { method: "DELETE" })
            ).json()
          ).status === "success" && Ye();
        } catch (Ae) {
          console.error(Ae);
        }
    };
  f.useEffect(() => {
    (Y(), Ye(), loadInfrastructure());
  }, []);
  const me = async (te) => {
      (F(!0), ve(""));
      try {
        const Ue = await (
          await fetch(`/api/v1/routers/${te}/sync`, { method: "POST" })
        ).json();
        Ue.status === "success" && (ve(Ue.message), Y());
      } catch (Ae) {
        console.error(Ae);
      } finally {
        F(!1);
      }
    },
    Oe = async (te) => {
      T &&
        (alert(
          `Aksi TR-069 ACS [${te}] berhasil dikoordinasikan ke ONU CPE dengan S/N ${T.serial_number}!`,
        ),
        fe(null));
    };
  return e.jsxs("div", {
    className: "space-y-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsx("div", {
        className: "flex border-b border-slate-200 flex-wrap mb-4 bg-white dark:bg-slate-900 border p-1 rounded-xl shadow-sm",
        children: [
          { id: "nodes", label: "🖥️ Router & OLT/ACS Nodes" },
          { id: "radius", label: "🔌 Radius NAS Server & Logs" },
          { id: "sync", label: "🔄 Recovery & Sync MikroTik" },
        ].map((u) =>
          e.jsx(
            "button",
            {
              onClick: () => setNetworkSubTab(u.id),
              className: `px-5 py-3 text-xs font-bold border-b-2 tracking-tight transition-all duration-150 cursor-pointer ${networkSubTab === u.id ? "border-blue-600 text-blue-600 font-extrabold" : "border-transparent text-slate-500 hover:text-slate-800 dark:hover:text-slate-350"}`,
              children: u.label,
            },
            u.id,
          )
        ),
      }),
      networkSubTab === "nodes" && e.jsxs(f.Fragment, { children: [
      e.jsx(Tg, {}),
      e.jsxs("div", {
        className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            className: "xl:col-span-2 space-y-6",
            children: [
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-4 shadow-sm",
                children: [
                  e.jsxs("div", {
                    className:
                      "flex items-center justify-between border-b pb-3",
                    children: [
                      e.jsx("div", {
                        children: e.jsxs("h2", {
                          className:
                            "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                          children: [
                            e.jsx(gc, {
                              className: "h-4.5 w-4.5 text-blue-600",
                            }),
                            e.jsx("span", {
                              children: "Router Core & Cabang (RouterOS Node)",
                            }),
                          ],
                        }),
                      }),
                      ce &&
                        e.jsx("span", {
                          className: "text-emerald-500 text-xs font-semibold",
                          children: ce,
                        }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "grid grid-cols-1 md:grid-cols-2 gap-4",
                    children: J.map((te) =>
                      e.jsxs(
                        "div",
                        {
                          id: `router-card-${te.id}`,
                          className:
                            "p-4 bg-slate-50 hover:bg-slate-100/50 border border-slate-200 rounded-xl space-y-3 relative",
                          children: [
                            e.jsxs("div", {
                              className: "flex justify-between items-start",
                              children: [
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("h3", {
                                      className:
                                        "text-xs font-extrabold text-slate-800",
                                      children: te.name,
                                    }),
                                    e.jsxs("p", {
                                      className:
                                        "text-[10px] font-mono text-slate-500",
                                      children: [
                                        te.ip_address,
                                        ":",
                                        te.api_port,
                                      ],
                                    }),
                                  ],
                                }),
                                e.jsx("span", {
                                  className: `text-[9px] uppercase font-bold py-0.5 px-2 rounded-full ${te.status === "online" ? "bg-green-50 text-green-600" : "bg-rose-50 text-rose-600 animate-pulse"}`,
                                  children: te.status,
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "grid grid-cols-3 gap-2 text-center text-[10px] font-mono",
                              children: [
                                e.jsxs("div", {
                                  className:
                                    "bg-white p-2 rounded border border-slate-150",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "text-slate-400 block uppercase",
                                      children: "CPU",
                                    }),
                                    e.jsxs("strong", {
                                      className: "text-slate-800 font-bold",
                                      children: [te.cpu_usage, "%"],
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "bg-white p-2 rounded border border-slate-150",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "text-slate-400 block uppercase",
                                      children: "RAM",
                                    }),
                                    e.jsxs("strong", {
                                      className: "text-slate-800 font-bold",
                                      children: [te.memory_usage, "%"],
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "bg-white p-2 rounded border border-slate-150",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "text-slate-400 block uppercase",
                                      children: "SUHU",
                                    }),
                                    e.jsxs("strong", {
                                      className: "text-slate-800 font-bold",
                                      children: [te.temperature, "°C"],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "flex items-center justify-between text-[11px] pt-1",
                              children: [
                                e.jsxs("span", {
                                  className: "text-slate-450 font-light",
                                  children: ["Engine: ", te.firmware],
                                }),
                                w !== "Customer" &&
                                  w !== "Technician" &&
                                  w !== "Finance" &&
                                  e.jsxs("button", {
                                    onClick: () => me(te.id),
                                    disabled: G,
                                    className:
                                      "text-blue-600 hover:text-blue-500 font-bold flex items-center gap-1 cursor-pointer",
                                    children: [
                                      e.jsx(Va, {
                                        className: `h-3 w-3 ${G ? "animate-spin" : ""}`,
                                      }),
                                      e.jsx("span", { children: "Sync" }),
                                    ],
                                  }),
                              ],
                            }),
                          ],
                        },
                        te.id,
                      ),
                    ),
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b pb-2 flex justify-between items-center",
                    children: [
                      e.jsxs("h3", {
                        className:
                          "text-xs font-extrabold text-slate-800 uppercase tracking-widest flex items-center gap-1.5",
                        children: [
                          e.jsx(Qf, { className: "h-4 w-4 text-violet-500" }),
                          e.jsx("span", {
                            children: "Pemantau ONT (GenieACS TR-069 Service)",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[10px] bg-slate-100 text-slate-500 px-2 py-0.5 rounded font-mono",
                        children: "3 Perangkat Terdata",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "space-y-2.5",
                    children: ee.length ? ee.map((te) =>
                      e.jsxs(
                        "div",
                        {
                          onClick: () => fe(te),
                          className:
                            "p-3 bg-slate-50 hover:bg-slate-100/50 border border-slate-200 rounded-xl flex flex-col sm:flex-row items-center justify-between gap-4 cursor-pointer",
                          children: [
                            e.jsxs("div", {
                              className:
                                "flex items-start gap-3 w-full sm:w-auto",
                              children: [
                                e.jsx("div", {
                                  className:
                                    "h-8 w-8 bg-violet-50 text-violet-600 border border-violet-200 rounded flex items-center justify-center font-bold text-xs shrink-0 mt-0.5",
                                  children: "Mod",
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsxs("h4", {
                                      className:
                                        "text-xs font-extrabold text-slate-800",
                                      children: [te.vendor, " - ", te.model],
                                    }),
                                    e.jsxs("span", {
                                      className:
                                        "text-[10px] font-mono text-blue-600",
                                      children: ["S/N: ", te.serial_number],
                                    }),
                                    e.jsxs("p", {
                                      className:
                                        "text-[10px] text-slate-505 font-sans mt-0.5",
                                      children: [
                                        "Profil PPPoE terikat: ",
                                        e.jsx("strong", {
                                          className: "font-mono text-slate-700",
                                          children: te.pppoe_user,
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "flex items-center gap-4 text-xs font-mono shrink-0 w-full sm:w-auto justify-between",
                              children: [
                                e.jsxs("div", {
                                  className: "text-right",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-450 block font-sans",
                                      children: "Optical Power RX",
                                    }),
                                    e.jsxs("span", {
                                      className: `font-bold ${te.rx_power < -25 ? "text-rose-500" : "text-emerald-600"}`,
                                      children: [te.rx_power, " dBm"],
                                    }),
                                  ],
                                }),
                                e.jsx("span", {
                                  className: `text-[10px] font-bold px-1.5 py-0.5 rounded ${te.status === "online" ? "bg-green-50 text-green-600" : "bg-amber-50 text-amber-600 animate-pulse"}`,
                                  children: te.status,
                                }),
                              ],
                            }),
                          ],
                        },
                        te.id,
                      ),
                    ) : e.jsx("div", { className: "p-6 text-center text-xs text-slate-400 border border-dashed rounded-lg", children: "Belum ada perangkat ONT/ONU dari integrasi OLT/ACS." }),
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "space-y-6",
            children: [
              e.jsxs("div", {
                className:
                  "p-4 bg-slate-900 border border-slate-850 rounded-xl space-y-3 shadow-xl",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b border-slate-800 pb-2 flex justify-between items-center",
                    children: [
                      e.jsxs("h3", {
                        className:
                          "text-xs font-extrabold text-white uppercase tracking-widest flex items-center gap-1.5 font-sans",
                        children: [
                          e.jsx($n, {
                            className: "h-4 w-4 text-emerald-500 animate-pulse",
                          }),
                          e.jsx("span", {
                            children: "MikroTik ROS System Logs Console",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[9px] bg-emerald-950 text-emerald-400 border border-emerald-900 px-1.5 py-0.5 rounded font-mono uppercase",
                        children: "live logs",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "bg-slate-950 border border-slate-850 rounded-lg p-3 font-mono text-[10px] text-slate-300 leading-relaxed max-h-52 overflow-y-auto space-y-2 select-text",
                    children: "Log RouterOS belum dimuat. Gunakan terminal baca atau endpoint diagnostik untuk mengambil log nyata dari router.",
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3.5",
                children: [
                  e.jsx("div", {
                    className:
                      "border-b pb-2 flex justify-between items-center",
                    children: e.jsx("h3", {
                      className:
                        "text-xs font-extrabold text-slate-805 uppercase tracking-widest",
                      children: "Daftar OLT GPON / EPON",
                    }),
                  }),
                  e.jsx("div", {
                    className: "space-y-3 text-xs",
                    children: ue.length ? ue.map((te) =>
                      e.jsxs(
                        "div",
                        {
                          className:
                            "p-2.5 bg-slate-50 border rounded-lg flex justify-between items-center",
                          children: [
                            e.jsxs("div", {
                              children: [
                                e.jsx("h4", {
                                  className: "font-extrabold text-slate-800",
                                  children: te.name,
                                }),
                                e.jsxs("p", {
                                  className:
                                    "text-[10px] text-slate-500 font-mono",
                                  children: [
                                    te.ip,
                                    " • Registered: ",
                                    te.registered_onus,
                                    " ONUs",
                                  ],
                                }),
                              ],
                            }),
                            e.jsx("div", {
                              className: "text-right",
                              children: e.jsx("span", {
                                className:
                                  "text-[10px] px-1.5 py-0.5 rounded bg-green-50 text-green-600 border border-green-150 font-bold font-mono",
                                children: "OK",
                              }),
                            }),
                          ],
                        },
                        te.id,
                      ),
                    ) : e.jsx("div", { className: "p-5 text-center text-slate-400 border border-dashed rounded-lg", children: "Belum ada OLT nyata yang didaftarkan." }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b pb-2 flex justify-between items-center font-sans",
                    children: [
                      e.jsxs("h3", {
                        className:
                          "text-xs font-black text-rose-600 uppercase tracking-widest flex items-center gap-1.5",
                        children: [
                          e.jsx(so, {
                            className: "h-4.5 w-4.5 text-emerald-500 shrink-0",
                          }),
                          e.jsx("span", {
                            children: "Disaster Recovery Backup Hub",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[9px] bg-emerald-50 border border-emerald-200 text-emerald-600 font-bold px-2 py-0.5 rounded-full select-none animate-pulse",
                        children: "Aktif & Aman",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[10px] text-slate-550 leading-normal font-sans",
                    children: [
                      "Mencadangkan router & data billing ",
                      e.jsx("strong", {
                        children: "secara otomatis tiap hari (03:00 WIB)",
                      }),
                      ". File cadangan disimpan aman di Cloud Jayanet, sehingga ",
                      e.jsx("strong", {
                        children:
                          "dapat diunduh kapan saja walau router utama padam total",
                      }),
                      "!",
                    ],
                  }),
                  e.jsxs("form", {
                    onSubmit: Te,
                    className:
                      "p-3 bg-slate-50 border border-slate-150 rounded-xl space-y-3 font-sans",
                    children: [
                      e.jsxs("h4", {
                        className:
                          "text-[9.5px] font-bold text-slate-700 uppercase tracking-wider flex items-center gap-1",
                        children: [
                          e.jsx(h0, { className: "h-3.5 w-3.5 text-blue-500" }),
                          e.jsx("span", { children: "Amankan Snapshot Baru" }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "grid grid-cols-1 sm:grid-cols-2 gap-2 text-[11px]",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[8.5px] font-bold text-slate-400 block tracking-wide select-none",
                                children: "TIPE SUMBER",
                              }),
                              e.jsxs("select", {
                                value: oe,
                                onChange: (te) => be(te.target.value),
                                className:
                                  "w-full p-1.5 bg-white border border-slate-200 outline-none rounded text-xs select cursor-pointer",
                                children: [
                                  e.jsx("option", {
                                    value: "routerOS_binary",
                                    children: "RouterOS Backup (.backup)",
                                  }),
                                  e.jsx("option", {
                                    value: "olt_script",
                                    children: "OLT ZTE Config (.rsc)",
                                  }),
                                  e.jsx("option", {
                                    value: "radius_database",
                                    children: "Database Clients (.sql)",
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[8.5px] font-bold text-slate-400 block tracking-wide select-none",
                                children: "CATATAN RECOVERY",
                              }),
                              e.jsx("input", {
                                type: "text",
                                placeholder: "Misal: Sebelum upgrade VLAN",
                                value: $,
                                required: !0,
                                onChange: (te) => de(te.target.value),
                                className:
                                  "w-full p-1.5 bg-white border border-slate-200 outline-none rounded text-xs input",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("button", {
                        type: "submit",
                        disabled:
                          le ||
                          w === "Technician" ||
                          w === "Finance" ||
                          w === "Customer",
                        className:
                          "w-full py-1.5 bg-slate-900 border border-slate-800 hover:bg-slate-850 hover:text-white text-slate-300 text-[10.5px] font-bold rounded flex items-center justify-center gap-1.5 transition-all cursor-pointer shadow-sm hover:shadow disabled:bg-slate-300 disabled:text-slate-500 disabled:cursor-not-allowed",
                        children: [
                          e.jsx(Va, {
                            className: `h-3 w-3 text-emerald-500 ${le ? "animate-spin" : ""}`,
                          }),
                          e.jsx("span", {
                            children: le
                              ? "Memproses Backup..."
                              : w === "Technician" || w === "Finance"
                                ? "Akses Backup Dikunci"
                                : "Inisialisasi Backup Off-Site",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-2 max-h-[290px] overflow-y-auto pr-1",
                    children: [
                      e.jsxs("span", {
                        className:
                          "text-[9.5px] font-bold text-slate-400 uppercase tracking-widest block font-sans select-none",
                        children: [
                          "Daftar Backup Offsite Cloud (",
                          Ee.length,
                          ")",
                        ],
                      }),
                      Ee.length === 0
                        ? e.jsx("p", {
                            className:
                              "text-slate-400 text-center text-xs py-4 font-sans select-none",
                            children: "Belum ada snapshot terdata.",
                          })
                        : Ee.map((te) =>
                            e.jsxs(
                              "div",
                              {
                                className:
                                  "p-2.5 bg-slate-50 hover:bg-slate-100/30 border border-slate-150 rounded-xl flex items-center justify-between gap-2 transition-all text-xs font-sans",
                                children: [
                                  e.jsxs("div", {
                                    className: "truncate flex-1 space-y-1",
                                    children: [
                                      e.jsxs("div", {
                                        className: "flex items-center gap-1.5",
                                        children: [
                                          e.jsx("span", {
                                            className:
                                              "px-1 py-0.5 text-[7px] font-black uppercase rounded bg-slate-200 text-slate-705 font-mono select-none",
                                            children:
                                              te.type === "routerOS_binary"
                                                ? "ROS BIN"
                                                : te.type === "olt_script"
                                                  ? "OLT RSC"
                                                  : "SQL DB",
                                          }),
                                          e.jsx("strong", {
                                            className:
                                              "text-slate-800 truncate block font-mono text-[10px]",
                                            title: te.filename,
                                            children: te.filename,
                                          }),
                                        ],
                                      }),
                                      e.jsx("p", {
                                        className:
                                          "text-[9.5px] text-slate-550 truncate leading-none",
                                        children: te.note,
                                      }),
                                      e.jsxs("div", {
                                        className:
                                          "flex flex-wrap items-center gap-2 text-[9px] text-slate-400 font-mono mt-1 select-none",
                                        children: [
                                          e.jsxs("span", {
                                            className:
                                              "flex items-center gap-0.5 shrink-0",
                                            children: [
                                              e.jsx(Wr, {
                                                className: "h-2.5 w-2.5",
                                              }),
                                              new Date(
                                                te.created_at,
                                              ).toLocaleDateString("id-ID", {
                                                day: "numeric",
                                                month: "short",
                                                hour: "2-digit",
                                                minute: "2-digit",
                                              }),
                                            ],
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "bg-slate-200/50 px-1 rounded shrink-0",
                                            children: te.size,
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-emerald-600 font-bold uppercase shrink-0",
                                            children:
                                              te.source &&
                                              te.source.includes("Routine")
                                                ? "Harian"
                                                : "Manual",
                                          }),
                                        ],
                                      }),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className:
                                      "flex items-center gap-1 shrink-0",
                                    children: [
                                      e.jsx("a", {
                                        href: `/api/v1/backups/download/${te.filename}`,
                                        className:
                                          "p-1.5 bg-blue-50 border border-blue-200 hover:bg-blue-100 text-blue-600 rounded-lg cursor-pointer transition-colors",
                                        title: "Download File Cadangan",
                                        children: e.jsx(pc, {
                                          className: "h-3 w-3",
                                        }),
                                      }),
                                      w !== "Customer" &&
                                        w !== "Technician" &&
                                        w !== "Finance" &&
                                        e.jsx("button", {
                                          onClick: () => Ie(te.id),
                                          className:
                                            "p-1.5 bg-rose-50 border border-rose-100 hover:bg-rose-100 text-rose-600 rounded-lg cursor-pointer transition-all",
                                          title: "Hapus Snapshot",
                                          children: e.jsx(ms, {
                                            className: "h-3 w-3",
                                          }),
                                        }),
                                    ],
                                  }),
                                ],
                              },
                              te.id,
                            ),
                          ),
                    ],
                  }),
                ],
              }),
            ],
          }),
          T &&
            e.jsx("div", {
              id: "acs-control-modal",
              className:
                "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
              children: e.jsxs("div", {
                className:
                  "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
                children: [
                  e.jsxs("div", {
                    className:
                      "flex items-center justify-between border-b pb-3 mb-2",
                    children: [
                      e.jsxs("div", {
                        children: [
                          e.jsxs("h3", {
                            className:
                              "font-display font-extrabold text-slate-808 text-sm",
                            children: ["TR-069 Panel: ", T.model],
                          }),
                          e.jsxs("p", {
                            className:
                              "text-[10px] text-blue-600 font-mono mt-0.5",
                            children: ["S/N: ", T.serial_number],
                          }),
                        ],
                      }),
                      e.jsx("button", {
                        onClick: () => fe(null),
                        className:
                          "p-1 hover:bg-slate-100 rounded text-slate-400",
                        children: e.jsx(la, { className: "h-4 w-4" }),
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "grid grid-cols-2 gap-3 p-3 bg-slate-50 border rounded-lg text-center text-xs",
                    children: [
                      e.jsxs("div", {
                        children: [
                          e.jsx("span", {
                            className: "text-slate-400 block text-[10px]",
                            children: "RX Laser Power",
                          }),
                          e.jsxs("strong", {
                            className: `text-sm ${T.rx_power < -25 ? "text-rose-600" : "text-emerald-600"}`,
                            children: [T.rx_power, " dBm"],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        children: [
                          e.jsx("span", {
                            className: "text-slate-400 block text-[10px]",
                            children: "TX Laser Power",
                          }),
                          e.jsxs("strong", {
                            className: "text-sm text-slate-805",
                            children: [T.tx_power, " dBm"],
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1.5 text-xs text-slate-707",
                    children: [
                      e.jsx("p", {
                        children: e.jsx("strong", {
                          children: "Configured SSID WiFi:",
                        }),
                      }),
                      e.jsx("input", {
                        type: "text",
                        defaultValue: T.ssid_wifi,
                        disabled:
                          w === "Technician" ||
                          w === "Finance" ||
                          w === "Customer",
                        className:
                          "w-full p-2 bg-slate-50 border rounded outline-none font-sans disabled:opacity-60 disabled:cursor-not-allowed",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-2.5",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[10px] font-bold text-slate-400 uppercase tracking-widest block",
                        children: "Aksi Konsol ACS",
                      }),
                      e.jsxs("div", {
                        className: "grid grid-cols-2 gap-2",
                        children: [
                          e.jsx("button", {
                            disabled:
                              w === "Technician" ||
                              w === "Finance" ||
                              w === "Customer",
                            onClick: () => Oe("REBOOT"),
                            className:
                              "py-1.5 bg-slate-800 hover:bg-slate-700 text-slate-100 font-bold text-[11px] rounded transition-all cursor-pointer text-center disabled:bg-slate-300 disabled:text-slate-500 disabled:cursor-not-allowed",
                            children: "Reboot ONT",
                          }),
                          e.jsx("button", {
                            disabled:
                              w === "Technician" ||
                              w === "Finance" ||
                              w === "Customer",
                            onClick: () => Oe("FACTORY_RESET"),
                            className:
                              "py-1.5 bg-rose-50 border border-rose-200 text-rose-600 hover:bg-rose-100 font-bold text-[11px] rounded transition-all cursor-pointer text-center disabled:bg-slate-100 disabled:text-slate-400 disabled:border-slate-200 disabled:cursor-not-allowed",
                            children: "Factory Reset",
                          }),
                        ],
                      }),
                      e.jsx("button", {
                        disabled:
                          w === "Technician" ||
                          w === "Finance" ||
                          w === "Customer",
                        onClick: () => Oe("PUSH_PPPOE"),
                        className:
                          "w-full py-2 bg-blue-600 hover:bg-blue-500 text-white text-xs font-bold rounded-lg cursor-pointer transition-colors pt-2 shadow disabled:bg-slate-300 disabled:text-slate-500 disabled:cursor-not-allowed",
                        children: "Push PPPoE Credentials Config",
                      }),
                    ],
                  }),
                ],
              }),
            }),
        ],
      }),
      ] }),
      networkSubTab === "radius" && e.jsx(window.RadiusDashboard || (() => e.jsx("p", { children: "Loading..." })), { G: { activeRole: w } }),
      networkSubTab === "sync" && e.jsx(window.SyncDashboard || (() => e.jsx("p", { children: "Loading..." })), { activeRole: w }),
    ],
  });
}
function Ag({ activeRole: w }) {
  const [J, S] = f.useState([]),
    [b, V] = f.useState(null),
    [ue, re] = f.useState(!1),
    [ee, B] = f.useState("all"),
    [T, fe] = f.useState(""),
    [G, F] = f.useState({
      customer_name: "",
      title: "",
      description: "",
      priority: "medium",
    }),
    [ce, ve] = f.useState("Akhmad"),
    Y = async () => {
      try {
        const de = await (await fetch("/api/v1/support/tickets")).json();
        de.status === "success" && S(de.data);
      } catch ($) {
        console.error($);
      }
    };
  f.useEffect(() => {
    Y();
  }, []);
  const Ee = async ($) => {
      $.preventDefault();
      try {
        (
          await (
            await fetch("/api/v1/support/tickets", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(G),
            })
          ).json()
        ).status === "success" &&
          (re(!1),
          F({
            customer_name: "",
            title: "",
            description: "",
            priority: "medium",
          }),
          Y());
      } catch (de) {
        console.error(de);
      }
    },
    Se = async ($) => {
      try {
        (
          await (
            await fetch(`/api/v1/support/tickets/${$}/assign`, {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ technician: ce }),
            })
          ).json()
        ).status === "success" && (Y(), V(null));
      } catch (de) {
        console.error(de);
      }
    },
    le = async ($) => {
      try {
        const de = J.map((oe) =>
          oe.id === $ ? { ...oe, status: "resolved" } : oe,
        );
        (S(de),
          V(null),
          alert("Tiket keluhan pelanggan berhasil diselesaikan!"));
      } catch (de) {
        console.error(de);
      }
    },
    ie = J.filter(($) => {
      const de = ee === "all" || $.priority === ee,
        oe =
          $.title.toLowerCase().includes(T.toLowerCase()) ||
          $.customer_name.toLowerCase().includes(T.toLowerCase()) ||
          $.technician.toLowerCase().includes(T.toLowerCase());
      return de && oe;
    });
  return e.jsxs("div", {
    className:
      "grid grid-cols-1 xl:grid-cols-3 gap-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsxs("div", {
        className: "xl:col-span-2 space-y-4",
        children: [
          e.jsxs("div", {
            className:
              "p-4 bg-white border border-slate-200 rounded-xl space-y-3.5 shadow-sm",
            children: [
              e.jsxs("div", {
                className:
                  "flex flex-col sm:flex-row items-center justify-between gap-4",
                children: [
                  e.jsx("div", {
                    children: e.jsxs("h2", {
                      className:
                        "text-sm font-extrabold text-slate-900 flex items-center gap-2",
                      children: [
                        e.jsx(ir, { className: "h-4.5 w-4.5 text-blue-650" }),
                        e.jsxs("span", {
                          children: [
                            "Pusat Pengaduan & Keluhan Tiket (",
                            ie.length,
                            ")",
                          ],
                        }),
                      ],
                    }),
                  }),
                  w !== "Technician" &&
                    e.jsxs("button", {
                      onClick: () => re(!0),
                      className:
                        "w-full sm:w-auto px-4 py-1.5 bg-blue-600 hover:bg-blue-505 text-white font-bold rounded-lg text-xs flex items-center justify-center gap-1.5 cursor-pointer shadow-sm shadow-blue-500/10 transition-colors",
                      children: [
                        e.jsx(jn, { className: "h-4 w-4" }),
                        e.jsx("span", { children: "Buat Tiket Baru" }),
                      ],
                    }),
                ],
              }),
              e.jsxs("div", {
                className: "flex flex-col sm:flex-row items-center gap-3",
                children: [
                  e.jsxs("div", {
                    className: "relative flex-1 w-full",
                    children: [
                      e.jsx(Pi, {
                        className:
                          "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400",
                      }),
                      e.jsx("input", {
                        type: "text",
                        placeholder: "Cari keluhan, pelanggan, nama teknisi...",
                        value: T,
                        onChange: ($) => fe($.target.value),
                        className:
                          "w-full pl-9 pr-4 py-1.5 bg-slate-50 border border-slate-200 focus:border-blue-500 rounded-lg text-xs placeholder-slate-400 outline-none",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "flex gap-1.5 overflow-x-auto self-start w-full sm:w-auto",
                    children: ["all", "critical", "high", "medium", "low"].map(
                      ($) =>
                        e.jsx(
                          "button",
                          {
                            onClick: () => B($),
                            className: `px-3 py-1 rounded text-[11px] font-bold capitalize transition-colors cursor-pointer ${ee === $ ? "bg-slate-800 text-white font-extrabold" : "bg-slate-100 hover:bg-slate-200 text-slate-650"}`,
                            children: $,
                          },
                          $,
                        ),
                    ),
                  }),
                ],
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "bg-white border rounded-xl overflow-hidden shadow-sm divide-y divide-slate-100",
            children:
              ie.length === 0
                ? e.jsx("p", {
                    className:
                      "p-8 text-center text-xs text-slate-400 font-light",
                    children: "Tidak menemukan tiket keluhan.",
                  })
                : ie.map(($) =>
                    e.jsxs(
                      "div",
                      {
                        onClick: () => V($),
                        className:
                          "p-4 hover:bg-slate-50 transition-colors cursor-pointer flex items-center justify-between gap-4 text-xs",
                        children: [
                          e.jsxs("div", {
                            className: "flex items-start gap-3",
                            children: [
                              e.jsx("div", {
                                className: `p-1.5 rounded-lg shrink-0 mt-0.5 ${$.priority === "critical" || $.priority === "high" ? "bg-rose-50 text-rose-600" : "bg-slate-100 text-slate-600"}`,
                                children: e.jsx(Xn, { className: "h-5 w-5" }),
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsx("h4", {
                                    className:
                                      "font-extrabold text-slate-800 tracking-tight",
                                    children: $.title,
                                  }),
                                  e.jsxs("p", {
                                    className:
                                      "text-[10px] text-slate-500 mt-0.5",
                                    children: ["Klien: ", $.customer_name],
                                  }),
                                  e.jsxs("div", {
                                    className:
                                      "flex items-center gap-2.5 mt-2 text-[10px] text-slate-450 font-mono font-semibold",
                                    children: [
                                      e.jsxs("span", {
                                        className:
                                          "bg-slate-105 border px-1.5 py-0.5 rounded uppercase",
                                        children: [$.priority, " priority"],
                                      }),
                                      e.jsx("span", { children: "•" }),
                                      e.jsxs("span", {
                                        children: [
                                          "Teknisi: ",
                                          $.technician || "Unassigned",
                                        ],
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "text-right shrink-0",
                            children: [
                              e.jsx("span", {
                                className: `text-[10px] font-bold px-2 py-0.5 rounded capitalize ${$.status === "resolved" ? "bg-green-50 text-green-600" : $.status === "assigned" ? "bg-indigo-50 text-indigo-600" : $.status === "pending" ? "bg-amber-50 text-amber-600 animate-pulse" : "bg-blue-50 text-blue-600 animate-pulse"}`,
                                children: $.status,
                              }),
                              e.jsx("span", {
                                className:
                                  "block text-[9px] text-slate-400 font-mono mt-1",
                                children: new Date(
                                  $.created_at,
                                ).toLocaleDateString(),
                              }),
                            ],
                          }),
                        ],
                      },
                      $.id,
                    ),
                  ),
          }),
        ],
      }),
      e.jsx("div", {
        id: "support-details-panel",
        children: b
          ? e.jsxs("div", {
              className:
                "bg-white border rounded-xl overflow-hidden divide-y divide-slate-100 p-4 space-y-4",
              children: [
                e.jsxs("div", {
                  children: [
                    e.jsxs("div", {
                      className:
                        "flex justify-between items-start border-b pb-2 mb-2",
                      children: [
                        e.jsxs("div", {
                          children: [
                            e.jsx("h3", {
                              className:
                                "text-sm font-extrabold text-slate-800 leading-tight",
                              children: b.title,
                            }),
                            e.jsxs("p", {
                              className:
                                "text-[10px] text-slate-405 mt-0.5 font-mono",
                              children: ["Tiket #", b.id],
                            }),
                          ],
                        }),
                        e.jsx("button", {
                          onClick: () => V(null),
                          className:
                            "p-1 hover:bg-slate-100 rounded text-slate-400",
                          children: e.jsx(la, { className: "h-4 w-4" }),
                        }),
                      ],
                    }),
                    e.jsx("p", {
                      className:
                        "text-xs text-slate-650 leading-relaxed font-light select-none",
                      children: b.description,
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "pt-4 space-y-3",
                  children: [
                    e.jsx("span", {
                      className:
                        "text-[9px] font-bold text-slate-400 uppercase tracking-widest block",
                      children: "Alokasikan Surat Perintah Kerja (Work Order)",
                    }),
                    b.status === "open" &&
                    w !== "Customer" &&
                    w !== "Technician"
                      ? e.jsxs("div", {
                          className: "space-y-2 font-sans text-xs",
                          children: [
                            e.jsx("label", {
                              className: "font-bold text-slate-500",
                              children: "Pilih Teknisi Lapangan:",
                            }),
                            e.jsxs("div", {
                              className: "flex gap-2",
                              children: [
                                e.jsxs("select", {
                                  value: ce,
                                  onChange: ($) => ve($.target.value),
                                  className:
                                    "flex-1 p-2 bg-slate-50 border rounded-lg text-xs cursor-pointer outline-none",
                                  children: [
                                    e.jsx("option", {
                                      value: "Akhmad",
                                      children:
                                        "Akhmad (Technician Central Node)",
                                    }),
                                    e.jsx("option", {
                                      value: "Zulfikir",
                                      children:
                                        "Zulfikir (Technician South Node)",
                                    }),
                                    e.jsx("option", {
                                      value: "Rahman",
                                      children: "Rahman (Lead Spv Field)",
                                    }),
                                  ],
                                }),
                                e.jsx("button", {
                                  onClick: () => Se(b.id),
                                  className:
                                    "px-3.5 py-1.5 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-lg cursor-pointer transition-colors",
                                  children: "Tunjuk",
                                }),
                              ],
                            }),
                          ],
                        })
                      : b.status === "assigned" || b.status === "pending"
                        ? e.jsxs("div", {
                            className: "space-y-2",
                            children: [
                              e.jsxs("p", {
                                className: "text-xs text-slate-600 font-medium",
                                children: [
                                  "Terpilih: ",
                                  e.jsx("strong", { children: b.technician }),
                                ],
                              }),
                              w !== "Customer" &&
                                e.jsxs("button", {
                                  onClick: () => le(b.id),
                                  className:
                                    "w-full py-2 bg-green-600 hover:bg-green-500 text-white font-bold text-xs rounded-lg transition-colors flex items-center justify-center gap-1 cursor-pointer",
                                  children: [
                                    e.jsx(tn, { className: "h-4 w-4" }),
                                    e.jsx("span", {
                                      children: "Selesaikan & Selesai WO",
                                    }),
                                  ],
                                }),
                            ],
                          })
                        : e.jsxs("div", {
                            className:
                              "p-3 bg-green-50 border border-green-200 text-green-800 text-xs rounded-lg flex items-center gap-2 font-semibold",
                            children: [
                              e.jsx(tn, {
                                className: "h-4.5 w-4.5 text-green-600",
                              }),
                              e.jsx("span", {
                                children:
                                  "Keluhan ini telah tuntas diselesaikan oleh teknisi.",
                              }),
                            ],
                          }),
                  ],
                }),
              ],
            })
          : e.jsxs("div", {
              className:
                "p-10 bg-white border rounded-xl text-center text-xs text-slate-400 font-light flex flex-col items-center justify-center gap-2",
              children: [
                e.jsx(Of, { className: "h-7 w-7 text-slate-300" }),
                e.jsx("span", {
                  children:
                    "Pilih salah satu tiket keluhan pelanggan untuk mengalokasikannya ke tim teknisi lapangan Jaya Net (Operator Akhmad/Zulfir).",
                }),
              ],
            }),
      }),
      ue &&
        e.jsx("div", {
          id: "add-ticket-modal",
          className:
            "fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-xl shadow-2xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b pb-3 mb-2",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-display font-extrabold text-slate-800 text-sm",
                    children: "Buat Laporan Tiket Keluhan",
                  }),
                  e.jsx("button", {
                    onClick: () => re(!1),
                    className: "p-1 hover:bg-slate-100 rounded text-slate-400",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: Ee,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Pelanggan / CRM ID",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "Budi Santoso atau PLG-8219",
                        value: G.customer_name,
                        onChange: ($) =>
                          F({ ...G, customer_name: $.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Jenis Kerusakan / Title *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "Misal: Redaman tinggi, modem LOS...",
                        value: G.title,
                        onChange: ($) => F({ ...G, title: $.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Tingkat Darurat",
                      }),
                      e.jsxs("select", {
                        value: G.priority,
                        onChange: ($) => F({ ...G, priority: $.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg cursor-pointer outline-none",
                        children: [
                          e.jsx("option", {
                            value: "low",
                            children: "Low (Pertanyaan Dasar)",
                          }),
                          e.jsx("option", {
                            value: "medium",
                            children: "Medium (Bisa Ditunda)",
                          }),
                          e.jsx("option", {
                            value: "high",
                            children: "High (LOS / No Connection)",
                          }),
                          e.jsx("option", {
                            value: "critical",
                            children: "Critical (Down Area / PON Down)",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Deskripsi Rincian Masalah *",
                      }),
                      e.jsx("textarea", {
                        required: !0,
                        rows: 3,
                        placeholder: "Tuliskan kronologi singkat...",
                        value: G.description,
                        onChange: ($) =>
                          F({ ...G, description: $.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border rounded-lg resize-none outline-none font-sans",
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2.5 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-lg cursor-pointer pt-2 px-4 shadow",
                    children: "Kirim & Daftarkan Tiket",
                  }),
                ],
              }),
            ],
          }),
        }),
    ],
  });
}
function Mg({ activeRole: w }) {
  const [J, S] = f.useState([]),
    [b, V] = f.useState("all"),
    [ue, re] = f.useState(""),
    [ee, B] = f.useState(""),
    [T, fe] = f.useState(""),
    [G, F] = f.useState({
      wa_api_url: "https://api.fonnte.com/send",
      wa_token: "FONNTE_TOKEN_89218A",
      tg_bot_token: "bot128912903:AAE8k-tgbOt01",
      tg_chat_id: "-1002182103981",
    }),
    ce = async () => {
      try {
        const ie = await (await fetch("/api/v1/comms/logs")).json();
        ie.status === "success" && S(ie.data);
      } catch (le) {
        console.error(le);
      }
    },
    ve = async () => {
      try {
        const ie = await (await fetch("/api/v1/comms/gateway-settings")).json();
        ie.status === "success" && F(ie.data);
      } catch (le) {
        console.error(le);
      }
    };
  f.useEffect(() => {
    (ce(), ve());
  }, []);
  const Y = async (le) => {
      if ((le.preventDefault(), !(!ee || !T)))
        try {
          (
            await (
              await fetch("/api/v1/comms/send-test", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({ number: ee, message: T }),
              })
            ).json()
          ).status === "success" &&
            (alert(
              "Pesan uji coba WhatsApp berhasil dikoordinasikan secara lokal!",
            ),
            B(""),
            fe(""),
            ce());
        } catch (ie) {
          console.error(ie);
        }
    },
    Ee = async (le) => {
      le.preventDefault();
      try {
        (
          await (
            await fetch("/api/v1/comms/gateway-settings", {
              method: "PUT",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify(G),
            })
          ).json()
        ).status === "success" &&
          (alert(
            "Konfigurasi API Gateway WhatsApp & Telegram berhasil disimpan & diaktifkan!",
          ),
          ve());
      } catch (ie) {
        console.error(ie);
      }
    },
    Se = J.filter((le) => {
      const ie = b === "all" || le.type === b,
        $ =
          le.customer_name.toLowerCase().includes(ue.toLowerCase()) ||
          le.recipient.includes(ue) ||
          le.content.toLowerCase().includes(ue.toLowerCase());
      return ie && $;
    });
  return e.jsxs("div", {
    className:
      "grid grid-cols-1 xl:grid-cols-3 gap-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsxs("div", {
        className: "xl:col-span-2 space-y-4",
        children: [
          e.jsxs("div", {
            className:
              "p-4 bg-white border border-slate-200 rounded-xl space-y-3 shadow-sm",
            children: [
              e.jsx("div", {
                className:
                  "flex border-b pb-2 mb-1 justify-between items-center",
                children: e.jsxs("h2", {
                  className:
                    "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                  children: [
                    e.jsx(bc, { className: "h-4.5 w-4.5 text-blue-650" }),
                    e.jsxs("span", {
                      children: [
                        "Log Notifikasi WhatsApp & Telegram (",
                        Se.length,
                        ")",
                      ],
                    }),
                  ],
                }),
              }),
              e.jsxs("div", {
                className: "flex flex-col sm:flex-row items-center gap-3",
                children: [
                  e.jsxs("div", {
                    className: "relative flex-1 w-full text-xs",
                    children: [
                      e.jsx(Pi, {
                        className:
                          "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-450",
                      }),
                      e.jsx("input", {
                        type: "text",
                        placeholder: "Cari penerima, isi pesan, status...",
                        value: ue,
                        onChange: (le) => re(le.target.value),
                        className:
                          "w-full pl-9 pr-4 py-1.5 bg-slate-50 border border-slate-200 rounded-lg outline-none",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "flex gap-1.5 w-full sm:w-auto",
                    children: ["all", "whatsapp", "telegram"].map((le) =>
                      e.jsx(
                        "button",
                        {
                          onClick: () => V(le),
                          className: `px-3 py-1 rounded text-[11px] font-bold capitalize transition-colors cursor-pointer ${b === le ? "bg-slate-850 text-white font-extrabold" : "bg-slate-100 hover:bg-slate-200 text-slate-600"}`,
                          children: le,
                        },
                        le,
                      ),
                    ),
                  }),
                ],
              }),
            ],
          }),
          e.jsx("div", {
            className:
              "bg-white border rounded-xl overflow-hidden shadow-sm divide-y divide-slate-100",
            children:
              Se.length === 0
                ? e.jsx("p", {
                    className:
                      "p-8 text-center text-xs text-slate-400 font-light",
                    children: "Tidak ada rekaman notifikasi keluar.",
                  })
                : Se.map((le) =>
                    e.jsxs(
                      "div",
                      {
                        className:
                          "p-4 hover:bg-slate-50 transition-colors text-xs flex items-start justify-between gap-4",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1.5 flex-1 min-w-0",
                            children: [
                              e.jsxs("div", {
                                className: "flex items-center gap-2",
                                children: [
                                  e.jsx("span", {
                                    className: "font-extrabold text-slate-800",
                                    children: le.customer_name,
                                  }),
                                  e.jsxs("span", {
                                    className:
                                      "text-[10px] text-slate-400 font-mono",
                                    children: ["(", le.recipient, ")"],
                                  }),
                                ],
                              }),
                              e.jsx("div", {
                                className:
                                  "bg-slate-50/80 border p-2 rounded-lg text-[11px] text-slate-650 font-sans block relative",
                                children: le.content,
                              }),
                              e.jsxs("div", {
                                className:
                                  "flex gap-3 text-[10px] font-mono text-slate-450",
                                children: [
                                  e.jsxs("span", {
                                    className: "capitalize",
                                    children: ["Saluran: ", le.type],
                                  }),
                                  e.jsx("span", { children: "•" }),
                                  e.jsxs("span", {
                                    className: "capitalize",
                                    children: ["Kategori: ", le.message_type],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "text-right shrink-0",
                            children: [
                              e.jsx("span", {
                                className: `text-[10px] font-bold px-1.5 py-0.5 rounded capitalize ${le.status === "sent" ? "bg-green-50 text-green-600" : "bg-rose-50 text-rose-500 animate-pulse"}`,
                                children: le.status,
                              }),
                              e.jsx("span", {
                                className:
                                  "block text-[9px] text-slate-400 font-mono mt-1",
                                children: new Date(
                                  le.dispatched_at,
                                ).toLocaleTimeString(),
                              }),
                            ],
                          }),
                        ],
                      },
                      le.id,
                    ),
                  ),
          }),
        ],
      }),
      e.jsxs("div", {
        className: "space-y-4",
        children: [
          w !== "Customer" &&
            w !== "Technician" &&
            e.jsxs("div", {
              className:
                "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3 text-xs",
              children: [
                e.jsxs("div", {
                  className: "border-b pb-2 flex gap-1.5 items-center",
                  children: [
                    e.jsx(Fr, { className: "h-4.5 w-4.5 text-blue-600" }),
                    e.jsx("h3", {
                      className:
                        "font-extrabold text-slate-800 uppercase tracking-widest",
                      children: "Broadcast WhatsApp Uji Coba",
                    }),
                  ],
                }),
                e.jsxs("form", {
                  onSubmit: Y,
                  className: "space-y-3",
                  children: [
                    e.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "Nomor Penerima *",
                        }),
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "Contoh: 0812345678",
                          value: ee,
                          onChange: (le) => B(le.target.value),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "Pesan WhatsApp Broadcast *",
                        }),
                        e.jsx("textarea", {
                          required: !0,
                          rows: 4,
                          placeholder:
                            "Halo, ini adalah pesan broadcast pengingat tagihan...",
                          value: T,
                          onChange: (le) => fe(le.target.value),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg resize-none outline-none font-sans",
                        }),
                      ],
                    }),
                    e.jsxs("button", {
                      type: "submit",
                      className:
                        "w-full py-2 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1 shadow",
                      children: [
                        e.jsx(vc, { className: "h-3 w-3 shrink-0" }),
                        e.jsx("span", { children: "Kirim Notifikasi" }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          w !== "Customer" &&
            w !== "Technician" &&
            e.jsxs("div", {
              className:
                "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-3.5 text-xs",
              children: [
                e.jsxs("div", {
                  className: "border-b pb-2 flex gap-1.5 items-center",
                  children: [
                    e.jsx(mu, {
                      className: "h-4.5 w-4.5 text-violet-600 animate-spin",
                      style: { animationDuration: "6s" },
                    }),
                    e.jsx("h3", {
                      className:
                        "font-extrabold text-slate-805 uppercase tracking-widest",
                      children: "Gateway API WhatsApp & Telegram",
                    }),
                  ],
                }),
                e.jsxs("form", {
                  onSubmit: Ee,
                  className: "space-y-3",
                  children: [
                    e.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "WhatsApp Gateway URL *",
                        }),
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "https://api.fonnte.com/send",
                          value: G.wa_api_url,
                          onChange: (le) =>
                            F({ ...G, wa_api_url: le.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono text-[11px]",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "WhatsApp API Token *",
                        }),
                        e.jsx("input", {
                          type: "password",
                          required: !0,
                          placeholder: "Token atau API Key Fonnte",
                          value: G.wa_token,
                          onChange: (le) =>
                            F({ ...G, wa_token: le.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono text-[11px]",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-1 border-t pt-2 mt-2",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "Telegram Bot Token *",
                        }),
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "bot123456:ABC-DEF1234",
                          value: G.tg_bot_token,
                          onChange: (le) =>
                            F({ ...G, tg_bot_token: le.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono text-[11px]",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "space-y-1",
                      children: [
                        e.jsx("label", {
                          className: "font-bold text-slate-500",
                          children: "Telegram Chat ID / Group ID *",
                        }),
                        e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder: "-10012345678",
                          value: G.tg_chat_id,
                          onChange: (le) =>
                            F({ ...G, tg_chat_id: le.target.value }),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-mono text-[11px]",
                        }),
                      ],
                    }),
                    e.jsx("button", {
                      type: "submit",
                      className:
                        "w-full py-2 bg-violet-650 hover:bg-violet-600 text-white font-bold rounded-lg cursor-pointer flex items-center justify-center gap-1 shadow-md pt-2",
                      children: e.jsx("span", {
                        children: "Save & Connect Gateways",
                      }),
                    }),
                  ],
                }),
              ],
            }),
        ],
      }),
    ],
  });
}
function Pg({ activeRole: w }) {
  const [usage, setUsage] = f.useState({ total_bytes: 0, download_bytes: 0, upload_bytes: 0, active_sessions: 0, categories: [] });
  const [topUsers, setTopUsers] = f.useState([]);
  const [analyticsError, setAnalyticsError] = f.useState("");
  const formatBytes = (value) => {
    const bytes = Number(value || 0); if (!bytes) return "0 B";
    const units = ["B", "KB", "MB", "GB", "TB"]; const unit = Math.min(units.length - 1, Math.floor(Math.log(bytes) / Math.log(1024)));
    return `${(bytes / Math.pow(1024, unit)).toFixed(unit > 2 ? 2 : 1)} ${units[unit]}`;
  };
  const loadAnalytics = async () => {
    try {
      const [u, t] = await Promise.all([fetch("/api/v1/analytics/usage").then((r) => r.json()), fetch("/api/v1/analytics/top-users").then((r) => r.json())]);
      if (u.status !== "success") throw new Error(u.message || "RouterOS tidak terhubung");
      setUsage(u.data); setTopUsers(t.status === "success" && Array.isArray(t.data) ? t.data : []); setAnalyticsError("");
    } catch (err) { setAnalyticsError(err.message || "Data RouterOS tidak dapat dibaca"); }
  };
  f.useEffect(() => { loadAnalytics(); const timer = setInterval(loadAnalytics, 1e4); return () => clearInterval(timer); }, []);
  const J = Array.isArray(usage.categories) ? usage.categories : [],
    S = topUsers.slice(0, 10).map((item) => ({ type: item.customer_name || item.username, count: formatBytes(item.usage_bytes), severity: item.ip_address || "Sesi aktif", color: "text-emerald-600" }));
  return e.jsxs("div", {
    className: "space-y-6 max-w-7xl mx-auto w-full font-sans select-none pb-12",
    children: [
      e.jsxs("div", {
        children: [
          e.jsx("h1", {
            className:
              "text-xl font-display font-extrabold text-slate-900 tracking-tight",
            children: "Data Analytics & Traffic Logger",
          }),
          e.jsx("p", {
            className: "text-xs text-slate-500 font-light mt-0.5",
            children:
              "Statistik sesi dan pemakaian data yang dibaca langsung dari RouterOS.",
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm lg:col-span-2 space-y-4",
            children: [
              e.jsxs("div", {
                className: "border-b pb-3 flex justify-between items-center",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsxs("h3", {
                        className:
                          "text-sm font-extrabold text-slate-800 flex items-center gap-1.5",
                        children: [
                          e.jsx(so, { className: "h-4.5 w-4.5 text-blue-650" }),
                          e.jsx("span", {
                            children:
                              "RouterOS Live Usage Analytics",
                          }),
                        ],
                      }),
                      e.jsx("p", {
                        className: "text-[10px] text-slate-450 mt-0.5",
                        children: analyticsError || "Gabungan sesi PPPoE dan Hotspot aktif",
                      }),
                    ],
                  }),
                  e.jsx("span", {
                    className:
                      "text-[10px] bg-emerald-50 text-emerald-600 font-bold border border-emerald-150 rounded px-2.5 py-0.5 font-mono",
                    children: analyticsError ? "Router Offline" : "Live RouterOS",
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "grid grid-cols-2 md:grid-cols-4 gap-3",
                children: [
                  e.jsxs("div", {
                    className: "p-3 bg-slate-50 rounded-lg text-center border",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[9px] uppercase font-bold text-slate-400 block tracking-wider",
                        children: "Total Traffic Sesi",
                      }),
                      e.jsx("strong", {
                        className:
                          "text-lg font-display font-extrabold text-slate-800",
                        children: formatBytes(usage.total_bytes),
                      }),
                      e.jsx("p", {
                        className: "text-[8px] text-slate-400 mt-0.5",
                        children: "Counter sesi aktif",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "p-3 bg-slate-50 rounded-lg text-center border",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[9px] uppercase font-bold text-slate-400 block tracking-wider",
                        children: "Download",
                      }),
                      e.jsx("strong", {
                        className:
                          "text-lg font-display font-extrabold text-rose-600",
                        children: formatBytes(usage.download_bytes),
                      }),
                      e.jsx("p", {
                        className: "text-[8px] text-rose-500 mt-0.5",
                        children: "RouterOS bytes-out",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "p-3 bg-slate-50 rounded-lg text-center border",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[9px] uppercase font-bold text-slate-400 block tracking-wider",
                        children: "Upload",
                      }),
                      e.jsx("strong", {
                        className:
                          "text-lg font-display font-extrabold text-slate-800",
                        children: formatBytes(usage.upload_bytes),
                      }),
                      e.jsx("p", {
                        className: "text-[8px] text-emerald-500 mt-0.5",
                        children: "RouterOS bytes-in",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "p-3 bg-slate-50 rounded-lg text-center border",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[9px] uppercase font-bold text-slate-400 block tracking-wider",
                        children: "Sesi Online",
                      }),
                      e.jsx("strong", {
                        className:
                          "text-lg font-display font-extrabold text-slate-800",
                        children: String(usage.active_sessions || 0),
                      }),
                      e.jsx("p", {
                        className: "text-[8px] text-slate-400 mt-0.5",
                        children: "PPPoE + Hotspot",
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "space-y-2.5",
                children: [
                  e.jsx("span", {
                    className:
                      "text-[11px] font-bold text-slate-400 uppercase tracking-widest block",
                    children: "Pemakaian Teratas per Sesi",
                  }),
                  e.jsxs("div", {
                    className:
                      "border rounded-lg overflow-hidden divide-y text-xs text-slate-700",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-2 bg-slate-50 font-bold grid grid-cols-3 gap-2 text-slate-500",
                        children: [
                          e.jsx("span", { children: "Username" }),
                          e.jsx("span", { children: "Total Pemakaian" }),
                          e.jsx("span", { children: "IP / Status" }),
                        ],
                      }),
                      S.length ? S.map((b, V) =>
                        e.jsxs(
                          "div",
                          {
                            className:
                              "p-2.5 grid grid-cols-3 gap-2 items-center font-mono hover:bg-slate-50 transition-colors",
                            children: [
                              e.jsx("span", {
                                className: "font-sans font-bold text-slate-700",
                                children: b.type,
                              }),
                              e.jsx("span", {
                                className: "font-extrabold text-slate-800",
                                children: b.count,
                              }),
                              e.jsx("span", {
                                className: `text-[10px] font-bold ${b.color}`,
                                children: b.severity,
                              }),
                            ],
                          },
                          V,
                        ),
                      ) : e.jsx("div", { className: "p-6 text-center text-slate-400", children: analyticsError || "Belum ada sesi aktif." }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
            children: [
              e.jsxs("div", {
                children: [
                  e.jsx("h3", {
                    className: "text-sm font-extrabold text-slate-800",
                    children: "Kategori Traffic L7 / NetFlow",
                  }),
                  e.jsx("p", {
                    className: "text-[10px] text-slate-400",
                    children: "Hanya tampil bila kolektor NetFlow/L7 dikonfigurasi",
                  }),
                ],
              }),
              e.jsx("div", {
                className: "space-y-4",
                children: J.length ? J.map((b, V) =>
                  e.jsxs(
                    "div",
                    {
                      className: "space-y-1.5 text-xs text-slate-750",
                      children: [
                        e.jsxs("div", {
                          className:
                            "flex justify-between items-center font-medium",
                          children: [
                            e.jsx("span", { children: b.title }),
                            e.jsxs("span", {
                              className: "font-bold flex items-center gap-1.5",
                              children: [
                                e.jsx("strong", { children: b.percentage }),
                                e.jsxs("span", {
                                  className:
                                    "text-[10px] text-slate-450 font-mono",
                                  children: ["(", b.volume, ")"],
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsx("div", {
                          className:
                            "w-full bg-slate-100 h-2 rounded-full overflow-hidden",
                          children: e.jsx("div", {
                            className: `h-full ${b.color}`,
                            style: { width: b.percentage },
                          }),
                        }),
                      ],
                    },
                    V,
                  ),
                ) : e.jsx("div", { className: "p-6 text-center text-xs text-slate-400 border border-dashed rounded-lg", children: "Data kategori belum tersedia dari RouterOS. Aktifkan dan hubungkan kolektor NetFlow/Traffic Flow untuk klasifikasi aplikasi." }),
              }),
              e.jsx("div", {
                className:
                  "pt-2 border-t text-[10px] text-slate-450 leading-relaxed font-light",
                children:
                  "Tidak ada estimasi atau data demo. Nilai hanya ditampilkan setelah sumber telemetry nyata tersedia.",
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function Lg({ activeRole: w }) {
  // MIKROBIL_LG_PROFILE_STATES
  const [profileName, setProfileName] = f.useState("");
  const [profileEmail, setProfileEmail] = f.useState("");
  const [profilePass, setProfilePass] = f.useState("");
  const [profileLoading, setProfileLoading] = f.useState(!1);
  const [profileAlert, setProfileAlert] = f.useState(null);

  f.useEffect(() => {
    if (window.currentUserSession && window.currentUserSession.user) {
      setProfileName(window.currentUserSession.user.name || "");
      setProfileEmail(window.currentUserSession.user.email || "");
      setProfilePass(window.currentUserSession.user.password || "");
    }
  }, []);

  const saveSaaSProfile = async (ev) => {
    ev.preventDefault();
    if (!profileName.trim() || !profileEmail.trim()) {
      setProfileAlert({ type: "error", message: "Kolom Nama dan Email wajib diisi." });
      return;
    }
    setProfileLoading(!0);
    setProfileAlert(null);
    try {
      const res = await (await fetch("/api/v1/user/profile", {
        method: "PUT",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          current_email: window.currentUserSession?.user?.email,
          name: profileName,
          email: profileEmail,
          password: profilePass
        })
      })).json();
      if (res.status === "success") {
        setProfileAlert({ type: "success", message: "Profil Anda berhasil diperbarui!" });
        if (window.currentUserSession && window.currentUserSession.user) {
          window.currentUserSession.user = res.data.user;
        }
      } else {
        setProfileAlert({ type: "error", message: res.message || "Gagal memperbarui profil." });
      }
    } catch (e) {
      setProfileAlert({ type: "error", message: "Terjadi gangguan koneksi internet." });
    } finally {
      setProfileLoading(!1);
    }
  };

const [J, S] = f.useState(window.currentUserSession?.tenant?.company_name || window.currentUserSession?.tenant?.name || "PT Jaya Solusi Network"),
    [b, V] = f.useState(window.currentUserSession?.tenant?.phone || "+62812345678"),
    [ue, re] = f.useState(window.currentUserSession?.tenant?.address || "Jakarta Selatan, Blok M Node Central"),
    [ee, B] = f.useState(window.currentUserSession?.tenant?.subscription_plan_id === 1 ? (window.currentUserSession?.tenant?.status === "trial" ? "Starter Plan (Uji Coba / Trial)" : "Starter Plan") : window.currentUserSession?.tenant?.subscription_plan_id === 3 ? "Enterprise Plan" : "Pro Plan"),
    [showUpgradeModal, setShowUpgradeModal] = f.useState(!1),
    [T, fe] = f.useState([]),
    [G, F] = f.useState(!1),
    [ce, ve] = f.useState(""),
    [Y, Ee] = f.useState(""),
    [Se, le] = f.useState(""),
    [ie, $] = f.useState(""),
    [de, oe] = f.useState(""),
    [be, Ye] = f.useState("3"),
    [Te, Ie] = f.useState(""),
    me = async () => {
      (F(!0), ve(""));
      try {
        const pt = await (
          await fetch("/api/v1/tenant/users?tenantId=1")
        ).json();
        pt.status === "success"
          ? fe(pt.data)
          : ve(pt.message || "Gagal mengambil data staf.");
      } catch {
        ve("Terjadi hambatan koneksi ke server.");
      } finally {
        F(!1);
      }
    },
    Oe = async (xe) => {
      if (
        (xe.preventDefault(),
        ve(""),
        Ee(""),
        !Se.trim() || !ie.trim() || !Te.trim())
      ) {
        ve("Silakan lengkapi seluruh field wajib.");
        return;
      }
      try {
        const Xt = await (
          await fetch("/api/v1/tenant/users", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({
              tenant_id: 1,
              role_id: Number(be),
              name: Se,
              email: ie,
              phone: de,
              password: Te,
            }),
          })
        ).json();
        Xt.status === "success"
          ? (Ee("Sub-akun staf baru berhasil didaftarkan secara aman!"),
            le(""),
            $(""),
            oe(""),
            Ie(""),
            me())
          : ve(Xt.message || "Gagal mendaftarkan staf baru.");
      } catch {
        ve("Terjadi hambatan koneksi saat mendaftarkan staf.");
      }
    },
    te = async (xe, pt) => {
      if (
        window.confirm(`Hapus sub-akun staf "${pt}"? Tindakan ini permanen.`)
      ) {
        (ve(""), Ee(""));
        try {
          const Pt = await (
            await fetch(`/api/v1/tenant/users/${xe}`, { method: "DELETE" })
          ).json();
          Pt.status === "success"
            ? (Ee(`Sub-akun "${pt}" berhasil dihapus.`), me())
            : ve(Pt.message || "Gagal menghapus sub-akun.");
        } catch {
          ve("Terjadi kendala koneksi.");
        }
      }
    };
  f.useEffect(() => {
    me();
  }, []);
  const Ae = (xe) => {
      switch (xe) {
        case 1:
          return {
            name: "SaaS Admin (Pusat)",
            bg: "bg-purple-50 text-purple-600 border-purple-200",
          };
        case 2:
          return {
            name: "Owner / Pemilik",
            bg: "bg-blue-50 text-blue-600 border-blue-200",
          };
        case 3:
          return {
            name: "Admin Utama",
            bg: "bg-emerald-50 text-emerald-600 border-emerald-250",
          };
        case 4:
          return {
            name: "Finance / Keuangan",
            bg: "bg-amber-50 text-amber-700 border-amber-200",
          };
        case 5:
          return {
            name: "NOC Monitor",
            bg: "bg-rose-50 text-rose-600 border-rose-200",
          };
        case 6:
          return {
            name: "Teknisi Lapangan",
            bg: "bg-slate-100 text-slate-700 border-slate-200",
          };
        default:
          return {
            name: "Staf",
            bg: "bg-slate-50 text-slate-600 border-slate-200",
          };
      }
    },
    [Ue, y] = f.useState("midtrans"),
    [K, O] = f.useState("sandbox"),
    [P, z] = f.useState(!1),
    [g, C] = f.useState(""),
    [I, X] = f.useState(""),
    [pe, he] = f.useState(""),
    [Ne, $e] = f.useState(""),
    [ae, ze] = f.useState(""),
    [at, bt] = f.useState(""),
    [Mt, ge] = f.useState(""),
    [Me, mt] = f.useState(""),
    [st, Z] = f.useState({
      qris: !0,
      va_bca: !0,
      va_mandiri: !0,
      va_bni: !0,
      va_bri: !0,
      retail_alfamart: !1,
      retail_indomaret: !1,
    }),
    [_e, Ze] = f.useState({
      qris: 0.7,
      virtualAccount: 4e3,
      retailOutlet: 5e3,
    }),
    [Xe, Ht] = f.useState(!0),
    [St, E] = f.useState("JYN"),
    [Re, qe] = f.useState(!0),
    [Fe, fa] = f.useState(!1),
    [Aa, ps] = f.useState(!1),
    [ra, es] = f.useState(null),
    [Ft, Tt] = f.useState(null),
    oa = async () => {
      var xe, pt, Xt, Pt, Ya, Xa, an, ws;
      try {
        qe(!0);
        const Na = await (
          await fetch("/api/v1/settings/payment-gateway")
        ).json();
        if (Na.status === "success" && Na.data) {
          const $t = Na.data;
          (y($t.activeGateway || "midtrans"),
            O($t.environment || "sandbox"),
            C(((xe = $t.midtrans) == null ? void 0 : xe.clientKey) || ""),
            X(((pt = $t.midtrans) == null ? void 0 : pt.serverKey) || ""),
            he(((Xt = $t.midtrans) == null ? void 0 : Xt.merchantId) || ""),
            $e(((Pt = $t.xendit) == null ? void 0 : Pt.secretKey) || ""),
            ze(
              ((Ya = $t.xendit) == null ? void 0 : Ya.verificationToken) || "",
            ),
            bt(((Xa = $t.tripay) == null ? void 0 : Xa.apiKey) || ""),
            ge(((an = $t.tripay) == null ? void 0 : an.privateKey) || ""),
            mt(((ws = $t.tripay) == null ? void 0 : ws.merchantCode) || ""),
            $t.channels && Z($t.channels),
            $t.fees && Ze($t.fees),
            Ht($t.autoSyncInvoiceStatus !== !1),
            E($t.invoicePrefix || "JYN"));
        }
      } catch (ks) {
        console.error("Gagal memuat setting payment gateway:", ks);
      } finally {
        qe(!1);
      }
    };
  f.useEffect(() => {
    oa();
  }, []);
  const Zt = async (xe) => {
      xe.preventDefault();
      try {
        (fa(!0),
          Tt(null),
          (
            await (
              await fetch("/api/v1/settings/payment-gateway", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({
                  activeGateway: Ue,
                  environment: K,
                  midtrans: { clientKey: g, serverKey: I, merchantId: pe },
                  xendit: { secretKey: Ne, verificationToken: ae },
                  tripay: { apiKey: at, privateKey: Mt, merchantCode: Me },
                  channels: st,
                  fees: _e,
                  autoSyncInvoiceStatus: Xe,
                  invoicePrefix: St,
                }),
              })
            ).json()
          ).status === "success"
            ? (Tt("success"), setTimeout(() => Tt(null), 3500))
            : Tt("error"));
      } catch {
        Tt("error");
      } finally {
        fa(!1);
      }
    },
    ts = async () => {
      try {
        (ps(!0), es(null));
        const Xt = await (
          await fetch("/api/v1/settings/payment-gateway/test", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ gateway: Ue, environment: K }),
          })
        ).json();
        Xt.status === "success"
          ? es(Xt.data)
          : es({
              status: "FAILED",
              message:
                "Koneksi gagal terjalin. Mohon pastikan API Key sudah sesuai.",
            });
      } catch {
        es({
          status: "FAILED",
          message: "Network Error: Timeout menghubungi server payment gateway.",
        });
      } finally {
        ps(!1);
      }
    },
    ja = (xe) => {
      Z((pt) => ({ ...pt, [xe]: !pt[xe] }));
    },
    _s = [
      {
        module: "Dashboard NOC & Live Graphs",
        owner: !0,
        admin: !0,
        finance: !0,
        noc: !0,
        tech: !0,
        customer: !1,
      },
      {
        module: "Customer CRM (Read-Only)",
        owner: !0,
        admin: !0,
        finance: !0,
        noc: !0,
        tech: !0,
        customer: !1,
      },
      {
        module: "Customer CRM (Write-Create)",
        owner: !0,
        admin: !0,
        finance: !1,
        noc: !1,
        tech: !1,
        customer: !1,
      },
      {
        module: "Billing & Invoices Runs",
        owner: !0,
        admin: !0,
        finance: !0,
        noc: !1,
        tech: !1,
        customer: !1,
      },
      {
        module: "PPPoE & Hotspot Operations",
        owner: !0,
        admin: !0,
        finance: !1,
        noc: !0,
        tech: !0,
        customer: !1,
      },
      {
        module: "Server Router Setup & Sync",
        owner: !0,
        admin: !0,
        finance: !1,
        noc: !0,
        tech: !1,
        customer: !1,
      },
      {
        module: "Support Tiket WO & Penugasan",
        owner: !0,
        admin: !0,
        finance: !1,
        noc: !1,
        tech: !0,
        customer: !1,
      },
      {
        module: "Tenant RBAC Settings & Gateway",
        owner: !0,
        admin: !1,
        finance: !1,
        noc: !1,
        tech: !1,
        customer: !1,
      },
    ];
  return e.jsxs("div", {
    className:
      "space-y-6 max-w-7xl mx-auto w-full font-sans select-none pb-16 px-2 md:px-0",
    children: [
      e.jsxs("div", {
        className:
          "flex flex-col md:flex-row md:items-center justify-between gap-4",
        children: [
          e.jsxs("div", {
            children: [
              e.jsxs("h1", {
                className:
                  "text-xl font-display font-black text-slate-900 tracking-tight flex items-center gap-2",
                children: [
                  e.jsx(mu, { className: "h-6 w-6 text-blue-600" }),
                  e.jsx("span", {
                    children: "Pengaturan Cabang & Payment Gateway",
                  }),
                ],
              }),
              e.jsx("p", {
                className:
                  "text-xs text-slate-500 font-normal mt-0.5 font-sans",
                children:
                  "Konfigurasi profil legal ISP, aktifkan webhook payment gateway (Midtrans, Xendit, TriPay) serta kelola tabel matriks RBAC staf.",
              }),
            ],
          }),
          e.jsxs("span", {
            className:
              "self-start md:self-auto inline-flex items-center gap-1 bg-blue-50 text-blue-600 border border-blue-150 px-2.5 py-1 rounded-full text-[10px] font-bold font-mono",
            children: [
              e.jsx(Fr, { className: "h-3.5 w-3.5" }),
              e.jsx("span", { children: "Android App View Compatible" }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 space-y-6",
            children: [
              e.jsxs("div", {
                className: "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className: "border-b pb-2 flex items-center gap-2",
                    children: [
                      e.jsx(Lp, { className: "h-4.5 w-4.5 text-blue-600 shrink-0" }),
                      e.jsx("h3", {
                        className: "text-xs font-bold uppercase tracking-wider text-slate-800",
                        children: "Akun Saya (Profil, Email & Kata Sandi)"
                      })
                    ]
                  }),
                  profileAlert && e.jsxs("div", {
                    className: `p-3 rounded-lg border text-xs font-semibold flex items-center justify-between ${profileAlert.type === "success" ? "bg-green-50 border-green-200 text-green-800" : "bg-rose-50 border-rose-200 text-rose-800"}`,
                    children: [
                      e.jsx("span", { children: profileAlert.message }),
                      e.jsx("button", {
                        onClick: () => setProfileAlert(null),
                        className: "text-slate-400 hover:text-slate-600 font-bold px-1.5",
                        children: "×"
                      })
                    ]
                  }),
                  e.jsxs("form", {
                    onSubmit: saveSaaSProfile,
                    className: "space-y-3",
                    children: [
                      e.jsxs("div", {
                        className: "grid grid-cols-1 sm:grid-cols-2 gap-3.5",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", { className: "text-[10px] font-bold text-slate-500 uppercase font-mono", children: "Nama Lengkap" }),
                              e.jsx("input", {
                                type: "text",
                                value: profileName,
                                onChange: (t) => setProfileName(t.target.value),
                                className: "w-full border border-slate-200 rounded-lg p-2 text-xs outline-none focus:ring-2 focus:ring-blue-500/25",
                                placeholder: "Masukkan nama Anda"
                              })
                            ]
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", { className: "text-[10px] font-bold text-slate-500 uppercase font-mono", children: "Alamat Email" }),
                              e.jsx("input", {
                                type: "email",
                                value: profileEmail,
                                onChange: (t) => setProfileEmail(t.target.value),
                                className: "w-full border border-slate-200 rounded-lg p-2 text-xs outline-none focus:ring-2 focus:ring-blue-500/25",
                                placeholder: "nama@domain.com"
                              })
                            ]
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", { className: "text-[10px] font-bold text-slate-500 uppercase font-mono", children: "Kata Sandi Baru" }),
                          e.jsx("input", {
                            type: "text",
                            value: profilePass,
                            onChange: (t) => setProfilePass(t.target.value),
                            className: "w-full border border-slate-200 rounded-lg p-2 text-xs outline-none focus:ring-2 focus:ring-blue-500/25 font-mono",
                            placeholder: "Isi kata sandi baru"
                          })
                        ]
                      }),
                      e.jsx("button", {
                        type: "submit",
                        disabled: profileLoading,
                        className: "w-full sm:w-auto px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-bold transition-all shadow-sm cursor-pointer disabled:opacity-50",
                        children: profileLoading ? "Menyimpan..." : "Simpan Perubahan Akun"
                      })
                    ]
                  })
                ]
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className: "border-b pb-2 flex items-center gap-2",
                    children: [
                      e.jsx(Lp, {
                        className: "h-4.5 w-4.5 text-blue-600 shrink-0",
                      }),
                      e.jsx("h3", {
                        className:
                          "text-xs font-bold uppercase tracking-wider text-slate-800",
                        children: "Profil Usaha ISP & WhatsApp Center",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-3.5 text-xs text-slate-700 font-sans",
                    children: [
                      e.jsxs("div", {
                        className: "grid grid-cols-1 sm:grid-cols-2 gap-3.5",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className: "font-bold text-slate-500 block",
                                children: "Nama Perusahaan (Tenant ID #" + String(window.currentUserSession?.tenant?.id || 1).padStart(4, "0") + ")",
                              }),
                              e.jsx("input", {
                                type: "text",
                                value: J,
                                onChange: (xe) => S(xe.target.value),
                                className:
                                  "w-full p-2 bg-slate-55 border border-slate-200 rounded-lg outline-none font-sans focus:border-blue-500 transition-colors",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className: "font-bold text-slate-500 block",
                                children: "Kontak WhatsApp Notifikasi Billing",
                              }),
                              e.jsx("input", {
                                type: "text",
                                value: b,
                                onChange: (xe) => V(xe.target.value),
                                className:
                                  "w-full p-2 bg-slate-55 border border-slate-200 rounded-lg outline-none font-mono focus:border-blue-500 transition-colors",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-500 block",
                            children: "Alamat Central Core Head Office",
                          }),
                          e.jsx("textarea", {
                            rows: 2,
                            value: ue,
                            onChange: (xe) => re(xe.target.value),
                            className:
                              "w-full p-2 bg-slate-55 border border-slate-200 rounded-lg resize-none outline-none font-sans focus:border-blue-500 transition-colors",
                          }),
                        ],
                      }),
                      w !== "Owner"
                        ? e.jsxs("div", {
                            className:
                              "p-2.5 bg-slate-100 text-slate-500 text-[11px] rounded leading-relaxed border font-light",
                            children: [
                              "⚠️ Anda saat ini masuk sebagai role ",
                              e.jsx("strong", { children: w }),
                              ". Mengubah profile billing usaha memerlukan akses role ",
                              e.jsx("strong", {
                                children: "Owner / Administrator Utama",
                              }),
                              ".",
                            ],
                          })
                        : e.jsx("button", {
                            onClick: () =>
                              alert(
                                "Profil perusahaan berhasil diperbarui secara persist!",
                              ),
                            className:
                              "px-4 py-2 bg-blue-600 text-white font-bold rounded-lg text-xs shadow-md shadow-blue-500/10 cursor-pointer hover:bg-blue-500 transition-all active:scale-[0.98] w-full sm:w-auto",
                            children: "Simpan Perubahan Profil",
                          }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b pb-2 flex items-center justify-between",
                    children: [
                      e.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          e.jsx(sr, {
                            className: "h-4.5 w-4.5 text-emerald-600 shrink-0",
                          }),
                          e.jsx("h3", {
                            className:
                              "text-xs font-bold uppercase tracking-wider text-slate-800",
                            children:
                              "Gerbang Pembayaran Otomatis (Payment Gateway)",
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[9px] font-black uppercase px-2 py-0.5 rounded-full bg-emerald-50 text-emerald-600 border border-emerald-200 select-none",
                        children: "WEBHOOK RECOVERY ACTIVE",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[11.5px] text-slate-500 leading-relaxed font-sans",
                    children: [
                      "Hubungkan akun Payment Gateway Indonesia untuk mengaktifkan sistem tagihan otomatis. Pelanggan dapat membayar via ",
                      e.jsx("strong", {
                        children: "QRIS, Alfamart, Indomaret, & Bank Transfer",
                      }),
                      ". Pembayaran yang lunas akan ",
                      e.jsx("strong", {
                        children:
                          "mengaktifkan kembali isolir Router PPPoE secara real-time otomatis",
                      }),
                      "!",
                    ],
                  }),
                  e.jsxs("form", {
                    onSubmit: Zt,
                    className: "space-y-4 font-sans text-xs",
                    children: [
                      e.jsxs("div", {
                        className: "grid grid-cols-1 sm:grid-cols-2 gap-3.5",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "font-bold text-slate-400 block uppercase tracking-wider text-[9px]",
                                children: "PROVIDER UTAMA YANG DIGUNAKAN",
                              }),
                              e.jsxs("select", {
                                value: Ue,
                                onChange: (xe) => {
                                  (y(xe.target.value), es(null));
                                },
                                className:
                                  "w-full p-2.5 bg-slate-50 border border-slate-200 rounded-lg font-bold text-slate-700 outline-none cursor-pointer focus:border-blue-500 focus:bg-white transition-all text-xs",
                                children: [
                                  e.jsx("option", {
                                    value: "midtrans",
                                    children: "🇲🇩 Midtrans (PT Midtrans Jkt)",
                                  }),
                                  e.jsx("option", {
                                    value: "xendit",
                                    children: "🇽🇳 Xendit Payment Gateway",
                                  }),
                                  e.jsx("option", {
                                    value: "tripay",
                                    children: "🇹🇵 TriPay Indonesia API",
                                  }),
                                  e.jsx("option", {
                                    value: "manual",
                                    children:
                                      "🏦 Transfer Bank Manual (Konfirmasi Operator)",
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "font-bold text-slate-400 block uppercase tracking-wider text-[9px]",
                                children: "MODE LINGKUNGAN API (ENVIRONMENT)",
                              }),
                              e.jsxs("div", {
                                className: "grid grid-cols-2 gap-2",
                                children: [
                                  e.jsx("button", {
                                    type: "button",
                                    onClick: () => O("sandbox"),
                                    className: `p-2.5 rounded-lg border text-xs font-bold transition-all cursor-pointer ${K === "sandbox" ? "bg-amber-50 text-amber-700 border-amber-300 font-extrabold" : "bg-slate-50 text-slate-500 hover:bg-slate-100 border-slate-200"}`,
                                    children: "🧪 Sandbox (Trial)",
                                  }),
                                  e.jsx("button", {
                                    type: "button",
                                    disabled: w !== "Owner",
                                    onClick: () => O("production"),
                                    className: `p-2.5 rounded-lg border text-xs font-bold transition-all cursor-pointer ${K === "production" ? "bg-slate-900 text-emerald-400 border-slate-950 font-extrabold" : "bg-slate-50 text-slate-500 hover:bg-slate-100 border-slate-200 disabled:opacity-50"}`,
                                    children: "⚡ Production (Live)",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                      Ue === "manual"
                        ? e.jsxs("div", {
                            className:
                              "p-3 bg-blue-50/50 border border-blue-150 rounded-xl space-y-2",
                            children: [
                              e.jsxs("h4", {
                                className:
                                  "font-bold text-blue-900 text-xs flex items-center gap-1.5",
                                children: [
                                  e.jsx(x0, {
                                    className: "h-4 w-4 text-blue-600",
                                  }),
                                  e.jsx("span", {
                                    children: "Mode Transfer Bank Manual Aktif",
                                  }),
                                ],
                              }),
                              e.jsxs("p", {
                                className:
                                  "text-[11px] text-slate-550 leading-relaxed",
                                children: [
                                  "Sistem otomatisasi penagihan akan tetap berjalan, namun pelanggan harus mengunggah bukti transfer manual melalui ",
                                  e.jsx("strong", {
                                    children: "Portal Pelanggan",
                                  }),
                                  ". Staf Finance atau Admin harus menyetujui invoice secara manual melalui menu ",
                                  e.jsx("b", { children: "Billing & Invoice" }),
                                  " untuk membuka isolis port internet router mikrotik pelanggan.",
                                ],
                              }),
                            ],
                          })
                        : e.jsxs("div", {
                            className:
                              "p-3.5 bg-slate-50 border border-slate-150 rounded-xl space-y-3 relative",
                            children: [
                              e.jsxs("div", {
                                className:
                                  "flex items-center justify-between border-b border-slate-200 pb-1.5",
                                children: [
                                  e.jsxs("h4", {
                                    className:
                                      "font-bold text-slate-700 text-[10px] uppercase tracking-widest flex items-center gap-1",
                                    children: [
                                      e.jsx(xc, {
                                        className: "h-3.5 w-3.5 text-blue-550",
                                      }),
                                      e.jsxs("span", {
                                        children: [
                                          "Parameter Kredensial ",
                                          Ue.toUpperCase(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  e.jsx("button", {
                                    type: "button",
                                    onClick: () => z(!P),
                                    className:
                                      "text-[10px] text-slate-550 hover:text-slate-800 flex items-center gap-1 font-semibold",
                                    children: P
                                      ? e.jsxs(e.Fragment, {
                                          children: [
                                            e.jsx(i0, { className: "h-3 w-3" }),
                                            e.jsx("span", {
                                              children: "Sembunyikan Key",
                                            }),
                                          ],
                                        })
                                      : e.jsxs(e.Fragment, {
                                          children: [
                                            e.jsx(r0, { className: "h-3 w-3" }),
                                            e.jsx("span", {
                                              children: "Tampilkan Key",
                                            }),
                                          ],
                                        }),
                                  }),
                                ],
                              }),
                              Ue === "midtrans" &&
                                e.jsxs("div", {
                                  className:
                                    "grid grid-cols-1 sm:grid-cols-3 gap-3",
                                  children: [
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Merchant ID",
                                        }),
                                        e.jsx("input", {
                                          type: "text",
                                          required: !0,
                                          value: pe,
                                          onChange: (xe) => he(xe.target.value),
                                          placeholder: "M1038294",
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Client Key",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: g,
                                          onChange: (xe) => C(xe.target.value),
                                          placeholder: "SB-Mid-client-...",
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Server Key",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: I,
                                          onChange: (xe) => X(xe.target.value),
                                          placeholder: "SB-Mid-server-...",
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              Ue === "xendit" &&
                                e.jsxs("div", {
                                  className:
                                    "grid grid-cols-1 sm:grid-cols-2 gap-3",
                                  children: [
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Secret API Key (Xnd_)",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: Ne,
                                          placeholder: "xnd_development_...",
                                          onChange: (xe) => $e(xe.target.value),
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Token Verifikasi Webhook",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: ae,
                                          placeholder: "vrt_tok_abc...",
                                          onChange: (xe) => ze(xe.target.value),
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              Ue === "tripay" &&
                                e.jsxs("div", {
                                  className:
                                    "grid grid-cols-1 sm:grid-cols-3 gap-3",
                                  children: [
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Merchant Code",
                                        }),
                                        e.jsx("input", {
                                          type: "text",
                                          required: !0,
                                          value: Me,
                                          placeholder: "T10382",
                                          onChange: (xe) => mt(xe.target.value),
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "API Key",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: at,
                                          placeholder: "TP-api-key-...",
                                          onChange: (xe) => bt(xe.target.value),
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                    e.jsxs("div", {
                                      className: "space-y-1",
                                      children: [
                                        e.jsx("label", {
                                          className:
                                            "text-[9px] font-bold text-slate-400 block uppercase",
                                          children: "Private Key",
                                        }),
                                        e.jsx("input", {
                                          type: P ? "text" : "password",
                                          required: !0,
                                          value: Mt,
                                          placeholder: "TP-private-key-...",
                                          onChange: (xe) => ge(xe.target.value),
                                          className:
                                            "w-full p-2 bg-white border border-slate-200 rounded outline-none font-mono text-xs focus:border-blue-500",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              e.jsxs("div", {
                                className:
                                  "pt-1.5 flex flex-wrap items-center justify-between gap-3",
                                children: [
                                  e.jsxs("p", {
                                    className:
                                      "text-[10px] text-slate-450 leading-relaxed max-w-md",
                                    children: [
                                      "⚠️ Webhook URL Anda di server partner wajib mengarah ke: ",
                                      e.jsx("code", {
                                        className:
                                          "bg-slate-200 text-slate-700 px-1 py-0.5 rounded text-[9.5px]",
                                        children:
                                          "https://jayanet.com/api/v1/payments/webhook",
                                      }),
                                    ],
                                  }),
                                  e.jsxs("button", {
                                    type: "button",
                                    disabled: Aa,
                                    onClick: ts,
                                    className:
                                      "px-3 py-1.5 bg-slate-900 hover:bg-slate-800 text-slate-300 hover:text-white rounded text-[10px] font-bold flex items-center gap-1.5 transition-all cursor-pointer active:scale-95 shrink-0",
                                    children: [
                                      e.jsx(eo, {
                                        className: `h-3 w-3 text-emerald-500 ${Aa ? "animate-spin" : ""}`,
                                      }),
                                      e.jsx("span", {
                                        children: Aa
                                          ? "Menguji Koneksi..."
                                          : "Uji Kredensial API",
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                              ra &&
                                e.jsxs("div", {
                                  className:
                                    "mt-2 p-2.5 rounded-lg border text-[11px] font-sans transition-all flex items-start gap-2 bg-emerald-50 border-emerald-250 text-emerald-800",
                                  children: [
                                    e.jsx(tn, {
                                      className:
                                        "h-4.5 w-4.5 text-emerald-600 shrink-0 mt-0.5",
                                    }),
                                    e.jsxs("div", {
                                      children: [
                                        e.jsxs("div", {
                                          className:
                                            "font-bold flex items-center gap-2",
                                          children: [
                                            e.jsx("span", {
                                              children: ra.status,
                                            }),
                                            ra.latency_ms &&
                                              e.jsxs("span", {
                                                className:
                                                  "font-mono bg-emerald-200/50 px-1 rounded",
                                                children: [
                                                  ra.latency_ms,
                                                  " ms Latency",
                                                ],
                                              }),
                                          ],
                                        }),
                                        ra.client_name &&
                                          e.jsxs("div", {
                                            className:
                                              "text-[9.5px] text-emerald-700 mt-0.5",
                                            children: [
                                              e.jsx("b", {
                                                children: "Merchant Terdaftar:",
                                              }),
                                              " ",
                                              ra.client_name,
                                            ],
                                          }),
                                        e.jsx("p", {
                                          className:
                                            "text-[10px] text-emerald-700 mt-1 leading-normal",
                                          children: ra.message,
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                            ],
                          }),
                      e.jsxs("div", {
                        className: "space-y-2",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[10px] font-bold text-slate-400 block uppercase tracking-wider select-none",
                            children:
                              "METODE PEMBAYARAN KLIEN YANG INGIN DIAKTIFKAN",
                          }),
                          e.jsxs("div", {
                            className:
                              "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2",
                            children: [
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("qris"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.qris ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "📷 QRIS Gopay/OVO/Shopee",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Potongan: ",
                                          _e.qris,
                                          "% per transaksi",
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.qris
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("va_bca"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.va_bca ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "💳 Virtual Account BCA",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Biaya: Rp ",
                                          _e.virtualAccount.toLocaleString(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.va_bca
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("va_mandiri"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.va_mandiri ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "💳 Virtual Account Mandiri",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Biaya: Rp ",
                                          _e.virtualAccount.toLocaleString(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.va_mandiri
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("va_bri"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.va_bri ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "💳 Virtual Account BRI",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Biaya: Rp ",
                                          _e.virtualAccount.toLocaleString(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.va_bri
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("retail_alfamart"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.retail_alfamart ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "🏪 Alfamart Mart Outlet",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Biaya: Rp ",
                                          _e.retailOutlet.toLocaleString(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.retail_alfamart
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                              e.jsxs("button", {
                                type: "button",
                                onClick: () => ja("retail_indomaret"),
                                className: `p-2.5 rounded-xl border flex items-center justify-between gap-2.5 transition-all text-left cursor-pointer active:scale-95 ${st.retail_indomaret ? "bg-emerald-50 border-emerald-300 text-slate-800" : "bg-white border-slate-200 text-slate-400 hover:bg-slate-50"}`,
                                children: [
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("h5", {
                                        className:
                                          "font-bold text-xs select-none",
                                        children: "🏪 Indomaret Minimarket",
                                      }),
                                      e.jsxs("span", {
                                        className:
                                          "text-[9px] text-slate-500 block",
                                        children: [
                                          "Biaya: Rp ",
                                          _e.retailOutlet.toLocaleString(),
                                        ],
                                      }),
                                    ],
                                  }),
                                  st.retail_indomaret
                                    ? e.jsx(er, {
                                        className:
                                          "h-5 w-5 text-emerald-600 shrink-0",
                                      })
                                    : e.jsx(tr, {
                                        className:
                                          "h-5 w-5 text-slate-300 shrink-0",
                                      }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "grid grid-cols-1 sm:grid-cols-2 gap-3.5 pt-1.5 border-t border-slate-100",
                        children: [
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[9px] font-bold text-slate-400 block uppercase",
                                children: "PREFIX KODE INVOICE UNGGULAN",
                              }),
                              e.jsx("input", {
                                type: "text",
                                value: St,
                                onChange: (xe) => E(xe.target.value),
                                placeholder: "JYN",
                                className:
                                  "p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none font-bold font-mono text-slate-700 focus:border-blue-500 w-1/2",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "flex items-center gap-2.5 self-center select-none cursor-pointer mt-3 sm:mt-0",
                            onClick: () => Ht(!Xe),
                            children: [
                              e.jsx("input", {
                                type: "checkbox",
                                checked: Xe,
                                onChange: () => {},
                                className:
                                  "h-4.5 w-4.5 text-blue-600 border-slate-300 rounded cursor-pointer",
                              }),
                              e.jsxs("div", {
                                className: "text-xs",
                                children: [
                                  e.jsx("h5", {
                                    className:
                                      "text-[11px] font-bold text-slate-700",
                                    children: "Auto-Suspend Integration",
                                  }),
                                  e.jsx("p", {
                                    className:
                                      "text-[9.5px] text-slate-450 leading-none",
                                    children:
                                      "Otomatis suspens pelanggan telat bayar H+3 jatuh tempo.",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "pt-2 border-t border-slate-100 flex flex-wrap items-center justify-between gap-3",
                        children: [
                          e.jsx("span", {
                            className:
                              "text-[11px] text-slate-400 font-light leading-none",
                            children:
                              "Konfigurasi ini diaplikasikan langsung pada seluruh transaksi tenant.",
                          }),
                          e.jsxs("div", {
                            className: "flex items-center gap-2.5",
                            children: [
                              Ft === "success" &&
                                e.jsx("span", {
                                  className:
                                    "text-[10.5px] bg-emerald-50 text-emerald-600 border border-emerald-250 font-bold px-3 py-1.5 rounded-lg",
                                  children:
                                    "🟢 Konfigurasi disimpan & sinkron!",
                                }),
                              Ft === "error" &&
                                e.jsx("span", {
                                  className:
                                    "text-[10.5px] bg-rose-50 text-rose-600 border border-rose-200 font-bold px-3 py-1.5 rounded-lg",
                                  children: "🔴 Gagal menyimpan data.",
                                }),
                              e.jsx("button", {
                                type: "submit",
                                disabled:
                                  Fe || (w !== "Owner" && w !== "Super Admin"),
                                className:
                                  "px-5 py-2.5 bg-blue-600 disabled:bg-slate-300 text-white font-extrabold rounded-xl shadow-lg shadow-blue-500/10 cursor-pointer hover:bg-blue-500 transition-all active:scale-95 text-xs text-center flex items-center justify-center gap-2 leading-none shrink-0",
                                children: Fe
                                  ? "Sinkronisasi..."
                                  : "Simpan Gateway & Saluran",
                              }),
                            ],
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className: "border-b pb-2 flex items-center gap-1.5",
                    children: [
                      e.jsx(Dp, {
                        className: "h-4.5 w-4.5 text-blue-600 shrink-0",
                      }),
                      e.jsx("h3", {
                        className:
                          "text-xs font-bold uppercase tracking-wider text-slate-800",
                        children:
                          "Tabel Matriks Akses RBAC (Role-Based Access Control)",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-[11px] text-slate-500 leading-relaxed font-light",
                    children: [
                      "Gunakan widget ",
                      e.jsx("strong", { children: "Simulator RBAC" }),
                      " di sisi kanan atas panel navbar untuk secara dinamis berganti peran demi menguji modul otentikasi menu secara live.",
                    ],
                  }),
                  e.jsx("div", {
                    className:
                      "border border-slate-200 rounded-xl overflow-x-auto select-none",
                    children: e.jsxs("table", {
                      className:
                        "w-full text-xs text-left text-slate-700 font-sans border-collapse",
                      children: [
                        e.jsx("thead", {
                          children: e.jsxs("tr", {
                            className:
                              "bg-slate-50 font-bold border-b border-slate-100 text-slate-550 text-[10.5px]",
                            children: [
                              e.jsx("th", {
                                className: "p-2.5",
                                children: "Menu / Fitur Aplikasi",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "Owner",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "Admin",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "Finance",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "NOC",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "Tech",
                              }),
                              e.jsx("th", {
                                className: "p-2.5 text-center",
                                children: "Client",
                              }),
                            ],
                          }),
                        }),
                        e.jsx("tbody", {
                          className:
                            "divide-y divide-slate-100 font-sans text-[11px]",
                          children: _s.map((xe, pt) =>
                            e.jsxs(
                              "tr",
                              {
                                className: "hover:bg-slate-50/50",
                                children: [
                                  e.jsx("td", {
                                    className: "p-2.5 font-bold text-slate-800",
                                    children: xe.module,
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.owner
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.admin
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.finance
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.noc
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.tech
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                  e.jsx("td", {
                                    className: "p-2.5 text-center",
                                    children: xe.customer
                                      ? e.jsx(ul, {
                                          className:
                                            "h-4 w-4 text-emerald-600 mx-auto font-black",
                                        })
                                      : "-",
                                  }),
                                ],
                              },
                              pt,
                            ),
                          ),
                        }),
                      ],
                    }),
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-5",
                id: "staff-management-section",
                children: [
                  e.jsxs("div", {
                    className:
                      "border-b pb-2 flex items-center justify-between",
                    children: [
                      e.jsxs("div", {
                        className: "flex items-center gap-2",
                        children: [
                          e.jsx(Jn, {
                            className: "h-5 w-5 text-blue-600 shrink-0",
                          }),
                          e.jsxs("div", {
                            children: [
                              e.jsx("h3", {
                                className:
                                  "text-xs font-bold uppercase tracking-wider text-slate-800",
                                children: "Kredensial & Sub-Akun Karyawan",
                              }),
                              e.jsx("p", {
                                className:
                                  "text-[10px] text-slate-400 font-light mt-0.5",
                                children:
                                  "Buat login khusus untuk Admin, NOC, Finance, & Teknisi",
                              }),
                            ],
                          }),
                        ],
                      }),
                      e.jsx("span", {
                        className:
                          "text-[10.5px] font-mono px-2 py-0.5 rounded bg-blue-50 text-blue-600 font-bold border border-blue-100",
                        children: "Keamanan Mandiri",
                      }),
                    ],
                  }),
                  ce &&
                    e.jsx("div", {
                      className:
                        "p-3 bg-red-50 border border-red-200 rounded-lg text-red-600 text-xs font-semibold",
                      children: ce,
                    }),
                  Y &&
                    e.jsx("div", {
                      className:
                        "p-3 bg-emerald-50 border border-emerald-200 rounded-lg text-emerald-600 text-xs font-semibold",
                      children: Y,
                    }),
                  e.jsxs("div", {
                    className: "grid grid-cols-1 md:grid-cols-12 gap-6",
                    children: [
                      e.jsxs("form", {
                        onSubmit: Oe,
                        className:
                          "md:col-span-5 space-y-3.5 bg-slate-50/50 p-4 rounded-xl border border-slate-100 text-left",
                        children: [
                          e.jsxs("h4", {
                            className:
                              "text-[11.5px] font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1",
                            children: [
                              e.jsx(zp, {
                                className: "h-3.5 w-3.5 text-blue-500",
                              }),
                              e.jsx("span", { children: "Daftar Sub-Akun" }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[10px] font-bold uppercase tracking-wider text-slate-500 block",
                                children: "Nama Lengkap*",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "Contoh: Ahmad Teknisi",
                                value: Se,
                                onChange: (xe) => le(xe.target.value),
                                className:
                                  "w-full text-xs p-2 bg-white border border-slate-200 rounded-lg focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none font-semibold text-slate-850",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[10px] font-bold uppercase tracking-wider text-slate-500 block",
                                children: "Email Login (ID)*",
                              }),
                              e.jsx("input", {
                                type: "email",
                                required: !0,
                                placeholder: "ahmad@jayanet.com",
                                value: ie,
                                onChange: (xe) => $(xe.target.value),
                                className:
                                  "w-full text-xs p-2 bg-white border border-slate-200 rounded-lg focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none font-mono text-slate-850",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1 block",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[10px] font-bold uppercase tracking-wider text-slate-500 block",
                                children: "Nomor HP",
                              }),
                              e.jsx("input", {
                                type: "text",
                                placeholder: "0812xxxxxxxx",
                                value: de,
                                onChange: (xe) => oe(xe.target.value),
                                className:
                                  "w-full text-xs p-2 bg-white border border-slate-200 rounded-lg focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none font-mono text-slate-850",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[10px] font-bold uppercase tracking-wider text-slate-500 block",
                                children: "Sandi Login Password*",
                              }),
                              e.jsx("input", {
                                type: "text",
                                required: !0,
                                placeholder: "Sandi login khusus",
                                value: Te,
                                onChange: (xe) => Ie(xe.target.value),
                                className:
                                  "w-full text-xs p-2 bg-white border border-slate-200 rounded-lg focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none font-mono text-slate-850",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("label", {
                                className:
                                  "text-[10px] font-bold uppercase tracking-wider text-slate-500 block",
                                children: "Hak Akses Peran (Role)*",
                              }),
                              e.jsxs("select", {
                                value: be,
                                onChange: (xe) => Ye(xe.target.value),
                                className:
                                  "w-full text-xs p-2 bg-white border border-slate-200 rounded-lg outline-none cursor-pointer focus:ring-1 focus:ring-blue-500 font-semibold text-slate-700",
                                children: [
                                  e.jsx("option", {
                                    value: "3",
                                    children:
                                      "Admin Utama (Akses Billing/Keuangan)",
                                  }),
                                  e.jsx("option", {
                                    value: "4",
                                    children:
                                      "Finance / Kasir (Manajemen Invoice/Koran)",
                                  }),
                                  e.jsx("option", {
                                    value: "5",
                                    children:
                                      "NOC Monitor (Tiket Komplain & OLT)",
                                  }),
                                  e.jsx("option", {
                                    value: "6",
                                    children:
                                      "Teknisi Lapangan (Peta, Isolir, Aktivasi)",
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("button", {
                            type: "submit",
                            className:
                              "w-full py-2 bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs rounded-lg flex items-center justify-center gap-1.5 cursor-pointer shadow-sm transition-all active:scale-95 mt-4",
                            children: [
                              e.jsx(jn, { className: "h-4 w-4" }),
                              e.jsx("span", { children: "Daftarkan Sub-Akun" }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "md:col-span-7 space-y-4",
                        children: [
                          e.jsxs("h4", {
                            className:
                              "text-[11.5px] font-bold text-slate-700 uppercase tracking-widest flex items-center gap-1.5 border-b pb-1.5 text-left",
                            children: [
                              e.jsx("span", {
                                children: "Daftar Sub-Akun Aktif",
                              }),
                              e.jsxs("span", {
                                className:
                                  "text-[10px] font-mono font-bold bg-slate-100 text-slate-400 px-1.5 py-0.2 rounded-full",
                                children: [T.length, " Akun"],
                              }),
                            ],
                          }),
                          G
                            ? e.jsx("div", {
                                className:
                                  "py-12 text-center text-slate-400 text-xs",
                                children: "Sedang memuat data akun staf...",
                              })
                            : T.length === 0
                              ? e.jsx("div", {
                                  className:
                                    "py-12 text-center text-slate-400 text-xs border border-dashed rounded-lg",
                                  children:
                                    "Belum ada sub-akun staf terdaftar.",
                                })
                              : e.jsx("div", {
                                  className:
                                    "space-y-2.5 overflow-y-auto max-h-[460px] pr-1",
                                  children: T.map((xe) => {
                                    const pt = Ae(xe.role_id);
                                    return e.jsxs(
                                      "div",
                                      {
                                        className:
                                          "p-3 bg-white border border-slate-200 rounded-xl flex items-center justify-between gap-4 hover:border-blue-200 transition-colors",
                                        children: [
                                          e.jsxs("div", {
                                            className:
                                              "text-left flex items-start gap-2.5 min-w-0",
                                            children: [
                                              e.jsx("div", {
                                                className:
                                                  "h-8 w-8 rounded-full bg-slate-100 shrink-0 font-bold text-xs text-slate-600 flex items-center justify-center border border-slate-200 uppercase mt-0.5",
                                                children: xe.name.substring(
                                                  0,
                                                  2,
                                                ),
                                              }),
                                              e.jsxs("div", {
                                                className: "min-w-0",
                                                children: [
                                                  e.jsx("h5", {
                                                    className:
                                                      "font-bold text-slate-800 text-xs truncate leading-tight",
                                                    children: xe.name,
                                                  }),
                                                  e.jsx("p", {
                                                    className:
                                                      "text-[10px] font-mono text-slate-550 truncate",
                                                    children: xe.email,
                                                  }),
                                                  xe.phone &&
                                                    e.jsx("p", {
                                                      className:
                                                        "text-[9.5px] font-mono text-slate-400",
                                                      children: xe.phone,
                                                    }),
                                                  e.jsxs("div", {
                                                    className:
                                                      "flex items-center gap-1.5 mt-1",
                                                    children: [
                                                      e.jsx("span", {
                                                        className: `px-2 py-0.5 rounded text-[9.5px] font-bold uppercase tracking-wider border ${pt.bg}`,
                                                        children: pt.name,
                                                      }),
                                                      xe.password &&
                                                        e.jsxs("span", {
                                                          className:
                                                            "text-[9px] text-slate-400 font-mono flex items-center gap-1 font-semibold",
                                                          children: [
                                                            e.jsx(Ep, {
                                                              className:
                                                                "h-2.5 w-2.5 shrink-0 text-slate-450",
                                                            }),
                                                            "PW: ",
                                                            xe.password,
                                                          ],
                                                        }),
                                                    ],
                                                  }),
                                                ],
                                              }),
                                            ],
                                          }),
                                          xe.id !== 1 &&
                                          xe.id !== 9999 &&
                                          xe.role_id !== 2
                                            ? e.jsx("button", {
                                                onClick: () =>
                                                  te(xe.id, xe.name),
                                                className:
                                                  "p-1.5 text-rose-500 hover:text-rose-700 bg-rose-50 hover:bg-rose-100 rounded-lg border border-rose-100 shrink-0 cursor-pointer transition-all",
                                                title:
                                                  "Hapus Sub-Akun Karyawan",
                                                children: e.jsx(ms, {
                                                  className: "h-3.5 w-3.5",
                                                }),
                                              })
                                            : e.jsx("span", {
                                                className:
                                                  "text-[9.5px] font-display font-bold text-slate-400 bg-slate-50 border border-slate-100 px-2 py-0.5 rounded leading-none",
                                                children: "Utama",
                                              }),
                                        ],
                                      },
                                      xe.id,
                                    );
                                  }),
                                }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "space-y-4",
            children: [
              e.jsxs("div", {
                className:
                  "p-5 bg-gradient-to-tr from-slate-900 via-slate-950 to-blue-950 rounded-xl space-y-4 text-white shadow-xl",
                children: [
                  e.jsxs("p", {
                    className:
                      "text-[10px] text-blue-400 font-mono font-bold uppercase tracking-widest flex items-center gap-1.5 border-b border-white/5 pb-2",
                    children: [
                      e.jsx(ar, {
                        className: "h-4 w-4 text-blue-400 animate-pulse",
                      }),
                      e.jsx("span", { children: "Paket Lisensi SaaS" }),
                    ],
                  }),
                  e.jsxs("div", {
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[10px] text-slate-400 font-light block",
                        children: "PAKET AKTIF USAHA:",
                      }),
                      e.jsx("h3", {
                        className: "text-xl font-display font-black text-white",
                        children: ee,
                      }),
                      e.jsx("p", {
                        className: "text-[11px] text-slate-350 mt-1",
                        children:
                          (ee && (ee.includes("Starter") || ee.includes("Trial") || ee.includes("Uji Coba"))) ? "Kuota terkelola hingga 100 Pelanggan & 3 Router." : (ee && ee.includes("Enterprise")) ? "Kuota terkelola hingga Tanpa Batas Pelanggan & Router." : "Kuota terkelola hingga 1000 Pelanggan & 20 Router.",
                      }),
                    ],
                  }),
                  e.jsx("div", {
                    className: "space-y-2 pt-2 text-xs",
                    children: e.jsxs("button", {
                      onClick: () => {
                        setShowUpgradeModal(true);
                      },
                      className:
                        "w-full py-2 bg-emerald-600 hover:bg-emerald-500 text-white font-bold rounded-lg flex items-center justify-center gap-1.5 cursor-pointer active:scale-95 transition-all",
                      children: [
                        e.jsx(sr, { className: "h-4 w-4 shrink-0" }),
                        e.jsx("span", { children: "Upgrade / Ubah Paket" }),
                      ],
                    }),
                  }),
                  showUpgradeModal && e.jsx("div", {
                    className: "fixed inset-0 bg-slate-950/75 backdrop-blur-md flex items-center justify-center z-[100] p-4 font-sans animate-fade-in",
                    children: e.jsxs("div", {
                      className: "bg-slate-900 border border-slate-800 rounded-2xl max-w-3xl w-full p-6 text-white shadow-2xl relative",
                      children: [
                        e.jsx("button", {
                          onClick: () => setShowUpgradeModal(false),
                          className: "absolute top-4 right-4 text-slate-400 hover:text-white text-lg bg-slate-800/40 hover:bg-slate-800 p-1.5 rounded-full w-8 h-8 flex items-center justify-center transition-all cursor-pointer",
                          children: "×"
                        }),
                        e.jsx("div", {
                          className: "text-center mb-6",
                          children: [
                            e.jsx("div", {
                              className: "inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-[10px] font-semibold uppercase tracking-wider mb-2",
                              children: "Lisensi Resmi MikRobiL SaaS v1.0"
                            }),
                            e.jsx("h2", {
                              className: "text-xl font-bold bg-gradient-to-r from-emerald-400 via-teal-300 to-indigo-400 bg-clip-text text-transparent",
                              children: "Upgrade / Ubah Paket Lisensi ISP"
                            }),
                            e.jsx("p", {
                              className: "text-xs text-slate-400 mt-1",
                              children: "Pilih paket yang dibuat oleh pemilik web yang sesuai dengan kapasitas operasional ISP Anda."
                            })
                          ]
                        }),
                        e.jsxs("div", {
                          className: "grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",
                          children: [
                            e.jsxs("div", {
                              className: "bg-slate-800/40 border border-slate-700/60 rounded-xl p-4 flex flex-col justify-between hover:border-slate-650 transition-all text-xs",
                              children: [
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "px-2 py-0.5 rounded text-[9px] bg-slate-800 text-slate-350 font-bold uppercase",
                                      children: "Starter"
                                    }),
                                    e.jsx("h4", {
                                      className: "text-sm font-bold mt-2 text-slate-200",
                                      children: "Starter Plan"
                                    }),
                                    e.jsx("p", {
                                      className: "text-[10px] text-slate-400 mt-1",
                                      children: "Sangat pas untuk ISP pemula atau uji coba wilayah baru."
                                    }),
                                    e.jsxs("div", {
                                      className: "my-3",
                                      children: [
                                        e.jsx("span", { className: "text-base font-black text-white", children: "Rp 150.000" }),
                                        e.jsx("span", { className: "text-[10px] text-slate-400 font-normal", children: " / bln" })
                                      ]
                                    }),
                                    e.jsxs("ul", {
                                      className: "space-y-1.5 text-[10px] text-slate-350 border-t border-slate-800/80 pt-3",
                                      children: [
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "100" }), " Pelanggan"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "3" }), " Routers"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "1" }), " OLT Node"] })
                                      ]
                                    })
                                  ]
                                }),
                                e.jsx("button", {
                                  onClick: async () => {
                                    try {
                                      const res = await (await fetch("/api/v1/subscription/upgrade", {
                                        method: "POST",
                                        headers: { "Content-Type": "application/json" },
                                        body: JSON.stringify({ plan_id: 1 })
                                      })).json();
                                      if (res.status === "success") {
                                        alert("Paket berhasil diubah ke Starter Plan!");
                                        B("Starter Plan");
                                        if (window.currentUserSession && window.currentUserSession.tenant) {
                                          window.currentUserSession.tenant.subscription_plan_id = 1;
                                        }
                                        setShowUpgradeModal(false);
                                      } else {
                                        alert("Gagal mengubah paket: " + res.message);
                                      }
                                    } catch (err) {
                                      alert("Gangguan koneksi internet.");
                                    }
                                  },
                                  disabled: ee.includes("Starter"),
                                  className: "mt-4 w-full py-1.5 rounded-lg text-[11px] font-bold transition-all " + (ee.includes("Starter") ? "bg-slate-800 text-slate-500 cursor-not-allowed" : "bg-white hover:bg-slate-100 text-slate-900 active:scale-95 cursor-pointer"),
                                  children: ee.includes("Starter") ? "Aktif Saat Ini" : "Pilih Starter"
                                })
                              ]
                            }),
                            e.jsxs("div", {
                              className: "bg-indigo-500/5 border border-indigo-500/20 rounded-xl p-4 flex flex-col justify-between hover:border-indigo-500/40 transition-all text-xs relative",
                              children: [
                                e.jsx("span", {
                                  className: "absolute -top-2.5 left-1/2 -translate-x-1/2 px-2 py-0.5 rounded-full text-[8px] bg-indigo-500 text-white font-bold uppercase shadow-sm whitespace-nowrap",
                                  children: "Terpopuler"
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "px-2 py-0.5 rounded text-[9px] bg-indigo-500/20 text-indigo-300 font-bold uppercase",
                                      children: "Professional"
                                    }),
                                    e.jsx("h4", {
                                      className: "text-sm font-bold mt-2 text-indigo-100",
                                      children: "Pro Plan"
                                    }),
                                    e.jsx("p", {
                                      className: "text-[10px] text-slate-400 mt-1",
                                      children: "Paket standar ideal untuk pertumbuhan bisnis ISP regional."
                                    }),
                                    e.jsxs("div", {
                                      className: "my-3",
                                      children: [
                                        e.jsx("span", { className: "text-base font-black text-white", children: "Rp 500.000" }),
                                        e.jsx("span", { className: "text-[10px] text-slate-400 font-normal", children: " / bln" })
                                      ]
                                    }),
                                    e.jsxs("ul", {
                                      className: "space-y-1.5 text-[10px] text-slate-350 border-t border-slate-800/80 pt-3",
                                      children: [
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "1.000" }), " Pelanggan"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "20" }), " Routers"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "5" }), " OLT Nodes"] })
                                      ]
                                    })
                                  ]
                                }),
                                e.jsx("button", {
                                  onClick: async () => {
                                    try {
                                      const res = await (await fetch("/api/v1/subscription/upgrade", {
                                        method: "POST",
                                        headers: { "Content-Type": "application/json" },
                                        body: JSON.stringify({ plan_id: 2 })
                                      })).json();
                                      if (res.status === "success") {
                                        alert("Paket berhasil diubah ke Pro Plan!");
                                        B("Pro Plan");
                                        if (window.currentUserSession && window.currentUserSession.tenant) {
                                          window.currentUserSession.tenant.subscription_plan_id = 2;
                                        }
                                        setShowUpgradeModal(false);
                                      } else {
                                        alert("Gagal mengubah paket: " + res.message);
                                      }
                                    } catch (err) {
                                      alert("Gangguan koneksi internet.");
                                    }
                                  },
                                  disabled: ee.includes("Pro"),
                                  className: "mt-4 w-full py-1.5 rounded-lg text-[11px] font-bold transition-all " + (ee.includes("Pro") ? "bg-slate-800 text-slate-500 cursor-not-allowed" : "bg-indigo-600 hover:bg-indigo-505 text-white active:scale-95 cursor-pointer"),
                                  children: ee.includes("Pro") ? "Aktif Saat Ini" : "Pilih Pro"
                                })
                              ]
                            }),
                            e.jsxs("div", {
                              className: "bg-emerald-500/5 border border-emerald-500/20 rounded-xl p-4 flex flex-col justify-between hover:border-emerald-500/40 transition-all text-xs",
                              children: [
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "px-2 py-0.5 rounded text-[9px] bg-emerald-500/25 text-emerald-300 font-bold uppercase",
                                      children: "Enterprise"
                                    }),
                                    e.jsx("h4", {
                                      className: "text-sm font-bold mt-2 text-emerald-100",
                                      children: "Enterprise Plan"
                                    }),
                                    e.jsx("p", {
                                      className: "text-[10px] text-slate-400 mt-1",
                                      children: "Kapasitas tanpa batas dengan dukungan SLA performa premium."
                                    }),
                                    e.jsxs("div", {
                                      className: "my-3",
                                      children: [
                                        e.jsx("span", { className: "text-base font-black text-white", children: "Rp 1.500.000" }),
                                        e.jsx("span", { className: "text-[10px] text-slate-400 font-normal", children: " / bln" })
                                      ]
                                    }),
                                    e.jsxs("ul", {
                                      className: "space-y-1.5 text-[10px] text-slate-350 border-t border-slate-800/80 pt-3",
                                      children: [
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "Tanpa Batas" }), " Pelanggan"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "Tanpa Batas" }), " Routers"] }),
                                        e.jsxs("li", { className: "flex items-center gap-1", children: ["✓ ", e.jsx("b", { children: "99" }), " OLT Server"] })
                                      ]
                                    })
                                  ]
                                }),
                                e.jsx("button", {
                                  onClick: async () => {
                                    try {
                                      const res = await (await fetch("/api/v1/subscription/upgrade", {
                                        method: "POST",
                                        headers: { "Content-Type": "application/json" },
                                        body: JSON.stringify({ plan_id: 3 })
                                      })).json();
                                      if (res.status === "success") {
                                        alert("Paket berhasil diubah ke Enterprise Plan!");
                                        B("Enterprise Plan");
                                        if (window.currentUserSession && window.currentUserSession.tenant) {
                                          window.currentUserSession.tenant.subscription_plan_id = 3;
                                        }
                                        setShowUpgradeModal(false);
                                      } else {
                                        alert("Gagal mengubah paket: " + res.message);
                                      }
                                    } catch (err) {
                                      alert("Gangguan koneksi internet.");
                                    }
                                  },
                                  disabled: ee.includes("Enterprise"),
                                  className: "mt-4 w-full py-1.5 rounded-lg text-[11px] font-bold transition-all " + (ee.includes("Enterprise") ? "bg-slate-800 text-slate-500 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-500 text-white active:scale-95 cursor-pointer"),
                                  children: ee.includes("Enterprise") ? "Aktif Saat Ini" : "Pilih Enterprise"
                                })
                              ]
                            })
                          ]
                        }),
                        e.jsx("div", {
                          className: "flex justify-end gap-2 border-t border-slate-800/60 pt-4",
                          children: e.jsx("button", {
                            onClick: () => setShowUpgradeModal(false),
                            className: "px-4 py-2 rounded-lg text-[11px] font-bold bg-slate-800 hover:bg-slate-700 text-slate-300 transition-all cursor-pointer",
                            children: "Batal / Tutup"
                          })
                        })
                      ]
                    })
                  })
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-amber-50 border border-amber-200 rounded-xl space-y-2.5 font-sans",
                children: [
                  e.jsxs("h4", {
                    className:
                      "text-xs font-bold text-amber-800 uppercase tracking-wider flex items-center gap-1.5",
                    children: [
                      e.jsx(Xn, {
                        className: "h-4 w-4 text-amber-600 shrink-0",
                      }),
                      e.jsx("span", { children: "Instruksi Webhook" }),
                    ],
                  }),
                  e.jsx("p", {
                    className: "text-[11px] text-amber-900 leading-relaxed",
                    children:
                      "Setelah mendaftar dan menyalin kredensial server key Midtrans atau Xendit Anda, silahkan lengkapi URL Webhook (Notification Callback URL) pada dasbor partner Anda.",
                  }),
                  e.jsx("div", {
                    className:
                      "bg-white/75 p-2 rounded border border-amber-100 break-all font-mono text-[9px] text-amber-950 select-text",
                    children:
                      "https://ais-pre-t74pw4eshk4imnhictujcm-31119983841.asia-southeast1.run.app/api/v1/payments/webhook",
                  }),
                  e.jsxs("p", {
                    className: "text-[10px] text-amber-805",
                    children: [
                      "💡 ",
                      e.jsx("b", { children: "Catatan:" }),
                      " Jika webhook terintegrasi dengan baik, status tagihan invoice client Anda akan lunas secara instan setelah pembayaran diselesaikan, dan router utama akan otomatis mengizinkan lalu lintas internet client tersebut tanpa intervensi manual!",
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function Eg({ onLogout: w }) {
  const [J, S] = f.useState(""),
    [b, V] = f.useState(""),
    [ue, re] = f.useState(!1),
    [ee, B] = f.useState(!1),
    T = (fe) => {
      (fe.preventDefault(),
        alert(
          "Tiket keluhan pelanggan berhasil didaftarkan! Tim teknisi support akan segera menghubungi Anda.",
        ),
        S(""),
        V(""));
    };
  return e.jsxs("div", {
    className:
      "min-h-screen bg-slate-50 font-sans text-slate-700 select-none pb-12",
    children: [
      e.jsxs("header", {
        className:
          "h-16 bg-white border-b border-slate-200 px-6 flex items-center justify-between select-none",
        children: [
          e.jsxs("div", {
            className: "flex items-center gap-2.5",
            children: [
              e.jsx("div", {
                className:
                  "h-7 w-7 rounded bg-blue-600 flex items-center justify-center font-display font-black text-white text-md",
                children: "M",
              }),
              e.jsx("span", {
                className:
                  "font-display font-extrabold text-slate-800 text-sm tracking-tight",
                children: "Klien Jaya Net Portal",
              }),
            ],
          }),
          e.jsxs("div", {
            className: "flex items-center gap-3",
            children: [
              e.jsxs("span", {
                className:
                  "text-xs bg-emerald-50 text-emerald-600 font-bold px-2 py-0.5 rounded border border-emerald-150 flex items-center gap-1",
                children: [
                  e.jsx("span", {
                    className:
                      "h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse",
                  }),
                  e.jsx("span", { children: "KONEKSI AKTIF • PPPoE ONLINE" }),
                ],
              }),
              e.jsx("button", {
                onClick: w,
                className:
                  "text-xs text-rose-500 hover:text-rose-600 font-bold cursor-pointer",
                children: "Keluar Portal",
              }),
            ],
          }),
        ],
      }),
      e.jsxs("main", {
        className: "max-w-4xl mx-auto w-full px-6 pt-10 space-y-6",
        children: [
          e.jsxs("div", {
            className:
              "bg-gradient-to-tr from-slate-900 via-slate-950 to-blue-950 text-white rounded-2xl p-6 shadow-xl relative overflow-hidden space-y-3.5",
            children: [
              e.jsxs("div", {
                className:
                  "flex items-center justify-between border-b border-slate-900 pb-2.5",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("p", {
                        className:
                          "text-[10px] text-blue-400 font-mono font-bold tracking-widest",
                        children: "SELAMAT DATANG DI CUSTOMER PORTAL",
                      }),
                      e.jsx("h2", {
                        className:
                          "text-xl font-display font-black tracking-tight mt-1",
                        children: "Budi Santoso",
                      }),
                    ],
                  }),
                  e.jsx("span", {
                    className: "text-xs font-mono font-bold text-slate-400",
                    children: "Kode: #PLG-00001",
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "grid grid-cols-1 sm:grid-cols-2 gap-4 pt-1",
                children: [
                  e.jsxs("div", {
                    className:
                      "p-3 bg-white/5 border border-white/10 rounded-xl",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[10px] text-slate-400 font-light block",
                        children: "PAKET INTERNET LANGGANAN:",
                      }),
                      e.jsxs("h4", {
                        className:
                          "text-sm font-extrabold text-blue-400 mt-1 flex items-center gap-1.5",
                        children: [
                          e.jsx(Nn, { className: "h-4.5 w-4.5" }),
                          e.jsx("span", {
                            children: "Home-Lite 10 Mbps (Unlimited)",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "p-3 bg-white/5 border border-white/10 rounded-xl",
                    children: [
                      e.jsx("span", {
                        className:
                          "text-[10px] text-slate-400 font-light block",
                        children: "STATUS BILLING METRIC:",
                      }),
                      e.jsx("h4", {
                        className: `text-sm font-extrabold mt-1 uppercase ${ue ? "text-emerald-400" : "text-amber-400 animate-pulse"}`,
                        children: ue
                          ? "LUNAS (Layanan Aktif)"
                          : "MENUNGGAK TAGIHAN (Rp 150.000)",
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "grid grid-cols-1 md:grid-cols-2 gap-6",
            children: [
              e.jsxs("div", {
                className:
                  "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className: "border-b pb-2 flex items-center gap-1.5",
                    children: [
                      e.jsx(nr, { className: "h-4.5 w-4.5 text-blue-600" }),
                      e.jsx("h3", {
                        className:
                          "text-xs font-bold uppercase tracking-widest text-slate-800",
                        children: "Tagihan & Cetak Invoice",
                      }),
                    ],
                  }),
                  ue
                    ? e.jsxs("div", {
                        className:
                          "p-4 bg-emerald-50 border border-emerald-200 text-emerald-850 text-xs rounded-xl flex items-center gap-2 font-semibold",
                        children: [
                          e.jsx(so, {
                            className: "h-5 w-5 text-emerald-600 shrink-0",
                          }),
                          e.jsx("span", {
                            children:
                              "Semua tagihan lunas! Terima kasih telah berlangganan di Jaya Net.",
                          }),
                        ],
                      })
                    : e.jsxs("div", {
                        className: "space-y-4",
                        children: [
                          e.jsxs("div", {
                            className:
                              "p-3.5 bg-slate-50 border rounded-lg text-xs flex justify-between items-center",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsx("span", {
                                    className: "font-extrabold text-slate-800",
                                    children: "Invoice: INV/202606/0001",
                                  }),
                                  e.jsx("p", {
                                    className:
                                      "text-[10px] text-slate-500 font-mono mt-0.5",
                                    children: "Jatuh Tempo: 10 Juni 2026",
                                  }),
                                ],
                              }),
                              e.jsx("strong", {
                                className: "text-slate-800 font-display",
                                children: "Rp 150.000",
                              }),
                            ],
                          }),
                          ee
                            ? e.jsxs("div", {
                                className:
                                  "p-4 bg-slate-50/50 border rounded-xl space-y-3.5 text-xs text-center",
                                children: [
                                  e.jsx("p", {
                                    className: "font-bold",
                                    children:
                                      "Scan Kode QRIS (Automated Webhook Sync)",
                                  }),
                                  e.jsx("div", {
                                    className:
                                      "h-36 w-36 bg-white border mx-auto p-1.5 flex items-center justify-center rounded",
                                    children: e.jsx(fc, {
                                      className: "h-full w-full text-slate-800",
                                    }),
                                  }),
                                  e.jsx("button", {
                                    onClick: () => {
                                      (re(!0),
                                        B(!1),
                                        alert(
                                          "Pembayaran dengan QRIS sukses disinkronkan ke billing core!",
                                        ));
                                    },
                                    className:
                                      "w-full py-1.5 bg-emerald-600 text-white font-bold text-[11px] rounded transition-all cursor-pointer",
                                    children: "Konfirmasi Bayar",
                                  }),
                                ],
                              })
                            : e.jsxs("button", {
                                onClick: () => B(!0),
                                className:
                                  "w-full py-2 bg-blue-600 hover:bg-blue-505 text-white font-bold text-xs rounded-lg cursor-pointer flex items-center justify-center gap-1 shadow",
                                children: [
                                  e.jsx(sr, { className: "h-3.5 w-3.5" }),
                                  e.jsx("span", {
                                    children: "Metode Bayar Instan",
                                  }),
                                ],
                              }),
                        ],
                      }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-5 bg-white border border-slate-200 rounded-xl shadow-sm space-y-4",
                children: [
                  e.jsxs("div", {
                    className: "border-b pb-2 flex items-center gap-1.5",
                    children: [
                      e.jsx(ir, { className: "h-4.5 w-4.5 text-indigo-500" }),
                      e.jsx("h3", {
                        className:
                          "text-xs font-bold uppercase tracking-widest text-slate-800",
                        children: "Tiket Dukungan Cepat",
                      }),
                    ],
                  }),
                  e.jsxs("form", {
                    onSubmit: T,
                    className: "space-y-3 text-xs text-slate-700",
                    children: [
                      e.jsx("div", {
                        className: "space-y-1",
                        children: e.jsx("input", {
                          type: "text",
                          required: !0,
                          placeholder:
                            "Keluhan singkat, misal: WiFi Melambat...",
                          value: J,
                          onChange: (fe) => S(fe.target.value),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg outline-none font-sans text-xs",
                        }),
                      }),
                      e.jsx("div", {
                        className: "space-y-1",
                        children: e.jsx("textarea", {
                          required: !0,
                          rows: 2,
                          placeholder:
                            "Ketikkan rincian detail kendala modem/los...",
                          value: b,
                          onChange: (fe) => V(fe.target.value),
                          className:
                            "w-full p-2 bg-slate-50 border rounded-lg resize-none outline-none font-sans text-xs",
                        }),
                      }),
                      e.jsxs("button", {
                        type: "submit",
                        className:
                          "w-full py-2.5 bg-indigo-650 hover:bg-indigo-600 text-white font-bold text-xs rounded-lg cursor-pointer shadow flex items-center justify-center gap-1",
                        children: [
                          e.jsx(Yf, { className: "h-3.5 w-3.5 shrink-0" }),
                          e.jsx("span", { children: "Daulat Tiket Keluhan" }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
    ],
  });
}
function Og({ activeRole: w }) {
  var ga;
  const [J, S] = f.useState([]),
    [b, V] = f.useState([]),
    [ue, re] = f.useState([]),
    [ee, B] = f.useState(""),
    [T, fe] = f.useState(""),
    [G, F] = f.useState(""),
    [ce, ve] = f.useState(!1),
    [Y, Ee] = f.useState(null),
    [Se, le] = f.useState(null),
    [ie, $] = f.useState({ amount: "250000", paymentMethod: "qris" }),
    [de, oe] = f.useState(!1),
    [be, Ye] = f.useState({
      name: "",
      code: "",
      phone: "",
      commission_pct: "10",
      balance: "500000",
      status: "active",
    }),
    [Te, Ie] = f.useState(!1),
    [me, Oe] = f.useState(null),
    [te, Ae] = f.useState({ profileId: "", quantity: 10 }),
    [Ue, y] = f.useState([]),
    [K, O] = f.useState(""),
    [P, z] = f.useState(""),
    [g, C] = f.useState("vouchers"),
    [I, X] = f.useState("150000"),
    [pe, he] = f.useState(!1),
    [Ne, $e] = f.useState(!1),
    [ae, ze] = f.useState("192.168.1.1"),
    [at, bt] = f.useState(!1),
    [Mt, ge] = f.useState([]),
    [Me, mt] = f.useState([
      {
        id: 1,
        name: "Ibu Hartati (Kios Jus)",
        type: "Hotspot Voucher",
        plan: "Plan Wifi Keluarga 1 Bln",
        status: "online",
        traffic: "14.2 GB used",
        activeUntil: "15 Juni 2026",
        durationLeft: "7 Hari lagi",
      },
      {
        id: 2,
        name: "Pak Slamet (Bengkel)",
        type: "PPPoE Home",
        plan: "Plan 10 Mbps Corporate",
        status: "online",
        traffic: "184.8 GB used",
        activeUntil: "24 Juni 2026",
        durationLeft: "16 Hari lagi",
      },
      {
        id: 3,
        name: "Warkop Mas Toni",
        type: "Hotspot Voucher",
        plan: "Plan Game Online 12 Jam",
        status: "offline",
        traffic: "0 Bytes",
        activeUntil: "Expired",
        durationLeft: "Habis",
      },
      {
        id: 4,
        name: "Siti Nurjanah",
        type: "Hotspot Voucher",
        plan: "Plan Belajar Desa 3 Jam",
        status: "online",
        traffic: "890 MB used",
        activeUntil: "Hari ini, 18:00",
        durationLeft: "4 Jam lagi",
      },
      {
        id: 5,
        name: "Budi Santoso",
        type: "PPPoE Home",
        plan: "Plan 15 Mbps",
        status: "online",
        traffic: "294.5 GB used",
        activeUntil: "15 Juli 2026",
        durationLeft: "37 Hari lagi",
      },
    ]),
    [st, Z] = f.useState("telegram"),
    [_e, Ze] = f.useState(""),
    [Xe, Ht] = f.useState(!1),
    [St, E] = f.useState([
      {
        id: "tg-init",
        sender: "bot",
        text: `🤖 **MikRobiL support Bot** (v1.2.5)

Selamat datang di Bot interaktif Telegram MikRobiL. Gunakan perintah di bawah ini untuk mengelola tagihan, cek ping, dan mencetak voucher Anda secara mandiri.

Ketik \`/help\` atau gunakan tombol pintas cepat di bawah ini.`,
        timestamp: "09:41",
      },
    ]),
    Re = (v) => {
      Z(v);
      const Pe = new Date().toLocaleTimeString("id-ID", {
        hour: "2-digit",
        minute: "2-digit",
      });
      E(
        v === "whatsapp"
          ? [
              {
                id: "wa-init",
                sender: "bot",
                text: `🟢 *MikRobiL Billing Bot* is active!

Selamat datang di layanan Chatbot WhatsApp mandiri MikRobiL.

Ketik *help* atau *menu* untuk melihat daftar tindakan cepat tagihan dan topup.`,
                timestamp: Pe,
              },
            ]
          : [
              {
                id: "tg-init-sw",
                sender: "bot",
                text: `🤖 **MikRobiL support Bot** (v1.2.5)

Selamat datang di Bot interaktif Telegram MikRobiL. Gunakan perintah di bawah ini untuk mengelola tagihan, cek ping, dan mencetak voucher Anda secara mandiri.

Ketik \`/help\` untuk instruksi lengkap.`,
                timestamp: Pe,
              },
            ],
      );
    },
    qe = (v) => {
      if (!v.trim()) return;
      const Pe = Math.random().toString(),
        vt = new Date().toLocaleTimeString("id-ID", {
          hour: "2-digit",
          minute: "2-digit",
        }),
        Ut = { id: Pe, sender: "user", text: v, timestamp: vt };
      (E((we) => [...we, Ut]),
        Ze(""),
        Ht(!0),
        setTimeout(() => {
          const we = v.trim().toLowerCase();
          let Ve = "";
          if (
            we === "help" ||
            we === "menu" ||
            we === "/help" ||
            we === "/menu"
          )
            st === "whatsapp"
              ? (Ve = `📱 *MENU UTAMA CHATBOT MIKROBIL (WhatsApp)*

Gunakan perintah interaktif berikut:
• *cek ping [target]* _- Diagnostik koneksi host_
• *cek tagihan* _- Ringkasan tagihan pelanggan ritel_
• *cek daftar pelanggan* _- List port & online status_
• *beli voucher* _- Ambil kode WiFi potong saldo_
• *top up [nominal]* _- Pengisian deposit dompet ritel_
• *status* _- Informasi CPU router & uptime_`)
              : (Ve =
                  "🤖 **MENU UTAMA MIKROBIL TELEGRAM BOT**\n\nSilakan kirimkan perintah berikut:\n• `/ping [host]` - Cek respon RTT ping ke IP/domain\n• `/tagihan` - Laporan penagihan dan status jatuh tempo\n• `/pelanggan` - Tampilkan 5 klien aktif keagenan Anda\n• `/belivoucher` - Cetak voucher hotspot via saldo Anda\n• `/topup [jumlah]` - Simulasi penyetoran dana GPN QRIS\n• `/status` - Informasi load RouterOS & ping API");
          else if (
            we.startsWith("cek ping ") ||
            we.startsWith("/ping ") ||
            we === "cek ping" ||
            we === "/ping"
          ) {
            let rt = "192.168.1.1";
            (we.startsWith("cek ping ")
              ? (rt = v.substring(9).trim())
              : we.startsWith("/ping ") && (rt = v.substring(6).trim()),
              (Ve = `📡 *DIAGNOSTIK KONEKSI (PING): ${rt}*
Mengirim 4 paket ICMP Echo Request via Router Core...

 -> icmp_seq=1 ttl=64 time=18ms
 -> icmp_seq=2 ttl=64 time=15ms
 -> icmp_seq=3 ttl=64 time=12ms
 -> icmp_seq=4 ttl=64 time=22ms

📊 *Hasil Uji Laten*:
• Paket: 4 Terkirim, 4 Diterima (0.0% Loss)
• Latensi Rerata: *16.7 ms* (Sangat Stabil)
• Status Host: *ONLINE & RESPONS SANGAT BAIK*`));
          } else if (
            we.startsWith("cek tagihan") ||
            we.startsWith("/tagihan")
          ) {
            let rt = "";
            if (
              (we.startsWith("cek tagihan ")
                ? (rt = v.substring(12).trim().toLowerCase())
                : we.startsWith("/tagihan ") &&
                  (rt = v.substring(9).trim().toLowerCase()),
              rt)
            ) {
              const We = Me.find((nt) => nt.name.toLowerCase().includes(rt));
              We
                ? (Ve = `💵 *LAPORAN PENAGIHAN PELANGGAN MIKROBIL*

• *Klien*: ${We.name}
• *Layanan/Jenis*: ${We.type}
• *Paket Langganan*: ${We.plan}
• *Status Saat Ini*: ${We.status === "online" ? "🟢 ONLINE" : "🔴 OFFLINE"}
• *Batas Aktif*: ${We.activeUntil} (${We.durationLeft})
• *Status Tagihan*: *Rp 120.000 (MENUNGGU PEMBAYARAN - UNPAID)*

_Hubungi Admin/Agen untuk klaim tanda lunas._`)
                : (Ve = `⚠️ *Klien tidak ditemukan.*

Pencarian untuk *"${rt}"* tidak mencocokkan pelanggan mana pun di database keagenan Anda. Silakan cek nama di \`/pelanggan\`.`);
            } else
              Ve =
                `💵 *DAFTAR TAGIHAN JATUH TEMPO AKAN DATANG*

Berikut adalah tunggakan & invoice pelanggan aktif Anda:

` +
                Me.map(
                  (nt, ea) =>
                    `  ${ea + 1}. *${nt.name}* - Rp 120.000 (${nt.durationLeft})`,
                ).join(`
`) +
                `

ℹ️ Silakan ketik *cek tagihan [nama]* untuk detail penagihan spesifik per klien.`;
          } else if (
            we.startsWith("cek daftar pelanggan") ||
            we === "cek pelanggan" ||
            we === "/pelanggan" ||
            we === "pelanggan"
          )
            Ve =
              `👥 *INFORMASI REGISTER KEANGGOTAAN PELANGGAN*
Total terhubung: 5 Klien Lapangan

` +
              Me.map((We, nt) => {
                const ea = We.status === "online" ? "🟢" : "🔴";
                return `${nt + 1}. ${ea} *${We.name}*
    - Paket: ${We.plan}
    - Kuota/Traffic: ${We.traffic}`;
              }).join(`

`);
          else if (
            we.startsWith("beli voucher") ||
            we.startsWith("/belivoucher") ||
            we === "beli voucher" ||
            we === "voucher"
          )
            if (!me)
              Ve = `⚠️ *Akses Ditolak!*

Anda belum terotentikasi sebagai agen lapangan. Silakan pilih salah satu mitra/agen pada *Simulator Login Panel Kiri* terlebih dahulu untuk menguji sinkronisasi saldo secara real-time.`;
            else {
              const rt = ue[0] || {
                  name: "Plan Harian 3 Jam",
                  price: 5e3,
                  rate_limit: "2 Mbps",
                },
                We = me.commission_pct || 10,
                nt = rt.price,
                ea = nt * (1 - We / 100);
              if (me.balance < ea)
                Ve = `❌ *SALDO TIDAK CUKUP!*

• Saldo Agen Anda: *Rp ${me.balance.toLocaleString("id-ID")}*
• Harga Paket Net: *Rp ${ea.toLocaleString("id-ID")}*

Silakan lakukan *top up* terlebih dahulu via bot gawai Anda.`;
              else {
                const as = me.balance - ea,
                  Ot = J.map((qt) => {
                    if (qt.id === me.id) {
                      const Ss = { ...qt, balance: as };
                      return (Oe(Ss), Ss);
                    }
                    return qt;
                  });
                S(Ot);
                const Ra =
                    "MB-" +
                    Math.floor(1e5 + Math.random() * 9e5)
                      .toString(36)
                      .toUpperCase(),
                  It = {
                    code: Ra,
                    price: nt,
                    validity: "1 Hari",
                    speed: rt.rate_limit,
                  };
                y((qt) => [It, ...qt]);
                const _a = {
                  id: b.length + 1,
                  reseller_id: me.id,
                  type: "sale",
                  amount: nt,
                  commission: nt - ea,
                  description: `Penjualan Voucher Hotspot ${rt.name} via Telegram Bot`,
                  created_at: new Date().toISOString(),
                };
                (V((qt) => [_a, ...qt]),
                  Pt(),
                  (Ve = `✅ *PEMBELIAN VOUCHER VIA CHATBOT BERHASIL!*

• *Nama Agen*: ${me.name}
• *Paket WiFi*: ${rt.name} (${rt.rate_limit})
• *Tagihan Saldo Ritel*: *Rp ${ea.toLocaleString("id-ID")}* (Diskon ${We}% sudah dipotong)

🎫 *KODE VOUCHER HOTSPOT*:
*====================*
👉  *${Ra}*  👈
*====================*

🎫 _Silakan serahkan kode ini ke pelanggan atau cetak via POS thermal bluetooth printer._`));
              }
            }
          else if (
            we.startsWith("top up") ||
            we.startsWith("/topup") ||
            we === "top up" ||
            we === "topup"
          )
            if (!me)
              Ve = `⚠️ *Autentikasi Diperlukan!*

Silakan pilih agen di panel login simulator kiri sebelum melakukan top up isi saldo lewat chatbot.`;
            else {
              let rt = 1e5;
              const We = we.split(" ");
              if (We.length > 2) {
                const Ot = We[2].replace(/[^0-9]/g, "");
                Ot && (rt = parseInt(Ot, 10));
              } else if (We.length === 2) {
                const Ot = We[1].replace(/[^0-9]/g, "");
                Ot && (rt = parseInt(Ot, 10));
              }
              const nt = me.balance + rt,
                ea = J.map((Ot) => {
                  if (Ot.id === me.id) {
                    const Ra = { ...Ot, balance: nt };
                    return (Oe(Ra), Ra);
                  }
                  return Ot;
                });
              S(ea);
              const as = {
                id: b.length + 1,
                reseller_id: me.id,
                type: "topup",
                amount: rt,
                commission: 0,
                description: `Auto-deposit via ${st === "whatsapp" ? "WhatsApp" : "Telegram"} Bot QRIS Instant`,
                created_at: new Date().toISOString(),
              };
              (V((Ot) => [as, ...Ot]),
                Pt(),
                (Ve = `💳 *AUTO DEPOSIT TOPUP BERHASIL MIKROBIL*

• *Mitra Kios*: ${me.name} (${me.code})
• *Nominal*: *Rp ${rt.toLocaleString("id-ID")}*
• *Gerbang*: QRIS Auto-Settlement Virtual GPN
• *Saldo Baru*: *Rp ${nt.toLocaleString("id-ID")}*

💸 Saldo Anda terupdate di aplikasi seluler & server Radius secara instan!`));
            }
          else
            we === "status" || we === "/status" || we === "cek status"
              ? (Ve = `🖥️ *LAPORAN SERVER CORE MIKROBIL*

• *Router Board*: RB4011iGS+ (v7.12 Stable)
• *CPU Load*: 14% (Sangat Ringan)
• *Uptime Server*: 24 Hari, 1 Jam, 40 Menit
• *Sesi Radius Active*: 182 Klien Online
• *Bot Gateway Link*: 🟢 ONLINE & SIAP`)
              : (Ve = `❓ *Perintah Tidak Dikenali.*

Halo! Saya adalah agen interaktif otomatis MikRobiL.

Ketik *help* (WhatsApp) atau \`/help\` (Telegram) untuk melihat daftar menu dan panduan perintah bot yang lengkap!`);
          (E((rt) => [
            ...rt,
            {
              id: Math.random().toString(),
              sender: "bot",
              text: Ve,
              timestamp: new Date().toLocaleTimeString("id-ID", {
                hour: "2-digit",
                minute: "2-digit",
              }),
            },
          ]),
            Ht(!1));
        }, 1e3));
    },
    [Fe, fa] = f.useState("WAG-8392-AJKX"),
    [Aa, ps] = f.useState("72819381:AAFj1892A-Zol1S"),
    [ra, es] = f.useState("-1001839281"),
    [Ft, Tt] = f.useState({ offline: !0, online: !0, payment: !0, ticket: !0 }),
    [oa, Zt] = f.useState(""),
    [ts, ja] = f.useState(null),
    _s = (v) => {
      (ja(v),
        Zt(`Menghubungkan ke API Gateway ${v.toUpperCase()}...`),
        setTimeout(() => {
          (Zt(
            `✅ SUKSES! Pesan uji notifikasi dikirimkan via ${v.toUpperCase()} Gateway ke kontak/grup terdaftar.`,
          ),
            ja(null),
            setTimeout(() => Zt(""), 5e3));
        }, 1500));
    },
    xe = () => {
      if (!ae) return;
      (bt(!0),
        ge([
          `📡 MENCOBA PING KE HOST: ${ae}...`,
          "Protokol MikroTik RouterOS v7 Ping Terminal:",
        ]));
      let v = 0;
      const Pe = setInterval(() => {
        v++;
        const vt = Math.floor(Math.random() * 45) + 12,
          Ut = 64;
        (ge((we) => [
          ...we,
          `   -> dari router_core_utama: icmp_seq=${v} ttl=${Ut} time=${vt}ms`,
        ]),
          v >= 5 &&
            (clearInterval(Pe),
            ge((we) => [
              ...we,
              `
--- Statistik Ping MikRobiL untuk ${ae} ---`,
              "5 Paket dikirim, 5 Diterima, 0% Packet Loss, Latensi Rerata: 24.5ms",
              "Status Target: ONLINE & BEROPERASI BAIK",
            ]),
            bt(!1)));
      }, 450);
    },
    pt = (v) => {
      (v.preventDefault(), me && (he(!0), $e(!0)));
    },
    Xt = () => {
      if (!me) return;
      const v = Number(I),
        Pe = J.map((Ut) => {
          if (Ut.id === me.id) {
            const we = { ...Ut, balance: Ut.balance + v };
            return (Oe(we), we);
          }
          return Ut;
        });
      S(Pe);
      const vt = {
        id: b.length + 1,
        reseller_id: me.id,
        type: "topup",
        amount: v,
        commission: 0,
        description: `Pengisian Mandiri Saldo Agen ${me.name} via QRIS Instant`,
        created_at: new Date().toISOString(),
      };
      (V((Ut) => [vt, ...Ut]),
        O(
          `Selesai! Saldo sebesar Rp ${v.toLocaleString("id-ID")} telah dikreditkan secara instan.`,
        ),
        $e(!1),
        he(!1),
        Pt());
    };
  f.useEffect(() => {
    (Pt(), Ya(), Xa());
  }, []);
  const Pt = async () => {
      try {
        const Pe = await (await fetch("/api/v1/resellers")).json();
        Pe.status === "success" && S(Pe.data);
      } catch (v) {
        console.error(v);
      }
    },
    Ya = async () => {
      try {
        const Pe = await (await fetch("/api/v1/resellers/transactions")).json();
        Pe.status === "success" && V(Pe.data);
      } catch (v) {
        console.error(v);
      }
    },
    Xa = async () => {
      try {
        const Pe = await (await fetch("/api/v1/hotspot/profiles")).json();
        Pe.status === "success" &&
          (re(Pe.data),
          Pe.data.length > 0 &&
            !te.profileId &&
            Ae((vt) => ({ ...vt, profileId: String(Pe.data[0].id) })));
      } catch (v) {
        console.error(v);
      }
    },
    an = async (v) => {
      v.preventDefault();
      try {
        const vt = await (
          await fetch("/api/v1/resellers", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(be),
          })
        ).json();
        vt.status === "success"
          ? (fe("Kios Agent baru berhasil didaftarkan di sistem!"),
            ve(!1),
            Ye({
              name: "",
              code: "",
              phone: "",
              commission_pct: "10",
              balance: "250000",
              status: "active",
            }),
            Pt())
          : F(vt.message || "Gagal membuat reseller");
      } catch (Pe) {
        console.error(Pe);
      }
    },
    ws = async (v) => {
      if ((v.preventDefault(), !!Y))
        try {
          (
            await (
              await fetch(`/api/v1/resellers/${Y.id}`, {
                method: "PUT",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(Y),
              })
            ).json()
          ).status === "success" &&
            (fe("Data Reseller berhasil diperbarui!"), Ee(null), Pt());
        } catch (Pe) {
          console.error(Pe);
        }
    },
    ks = async (v) => {
      if (
        confirm("Hapus data reseller ini? Saldo sisa dan log akan dibekukan.")
      )
        try {
          (
            await (
              await fetch(`/api/v1/resellers/${v}`, { method: "DELETE" })
            ).json()
          ).status === "success" &&
            (fe("Reseller berhasil dihapus dari database."), Pt());
        } catch (Pe) {
          console.error(Pe);
        }
    },
    Na = async (v) => {
      (v.preventDefault(),
        Se &&
          (oe(!0),
          setTimeout(async () => {
            try {
              (
                await (
                  await fetch(`/api/v1/resellers/${Se.id}/topup`, {
                    method: "POST",
                    headers: { "Content-Type": "application/json" },
                    body: JSON.stringify({
                      amount: ie.amount,
                      description: `Topup Saldo via ${ie.paymentMethod.toUpperCase()} (Gateway Simulation)`,
                    }),
                  })
                ).json()
              ).status === "success" &&
                (fe(
                  `Konfirmasi sukses! Saldo Rp ${Number(ie.amount).toLocaleString("id-ID")} telah dikirim ke agen ${Se.name} via webhook instan.`,
                ),
                le(null),
                Pt(),
                Ya());
            } catch (Pe) {
              console.error(Pe);
            } finally {
              oe(!1);
            }
          }, 1200)));
    },
    $t = (v) => {
      if ((v.preventDefault(), !me)) {
        z("Pilih agen terlebih dahulu.");
        return;
      }
      const Pe = Number(te.profileId),
        vt = ue.find((It) => It.id === Pe);
      if (!vt) {
        z("Pilih profil voucher kecepatan.");
        return;
      }
      const Ut = vt.price,
        we = Number(te.quantity),
        Ve = Ut * we,
        rt = me.commission_pct,
        We = (Ve * rt) / 100,
        nt = Ve - We;
      if (me.balance < nt) {
        z(
          `Saldo tidak mencukupi! Saldo saat ini Rp ${me.balance.toLocaleString("id-ID")}, dibutuhkan saldo deposit minimal Rp ${nt.toLocaleString("id-ID")} (setelah diskon komisi ${rt}%).`,
        );
        return;
      }
      const ea = J.map((It) => {
        if (It.id === me.id) {
          const _a = {
            ...It,
            balance: It.balance - nt,
            total_sales: It.total_sales + Ve,
          };
          return (Oe(_a), _a);
        }
        return It;
      });
      S(ea);
      const as = [],
        Ot = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
      for (let It = 0; It < we; It++) {
        let _a = me.code + "-";
        for (let qt = 0; qt < 5; qt++)
          _a += Ot.charAt(Math.floor(Math.random() * Ot.length));
        as.push({
          code: _a,
          pin: Math.floor(1e5 + Math.random() * 9e5).toString(),
          profile: vt.name,
          speed: vt.rate_limit,
          validity: vt.validity,
          price: vt.price,
        });
      }
      const Ra = {
        id: b.length + 1,
        reseller_id: me.id,
        type: "voucher_purchase",
        amount: Ve,
        commission: We,
        description: `Cetak ${we} Voucher ${vt.name} dari saldo oleh ${me.name}`,
        created_at: new Date().toISOString(),
      };
      (V((It) => [Ra, ...It]),
        y(as),
        O(
          `Cetak Sukses! Saldo dikurangi Rp ${nt.toLocaleString("id-ID")} (Komisi Rp ${We.toLocaleString("id-ID")} terbayarkan di muka).`,
        ),
        z(""));
    },
    sn = J.filter(
      (v) =>
        v.name.toLowerCase().includes(ee.toLowerCase()) ||
        v.code.toLowerCase().includes(ee.toLowerCase()),
    ),
    Qn = J.reduce((v, Pe) => v + Pe.balance, 0),
    _n = b
      .filter((v) => v.type === "voucher_purchase")
      .reduce((v, Pe) => v + Pe.commission, 0);
  return e.jsxs("div", {
    className:
      "space-y-6 max-w-7xl mx-auto w-full font-sans select-none pb-16 animate-fade-in",
    id: "resellers-view-container",
    children: [
      T &&
        e.jsxs("div", {
          className:
            "p-3 bg-emerald-50 border border-emerald-200 text-emerald-800 text-xs rounded-xl font-medium flex justify-between items-center shadow-sm",
          children: [
            e.jsxs("div", {
              className: "flex items-center gap-1.5",
              children: [
                e.jsx(tn, { className: "h-4 w-4 text-emerald-600" }),
                e.jsx("span", { children: T }),
              ],
            }),
            e.jsx("button", {
              onClick: () => fe(""),
              className: "font-extrabold hover:text-slate-900 shrink-0 text-xs",
              children: "X",
            }),
          ],
        }),
      G &&
        e.jsxs("div", {
          className:
            "p-3 bg-rose-50 border border-rose-250 text-rose-800 text-xs rounded-xl font-medium flex justify-between items-center shadow-sm",
          children: [
            e.jsxs("div", {
              className: "flex items-center gap-1.5",
              children: [
                e.jsx(to, { className: "h-4 w-4 text-rose-600" }),
                e.jsx("span", { children: G }),
              ],
            }),
            e.jsx("button", {
              onClick: () => F(""),
              className: "font-extrabold hover:text-slate-950 shrink-0 text-xs",
              children: "X",
            }),
          ],
        }),
      e.jsxs("div", {
        className:
          "bg-gradient-to-r from-emerald-950 via-slate-900 to-slate-900 rounded-2xl p-6 text-white border border-emerald-500/10 shadow-lg relative overflow-hidden",
        children: [
          e.jsx("div", {
            className:
              "absolute right-0 top-0 bottom-0 w-1/3 opacity-10 bg-[radial-gradient(circle_at_right,rgba(16,185,129,0.3),transparent)] pointer-events-none",
          }),
          e.jsxs("div", {
            className:
              "relative flex flex-col md:flex-row md:items-center justify-between gap-4",
            children: [
              e.jsxs("div", {
                className: "space-y-1",
                children: [
                  e.jsx("span", {
                    className:
                      "px-2 py-0.5 bg-emerald-500/20 text-emerald-400 border border-emerald-500/20 rounded-full text-[10px] font-mono tracking-wider font-extrabold uppercase",
                    children: "DISTRIBUTION NETWORK",
                  }),
                  e.jsx("h2", {
                    className: "text-xl font-extrabold tracking-tight",
                    children: "Kios Desa & Reseller Agen Voucher",
                  }),
                  e.jsx("p", {
                    className: "text-xs text-slate-400 font-sans max-w-2xl",
                    children:
                      "Kelola kemitraan distribusi voucher internet desa mandiri. Daftarkan warung/kios lokal, monitor saldo deposit, persetujuan komisi ritel, dan berikan akses pencetakan voucher langsung dari saldo milik mereka.",
                  }),
                ],
              }),
              e.jsxs("div", {
                className: "flex gap-2",
                children: [
                  e.jsxs("button", {
                    onClick: () => {
                      (Ie(!Te), !Te && J.length > 0 && Oe(J[0]));
                    },
                    className:
                      "px-3.5 py-2 hover:bg-slate-800 border border-slate-700 font-bold rounded-lg text-xs cursor-pointer flex items-center gap-1.5 transition-colors",
                    children: [
                      e.jsx(Fr, { className: "h-4 w-4 text-emerald-400" }),
                      e.jsx("span", {
                        children: Te
                          ? "Tutup Portal Simulator"
                          : "Buka Portal Demo Agen",
                      }),
                    ],
                  }),
                  w !== "Customer" &&
                    w !== "Technician" &&
                    e.jsxs("button", {
                      onClick: () => ve(!0),
                      className:
                        "px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white font-bold rounded-lg text-xs cursor-pointer flex items-center gap-1.5 shadow-sm shadow-emerald-600/10 transition-colors",
                      children: [
                        e.jsx(jn, { className: "h-4 w-4" }),
                        e.jsx("span", { children: "Tambah Mitra Kios" }),
                      ],
                    }),
                ],
              }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
        children: [
          e.jsxs("div", {
            className:
              "p-4 bg-white border rounded-xl shadow-sm flex items-center justify-between",
            children: [
              e.jsxs("div", {
                className: "space-y-1",
                children: [
                  e.jsx("p", {
                    className:
                      "text-[10px] font-bold text-slate-400 tracking-wider uppercase font-sans",
                    children: "Agen Terdaftar",
                  }),
                  e.jsxs("h3", {
                    className: "text-xl font-black text-slate-800",
                    children: [J.length, " Mitra Kios"],
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "h-10 w-10 rounded-lg bg-slate-50 flex items-center justify-center text-slate-500",
                children: e.jsx(Jn, { className: "h-5 w-5" }),
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "p-4 bg-white border rounded-xl shadow-sm flex items-center justify-between",
            children: [
              e.jsxs("div", {
                className: "space-y-1",
                children: [
                  e.jsx("p", {
                    className:
                      "text-[10px] font-bold text-slate-405 tracking-wider uppercase font-sans",
                    children: "Total Dana Mengendap (Deposit)",
                  }),
                  e.jsxs("h3", {
                    className: "text-xl font-black text-emerald-700",
                    children: ["Rp ", Qn.toLocaleString("id-ID")],
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "h-10 w-10 rounded-lg bg-emerald-50 flex items-center justify-center text-emerald-650",
                children: e.jsx(Ap, { className: "h-5 w-5" }),
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "p-4 bg-white border rounded-xl shadow-sm flex items-center justify-between",
            children: [
              e.jsxs("div", {
                className: "space-y-1",
                children: [
                  e.jsx("p", {
                    className:
                      "text-[10px] font-bold text-slate-405 tracking-wider uppercase font-sans",
                    children: "Komisi Terdistribusi di Muka",
                  }),
                  e.jsxs("h3", {
                    className: "text-xl font-black text-indigo-700",
                    children: ["Rp ", _n.toLocaleString("id-ID")],
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "h-10 w-10 rounded-lg bg-indigo-50 flex items-center justify-center text-indigo-650",
                children: e.jsx(Tf, { className: "h-5 w-5" }),
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "p-4 bg-white border rounded-xl shadow-sm flex items-center justify-between",
            children: [
              e.jsxs("div", {
                className: "space-y-1",
                children: [
                  e.jsx("p", {
                    className:
                      "text-[10px] font-bold text-slate-405 tracking-wider uppercase font-sans",
                    children: "Volume Penjualan Grosir",
                  }),
                  e.jsxs("h3", {
                    className: "text-xl font-black text-cyan-700",
                    children: [
                      "Rp ",
                      J.reduce((v, Pe) => v + Pe.total_sales, 0).toLocaleString(
                        "id-ID",
                      ),
                    ],
                  }),
                ],
              }),
              e.jsx("div", {
                className:
                  "h-10 w-10 rounded-lg bg-cyan-50 flex items-center justify-center text-cyan-650",
                children: e.jsx(pu, { className: "h-5 w-5" }),
              }),
            ],
          }),
        ],
      }),
      Te &&
        e.jsxs("div", {
          className:
            "p-6 bg-slate-900 text-slate-100 rounded-2xl border border-emerald-500/25 shadow-2xl space-y-6",
          children: [
            e.jsxs("div", {
              className:
                "flex flex-col sm:flex-row sm:items-center justify-between border-b border-slate-800 pb-4 gap-2",
              children: [
                e.jsxs("div", {
                  className: "flex items-center gap-3",
                  children: [
                    e.jsx("span", {
                      className:
                        "h-3.5 w-3.5 rounded-full bg-emerald-500 animate-pulse shadow shadow-emerald-500/50",
                    }),
                    e.jsxs("div", {
                      children: [
                        e.jsxs("h3", {
                          className:
                            "text-base font-black text-white uppercase tracking-wide flex items-center gap-2",
                          children: [
                            e.jsx(Fr, {
                              className:
                                "h-5 w-5 text-emerald-400 animate-bounce",
                            }),
                            e.jsx("span", {
                              children:
                                "Android Agent Mobile Simulator & Notification Gateway",
                            }),
                          ],
                        }),
                        e.jsx("p", {
                          className:
                            "text-[11px] text-slate-400 font-sans mt-0.5",
                          children:
                            "Uji coba aplikasi agen lapangan MikRobiL langsung dari bilah browser Anda.",
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsx("button", {
                  onClick: () => {
                    (Ie(!1), y([]), O(""));
                  },
                  className:
                    "px-3 py-1 bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white text-xs font-bold rounded-lg border border-slate-700 cursor-pointer transition-colors",
                  children: "Tutup Simulator [X]",
                }),
              ],
            }),
            e.jsxs("div", {
              className: "grid grid-cols-1 xl:grid-cols-12 gap-6 items-start",
              children: [
                e.jsxs("div", {
                  className:
                    "xl:col-span-4 bg-slate-950 p-4 rounded-2xl border border-slate-800 space-y-5 text-xs text-slate-300 text-left",
                  children: [
                    e.jsxs("div", {
                      children: [
                        e.jsx("span", {
                          className:
                            "px-2 py-0.5 rounded bg-emerald-950 text-emerald-400 text-[9px] font-mono font-bold tracking-wider uppercase",
                          children: "SIMULASI OTENTIKASI AGEN",
                        }),
                        e.jsx("label", {
                          className:
                            "font-extrabold text-slate-400 block mt-2 mb-1.5",
                          children: "1. Pilih Akun Keagenan:",
                        }),
                        e.jsxs("select", {
                          value: me ? String(me.id) : "",
                          onChange: (v) => {
                            const Pe = J.find(
                              (vt) => vt.id === Number(v.target.value),
                            );
                            (Oe(Pe || null), y([]), O(""));
                          },
                          className:
                            "w-full p-2.5 bg-slate-900 border border-slate-700 rounded-xl outline-none font-bold text-emerald-400 cursor-pointer focus:border-emerald-500 transition-all text-xs",
                          children: [
                            e.jsx("option", {
                              value: "",
                              disabled: !0,
                              children: "-- Pilih Agen untuk Login --",
                            }),
                            J.map((v) =>
                              e.jsxs(
                                "option",
                                {
                                  value: v.id,
                                  children: [
                                    v.name,
                                    " (",
                                    v.code,
                                    ") - Saldo: Rp ",
                                    v.balance.toLocaleString("id-ID"),
                                  ],
                                },
                                v.id,
                              ),
                            ),
                          ],
                        }),
                      ],
                    }),
                    me
                      ? e.jsxs("div", {
                          className: "space-y-4",
                          children: [
                            e.jsxs("div", {
                              className:
                                "bg-slate-900/80 p-3.5 rounded-xl border border-slate-800 space-y-2",
                              children: [
                                e.jsxs("div", {
                                  className:
                                    "flex justify-between border-b border-slate-800 pb-1.5 items-center",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-slate-400 font-medium",
                                      children: "Status Agen:",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "px-2 py-0.5 rounded bg-cyan-950 text-cyan-300 font-bold uppercase text-[9px]",
                                      children: "ONLINE via APK",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "flex justify-between items-center text-[11px]",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-slate-500",
                                      children: "Kode Unik Agen:",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "font-mono font-black text-white uppercase",
                                      children: me.code,
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "flex justify-between items-center text-[11px]",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-slate-500",
                                      children: "Komisi Diskon:",
                                    }),
                                    e.jsxs("span", {
                                      className: "font-bold text-indigo-400",
                                      children: [me.commission_pct, "%"],
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className:
                                    "flex justify-between items-center text-[11px] border-t border-slate-800/50 pt-1.5",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-slate-500 font-sans",
                                      children: "Saldo Ritel Saat Ini:",
                                    }),
                                    e.jsxs("span", {
                                      className:
                                        "font-bold text-emerald-400 text-xs",
                                      children: [
                                        "Rp ",
                                        me.balance.toLocaleString("id-ID"),
                                      ],
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className:
                                "bg-slate-900/40 p-3.5 rounded-xl border border-slate-800/80 space-y-2",
                              children: [
                                e.jsxs("h4", {
                                  className:
                                    "font-bold text-white text-[11px] uppercase tracking-wide flex items-center gap-1",
                                  children: [
                                    e.jsx(ao, {
                                      className: "h-3.5 w-3.5 text-cyan-400",
                                    }),
                                    e.jsx("span", {
                                      children: "Metode Sinkronisasi",
                                    }),
                                  ],
                                }),
                                e.jsx("p", {
                                  className:
                                    "text-[10px] text-slate-400 leading-relaxed font-sans",
                                  children:
                                    "Semua transaksi di dalam smartphone mockup di sebelah kanan disinkronisasikan langsung ke server Mikrotik via API Radius. Saldo keagenan dipotong otomatis saat itu juga secara real-time.",
                                }),
                              ],
                            }),
                          ],
                        })
                      : e.jsx("div", {
                          className:
                            "p-8 text-center bg-slate-900/30 rounded-xl border border-dashed border-slate-800 text-slate-500",
                          children: e.jsx("p", {
                            className: "font-sans",
                            children:
                              "Silakan pilih salah satu akun agen di atas untuk memulai simulasi handset genggam android lapangan.",
                          }),
                        }),
                  ],
                }),
                e.jsx("div", {
                  className: "xl:col-span-8 flex flex-col items-center",
                  children: e.jsxs("div", {
                    className:
                      "w-full max-w-lg bg-slate-950 border-[5px] border-slate-800 rounded-3xl overflow-hidden shadow-2xl relative flex flex-col",
                    style: { minHeight: "520px" },
                    children: [
                      e.jsxs("div", {
                        className:
                          "bg-slate-900 px-4 py-2 flex items-center justify-between text-[11px] text-slate-400 border-b border-slate-850 font-mono",
                        children: [
                          e.jsxs("div", {
                            className: "flex items-center gap-1",
                            children: [
                              e.jsx("span", {
                                className: "font-bold text-white",
                                children: "09:41",
                              }),
                              e.jsx("span", {
                                className: "text-emerald-500",
                                children: "● 4G LTE",
                              }),
                            ],
                          }),
                          e.jsx("div", {
                            className:
                              "w-20 h-4 bg-slate-950 rounded-b-xl absolute top-0 left-1/2 transform -translate-x-1/2 flex items-center justify-center",
                            children: e.jsx("span", {
                              className:
                                "h-1.5 w-1.5 rounded-full bg-slate-800",
                            }),
                          }),
                          e.jsxs("div", {
                            className: "flex items-center gap-x-2",
                            children: [
                              e.jsx("span", {
                                className: "text-[10px]",
                                children: "📶 MikRobiL_OS",
                              }),
                              e.jsx("span", { children: "🔋 85%" }),
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "bg-gradient-to-r from-emerald-950 to-slate-900 px-4 py-3.5 flex items-center justify-between border-b border-emerald-500/15",
                        children: [
                          e.jsxs("div", {
                            className: "flex items-center gap-2",
                            children: [
                              e.jsx("div", {
                                className:
                                  "h-7 w-7 rounded-lg bg-emerald-500/10 border border-emerald-400/20 flex items-center justify-center text-[10px] text-emerald-400 font-bold uppercase",
                                children: "APK",
                              }),
                              e.jsxs("div", {
                                className: "text-left leading-none",
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "text-xs font-extrabold text-white block",
                                    children: "MIKROBIL AGENT PORTAL",
                                  }),
                                  e.jsxs("span", {
                                    className:
                                      "text-[9px] text-emerald-400 font-mono",
                                    children: [
                                      "V.2.4.1 (Android) - ",
                                      me ? me.name : "Belum Login",
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          me &&
                            e.jsxs("div", {
                              className: "text-right",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-[8px] text-slate-400 block uppercase font-mono",
                                  children: "Saldo Anda",
                                }),
                                e.jsxs("span", {
                                  className:
                                    "text-xs font-black text-emerald-400 font-mono",
                                  children: [
                                    "Rp ",
                                    me.balance.toLocaleString("id-ID"),
                                  ],
                                }),
                              ],
                            }),
                        ],
                      }),
                      e.jsx("div", {
                        className:
                          "flex-1 p-4 overflow-y-auto max-h-[380px] custom-scroll text-left",
                        children: me
                          ? e.jsxs(e.Fragment, {
                              children: [
                                e.jsx("div", {
                                  className:
                                    "flex border-b border-slate-800 mb-4 text-[10px] font-bold uppercase text-center select-none gap-1 bg-slate-900 p-1 rounded-xl",
                                  children: [
                                    {
                                      id: "vouchers",
                                      label: "🎫 Beli Voucher",
                                      color:
                                        "text-indigo-400 border-indigo-400",
                                    },
                                    {
                                      id: "topup",
                                      label: "💵 Top Up Agent",
                                      color:
                                        "text-emerald-400 border-emerald-400",
                                    },
                                    {
                                      id: "customers",
                                      label: "👥 Pelanggan Saya",
                                      color: "text-cyan-400 border-cyan-400",
                                    },
                                    {
                                      id: "ping",
                                      label: "📡 PING & Cek",
                                      color: "text-amber-400 border-amber-400",
                                    },
                                  ].map((v) =>
                                    e.jsx(
                                      "button",
                                      {
                                        onClick: () => {
                                          (C(v.id), O(""), z(""));
                                        },
                                        className: `flex-1 py-1.5 rounded-lg transition-all cursor-pointer ${g === v.id ? "bg-slate-950 text-white shadow-sm font-black border border-slate-800" : "text-slate-400 hover:text-slate-200"}`,
                                        children: v.label,
                                      },
                                      v.id,
                                    ),
                                  ),
                                }),
                                K &&
                                  e.jsxs("div", {
                                    className:
                                      "mb-4 p-3 bg-emerald-950/85 border border-emerald-500/30 text-emerald-300 text-[11px] rounded-xl font-medium font-sans flex items-start gap-1.5 animate-fadeIn",
                                    children: [
                                      e.jsx(tn, {
                                        className:
                                          "h-4.5 w-4.5 shrink-0 text-emerald-400",
                                      }),
                                      e.jsx("span", { children: K }),
                                    ],
                                  }),
                                P &&
                                  e.jsxs("div", {
                                    className:
                                      "mb-4 p-3 bg-rose-955/85 border border-rose-500/30 text-rose-300 text-[11px] rounded-xl font-medium font-sans flex items-start gap-1.5 animate-fadeIn",
                                    children: [
                                      e.jsx(to, {
                                        className:
                                          "h-4.5 w-4.5 shrink-0 text-rose-400",
                                      }),
                                      e.jsx("span", { children: P }),
                                    ],
                                  }),
                                g === "vouchers" &&
                                  e.jsxs("div", {
                                    className: "space-y-3",
                                    children: [
                                      e.jsxs("div", {
                                        className:
                                          "bg-slate-900/60 p-3 rounded-xl border border-slate-850",
                                        children: [
                                          e.jsx("span", {
                                            className:
                                              "text-[9px] font-mono font-bold text-indigo-400 uppercase tracking-widest block mb-2",
                                            children:
                                              "PROSES CETAK DAN JUAL VOUCHER WIFI",
                                          }),
                                          e.jsxs("form", {
                                            onSubmit: $t,
                                            className: "space-y-3.5",
                                            children: [
                                              e.jsxs("div", {
                                                children: [
                                                  e.jsx("label", {
                                                    className:
                                                      "text-[10px] text-slate-400 font-bold block mb-1",
                                                    children:
                                                      "Pilih Paket Kecepatan WiFi:",
                                                  }),
                                                  e.jsx("select", {
                                                    value: te.profileId,
                                                    onChange: (v) =>
                                                      Ae({
                                                        ...te,
                                                        profileId:
                                                          v.target.value,
                                                      }),
                                                    className:
                                                      "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg outline-none text-xs text-white cursor-pointer",
                                                    children: ue.map((v) =>
                                                      e.jsxs(
                                                        "option",
                                                        {
                                                          value: v.id,
                                                          children: [
                                                            v.name,
                                                            " - Rp ",
                                                            v.price.toLocaleString(
                                                              "id-ID",
                                                            ),
                                                            " (",
                                                            v.rate_limit,
                                                            ")",
                                                          ],
                                                        },
                                                        v.id,
                                                      ),
                                                    ),
                                                  }),
                                                ],
                                              }),
                                              e.jsxs("div", {
                                                className:
                                                  "grid grid-cols-2 gap-2",
                                                children: [
                                                  e.jsxs("div", {
                                                    children: [
                                                      e.jsx("label", {
                                                        className:
                                                          "text-[10px] text-slate-400 font-bold block mb-1",
                                                        children:
                                                          "Jumlah Voucher:",
                                                      }),
                                                      e.jsxs("select", {
                                                        value: String(
                                                          te.quantity,
                                                        ),
                                                        onChange: (v) =>
                                                          Ae({
                                                            ...te,
                                                            quantity: Number(
                                                              v.target.value,
                                                            ),
                                                          }),
                                                        className:
                                                          "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg outline-none text-xs text-white cursor-pointer",
                                                        children: [
                                                          e.jsx("option", {
                                                            value: "5",
                                                            children:
                                                              "5 Lembar",
                                                          }),
                                                          e.jsx("option", {
                                                            value: "10",
                                                            children:
                                                              "10 Lembar",
                                                          }),
                                                          e.jsx("option", {
                                                            value: "20",
                                                            children:
                                                              "20 Lembar",
                                                          }),
                                                          e.jsx("option", {
                                                            value: "50",
                                                            children:
                                                              "50 Lembar",
                                                          }),
                                                        ],
                                                      }),
                                                    ],
                                                  }),
                                                  e.jsxs("div", {
                                                    children: [
                                                      e.jsx("label", {
                                                        className:
                                                          "text-[10px] text-slate-400 font-bold block mb-1",
                                                        children:
                                                          "Estimasi Tagihan Saldo:",
                                                      }),
                                                      e.jsxs("div", {
                                                        className:
                                                          "p-2 bg-slate-950 border border-slate-850 rounded-lg text-xs font-mono font-bold text-cyan-400 mt-0.5",
                                                        children: [
                                                          "Rp ",
                                                          (
                                                            (((ga = ue.find(
                                                              (v) =>
                                                                v.id ===
                                                                Number(
                                                                  te.profileId,
                                                                ),
                                                            )) == null
                                                              ? void 0
                                                              : ga.price) ||
                                                              5e3) *
                                                            te.quantity *
                                                            (1 -
                                                              me.commission_pct /
                                                                100)
                                                          ).toLocaleString(
                                                            "id-ID",
                                                          ),
                                                        ],
                                                      }),
                                                    ],
                                                  }),
                                                ],
                                              }),
                                              e.jsxs("button", {
                                                type: "submit",
                                                className:
                                                  "w-full py-2.5 bg-indigo-650 hover:bg-indigo-600 text-white font-extrabold rounded-xl text-xs cursor-pointer shadow-lg hover:shadow-indigo-500/10 flex items-center justify-center gap-1.5 transition-all uppercase",
                                                children: [
                                                  e.jsx(Op, {
                                                    className: "h-4 w-4",
                                                  }),
                                                  e.jsx("span", {
                                                    children:
                                                      "Cetak & Potong Saldo Ritel",
                                                  }),
                                                ],
                                              }),
                                            ],
                                          }),
                                        ],
                                      }),
                                      Ue.length > 0 &&
                                        e.jsxs("div", {
                                          className:
                                            "bg-slate-900 border border-slate-800 rounded-xl p-3 space-y-2",
                                          children: [
                                            e.jsxs("div", {
                                              className:
                                                "flex items-center justify-between border-b border-slate-800 pb-1.5",
                                              children: [
                                                e.jsxs("span", {
                                                  className:
                                                    "text-[10px] font-bold text-slate-300 flex items-center gap-1 font-mono",
                                                  children: [
                                                    e.jsx(fc, {
                                                      className:
                                                        "h-3.5 w-3.5 text-indigo-400",
                                                    }),
                                                    e.jsxs("span", {
                                                      children: [
                                                        "Hasil Cetak Terbaru (",
                                                        Ue.length,
                                                        " Pcs)",
                                                      ],
                                                    }),
                                                  ],
                                                }),
                                                e.jsx("button", {
                                                  onClick: () => {
                                                    alert(
                                                      "Menghubungkan ke Bluetooth Thermal Printer RT_POS_58 via bluetooth android core...",
                                                    );
                                                  },
                                                  className:
                                                    "px-2 py-0.5 bg-slate-800 hover:bg-slate-750 text-[9px] text-white font-bold rounded flex items-center gap-1 border border-slate-700 cursor-pointer",
                                                  children: "🖨️ Cetak Thermal",
                                                }),
                                              ],
                                            }),
                                            e.jsx("div", {
                                              className:
                                                "grid grid-cols-2 gap-1.5 max-h-40 overflow-y-auto custom-scroll p-0.5",
                                              children: Ue.map((v, Pe) =>
                                                e.jsxs(
                                                  "div",
                                                  {
                                                    className:
                                                      "p-1 px-2 bg-slate-950 border border-slate-850 rounded text-center font-mono text-[9px] text-slate-300 relative",
                                                    children: [
                                                      e.jsxs("div", {
                                                        className:
                                                          "flex justify-between text-[7px] text-slate-500 font-sans",
                                                        children: [
                                                          e.jsx("span", {
                                                            children: "JAYANET",
                                                          }),
                                                          e.jsx("span", {
                                                            className:
                                                              "text-cyan-400 font-bold",
                                                            children:
                                                              v.validity,
                                                          }),
                                                        ],
                                                      }),
                                                      e.jsx("div", {
                                                        className:
                                                          "bg-slate-900 text-yellow-350 font-bold p-1 rounded my-1 text-center border border-slate-800",
                                                        children: v.code,
                                                      }),
                                                      e.jsxs("div", {
                                                        className:
                                                          "flex justify-between text-[7px] font-sans",
                                                        children: [
                                                          e.jsx("span", {
                                                            children: v.speed,
                                                          }),
                                                          e.jsxs("span", {
                                                            className:
                                                              "font-bold text-emerald-450",
                                                            children: [
                                                              "Rp ",
                                                              v.price,
                                                            ],
                                                          }),
                                                        ],
                                                      }),
                                                    ],
                                                  },
                                                  Pe,
                                                ),
                                              ),
                                            }),
                                          ],
                                        }),
                                    ],
                                  }),
                                g === "topup" &&
                                  e.jsx("div", {
                                    className: "space-y-3",
                                    children: e.jsxs("div", {
                                      className:
                                        "bg-slate-900/60 p-3 rounded-xl border border-slate-850",
                                      children: [
                                        e.jsx("span", {
                                          className:
                                            "text-[9px] font-mono font-bold text-emerald-400 uppercase tracking-widest block mb-2",
                                          children: "TOP UP SALDO AGEN INSTAN",
                                        }),
                                        Ne
                                          ? e.jsxs("div", {
                                              className:
                                                "text-center space-y-3 p-2 bg-slate-950 rounded-lg",
                                              children: [
                                                e.jsxs("span", {
                                                  className:
                                                    "text-[9px] font-mono font-bold text-amber-400 block uppercase",
                                                  children: [
                                                    "INVOICE DEPOSIT AGEN #",
                                                    me.code,
                                                    "-TX",
                                                  ],
                                                }),
                                                e.jsx("div", {
                                                  className:
                                                    "mx-auto w-32 h-32 bg-white border border-slate-800 p-1 flex items-center justify-center rounded",
                                                  children: e.jsx("div", {
                                                    className:
                                                      "p-1 bg-slate-50 border border-slate-350",
                                                    children: e.jsx("svg", {
                                                      className:
                                                        "h-28 w-28 text-slate-950",
                                                      viewBox: "0 0 24 24",
                                                      fill: "currentColor",
                                                      children: e.jsx("path", {
                                                        d: "M2 2h6v6H2V2zm2 2v2h2V4H4zm0 10v6h6v-6H4zm2 2v2h2v-2H6zm10-12h6v6h-6V4zm2 2v2h2V6H18zm-2 10h2v2h-2v-2zm2 2h2v2h-2v-2zm2-2h2v2h-2v-2zm-2-2h2v2h-2v-2zm-6 2h2v2H10v-2zm2-2h2v2h-2v-2zm-2-2h2v2H10v-2zm6-4h2v2h-2V8zm0-4h2v2h-2V4z",
                                                      }),
                                                    }),
                                                  }),
                                                }),
                                                e.jsxs("p", {
                                                  className:
                                                    "text-[10px] font-bold text-slate-300",
                                                  children: [
                                                    "TOTAL: Rp ",
                                                    Number(I).toLocaleString(
                                                      "id-ID",
                                                    ),
                                                  ],
                                                }),
                                                e.jsx("p", {
                                                  className:
                                                    "text-[8px] text-slate-500",
                                                  children:
                                                    "Scan QRIS dari aplikasi dompet digital GoPay, OVO, Dana atau Mobile Banking Agen.",
                                                }),
                                                e.jsxs("div", {
                                                  className: "flex gap-2",
                                                  children: [
                                                    e.jsx("button", {
                                                      onClick: () => $e(!1),
                                                      className:
                                                        "flex-1 py-1 px-2.5 bg-slate-800 hover:bg-slate-750 text-slate-300 font-bold rounded-lg text-[10px] cursor-pointer",
                                                      children: "Batal",
                                                    }),
                                                    e.jsx("button", {
                                                      onClick: Xt,
                                                      className:
                                                        "flex-1 py-1 px-2.5 bg-emerald-600 hover:bg-emerald-500 text-white font-extrabold rounded-lg text-[10px] cursor-pointer shadow-md",
                                                      children:
                                                        "Simulasikan Bayar Lunas ✓",
                                                    }),
                                                  ],
                                                }),
                                              ],
                                            })
                                          : e.jsxs("form", {
                                              onSubmit: pt,
                                              className: "space-y-3",
                                              children: [
                                                e.jsxs("div", {
                                                  children: [
                                                    e.jsx("label", {
                                                      className:
                                                        "text-[10px] text-slate-400 font-bold block mb-1",
                                                      children:
                                                        "Masukkan Jumlah Top Up (Rupiah):",
                                                    }),
                                                    e.jsx("input", {
                                                      type: "number",
                                                      required: !0,
                                                      value: I,
                                                      onChange: (v) =>
                                                        X(v.target.value),
                                                      placeholder:
                                                        "Contoh: 100000",
                                                      className:
                                                        "w-full p-2.5 bg-slate-950 border border-slate-800 rounded-xl outline-none text-xs text-white text-left font-mono focus:border-emerald-500",
                                                    }),
                                                  ],
                                                }),
                                                e.jsxs("div", {
                                                  className: "space-y-1",
                                                  children: [
                                                    e.jsx("label", {
                                                      className:
                                                        "text-[10px] text-slate-400 font-bold block mb-1",
                                                      children:
                                                        "Saluran Pembayaran Virtual:",
                                                    }),
                                                    e.jsxs("div", {
                                                      className:
                                                        "grid grid-cols-2 gap-1.5",
                                                      children: [
                                                        e.jsx("div", {
                                                          className:
                                                            "p-2 bg-slate-950 border border-emerald-500/20 text-emerald-400 text-center font-bold text-[10px] rounded-lg",
                                                          children:
                                                            "QRIS GPN (Auto Settlement)",
                                                        }),
                                                        e.jsx("div", {
                                                          className:
                                                            "p-2 bg-slate-950/40 border border-slate-850 text-slate-500 text-center text-[10px] rounded-lg cursor-not-allowed",
                                                          children:
                                                            "Xendit VA (Deposit Manual)",
                                                        }),
                                                      ],
                                                    }),
                                                  ],
                                                }),
                                                e.jsxs("button", {
                                                  type: "submit",
                                                  className:
                                                    "w-full py-2 bg-emerald-600 hover:bg-emerald-555 text-white font-extrabold rounded-xl text-xs cursor-pointer shadow-md flex items-center justify-center gap-1 ",
                                                  children: [
                                                    e.jsx(Va, {
                                                      className:
                                                        "h-4.5 w-4.5 shrink-0",
                                                    }),
                                                    e.jsx("span", {
                                                      children:
                                                        "Dapatkan Barcode QRIS",
                                                    }),
                                                  ],
                                                }),
                                              ],
                                            }),
                                      ],
                                    }),
                                  }),
                                g === "customers" &&
                                  e.jsxs("div", {
                                    className: "space-y-3",
                                    children: [
                                      e.jsxs("div", {
                                        className:
                                          "flex items-center justify-between",
                                        children: [
                                          e.jsxs("span", {
                                            className:
                                              "text-[9px] font-mono font-bold text-cyan-400 uppercase tracking-widest block",
                                            children: [
                                              "PELANGGAN RETAIL SAYA (",
                                              Me.length,
                                              ")",
                                            ],
                                          }),
                                          e.jsx("span", {
                                            className:
                                              "text-[8px] text-slate-550 font-mono",
                                            children: "Real-time sync",
                                          }),
                                        ],
                                      }),
                                      e.jsx("div", {
                                        className:
                                          "space-y-2.5 max-h-56 overflow-y-auto custom-scroll pr-1",
                                        children: Me.map((v) =>
                                          e.jsxs(
                                            "div",
                                            {
                                              className:
                                                "p-2.5 bg-slate-900 border border-slate-850 rounded-xl flex items-center justify-between text-xs gap-2",
                                              children: [
                                                e.jsxs("div", {
                                                  className:
                                                    "space-y-0.5 text-left",
                                                  children: [
                                                    e.jsxs("div", {
                                                      className:
                                                        "flex items-center gap-1.5",
                                                      children: [
                                                        e.jsx("span", {
                                                          className:
                                                            "font-extrabold text-white text-[11px] block",
                                                          children: v.name,
                                                        }),
                                                        v.status === "online"
                                                          ? e.jsx("span", {
                                                              className:
                                                                "h-1.5 w-1.5 rounded-full bg-emerald-400",
                                                            })
                                                          : e.jsx("span", {
                                                              className:
                                                                "h-1.5 w-1.5 rounded-full bg-orange-400",
                                                            }),
                                                      ],
                                                    }),
                                                    e.jsxs("div", {
                                                      className:
                                                        "text-[9px] text-slate-400 font-sans flex flex-wrap gap-x-2",
                                                      children: [
                                                        e.jsx("span", {
                                                          className:
                                                            "text-cyan-400 bg-cyan-950/60 px-1 rounded text-[8px]",
                                                          children: v.type,
                                                        }),
                                                        e.jsxs("span", {
                                                          children: [
                                                            "Plan: ",
                                                            v.plan,
                                                          ],
                                                        }),
                                                        e.jsxs("span", {
                                                          className:
                                                            "font-mono text-slate-500",
                                                          children: [
                                                            "| ",
                                                            v.traffic,
                                                          ],
                                                        }),
                                                      ],
                                                    }),
                                                  ],
                                                }),
                                                e.jsxs("div", {
                                                  className:
                                                    "space-y-1 text-right shrink-0",
                                                  children: [
                                                    e.jsx("div", {
                                                      className:
                                                        "text-[9.5px] font-mono leading-none",
                                                      children:
                                                        v.status === "online"
                                                          ? e.jsxs("span", {
                                                              className:
                                                                "text-emerald-400 font-bold",
                                                              children: [
                                                                "ON ",
                                                                v.durationLeft,
                                                              ],
                                                            })
                                                          : e.jsx("span", {
                                                              className:
                                                                "text-rose-400 font-bold bg-rose-950/20 px-1 rounded",
                                                              children: "OFF",
                                                            }),
                                                    }),
                                                    v.status === "offline"
                                                      ? e.jsx("button", {
                                                          onClick: () => {
                                                            alert(
                                                              `Waktu respon terdeteksi timeout! Notifikasi Peringatan Gangguan otomatis terkirim untuk ${v.name} via WhatsApp Gateway.`,
                                                            );
                                                          },
                                                          className:
                                                            "py-0.5 px-1.5 bg-rose-950/60 hover:bg-rose-900 text-rose-350 text-[8px] font-extrabold rounded border border-rose-800 cursor-pointer",
                                                          children:
                                                            "🚨 Alert Klien",
                                                        })
                                                      : e.jsx("button", {
                                                          onClick: () => {
                                                            alert(
                                                              `Ping diagnostik dikirim ke CPE ${v.name}: Rerata RTT 12ms. Koneksi prima.`,
                                                            );
                                                          },
                                                          className:
                                                            "py-0.5 px-1.5 bg-slate-800 hover:bg-slate-750 text-slate-300 text-[8px] font-bold rounded cursor-pointer",
                                                          children: "Uji Laten",
                                                        }),
                                                  ],
                                                }),
                                              ],
                                            },
                                            v.id,
                                          ),
                                        ),
                                      }),
                                    ],
                                  }),
                                g === "ping" &&
                                  e.jsx("div", {
                                    className: "space-y-3",
                                    children: e.jsxs("div", {
                                      className:
                                        "bg-slate-900/60 p-3 rounded-xl border border-slate-850",
                                      children: [
                                        e.jsx("span", {
                                          className:
                                            "text-[9px] font-mono font-bold text-amber-400 uppercase tracking-widest block mb-2",
                                          children: "PING & DIAGNOSTIK KONEKSI",
                                        }),
                                        e.jsxs("div", {
                                          className: "flex gap-1.5 items-end",
                                          children: [
                                            e.jsxs("div", {
                                              className: "flex-1",
                                              children: [
                                                e.jsx("label", {
                                                  className:
                                                    "text-[10px] text-slate-400 font-bold block mb-1",
                                                  children:
                                                    "Host Target IP/Domain:",
                                                }),
                                                e.jsx("input", {
                                                  type: "text",
                                                  value: ae,
                                                  onChange: (v) =>
                                                    ze(v.target.value),
                                                  placeholder:
                                                    "Contoh: google.com",
                                                  className:
                                                    "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg outline-none text-xs text-white text-left font-mono focus:border-amber-500",
                                                }),
                                              ],
                                            }),
                                            e.jsx("button", {
                                              onClick: xe,
                                              disabled: at,
                                              className: `py-2 px-3 text-white text-xs font-bold rounded-lg cursor-pointer transition-colors ${at ? "bg-slate-750 text-slate-500 cursor-not-allowed" : "bg-amber-600 hover:bg-amber-500"}`,
                                              children: at
                                                ? "Running..."
                                                : "Kirim ICMP",
                                            }),
                                          ],
                                        }),
                                        Mt.length > 0 &&
                                          e.jsx("div", {
                                            className:
                                              "mt-3 p-2 bg-slate-950 rounded-lg border border-slate-850 text-[10px] font-mono text-cyan-400 text-left space-y-1.5 max-h-48 overflow-y-auto custom-scroll",
                                            children: Mt.map((v, Pe) =>
                                              e.jsx(
                                                "div",
                                                {
                                                  className:
                                                    "whitespace-pre-wrap",
                                                  children: v,
                                                },
                                                Pe,
                                              ),
                                            ),
                                          }),
                                      ],
                                    }),
                                  }),
                              ],
                            })
                          : e.jsxs("div", {
                              className:
                                "p-16 text-center text-slate-500 space-y-2.5",
                              children: [
                                e.jsx(Fr, {
                                  className:
                                    "mx-auto h-10 w-10 text-slate-700 animate-pulse",
                                }),
                                e.jsx("h4", {
                                  className: "font-bold text-slate-400 text-xs",
                                  children: "Simulasi Gawai Belum Aktif",
                                }),
                                e.jsx("p", {
                                  className:
                                    "font-sans text-[11px] leading-relaxed max-w-xs mx-auto",
                                  children:
                                    "Silakan pilih agen di panel sebelah kiri untuk memproses aktivasi simulasi smartphone Mitra Kios Agent Portal field.",
                                }),
                              ],
                            }),
                      }),
                      e.jsx("div", {
                        className:
                          "bg-slate-900 py-3 flex items-center justify-around border-t border-slate-850 text-slate-500 text-[12px] select-none",
                        children: e.jsx("div", {
                          className:
                            "h-1.5 w-24 bg-slate-800 rounded-full animate-pulse",
                        }),
                      }),
                    ],
                  }),
                }),
              ],
            }),
            e.jsxs("div", {
              className:
                "p-5 bg-slate-950 border border-slate-800 rounded-2xl space-y-4 text-left",
              children: [
                e.jsxs("div", {
                  className:
                    "flex flex-col md:flex-row md:items-center justify-between border-b border-slate-850 pb-3 gap-2",
                  children: [
                    e.jsxs("div", {
                      children: [
                        e.jsx("span", {
                          className:
                            "px-2 py-0.5 rounded bg-indigo-950 text-indigo-400 text-[9px] font-mono font-bold tracking-wider uppercase",
                          children: "SIARAN GERBANG NOTIFIKASI",
                        }),
                        e.jsx("h4", {
                          className:
                            "text-sm font-extrabold text-white mt-1 flex items-center gap-1.5",
                          children: e.jsx("span", {
                            children:
                              "Gerbang Notifikasi Terintegrasi (WhatsApp & Telegram Gateway Settings)",
                          }),
                        }),
                        e.jsx("p", {
                          className: "text-[11px] text-slate-400 font-sans",
                          children:
                            "Hubungkan server router dengan platform pihak ketiga untuk mengirim notifikasi penagihan & pemeliharaan server secara otomatis.",
                        }),
                      ],
                    }),
                    e.jsx("div", { className: "h-2 w-2" }),
                  ],
                }),
                oa &&
                  e.jsx("div", {
                    className:
                      "p-3 bg-indigo-950/80 border border-indigo-500/20 text-indigo-300 text-xs rounded-xl font-medium font-sans",
                    children: oa,
                  }),
                e.jsxs("div", {
                  className:
                    "grid grid-cols-1 lg:grid-cols-12 gap-5 text-xs text-slate-350",
                  children: [
                    e.jsxs("div", {
                      className:
                        "lg:col-span-4 bg-slate-900/60 p-4 rounded-xl border border-slate-800 space-y-3",
                      children: [
                        e.jsx("div", {
                          className:
                            "flex items-center gap-2 text-emerald-400 font-bold uppercase text-[10px] tracking-wider mb-1",
                          children: e.jsx("span", {
                            children: "🟢 WHATSAPP GATEWAY (Wafone/Wablas)",
                          }),
                        }),
                        e.jsxs("div", {
                          className: "space-y-1",
                          children: [
                            e.jsx("label", {
                              className: "text-slate-450 block font-bold",
                              children: "API Key WhatsApp Token:",
                            }),
                            e.jsx("input", {
                              type: "text",
                              value: Fe,
                              onChange: (v) => fa(v.target.value),
                              placeholder: "WAG-xxxxxxxxxxxx",
                              className:
                                "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg text-white font-mono outline-none focus:border-emerald-500",
                            }),
                            e.jsx("span", {
                              className:
                                "text-[10px] text-slate-500 font-sans block",
                              children:
                                "Format: API key otentikasi dari gateway broker anda.",
                            }),
                          ],
                        }),
                        e.jsx("button", {
                          onClick: () => _s("whatsapp"),
                          disabled: ts !== null,
                          className:
                            "w-full py-2 bg-slate-800 hover:bg-slate-750 text-emerald-400 font-extrabold border border-emerald-500/10 hover:border-emerald-500/30 rounded-xl transition-all flex items-center justify-center gap-1.5 cursor-pointer",
                          children: "📡 Test Kirim Notif Offline via WA",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "lg:col-span-4 bg-slate-900/60 p-4 rounded-xl border border-slate-800 space-y-3",
                      children: [
                        e.jsx("div", {
                          className:
                            "flex items-center gap-2 text-sky-400 font-bold uppercase text-[10px] tracking-wider mb-1",
                          children: e.jsx("span", {
                            children: "🔵 TELEGRAM BOT API GATEWAY",
                          }),
                        }),
                        e.jsxs("div", {
                          className: "space-y-2",
                          children: [
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className: "text-slate-450 block font-bold",
                                  children: "Telegram Bot Token Secret:",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  value: Aa,
                                  onChange: (v) => ps(v.target.value),
                                  placeholder: "bot123456:ABC-DEF...",
                                  className:
                                    "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg text-white font-mono outline-none focus:border-sky-500 text-[11px]",
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "space-y-1",
                              children: [
                                e.jsx("label", {
                                  className: "text-slate-450 block font-bold",
                                  children: "Group / Personal Chat ID:",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  value: ra,
                                  onChange: (v) => es(v.target.value),
                                  placeholder: "-100xxxxxxxxx",
                                  className:
                                    "w-full p-2 bg-slate-950 border border-slate-800 rounded-lg text-white font-mono outline-none focus:border-sky-500",
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsx("button", {
                          onClick: () => _s("telegram"),
                          disabled: ts !== null,
                          className:
                            "w-full py-2 bg-slate-800 hover:bg-slate-750 text-sky-400 font-extrabold border border-sky-500/10 hover:border-sky-500/30 rounded-xl transition-all flex items-center justify-center gap-1.5 cursor-pointer",
                          children: "📨 Test PING Alert via Telegram",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "lg:col-span-4 bg-slate-900/60 p-4 rounded-xl border border-slate-800 space-y-3.5 text-xs",
                      children: [
                        e.jsx("span", {
                          className:
                            "text-slate-400 font-bold uppercase text-[10px] tracking-wider block",
                          children: "⚙️ ATURAN NOTIFIKASI OTOMATIS",
                        }),
                        e.jsxs("div", {
                          className: "space-y-2 pb-1 text-slate-300",
                          children: [
                            e.jsxs("label", {
                              className:
                                "flex items-center gap-2 bg-slate-950/40 p-2 rounded-lg border border-slate-850 hover:bg-slate-950 cursor-pointer select-none",
                              children: [
                                e.jsx("input", {
                                  type: "checkbox",
                                  checked: Ft.offline,
                                  onChange: (v) =>
                                    Tt({ ...Ft, offline: v.target.checked }),
                                  className:
                                    "accent-indigo-500 h-4 w-4 cursor-pointer",
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "block font-bold",
                                      children:
                                        "Pelanggan Offline (Watchdog Ping)",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-555 font-sans leading-tight block",
                                      children:
                                        "Kirim notif ke grup Telegram jika CPE klien RTO > 3 menit.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("label", {
                              className:
                                "flex items-center gap-2 bg-slate-950/40 p-2 rounded-lg border border-slate-850 hover:bg-slate-950 cursor-pointer select-none",
                              children: [
                                e.jsx("input", {
                                  type: "checkbox",
                                  checked: Ft.online,
                                  onChange: (v) =>
                                    Tt({ ...Ft, online: v.target.checked }),
                                  className:
                                    "accent-indigo-500 h-4 w-4 cursor-pointer",
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "block font-bold",
                                      children:
                                        "Pemulihan Koneksi (Klien Online)",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-555 font-sans leading-tight block",
                                      children:
                                        "Kirim notifikasi penyelesaian / online kembali ke pelanggan via WA.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("label", {
                              className:
                                "flex items-center gap-2 bg-slate-950/40 p-2 rounded-lg border border-slate-850 hover:bg-slate-950 cursor-pointer select-none",
                              children: [
                                e.jsx("input", {
                                  type: "checkbox",
                                  checked: Ft.payment,
                                  onChange: (v) =>
                                    Tt({ ...Ft, payment: v.target.checked }),
                                  className:
                                    "accent-indigo-500 h-4 w-4 cursor-pointer",
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "block font-bold",
                                      children:
                                        "Pelanggan Bayar Tagihan (Settlement)",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-555 font-sans leading-tight block",
                                      children:
                                        "Klaim lunas otomatis & kirim kuitansi pembayaran instan ke HP pelanggan.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("label", {
                              className:
                                "flex items-center gap-2 bg-slate-950/40 p-2 rounded-lg border border-slate-850 hover:bg-slate-950 cursor-pointer select-none",
                              children: [
                                e.jsx("input", {
                                  type: "checkbox",
                                  checked: Ft.ticket,
                                  onChange: (v) =>
                                    Tt({ ...Ft, ticket: v.target.checked }),
                                  className:
                                    "accent-indigo-500 h-4 w-4 cursor-pointer",
                                }),
                                e.jsxs("div", {
                                  children: [
                                    e.jsx("span", {
                                      className: "block font-bold",
                                      children:
                                        "Pelanggan Kirim Tiket Gangguan Baru",
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-555 font-sans leading-tight block",
                                      children:
                                        "Kirim penugasan teknisi lewat pesan instan di bot keagenan.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
            e.jsxs("div", {
              className:
                "p-5 bg-slate-950 border border-slate-800 rounded-2xl space-y-4 text-left",
              children: [
                e.jsxs("div", {
                  className:
                    "flex flex-col md:flex-row md:items-center justify-between border-b border-slate-855 pb-3 gap-2",
                  children: [
                    e.jsxs("div", {
                      children: [
                        e.jsx("span", {
                          className:
                            "px-2 py-0.5 rounded bg-cyan-955 text-cyan-400 text-[9px] font-mono font-bold tracking-wider uppercase",
                          children: "INTERACTIVE CUSTOMER & AGENT CHATBOTS",
                        }),
                        e.jsxs("h4", {
                          className:
                            "text-sm font-extrabold text-white mt-1 flex items-center gap-1.5",
                          children: [
                            e.jsx(bc, {
                              className:
                                "h-4.5 w-4.5 text-cyan-455 animate-pulse",
                            }),
                            e.jsx("span", {
                              children:
                                "Interactive Chatbot Simulator (WhatsApp & Telegram Support Bot)",
                            }),
                          ],
                        }),
                        e.jsx("p", {
                          className:
                            "text-[11px] text-slate-400 font-sans mt-0.5",
                          children:
                            "Uji coba interaksi kecerdasan respons otomatis MikRobiL bot langsung dengan mengetik di konsol obrolan.",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "flex gap-1 bg-slate-900 p-1 rounded-xl shrink-0 border border-slate-800",
                      children: [
                        e.jsx("button", {
                          type: "button",
                          onClick: () => Re("whatsapp"),
                          className: `px-3 py-1 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center gap-1 ${st === "whatsapp" ? "bg-emerald-600 text-white shadow-sm font-black" : "text-slate-450 hover:text-slate-200"}`,
                          children: e.jsx("span", { children: "WhatsApp Bot" }),
                        }),
                        e.jsx("button", {
                          type: "button",
                          onClick: () => Re("telegram"),
                          className: `px-3 py-1 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center gap-1 ${st === "telegram" ? "bg-sky-600 text-white shadow-sm font-black" : "text-slate-450 hover:text-slate-200"}`,
                          children: e.jsx("span", { children: "Telegram Bot" }),
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "grid grid-cols-1 lg:grid-cols-12 gap-5 items-stretch",
                  children: [
                    e.jsxs("div", {
                      className:
                        "lg:col-span-5 bg-slate-905/60 p-4 rounded-xl border border-slate-800 flex flex-col justify-between space-y-4",
                      children: [
                        e.jsxs("div", {
                          className: "space-y-3",
                          children: [
                            e.jsx("span", {
                              className:
                                "text-[10px] text-slate-400 font-bold uppercase tracking-widest block",
                              children:
                                "💡 AKSI CEPAT & INTEGRASI RADIUS REAL-TIME",
                            }),
                            e.jsx("p", {
                              className:
                                "text-[11px] text-slate-350 leading-relaxed font-sans",
                              children:
                                "Chatbot simulasi ini terhubung secara real-time ke memori keagenan MikRobiL. Semua perintah yang dikirim akan diproses layaknya sistem aslinya:",
                            }),
                            e.jsxs("div", {
                              className:
                                "space-y-1.5 text-[11px] text-slate-400 font-sans text-left",
                              children: [
                                e.jsxs("div", {
                                  className: "flex items-start gap-1.5",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-emerald-450 font-bold",
                                      children: "✓",
                                    }),
                                    e.jsx("span", {
                                      children:
                                        "Membeli / Cetak voucher akan memotong saldo agen secara otomatis.",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className: "flex items-start gap-1.5",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-emerald-450 font-bold",
                                      children: "✓",
                                    }),
                                    e.jsx("span", {
                                      children:
                                        "Top up saldo via bot akan menambah saldo deposit pada tabel & transaksinya seketika.",
                                    }),
                                  ],
                                }),
                                e.jsxs("div", {
                                  className: "flex items-start gap-1.5",
                                  children: [
                                    e.jsx("span", {
                                      className: "text-emerald-450 font-bold",
                                      children: "✓",
                                    }),
                                    e.jsx("span", {
                                      children:
                                        "Cek status pelanggan menampilkan data valid dari list CRM keagenan.",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              className: "pt-2",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "text-[9px] text-slate-500 font-bold uppercase tracking-wider block mb-1.5 font-sans",
                                  children: "KLIK PUNTASAN CEPAT TOMBOL:",
                                }),
                                e.jsx("div", {
                                  className: "flex flex-wrap gap-1.5",
                                  children: [
                                    {
                                      label: "🎫 Panduan Bot (/help)",
                                      cmd: "/help",
                                      color:
                                        "hover:bg-indigo-950/40 hover:text-indigo-300 hover:border-indigo-850",
                                    },
                                    {
                                      label: "📡 Cek Live Ping (/ping)",
                                      cmd: "/ping google.com",
                                      color:
                                        "hover:bg-amber-950/40 hover:text-amber-300 hover:border-amber-850",
                                    },
                                    {
                                      label: "💵 Tagihan Pelanggan (/tagihan)",
                                      cmd: "/tagihan",
                                      color:
                                        "hover:bg-cyan-955/40 hover:text-cyan-300 hover:border-cyan-850",
                                    },
                                    {
                                      label: "👥 Daftar Pelanggan Saya",
                                      cmd: "/pelanggan",
                                      color:
                                        "hover:bg-emerald-955/40 hover:text-emerald-300 hover:border-emerald-855",
                                    },
                                    {
                                      label: "⚡ Beli Voucher Wifi Bot",
                                      cmd: "/belivoucher",
                                      color:
                                        "hover:bg-fuchsia-955/40 hover:text-fuchsia-300 hover:border-fuchsia-850",
                                    },
                                    {
                                      label: "💰 Top Up 150rb via Bot",
                                      cmd: "/topup 150000",
                                      color:
                                        "hover:bg-cyan-955/40 hover:text-cyan-300 hover:border-cyan-850",
                                    },
                                    {
                                      label: "🖥️ Status Router Core",
                                      cmd: "/status",
                                      color:
                                        "hover:bg-slate-800 hover:text-white hover:border-slate-700",
                                    },
                                  ].map((v, Pe) =>
                                    e.jsx(
                                      "button",
                                      {
                                        type: "button",
                                        onClick: () => qe(v.cmd),
                                        className: `px-2 py-1 bg-slate-950 border border-slate-850 text-[10px] text-slate-350 font-mono rounded-lg cursor-pointer transition-all ${v.color}`,
                                        children: v.label,
                                      },
                                      Pe,
                                    ),
                                  ),
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "p-3.5 bg-slate-950 border border-slate-850 rounded-xl space-y-1.5 text-left",
                          children: [
                            e.jsxs("div", {
                              className: "flex items-center gap-2",
                              children: [
                                e.jsx("div", {
                                  className:
                                    "p-1 rounded bg-cyan-950 text-cyan-400 font-bold text-[9px] font-mono leading-none",
                                  children: "DEBUG SESSION",
                                }),
                                e.jsx("span", {
                                  className:
                                    "text-[10px] font-bold text-slate-300 uppercase font-mono",
                                  children: "MITRA TERPILIH",
                                }),
                              ],
                            }),
                            e.jsx("div", {
                              className:
                                "text-[10px] text-slate-450 font-sans leading-relaxed",
                              children: me
                                ? e.jsxs("p", {
                                    children: [
                                      "Sesi Link Agen: ",
                                      e.jsxs("strong", {
                                        className: "text-emerald-400 font-mono",
                                        children: [me.name, " (", me.code, ")"],
                                      }),
                                      ". Saldo Saat Ini: ",
                                      e.jsxs("strong", {
                                        className: "text-white font-mono",
                                        children: [
                                          "Rp ",
                                          me.balance.toLocaleString("id-ID"),
                                        ],
                                      }),
                                      ".",
                                    ],
                                  })
                                : e.jsx("p", {
                                    className:
                                      "text-amber-500 font-semibold font-sans",
                                    children:
                                      "⚠️ Sesi agen belum aktif. Silakan pilih agen pada Panel Otentikasi Agen (kiri atas) terlebih dahulu untuk menguji sinkronisasi voucher & saldo.",
                                  }),
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "lg:col-span-7 bg-slate-950 border border-slate-800 rounded-2xl overflow-hidden flex flex-col h-[380px] shadow-inner",
                      children: [
                        st === "whatsapp"
                          ? e.jsxs("div", {
                              className:
                                "bg-[#075E54] p-3 px-4 flex items-center justify-between border-b border-white/5 shadow-sm",
                              children: [
                                e.jsxs("div", {
                                  className: "flex items-center gap-2.5",
                                  children: [
                                    e.jsx("div", {
                                      className:
                                        "h-8 w-8 rounded-full bg-slate-100 flex items-center justify-center text-emerald-800 font-bold border border-emerald-500 text-sm",
                                      children: "💬",
                                    }),
                                    e.jsxs("div", {
                                      className: "text-left leading-tight",
                                      children: [
                                        e.jsx("h5", {
                                          className:
                                            "text-xs font-black text-white leading-none",
                                          children: "MikRobiL Billing Bot",
                                        }),
                                        e.jsxs("p", {
                                          className:
                                            "text-[9px] text-emerald-250 font-sans mt-0.5 font-medium flex items-center gap-1",
                                          children: [
                                            e.jsx("span", {
                                              className:
                                                "h-1.5 w-1.5 rounded-full bg-emerald-400 inline-block animate-pulse",
                                            }),
                                            e.jsx("span", {
                                              children:
                                                "Online - Auto Response",
                                            }),
                                          ],
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                                e.jsx("div", {
                                  className:
                                    "h-2 w-2 rounded-full bg-emerald-400 shadow shadow-emerald-400",
                                }),
                              ],
                            })
                          : e.jsxs("div", {
                              className:
                                "bg-[#17212b] p-3 px-4 flex items-center justify-between border-b border-slate-850 shadow-sm",
                              children: [
                                e.jsxs("div", {
                                  className: "flex items-center gap-2.5",
                                  children: [
                                    e.jsx("div", {
                                      className:
                                        "h-8 w-8 rounded-full bg-sky-950 flex items-center justify-center text-sky-400 font-bold border border-sky-500/20 text-sm",
                                      children: "🤖",
                                    }),
                                    e.jsxs("div", {
                                      className: "text-left leading-tight",
                                      children: [
                                        e.jsx("h5", {
                                          className:
                                            "text-xs font-black text-white leading-none",
                                          children: "@MikRobiL_Support_Bot",
                                        }),
                                        e.jsx("p", {
                                          className:
                                            "text-[9px] text-slate-400 font-mono mt-0.5 font-medium",
                                          children:
                                            "bot • Automated Billing Engine",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                                e.jsx("div", {
                                  className:
                                    "text-[9px] text-sky-450 font-bold bg-sky-950/60 px-1.5 py-0.5 rounded uppercase font-mono",
                                  children: "v1.2.5",
                                }),
                              ],
                            }),
                        e.jsxs("div", {
                          className:
                            "flex-1 p-3.5 space-y-3 overflow-y-auto custom-scroll flex flex-col-reverse text-left",
                          children: [
                            Xe &&
                              e.jsx("div", {
                                className:
                                  "self-start max-w-[80%] rounded-xl px-3 py-2 bg-slate-900 border border-slate-800 text-xs",
                                children: e.jsxs("div", {
                                  className: "flex items-center gap-2",
                                  children: [
                                    e.jsx("span", {
                                      className:
                                        "text-[10px] text-slate-500 font-mono",
                                      children: "Bot sedang memproses...",
                                    }),
                                    e.jsxs("div", {
                                      className: "flex gap-0.5",
                                      children: [
                                        e.jsx("span", {
                                          className:
                                            "h-1 w-1 bg-slate-500 rounded-full animate-bounce",
                                        }),
                                        e.jsx("span", {
                                          className:
                                            "h-1 w-1 bg-slate-500 rounded-full animate-bounce delay-100",
                                        }),
                                        e.jsx("span", {
                                          className:
                                            "h-1 w-1 bg-slate-500 rounded-full animate-bounce delay-200",
                                        }),
                                      ],
                                    }),
                                  ],
                                }),
                              }),
                            [...St].reverse().map((v) =>
                              e.jsxs(
                                "div",
                                {
                                  className: `max-w-[85%] rounded-2xl px-3.5 py-2.5 text-xs flex flex-col relative whitespace-pre-wrap ${v.sender === "user" ? "self-end bg-indigo-650 text-white rounded-br-sm" : "self-start bg-slate-900 border border-slate-800 text-slate-100 rounded-bl-sm"}`,
                                  children: [
                                    e.jsx("p", {
                                      className:
                                        "font-sans leading-relaxed select-text font-medium",
                                      children: v.text,
                                    }),
                                    e.jsxs("span", {
                                      className:
                                        "text-[8px] text-slate-400 text-right mt-1.5 block font-mono",
                                      children: [
                                        v.timestamp,
                                        " ",
                                        v.sender === "user" && "✓✓",
                                      ],
                                    }),
                                  ],
                                },
                                v.id,
                              ),
                            ),
                          ],
                        }),
                        e.jsxs("form", {
                          onSubmit: (v) => {
                            (v.preventDefault(), _e.trim() && qe(_e));
                          },
                          className:
                            "p-2 border-t border-slate-850 bg-slate-900 flex gap-1.5 items-center",
                          children: [
                            e.jsx("input", {
                              type: "text",
                              value: _e,
                              onChange: (v) => Ze(v.target.value),
                              placeholder:
                                st === "whatsapp"
                                  ? "Ketik pesan perintah (e.g. cek tagihan, cek ping)..."
                                  : "Ketik perintah bot /ping, /help, /belivoucher...",
                              className:
                                "flex-1 p-2 bg-slate-950 border border-slate-800 rounded-xl text-xs text-white outline-none focus:border-slate-700 text-left placeholder:text-slate-600 font-sans",
                            }),
                            e.jsx("button", {
                              type: "submit",
                              className:
                                "h-8 w-8 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white flex items-center justify-center shrink-0 cursor-pointer shadow transition-all",
                              children: e.jsx(vc, { className: "h-4.5 w-4.5" }),
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
      e.jsxs("div", {
        className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
        children: [
          e.jsxs("div", {
            className: "lg:col-span-2 space-y-6",
            children: [
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-4 shadow-sm",
                children: [
                  e.jsxs("div", {
                    className:
                      "flex flex-col sm:flex-row sm:items-center justify-between border-b pb-3 gap-3",
                    children: [
                      e.jsxs("div", {
                        children: [
                          e.jsxs("h3", {
                            className:
                              "text-sm font-extrabold text-slate-900 flex items-center gap-1.5",
                            children: [
                              e.jsx(ao, {
                                className: "h-4.5 w-4.5 text-emerald-650",
                              }),
                              e.jsx("span", {
                                children:
                                  "Daftar Kemitraan Kios & Reseller Ritel",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-[11px] text-slate-400 mt-0.5 font-sans",
                            children:
                              "Kios-Kios lokal desa yang memegang saldo cetak voucher hotspot",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "relative w-full sm:w-60",
                        children: [
                          e.jsx(Pi, {
                            className:
                              "absolute left-2.5 top-2.5 h-3.5 w-3.5 text-slate-400",
                          }),
                          e.jsx("input", {
                            type: "text",
                            placeholder: "Cari Agen...",
                            value: ee,
                            onChange: (v) => B(v.target.value),
                            className:
                              "w-full pl-8 pr-3 py-1.5 bg-slate-50 border border-slate-200 outline-none rounded-lg text-xs",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "bg-slate-50 border border-slate-200 rounded-lg overflow-hidden divide-y text-xs text-slate-750 font-sans",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-2.5 bg-slate-100 font-bold grid grid-cols-6 gap-2 text-slate-550 uppercase tracking-wide text-[10px]",
                        children: [
                          e.jsx("span", { children: "Nama Agen" }),
                          e.jsx("span", { children: "No HP WA" }),
                          e.jsx("span", { children: "Saldo Saat Ini" }),
                          e.jsx("span", { children: "Komisi (%)" }),
                          e.jsx("span", { children: "Total Omset" }),
                          e.jsx("span", {
                            className: "text-center",
                            children: "Aksi",
                          }),
                        ],
                      }),
                      sn.length === 0
                        ? e.jsx("div", {
                            className:
                              "p-8 text-center text-slate-400 font-sans",
                            children:
                              "Tidak ada data mitra kios yang cocok dalam database.",
                          })
                        : sn.map((v) =>
                            e.jsxs(
                              "div",
                              {
                                className:
                                  "p-2.5 grid grid-cols-6 gap-2 items-center hover:bg-white transition-colors",
                                children: [
                                  e.jsxs("div", {
                                    className: "flex flex-col truncate",
                                    children: [
                                      e.jsxs("span", {
                                        className:
                                          "font-extrabold text-slate-800 flex items-center gap-1 text-[12px]",
                                        children: [
                                          v.name,
                                          v.status === "suspended" &&
                                            e.jsx("span", {
                                              className:
                                                "h-1.5 w-1.5 rounded-full bg-rose-500 shrink-0",
                                            }),
                                        ],
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "font-mono text-[9px] text-slate-400 bg-slate-105 border px-1 py-0.2 rounded w-max mt-0.5 uppercase tracking-wider font-semibold",
                                        children: v.code,
                                      }),
                                    ],
                                  }),
                                  e.jsx("span", {
                                    className:
                                      "font-mono text-[11px] text-slate-600",
                                    children: v.phone || "-",
                                  }),
                                  e.jsx("div", {
                                    children: e.jsxs("span", {
                                      className:
                                        "font-bold text-emerald-800 text-[12px]",
                                      children: [
                                        "Rp ",
                                        v.balance.toLocaleString("id-ID"),
                                      ],
                                    }),
                                  }),
                                  e.jsxs("div", {
                                    className:
                                      "text-slate-650 flex items-center gap-0.5 font-bold",
                                    children: [
                                      e.jsxs("span", {
                                        children: [v.commission_pct, "%"],
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[10px] text-slate-400 font-medium",
                                        children: "disc",
                                      }),
                                    ],
                                  }),
                                  e.jsxs("span", {
                                    className: "text-indigo-650 font-bold",
                                    children: [
                                      "Rp ",
                                      v.total_sales.toLocaleString("id-ID"),
                                    ],
                                  }),
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-center items-center gap-2",
                                    children: [
                                      e.jsx("button", {
                                        onClick: () => le(v),
                                        className:
                                          "px-2 py-1 bg-emerald-50 hover:bg-emerald-100 border border-emerald-150 text-emerald-700 font-extrabold rounded text-[10px] uppercase cursor-pointer",
                                        title: "Topup Saldo Grosir",
                                        children: "+ Topup",
                                      }),
                                      e.jsx("button", {
                                        onClick: () => Ee(v),
                                        className:
                                          "p-1 text-blue-600 hover:bg-blue-50 rounded cursor-pointer",
                                        title: "Edit Profil Mitra",
                                        children: e.jsx(E0, {
                                          className: "h-3.5 w-3.5",
                                        }),
                                      }),
                                      e.jsx("button", {
                                        onClick: () => ks(v.id),
                                        className:
                                          "p-1 text-rose-600 hover:bg-rose-50 rounded cursor-pointer",
                                        title: "Hapus Mitra",
                                        children: e.jsx(ms, {
                                          className: "h-3.5 w-3.5",
                                        }),
                                      }),
                                    ],
                                  }),
                                ],
                              },
                              v.id,
                            ),
                          ),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-white border border-slate-200 rounded-xl space-y-4 shadow-sm",
                children: [
                  e.jsx("div", {
                    children: e.jsxs("h3", {
                      className:
                        "text-xs font-black text-slate-800 uppercase tracking-widest flex items-center gap-1 border-b pb-2",
                      children: [
                        e.jsx(Zf, { className: "h-4 w-4 text-slate-500" }),
                        e.jsx("span", {
                          children:
                            "Riwayat Mutasi Saldo & Komisi Agen Otomatis",
                        }),
                      ],
                    }),
                  }),
                  e.jsxs("div", {
                    className:
                      "bg-slate-50 border border-slate-205 rounded-lg overflow-hidden divide-y text-[11px] font-mono text-slate-705",
                    children: [
                      e.jsxs("div", {
                        className:
                          "grid grid-cols-5 p-2 bg-slate-100 font-extrabold font-sans text-xs text-slate-600 uppercase tracking-wider",
                        children: [
                          e.jsx("span", { children: "Waktu Transaksi" }),
                          e.jsx("span", { children: "Mitra Kios" }),
                          e.jsx("span", { children: "Jenis Operasi" }),
                          e.jsx("span", { children: "Nominal Gross" }),
                          e.jsx("span", { children: "Keuntungan Agen" }),
                        ],
                      }),
                      b.length === 0
                        ? e.jsx("div", {
                            className:
                              "p-4 text-center text-slate-400 font-sans",
                            children:
                              "Belum ada transaksi reseller dalam sistem.",
                          })
                        : b.map((v) => {
                            const Pe = J.find((vt) => vt.id === v.reseller_id);
                            return e.jsxs(
                              "div",
                              {
                                className:
                                  "grid grid-cols-5 p-2 items-center hover:bg-white transition-colors",
                                children: [
                                  e.jsx("span", {
                                    className: "text-slate-450",
                                    children: new Date(
                                      v.created_at,
                                    ).toLocaleString("id-ID", {
                                      hour: "2-digit",
                                      minute: "2-digit",
                                      second: "2-digit",
                                    }),
                                  }),
                                  e.jsx("span", {
                                    className:
                                      "font-sans font-bold text-slate-800",
                                    children: Pe
                                      ? Pe.name
                                      : `Mitra #${v.reseller_id}`,
                                  }),
                                  e.jsx("span", {
                                    children: e.jsx("span", {
                                      className: `text-[9px] px-1.5 py-0.2 font-black rounded uppercase ${v.type === "topup" ? "bg-blue-100 text-blue-700 font-sans" : "bg-emerald-100 text-emerald-700 font-sans"}`,
                                      children:
                                        v.type === "topup"
                                          ? "TOPUP SALDO"
                                          : "GEN VOUCHER",
                                    }),
                                  }),
                                  e.jsxs("span", {
                                    className: "font-bold text-slate-800",
                                    children: [
                                      "Rp ",
                                      v.amount.toLocaleString("id-ID"),
                                    ],
                                  }),
                                  e.jsx("span", {
                                    className: "text-emerald-750 font-bold",
                                    children:
                                      v.commission > 0
                                        ? `Rp ${v.commission.toLocaleString("id-ID")}`
                                        : "-",
                                  }),
                                ],
                              },
                              v.id,
                            );
                          }),
                    ],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className: "space-y-6",
            children: [
              e.jsxs("div", {
                className:
                  "p-5 bg-slate-900 border border-slate-850 rounded-xl shadow-lg space-y-4 text-white",
                children: [
                  e.jsxs("h4", {
                    className:
                      "font-black text-xs uppercase tracking-widest text-emerald-450 flex items-center gap-1.5",
                    children: [
                      e.jsx(xc, { className: "h-4 w-4" }),
                      e.jsx("span", {
                        children: "Sistem Login & Autentikasi Peran (RBAC)",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    className:
                      "text-xs text-slate-300 leading-relaxed font-sans",
                    children: [
                      "Setiap entitas dalam infrastruktur internet ",
                      e.jsx("b", { children: "Jaya Net (MikRobiL)" }),
                      " menggunakan kanal login tersendiri yang telah disesuaikan dengan protokol keamanan:",
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-3.5 pt-1 text-xs font-sans",
                    children: [
                      e.jsxs("div", {
                        className:
                          "p-2.5 bg-slate-950/60 rounded border border-slate-800 hover:bg-slate-950 transition-colors",
                        children: [
                          e.jsxs("p", {
                            className:
                              "font-extrabold text-sky-450 flex items-center gap-1 mb-0.5",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-1.5 w-1.5 rounded-full bg-sky-400",
                              }),
                              e.jsx("span", {
                                children: "1. Pelanggan CRM (Customer Portal)",
                              }),
                            ],
                          }),
                          e.jsxs("p", {
                            className:
                              "text-slate-400 text-[11px] leading-snug",
                            children: [
                              "Authentication menggunakan ",
                              e.jsx("b", { children: "Nomer HP (OTP)" }),
                              " atau ",
                              e.jsx("b", {
                                children: "ID Pelanggan (CUST-00x)",
                              }),
                              ". Web panel ini bertugas membayar bill invoice, mengajukan tiket perbaikan lapangan, mendeteksi status modem ONT red-loss, dan reboot.",
                            ],
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-2.5 bg-slate-950/60 rounded border border-slate-800 hover:bg-slate-950 transition-colors",
                        children: [
                          e.jsxs("p", {
                            className:
                              "font-extrabold text-emerald-400 flex items-center gap-1 mb-0.5",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-1.5 w-1.5 rounded-full bg-emerald-400",
                              }),
                              e.jsx("span", {
                                children:
                                  "2. Kios Agen / Reseller (Silo Portal)",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-slate-400 text-[11px] leading-snug",
                            children:
                              "Akses tersendiri bagi reseller lokal dengan menu: login kode agen, sisa balance deposit, cetak pulsa wifi voucher, dan riwayat setoran tunai e-warung.",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className:
                          "p-2.5 bg-slate-950/60 rounded border border-slate-800 hover:bg-slate-950 transition-colors",
                        children: [
                          e.jsxs("p", {
                            className:
                              "font-extrabold text-violet-400 flex items-center gap-1 mb-0.5",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-1.5 w-1.5 rounded-full bg-violet-400",
                              }),
                              e.jsx("span", {
                                children:
                                  "3. Staff NOC & Petugas Lapangan (NOC)",
                              }),
                            ],
                          }),
                          e.jsx("p", {
                            className:
                              "text-slate-400 text-[11px] leading-snug",
                            children:
                              "Role teknisi atau admin berhak mematikan port, memantau OLT GPON, melacak radius ping, membakar config simple-queue MikroTik, dan memutus sesi PPPoE mbandel.",
                          }),
                        ],
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3 text-xs text-slate-650 font-sans",
                children: [
                  e.jsxs("h4", {
                    className:
                      "font-extrabold text-slate-900 uppercase tracking-widest text-[11px] flex items-center gap-1.5",
                    children: [
                      e.jsx(Pf, { className: "h-4.5 w-4.5 text-indigo-650" }),
                      e.jsx("span", {
                        children: "Payment Gateway (Opsi Implementasi)",
                      }),
                    ],
                  }),
                  e.jsxs("p", {
                    className: "leading-relaxed",
                    children: [
                      "Sistem saat ini disiapkan untuk menggunakan 2 gerbang pembayaran utama di Indonesia, yaitu ",
                      e.jsx("b", { children: "Midtrans" }),
                      " atau ",
                      e.jsx("b", { children: "Xendit" }),
                      ".",
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "bg-slate-800 text-slate-300 p-2.5 rounded font-mono text-[9px] leading-relaxed space-y-1",
                    children: [
                      e.jsx("p", {
                        className: "text-yellow-400 font-bold",
                        children: "// Webhook Endpoint:",
                      }),
                      e.jsx("p", { children: "POST /api/v1/payments/webhook" }),
                      e.jsx("p", {
                        className: "text-slate-500 mt-2",
                        children: "// Request Payload midtrans (sim):",
                      }),
                      e.jsx("p", { children: "{" }),
                      e.jsx("p", {
                        children: '  "transaction_status": "settlement",',
                      }),
                      e.jsx("p", {
                        children: '  "order_id": "INV-2026-9912",',
                      }),
                      e.jsx("p", {
                        children: '  "gross_amount": "150000.00",',
                      }),
                      e.jsx("p", { children: '  "payment_type": "qris"' }),
                      e.jsx("p", { children: "}" }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "p-2.5 bg-indigo-50 border border-indigo-100 rounded-lg text-slate-700 text-[11px] leading-relaxed",
                    children: [
                      e.jsx("strong", { children: "Alur Bayar QRIS Instan:" }),
                      " Klien meng-scan kode QR di Splash Captive Portal, server menerima konfirmasi sukses instan via webhook payment gateway, dan RouterOS secara otomatis membebaskan/mengizinkan IP MAC address tersebut tanpa repot memencet voucher fisik!",
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      ce &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-950/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-2xl shadow-xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-900 text-sm",
                    children: "Daftarkan Reseller/Agen Baru",
                  }),
                  e.jsx("button", {
                    onClick: () => ve(!1),
                    className:
                      "p-1 hover:bg-slate-100 rounded text-slate-400 cursor-pointer",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: an,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Agen (Nama Warung) *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "e.g. Toko Kelontong Bu Erna",
                        value: be.name,
                        onChange: (v) => Ye({ ...be, name: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-500 font-sans",
                            children: "Kode Agen *",
                          }),
                          e.jsx("input", {
                            type: "text",
                            required: !0,
                            placeholder: "Contoh: ERNA01",
                            value: be.code,
                            onChange: (v) =>
                              Ye({ ...be, code: v.target.value }),
                            className:
                              "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none font-mono uppercase text-indigo-650 font-bold",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-500",
                            children: "Komisi/Diskon (%) *",
                          }),
                          e.jsx("input", {
                            type: "number",
                            required: !0,
                            value: be.commission_pct,
                            onChange: (v) =>
                              Ye({ ...be, commission_pct: v.target.value }),
                            className:
                              "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nomor Ponsel (WhatsApp) *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        placeholder: "e.g. 0812XXXXXXXX",
                        value: be.phone,
                        onChange: (v) => Ye({ ...be, phone: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Saldo Deposit Awal (Rp)*",
                      }),
                      e.jsx("input", {
                        type: "number",
                        required: !0,
                        value: be.balance,
                        onChange: (v) => Ye({ ...be, balance: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg font-bold text-emerald-800 outline-none",
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2.5 bg-emerald-600 hover:bg-emerald-500 text-white font-extrabold rounded-lg cursor-pointer transform hover:scale-[1.01] transition-all",
                    children: "Simpan & Daftarkan Agen",
                  }),
                ],
              }),
            ],
          }),
        }),
      Y &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-950/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-2xl shadow-xl p-6 max-w-sm w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsx("h3", {
                    className:
                      "font-sans font-extrabold text-slate-900 text-sm",
                    children: "Edit Profil Agen",
                  }),
                  e.jsx("button", {
                    onClick: () => Ee(null),
                    className:
                      "p-1 hover:bg-slate-100 rounded text-slate-400 cursor-pointer",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("form", {
                onSubmit: ws,
                className: "space-y-3.5 text-xs text-slate-700",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Nama Agen *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: Y.name,
                        onChange: (v) => Ee({ ...Y, name: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "No HP WhatsApp *",
                      }),
                      e.jsx("input", {
                        type: "text",
                        required: !0,
                        value: Y.phone,
                        onChange: (v) => Ee({ ...Y, phone: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none font-mono",
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "grid grid-cols-2 gap-3",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-500",
                            children: "Komisi (%) *",
                          }),
                          e.jsx("input", {
                            type: "number",
                            required: !0,
                            value: Y.commission_pct,
                            onChange: (v) =>
                              Ee({
                                ...Y,
                                commission_pct: Number(v.target.value),
                              }),
                            className:
                              "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg",
                          }),
                        ],
                      }),
                      e.jsxs("div", {
                        className: "space-y-1",
                        children: [
                          e.jsx("label", {
                            className: "font-bold text-slate-500",
                            children: "Ubah Saldo Manual *",
                          }),
                          e.jsx("input", {
                            type: "number",
                            required: !0,
                            value: Y.balance,
                            onChange: (v) =>
                              Ee({ ...Y, balance: Number(v.target.value) }),
                            className:
                              "w-full p-2 bg-slate-50 border text-xs text-emerald-800 font-bold border-slate-200 rounded-lg",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1",
                    children: [
                      e.jsx("label", {
                        className: "font-bold text-slate-500",
                        children: "Status Agen *",
                      }),
                      e.jsxs("select", {
                        value: Y.status,
                        onChange: (v) => Ee({ ...Y, status: v.target.value }),
                        className:
                          "w-full p-2 bg-slate-50 border border-slate-200 rounded-lg outline-none cursor-pointer",
                        children: [
                          e.jsx("option", {
                            value: "active",
                            children: "Active",
                          }),
                          e.jsx("option", {
                            value: "suspended",
                            children: "Suspended (Beku)",
                          }),
                        ],
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    className:
                      "w-full py-2.5 bg-indigo-600 hover:bg-indigo-505 text-white font-bold rounded-lg cursor-pointer shadow",
                    children: "Simpan Perubahan Agen",
                  }),
                ],
              }),
            ],
          }),
        }),
      Se &&
        e.jsx("div", {
          className:
            "fixed inset-0 z-50 bg-slate-950/60 backdrop-blur-sm flex items-center justify-center p-4",
          children: e.jsxs("div", {
            className:
              "bg-white border rounded-2xl shadow-xl p-6 max-w-md w-full space-y-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center justify-between border-b pb-3",
                children: [
                  e.jsxs("h3", {
                    className:
                      "font-sans font-black text-slate-900 text-sm flex items-center gap-1",
                    children: [
                      e.jsx(Ap, { className: "h-4.5 w-4.5 text-emerald-600" }),
                      e.jsx("span", {
                        children: "Topup Deposit Keagenan Ritel",
                      }),
                    ],
                  }),
                  e.jsx("button", {
                    onClick: () => le(null),
                    className:
                      "p-1 hover:bg-slate-100 rounded text-slate-400 cursor-pointer",
                    children: e.jsx(la, { className: "h-4 w-4" }),
                  }),
                ],
              }),
              e.jsxs("p", {
                className: "text-xs text-slate-500 leading-relaxed font-sans",
                children: [
                  "Isi ulang kuota saldo utama untuk reseller ",
                  e.jsxs("b", { children: [Se.name, " (", Se.code, ")"] }),
                  ". Saldo ini didebet secara aman ketika agen menghasilkan wifi voucher.",
                ],
              }),
              e.jsxs("form", {
                onSubmit: Na,
                className: "space-y-4 text-xs text-slate-705",
                children: [
                  e.jsxs("div", {
                    className: "space-y-1.5",
                    children: [
                      e.jsx("label", {
                        className: "font-extrabold text-slate-500",
                        children: "Pilih Jumlah Nominal Pengisian (Rupiah) *",
                      }),
                      e.jsx("div", {
                        className: "grid grid-cols-2 gap-2",
                        children: [
                          { value: "100000", label: "Rp 100.000" },
                          { value: "250000", label: "Rp 250.000" },
                          { value: "500000", label: "Rp 500.000" },
                          { value: "1000000", label: "Rp 1.000.000" },
                          { value: "2500000", label: "Rp 2.500.000" },
                        ].map((v) =>
                          e.jsx(
                            "button",
                            {
                              type: "button",
                              onClick: () =>
                                $((Pe) => ({ ...Pe, amount: v.value })),
                              className: `p-2.5 rounded-lg border text-center font-bold tracking-tight transition-all cursor-pointer ${ie.amount === v.value ? "bg-emerald-50 text-emerald-800 border-emerald-400 shadow-sm" : "bg-slate-50 text-slate-700 hover:bg-slate-100 border-slate-200"}`,
                              children: v.label,
                            },
                            v.value,
                          ),
                        ),
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className: "space-y-1.5",
                    children: [
                      e.jsx("label", {
                        className: "font-extrabold text-slate-500",
                        children: "Pilih Saluran Bayar Virtual Gateway *",
                      }),
                      e.jsx("div", {
                        className: "grid grid-cols-3 gap-2",
                        children: [
                          { key: "qris", tag: "QRIS GPN" },
                          { key: "xendit", tag: "Xendit VA" },
                          { key: "midtrans", tag: "Midtrans CC" },
                        ].map((v) =>
                          e.jsx(
                            "button",
                            {
                              type: "button",
                              onClick: () =>
                                $((Pe) => ({ ...Pe, paymentMethod: v.key })),
                              className: `p-2 bg-white border font-bold text-center rounded-lg transition-colors cursor-pointer ${ie.paymentMethod === v.key ? "border-indigo-500 text-indigo-700 bg-indigo-50/20" : "border-slate-200 text-slate-650 hover:bg-slate-50"}`,
                              children: v.tag,
                            },
                            v.key,
                          ),
                        ),
                      }),
                    ],
                  }),
                  e.jsxs("div", {
                    className:
                      "bg-slate-50 p-2.5 rounded text-[11px] border border-slate-200 text-slate-500",
                    children: [
                      "Pencairan saldo dilakukan instan sesudah gateway API berstatus ",
                      e.jsx("code", { children: '"settlement"' }),
                      " atau ",
                      e.jsx("code", { children: '"success"' }),
                      ". Webhook webhook callback akan dipicu otomatis.",
                    ],
                  }),
                  e.jsx("button", {
                    type: "submit",
                    disabled: de,
                    className: `w-full py-2.5 text-white font-extrabold rounded-lg cursor-pointer transform hover:scale-[1.01] transition-all flex items-center justify-center gap-1.5 ${de ? "bg-slate-400 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-500"}`,
                    children: de
                      ? e.jsxs(e.Fragment, {
                          children: [
                            e.jsx(Va, { className: "h-4 w-4 animate-spin" }),
                            e.jsx("span", {
                              children: "Menyalurkan API callback...",
                            }),
                          ],
                        })
                      : e.jsxs(e.Fragment, {
                          children: [
                            e.jsx(tn, { className: "h-4 w-4" }),
                            e.jsxs("span", {
                              children: [
                                "Selesaikan & Bayar Rp ",
                                Number(ie.amount).toLocaleString("id-ID"),
                              ],
                            }),
                          ],
                        }),
                  }),
                ],
              }),
            ],
          }),
        }),
    ],
  });
}
function Dg() {
  const [w, J] = f.useState(!1),
    [S, b] = f.useState([
      {
        id: "welcome",
        sender: "assistant",
        text: `Halo! Saya adalah MikRobiL AI NOC Assistant. 🤖

Saya dideploy untuk membantu Anda mengelola MikroTik RouterOS v7, mengurus IP Pool, mengonfigurasi profil kecepatan PPPoE, dan troubleshooting link jaringan di PT Jaya Solusi Network.

Ada kendala jaringan atau setup yang ingin Anda tanyakan hari ini?`,
        timestamp: new Date(),
      },
    ]),
    [V, ue] = f.useState(""),
    [re, ee] = f.useState(!1),
    B = f.useRef(null);
  f.useEffect(() => {
    B.current && (B.current.scrollTop = B.current.scrollHeight);
  }, [S, w]);
  const T = async (F) => {
      const ce = (F || V).trim();
      if (!ce || re) return;
      F || ue("");
      const ve = {
        id: `usr-${Date.now()}`,
        sender: "user",
        text: ce,
        timestamp: new Date(),
      };
      (b((Y) => [...Y, ve]), ee(!0));
      try {
        const Y = S.map((ie) => ({
            role: ie.sender === "user" ? "user" : "model",
            parts: [{ text: ie.text }],
          })),
          Se = await (
            await fetch("/api/v1/gemini/assistant", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ prompt: ce, chatHistory: Y }),
            })
          ).json(),
          le = {
            id: `ai-${Date.now()}`,
            sender: "assistant",
            text:
              Se.status === "success" && Se.data
                ? Se.data.text
                : "Mohon maaf jaringan sedang sibuk, silakan coba beberapa saat lagi.",
            timestamp: new Date(),
          };
        b((ie) => [...ie, le]);
      } catch (Y) {
        (console.error("AI Assistant request error:", Y),
          b((Ee) => [
            ...Ee,
            {
              id: `ai-err-${Date.now()}`,
              sender: "assistant",
              text: "Gagal menghubungkan sistem AI MikRobiL. Pastikan backend server Anda berjalan pada port 3000.",
              timestamp: new Date(),
            },
          ]));
      } finally {
        ee(!1);
      }
    },
    fe = () => {
      b([
        {
          id: "welcome",
          sender: "assistant",
          text: "Sesi percakapan dibersihkan. Sila tanyakan hal teknis lain seperti: Cara setup PPPoE Profiles, pengecekan DHCP server, atau status router JSN.",
          timestamp: new Date(),
        },
      ]);
    },
    G = [
      "Cara setup PPPoE Server MikroTik?",
      "Kenapa router SouthOffice offline?",
      "Blokir situs/port via Firewall?",
      "Menu bandwidth limit profile",
    ];
  return e.jsxs("div", {
    className: "fixed bottom-6 right-6 z-50 font-sans select-none",
    children: [
      e.jsx("button", {
        id: "ai-assistant-toggle",
        onClick: () => J(!w),
        className:
          "h-12 w-12 rounded-full bg-indigo-650 hover:bg-indigo-600 text-white shadow-xl shadow-indigo-650/40 flex items-center justify-center cursor-pointer hover:scale-105 active:scale-95 transition-all relative z-50",
        children: w
          ? e.jsx(la, { className: "h-5 w-5 animate-spin-once" })
          : e.jsxs("div", {
              className: "relative",
              children: [
                e.jsx(no, {
                  className: "h-5 w-5 text-amber-200 animate-pulse",
                }),
                e.jsxs("span", {
                  className: "absolute -top-1.5 -right-1.5 flex h-2.5 w-2.5",
                  children: [
                    e.jsx("span", {
                      className:
                        "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75",
                    }),
                    e.jsx("span", {
                      className:
                        "relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500",
                    }),
                  ],
                }),
              ],
            }),
      }),
      w &&
        e.jsxs("div", {
          id: "ai-assistant-drawer",
          className:
            "fixed bottom-22 right-6 w-[385px] h-[520px] max-w-[calc(100vw-32px)] bg-white border border-slate-200 rounded-2xl shadow-2xl flex flex-col overflow-hidden z-50 animate-slide-in-up",
          children: [
            e.jsxs("div", {
              className:
                "px-4 py-3 bg-gradient-to-r from-slate-900 to-indigo-950 text-white flex justify-between items-center shadow-md",
              children: [
                e.jsxs("div", {
                  className: "flex items-center gap-2",
                  children: [
                    e.jsx("div", {
                      className: "p-1 bg-white/10 rounded",
                      children: e.jsx(no, {
                        className: "h-4 w-4 text-amber-300",
                      }),
                    }),
                    e.jsxs("div", {
                      children: [
                        e.jsx("h4", {
                          className:
                            "text-[12px] font-extrabold tracking-wide uppercase",
                          children: "MikRobiL AI NOC Assistant",
                        }),
                        e.jsxs("p", {
                          className:
                            "text-[9px] text-indigo-300 font-mono font-bold flex items-center gap-1 mt-0.5",
                          children: [
                            e.jsx("span", {
                              className:
                                "h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse",
                            }),
                            e.jsx("span", {
                              children: "ONLINE • Gemini 3.5 Flash",
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "flex items-center gap-1.5",
                  children: [
                    e.jsx("button", {
                      onClick: fe,
                      title: "Bersihkan percakapan",
                      className:
                        "p-1 hover:bg-white/10 text-slate-300 hover:text-white rounded transition",
                      children: e.jsx(Va, { className: "h-3.5 w-3.5" }),
                    }),
                    e.jsx("button", {
                      onClick: () => J(!1),
                      className:
                        "p-1 hover:bg-white/10 text-slate-300 hover:text-white rounded transition",
                      children: e.jsx(la, { className: "h-3.5 w-3.5" }),
                    }),
                  ],
                }),
              ],
            }),
            e.jsxs("div", {
              ref: B,
              className:
                "flex-1 p-4 overflow-y-auto space-y-3.5 bg-slate-50 custom-scroll text-xs",
              children: [
                S.map((F) =>
                  e.jsxs(
                    "div",
                    {
                      className: `flex gap-2.5 items-start ${F.sender === "user" ? "flex-row-reverse" : ""}`,
                      children: [
                        e.jsx("div", {
                          className: `p-1.5 rounded-lg shrink-0 ${F.sender === "user" ? "bg-slate-200 text-slate-700" : "bg-indigo-50 text-indigo-650"}`,
                          children:
                            F.sender === "user"
                              ? e.jsx(xu, { className: "h-3.5 w-3.5" })
                              : e.jsx(uc, { className: "h-3.5 w-3.5" }),
                        }),
                        e.jsxs("div", {
                          className: `max-w-[75%] p-2.5 rounded-xl text-[11px] leading-relaxed relative ${F.sender === "user" ? "bg-indigo-600 text-white rounded-tr-none font-sans" : "bg-white border rounded-tl-none text-slate-700 whitespace-pre-wrap font-sans shadow-sm"}`,
                          children: [
                            F.text,
                            e.jsx("span", {
                              className: `block text-[8px] mt-1 font-mono text-right ${F.sender === "user" ? "text-indigo-200" : "text-slate-400"}`,
                              children: F.timestamp.toLocaleTimeString("id", {
                                hour: "2-digit",
                                minute: "2-digit",
                              }),
                            }),
                          ],
                        }),
                      ],
                    },
                    F.id,
                  ),
                ),
                re &&
                  e.jsxs("div", {
                    className: "flex gap-2.5 items-start",
                    children: [
                      e.jsx("div", {
                        className:
                          "p-1.5 bg-indigo-50 text-indigo-650 rounded-lg shrink-0",
                        children: e.jsx(uc, { className: "h-3.5 w-3.5" }),
                      }),
                      e.jsxs("div", {
                        className:
                          "bg-white border rounded-xl rounded-tl-none p-3 shadow-sm text-slate-550 flex gap-2 items-center text-[11px]",
                        children: [
                          e.jsx("span", {
                            className:
                              "h-2 w-2 rounded-full bg-indigo-500 animate-bounce",
                          }),
                          e.jsx("span", {
                            className:
                              "h-2 w-2 rounded-full bg-indigo-500 animate-bounce delay-100",
                          }),
                          e.jsx("span", {
                            className:
                              "h-2 w-2 rounded-full bg-indigo-500 animate-bounce delay-200",
                          }),
                          e.jsx("span", {
                            className:
                              "font-medium text-[10px] text-slate-400 ml-1.5",
                            children: "MikRobiL AI sedang berpikir...",
                          }),
                        ],
                      }),
                    ],
                  }),
              ],
            }),
            e.jsx("div", {
              className:
                "px-3 py-1.5 bg-slate-100 border-t border-slate-150 flex gap-1.5 overflow-x-auto whitespace-nowrap custom-scroll shrink-0 select-none",
              children: G.map((F, ce) =>
                e.jsxs(
                  "button",
                  {
                    disabled: re,
                    onClick: () => T(F),
                    className:
                      "bg-white border text-slate-650 px-2.5 py-0.5 rounded text-[10px] hover:border-indigo-400 font-medium cursor-pointer transition flex items-center gap-1 shadow-sm shrink-0",
                    children: [
                      e.jsx(ir, { className: "h-3 w-3 text-indigo-500" }),
                      e.jsx("span", { children: F }),
                    ],
                  },
                  ce,
                ),
              ),
            }),
            e.jsx("div", {
              className: "p-2.5 bg-white border-t border-slate-150 shrink-0",
              children: e.jsxs("form", {
                onSubmit: (F) => {
                  (F.preventDefault(), T());
                },
                className: "flex items-center gap-2",
                children: [
                  e.jsx("input", {
                    type: "text",
                    value: V,
                    onChange: (F) => ue(F.target.value),
                    disabled: re,
                    placeholder: "Tanyakan command, setup VLAN, firewall...",
                    className:
                      "flex-1 p-2 bg-slate-50 border hover:border-slate-350 focus:border-indigo-500 rounded-xl text-xs outline-none font-sans font-medium",
                  }),
                  e.jsx("button", {
                    type: "submit",
                    disabled: re || !V.trim(),
                    className: `p-2 rounded-xl text-white shadow transition-all shrink-0 ${re || !V.trim() ? "bg-slate-300 text-slate-500 shadow-none cursor-not-allowed" : "bg-indigo-650 hover:bg-indigo-600 hover:scale-105 active:scale-95 cursor-pointer"}`,
                    children: e.jsx(vc, { className: "h-3.5 w-3.5" }),
                  }),
                ],
              }),
            }),
          ],
        }),
    ],
  });
}
function Rg({ activeRole: w }) {
  const [J, S] = f.useState("chat"),
    [b, V] = f.useState(""),
    [ue, re] = f.useState([]),
    [ee, B] = f.useState(!1),
    [T, fe] = f.useState(""),
    [G, F] = f.useState(""),
    [ce, ve] = f.useState([
      {
        sender: "model",
        text: `Halo! Selamat datang di Pusat AI Network Guru. 🤖

Saya dideploy dengan pengetahuan mendalam seputar:
- Konfigurasi RouterOS v7 MikroTik (VLAN, PPPoE Server, Hotspot, Bridge, Routing)
- Manajemen ISP/RT-RW Net dan limitasi bandwidth (Simple Queue, Queue Tree)
- Penanganan gangguan (packet loss, interferensi, DNS hijacking, atau routing failover)

Ajukan pertanyaan teknis Anda, jalankan simulasi, atau gunakan tab 'Penyunting Skrip' di atas untuk menyunting berkas konfigurasi lokal secara otomatis!`,
        timestamp: new Date(),
      },
    ]),
    [Y, Ee] = f.useState([]),
    [Se, le] = f.useState(""),
    [ie, $] = f.useState("all"),
    [de, oe] = f.useState(null),
    [be, Ye] = f.useState([]),
    [Te, Ie] = f.useState(""),
    [me, Oe] = f.useState(""),
    [te, Ae] = f.useState(""),
    [Ue, y] = f.useState(""),
    [K, O] = f.useState(!1),
    [P, z] = f.useState(""),
    [g, C] = f.useState(""),
    [I, X] = f.useState(""),
    pe = f.useRef(null);
  (f.useEffect(() => {
    (he(), Ne());
  }, []),
    f.useEffect(() => {
      pe.current && pe.current.scrollIntoView({ behavior: "smooth" });
    }, [ce, J]));
  const he = async () => {
      try {
        const Me = await (await fetch("/api/v1/ai/chats")).json();
        Me.status === "success" && Ee(Me.data);
      } catch (ge) {
        console.error("Gagal koordinasi riwayat chat:", ge);
      }
    },
    Ne = async () => {
      try {
        const Me = await (await fetch("/api/v1/ai/files")).json();
        Me.status === "success" &&
          (Ye(Me.data),
          Me.data.length > 0 &&
            !Te &&
            (Ie(Me.data[0].name),
            Oe(Me.data[0].content),
            Ae(Me.data[0].content)));
      } catch (ge) {
        console.error("Gagal memuat berkas lokalisasi rsc:", ge);
      }
    },
    $e = (ge) => {
      const Me = be.find((mt) => mt.name === ge);
      Me && (Ie(ge), Oe(Me.content), Ae(Me.content), z(""), C(""), X(""));
    },
    ae = async (ge) => {
      ge.preventDefault();
      const Me = b.trim();
      if (Me) {
        (V(""),
          F(""),
          B(!0),
          ve((mt) => [
            ...mt,
            { sender: "user", text: Me, timestamp: new Date() },
          ]));
        try {
          const st = await (
            await fetch("/api/v1/gemini/assistant", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ prompt: Me }),
            })
          ).json();
          st.status === "success" && st.data
            ? (ve((Z) => [
                ...Z,
                { sender: "model", text: st.data.text, timestamp: new Date() },
              ]),
              he())
            : F("Gagal memperoleh deskripsi dari asisten.");
        } catch {
          F("Sambungan terputus ke asisten ISP.");
        } finally {
          B(!1);
        }
      }
    },
    ze = async (ge, Me) => {
      try {
        const st = await (
          await fetch("/api/v1/ai/chats/curate", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ id: ge, status: Me }),
          })
        ).json();
        st.status === "success" && (he(), de && de.id === ge && oe(st.data));
      } catch (mt) {
        console.error(mt);
      }
    },
    at = async (ge) => {
      if ((ge.preventDefault(), !Ue.trim())) {
        X("Harap masukkan instruksi edit terlebih dahulu!");
        return;
      }
      (O(!0), C(""), X(""), z(""));
      try {
        const mt = await (
          await fetch("/api/v1/ai/files/edit", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ fileName: Te, instruction: Ue }),
          })
        ).json();
        mt.status === "success"
          ? (C("File berhasil dimodifikasi secara otomatis!"),
            Oe(mt.data.newContent),
            z(mt.data.explanation),
            y(""),
            Ne(),
            he())
          : X(mt.message || "Gagal menyunting berkas.");
      } catch {
        X("Kegagalan sambungan server penyunting skrip.");
      } finally {
        O(!1);
      }
    },
    bt = [
      {
        title: "PPPoE Server",
        q: "Bagaimana cara setup PPPoE Server di MikroTik agar ip address client dinamis?",
      },
      {
        title: "Blokir Ads/Port",
        q: "Bagaimana cara membuat rule firewall filter untuk blokir situs judi/iklan di MikroTik?",
      },
      {
        title: "VLAN Trunking",
        q: "Berikan skrip RouterOS v7 untuk VLAN Trunking port ether2 ke switch?",
      },
      {
        title: "WAN Failover",
        q: "Bagaimana cara setting failover gateway dual WAN pakai ping check target?",
      },
    ],
    Mt = Y.filter((ge) => {
      const Me =
          ge.user_prompt.toLowerCase().includes(Se.toLowerCase()) ||
          ge.ai_response.toLowerCase().includes(Se.toLowerCase()),
        mt = ie === "all" || ge.category === ie;
      return Me && mt;
    });
  return e.jsxs("div", {
    id: "ai-local-web-root",
    className: "space-y-6 select-none max-w-7xl mx-auto",
    children: [
      e.jsxs("div", {
        className:
          "bg-slate-900 border border-slate-800 rounded-3xl p-6 text-white relative overflow-hidden shadow-xl",
        children: [
          e.jsx("div", {
            className:
              "absolute -right-12 -top-12 w-48 h-48 bg-blue-600/10 rounded-full blur-2xl",
          }),
          e.jsx("div", {
            className:
              "absolute -left-12 -bottom-12 w-48 h-48 bg-indigo-650/10 rounded-full blur-2xl",
          }),
          e.jsxs("div", {
            className:
              "relative z-10 flex flex-col md:flex-row justify-between items-start md:items-center gap-4",
            children: [
              e.jsxs("div", {
                className: "flex items-center gap-3.5",
                children: [
                  e.jsx("div", {
                    className:
                      "p-3 bg-gradient-to-br from-indigo-550 to-blue-600 rounded-2xl shadow-lg border border-indigo-400/20",
                    children: e.jsx(no, {
                      className: "h-6 w-6 text-amber-200 animate-pulse",
                    }),
                  }),
                  e.jsxs("div", {
                    children: [
                      e.jsxs("h1", {
                        className:
                          "text-xl font-display font-black tracking-tight text-white flex items-center gap-2",
                        children: [
                          "Pusat AI Network Guru & Dev Simulator",
                          e.jsx("span", {
                            className:
                              "text-[9px] bg-indigo-500/30 text-indigo-300 font-mono font-extrabold px-2 py-0.5 rounded border border-indigo-500/20 uppercase tracking-widest leading-none",
                            children: "LOCAL-FIRST",
                          }),
                        ],
                      }),
                      e.jsx("p", {
                        className: "text-xs text-slate-400 mt-1 font-sans",
                        children:
                          "Asisten AI cerdas untuk merancang skrip MikroTik RouterOS v7, melog semua percakapan teknis admin, dan auto-edit script local konfigurasi Anda.",
                      }),
                    ],
                  }),
                ],
              }),
              e.jsxs("div", {
                className:
                  "flex bg-slate-950 p-1 rounded-xl border border-slate-800 select-none shrink-0 text-xs font-bold shadow-inner",
                children: [
                  e.jsxs("button", {
                    onClick: () => S("chat"),
                    className: `px-3.5 py-2 rounded-lg flex items-center gap-1.5 transition-all text-center cursor-pointer ${J === "chat" ? "bg-indigo-600 text-white shadow" : "text-slate-400 hover:text-white"}`,
                    children: [
                      e.jsx(bc, { className: "h-3.5 w-3.5" }),
                      e.jsx("span", { children: "Network Guru Chat" }),
                    ],
                  }),
                  e.jsxs("button", {
                    onClick: () => S("curation"),
                    className: `px-3.5 py-2 rounded-lg flex items-center gap-1.5 transition-all text-center cursor-pointer ${J === "curation" ? "bg-indigo-600 text-white shadow" : "text-slate-400 hover:text-white"}`,
                    children: [
                      e.jsx($n, { className: "h-3.5 w-3.5" }),
                      e.jsxs("span", {
                        children: ["Saring & Kurasi Obrolan (", Y.length, ")"],
                      }),
                    ],
                  }),
                  e.jsxs("button", {
                    onClick: () => S("editor"),
                    className: `px-3.5 py-2 rounded-lg flex items-center gap-1.5 transition-all text-center cursor-pointer ${J === "editor" ? "bg-indigo-600 text-white shadow" : "text-slate-400 hover:text-white"}`,
                    children: [
                      e.jsx(wp, { className: "h-3.5 w-3.5" }),
                      e.jsx("span", {
                        children: "Penyunting Skrip (Auto-Edit)",
                      }),
                    ],
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      J === "chat" &&
        e.jsxs("div", {
          className: "grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",
          children: [
            e.jsxs("div", {
              className: "lg:col-span-3 space-y-4",
              children: [
                e.jsxs("div", {
                  className: "bg-white border rounded-2xl p-4 shadow-sm",
                  children: [
                    e.jsx("h3", {
                      className:
                        "text-xs font-extrabold text-slate-800 tracking-wider uppercase mb-3 text-left",
                      children: "💡 Preset Pertanyaan Populer",
                    }),
                    e.jsx("div", {
                      className: "space-y-2.5",
                      children: bt.map((ge, Me) =>
                        e.jsxs(
                          "button",
                          {
                            onClick: () => {
                              V(ge.q);
                            },
                            className:
                              "w-full text-left p-3 rounded-xl border border-slate-155 bg-slate-50/50 hover:bg-slate-50 hover:border-slate-300 text-xs transition duration-150 cursor-pointer text-slate-700 font-sans leading-relaxed group shadow-sm hover:translate-x-0.5",
                            children: [
                              e.jsxs("span", {
                                className:
                                  "font-extrabold text-indigo-700 block mb-1 font-mono text-[10px] uppercase",
                                children: ["#", ge.title],
                              }),
                              e.jsx("p", {
                                className:
                                  "line-clamp-2 text-slate-650 text-[11px] group-hover:text-slate-900",
                                children: ge.q,
                              }),
                            ],
                          },
                          Me,
                        ),
                      ),
                    }),
                  ],
                }),
                e.jsx("div", {
                  className:
                    "bg-indigo-50 border border-indigo-100 rounded-2xl p-4 text-[11px] text-indigo-900 space-y-2 font-sans shadow-sm",
                  children: e.jsxs("div", {
                    className: "flex gap-2 items-start",
                    children: [
                      e.jsx(mc, {
                        className: "h-4 w-4 text-indigo-650 shrink-0 mt-0.5",
                      }),
                      e.jsxs("div", {
                        children: [
                          e.jsx("span", {
                            className: "font-extrabold block",
                            children: "Context-Aware AI",
                          }),
                          e.jsx("span", {
                            className: "text-slate-600",
                            children:
                              "Model otomatis dikaitkan dengan konteks ISP tenant aktif (PT Jaya Solusi Network), routers online, status tagihan terhutang, serta penayangan log audit agar instruksi CLI persis sesuai topologi nyata Anda!",
                          }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
            e.jsxs("div", {
              className:
                "lg:col-span-9 bg-white border border-slate-205 rounded-2xl flex flex-col h-[580px] shadow-sm overflow-hidden",
              children: [
                e.jsxs("div", {
                  className:
                    "px-5 py-3.5 border-b bg-gradient-to-r from-slate-900 to-indigo-950 text-white flex justify-between items-center",
                  children: [
                    e.jsxs("div", {
                      className: "flex items-center gap-2.5",
                      children: [
                        e.jsx("div", {
                          className:
                            "h-2.5 w-2.5 bg-emerald-500 rounded-full animate-pulse",
                        }),
                        e.jsxs("div", {
                          children: [
                            e.jsxs("div", {
                              className: "flex items-center gap-1.5 font-sans",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "font-black text-[12px] uppercase text-white tracking-widest",
                                  children: "Local RouterOS AI Assistant",
                                }),
                                e.jsx("span", {
                                  className:
                                    "text-[8px] bg-slate-800 text-slate-300 border border-slate-700 px-1.5 py-0.5 rounded font-mono font-bold",
                                  children: "V7 ENGINE",
                                }),
                              ],
                            }),
                            e.jsx("p", {
                              className:
                                "text-[10px] text-slate-400 font-mono mt-0.5",
                              children:
                                "Berkomunikasi langsung, menganalisis skrip .rsc, dan melog dialog otomatis",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("button", {
                      type: "button",
                      onClick: () => {
                        ve([
                          {
                            sender: "model",
                            text: "Sesi percakapan dibersihkan. Sila tanyakan hal teknis lain seputar setup WAN routing, PPPoE profile, DHCP Pool, dsb.",
                            timestamp: new Date(),
                          },
                        ]);
                      },
                      className:
                        "px-2.5 py-1 text-[10px] bg-slate-800 hover:bg-slate-700 text-slate-350 hover:text-white rounded border border-slate-700 cursor-pointer font-bold transition flex items-center gap-1 shrink-0",
                      children: [
                        e.jsx(Va, { className: "h-3 w-3" }),
                        e.jsx("span", { children: "Bersihkan Sesi" }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "flex-1 overflow-y-auto p-5 space-y-4 bg-slate-50 custom-scroll",
                  children: [
                    ce.map((ge, Me) =>
                      e.jsxs(
                        "div",
                        {
                          className: `flex gap-3 items-start ${ge.sender === "user" ? "flex-row-reverse" : ""}`,
                          children: [
                            e.jsx("div", {
                              className: `p-2 rounded-xl shrink-0 ${ge.sender === "user" ? "bg-slate-200 text-slate-700" : "bg-indigo-50 border border-indigo-100 text-indigo-650 shadow-sm animate-pulse"}`,
                              children:
                                ge.sender === "user"
                                  ? e.jsx(xu, { className: "h-4 w-4" })
                                  : e.jsx(uc, {
                                      className: "h-4 w-4 text-indigo-600",
                                    }),
                            }),
                            e.jsxs("div", {
                              className: `max-w-[80%] p-3.5 rounded-2xl relative ${ge.sender === "user" ? "bg-indigo-600 text-white rounded-tr-none font-sans text-xs italic shadow-sm" : "bg-white border text-slate-800 rounded-tl-none text-xs leading-relaxed font-sans shadow-md"}`,
                              children: [
                                e.jsx("div", {
                                  className:
                                    "whitespace-pre-wrap leading-relaxed font-sans text-[11px] text-slate-850",
                                  children: ge.text,
                                }),
                                e.jsxs("div", {
                                  className:
                                    "flex items-center justify-between text-[8px] mt-2 font-mono uppercase tracking-wider opacity-60",
                                  children: [
                                    e.jsx("span", {
                                      children:
                                        ge.sender === "user"
                                          ? "Client Operator"
                                          : "AI Core Server",
                                    }),
                                    e.jsx("span", {
                                      children: new Date(
                                        ge.timestamp,
                                      ).toLocaleTimeString("id-ID", {
                                        hour: "2-digit",
                                        minute: "2-digit",
                                      }),
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          ],
                        },
                        Me,
                      ),
                    ),
                    ee &&
                      e.jsxs("div", {
                        className: "flex gap-3 items-start",
                        children: [
                          e.jsx("div", {
                            className:
                              "p-2 bg-indigo-50 border border-indigo-100 text-indigo-650 rounded-xl shrink-0 animate-spin",
                            children: e.jsx(uc, { className: "h-4 w-4" }),
                          }),
                          e.jsxs("div", {
                            className:
                              "bg-white border rounded-2xl rounded-tl-none p-4 shadow-sm text-slate-550 flex gap-2.5 items-center justify-center",
                            children: [
                              e.jsx("span", {
                                className:
                                  "h-2 w-2 rounded-full bg-indigo-500 animate-bounce",
                              }),
                              e.jsx("span", {
                                className:
                                  "h-2 w-2 rounded-full bg-indigo-500 animate-bounce [animation-delay:0.2s]",
                              }),
                              e.jsx("span", {
                                className:
                                  "h-2 w-2 rounded-full bg-indigo-500 animate-bounce [animation-delay:0.4s]",
                              }),
                              e.jsx("span", {
                                className:
                                  "text-[10px] font-bold text-slate-400 uppercase tracking-widest font-mono",
                                children: "Menyusun respon network optimal...",
                              }),
                            ],
                          }),
                        ],
                      }),
                    e.jsx("div", { ref: pe }),
                  ],
                }),
                G &&
                  e.jsxs("div", {
                    className:
                      "bg-red-50 p-2 text-center text-[10px] text-red-600 font-sans border-t border-red-200 font-bold flex items-center justify-center gap-1 shrink-0",
                    children: [
                      e.jsx(to, { className: "h-3 w-3 shrink-0" }),
                      e.jsx("span", { children: G }),
                    ],
                  }),
                e.jsx("div", {
                  className: "p-3 bg-white border-t border-slate-200 shrink-0",
                  children: e.jsxs("form", {
                    onSubmit: ae,
                    className: "flex gap-2",
                    children: [
                      e.jsx("input", {
                        type: "text",
                        value: b,
                        onChange: (ge) => V(ge.target.value),
                        disabled: ee,
                        placeholder:
                          "Tanyakan pengaturan firewall, PPPoE profile kecepatan, VLAN bonding, blokir DNS...",
                        className:
                          "flex-1 p-3.5 bg-slate-50 border hover:border-slate-350 focus:border-indigo-500 rounded-xl text-xs outline-none font-sans font-medium",
                      }),
                      e.jsxs("button", {
                        type: "submit",
                        disabled: ee || !b.trim(),
                        className: `px-5 rounded-xl text-white font-bold text-xs flex items-center gap-1.5 transition-all cursor-pointer border shadow ${ee || !b.trim() ? "bg-slate-300 text-slate-500 border-slate-300 shadow-none cursor-not-allowed" : "bg-indigo-650 hover:bg-indigo-600 border-indigo-700 hover:scale-[1.02] active:scale-[0.98]"}`,
                        children: [
                          e.jsx(vc, { className: "h-3.5 w-3.5" }),
                          e.jsx("span", { children: "Kirim" }),
                        ],
                      }),
                    ],
                  }),
                }),
              ],
            }),
          ],
        }),
      J === "curation" &&
        e.jsxs("div", {
          className: "space-y-4 font-sans animate-fade-in text-xs",
          children: [
            e.jsxs("div", {
              className:
                "bg-white border rounded-2xl p-4 shadow-sm flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3",
              children: [
                e.jsxs("div", {
                  className:
                    "flex-1 w-full flex items-center gap-2 border bg-slate-50 rounded-xl px-3 py-1.5 focus-within:border-indigo-500",
                  children: [
                    e.jsx(Pi, { className: "h-4 w-4 text-slate-400 shrink-0" }),
                    e.jsx("input", {
                      type: "text",
                      placeholder:
                        "Cari kata kunci di prompt atau respon asisten...",
                      value: Se,
                      onChange: (ge) => le(ge.target.value),
                      className:
                        "bg-transparent border-none outline-none w-full text-xs font-sans text-slate-705 placeholder-slate-400",
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "flex gap-2 w-full sm:w-auto shrink-0 select-none",
                  children: [
                    e.jsxs("select", {
                      value: ie,
                      onChange: (ge) => $(ge.target.value),
                      className:
                        "p-2 border rounded-xl bg-white outline-none font-sans font-bold text-slate-700 cursor-pointer text-xs",
                      children: [
                        e.jsx("option", {
                          value: "all",
                          children: "Semua Kategori (Filter)",
                        }),
                        e.jsx("option", {
                          value: "PPPoE Setup",
                          children: "PPPoE Setup",
                        }),
                        e.jsx("option", {
                          value: "Hotspot Profile",
                          children: "Hotspot Profile",
                        }),
                        e.jsx("option", {
                          value: "Filter Firewall",
                          children: "Filter Firewall",
                        }),
                        e.jsx("option", {
                          value: "Troubleshooting",
                          children: "Troubleshooting",
                        }),
                        e.jsx("option", {
                          value: "Bandwidth Limit",
                          children: "Bandwidth Limit",
                        }),
                        e.jsx("option", {
                          value: "Auto-Edit",
                          children: "Auto-Edit",
                        }),
                        e.jsx("option", {
                          value: "Umum / Jaringan",
                          children: "Umum / Jaringan",
                        }),
                      ],
                    }),
                    e.jsx("button", {
                      onClick: he,
                      className:
                        "p-2 border rounded-xl hover:bg-slate-50 cursor-pointer font-bold transition text-slate-655",
                      title: "Refresh Database",
                      children: e.jsx(Va, { className: "h-3.5 w-3.5" }),
                    }),
                  ],
                }),
              ],
            }),
            e.jsxs("div", {
              className: "grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",
              children: [
                e.jsxs("div", {
                  className:
                    "lg:col-span-8 bg-white border border-slate-205 rounded-2xl overflow-hidden shadow-sm",
                  children: [
                    e.jsxs("div", {
                      className:
                        "px-4 py-3 bg-slate-50 border-b flex justify-between items-center text-xs font-bold text-slate-750",
                      children: [
                        e.jsx("span", {
                          children: "DATABASE RIWAYAT CHAT & LOG SERVER",
                        }),
                        e.jsxs("span", {
                          className: "text-[10px] text-slate-400",
                          children: [
                            "Total: ",
                            Mt.length,
                            " Percakapan Terkam",
                          ],
                        }),
                      ],
                    }),
                    e.jsx("div", {
                      className: "overflow-x-auto",
                      children: e.jsxs("table", {
                        className:
                          "w-full text-left border-collapse font-sans text-xs",
                        children: [
                          e.jsx("thead", {
                            children: e.jsxs("tr", {
                              className:
                                "bg-slate-100/80 text-slate-500 font-extrabold uppercase border-b text-[10px] tracking-wider font-mono",
                              children: [
                                e.jsx("th", {
                                  className: "p-3",
                                  children: "Waktu",
                                }),
                                e.jsx("th", {
                                  className: "p-3",
                                  children: "Kategori",
                                }),
                                e.jsx("th", {
                                  className: "p-3",
                                  children: "Pertanyaan Pembuka (Prompt)",
                                }),
                                e.jsx("th", {
                                  className: "p-3 text-center",
                                  children: "Status Kurasi",
                                }),
                                e.jsx("th", {
                                  className: "p-3 text-center",
                                  children: "Aksi",
                                }),
                              ],
                            }),
                          }),
                          e.jsx("tbody", {
                            className: "divide-y text-slate-700",
                            children:
                              Mt.length === 0
                                ? e.jsx("tr", {
                                    children: e.jsx("td", {
                                      colSpan: 5,
                                      className:
                                        "p-8 text-center text-slate-400 font-medium",
                                      children:
                                        "Tidak ditemukan log riwayat pencakapan AI terkam yang sesuai kriteria.",
                                    }),
                                  })
                                : Mt.map((ge) =>
                                    e.jsxs(
                                      "tr",
                                      {
                                        onClick: () => oe(ge),
                                        className: `hover:bg-slate-50/50 cursor-pointer transition ${de && de.id === ge.id ? "bg-indigo-50/30" : ""}`,
                                        children: [
                                          e.jsxs("td", {
                                            className:
                                              "p-3 font-mono text-[10px] whitespace-nowrap text-slate-400",
                                            children: [
                                              new Date(
                                                ge.timestamp,
                                              ).toLocaleTimeString("id", {
                                                hour: "2-digit",
                                                minute: "2-digit",
                                              }),
                                              " ",
                                              new Date(
                                                ge.timestamp,
                                              ).toLocaleDateString("id", {
                                                day: "2-digit",
                                                month: "short",
                                              }),
                                            ],
                                          }),
                                          e.jsx("td", {
                                            className: "p-3",
                                            children: e.jsx("span", {
                                              className:
                                                "px-2 py-0.5 rounded-full text-[9px] font-extrabold tracking-tight bg-slate-100 text-slate-600 font-mono",
                                              children: ge.category,
                                            }),
                                          }),
                                          e.jsx("td", {
                                            className:
                                              "p-3 max-w-[240px] truncate font-medium text-slate-800",
                                            children: ge.user_prompt,
                                          }),
                                          e.jsx("td", {
                                            className:
                                              "p-3 text-center whitespace-nowrap",
                                            children: e.jsx("span", {
                                              className: `px-2 py-0.5 rounded text-[9px] font-bold ${ge.curation_status === "Curated" ? "bg-emerald-50 text-emerald-700 border border-emerald-150" : ge.curation_status === "Pending Filter" ? "bg-amber-50 text-amber-700 border border-amber-150" : "bg-slate-50 text-slate-500 border border-slate-150"}`,
                                              children:
                                                ge.curation_status || "Pending",
                                            }),
                                          }),
                                          e.jsx("td", {
                                            className:
                                              "p-3 text-center whitespace-nowrap",
                                            onClick: (Me) =>
                                              Me.stopPropagation(),
                                            children: e.jsxs("div", {
                                              className:
                                                "flex justify-center gap-1.5 text-[10px]",
                                              children: [
                                                e.jsx("button", {
                                                  onClick: () =>
                                                    ze(ge.id, "Curated"),
                                                  className:
                                                    "px-1.5 py-0.5 bg-emerald-50 hover:bg-emerald-100 text-emerald-700 border border-emerald-200 rounded font-semibold cursor-pointer",
                                                  children: "Lolos Saring",
                                                }),
                                                e.jsx("button", {
                                                  onClick: () =>
                                                    ze(ge.id, "R&D Review"),
                                                  className:
                                                    "px-1.5 py-0.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 rounded font-semibold cursor-pointer",
                                                  children: "R&D",
                                                }),
                                              ],
                                            }),
                                          }),
                                        ],
                                      },
                                      ge.id,
                                    ),
                                  ),
                          }),
                        ],
                      }),
                    }),
                  ],
                }),
                e.jsx("div", {
                  className: "lg:col-span-4 space-y-4",
                  children: de
                    ? e.jsxs("div", {
                        className:
                          "bg-white border border-slate-205 rounded-2xl p-4 shadow-sm space-y-4",
                        children: [
                          e.jsxs("div", {
                            className:
                              "flex justify-between items-start border-b pb-2.5",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsx("h4", {
                                    className:
                                      "font-extrabold text-slate-800 text-[12px] uppercase tracking-wide",
                                    children: "Detail Track Percakapan",
                                  }),
                                  e.jsxs("p", {
                                    className:
                                      "text-[9px] text-slate-400 font-mono mt-0.5",
                                    children: ["Sesi ID: #", de.id],
                                  }),
                                ],
                              }),
                              e.jsx("button", {
                                onClick: () => oe(null),
                                className:
                                  "text-slate-400 hover:text-slate-600 text-[11px] font-bold",
                                children: "Batal",
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("span", {
                                className:
                                  "text-[10px] font-mono text-slate-400 block uppercase font-bold",
                                children: "User Prompt:",
                              }),
                              e.jsx("div", {
                                className:
                                  "p-2 bg-slate-50 rounded-xl font-medium text-slate-800 font-sans border text-[11px]",
                                children: de.user_prompt,
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "space-y-1",
                            children: [
                              e.jsx("span", {
                                className:
                                  "text-[10px] font-mono text-slate-400 block uppercase font-bold",
                                children: "AI Response Output:",
                              }),
                              e.jsx("div", {
                                className:
                                  "p-3 bg-slate-900 text-slate-100 rounded-xl font-mono text-[10.5px] border overflow-y-auto max-h-[180px] whitespace-pre-wrap leading-relaxed custom-scroll",
                                children: de.ai_response,
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "grid grid-cols-2 gap-3 pt-2 text-[10px] leading-tight",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "text-slate-400 font-extrabold block mb-0.5",
                                    children: "Kategori Terdeteksi",
                                  }),
                                  e.jsx("span", {
                                    className: "font-bold text-slate-700",
                                    children: de.category,
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "text-slate-400 font-extrabold block mb-0.5",
                                    children: "Waktu Pencatatan",
                                  }),
                                  e.jsx("span", {
                                    className:
                                      "font-bold text-slate-700 font-mono",
                                    children: new Date(
                                      de.timestamp,
                                    ).toLocaleString("id-ID"),
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className:
                              "p-2.5 bg-yellow-50 border border-yellow-100 rounded-xl text-[10px] text-yellow-800 leading-normal",
                            children: [
                              e.jsx("strong", {
                                children: "Tujuan Penyaringan:",
                              }),
                              " Riwayat chat direkam otomatis dan di saring untuk dianalisis guna melatih dataset model (R&D) di masa mendatang agar balasan asisten semakin akurat dan optimal bagi admin.",
                            ],
                          }),
                        ],
                      })
                    : e.jsxs("div", {
                        className:
                          "bg-slate-100 border border-dashed rounded-2xl p-8 text-center text-slate-400 font-medium",
                        children: [
                          e.jsx(hu, {
                            className: "h-6 w-6 text-slate-350 mx-auto mb-2",
                          }),
                          "Pilih salah satu baris log di sebelah kiri untuk melihat rekonstruksi percakapan dan respon AI NOC secara lengkap.",
                        ],
                      }),
                }),
              ],
            }),
          ],
        }),
      J === "editor" &&
        e.jsxs("div", {
          className: "space-y-4 font-sans animate-fade-in text-xs",
          children: [
            e.jsxs("div", {
              className:
                "bg-yellow-50 border border-yellow-200 rounded-2xl p-4 flex gap-3 text-yellow-905 font-medium leading-relaxed shadow-sm",
              children: [
                e.jsx(mc, {
                  className:
                    "h-5 w-5 text-yellow-650 shrink-0 select-none mt-0.5",
                }),
                e.jsxs("div", {
                  children: [
                    e.jsx("span", {
                      className:
                        "font-extrabold block uppercase text-[11px] tracking-wide text-yellow-850",
                      children: "🛠️ Lokalisasi File Auto-Edit Engine",
                    }),
                    e.jsx("p", {
                      className: "text-[11.5px] mt-0.5 text-yellow-800",
                      children:
                        'Pilih berkas konfigurasi RouterOS rsc lokal (.rsc / .html) yang disimpan pada cluster server. Ketik instruksi kustom Anda (misal: "Ubah limit bandwidth profile Home-Lite ke 20M/10M" atau "Tambahkan rule untuk drop http"), asisten AI akan menyunting dan menerapkan perubahan tersebut secara otomatis.',
                    }),
                  ],
                }),
              ],
            }),
            e.jsxs("div", {
              className: "grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",
              children: [
                e.jsxs("div", {
                  className:
                    "lg:col-span-3 bg-white border border-slate-205 rounded-2xl p-4 shadow-sm space-y-3",
                  children: [
                    e.jsx("h3", {
                      className:
                        "text-xs font-black text-slate-800 tracking-wider uppercase",
                      children: "📂 Daftar File Lokal RouterOS",
                    }),
                    e.jsx("div", {
                      className: "space-y-2",
                      children: be.map((ge) =>
                        e.jsxs(
                          "button",
                          {
                            onClick: () => $e(ge.name),
                            className: `w-full text-left p-2.5 rounded-xl border transition-all cursor-pointer flex items-center gap-2.5 leading-tight ${Te === ge.name ? "bg-indigo-600 border-indigo-700 text-white shadow-md shadow-indigo-605/10" : "bg-slate-50 border-slate-200 hover:bg-slate-100 hover:border-slate-300 text-slate-700"}`,
                            children: [
                              e.jsx(wp, {
                                className: `h-4.5 w-4.5 shrink-0 ${Te === ge.name ? "text-white" : "text-indigo-650"}`,
                              }),
                              e.jsxs("div", {
                                className: "min-w-0 flex-1",
                                children: [
                                  e.jsx("span", {
                                    className:
                                      "font-extrabold block truncate text-xs",
                                    children: ge.name,
                                  }),
                                  e.jsx("span", {
                                    className: `text-[8.5px] font-sans truncate block mt-0.5 ${Te === ge.name ? "text-indigo-205" : "text-slate-400"}`,
                                    children: ge.description,
                                  }),
                                ],
                              }),
                            ],
                          },
                          ge.name,
                        ),
                      ),
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "lg:col-span-9 grid grid-cols-1 md:grid-cols-12 gap-6",
                  children: [
                    e.jsxs("div", {
                      className:
                        "md:col-span-7 bg-slate-900 border border-slate-800 text-slate-100 rounded-2xl flex flex-col h-[480px] shadow-lg overflow-hidden",
                      children: [
                        e.jsxs("div", {
                          className:
                            "px-4 py-2.5 bg-slate-950 border-b border-slate-800 flex justify-between items-center text-[10.5px] font-mono tracking-wide text-slate-400 shrink-0",
                          children: [
                            e.jsxs("div", {
                              className: "flex items-center gap-1.5",
                              children: [
                                e.jsx("span", {
                                  className:
                                    "h-2 w-2 rounded-full bg-indigo-500",
                                }),
                                e.jsxs("span", {
                                  children: [
                                    "Lokal Skrip Editor: ",
                                    e.jsx("strong", {
                                      className: "text-white font-mono",
                                      children: Te,
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            e.jsx("span", {
                              className:
                                "text-[9px] bg-slate-800 px-1.5 text-slate-400 font-bold uppercase rounded",
                              children: "ROUTEROS SCRIPT",
                            }),
                          ],
                        }),
                        e.jsx("div", {
                          className:
                            "flex-1 p-4 font-mono text-[10.5px] leading-relaxed overflow-y-auto whitespace-pre custom-scroll text-emerald-400 bg-slate-950/90 [tab-size:4]",
                          children: me,
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "md:col-span-5 bg-white border border-slate-205 rounded-2xl p-4 shadow-sm flex flex-col h-[480px] justify-between",
                      children: [
                        e.jsxs("div", {
                          className:
                            "space-y-4 flex-1 overflow-y-auto custom-scroll pr-1",
                          children: [
                            e.jsxs("div", {
                              children: [
                                e.jsx("h4", {
                                  className:
                                    "font-extrabold text-slate-800 text-[12px] uppercase tracking-wide",
                                  children: "Papan Perintah AI Edit",
                                }),
                                e.jsx("p", {
                                  className:
                                    "text-[10px] text-slate-400 mt-0.5 leading-relaxed font-sans",
                                  children:
                                    "Ketik instruksi modifikasi skrip Anda dalam bahasa Indonesia. AI akan menulis ulang isi skrip dan menerapkan update.",
                                }),
                              ],
                            }),
                            e.jsxs("form", {
                              onSubmit: at,
                              className: "space-y-3 select-none",
                              children: [
                                e.jsxs("div", {
                                  className: "space-y-1",
                                  children: [
                                    e.jsx("label", {
                                      className:
                                        "font-bold text-slate-600 block text-[10px] uppercase",
                                      children: "Instruksi Edit File",
                                    }),
                                    e.jsx("textarea", {
                                      value: Ue,
                                      onChange: (ge) => y(ge.target.value),
                                      disabled: K,
                                      placeholder:
                                        'Contoh: "Ubah limit bandwidth Home-Lite menjadi 20M/15M" atau "Tambahkan drop firewall rules http port 80"',
                                      className:
                                        "w-full p-2.5 bg-slate-50 border hover:border-slate-300 focus:border-indigo-500 rounded-xl outline-none font-sans text-xs h-24 resize-none leading-relaxed",
                                    }),
                                  ],
                                }),
                                e.jsx("button", {
                                  type: "submit",
                                  disabled: K || !Ue.trim(),
                                  className: `w-full py-2.5 rounded-xl font-bold text-xs flex items-center justify-center gap-1.5 transition shadow cursor-pointer border ${K || !Ue.trim() ? "bg-slate-100 text-slate-500 border-slate-200 cursor-not-allowed shadow-none" : "bg-indigo-650 hover:bg-indigo-600 text-white border-indigo-700 hover:scale-[1.01] active:scale-[0.99]"}`,
                                  children: K
                                    ? e.jsxs(e.Fragment, {
                                        children: [
                                          e.jsx(Va, {
                                            className:
                                              "h-3.5 w-3.5 animate-spin",
                                          }),
                                          e.jsx("span", {
                                            children:
                                              "AI Sedang Menyunting File...",
                                          }),
                                        ],
                                      })
                                    : e.jsxs(e.Fragment, {
                                        children: [
                                          e.jsx(no, {
                                            className:
                                              "h-3.5 w-3.5 text-amber-300 fill-current animate-bounce",
                                          }),
                                          e.jsx("span", {
                                            children: "Jalankan Auto-Edit File",
                                          }),
                                        ],
                                      }),
                                }),
                              ],
                            }),
                            I &&
                              e.jsxs("div", {
                                className:
                                  "p-3 bg-red-50 border border-red-150 rounded-xl text-red-750 flex gap-2 leading-relaxed",
                                children: [
                                  e.jsx(to, {
                                    className:
                                      "h-4.5 w-4.5 text-red-500 shrink-0 mt-0.5",
                                  }),
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("span", {
                                        className:
                                          "font-extrabold block text-[10.5px]",
                                        children: "Penyuntingan Gagal",
                                      }),
                                      e.jsx("span", {
                                        className: "text-[10px] leading-normal",
                                        children: I,
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                            g &&
                              e.jsxs("div", {
                                className:
                                  "p-3 bg-emerald-50 border border-emerald-150 rounded-xl text-emerald-800 flex gap-2.5 leading-relaxed",
                                children: [
                                  e.jsx(tn, {
                                    className:
                                      "h-4.5 w-4.5 text-emerald-550 shrink-0 mt-0.5",
                                  }),
                                  e.jsxs("div", {
                                    children: [
                                      e.jsx("span", {
                                        className:
                                          "font-extrabold block text-[10.5px]",
                                        children: "Auto-Edit Berhasil!",
                                      }),
                                      e.jsx("p", {
                                        className:
                                          "text-[10px] leading-relaxed mt-1 text-slate-600 font-sans",
                                        children:
                                          P ||
                                          "Isi berkas konfigurasi lokal berhasil dimutakhirkan dengan aman.",
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                          ],
                        }),
                        me !== te &&
                          e.jsxs("div", {
                            className:
                              "border-t pt-3 mt-3 flex justify-between items-center text-[10px] font-sans",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsx("span", {
                                    className: "text-amber-600 font-bold block",
                                    children: "⚠️ Skrip Belum Disimpan?",
                                  }),
                                  e.jsx("span", {
                                    className: "text-slate-400",
                                    children:
                                      "File telah dimodifikasi secara dinamis di server.",
                                  }),
                                ],
                              }),
                              e.jsx("button", {
                                onClick: () => {
                                  (Oe(te), z(""), C(""), X(""));
                                },
                                className:
                                  "px-2 py-1 text-slate-400 hover:text-red-650 font-bold border border-slate-205 hover:bg-slate-50 rounded",
                                children: "Batalkan / Reset",
                              }),
                            ],
                          }),
                      ],
                    }),
                  ],
                }),
              ],
            }),
          ],
        }),
    ],
  });
}
function zg() {
  // MIKROBIL_ZG_EXTENDED_STATES
  const [logs, setLogs] = f.useState([]);
  const [logsQuery, setLogsQuery] = f.useState("");
  const [admName, setAdmName] = f.useState("");
  const [admEmail, setAdmEmail] = f.useState("");
  const [admPass, setAdmPass] = f.useState("");
  const [admLoading, setAdmLoading] = f.useState(!1);

  f.useEffect(() => {
    if (window.currentUserSession && window.currentUserSession.user) {
      setAdmName(window.currentUserSession.user.name || "Ahmad Arsal");
      setAdmEmail(window.currentUserSession.user.email || "admin@mikrobil.com");
      setAdmPass(window.currentUserSession.user.password || "");
    }
  }, []);

  const updateAdminProfile = async (ev) => {
    ev.preventDefault();
    if (!admName.trim() || !admEmail.trim()) {
      Y({ type: "error", message: "Nama dan Email wajib diisi." });
      return;
    }
    setAdmLoading(!0);
    try {
      const res = await (await fetch("/api/v1/user/profile", {
        method: "PUT",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          current_email: window.currentUserSession?.user?.email || "admin@mikrobil.com",
          name: admName,
          email: admEmail,
          password: admPass
        })
      })).json();
      if (res.status === "success") {
        Y({ type: "success", message: "Profil Pemilik Web berhasil diperbarui!" });
        if (window.currentUserSession && window.currentUserSession.user) {
          window.currentUserSession.user = res.data.user;
        }
        z(); // Refresh
      } else {
        Y({ type: "error", message: res.message || "Gagal memperbarui profil." });
      }
    } catch (e) {
      Y({ type: "error", message: "Terjadi gangguan jaringan." });
    } finally {
      setAdmLoading(!1);
    }
  };

  const clearSaaSLogs = async () => {
    if (window.confirm("Apakah Anda yakin ingin menghapus seluruh log audit secara permanen?")) {
      try {
        const res = await (await fetch("/api/v1/saas/logs/clear", { method: "POST" })).json();
        if (res.status === "success") {
          Y({ type: "success", message: res.message });
          setLogs([]);
        }
      } catch (e) {
        Y({ type: "error", message: "Gagal berkomunikasi dengan server." });
      }
    }
  };

const [w, J] = f.useState([]),
    [S, b] = f.useState("tenants"),
    [V, ue] = f.useState(""),
    [re, ee] = f.useState("all"),
    [B, T] = f.useState(!1),
    [fe, G] = f.useState(!1),
    [F, ce] = f.useState(!1),
    [ve, Y] = f.useState(null),
    [Ee, Se] = f.useState([]),
    [le, ie] = f.useState(""),
    [$, de] = f.useState(""),
    [oe, be] = f.useState(!1),
    [Ye, Te] = f.useState(!1),
    [Ie, me] = f.useState(!1),
    [Oe, te] = f.useState(null),
    [Ae, Ue] = f.useState([
      {
        id: 1,
        name: "Starter",
        max_customers: 100,
        max_routers: 3,
        max_olts: 1,
        monthly_price: 15e4,
      },
      {
        id: 2,
        name: "Professional",
        max_customers: 1e3,
        max_routers: 20,
        max_olts: 5,
        monthly_price: 5e5,
      },
      {
        id: 3,
        name: "Enterprise",
        max_customers: 999999,
        max_routers: 999,
        max_olts: 99,
        monthly_price: 15e5,
      },
    ]),
    [y, K] = f.useState(!1),
    [O, P] = f.useState({
      active_gateway: "midtrans",
      midtrans_client_key: "SB-Mid-client-Plat73942",
      midtrans_server_key: "SB-Mid-server-PlatX829384",
      xendit_api_key: "xnd_development_PlatformKey928372",
      bank_name: "Bank Mandiri",
      bank_account_number: "1350020260611",
      bank_account_name: "PT MikRobiL Solusi Digital",
      auto_approve: !1,
      environment: "sandbox",
    }),
    z = async () => {
      T(!0);
      try {
        const _e = await (await fetch("/api/v1/saas/tenants")).json();
        _e.status === "success" && J(_e.data);
        const Xe = await (await fetch("/api/v1/saas/settings")).json();
        Xe.status === "success" && Xe.data && P(Xe.data);
        const St = await (await fetch("/api/v1/saas/plans")).json();
        St.status === "success" && St.data && Ue(St.data);
        
        const logsRes = await (await fetch("/api/v1/saas/logs")).json();
        logsRes.status === "success" && setLogs(logsRes.data);
const Re = await (await fetch("/api/v1/saas/backup/snapshots")).json();
        Re.status === "success" && Se(Re.data);
      } catch (Z) {
        console.error("[SaaS Load Error]", Z);
      } finally {
        T(!1);
      }
    };
  f.useEffect(() => {
    z();
  }, []);
  const g = async (Z, _e) => {
      try {
        const Xe = await (
          await fetch(`/api/v1/saas/tenants/${Z}/status`, {
            method: "PUT",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ status: _e }),
          })
        ).json();
        Xe.status === "success"
          ? (Y({
              type: "success",
              message: `Status tenant berhasil diubah menjadi: ${_e.toUpperCase()}`,
            }),
            z())
          : Y({
              type: "error",
              message: Xe.message || "Gagal mengubah status tenant",
            });
      } catch {
        Y({ type: "error", message: "Gagal berkomunikasi dengan server" });
      }
    },
    C = async (Z, _e) => {
      try {
        const Xe = await (
          await fetch(`/api/v1/saas/tenants/${Z}/plan`, {
            method: "PUT",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ subscription_plan_id: _e }),
          })
        ).json();
        Xe.status === "success"
          ? (Y({
              type: "success",
              message: "Paket langganan tenant berhasil diperbarui!",
            }),
            z())
          : Y({
              type: "error",
              message: Xe.message || "Gagal mengubah paket tenant",
            });
      } catch {
        Y({ type: "error", message: "Gagal memperbarui paket tenant" });
      }
    },
    I = async (Z, _e) => {
      if (
        window.confirm(
          `Apakah Anda yakin ingin menghapus tenant "${_e}" beserta seluruh data user di dalamnya secara permanen? Tindakan ini tidak dapat dipulihkan!`,
        )
      )
        try {
          const Xe = await (
            await fetch(`/api/v1/saas/tenants/${Z}`, { method: "DELETE" })
          ).json();
          Xe.status === "success"
            ? (Y({
                type: "success",
                message: `Tenant "${_e}" berhasil dihapus dari platform!`,
              }),
              z())
            : Y({
                type: "error",
                message: Xe.message || "Gagal menghapus tenant",
              });
        } catch {
          Y({ type: "error", message: "Gagal berkomunikasi dengan server" });
        }
    },
    X = async (Z) => {
      (Z.preventDefault(), G(!0));
      try {
        const Ze = await (
          await fetch("/api/v1/saas/settings", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(O),
          })
        ).json();
        Ze.status === "success"
          ? (Y({
              type: "success",
              message:
                "Konfigurasi Payment Gateway & Platform SaaS berhasil disimpan!",
            }),
            z())
          : Y({
              type: "error",
              message: Ze.message || "Gagal menyimpan konfigurasi",
            });
      } catch {
        Y({ type: "error", message: "Gagal mengirim data pengaturan" });
      } finally {
        G(!1);
      }
    },
    pe = async () => {
      Te(!0);
      try {
        const _e = await (await fetch("/api/v1/saas/backup/export")).json();
        if (_e.status === "success") {
          const Ze = JSON.stringify(_e.data, null, 2),
            Xe = new Blob([Ze], { type: "application/json" }),
            Ht = URL.createObjectURL(Xe),
            St = document.createElement("a"),
            E = new Date().toISOString().slice(0, 19).replace(/[:T]/g, "-");
          ((St.href = Ht),
            (St.download = `mikrobil_saas_platform_backup_${E}.json`),
            document.body.appendChild(St),
            St.click(),
            document.body.removeChild(St),
            URL.revokeObjectURL(Ht),
            Y({
              type: "success",
              message: "Cadangan data utuh berhasil diexport dan didownload!",
            }));
        } else
          Y({
            type: "error",
            message: _e.message || "Gagal menyusun data backup",
          });
      } catch {
        Y({
          type: "error",
          message: "Gagal berkomunikasi dengan server untuk backup export",
        });
      } finally {
        Te(!1);
      }
    },
    he = async (Z) => {
      var Xe;
      const _e = (Xe = Z.target.files) == null ? void 0 : Xe[0];
      if (!_e) return;
      (me(!0), te(null));
      const Ze = new FileReader();
      ((Ze.onload = async (Ht) => {
        var St;
        try {
          const E = (St = Ht.target) == null ? void 0 : St.result,
            Re = JSON.parse(E);
          if (!Re.tenants || !Re.users) {
            (te(
              "Format berkas backup salah. Pastikan file JSON cadangan yang valid.",
            ),
              me(!1));
            return;
          }
          const Fe = await (
            await fetch("/api/v1/saas/backup/import", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ backupData: Re }),
            })
          ).json();
          Fe.status === "success"
            ? (Y({
                type: "success",
                message:
                  "Restorasi sukses! Database platform dan semua tenant diperbarui ke versi backup.",
              }),
              z())
            : te(Fe.message || "Gagal memulihkan data backup");
        } catch (E) {
          te("Gagal membaca atau memproses berkas JSON: " + E.message);
        } finally {
          (me(!1), (Z.target.value = ""));
        }
      }),
        (Ze.onerror = () => {
          (te("Gagal membaca berkas."), me(!1));
        }),
        Ze.readAsText(_e));
    },
    Ne = async (Z) => {
      if ((Z.preventDefault(), !!le.trim())) {
        be(!0);
        try {
          const Ze = await (
            await fetch("/api/v1/saas/backup/snapshots", {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({ name: le, note: $ }),
            })
          ).json();
          Ze.status === "success"
            ? (Y({
                type: "success",
                message: "Snapshot restore point berhasil dibuat!",
              }),
              ie(""),
              de(""),
              z())
            : Y({
                type: "error",
                message: Ze.message || "Gagal membuat snapshot",
              });
        } catch {
          Y({ type: "error", message: "Gagal berkomunikasi dengan server" });
        } finally {
          be(!1);
        }
      }
    },
    $e = async (Z, _e) => {
      if (
        window.confirm(
          `Apakah Anda yakin ingin memulihkan sistem ke snapshot "${_e}"? Ini akan menimpa seluruh state aktif saat ini!`,
        )
      )
        try {
          const Xe = await (
            await fetch(`/api/v1/saas/backup/snapshots/${Z}/restore`, {
              method: "POST",
            })
          ).json();
          Xe.status === "success"
            ? (Y({
                type: "success",
                message: `Sistem berhasil dimundurkan ke snapshot "${_e}"!`,
              }),
              z())
            : Y({
                type: "error",
                message: Xe.message || "Gagal memulihkan snapshot",
              });
        } catch {
          Y({ type: "error", message: "Gagal terhubung ke server" });
        }
    },
    ae = async (Z) => {
      if (window.confirm("Hapus snapshot pemulihan ini?"))
        try {
          (
            await (
              await fetch(`/api/v1/saas/backup/snapshots/${Z}`, {
                method: "DELETE",
              })
            ).json()
          ).status === "success" &&
            (Y({ type: "success", message: "Snapshot berhasil dihapus!" }),
            z());
        } catch {
          Y({ type: "error", message: "Gagal terhubung ke server" });
        }
    },
    ze = (Z, _e, Ze) => {
      Ue((Xe) => Xe.map((Ht) => (Ht.id === Z ? { ...Ht, [_e]: Ze } : Ht)));
    },
    at = async (Z) => {
      (Z.preventDefault(), K(!0));
      try {
        const Ze = await (
          await fetch("/api/v1/saas/plans", {
            method: "PUT",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ plans: Ae }),
          })
        ).json();
        Ze.status === "success"
          ? (Y({
              type: "success",
              message:
                "Paket langganan (SaaS Plans) berhasil disimpan & disinkronisasikan ke platform!",
            }),
            z())
          : Y({
              type: "error",
              message: Ze.message || "Gagal menyimpan konfigurasi paket",
            });
      } catch {
        Y({ type: "error", message: "Gagal berkomunikasi dengan server" });
      } finally {
        K(!1);
      }
    },
    bt = w.filter((Z) => {
      const _e =
        Z.company_name.toLowerCase().includes(V.toLowerCase()) ||
        Z.name.toLowerCase().includes(V.toLowerCase()) ||
        Z.domain.toLowerCase().includes(V.toLowerCase()) ||
        Z.email.toLowerCase().includes(V.toLowerCase());
      return re === "all" ? _e : _e && Z.status === re;
    }),
    Mt = w.length,
    ge = w.filter((Z) => Z.status === "active").length,
    Me = w.filter((Z) => Z.status === "pending").length,
    mt = w.filter((Z) => Z.status === "trial").length,
    st = w.reduce((Z, _e) => {
      if (_e.status === "active") {
        const Ze = Ae.find((Xe) => Xe.id === _e.subscription_plan_id);
        return Z + (Ze ? Ze.monthly_price : 0);
      }
      return Z;
    }, 0);
  return e.jsxs("div", {
    id: "saas-admin-container",
    className: "space-y-6 font-sans",
    children: [
      e.jsxs("div", {
        className:
          "flex flex-col md:flex-row justify-between items-start md:items-center gap-4 bg-white p-5 rounded-xl border border-slate-200",
        children: [
          e.jsxs("div", {
            children: [
              e.jsx("span", {
                className:
                  "text-[10px] uppercase font-bold text-blue-600 font-mono tracking-wider",
                children: "Super Administrator Area",
              }),
              e.jsxs("h1", {
                className:
                  "text-2xl font-bold font-display text-slate-800 flex items-center gap-2",
                children: [
                  e.jsx(jp, { className: "h-6 w-6 text-blue-600" }),
                  "Panel Pemilik Web (SaaS Control Room)",
                ],
              }),
              e.jsx("p", {
                className: "text-xs text-slate-500 mt-1",
                children:
                  "Gunakan panel ini untuk mengelola pendaftaran tenant ISP, melakukan verifikasi (ACC), dan mengkonfigurasi sistem pembayaran global.",
              }),
            ],
          }),
          e.jsxs("div", {
            className: "flex items-center gap-2",
            children: [
              e.jsx("span", {
                className: "h-2 w-2 rounded-full bg-green-500 animate-ping",
              }),
              e.jsx("span", {
                className: "text-xs font-semibold text-slate-600",
                children: "Platform Core Engine: Terhubung",
              }),
            ],
          }),
        ],
      }),
      ve &&
        e.jsxs("div", {
          id: "saas-alert-banner",
          className: `flex items-start gap-3 p-4 rounded-xl border ${ve.type === "success" ? "bg-green-50 border-green-200 text-green-800" : "bg-rose-50 border-rose-200 text-rose-800"}`,
          children: [
            ve.type === "success"
              ? e.jsx(hc, {
                  className: "h-5 w-5 text-green-600 shrink-0 mt-0.5",
                })
              : e.jsx(to, {
                  className: "h-5 w-5 text-rose-600 shrink-0 mt-0.5",
                }),
            e.jsx("div", {
              className: "text-sm flex-1 font-semibold",
              children: ve.message,
            }),
            e.jsx("button", {
              onClick: () => Y(null),
              className: "text-slate-400 hover:text-slate-605",
              children: e.jsx(la, { className: "h-4 w-4" }),
            }),
          ],
        }),
      e.jsxs("div", {
        className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
        children: [
          e.jsxs("div", {
            className:
              "bg-white p-5 rounded-xl border border-slate-200 flex items-center gap-4 hover:shadow-lg transition-all duration-300",
            children: [
              e.jsx("div", {
                className: "p-3 bg-blue-50 text-blue-600 rounded-lg",
                children: e.jsx(Jn, { className: "h-6 w-6" }),
              }),
              e.jsxs("div", {
                children: [
                  e.jsx("p", {
                    className:
                      "text-xs text-slate-500 font-semibold font-mono uppercase tracking-wider",
                    children: "Total Tenant",
                  }),
                  e.jsx("h3", {
                    className: "text-2xl font-bold font-display text-slate-800",
                    children: Mt,
                  }),
                  e.jsx("span", {
                    className: "text-[10px] text-slate-400",
                    children: "Terdaftar di platform",
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "bg-white p-5 rounded-xl border border-slate-200 flex items-center gap-4 hover:shadow-lg transition-all duration-300",
            children: [
              e.jsx("div", {
                className: "p-3 bg-amber-50 text-amber-600 rounded-lg",
                children: e.jsx(du, { className: "h-6 w-6 animate-pulse" }),
              }),
              e.jsxs("div", {
                children: [
                  e.jsx("p", {
                    className:
                      "text-xs text-slate-500 font-semibold font-mono uppercase tracking-wider",
                    children: "Butuh ACC (Pendaftar)",
                  }),
                  e.jsx("h3", {
                    className: "text-2xl font-bold font-display text-amber-600",
                    children: Me,
                  }),
                  e.jsx("span", {
                    className: "text-[10px] text-amber-500 font-bold",
                    children: "Harus disetujui admin",
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "bg-white p-5 rounded-xl border border-slate-200 flex items-center gap-4 hover:shadow-lg transition-all duration-300",
            children: [
              e.jsx("div", {
                className: "p-3 bg-emerald-50 text-emerald-600 rounded-lg",
                children: e.jsx(hc, { className: "h-6 w-6" }),
              }),
              e.jsxs("div", {
                children: [
                  e.jsx("p", {
                    className:
                      "text-xs text-slate-500 font-semibold font-mono uppercase tracking-wider",
                    children: "Tenant Aktif",
                  }),
                  e.jsx("h3", {
                    className:
                      "text-2xl font-bold font-display text-emerald-600",
                    children: ge,
                  }),
                  e.jsxs("span", {
                    className: "text-[10px] text-emerald-500 font-semibold",
                    children: [mt, " mode free trial"],
                  }),
                ],
              }),
            ],
          }),
          e.jsxs("div", {
            className:
              "bg-white p-5 rounded-xl border border-slate-200 flex items-center gap-4 hover:shadow-lg transition-all duration-300",
            children: [
              e.jsx("div", {
                className: "p-3 bg-violet-50 text-violet-600 rounded-lg",
                children: e.jsx(a0, { className: "h-6 w-6" }),
              }),
              e.jsxs("div", {
                children: [
                  e.jsx("p", {
                    className:
                      "text-xs text-slate-500 font-semibold font-mono uppercase tracking-wider",
                    children: "Estimasi Omset / Bulan",
                  }),
                  e.jsxs("h3", {
                    className:
                      "text-2xl font-bold font-display text-violet-700",
                    children: ["Rp ", st.toLocaleString("id-ID")],
                  }),
                  e.jsx("span", {
                    className: "text-[10px] text-violet-500 font-semibold",
                    children: "SaaS Subscription",
                  }),
                ],
              }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className:
          "flex border-b border-slate-200 bg-white p-1 rounded-xl border",
        children: [
          e.jsxs("button", {
            onClick: () => b("tenants"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "tenants" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx(jp, { className: "h-4 w-4" }),
              e.jsx("span", {
                children: "Manajemen Tenant (Pendaftaran & ACC)",
              }),
              Me > 0 &&
                e.jsx("span", {
                  className:
                    "bg-red-500 text-white font-mono text-[9px] h-4 min-w-4 flex items-center justify-center rounded-full leading-none px-1",
                  children: Me,
                }),
            ],
          }),
          e.jsxs("button", {
            onClick: () => b("payment"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "payment" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx(sr, { className: "h-4 w-4" }),
              e.jsx("span", { children: "SaaS Payment Gateway (Pendaftaran)" }),
            ],
          }),
          e.jsxs("button", {
            onClick: () => b("plans"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "plans" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx(F0, { className: "h-4 w-4" }),
              e.jsx("span", { children: "Paket Langganan (SaaS Plans)" }),
            ],
          }),
          e.jsxs("button", {
            onClick: () => b("backup"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "backup" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx($n, { className: "h-4 w-4" }),
              e.jsx("span", {
                children: "Cadangan & Pemulihan (Backup & Restore)",
              }),
            ],
          }),
          e.jsxs("button", {
            onClick: () => b("saas_logs"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "saas_logs" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx(jp, { className: "h-4 w-4 text-amber-500" }),
              e.jsx("span", { children: "Log Aktivitas SaaS" }),
            ],
          }),
          e.jsxs("button", {
            onClick: () => b("profile"),
            className: `flex-1 py-3 text-xs font-bold rounded-lg transition-all cursor-pointer flex items-center justify-center gap-2 ${S === "profile" ? "bg-blue-600 text-white shadow-md" : "text-slate-600 hover:text-slate-900 hover:bg-slate-50"}`,
            children: [
              e.jsx(Jn, { className: "h-4 w-4 text-emerald-500" }),
              e.jsx("span", { children: "Profil & Keamanan" }),
            ],
          }),
        ],
      }),
      e.jsxs("div", {
        className:
          "bg-white rounded-xl border border-slate-200 overflow-hidden",
        children: [
          
          S === "profile" &&
            e.jsx("div", {
              className: "p-6 space-y-6 max-w-xl",
              children: e.jsxs("div", {
                className: "space-y-4",
                children: [
                  e.jsxs("div", {
                    children: [
                      e.jsx("h2", { className: "text-base font-bold text-slate-800", children: "Pengaturan Akun & Sandi Super Admin" }),
                      e.jsx("p", { className: "text-xs text-slate-400 mt-1", children: "Perbarui identitas login Anda sebagai pemilik utama platform SaaS MikRobiL." })
                    ]
                  }),
                  e.jsxs("form", {
                    onSubmit: updateAdminProfile,
                    className: "space-y-4",
                    children: [
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", { className: "text-[10px] uppercase font-bold text-slate-500 font-mono tracking-wider", children: "Nama Super Admin" }),
                          e.jsx("input", {
                            type: "text",
                            value: admName,
                            onChange: (Z) => setAdmName(Z.target.value),
                            className: "w-full border border-slate-200 rounded-lg p-2.5 text-xs outline-none focus:ring-2 focus:ring-blue-500/25 font-sans"
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", { className: "text-[10px] uppercase font-bold text-slate-500 font-mono tracking-wider", children: "Alamat Email" }),
                          e.jsx("input", {
                            type: "email",
                            value: admEmail,
                            onChange: (Z) => setAdmEmail(Z.target.value),
                            className: "w-full border border-slate-200 rounded-lg p-2.5 text-xs outline-none focus:ring-2 focus:ring-blue-500/25 font-sans"
                          })
                        ]
                      }),
                      e.jsxs("div", {
                        className: "space-y-1.5",
                        children: [
                          e.jsx("label", { className: "text-[10px] uppercase font-bold text-slate-500 font-mono tracking-wider", children: "Kata Sandi" }),
                          e.jsx("input", {
                            type: "text",
                            value: admPass,
                            onChange: (Z) => setAdmPass(Z.target.value),
                            className: "w-full border border-slate-200 rounded-lg p-2.5 text-xs outline-none focus:ring-2 focus:ring-blue-500/25 font-mono"
                          })
                        ]
                      }),
                      e.jsx("button", {
                        type: "submit",
                        disabled: admLoading,
                        className: "px-5 py-2.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-bold transition-all shadow-sm cursor-pointer disabled:opacity-50",
                        children: admLoading ? "Menyimpan..." : "Simpan Perubahan Profil"
                      })
                    ]
                  })
                ]
              })
            }),
          S === "saas_logs" &&
            e.jsxs("div", {
              className: "p-6 space-y-6",
              children: [
                e.jsxs("div", {
                  className: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",
                  children: [
                    e.jsxs("div", {
                      children: [
                        e.jsx("h2", { className: "text-base font-bold text-slate-800", children: "Log Aktivitas Keamanan & Perubahan Akun" }),
                        e.jsx("p", { className: "text-xs text-slate-400 mt-1", children: "Penampungan riwayat audit real-time perubahan nama, email, dan sandi seluruh akun SaaS." })
                      ]
                    }),
                    e.jsxs("div", {
                      className: "flex gap-2",
                      children: [
                        e.jsx("button", {
                          type: "button",
                          onClick: z,
                          className: "px-3 py-2 border border-slate-200 text-slate-600 hover:bg-slate-50 rounded-lg text-[11px] font-semibold cursor-pointer transition-all",
                          children: "Muat Ulang"
                        }),
                        e.jsx("button", {
                          type: "button",
                          onClick: clearSaaSLogs,
                          className: "px-3 py-2 bg-rose-50 text-rose-700 border border-rose-200 hover:bg-rose-100 rounded-lg text-[11px] font-bold cursor-pointer transition-all",
                          children: "Kosongkan Log"
                        })
                      ]
                    })
                  ]
                }),
                e.jsxs("div", {
                  className: "relative max-w-sm",
                  children: [
                    e.jsx(Pi, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-slate-400" }),
                    e.jsx("input", {
                      type: "text",
                      placeholder: "Cari berdasarkan nama tenant, email atau tindakan...",
                      value: logsQuery,
                      onChange: (Z) => setLogsQuery(Z.target.value),
                      className: "w-full pl-9 pr-4 py-2 border border-slate-200 rounded-lg text-xs font-sans outline-none focus:ring-2 focus:ring-blue-500/25 transition-all text-slate-700 text-xs"
                    })
                  ]
                }),
                e.jsx("div", {
                  className: "overflow-x-auto border border-slate-150 rounded-xl",
                  children: e.jsxs("table", {
                    className: "w-full text-left border-collapse font-sans text-xs",
                    children: [
                      e.jsx("thead", {
                        children: e.jsxs("tr", {
                          className: "bg-slate-50 text-slate-500 font-mono text-[9px] font-bold uppercase border-b border-slate-100",
                          children: [
                            e.jsx("th", { className: "p-3", children: "ID" }),
                            e.jsx("th", { className: "p-3", children: "SaaS Tenant / Perusahaan" }),
                            e.jsx("th", { className: "p-3", children: "Akun Pengguna (User)" }),
                            e.jsx("th", { className: "p-3", children: "Tindakan Keamanan / Audit Log" }),
                            e.jsx("th", { className: "p-3 text-right", children: "Waktu Pencatatan" })
                          ]
                        })
                      }),
                      e.jsx("tbody", {
                        className: "divide-y divide-slate-100 text-slate-700 text-xs",
                        children: logs
                          .filter(log => {
                            const q = logsQuery.toLowerCase();
                            return (log.tenant_name || "").toLowerCase().includes(q) ||
                                   (log.user_name || "").toLowerCase().includes(q) ||
                                   (log.user_email || "").toLowerCase().includes(q) ||
                                   (log.action || "").toLowerCase().includes(q);
                          })
                          .map((log) => e.jsxs("tr", {
                            className: "hover:bg-slate-50/50 transition-colors text-xs",
                            children: [
                              e.jsx("td", { className: "p-3 font-mono text-slate-400 text-xs", children: log.id }),
                              e.jsx("td", { className: "p-3 font-bold text-slate-800 text-xs", children: log.tenant_name || "MikRobiL SaaS" }),
                              e.jsxs("td", {
                                className: "p-3 font-medium text-xs",
                                children: [
                                  e.jsx("div", { className: "text-slate-800 font-medium text-xs", children: log.user_name }),
                                  e.jsx("div", { className: "text-[9px] text-slate-400 font-mono", children: log.user_email })
                                ]
                              }),
                              e.jsx("td", { className: "p-3 text-xs", children: e.jsx("span", {
                                className: "bg-amber-50 text-amber-805 px-2 py-0.5 rounded border border-amber-100 font-medium font-sans inline-block text-xs",
                                children: log.action
                              }) }),
                              e.jsx("td", { className: "p-3 text-right font-mono text-[9px] text-slate-400 text-xs", children: log.timestamp ? new Date(log.timestamp).toLocaleString("id-ID") : "N/A" })
                            ]
                          }))
                      })
                    ]
                  })
                })
              ]
            }),
S === "tenants" &&
            e.jsxs("div", {
              className: "p-6",
              children: [
                e.jsxs("div", {
                  className:
                    "flex flex-col sm:flex-row justify-between gap-4 mb-6",
                  children: [
                    e.jsxs("div", {
                      className: "relative flex-1 max-w-md",
                      children: [
                        e.jsx(Pi, {
                          className:
                            "absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400",
                        }),
                        e.jsx("input", {
                          type: "text",
                          placeholder:
                            "Cari tenant berdasarkan nama, domain atau email...",
                          value: V,
                          onChange: (Z) => ue(Z.target.value),
                          className:
                            "w-full pl-10 pr-4 py-2 border border-slate-200 rounded-lg text-xs font-sans text-slate-700 outline-none focus:ring-2 focus:ring-blue-500/25 transition-all",
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className: "flex items-center gap-2",
                      children: [
                        e.jsx("span", {
                          className:
                            "text-xs font-bold text-slate-500 font-mono",
                          children: "Filter Status:",
                        }),
                        e.jsxs("select", {
                          value: re,
                          onChange: (Z) => ee(Z.target.value),
                          className:
                            "bg-white border border-slate-200 rounded-lg text-xs font-semibold text-slate-700 p-2 outline-none focus:ring-2 focus:ring-blue-500/25 cursor-pointer",
                          children: [
                            e.jsx("option", {
                              value: "all",
                              children: "Semua Status",
                            }),
                            e.jsx("option", {
                              value: "pending",
                              children: "Butuh ACC (Pending)",
                            }),
                            e.jsx("option", {
                              value: "active",
                              children: "Aktif (Active)",
                            }),
                            e.jsx("option", {
                              value: "trial",
                              children: "Uji Coba (Trial)",
                            }),
                            e.jsx("option", {
                              value: "suspended",
                              children: "Ditangguhkan (Suspended)",
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
                B
                  ? e.jsx("div", {
                      className: "py-12 text-center text-slate-400 text-xs",
                      children: "Memuat data tenant platform...",
                    })
                  : bt.length === 0
                    ? e.jsx("div", {
                        className: "py-12 text-center text-slate-400 text-xs",
                        children:
                          "Tidak ada tenant terdaftar yang cocok dengan filter.",
                      })
                    : e.jsx("div", {
                        className: "overflow-x-auto",
                        children: e.jsxs("table", {
                          className:
                            "w-full text-left border-collapse font-sans",
                          children: [
                            e.jsx("thead", {
                              children: e.jsxs("tr", {
                                className:
                                  "bg-slate-50 text-slate-500 font-mono text-[10.5px] font-bold uppercase border-b border-slate-100",
                                children: [
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Tenant / Perusahaan",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Alamat Domain",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Kontak Owner",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Paket Core",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Status",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4",
                                    children: "Tanggal Daftar",
                                  }),
                                  e.jsx("th", {
                                    className: "p-4 text-right",
                                    children: "Aksi & Persetujuan (ACC)",
                                  }),
                                ],
                              }),
                            }),
                            e.jsx("tbody", {
                              className:
                                "divide-y divide-slate-150 text-slate-700",
                              children: bt.map((Z) =>
                                e.jsxs(
                                  "tr",
                                  {
                                    className:
                                      "hover:bg-slate-50/50 text-xs transition-colors",
                                    children: [
                                      e.jsx("td", {
                                        className: "p-4",
                                        children: e.jsxs("div", {
                                          className: "flex items-center gap-3",
                                          children: [
                                            e.jsx("img", {
                                              src: Z.logo,
                                              alt: "logo",
                                              className:
                                                "h-8 w-8 rounded-lg object-cover border border-slate-200",
                                            }),
                                            e.jsxs("div", {
                                              children: [
                                                e.jsx("h4", {
                                                  className:
                                                    "font-bold text-slate-900",
                                                  children: Z.company_name,
                                                }),
                                                e.jsxs("p", {
                                                  className:
                                                    "text-[10px] text-slate-450 font-mono",
                                                  children: ["ID: #", Z.id],
                                                }),
                                              ],
                                            }),
                                          ],
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className: "p-4",
                                        children: e.jsx("a", {
                                          href: `http://${Z.domain}`,
                                          target: "_blank",
                                          rel: "noreferrer",
                                          className:
                                            "text-blue-600 hover:underline font-semibold font-mono",
                                          children: Z.domain,
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className: "p-4",
                                        children: e.jsxs("div", {
                                          children: [
                                            e.jsx("p", {
                                              className:
                                                "font-semibold text-slate-800",
                                              children: Z.name,
                                            }),
                                            e.jsx("p", {
                                              className:
                                                "text-[10.5px] text-slate-500",
                                              children: Z.email,
                                            }),
                                            e.jsx("span", {
                                              className:
                                                "text-[10px] text-slate-400 font-mono",
                                              children: Z.phone,
                                            }),
                                          ],
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className: "p-4",
                                        children: e.jsx("div", {
                                          className:
                                            "flex items-center gap-1.5",
                                          children: e.jsxs("select", {
                                            value: Z.subscription_plan_id,
                                            onChange: (_e) =>
                                              C(Z.id, Number(_e.target.value)),
                                            className:
                                              "bg-transparent text-xs font-semibold text-slate-700 border border-slate-200 rounded p-1 outline-none cursor-pointer hover:bg-slate-100",
                                            children: [
                                              e.jsx("option", {
                                                value: 1,
                                                children: "Starter (100 k.)",
                                              }),
                                              e.jsx("option", {
                                                value: 2,
                                                children:
                                                  "Professional (1k k.)",
                                              }),
                                              e.jsx("option", {
                                                value: 3,
                                                children: "Enterprise (unlim)",
                                              }),
                                            ],
                                          }),
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className: "p-4",
                                        children: e.jsxs("select", {
                                          value: Z.status,
                                          onChange: (_e) =>
                                            g(Z.id, _e.target.value),
                                          className: `text-[11.5px] font-bold px-2 py-1 rounded-lg border outline-none cursor-pointer tracking-wider uppercase transition-all duration-150 ${Z.status === "pending" ? "bg-amber-50 text-amber-600 border-amber-200" : Z.status === "active" ? "bg-emerald-50 text-emerald-600 border-emerald-200 font-semibold" : Z.status === "trial" ? "bg-blue-50 text-blue-650 border-blue-200" : "bg-rose-50 text-rose-600 border-rose-200"}`,
                                          children: [
                                            e.jsx("option", {
                                              value: "pending",
                                              className:
                                                "text-slate-800 bg-white uppercase font-bold",
                                              children: "BUTUH ACC",
                                            }),
                                            e.jsx("option", {
                                              value: "active",
                                              className:
                                                "text-slate-800 bg-white uppercase font-bold",
                                              children: "AKTIF",
                                            }),
                                            e.jsx("option", {
                                              value: "trial",
                                              className:
                                                "text-slate-800 bg-white uppercase font-bold",
                                              children: "TRIAL",
                                            }),
                                            e.jsx("option", {
                                              value: "suspended",
                                              className:
                                                "text-slate-800 bg-white uppercase font-bold",
                                              children: "SUSPEND",
                                            }),
                                          ],
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className:
                                          "p-4 text-slate-500 font-mono text-[11px]",
                                        children: new Date(
                                          Z.created_at,
                                        ).toLocaleDateString("id-ID", {
                                          day: "2-digit",
                                          month: "short",
                                          year: "numeric",
                                        }),
                                      }),
                                      e.jsx("td", {
                                        className: "p-4 text-right",
                                        children: e.jsxs("div", {
                                          className: "flex justify-end gap-1.5",
                                          children: [
                                            Z.status === "pending" &&
                                              e.jsxs(e.Fragment, {
                                                children: [
                                                  e.jsxs("button", {
                                                    onClick: () =>
                                                      g(Z.id, "active"),
                                                    className:
                                                      "px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white font-bold rounded text-[11px] flex items-center gap-1 transition-all shadow-sm shadow-emerald-500/10 cursor-pointer",
                                                    title:
                                                      "Approve / Setujui Tenant",
                                                    children: [
                                                      e.jsx(ul, {
                                                        className: "h-3 w-3",
                                                      }),
                                                      e.jsx("span", {
                                                        children:
                                                          "Setujui (ACC)",
                                                      }),
                                                    ],
                                                  }),
                                                  e.jsx("button", {
                                                    onClick: () =>
                                                      g(Z.id, "suspended"),
                                                    className:
                                                      "px-2.5 py-1.5 bg-white border border-slate-200 hover:bg-rose-50 hover:text-rose-600 text-slate-600 font-bold rounded text-[11px] transition-all cursor-pointer",
                                                    title: "Tolak Pendaftaran",
                                                    children: e.jsx("span", {
                                                      children: "Tolak",
                                                    }),
                                                  }),
                                                ],
                                              }),
                                            Z.status === "active" &&
                                              e.jsx("button", {
                                                onClick: () =>
                                                  g(Z.id, "suspended"),
                                                className:
                                                  "px-2.5 py-1.5 bg-white border border-slate-200 text-rose-600 hover:bg-rose-50 font-bold rounded text-[11px] transition-all cursor-pointer",
                                                title: "Suspend Tenant",
                                                children: "Suspend",
                                              }),
                                            Z.status === "trial" &&
                                              e.jsx("button", {
                                                onClick: () =>
                                                  g(Z.id, "active"),
                                                className:
                                                  "px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white font-bold rounded text-[11px] transition-all cursor-pointer",
                                                title:
                                                  "Ubah ke Paket Pro Aktif",
                                                children: "Aktifkan Penuh",
                                              }),
                                            Z.status === "suspended" &&
                                              e.jsx("button", {
                                                onClick: () =>
                                                  g(Z.id, "active"),
                                                className:
                                                  "px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white font-bold rounded text-[11px] transition-all cursor-pointer",
                                                title:
                                                  "Aktifkan Kembali Tenant",
                                                children: "Pulihkan Tenant",
                                              }),
                                            e.jsxs("button", {
                                              onClick: () =>
                                                I(Z.id, Z.company_name),
                                              className:
                                                "px-2.5 py-1.5 bg-rose-50 hover:bg-rose-100 text-rose-600 hover:text-rose-700 font-bold rounded text-[11px] flex items-center gap-1 transition-all border border-rose-200 cursor-pointer",
                                              title: "Hapus Tenant Selamanya",
                                              children: [
                                                e.jsx(ms, {
                                                  className: "h-3 w-3 shrink-0",
                                                }),
                                                e.jsx("span", {
                                                  children: "Hapus",
                                                }),
                                              ],
                                            }),
                                          ],
                                        }),
                                      }),
                                    ],
                                  },
                                  Z.id,
                                ),
                              ),
                            }),
                          ],
                        }),
                      }),
                e.jsxs("div", {
                  className:
                    "mt-8 bg-blue-50/50 border border-blue-200/60 p-4.5 rounded-xl text-left",
                  children: [
                    e.jsxs("h4", {
                      className:
                        "text-xs font-bold text-slate-900 flex items-center gap-1.5",
                      children: [
                        e.jsx(ir, { className: "h-4 w-4 text-blue-600" }),
                        "Bagaimana Alur Pemantauan & ACC Tenant?",
                      ],
                    }),
                    e.jsxs("p", {
                      className:
                        "text-[11px] text-slate-600 leading-relaxed mt-1.5",
                      children: [
                        "Setiap kali penyedia ISP baru mengisi formulir pada halaman landing page (klik tombol ",
                        e.jsx("b", { children: '"Daftar 7 Hari Trial"' }),
                        "), sistem akan menampung pendaftaran mereka dengan status ",
                        e.jsx("b", { children: '"Butuh ACC"' }),
                        " atau ",
                        e.jsx("b", { children: '"Trial"' }),
                        ". Anda sebagai Pemilik Web memiliki otoritas penuh untuk meninjau data mereka, mengubah kuota batas pelanggan, dan mengklik ",
                        e.jsx("b", { children: '"Setujui (ACC)"' }),
                        " untuk langsung meluncurkan domain server mereka secara otomatis.",
                      ],
                    }),
                  ],
                }),
              ],
            }),
          S === "payment" &&
            e.jsxs("form", {
              onSubmit: X,
              className: "p-6 space-y-6",
              children: [
                e.jsxs("div", {
                  className:
                    "bg-slate-50 border border-slate-200 p-4 rounded-xl flex items-start gap-3",
                  children: [
                    e.jsx(sr, {
                      className: "h-5 w-5 text-blue-650 shrink-0 mt-0.5",
                    }),
                    e.jsxs("div", {
                      children: [
                        e.jsx("h4", {
                          className: "text-xs font-bold text-slate-800",
                          children: "Payment Gateway Pendaftaran (SaaS)",
                        }),
                        e.jsx("p", {
                          className: "text-xs text-slate-500 mt-1",
                          children:
                            "Atur kredensial gerbang pembayaran global yang digunakan untuk mengumpulkan biaya berlangganan bulanan / pendaftaran lisensi dari tenant ISP. Biaya pendaftaran ini akan masuk ke rekening/akun pemilik web.",
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
                  children: [
                    e.jsxs("div", {
                      className: "space-y-4",
                      children: [
                        e.jsxs("div", {
                          className: "space-y-2",
                          children: [
                            e.jsx("label", {
                              className: "text-xs font-bold text-slate-700",
                              children: "Metode Pembayaran Pendaftaran Utama",
                            }),
                            e.jsxs("select", {
                              value: O.active_gateway,
                              onChange: (Z) =>
                                P({ ...O, active_gateway: Z.target.value }),
                              className:
                                "w-full bg-white border border-slate-200 rounded-lg text-xs font-semibold p-2.5 outline-none focus:ring-2 focus:ring-blue-500/25 cursor-pointer",
                              children: [
                                e.jsx("option", {
                                  value: "midtrans",
                                  children: "Midtrans Gateway (Otomatis)",
                                }),
                                e.jsx("option", {
                                  value: "xendit",
                                  children: "Xendit Gateway (Otomatis)",
                                }),
                                e.jsx("option", {
                                  value: "bank_transfer",
                                  children: "Transfer Bank Manual (ACC Manual)",
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className: "space-y-2",
                          children: [
                            e.jsx("label", {
                              className: "text-xs font-bold text-slate-700",
                              children: "Environment Gateway",
                            }),
                            e.jsxs("div", {
                              className: "flex gap-4",
                              children: [
                                e.jsxs("label", {
                                  className:
                                    "flex items-center gap-2 cursor-pointer text-xs font-semibold text-slate-650",
                                  children: [
                                    e.jsx("input", {
                                      type: "radio",
                                      name: "environment",
                                      value: "sandbox",
                                      checked: O.environment === "sandbox",
                                      onChange: () =>
                                        P({ ...O, environment: "sandbox" }),
                                      className:
                                        "text-blue-600 focus:ring-blue-500",
                                    }),
                                    e.jsx("span", {
                                      children: "Sandbox (Testing Mode)",
                                    }),
                                  ],
                                }),
                                e.jsxs("label", {
                                  className:
                                    "flex items-center gap-2 cursor-pointer text-xs font-semibold text-slate-650",
                                  children: [
                                    e.jsx("input", {
                                      type: "radio",
                                      name: "environment",
                                      value: "production",
                                      checked: O.environment === "production",
                                      onChange: () =>
                                        P({ ...O, environment: "production" }),
                                      className:
                                        "text-blue-600 focus:ring-blue-500",
                                    }),
                                    e.jsx("span", {
                                      className: "text-red-650 font-bold",
                                      children: "Production (Live Real Money)",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "p-3 bg-slate-50 rounded-lg border border-slate-150 flex items-center justify-between",
                          children: [
                            e.jsxs("div", {
                              children: [
                                e.jsx("h5", {
                                  className: "text-xs font-bold text-slate-700",
                                  children: "Setujui Otomatis (Auto ACC)",
                                }),
                                e.jsx("p", {
                                  className: "text-[10.5px] text-slate-450",
                                  children:
                                    "Aktifkan server tenant langsung ketika invoice PG platform lunas.",
                                }),
                              ],
                            }),
                            e.jsx("input", {
                              type: "checkbox",
                              checked: O.auto_approve,
                              onChange: (Z) =>
                                P({ ...O, auto_approve: Z.target.checked }),
                              className:
                                "h-4 w-4 text-blue-600 border-slate-250 rounded focus:ring-blue-500 cursor-pointer",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "bg-slate-50/50 p-5 rounded-xl border border-slate-150 space-y-4",
                      children: [
                        O.active_gateway === "midtrans" &&
                          e.jsxs(e.Fragment, {
                            children: [
                              e.jsxs("h4", {
                                className:
                                  "text-xs font-bold text-slate-800 flex items-center gap-1.5",
                                children: [
                                  e.jsx(xc, {
                                    className: "h-4 w-4 text-amber-500",
                                  }),
                                  "Kredensial Midtrans Platform Owner",
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "text-[11px] font-bold text-slate-600",
                                    children: "Client Key",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    value: O.midtrans_client_key,
                                    onChange: (Z) =>
                                      P({
                                        ...O,
                                        midtrans_client_key: Z.target.value,
                                      }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs font-mono p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "text-[11px] font-bold text-slate-600",
                                        children: "Server Key (Private Secret)",
                                      }),
                                      e.jsx("button", {
                                        type: "button",
                                        onClick: () => ce(!F),
                                        className:
                                          "text-[10px] text-blue-600 font-bold hover:underline",
                                        children: F
                                          ? "Sembunyikan"
                                          : "Tampilkan",
                                      }),
                                    ],
                                  }),
                                  e.jsx("input", {
                                    type: F ? "text" : "password",
                                    value: O.midtrans_server_key,
                                    onChange: (Z) =>
                                      P({
                                        ...O,
                                        midtrans_server_key: Z.target.value,
                                      }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs font-mono p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        O.active_gateway === "xendit" &&
                          e.jsxs(e.Fragment, {
                            children: [
                              e.jsxs("h4", {
                                className:
                                  "text-xs font-bold text-slate-800 flex items-center gap-1.5",
                                children: [
                                  e.jsx(xc, {
                                    className: "h-4 w-4 text-blue-500",
                                  }),
                                  "Kredensial Xendit Platform Owner",
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center",
                                    children: [
                                      e.jsx("label", {
                                        className:
                                          "text-[11px] font-bold text-slate-600",
                                        children: "API Key (Private Token)",
                                      }),
                                      e.jsx("button", {
                                        type: "button",
                                        onClick: () => ce(!F),
                                        className:
                                          "text-[10px] text-blue-600 font-bold hover:underline",
                                        children: F
                                          ? "Sembunyikan"
                                          : "Tampilkan",
                                      }),
                                    ],
                                  }),
                                  e.jsx("input", {
                                    type: F ? "text" : "password",
                                    value: O.xendit_api_key,
                                    onChange: (Z) =>
                                      P({
                                        ...O,
                                        xendit_api_key: Z.target.value,
                                      }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs font-mono p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        O.active_gateway === "bank_transfer" &&
                          e.jsxs(e.Fragment, {
                            children: [
                              e.jsx("h4", {
                                className: "text-xs font-bold text-slate-800",
                                children:
                                  "Rekening Tujuan Transfer Manual Platform",
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "text-[11px] font-bold text-slate-600",
                                    children: "Nama Bank",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    placeholder:
                                      "contoh: Bank Mandiri atau Bank BCA",
                                    value: O.bank_name,
                                    onChange: (Z) =>
                                      P({ ...O, bank_name: Z.target.value }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "text-[11px] font-bold text-slate-600",
                                    children: "Nomor Rekening",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    placeholder:
                                      "Masukkan nomor rekening tujuan",
                                    value: O.bank_account_number,
                                    onChange: (Z) =>
                                      P({
                                        ...O,
                                        bank_account_number: Z.target.value,
                                      }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs font-mono p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "space-y-2",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "text-[11px] font-bold text-slate-600",
                                    children: "Nama Pemilik Rekening",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    placeholder:
                                      "Nama pemilik akun/rekening bank",
                                    value: O.bank_account_name,
                                    onChange: (Z) =>
                                      P({
                                        ...O,
                                        bank_account_name: Z.target.value,
                                      }),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-xs p-2.5 outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                            ],
                          }),
                      ],
                    }),
                  ],
                }),
                e.jsx("div", {
                  className: "flex justify-end pt-4 border-t border-slate-100",
                  children: e.jsx("button", {
                    type: "submit",
                    disabled: fe,
                    className:
                      "px-5 py-2.5 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-bold rounded-lg text-xs transition-all shadow-md shadow-blue-500/20 cursor-pointer flex items-center gap-2",
                    children: fe ? "Menyimpan..." : "Simpan Pengaturan Gateway",
                  }),
                }),
              ],
            }),
          S === "plans" &&
            e.jsxs("form", {
              onSubmit: at,
              className: "p-6",
              children: [
                e.jsxs("div", {
                  className:
                    "flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-4.5 bg-slate-50 p-4.5 border border-slate-200 rounded-lg text-left",
                  children: [
                    e.jsxs("div", {
                      children: [
                        e.jsx("h4", {
                          className: "text-xs font-bold text-slate-800",
                          children:
                            "Daftar & Konfigurasi Paket Penjualan Lisensi (SaaS Plans)",
                        }),
                        e.jsx("p", {
                          className: "text-[11.5px] text-slate-500 mt-1",
                          children:
                            "Atur batasan maksimal pelanggan CRM, router fisik, dan OLT yang boleh dikoneksikan oleh tenant ISP berdasarkan tagihan lisensi paket bulanan mereka.",
                        }),
                      ],
                    }),
                    e.jsx("button", {
                      type: "submit",
                      disabled: y,
                      className:
                        "px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-bold rounded-lg text-xs transition-all shadow-md shadow-blue-500/25 cursor-pointer flex items-center gap-1.5 shrink-0",
                      children: y
                        ? "Menyimpan..."
                        : "Simpan Semua Perubahan Paket",
                    }),
                  ],
                }),
                e.jsx("div", {
                  className: "grid grid-cols-1 md:grid-cols-3 gap-6 mt-6",
                  children: Ae.map((Z) => {
                    const _e = Z.id === 2,
                      Ze = Z.id === 3,
                      Xe = _e
                        ? "border-2 border-emerald-500 relative shadow-emerald-100 shadow-md"
                        : Ze
                          ? "border border-violet-300 shadow-violet-50/50 shadow-md"
                          : "border border-slate-200 text-slate-700 shadow-sm",
                      Ht = _e
                        ? "bg-emerald-50/70 border-b border-slate-200"
                        : Ze
                          ? "bg-violet-50/70 border-b border-slate-200"
                          : "bg-slate-50/50 border-b border-slate-200",
                      St = _e
                        ? "bg-emerald-100 text-emerald-700"
                        : Ze
                          ? "bg-violet-100 text-violet-750"
                          : "bg-blue-100 text-blue-700";
                    return e.jsxs(
                      "div",
                      {
                        className: `rounded-xl bg-white overflow-hidden hover:shadow-lg transition-all duration-300 ${Xe}`,
                        children: [
                          _e &&
                            e.jsx("div", {
                              className:
                                "absolute top-3 right-3 bg-emerald-500 text-white font-mono text-[9px] font-bold px-2 py-0.5 rounded-full uppercase tracking-wider",
                              children: "Terpopuler",
                            }),
                          e.jsxs("div", {
                            className: `p-4 text-center ${Ht}`,
                            children: [
                              e.jsxs("span", {
                                className: `px-2 py-0.5 rounded text-[10px] font-mono font-bold uppercase tracking-wide ${St}`,
                                children: ["PAKET LISENSI ", Z.id],
                              }),
                              e.jsxs("div", {
                                className: "mt-3",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "block text-[10px] uppercase font-bold text-slate-400 text-left mb-1",
                                    children: "Nama Paket",
                                  }),
                                  e.jsx("input", {
                                    type: "text",
                                    required: !0,
                                    value: Z.name,
                                    onChange: (E) =>
                                      ze(Z.id, "name", E.target.value),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg text-sm font-semibold p-1.5 text-center outline-none focus:ring-1 focus:ring-blue-500",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className: "mt-2.5",
                                children: [
                                  e.jsx("label", {
                                    className:
                                      "block text-[10px] uppercase font-bold text-slate-400 text-left mb-1",
                                    children: "Harga (Rupiah / Bulan)",
                                  }),
                                  e.jsxs("div", {
                                    className: "relative",
                                    children: [
                                      e.jsx("span", {
                                        className:
                                          "absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400 font-bold text-xs",
                                        children: "Rp",
                                      }),
                                      e.jsx("input", {
                                        type: "number",
                                        required: !0,
                                        min: "0",
                                        value: Z.monthly_price,
                                        onChange: (E) =>
                                          ze(
                                            Z.id,
                                            "monthly_price",
                                            Number(E.target.value),
                                          ),
                                        className:
                                          "w-full bg-white border border-slate-200 rounded-lg text-sm font-bold p-1.5 pl-8 text-right outline-none focus:ring-1 focus:ring-blue-500",
                                      }),
                                    ],
                                  }),
                                ],
                              }),
                            ],
                          }),
                          e.jsxs("div", {
                            className: "p-4 space-y-4 text-xs",
                            children: [
                              e.jsxs("div", {
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center mb-1",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-600 font-medium",
                                        children: "Maksimal Pelanggan CRM",
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[10px] font-bold text-slate-400",
                                        children: "Klien",
                                      }),
                                    ],
                                  }),
                                  e.jsx("input", {
                                    type: "number",
                                    required: !0,
                                    min: "1",
                                    value: Z.max_customers,
                                    onChange: (E) =>
                                      ze(
                                        Z.id,
                                        "max_customers",
                                        Number(E.target.value),
                                      ),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg p-1.5 font-bold text-slate-800 outline-none focus:ring-1 focus:ring-blue-500 text-right",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center mb-1",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-600 font-medium",
                                        children: "Maksimal Router Fisik",
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[10px] font-bold text-slate-400",
                                        children: "Router",
                                      }),
                                    ],
                                  }),
                                  e.jsx("input", {
                                    type: "number",
                                    required: !0,
                                    min: "1",
                                    value: Z.max_routers,
                                    onChange: (E) =>
                                      ze(
                                        Z.id,
                                        "max_routers",
                                        Number(E.target.value),
                                      ),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg p-1.5 font-bold text-slate-800 outline-none focus:ring-1 focus:ring-blue-500 text-right",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                children: [
                                  e.jsxs("div", {
                                    className:
                                      "flex justify-between items-center mb-1",
                                    children: [
                                      e.jsx("span", {
                                        className: "text-slate-600 font-medium",
                                        children: "Maksimal OLT GPON/EPON",
                                      }),
                                      e.jsx("span", {
                                        className:
                                          "text-[10px] font-bold text-slate-400",
                                        children: "Box OLT",
                                      }),
                                    ],
                                  }),
                                  e.jsx("input", {
                                    type: "number",
                                    required: !0,
                                    min: "1",
                                    value: Z.max_olts,
                                    onChange: (E) =>
                                      ze(
                                        Z.id,
                                        "max_olts",
                                        Number(E.target.value),
                                      ),
                                    className:
                                      "w-full bg-white border border-slate-200 rounded-lg p-1.5 font-bold text-slate-800 outline-none focus:ring-1 focus:ring-blue-500 text-right",
                                  }),
                                ],
                              }),
                              e.jsxs("div", {
                                className:
                                  "pt-3 border-t border-slate-100 flex justify-between text-[10.5px] text-slate-400",
                                children: [
                                  e.jsx("span", {
                                    children:
                                      "Layanan ACS TR-069 + Auto Provisioning",
                                  }),
                                  e.jsx("span", {
                                    className: "text-emerald-600 font-bold",
                                    children: "✓ Aktif",
                                  }),
                                ],
                              }),
                            ],
                          }),
                        ],
                      },
                      Z.id,
                    );
                  }),
                }),
                e.jsxs("div", {
                  className:
                    "mt-8 pt-4 border-t border-slate-155 flex justify-end gap-3",
                  children: [
                    e.jsx("button", {
                      type: "button",
                      onClick: () => z(),
                      className:
                        "px-4.5 py-2.5 bg-slate-100 hover:bg-slate-200 rounded-lg font-bold text-xs text-slate-700 transition-all cursor-pointer",
                      children: "Reset Perubahan",
                    }),
                    e.jsx("button", {
                      type: "submit",
                      disabled: y,
                      className:
                        "px-5 py-2.5 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-bold rounded-lg text-xs transition-all shadow-md shadow-blue-500/20 cursor-pointer flex items-center gap-2",
                      children: y ? "Menyimpan..." : "Simpan Perubahan Paket",
                    }),
                  ],
                }),
              ],
            }),
          S === "backup" &&
            e.jsxs("div", {
              className: "p-6 space-y-8",
              children: [
                e.jsx("div", {
                  className:
                    "bg-slate-50 p-5 border border-slate-200 rounded-xl text-left",
                  children: e.jsxs("div", {
                    className: "flex items-start gap-4",
                    children: [
                      e.jsx("div", {
                        className:
                          "p-3 bg-blue-50 rounded-lg border border-blue-200 text-blue-600",
                        children: e.jsx($n, {
                          className: "h-6 w-6",
                          strokeWidth: 1.75,
                        }),
                      }),
                      e.jsxs("div", {
                        children: [
                          e.jsx("h4", {
                            className:
                              "text-sm font-bold text-slate-900 font-sans",
                            children:
                              "Pusat Cadangan & Pemulihan Sistem (Disaster Recovery Control Room)",
                          }),
                          e.jsx("p", {
                            className:
                              "text-[12px] text-slate-500 mt-1 leading-relaxed",
                            children:
                              "Sebagai pemilik sistem (SaaS Web Owner), Anda memiliki hak akses penuh untuk melakukan pencadangan menyeluruh terhadap seluruh database platform Mikrobil (Data Tenant, Users, Pendaftaran, Transaksi, Konfigurasi Billing, data Router, data OLT, LOG, dsb.).",
                          }),
                          e.jsx("p", {
                            className:
                              "text-[11.5px] text-amber-600 font-semibold mt-1",
                            children:
                              "⚠️ PERINGATAN: Memulihkan dari data cadangan lama akan mengganti seluruh database saat ini secara permanen. Pastikan untuk membuat snapshot sebelum melanjutkan.",
                          }),
                        ],
                      }),
                    ],
                  }),
                }),
                e.jsxs("div", {
                  className: "grid grid-cols-1 md:grid-cols-2 gap-8",
                  children: [
                    e.jsxs("div", {
                      className:
                        "border border-slate-200 rounded-xl bg-white p-6 space-y-6 text-left shadow-sm",
                      children: [
                        e.jsxs("div", {
                          children: [
                            e.jsxs("h3", {
                              className:
                                "text-sm font-bold text-slate-800 flex items-center gap-2",
                              children: [
                                e.jsx(pc, {
                                  className: "h-4.5 w-4.5 text-blue-600",
                                }),
                                "Pencadangan Berkas Fisik (Export JSON)",
                              ],
                            }),
                            e.jsx("p", {
                              className: "text-[11.5px] text-slate-500 mt-1",
                              children:
                                "Download seluruh snapshot in-memory database server langsung ke komputer lokal Anda sebagai file enkapsulasi `.json`.",
                            }),
                          ],
                        }),
                        e.jsxs("button", {
                          type: "button",
                          onClick: pe,
                          disabled: Ye,
                          className:
                            "w-full py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-bold rounded-lg text-xs transition-all shadow-md shadow-blue-500/10 cursor-pointer flex items-center justify-center gap-2",
                          children: [
                            e.jsx(pc, { className: "h-4 w-4" }),
                            Ye
                              ? "Menyusun Berkas Cadangan..."
                              : "Unduh Cadangan Sistem Web (.json)",
                          ],
                        }),
                        e.jsxs("div", {
                          className:
                            "border-t border-dashed border-slate-200 pt-6",
                          children: [
                            e.jsxs("h3", {
                              className:
                                "text-sm font-bold text-slate-800 flex items-center gap-2 mb-2",
                              children: [
                                e.jsx(Cp, {
                                  className: "h-4.5 w-4.5 text-orange-600",
                                }),
                                "Buka & Pulihkan Berkas Fisik (Import JSON)",
                              ],
                            }),
                            e.jsx("p", {
                              className:
                                "text-[11.5px] text-slate-500 mb-4 font-sans leading-relaxed",
                              children:
                                "Unggah kembali file `.json` cadangan yang sebelumnya diunduh untuk memulihkan seluruh sistem platform seketika.",
                            }),
                            e.jsxs("div", {
                              className:
                                "border border-dashed border-slate-200 rounded-lg p-5 bg-slate-50 text-center relative hover:bg-slate-100 transition-all",
                              children: [
                                e.jsx("input", {
                                  type: "file",
                                  accept: ".json",
                                  onChange: he,
                                  disabled: Ie,
                                  className:
                                    "absolute inset-0 w-full h-full opacity-0 cursor-pointer",
                                }),
                                e.jsxs("div", {
                                  className: "flex flex-col items-center gap-2",
                                  children: [
                                    e.jsx("div", {
                                      className:
                                        "p-2 bg-white rounded-full border border-slate-200",
                                      children: e.jsx(Cp, {
                                        className: "h-5 w-5 text-slate-400",
                                      }),
                                    }),
                                    e.jsx("span", {
                                      className:
                                        "text-[11.5px] font-semibold text-slate-600",
                                      children: Ie
                                        ? "Membaca & Memulihkan Berkas..."
                                        : "Klik atau seret file cadangan (.json) ke sini",
                                    }),
                                    e.jsx("span", {
                                      className: "text-[10px] text-slate-400",
                                      children:
                                        "Hanya menerima format JSON cadangan Mikrobil",
                                    }),
                                  ],
                                }),
                              ],
                            }),
                            Oe &&
                              e.jsx("div", {
                                className:
                                  "mt-3 p-3 bg-red-50 border border-red-200 text-red-600 rounded-lg text-xs font-semibold leading-relaxed",
                                children: Oe,
                              }),
                          ],
                        }),
                      ],
                    }),
                    e.jsxs("div", {
                      className:
                        "border border-slate-200 rounded-xl bg-white p-6 space-y-6 text-left shadow-sm",
                      children: [
                        e.jsxs("div", {
                          children: [
                            e.jsxs("h3", {
                              className:
                                "text-sm font-bold text-slate-800 flex items-center gap-2",
                              children: [
                                e.jsx(kp, {
                                  className: "h-4.5 w-4.5 text-emerald-600",
                                  strokeWidth: 2.25,
                                }),
                                "Buat Restore Point Instan (Snapshot)",
                              ],
                            }),
                            e.jsx("p", {
                              className: "text-[11.5px] text-slate-500 mt-1",
                              children:
                                "Simpan salinan database ke dalam memori server untuk pengujian aman. Anda dapat membatalkan semua eksperimen berisiko dengan mengembalikan ke titik ini instantly.",
                            }),
                          ],
                        }),
                        e.jsxs("form", {
                          onSubmit: Ne,
                          className:
                            "space-y-3 p-4 bg-slate-50 border border-slate-200 rounded-lg",
                          children: [
                            e.jsxs("div", {
                              children: [
                                e.jsx("label", {
                                  className:
                                    "block text-[10px] uppercase font-bold text-slate-400 mb-1",
                                  children: "Nama Restore Point / Label",
                                }),
                                e.jsx("input", {
                                  type: "text",
                                  required: !0,
                                  placeholder:
                                    "Contoh: Sebelum Uji Coba Integrasi API Xendit",
                                  value: le,
                                  onChange: (Z) => ie(Z.target.value),
                                  className:
                                    "w-full bg-white border border-slate-200 rounded-lg text-xs font-semibold p-2 outline-none focus:ring-1 focus:ring-blue-500 text-left text-slate-800",
                                }),
                              ],
                            }),
                            e.jsxs("div", {
                              children: [
                                e.jsx("label", {
                                  className:
                                    "block text-[10px] uppercase font-bold text-slate-400 mb-1",
                                  children: "Catatan Tambahan (Opsional)",
                                }),
                                e.jsx("textarea", {
                                  placeholder:
                                    "Tulis alasan backup, misalnya: Menjaga data user lama aman...",
                                  value: $,
                                  onChange: (Z) => de(Z.target.value),
                                  rows: 2,
                                  className:
                                    "w-full bg-white border border-slate-200 rounded-lg text-xs p-2 outline-none focus:ring-1 focus:ring-blue-500 text-left text-slate-750",
                                }),
                              ],
                            }),
                            e.jsxs("button", {
                              type: "submit",
                              disabled: oe || !le.trim(),
                              className:
                                "w-full py-2 bg-emerald-600 hover:bg-emerald-700 disabled:bg-emerald-400 text-white font-bold rounded-lg text-xs transition-all cursor-pointer flex items-center justify-center gap-1.5",
                              children: [
                                e.jsx(jn, { className: "h-3.5 w-3.5" }),
                                oe
                                  ? "Memproses Snapshot..."
                                  : "Simpan Restore Point Instan",
                              ],
                            }),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
                e.jsxs("div", {
                  className:
                    "border border-slate-200 rounded-xl bg-white overflow-hidden text-left shadow-sm",
                  children: [
                    e.jsxs("div", {
                      className:
                        "bg-slate-50 p-4 border-b border-slate-200 flex items-center justify-between",
                      children: [
                        e.jsxs("span", {
                          className:
                            "text-xs font-bold text-slate-800 uppercase tracking-wide flex items-center gap-2",
                          children: [
                            e.jsx(kp, {
                              className: "h-4.5 w-4.5 text-blue-600",
                            }),
                            "Daftar Titik Pemulihan Server (Restore Point Snapshots)",
                          ],
                        }),
                        e.jsxs("button", {
                          type: "button",
                          onClick: () => z(),
                          className:
                            "p-1 px-2.5 rounded bg-white hover:bg-slate-100 border border-slate-200 text-[10.5px] font-bold text-slate-600 cursor-pointer flex items-center gap-1",
                          children: [
                            e.jsx(Va, { className: "h-3 w-3" }),
                            "Segarkan List",
                          ],
                        }),
                      ],
                    }),
                    e.jsx("div", {
                      className: "overflow-x-auto max-h-[350px]",
                      children: e.jsxs("table", {
                        className: "w-full border-collapse",
                        children: [
                          e.jsx("thead", {
                            children: e.jsxs("tr", {
                              className:
                                "bg-slate-50 border-b border-slate-200 text-[10px] uppercase font-bold text-slate-400 font-sans tracking-wider text-left",
                              children: [
                                e.jsx("th", {
                                  className: "py-2.5 px-4 text-center w-12",
                                  children: "ID",
                                }),
                                e.jsx("th", {
                                  className: "py-2.5 px-4",
                                  children: "Nama Point / Snapshot",
                                }),
                                e.jsx("th", {
                                  className: "py-2.5 px-4 text-center",
                                  children: "Tgl Dibuat",
                                }),
                                e.jsx("th", {
                                  className: "py-2.5 px-4 text-center",
                                  children: "Kapasitas",
                                }),
                                e.jsx("th", {
                                  className: "py-2.5 px-4 text-center",
                                  children: "Aktif Tenant",
                                }),
                                e.jsx("th", {
                                  className: "py-2.5 px-4 w-44 text-right",
                                  children: "Aksi Tindakan Pelaksana",
                                }),
                              ],
                            }),
                          }),
                          e.jsx("tbody", {
                            children:
                              Ee.length === 0
                                ? e.jsx("tr", {
                                    children: e.jsx("td", {
                                      colSpan: 6,
                                      className:
                                        "py-10 text-center text-slate-400 text-xs",
                                      children:
                                        "Belum ada restore point yang disimpan dalam server in-memory database.",
                                    }),
                                  })
                                : Ee.map((Z) =>
                                    e.jsxs(
                                      "tr",
                                      {
                                        className:
                                          "border-b last:border-0 border-slate-100 hover:bg-slate-50/50 text-[11.5px] text-slate-700",
                                        children: [
                                          e.jsx("td", {
                                            className:
                                              "py-3 px-4 font-mono font-bold text-center text-slate-400",
                                            children: Z.id,
                                          }),
                                          e.jsxs("td", {
                                            className: "py-3 px-4",
                                            children: [
                                              e.jsx("span", {
                                                className:
                                                  "font-bold text-slate-800 block text-[12px]",
                                                children: Z.name,
                                              }),
                                              e.jsx("span", {
                                                className:
                                                  "text-[10px] text-slate-400 mt-0.5 block",
                                                children:
                                                  Z.note ||
                                                  "Tidak ada catatan tambahan.",
                                              }),
                                            ],
                                          }),
                                          e.jsx("td", {
                                            className:
                                              "py-3 px-4 text-center text-slate-500 font-mono",
                                            children: new Date(
                                              Z.created_at,
                                            ).toLocaleString("id-ID", {
                                              day: "2-digit",
                                              month: "short",
                                              year: "numeric",
                                              hour: "2-digit",
                                              minute: "2-digit",
                                            }),
                                          }),
                                          e.jsx("td", {
                                            className:
                                              "py-3 px-4 text-center text-slate-600 font-mono font-semibold",
                                            children: Z.size,
                                          }),
                                          e.jsx("td", {
                                            className: "py-3 px-4 text-center",
                                            children: e.jsxs("span", {
                                              className:
                                                "bg-slate-100 border border-slate-200 text-slate-700 px-2 py-0.5 rounded text-[10px] font-mono font-bold",
                                              children: [
                                                Z.tenant_count || "4",
                                                " Tenant",
                                              ],
                                            }),
                                          }),
                                          e.jsxs("td", {
                                            className:
                                              "py-3 px-4 text-right space-x-2",
                                            children: [
                                              e.jsx("button", {
                                                type: "button",
                                                onClick: () => $e(Z.id, Z.name),
                                                className:
                                                  "px-3 py-1 bg-emerald-50 hover:bg-emerald-100 border border-emerald-300 text-emerald-700 font-bold rounded text-[10.5px] cursor-pointer transition-all",
                                                children: "Restore",
                                              }),
                                              e.jsx("button", {
                                                type: "button",
                                                disabled: !1,
                                                onClick: () => ae(Z.id),
                                                className:
                                                  "px-2 py-1 bg-red-50 hover:bg-red-100 border border-red-200 hover:border-red-300 text-red-600 font-bold rounded text-[10.5px] disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer transition-all inline-flex items-center justify-center align-middle",
                                                children: e.jsx(ms, {
                                                  className: "h-3 w-3",
                                                }),
                                              }),
                                            ],
                                          }),
                                        ],
                                      },
                                      Z.id,
                                    ),
                                  ),
                          }),
                        ],
                      }),
                    }),
                  ],
                }),
              ],
            }),
        ],
      }),
    ],
  });
}
function Bg() {
  const [w, J] = f.useState("landing"),
    [S, b] = f.useState("dashboard"),
    [V, ue] = f.useState(!1),
    [re, ee] = f.useState(null),
    [B, T] = f.useState("Owner"),
    [fe, G] = f.useState([]),
    [F, ce] = f.useState(0),
    ve = async () => {
      try {
        const $ = await (await fetch("/api/v1/dashboard/overview")).json();
        if ($.status === "success") {
          const de = $.data.active_alerts || [];
          (G(de), ce(de.length));
        }
      } catch (ie) {
        console.error(ie);
      }
    };
  f.useEffect(() => {
    ve();
    const ie = setInterval(() => {
      ve();
    }, 15e3);
    return () => clearInterval(ie);
  }, []);
  const Y = (ie) => {
      switch (ie) {
        case 1:
          return "saas_admin";
        case 2:
          return "Owner";
        case 3:
          return "Admin";
        case 4:
          return "Finance";
        case 5:
          return "NOC";
        case 6:
          return "Technician";
        default:
          return "Technician";
      }
    },
    Ee = (ie) => {
      var de;
      ee(ie);
      const $ = Y(
        (de = ie == null ? void 0 : ie.user) == null ? void 0 : de.role_id,
      );
      (T($), J("app"), b($ === "saas_admin" ? "saas_admin" : "dashboard"));
    },
    Se = () => {
      (ee(null), J("landing"));
    },
    le = () => {
      (ee({
        token: "demo-token",
        user: { name: "Budi Gunawan", email: "admin@jayanet.com", role_id: 2 },
        tenant: { name: "Jaya Net", company_name: "PT Jaya Solusi Network" },
      }),
        T("Owner"),
        J("app"),
        b("dashboard"));
    };
  return e.jsxs("div", {
    id: "application-root",
    className: "min-h-screen bg-slate-950 text-slate-800 antialiased font-sans",
    children: [
      w === "landing" &&
        e.jsx(bg, {
          onLogin: () => J("login"),
          onRegister: () => J("register"),
          onEnterDemo: le,
        }),
      (w === "login" || w === "register") &&
        e.jsx(vg, {
          initialMode: w,
          onBack: () => J("landing"),
          onSuccess: Ee,
        }),
      w === "app" &&
        e.jsxs("div", {
          className: "flex h-screen overflow-hidden bg-slate-50 font-sans",
          children: [
            B === "Customer"
              ? e.jsxs("div", {
                  className: "flex-1 overflow-y-auto custom-scroll",
                  children: [
                    e.jsxs("div", {
                      id: "sim-back-banner",
                      className:
                        "bg-amber-500 text-slate-950 font-bold p-2.5 text-center text-xs flex justify-between items-center px-6 border-b border-amber-600 select-none",
                      children: [
                        e.jsx("span", {
                          children:
                            "Simulator: Anda melihat tampilan portal mandiri pelanggan. Gunakan menu dropdown di sebelah kanan atas untuk kembali ke Panel Operator.",
                        }),
                        e.jsxs("select", {
                          value: B,
                          onChange: (ie) => T(ie.target.value),
                          className:
                            "bg-slate-950 text-white font-semibold rounded text-[11px] p-1 font-sans cursor-pointer outline-none ml-4",
                          children: [
                            e.jsx("option", {
                              value: "Customer",
                              children: "Simulate: Klien",
                            }),
                            e.jsx("option", {
                              value: "Owner",
                              children: "Simulate: Owner",
                            }),
                            e.jsx("option", {
                              value: "NOC",
                              children: "Simulate: NOC Staf",
                            }),
                            e.jsx("option", {
                              value: "Admin",
                              children: "Simulate: Administrator",
                            }),
                          ],
                        }),
                      ],
                    }),
                    e.jsx(Eg, { onLogout: Se }),
                  ],
                })
              : e.jsxs(e.Fragment, {
                  children: [
                    e.jsx(fg, {
                      currentView: S,
                      setView: b,
                      activeRole: B,
                      isOpen: V,
                      onClose: () => ue(!1),
                    }),
                    V &&
                      e.jsx("div", {
                        onClick: () => ue(!1),
                        className:
                          "fixed inset-0 bg-slate-950/50 backdrop-blur-xs z-40 md:hidden",
                      }),
                    e.jsxs("div", {
                      className:
                        "flex-1 flex flex-col min-w-0 overflow-hidden bg-slate-50",
                      children: [
                        e.jsx(gg, {
                          activeRole: B,
                          setActiveRole: (ie) => {
                            (T(ie),
                              ie === "Customer"
                                ? b("customer-portal")
                                : ie === "saas_admin"
                                  ? b("saas_admin")
                                  : (S === "saas_admin" ||
                                      S === "customer-portal") &&
                                    b("dashboard"));
                          },
                          onLogout: Se,
                          alerts: fe,
                          unreadCount: F,
                          onToggleSidebar: () => ue(!0),
                          userSession: re,
                        }),
                        e.jsxs("div", {
                          className:
                            "flex-1 overflow-y-auto custom-scroll p-6 bg-slate-50 relative",
                          children: [
                            S === "dashboard" && e.jsx(yg, { activeRole: B }),
                            S === "analytics" && e.jsx(Pg, { activeRole: B }),
                            S === "customers" && e.jsx(jg, { activeRole: B }),
                            S === "billing" && e.jsx(Ng, { activeRole: B }),
                            S === "internet" && e.jsx(_g, { activeRole: B }),
                            S === "resellers" && e.jsx(Og, { activeRole: B }),
                            S === "network" && e.jsx(Cg, { activeRole: B }),
                            S === "support" && e.jsx(Ag, { activeRole: B }),
                            S === "comms" && e.jsx(Mg, { activeRole: B }),
                            S === "settings" && e.jsx(Lg, { activeRole: B }),
                            S === "ai_local" && e.jsx(Rg, { activeRole: B }),
                            S === "saas_admin" && e.jsx(zg, {}),
                          ],
                        }),
                      ],
                    }),
                  ],
                }),
            B !== "Customer" && e.jsx(Dg, {}),
          ],
        }),
    ],
  });
}
uf.createRoot(document.getElementById("root")).render(
  e.jsx(f.StrictMode, { children: e.jsx(Bg, {}) }),
);
